|
@@ -1,17 +1,17 @@
|
|
|
package com.zfire.jiasm.syncdata.download.order.repair;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.zfire.jiasm.syncdata.base.BaseService;
|
|
|
-import com.zfire.jiasm.syncdata.dao.mapper.AssignDownloadMapper;
|
|
|
-import com.zfire.jiasm.syncdata.dao.mapper.DetailOrderRepairMapper;
|
|
|
-import com.zfire.jiasm.syncdata.dao.mapper.RepairDownloadMapper;
|
|
|
-import com.zfire.jiasm.syncdata.dao.mapper.RepairMxDownloadMapper;
|
|
|
+import com.zfire.jiasm.syncdata.dao.mapper.*;
|
|
|
import com.zfire.jiasm.syncdata.parameter.OrderPar;
|
|
|
+import com.zfire.jiasm.syncdata.parameter.ReAppointment;
|
|
|
import com.zfire.jiasm.syncdata.plus.entity.*;
|
|
|
import com.zfire.jiasm.syncdata.plus.service.*;
|
|
|
import com.zfire.jiasm.syncdata.response.WebsitSH;
|
|
|
import com.zfire.jiasm.syncdata.service.OrderService;
|
|
|
import com.zfire.jiasm.syncdata.service.PublicService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.jetbrains.annotations.NotNull;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -22,8 +22,7 @@ import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* 格力品牌维修工单下载后落本地数据表
|
|
|
- * 1:落业务表
|
|
|
- * 2:修改下载主表处理结果
|
|
|
+ * 落业务表 - 修改下载主表处理结果
|
|
|
*/
|
|
|
@Slf4j
|
|
|
@Component
|
|
@@ -57,6 +56,25 @@ public class RepairBusiness {
|
|
|
OrderProductService orderProductService;
|
|
|
@Resource
|
|
|
ItfTblAssignFkmxDownloadService itfTblAssignFkmxDownloadService;
|
|
|
+ @Resource
|
|
|
+ OrderRepairOperatingLogService orderRepairOperatingLogService;
|
|
|
+ @Resource
|
|
|
+ ItfTblAssignSatisfactionDownloadService itfTblAssignSatisfactionDownloadService;
|
|
|
+ @Resource
|
|
|
+ OrderAppraiseService orderAppraiseService;
|
|
|
+ @Resource
|
|
|
+ AppraiseMapper appraiseMapper;
|
|
|
+ @Resource
|
|
|
+ AssignSatisfactionDownloadMapper assignSatisfactionDownloadMapper;
|
|
|
+ @Resource
|
|
|
+ FaGreeSmsService faGreeSmsService;
|
|
|
+ @Resource
|
|
|
+ ItfTblAssignXzydDownloadService itfTblAssignXzydDownloadService;
|
|
|
+ @Resource
|
|
|
+ OrderInformationService orderInformationService;
|
|
|
+ @Resource
|
|
|
+ ItfTblAssignAppointmentDownloadService itfTblAssignAppointmentDownloadService;
|
|
|
+
|
|
|
|
|
|
|
|
|
// 1:工单落入本地表
|
|
@@ -83,7 +101,6 @@ public class RepairBusiness {
|
|
|
// 提取品牌商对应的系列信息
|
|
|
Map<String, List<SysDictRef>> sysDictRefXiLieMap = publicService.getMap(brand);
|
|
|
|
|
|
-
|
|
|
// 提取待落本地表的数据
|
|
|
repairRec = itfTblAssignDownloadService.lambdaQuery()
|
|
|
.eq(ItfTblAssignDownload::getSynStatus,0)
|
|
@@ -99,38 +116,247 @@ public class RepairBusiness {
|
|
|
|
|
|
// 按任务号download_task_no,按单来处理
|
|
|
for (ItfTblAssignDownload item: repairRec){
|
|
|
-
|
|
|
// 新增
|
|
|
repairBusiness.addOrder(brand, item, sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap);
|
|
|
}
|
|
|
+
|
|
|
+ log.info("维修工单落本地表处理完成: {}",sdf.format(new Date()));
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void addOrder(Brand brand, ItfTblAssignDownload item,
|
|
|
+ public void addOrder(Brand brand, ItfTblAssignDownload item,
|
|
|
Map<String, List<SysDictRef>> sysDictRefDLMap,
|
|
|
Map<String, List<SysDictRef>> sysDictRefXLMap,
|
|
|
Map<String, List<SysDictRef>> sysDictRefXiLieMap) {
|
|
|
+
|
|
|
+ List<ItfTblAssignXzydDownload> yds = itfTblAssignXzydDownloadService.lambdaQuery()
|
|
|
+ .eq(ItfTblAssignXzydDownload::getDownloadTaskNo,item.getDownloadTaskNo()).list();
|
|
|
+
|
|
|
// 新增 TL_SynDataFrom_tbl_assign_batch
|
|
|
// TL_SynDataFrom_tbl_assign 主单的 syn_req_id
|
|
|
-
|
|
|
// 处理维修工单主表数据
|
|
|
- OrderBase order = generateOrder(brand, item);
|
|
|
+ OrderBase order = generateOrder(brand, item, yds);
|
|
|
// 处理工单师傅
|
|
|
- OrderWorker orderWorker = publicService.getOrderWorker(order);
|
|
|
+ publicService.getOrderWorker(order);
|
|
|
// 获取工单扩展信息
|
|
|
getOrderInstall(item, order);
|
|
|
-
|
|
|
// 处理维修单明细表 TL_SynDataFrom_tbl_assign_mx
|
|
|
generateMx(brand, item, order, sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap);
|
|
|
+ // 处理维修单过程反馈表 放入操作日志表 TL_SynDataFrom_tbl_assign_fkmx
|
|
|
+ generateFkmx(brand, item, order);
|
|
|
+ // 处理用户评价数据 TL_SynDataFrom_tbl_assign_satisfaction
|
|
|
+ generateSstisfaction(brand, item, sysDictRefDLMap, order);
|
|
|
+ // 阅读要求数据处理 TL_SynDataFrom_tbl_assign_xzyd
|
|
|
+ generateXzyd(brand, yds, order);
|
|
|
+ // 用户预约改约数据处理 TL_SynDataFrom_tbl_assign_appointment
|
|
|
+ generateAppointment(item, order);
|
|
|
+ }
|
|
|
|
|
|
+ private void generateAppointment(ItfTblAssignDownload item, OrderBase order) {
|
|
|
+ // 新增工单,直接修改主表预约时间最近一次的数据修改
|
|
|
+ List<ItfTblAssignAppointmentDownload> appoint = itfTblAssignAppointmentDownloadService.lambdaQuery()
|
|
|
+ .eq(ItfTblAssignAppointmentDownload::getDownloadTaskNo, item.getDownloadTaskNo())
|
|
|
+ .orderByAsc(ItfTblAssignAppointmentDownload::getSynReqId).list();
|
|
|
+ for (ItfTblAssignAppointmentDownload a:appoint){
|
|
|
+ OrderBase up = new OrderBase();
|
|
|
+ up.setId(order.getId());
|
|
|
+ up.setFirstAppointmentId(a.getCzren());
|
|
|
+ up.setExpectStartTime(a.getKssj());
|
|
|
+ up.setExpectEndTime(a.getJssj());
|
|
|
+ orderBaseService.updateById(up);
|
|
|
+ ItfTblAssignAppointmentDownload u = new ItfTblAssignAppointmentDownload();
|
|
|
+ u.setSynReqId(a.getSynReqId());
|
|
|
+ u.setSynStatus(1);
|
|
|
+ u.setSynTime(new Date());
|
|
|
+ itfTblAssignAppointmentDownloadService.updateById(u);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- // 处理维修单过程反馈表 放入操作日志表
|
|
|
+ private void generateXzyd(Brand brand, List<ItfTblAssignXzydDownload> yds, OrderBase order) {
|
|
|
+ for (ItfTblAssignXzydDownload yd: yds){
|
|
|
+ OrderInformation add = new OrderInformation();
|
|
|
+ add.setId(String.valueOf(yd.getXzid()));
|
|
|
+ add.setAskCategoryId(yd.getXzyqlb());
|
|
|
+ add.setAskCategoryName(yd.getXzyq());
|
|
|
+ add.setOrderBaseId(order.getId());
|
|
|
+ add.setCreateBy(yd.getCreatedBy());
|
|
|
+ add.setCreateTime(yd.getCreatedDate());
|
|
|
+ add.setUpdateBy(yd.getLastModifiedBy());
|
|
|
+ add.setUpdateTime(yd.getLastModifiedDate());
|
|
|
+ add.setReadStatus(yd.getYdbz());
|
|
|
+ add.setReadName(yd.getYdrmc());
|
|
|
+ add.setReadTime(yd.getYdsj());
|
|
|
+ WebsitSH websitSH = publicService.WebsitToSH(yd.getWdno(), brand.getBrandId());
|
|
|
+ add.setWebsitId(websitSH.getWdId());
|
|
|
+ add.setWebsitName(websitSH.getWdmc());
|
|
|
+
|
|
|
+ orderInformationService.save(add);
|
|
|
+ ItfTblAssignXzydDownload up = new ItfTblAssignXzydDownload();
|
|
|
+ up.setSynReqId(yd.getSynReqId());
|
|
|
+ up.setSynStatus(1);
|
|
|
+ up.setSynTime(new Date());
|
|
|
+ itfTblAssignXzydDownloadService.updateById(up);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void generateSstisfaction(Brand brand, ItfTblAssignDownload item, Map<String, List<SysDictRef>> sysDictRefDLMap, OrderBase order) {
|
|
|
+ List<ItfTblAssignSatisfactionDownload> satis = itfTblAssignSatisfactionDownloadService.lambdaQuery()
|
|
|
+ .eq(ItfTblAssignSatisfactionDownload::getDownloadTaskNo, item.getDownloadTaskNo())
|
|
|
+ .list();
|
|
|
+
|
|
|
+ for (ItfTblAssignSatisfactionDownload s:satis){
|
|
|
+ // 查看是否已同步
|
|
|
+ ReAppointment request = new ReAppointment();
|
|
|
+ request.setId(s.getId());
|
|
|
+ OrderAppraise old = appraiseMapper.getAppraise(request);
|
|
|
+ if (old!=null){
|
|
|
+ upSyncstatus(s.getSynReqId(), 9, "评价已同步,忽略更新");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ // 查看该工单有无较早前下载相同的评价
|
|
|
+ List<ItfTblAssignSatisfactionDownload> rec = itfTblAssignSatisfactionDownloadService.lambdaQuery()
|
|
|
+ .lt(ItfTblAssignSatisfactionDownload::getSynReqId,s.getSynReqId())
|
|
|
+ .eq(ItfTblAssignSatisfactionDownload::getPgid,s.getPgid())
|
|
|
+ .le(ItfTblAssignSatisfactionDownload::getLastModifiedDate,s.getLastModifiedDate())
|
|
|
+ .eq(ItfTblAssignSatisfactionDownload::getPjly,s.getPjly()).list();
|
|
|
+ if (rec!=null && rec.size()>0){
|
|
|
+ upSyncstatus(s.getSynReqId(), 9 ,"评价已同步,忽略更新");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ // 判断评价是否为中差评,如果是中差评,检查上一条记录是否为中差评,如果是则新插入的不需要再申诉
|
|
|
+ // 这里并没查表, 需要一张表类工单系统 TL_get_satisfaction_pjly(itf_tbl_satisfaction_list)
|
|
|
+ Integer canInsert =1;
|
|
|
+ // 检查fa_order_repair是否有一条sxlx = 0的首评记录
|
|
|
+ if (s.getSxlx().equals(0) && s.getSynStatus().equals(0)){
|
|
|
+ ReAppointment r = new ReAppointment();
|
|
|
+ r.setId(String.valueOf(s.getSynReqId()));
|
|
|
+ ItfTblAssignSatisfactionDownload sa = assignSatisfactionDownloadMapper.getSatisfaction(r);
|
|
|
+ if (sa !=null){
|
|
|
+ canInsert = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 只插入一条sxlx = 0的首评记录
|
|
|
+ if (canInsert.equals(1)){
|
|
|
+ // 增加评价记录
|
|
|
+ WebsitSH websitSH = addappraise(brand, sysDictRefDLMap, s);
|
|
|
+ // 增加差评短信
|
|
|
+ addcpsms(order, s, websitSH);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 已评价过,则更新追评 新增时无,不需操作 appraise_datetime字段新增时无操作,只需查工单基础表,判断不为null即可
|
|
|
+ // 这里改为首次评价
|
|
|
+ upOrderBasePJ(order, s);
|
|
|
+
|
|
|
+ // 修改同步状态
|
|
|
+ upSatisfactionSynstatus(s);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void addcpsms(OrderBase order, ItfTblAssignSatisfactionDownload s, WebsitSH websitSH) {
|
|
|
+ if (s.getPjnr().equals("3") || s.getPjnr().indexOf("不满意")>0){
|
|
|
+ if (StringUtils.isNotEmpty(s.getHfwdno()) && s.getHfwdno().equals("99999999")){
|
|
|
+ FaGreeSms fs = new FaGreeSms();
|
|
|
+ fs.setSynTaskNo(UUID.randomUUID().toString());
|
|
|
+ fs.setWorkerOrderNo(order.getId());
|
|
|
+ fs.setAzorwx(2);
|
|
|
+ fs.setFjid(String.valueOf(s.getPgid()));
|
|
|
+ fs.setFjwd(s.getHfwdno());
|
|
|
+ Random random = new Random(System.currentTimeMillis());
|
|
|
+ fs.setFsma(String.valueOf(random.nextInt(10000)));
|
|
|
+ fs.setFsnr("您收到一张客户的投诉工单,请及时处理!工单号:" + String.valueOf(s.getPgid()) +
|
|
|
+ ",服务人员:" + order.getWorkerName());
|
|
|
+ fs.setSjid(websitSH.getWdlxdh());
|
|
|
+ fs.setYhlb(2);
|
|
|
+ faGreeSmsService.save(fs);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @NotNull
|
|
|
+ private WebsitSH addappraise(Brand brand, Map<String, List<SysDictRef>> sysDictRefDLMap, ItfTblAssignSatisfactionDownload s) {
|
|
|
+ Boolean canAppeal = Boolean.TRUE;
|
|
|
+ Integer appeal = 0;
|
|
|
+ ReAppointment rq = new ReAppointment();
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(s.getPjnr())){
|
|
|
+ if (s.getPjnr().equals("1") || s.getPjnr().equals("满意")){
|
|
|
+ canAppeal=Boolean.FALSE;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 检查上一条记录是否为中差评,如果是则新插入的不需要再申诉
|
|
|
+
|
|
|
+ if (canAppeal){
|
|
|
+ ReAppointment req = new ReAppointment();
|
|
|
+ req.setId(String.valueOf(s.getPgid()));
|
|
|
+ OrderAppraise id = appraiseMapper.getOldId(req);
|
|
|
+ if (id !=null){
|
|
|
+ appeal = 0;
|
|
|
+ } else {
|
|
|
+ appeal = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ rq.setId(String.valueOf(s.getSynReqId()));
|
|
|
+ OrderAppraise add = assignSatisfactionDownloadMapper.getOrderAppraise(rq);
|
|
|
+
|
|
|
+ // rvisit_websit_id 单独处理
|
|
|
+ WebsitSH websitSH = publicService.WebsitToSH(s.getHfwdno(), brand.getBrandId());
|
|
|
+ add.setRvisitWebsitId(websitSH.getWdId());
|
|
|
+ add.setRvisitWebsitName(websitSH.getWdmc());
|
|
|
+ // splb 商品大类 单独处理
|
|
|
+ add.setMainId(sysDictRefDLMap.get(String.valueOf(s.getSplb())).get(0).getDictCode());
|
|
|
+ // can_appeal 是否可发起申诉 单独处理
|
|
|
+ add.setCanAppeal(appeal);
|
|
|
+ orderAppraiseService.save(add);
|
|
|
+ return websitSH;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void upOrderBasePJ(OrderBase order, ItfTblAssignSatisfactionDownload s) {
|
|
|
+ OrderBase upOrder = new OrderBase();
|
|
|
+ upOrder.setId(order.getId());
|
|
|
+ upOrder.setAppraiseTime(s.getCreatedDate());
|
|
|
+ // 原 评价:1=差评,2=中评,3=好评,0=未评价,4=剔除,5=其他
|
|
|
+ if (StringUtils.isEmpty(s.getPjnr())){
|
|
|
+ upOrder.setAppraiseStatus("N");
|
|
|
+ }
|
|
|
+ if (s.getPjnr().equals("1") || s.getPjnr().equals("满意")){
|
|
|
+ upOrder.setAppraiseStatus("A");
|
|
|
+ } else if (s.getPjnr().equals("2") || s.getPjnr().equals("一般")){
|
|
|
+ upOrder.setAppraiseStatus("B");
|
|
|
+ } else if (s.getPjnr().equals("3") || s.getPjnr().equals("不满意") ||
|
|
|
+ s.getPjnr().indexOf("差")>0 || s.getPjnr().indexOf("不满")>0){
|
|
|
+ upOrder.setAppraiseStatus("C");
|
|
|
+ } else {
|
|
|
+ upOrder.setAppraiseStatus("O");
|
|
|
+ }
|
|
|
+ orderBaseService.updateById(upOrder);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void upSatisfactionSynstatus(ItfTblAssignSatisfactionDownload s) {
|
|
|
+ ItfTblAssignSatisfactionDownload ups = new ItfTblAssignSatisfactionDownload();
|
|
|
+ ups.setSynReqId(s.getSynReqId());
|
|
|
+ ups.setSynStatus(1);
|
|
|
+ ups.setSynTime(new Date());
|
|
|
+ itfTblAssignSatisfactionDownloadService.updateById(ups);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void upSyncstatus(Long synReqId, Integer synStatus ,
|
|
|
+ String msg) {
|
|
|
+ ItfTblAssignSatisfactionDownload up = new ItfTblAssignSatisfactionDownload();
|
|
|
+ up.setSynReqId(synReqId);
|
|
|
+ up.setSynStatus(synStatus);
|
|
|
+ up.setSynTime(new Date());
|
|
|
+ up.setSynErrMsg(msg);
|
|
|
+ itfTblAssignSatisfactionDownloadService.updateById(up);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void generateFkmx(Brand brand, ItfTblAssignDownload item, OrderBase order) {
|
|
|
List<ItfTblAssignFkmxDownload> fkmxRec = new ArrayList<>();
|
|
|
- List<OrderRepairOperatingLog> orol = new ArrayList<>();
|
|
|
+ List<OrderRepairOperatingLog> orols = new ArrayList<>();
|
|
|
List<ItfTblAssignFkmxDownload> ups = new ArrayList<>();
|
|
|
|
|
|
fkmxRec = itfTblAssignFkmxDownloadService.lambdaQuery()
|
|
|
- .eq(ItfTblAssignFkmxDownload::getDownloadTaskNo,item.getDownloadTaskNo())
|
|
|
+ .eq(ItfTblAssignFkmxDownload::getDownloadTaskNo, item.getDownloadTaskNo())
|
|
|
.eq(ItfTblAssignFkmxDownload::getSynStatus,0)
|
|
|
.orderByAsc(ItfTblAssignFkmxDownload::getCreatedDate,ItfTblAssignFkmxDownload::getFkid)
|
|
|
.list();
|
|
@@ -148,23 +374,42 @@ public class RepairBusiness {
|
|
|
add.setFeedback(fkmx.getFkjg());
|
|
|
add.setOperator(fkmx.getFkren());
|
|
|
add.setOperatorNumber(fkmx.getFkrenmc());
|
|
|
- WebsitSH websitSH = publicService.WebsitToSH(fkmx.getFkwdno(),brand.getBrandId());
|
|
|
+ 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.setAppointState("DJS"); // 操作后派工状态
|
|
|
+ // 附件地址 todo
|
|
|
+ add.setPgguid(order.getPgguid());
|
|
|
+ add.setFkmxguid(fkmx.getFkmxguid());
|
|
|
+ add.setFkid(String.valueOf(fkmx.getFkid()));
|
|
|
+ add.setPgid(fkmx.getPgid());
|
|
|
+ add.setBrandFileId(fkmx.getScid());
|
|
|
+ add.setBrandFileName(fkmx.getScwj());
|
|
|
+ add.setWjid(fkmx.getWjid());
|
|
|
+ add.setReqSourceNum(fkmx.getQqlyxh());
|
|
|
+ add.setUploadNotifyFlag(0);
|
|
|
+ add.setCreateTime(fkmx.getFksj());
|
|
|
+ add.setUpdateTime(fkmx.getLastModifiedDate());
|
|
|
+ add.setCreateBy(fkmx.getCreatedBy());
|
|
|
+ add.setUpdateBy(fkmx.getLastModifiedBy());
|
|
|
+ orols.add(add);
|
|
|
+ ItfTblAssignFkmxDownload u = new ItfTblAssignFkmxDownload();
|
|
|
+ u.setSynReqId(fkmx.getSynReqId());
|
|
|
+ u.setSynStatus(1);
|
|
|
+ u.setSynTime(new Date());
|
|
|
+ ups.add(u);
|
|
|
+ }
|
|
|
+ if (orols.size()>0){
|
|
|
+ orderRepairOperatingLogService.saveBatch(orols);
|
|
|
+ orols.clear();
|
|
|
+ itfTblAssignFkmxDownloadService.updateBatchById(ups);
|
|
|
+ ups.clear();
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private void getOrderInstall(ItfTblAssignDownload item, OrderBase order) {
|
|
@@ -219,7 +464,7 @@ public class RepairBusiness {
|
|
|
op.setSmallName(rec.getXlmc());
|
|
|
}
|
|
|
|
|
|
- if (!rec.getXiid().equals("0")){
|
|
|
+ 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 {
|
|
@@ -239,11 +484,18 @@ public class RepairBusiness {
|
|
|
orderProductService.saveBatch(addmx);
|
|
|
addmx.clear();
|
|
|
itfTblAssignMxDownloadService.updateBatchById(ups);
|
|
|
+ ups.clear();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private OrderBase generateOrder(Brand brand, ItfTblAssignDownload item) {
|
|
|
- OrderBase order = saveOrderBase(brand, item);
|
|
|
+ private OrderBase generateOrder(Brand brand, ItfTblAssignDownload item, List<ItfTblAssignXzydDownload> yds) {
|
|
|
+ Boolean isChildInfo = Boolean.FALSE;
|
|
|
+
|
|
|
+ if (yds !=null && yds.size()>0){
|
|
|
+ isChildInfo = Boolean.TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ OrderBase order = saveOrderBase(brand, item, isChildInfo);
|
|
|
|
|
|
// 更新 修改时更新 新增时无需此操作 可以先放进来,是修改不到数据的
|
|
|
// 维修工单产品信息 (维修网点、维修网点名称) websit_id,websit_name
|
|
@@ -279,12 +531,15 @@ public class RepairBusiness {
|
|
|
return order;
|
|
|
}
|
|
|
|
|
|
- private OrderBase saveOrderBase(Brand brand, ItfTblAssignDownload item) {
|
|
|
+ private OrderBase saveOrderBase(Brand brand, ItfTblAssignDownload item, Boolean isChildInfo) {
|
|
|
// 获取维修工单主表数据
|
|
|
OrderPar orderPar = new OrderPar();
|
|
|
orderPar.setSynReqId(item.getSynReqId());
|
|
|
orderPar.setBrandId(brand.getBrandId());
|
|
|
OrderBase order = repairDownloadMapper.getOrderBase(orderPar);
|
|
|
+ if (isChildInfo){
|
|
|
+ order.setIsChildInfo("YES");
|
|
|
+ }
|
|
|
// 部分属性值重置
|
|
|
orderService.setParame(brand, order);
|
|
|
// 新增
|