重复车架处理调试7

master
zcstatham 2 years ago
parent be2b115534
commit 5af70da53d
  1. 2
      app/controller/Task.php
  2. 24
      app/view/repeat/index.html
  3. 1
      app/view/task/index.html
  4. 20
      extend/service/CarInfoHandle.php

@ -135,7 +135,7 @@ class Task extends BaseController
$this->json_data['code'] = 0;
$this->json_data['msg'] = '请先填写注册日期';
return json($this->json_data);
} else if ($type == 2 && isset($params['export_type']) && $params['export_type'] != '' && !in_array($params['export_type'], ['bhx', 'bmc', 'failed', 'repeat', 'failed_bmc', 'none_bmc', 'success_bmc'])) {
} else if ($type == 2 && isset($params['export_type']) && $params['export_type'] != '' && !in_array($params['export_type'], ['bhx', 'bmc', 'failed', 'repeat', 'failed_bmc', 'none_bmc', 'success_bmc', 'repeat_delete'])) {
$this->json_data['code'] = 0;
$this->json_data['msg'] = '导出类型错误,请选择正确的导出类型';
return json($this->json_data);

@ -4,6 +4,25 @@
.layui-table-cell {
padding: 0 5px;
}
.layui-input, .layui-select, .layui-textarea {
height: 28px;
}
.layui-input-block {
height: 28px;
min-height: auto;
}
.layui-form-label {
padding: 4px 15px;
}
.layui-form-item {
margin-bottom: 4px;
}
.layui-form-mid {
padding: 0 !important;
}
.layui-table td, .layui-table th {
padding: 0 15px;
}
</style>
{/block}
{block name="body"}
@ -118,6 +137,11 @@
class="layui-input" value="{$params.tag | default=''}">
</div>
</div>
<div class="layui-form-item layui-col-md12" style="clear: none;">
<div class="layui-input-block layui-text-right" id="tool-bar">
<button type="button" class="layui-btn" id="search-btn">搜索</button>
</div>
</div>
</div>
</div>
<div class="layui-card-body layui-form">

@ -73,6 +73,7 @@
<input type="radio" lay-filter="export_type" name="export_type" value="failed" class="layui-input" title="清洗失败">
<input type="radio" lay-filter="export_type" name="export_type" value="bmc" class="layui-input" title="清洗成功至上传">
<input type="radio" lay-filter="export_type" name="export_type" value="success_bmc" class="layui-input" title="清洗成功再次清洗">
<input type="radio" lay-filter="export_type" name="export_type" value="repeat_delete" class="layui-input" title="重复删除车架">
<!-- <input type="radio" lay-filter="export_type" name="export_type" value="failed_bmc" class="layui-input" title="导出清洗失败至上传">
<input type="radio" lay-filter="export_type" name="export_type" value="none_bmc" class="layui-input" title="导出未处理至上传">
-->

@ -144,7 +144,15 @@ class CarInfoHandle
if (count($map_or2) > 0) {
$map_or2 = array_merge([['car_info_t.insurer1_date', '=', ''], ['car_info_t.insurer2_date', '<>', '']], $map_or2);
}
$query = CarInfoT::where(empty($where) ? 1:$where)->where(function ($query) use ($map_or1, $map_or2) {
if ($data['export_type'] == 'repeat_delete')
$query = Db::table('repeat_data_t')->alias('car_info_t')->where(empty($where) ? 1:$where)
->where(function ($query) use ($map_or1, $map_or2) {
if (count($map_or1) > 0 && count($map_or2) > 0) {
$query->whereOr([$map_or1, $map_or2]);
}
});
else
$query = CarInfoT::where(empty($where) ? 1:$where)->where(function ($query) use ($map_or1, $map_or2) {
if (count($map_or1) > 0 && count($map_or2) > 0) {
$query->whereOr([$map_or1, $map_or2]);
}
@ -160,7 +168,7 @@ class CarInfoHandle
->where('car_info_t.car_number', 'REGEXP', '^[1-9][[:digit:]]{7}((0[[:digit:]])|(1[0-2]))(([0|1|2][[:digit:]])|3[0-1])[[:digit:]]{3}$|^[1-9][[:digit:]]{5}[1-9][[:digit:]]{3}((0[[:digit:]])|(1[0-2]))(([0|1|2][[:digit:]])|3[0-1])[[:digit:]]{3}([0-9]|X)$')
->field('car_info_t.*')->order('car_info_t.id asc');
}
}else {
}elseif ($data['export_type'] != 'repeat_delete') {
$query = $query->order('car_info_t.id asc');
}
$count = $query->count();
@ -701,7 +709,7 @@ class CarInfoHandle
}
if($export_limit != 0 && $export_type == 'success_bmc'){
CarInfoT::where('id', 'in', $ids)->update(['is_export_bmc' => 0]);
} else if($export_limit != 0) {
} else if($export_limit != 0 && $export_type == 'repeat_delete') {
CarInfoT::where('id', 'in', $ids)->update(['is_export_' . $export_type => $id]);
}
} else {
@ -719,7 +727,7 @@ class CarInfoHandle
}
if($export_limit != 0 && $export_type == 'success_bmc'){
CarInfoT::where('id', 'in', $ids)->update(['is_export_bmc' => 0]);
} else if($export_limit != 0) {
} else if($export_limit != 0 && $export_type == 'repeat_delete') {
CarInfoT::where('id', 'in', $ids)->update(['is_export_' . $export_type => $id]);
}
$limit -= 3000;
@ -757,8 +765,8 @@ class CarInfoHandle
$bhxFields = ['car_no', 'car_frame_no'];
}
$bmcFields = ['register_date', 'car_no', 'car_frame_no', 'engine_no', 'factory_model', 'car_year', 'displacement', 'car_man', 'car_number', 'car_phone', 'purchase_price', 'id_man', 'id_number', 'id_phone', 'insured_man', 'insured_number', 'insured_phone', 'company', 'insurer1_date', 'insurer2_date', 'insurer_type', 'linkman', 'linkphone', 'linkman', 'linkphone', 'linkman', 'linkphone'];
$titles = in_array($export_type, ['bmc','failed_bmc','none_bmc']) ? $bmcTitles : ($export_type == 'repeat' ? $orgTitles : $bhxTitles);
$fields = in_array($export_type, ['bmc','failed_bmc','none_bmc']) ? $bmcFields : ($export_type == 'repeat' ? $orgFields : $bhxFields);
$titles = in_array($export_type, ['bmc','failed_bmc','none_bmc']) ? $bmcTitles : ($export_type == 'repeat' || $export_type == 'repeat_delete' ? $orgTitles : $bhxTitles);
$fields = in_array($export_type, ['bmc','failed_bmc','none_bmc']) ? $bmcFields : ($export_type == 'repeat' || $export_type == 'repeat_delete' ? $orgFields : $bhxFields);
return [$titles, $fields];
}

Loading…
Cancel
Save