|
@@ -1,5 +1,6 @@
|
|
|
package com.zfire.jiasm.syncdata.download.order.repair;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.zfire.jiasm.syncdata.base.BaseService;
|
|
|
import com.zfire.jiasm.syncdata.constant.OrderStatusEnum;
|
|
@@ -78,9 +79,8 @@ public class RepairBusiness {
|
|
|
@Resource
|
|
|
ItfTblAssignAppointmentDownloadService itfTblAssignAppointmentDownloadService;
|
|
|
@Resource
|
|
|
- CustomerInformationWebsitService customerInformationWebsitService;
|
|
|
- @Resource
|
|
|
- WebsitOrderSignService websitOrderSignService;
|
|
|
+ OrderRepairDetailService orderRepairDetailService;
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -139,10 +139,25 @@ public class RepairBusiness {
|
|
|
// 修改
|
|
|
log.info("修改:");
|
|
|
|
|
|
-
|
|
|
+ // TL_SynDataFrom_tbl_assign_batch
|
|
|
+ // TL_SynDataFrom_tbl_assign 主单的 syn_req_id
|
|
|
// 处理维修工单主表数据
|
|
|
modifyOrderBase(brand, sysDictRefDLMap, item);
|
|
|
|
|
|
+ OrderBase order = orderBaseService.lambdaQuery()
|
|
|
+ .eq(OrderBase::getPgid, item.getPgid())
|
|
|
+ .eq(OrderBase::getOrderType, OrderTypeEnum.ORDER_TYPE_REPAIR.getCode()).one();
|
|
|
+
|
|
|
+ // 工单师傅信息更新
|
|
|
+ upOrderWorker(order);
|
|
|
+ // 工单扩展信息更新
|
|
|
+ getOrderInstall(item, order);
|
|
|
+
|
|
|
+
|
|
|
+ // 维修单明细表更新 TL_SynDataFrom_tbl_assign_mx
|
|
|
+ generateMxUpdate(brand, item, order, sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
} else {
|
|
|
// 新增
|
|
@@ -160,13 +175,41 @@ public class RepairBusiness {
|
|
|
log.info("维修工单落本地表处理完成: {}",sdf.format(new Date()));
|
|
|
}
|
|
|
|
|
|
+ private void upOrderWorker(OrderBase order) {
|
|
|
+ if (StringUtils.isEmpty(order.getWorkerName())){
|
|
|
+ // 清理师傅表
|
|
|
+ publicService.deleteWorker(order.getId());
|
|
|
+ } else {
|
|
|
+ // 提取现有的师傅信息
|
|
|
+ List<OrderWorker> ows = publicService.getWorker(order.getWorkerId(), order.getId());
|
|
|
+ // 看是工单师傅是否在内,如不在内说明重新指派了师傅
|
|
|
+ Boolean flag = Boolean.FALSE;
|
|
|
+ for (OrderWorker ow :ows){
|
|
|
+ if (ow.getWorkerId().equals(order.getWorkerId())){
|
|
|
+ flag = Boolean.TRUE;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!flag){
|
|
|
+ // 清理师傅表,重新生新新师傅数据
|
|
|
+ if (ows !=null && ows.size()>0){
|
|
|
+ publicService.deleteWorker(order.getId());
|
|
|
+ }
|
|
|
+ publicService.getOrderWorker(order);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void modifyOrderBase(Brand brand, Map<String, List<SysDictRef>> sysDictRefDLMap, ItfTblAssignDownload item) {
|
|
|
+ String orderStatus="";
|
|
|
+ Integer cjDowFlag=0;
|
|
|
// TL_SynDataFrom_tbl_assign_batch
|
|
|
// TL_SynDataFrom_tbl_assign 主单的 syn_req_id
|
|
|
// 提取基础表数据
|
|
|
OrderBase oldOrder = orderBaseService.lambdaQuery()
|
|
|
.eq(OrderBase::getPgid, item.getPgid())
|
|
|
.eq(OrderBase::getOrderType, OrderTypeEnum.ORDER_TYPE_REPAIR.getCode()).one();
|
|
|
+ orderStatus = oldOrder.getOrderStatus();
|
|
|
+ cjDowFlag = oldOrder.getOutCjDownloadFlag();
|
|
|
// 批量关闭的工单 同步下载无需再修改
|
|
|
if (oldOrder.getOrderStatus().equals(OrderStatusEnum.REPAIR_STATUS_R13.getCode())){
|
|
|
upItfTblAssignDownload(item.getSynReqId(),99,"last_modified_by = CLIENT__autoapp 本地已作废/关闭,忽略下载处理");
|
|
@@ -175,22 +218,155 @@ public class RepairBusiness {
|
|
|
// 基础表数据同步 总部的修改时间必须晚于本地系统时间才可以修改
|
|
|
if (item.getLastModifiedDate().compareTo(oldOrder.getUpdateTime())>0){
|
|
|
upOrderBase(brand, item, oldOrder.getId());
|
|
|
+ oldOrder = orderBaseService.lambdaQuery()
|
|
|
+ .eq(OrderBase::getPgid, item.getPgid())
|
|
|
+ .eq(OrderBase::getOrderType, OrderTypeEnum.ORDER_TYPE_REPAIR.getCode()).one();
|
|
|
}
|
|
|
// 网点信息更新
|
|
|
updateWebsit(brand, sysDictRefDLMap, item, oldOrder);
|
|
|
- // 预约时间信息更新 如何判断工单已预约 首次预约人信息不为空即为已预约
|
|
|
- if (StringUtils.isEmpty(oldOrder.getFirstAppointmentId())){
|
|
|
+ // 用户期望上门时间信息更新
|
|
|
+ updateYhqwsmsj(item, oldOrder);
|
|
|
+ // 状态信息更新
|
|
|
+ upOrderStatus(brand, item, oldOrder);
|
|
|
+ // 更新 工单机型
|
|
|
+ upOrderProduct(oldOrder);
|
|
|
+ // 更新 维修数据采集表
|
|
|
+ upOrderRepairDetail(oldOrder);
|
|
|
+ // 生成改派申请数据
|
|
|
+ if (oldOrder.getOrderStatus().equals("B5")){
|
|
|
+ generateDispatch(oldOrder);
|
|
|
+ }
|
|
|
+ // 修改工单改派申请表
|
|
|
+ upOrderApplyDispatch(item, orderStatus, oldOrder);
|
|
|
|
|
|
+ // 增加判断是否有未处理的待改派,如果广佛有待改派但总部工单不是待改派,直接更新改派标志
|
|
|
+ // 无删除标识,暂不处理
|
|
|
|
|
|
+ // 增加处理采集数据下载 新增不用操作
|
|
|
+ if ((oldOrder.getOrderStatus().equals("B41") || oldOrder.getOrderStatus().equals("B102")) && cjDowFlag ==0){
|
|
|
+ List<OrderRepairDetail> ords = orderRepairDetailService.lambdaQuery()
|
|
|
+ .eq(OrderRepairDetail::getOrderBaseId,oldOrder.getId())
|
|
|
+ .ne(OrderRepairDetail::getStatus,0).list();
|
|
|
+ // 已存在状态为"已采集"的记录暂时忽略下载
|
|
|
+ if (!(ords !=null && ords.size()>0)){
|
|
|
+ // 清除待采集数据
|
|
|
+ delOrderRepairDetail(oldOrder);
|
|
|
+ // 向表内写数据,另起任务下载数据
|
|
|
+
|
|
|
+ // 修改基础表已采集下载标识
|
|
|
+ OrderBase up = new OrderBase();
|
|
|
+ up.setId(oldOrder.getId());
|
|
|
+ up.setOutCjDownloadFlag(1);
|
|
|
+ orderBaseService.updateById(up);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 如果是家用的工单,且工单状态是待中心派工或待网点派工时,写入派嘉讯茂 暂停 todo
|
|
|
|
|
|
+ // 修改同步状态
|
|
|
+ upItfTblAssignDownloadStatus(item, oldOrder);
|
|
|
+ }
|
|
|
|
|
|
+ private void delOrderRepairDetail(OrderBase oldOrder) {
|
|
|
+ QueryWrapper dWrapper = new QueryWrapper<OrderRepairDetail>()
|
|
|
+ .eq("order_base_id", oldOrder.getId())
|
|
|
+ .eq("status",0);
|
|
|
+ orderRepairDetailService.remove(dWrapper);
|
|
|
+ }
|
|
|
|
|
|
+ private void upOrderApplyDispatch(ItfTblAssignDownload item, String orderStatus, OrderBase oldOrder) {
|
|
|
+ // 原 本地维修单表状态为5 待审批 同步过来的工单状态不是待审批时
|
|
|
+ // 修改工单改派申请 自动审核 新增时条件不成立的
|
|
|
+ if (orderStatus.equals(OrderStatusEnum.REPAIR_STATUS_R5.getCode()) && !item.getStat().equals(5L)){
|
|
|
+ OrderApplyDispatch oad = new OrderApplyDispatch();
|
|
|
+ oad.setExamineId("system");
|
|
|
+ oad.setExamineName("接口自动审核");
|
|
|
+ oad.setExamineStatus("OK");
|
|
|
+ oad.setExamineTime(new Date());
|
|
|
+ QueryWrapper upWrapper = new QueryWrapper<OrderApplyDispatch>()
|
|
|
+ .eq("order_base_id", oldOrder.getId())
|
|
|
+ .eq("examine_status","WAIT");
|
|
|
+ orderApplyDispatchService.update(oad,upWrapper);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
+ private void upOrderRepairDetail(OrderBase oldOrder) {
|
|
|
+ OrderRepairDetail ord = new OrderRepairDetail();
|
|
|
+ ord.setInstallWebsitId(oldOrder.getWebsitId());
|
|
|
+ ord.setInstallWebsitName(oldOrder.getWebsitName());
|
|
|
+ QueryWrapper upWrapper = new QueryWrapper<OrderRepairDetail>()
|
|
|
+ .eq("order_base_id", oldOrder.getId());
|
|
|
+ orderRepairDetailService.update(ord,upWrapper);
|
|
|
+ }
|
|
|
|
|
|
+ private void upOrderProduct(OrderBase oldOrder) {
|
|
|
+ OrderProduct op = new OrderProduct();
|
|
|
+ op.setServiceWebsit(oldOrder.getWebsitId());
|
|
|
+ op.setServiceWebsitMobile(publicService.getSHWDPhone(oldOrder.getWebsitId()));
|
|
|
+ QueryWrapper upWrapper = new QueryWrapper<OrderProduct>()
|
|
|
+ .eq("order_base_id", oldOrder.getId());
|
|
|
+ orderProductService.update(op,upWrapper);
|
|
|
+ }
|
|
|
|
|
|
+ private void upOrderStatus(Brand brand, ItfTblAssignDownload item, OrderBase oldOrder) {
|
|
|
+ // 查看是否可更新
|
|
|
+ Boolean allowUpdate = getaBoolean(item, oldOrder);
|
|
|
+ if (allowUpdate){
|
|
|
+ // 这里差 派工状态
|
|
|
+ OrderPar orderPar = new OrderPar();
|
|
|
+ orderPar.setSynReqId(item.getSynReqId());
|
|
|
+ orderPar.setBrandId(brand.getBrandId());
|
|
|
+ OrderBase order = repairDownloadMapper.getOrderBaseStatus(orderPar);
|
|
|
+ order.setId(oldOrder.getId());
|
|
|
+ orderBaseService.updateById(order);
|
|
|
+
|
|
|
+ oldOrder = orderBaseService.lambdaQuery()
|
|
|
+ .eq(OrderBase::getPgid, item.getPgid())
|
|
|
+ .eq(OrderBase::getOrderType, OrderTypeEnum.ORDER_TYPE_REPAIR.getCode()).one();
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ @NotNull
|
|
|
+ private Boolean getaBoolean(ItfTblAssignDownload item, OrderBase oldOrder) {
|
|
|
+ Boolean allowUpdate = Boolean.TRUE;
|
|
|
|
|
|
+ if (oldOrder.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I9.getCode())){
|
|
|
+ allowUpdate = Boolean.FALSE;
|
|
|
+ }
|
|
|
+ if (oldOrder.getOrderStatus().equals(OrderStatusEnum.REPAIR_STATUS_R7.getCode()) &&
|
|
|
+ (item.getStat().equals(4L) || item.getStat().equals(18L))){
|
|
|
+ allowUpdate = Boolean.FALSE;
|
|
|
+ }
|
|
|
+ if (!oldOrder.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I1.getCode()) &&
|
|
|
+ !oldOrder.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I2.getCode()) &&
|
|
|
+ !oldOrder.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I3.getCode()) &&
|
|
|
+ !oldOrder.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I4.getCode()) &&
|
|
|
+ !oldOrder.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I5.getCode()) &&
|
|
|
+ !oldOrder.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I6.getCode()) &&
|
|
|
+ !oldOrder.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I7.getCode()) &&
|
|
|
+ item.getStat()<=4L){
|
|
|
+ allowUpdate = Boolean.TRUE;
|
|
|
+ }
|
|
|
+ if (item.getStat().equals(2L) && (!oldOrder.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I1.getCode()) &&
|
|
|
+ !oldOrder.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I2.getCode()) &&
|
|
|
+ !oldOrder.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I3.getCode()))){
|
|
|
+ allowUpdate = Boolean.FALSE;
|
|
|
+ }
|
|
|
+ if (item.getStat().equals(2L) && (oldOrder.getOrderStatus().equals(OrderStatusEnum.INSTALL_STATUS_I5.getCode()) ||
|
|
|
+ oldOrder.getOrderStatus().equals(OrderStatusEnum.REPAIR_STATUS_R11.getCode()))){
|
|
|
+ allowUpdate = Boolean.TRUE;
|
|
|
+ }
|
|
|
+ return allowUpdate;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void updateYhqwsmsj(ItfTblAssignDownload item, OrderBase oldOrder) {
|
|
|
+ // 如何判断工单已预约 首次预约人信息不为空即为已预约
|
|
|
+ if (StringUtils.isEmpty(oldOrder.getFirstAppointmentId())){
|
|
|
+ OrderBase upOrder = new OrderBase();
|
|
|
+ upOrder.setId(oldOrder.getId());
|
|
|
+ upOrder.setExpectStartTime(item.getYhqwsmsj());
|
|
|
+ upOrder.setExpectEndTime(item.getQwsmjssj());
|
|
|
+ orderBaseService.updateById(upOrder);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void updateWebsit(Brand brand, Map<String, List<SysDictRef>> sysDictRefDLMap, ItfTblAssignDownload item, OrderBase oldOrder) {
|
|
@@ -201,6 +377,9 @@ public class RepairBusiness {
|
|
|
// 字段赋值
|
|
|
OrderBase upOrder = getOrderBase(brand, item, oldOrder);
|
|
|
orderBaseService.updateById(upOrder);
|
|
|
+ oldOrder = orderBaseService.lambdaQuery()
|
|
|
+ .eq(OrderBase::getPgid, item.getPgid())
|
|
|
+ .eq(OrderBase::getOrderType, OrderTypeEnum.ORDER_TYPE_REPAIR.getCode()).one();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -324,6 +503,7 @@ public class RepairBusiness {
|
|
|
for (ItfTblAssignAppointmentDownload a:appoint){
|
|
|
OrderBase up = new OrderBase();
|
|
|
up.setId(order.getId());
|
|
|
+ // 这里填写首次预约人信息同时也方便其他地方以此来判断该订单是否已预约
|
|
|
up.setFirstAppointmentId(a.getCzren());
|
|
|
up.setExpectStartTime(a.getKssj());
|
|
|
up.setExpectEndTime(a.getJssj());
|
|
@@ -381,6 +561,7 @@ public class RepairBusiness {
|
|
|
List<ItfTblAssignSatisfactionDownload> rec = itfTblAssignSatisfactionDownloadService.lambdaQuery()
|
|
|
.lt(ItfTblAssignSatisfactionDownload::getSynReqId,s.getSynReqId())
|
|
|
.eq(ItfTblAssignSatisfactionDownload::getPgid,s.getPgid())
|
|
|
+ .eq(ItfTblAssignSatisfactionDownload::getId,s.getId())
|
|
|
.le(ItfTblAssignSatisfactionDownload::getLastModifiedDate,s.getLastModifiedDate())
|
|
|
.eq(ItfTblAssignSatisfactionDownload::getPjly,s.getPjly()).list();
|
|
|
if (rec!=null && rec.size()>0){
|
|
@@ -541,12 +722,12 @@ public class RepairBusiness {
|
|
|
WebsitSH websitSH = publicService.WebsitToSH(fkmx.getFkwdno(), brand.getBrandId());
|
|
|
add.setOperateWebsit(websitSH.getWdmc());
|
|
|
add.setWebsitPhone(websitSH.getWdlxdh());
|
|
|
- add.setWorkerOrderState(order.getOrderStatus());// 反馈时的工单状态
|
|
|
- add.setBeforeOrderState(order.getLastOrderStatus());// 操作前工单状态 - 上一流程状态
|
|
|
- add.setBeforeAppointState(order.getDispatchStatus());// 操作前派工状态
|
|
|
- add.setOrderState("DJS"); // 操作后工单状态
|
|
|
+ add.setWorkerOrderStatus(order.getOrderStatus());// 反馈时的工单状态
|
|
|
+ add.setBeforeOrderStatus(order.getLastOrderStatus());// 操作前工单状态 - 上一流程状态
|
|
|
+ add.setBeforeDispatchStatus(order.getDispatchStatus());// 操作前派工状态
|
|
|
+ add.setOrderStatus("DJS"); // 操作后工单状态
|
|
|
// 总部下来的工单统一为待接收状态-派工状态
|
|
|
- add.setAppointState("DJS"); // 操作后派工状态
|
|
|
+ add.setDispatchStatus("DJS"); // 操作后派工状态
|
|
|
// 附件地址 todo
|
|
|
add.setPgguid(order.getPgguid());
|
|
|
add.setFkmxguid(fkmx.getFkmxguid());
|
|
@@ -588,7 +769,7 @@ public class RepairBusiness {
|
|
|
oit.setCreateTime(order.getCreateTime());
|
|
|
oit.setUpdateBy(order.getUpdateBy());
|
|
|
oit.setUpdateTime(order.getUpdateTime());
|
|
|
- orderInstallService.save(oit);
|
|
|
+ orderInstallService.saveOrUpdate(oit);
|
|
|
}
|
|
|
|
|
|
private void generateMx(Brand brand, ItfTblAssignDownload item, OrderBase order,
|
|
@@ -600,7 +781,7 @@ public class RepairBusiness {
|
|
|
List<ItfTblAssignMxDownload> ups = new ArrayList<>();
|
|
|
|
|
|
|
|
|
- // 明取明细表数据
|
|
|
+ // 提取明细表数据
|
|
|
mxRec = itfTblAssignMxDownloadService.lambdaQuery()
|
|
|
.eq(ItfTblAssignMxDownload::getDownloadTaskNo, item.getDownloadTaskNo())
|
|
|
.eq(ItfTblAssignMxDownload::getSynStatus,0)
|
|
@@ -652,6 +833,114 @@ public class RepairBusiness {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void generateMxUpdate(Brand brand, ItfTblAssignDownload item, OrderBase order,
|
|
|
+ Map<String, List<SysDictRef>> sysDictRefDLMap,
|
|
|
+ Map<String, List<SysDictRef>> sysDictRefXLMap,
|
|
|
+ Map<String, List<SysDictRef>> sysDictRefXiLieMap) {
|
|
|
+ List<ItfTblAssignMxDownload> mxRec = new ArrayList<>();
|
|
|
+ List<OrderProduct> addmx = new ArrayList<>();
|
|
|
+ List<OrderProduct> upmx = new ArrayList<>();
|
|
|
+ List<ItfTblAssignMxDownload> ups = new ArrayList<>();
|
|
|
+ Map<String, List<OrderProduct>> opsMap = new HashMap<>();
|
|
|
+
|
|
|
+
|
|
|
+ // 提取现有的数据
|
|
|
+ List<OrderProduct> ops = orderProductService.lambdaQuery()
|
|
|
+ .eq(OrderProduct::getOrderBaseId,order.getId()).list();
|
|
|
+
|
|
|
+ opsMap = ops.stream().
|
|
|
+ collect(Collectors.groupingBy(OrderProduct::getPgmxid));
|
|
|
+
|
|
|
+ // 提取明细表数据
|
|
|
+ mxRec = itfTblAssignMxDownloadService.lambdaQuery()
|
|
|
+ .eq(ItfTblAssignMxDownload::getDownloadTaskNo, item.getDownloadTaskNo())
|
|
|
+ .eq(ItfTblAssignMxDownload::getSynStatus,0)
|
|
|
+ .orderByAsc(ItfTblAssignMxDownload::getSynStatus)
|
|
|
+ .list();
|
|
|
+
|
|
|
+ for (ItfTblAssignMxDownload rec:mxRec){
|
|
|
+ // 提取维修工单明细数据对象
|
|
|
+ OrderPar mxreq = new OrderPar();
|
|
|
+ mxreq.setSynReqId(Long.valueOf(rec.getSynReqId()));
|
|
|
+ mxreq.setBrandId(brand.getBrandId());
|
|
|
+ OrderProduct op = getOrderProduct(item, order, sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap, rec, mxreq);
|
|
|
+
|
|
|
+ // 存在修改
|
|
|
+ if (opsMap.containsKey(op.getPgmxid())){
|
|
|
+ getupop(upmx, opsMap, op);
|
|
|
+ } else {
|
|
|
+ addmx.add(op);
|
|
|
+ }
|
|
|
+
|
|
|
+ ItfTblAssignMxDownload up = new ItfTblAssignMxDownload();
|
|
|
+ up.setSynReqId(rec.getSynReqId());
|
|
|
+ up.setSynStatus(1);
|
|
|
+ up.setSynReqTime(new Date());
|
|
|
+ ups.add(up);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (addmx.size()>0){
|
|
|
+ orderProductService.saveBatch(addmx);
|
|
|
+ addmx.clear();
|
|
|
+ }
|
|
|
+ if (upmx.size()>0){
|
|
|
+ orderProductService.updateBatchById(upmx);
|
|
|
+ addmx.clear();
|
|
|
+ }
|
|
|
+ if (ups.size()>0){
|
|
|
+ itfTblAssignMxDownloadService.updateBatchById(ups);
|
|
|
+ ups.clear();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void getupop(List<OrderProduct> upmx, Map<String, List<OrderProduct>> opsMap, OrderProduct op) {
|
|
|
+ OrderProduct up = new OrderProduct();
|
|
|
+ up.setId(opsMap.get(op.getPgmxid()).get(0).getId());
|
|
|
+ up.setMainId(op.getMainId());
|
|
|
+ up.setMainName(op.getMainName());
|
|
|
+ up.setSmallId(op.getSmallId());
|
|
|
+ up.setSmallName(op.getSmallName());
|
|
|
+ up.setSeriesId(op.getSeriesId());
|
|
|
+ up.setSeriesName(op.getSeriesName());
|
|
|
+ up.setProductId(op.getProductId());
|
|
|
+ up.setProductName(op.getProductName());
|
|
|
+ up.setUrgency(op.getUrgency());
|
|
|
+ up.setSaleWebsit(op.getSaleWebsit());
|
|
|
+ up.setServiceWebsit(op.getServiceWebsit());
|
|
|
+ up.setSaleWebsitMobile(op.getSaleWebsitMobile());
|
|
|
+ up.setServiceWebsitMobile(op.getServiceWebsitMobile());
|
|
|
+ up.setBuyTime(op.getBuyTime());
|
|
|
+ upmx.add(up);
|
|
|
+ }
|
|
|
+
|
|
|
+ @NotNull
|
|
|
+ private OrderProduct getOrderProduct(ItfTblAssignDownload item, OrderBase order, Map<String, List<SysDictRef>> sysDictRefDLMap, Map<String, List<SysDictRef>> sysDictRefXLMap, Map<String, List<SysDictRef>> sysDictRefXiLieMap, ItfTblAssignMxDownload rec, OrderPar mxreq) {
|
|
|
+ OrderProduct op = repairMxDownloadMapper.getMx(mxreq);
|
|
|
+
|
|
|
+ // 其他部分参数赋值
|
|
|
+ op.setOrderBaseId(order.getId());
|
|
|
+ op.setPgguid(item.getPgguid());
|
|
|
+ op.setMainId(sysDictRefDLMap.get(String.valueOf(rec.getSpid())).get(0).getDictCode());
|
|
|
+ op.setMainName(sysDictRefDLMap.get(String.valueOf(rec.getSpid())).get(0).getDictValue());
|
|
|
+ if (!rec.getXlid().equals(0L)){
|
|
|
+ op.setSmallId(sysDictRefXLMap.get(String.valueOf(rec.getXlid())).get(0).getDictCode());
|
|
|
+ op.setSmallName(sysDictRefXLMap.get(String.valueOf(rec.getXlid())).get(0).getDictValue());
|
|
|
+ } else {
|
|
|
+ op.setSmallId(String.valueOf(rec.getXlid()));
|
|
|
+ op.setSmallName(rec.getXlmc());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!rec.getXiid().equals("0") && sysDictRefXiLieMap.containsKey(rec.getXiid())){
|
|
|
+ op.setSeriesId(sysDictRefXiLieMap.get(rec.getXiid()).get(0).getDictCode());
|
|
|
+ op.setSeriesName(sysDictRefXiLieMap.get(rec.getXiid()).get(0).getDictValue());
|
|
|
+ } else {
|
|
|
+ op.setSeriesId(rec.getXiid());
|
|
|
+ op.setSeriesName(rec.getXimc());
|
|
|
+ }
|
|
|
+ return op;
|
|
|
+ }
|
|
|
+
|
|
|
private OrderBase generateOrder(Brand brand, ItfTblAssignDownload item, List<ItfTblAssignXzydDownload> yds) {
|
|
|
Boolean isChildInfo = Boolean.FALSE;
|
|
|
|
|
@@ -661,32 +950,10 @@ public class RepairBusiness {
|
|
|
|
|
|
OrderBase order = saveOrderBase(brand, item, isChildInfo);
|
|
|
|
|
|
- // 更新 修改时更新 新增时无需此操作 可以先放进来,是修改不到数据的
|
|
|
- // 维修工单产品信息 (维修网点、维修网点名称) websit_id,websit_name
|
|
|
- // order_product 无维修网点信息,所以不用做
|
|
|
-
|
|
|
- // 采集表需要做上面的操作 order_repair_detail 新增时也无需操作,加上也不会出错
|
|
|
- /*OrderPar request = new OrderPar();
|
|
|
- request.setOrderNo(order.getId());
|
|
|
- detailOrderRepairMapper.updateWebsitMessage(request);*/
|
|
|
-
|
|
|
-
|
|
|
- // 新增或是修改都要加 新增是一定要做的
|
|
|
// 总部维修单为待审批改派时 若本地表无改派数据则生成改派数据
|
|
|
if (order.getOrderStatus().equals("B5")){
|
|
|
generateDispatch(order);
|
|
|
}
|
|
|
-
|
|
|
- // 原 本地维修单表状态为5 待审批 同步过来的工单状态不是待审批时
|
|
|
- // 修改接品自动审核 新增时条件不成立的
|
|
|
-
|
|
|
- // 增加判断是否有未处理的待改派,如果广佛有待改派但总部工单不是待改派,直接更新改派标志
|
|
|
- // 新增时了样不用操作
|
|
|
-
|
|
|
- // 增加处理采集数据下载 新增不用操作
|
|
|
- /*if ((order.getOrderStatus().equals("B41") || order.getOrderStatus().equals("B102"))){
|
|
|
-
|
|
|
- }*/
|
|
|
// 如果是家用的工单,且工单状态是待中心派工或待网点派工时,写入派嘉讯茂 不做
|
|
|
|
|
|
// 修改同步状态
|