|
@@ -30,10 +30,10 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
|
@Slf4j
|
|
|
@Component
|
|
|
-public class RepairBusiness {
|
|
|
+public class Business {
|
|
|
|
|
|
@Resource
|
|
|
- RepairBusiness repairBusiness;
|
|
|
+ Business business;
|
|
|
@Resource
|
|
|
ItfTblAssignDownloadService itfTblAssignDownloadService;
|
|
|
@Resource
|
|
@@ -83,7 +83,6 @@ public class RepairBusiness {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
@Scheduled(fixedDelay = 1 * 10 * 1000)
|
|
|
public void inputOrder() {
|
|
@@ -91,7 +90,6 @@ public class RepairBusiness {
|
|
|
return;
|
|
|
}*/
|
|
|
|
|
|
-
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
List<ItfTblAssignDownload> repairRec = new ArrayList<>();
|
|
|
List<Long> pgids = new ArrayList<>();
|
|
@@ -138,31 +136,11 @@ public class RepairBusiness {
|
|
|
if (orderBaselist.contains(String.valueOf(item.getPgid()))){
|
|
|
|
|
|
log.info("修改:");
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- 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);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- generateMxUpdate(brand, item, order, sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ business.updateOrder(brand, sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap, item);
|
|
|
} else {
|
|
|
-
|
|
|
+
|
|
|
log.info("新增:");
|
|
|
- repairBusiness.addOrder(brand, item, sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap);
|
|
|
+ business.addOrder(brand, item, sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap);
|
|
|
orderBaselist.add(String.valueOf(item.getPgid()));
|
|
|
|
|
|
}
|
|
@@ -175,6 +153,36 @@ public class RepairBusiness {
|
|
|
log.info("维修工单落本地表处理完成: {}",sdf.format(new Date()));
|
|
|
}
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void updateOrder(Brand brand, Map<String, List<SysDictRef>> sysDictRefDLMap, Map<String, List<SysDictRef>> sysDictRefXLMap, Map<String, List<SysDictRef>> sysDictRefXiLieMap, ItfTblAssignDownload item) {
|
|
|
+ List<ItfTblAssignXzydDownload> yds = itfTblAssignXzydDownloadService.lambdaQuery()
|
|
|
+ .eq(ItfTblAssignXzydDownload::getDownloadTaskNo, item.getDownloadTaskNo()).list();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ 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);
|
|
|
+
|
|
|
+ generateMxUpdate(brand, item, order, sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap);
|
|
|
+
|
|
|
+ generateFkmxUpdate(brand, item, order);
|
|
|
+
|
|
|
+ generateSstisfactionUpdate(brand, item, sysDictRefDLMap, order);
|
|
|
+
|
|
|
+ generateXzydUpdate(brand, yds, order);
|
|
|
+
|
|
|
+ generateAppointmentUpdate(item, order);
|
|
|
+ }
|
|
|
+
|
|
|
private void upOrderWorker(OrderBase order) {
|
|
|
if (StringUtils.isEmpty(order.getWorkerName())){
|
|
|
|
|
@@ -242,7 +250,7 @@ public class RepairBusiness {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
if ((oldOrder.getOrderStatus().equals("B41") || oldOrder.getOrderStatus().equals("B102")) && cjDowFlag ==0){
|
|
|
List<OrderRepairDetail> ords = orderRepairDetailService.lambdaQuery()
|
|
|
.eq(OrderRepairDetail::getOrderBaseId,oldOrder.getId())
|
|
@@ -251,7 +259,7 @@ public class RepairBusiness {
|
|
|
if (!(ords !=null && ords.size()>0)){
|
|
|
|
|
|
delOrderRepairDetail(oldOrder);
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
OrderBase up = new OrderBase();
|
|
@@ -375,18 +383,13 @@ public class RepairBusiness {
|
|
|
|
|
|
if (flag){
|
|
|
|
|
|
- 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();
|
|
|
+ getOrderBase(brand, item, oldOrder);
|
|
|
+ orderBaseService.updateById(oldOrder);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@NotNull
|
|
|
- private OrderBase getOrderBase(Brand brand, ItfTblAssignDownload item, OrderBase oldOrder) {
|
|
|
- OrderBase upOrder = new OrderBase();
|
|
|
- upOrder.setId(oldOrder.getId());
|
|
|
+ private void getOrderBase(Brand brand, ItfTblAssignDownload item, OrderBase upOrder) {
|
|
|
if (StringUtils.isNotEmpty(item.getXxlb())){
|
|
|
upOrder.setInfoType(item.getXxlb());
|
|
|
} else {
|
|
@@ -415,7 +418,6 @@ public class RepairBusiness {
|
|
|
upOrder.setReceWebsitId("");
|
|
|
upOrder.setReceWebsitName("");
|
|
|
}
|
|
|
- return upOrder;
|
|
|
}
|
|
|
|
|
|
@NotNull
|
|
@@ -462,7 +464,7 @@ public class RepairBusiness {
|
|
|
upOrder.setId(id);
|
|
|
upOrder.setOutUpdateSynReqId(item.getSynReqId());
|
|
|
upOrder.setOutUpdateSynReqTime(new Date());
|
|
|
- upOrder.setUpdateTime(new Date());
|
|
|
+
|
|
|
return upOrder;
|
|
|
}
|
|
|
|
|
@@ -496,56 +498,161 @@ public class RepairBusiness {
|
|
|
}
|
|
|
|
|
|
private void generateAppointment(ItfTblAssignDownload item, OrderBase order) {
|
|
|
+ OrderBase up = new OrderBase();
|
|
|
+ List<ItfTblAssignAppointmentDownload> us = new ArrayList<>();
|
|
|
|
|
|
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());
|
|
|
+
|
|
|
+ ItfTblAssignAppointmentDownload u = new ItfTblAssignAppointmentDownload();
|
|
|
+ u.setSynReqId(a.getSynReqId());
|
|
|
+ u.setSynStatus(1);
|
|
|
+ u.setSynTime(new Date());
|
|
|
+ us.add(u);
|
|
|
+ }
|
|
|
+ if (appoint !=null && appoint.size()>0){
|
|
|
orderBaseService.updateById(up);
|
|
|
+ itfTblAssignAppointmentDownloadService.updateBatchById(us);
|
|
|
+ us.clear();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void generateAppointmentUpdate(ItfTblAssignDownload item, OrderBase order) {
|
|
|
+ OrderBase up = new OrderBase();
|
|
|
+ List<ItfTblAssignAppointmentDownload> us = new ArrayList<>();
|
|
|
+
|
|
|
+ List<ItfTblAssignAppointmentDownload> appoint = itfTblAssignAppointmentDownloadService.lambdaQuery()
|
|
|
+ .eq(ItfTblAssignAppointmentDownload::getDownloadTaskNo, item.getDownloadTaskNo())
|
|
|
+ .orderByAsc(ItfTblAssignAppointmentDownload::getSynReqId).list();
|
|
|
+ for (ItfTblAssignAppointmentDownload a:appoint){
|
|
|
+ up.setId(order.getId());
|
|
|
+
|
|
|
+ up.setFirstAppointmentId(a.getCzren());
|
|
|
+ up.setExpectStartTime(a.getKssj());
|
|
|
+ up.setExpectEndTime(a.getJssj());
|
|
|
+
|
|
|
ItfTblAssignAppointmentDownload u = new ItfTblAssignAppointmentDownload();
|
|
|
u.setSynReqId(a.getSynReqId());
|
|
|
u.setSynStatus(1);
|
|
|
u.setSynTime(new Date());
|
|
|
- itfTblAssignAppointmentDownloadService.updateById(u);
|
|
|
+ us.add(u);
|
|
|
+ }
|
|
|
+ if (appoint !=null && appoint.size()>0){
|
|
|
+ if (StringUtils.isEmpty(order.getFirstAppointmentId())){
|
|
|
+ orderBaseService.updateById(up);
|
|
|
+ }
|
|
|
+ itfTblAssignAppointmentDownloadService.updateBatchById(us);
|
|
|
+ us.clear();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void generateXzyd(Brand brand, List<ItfTblAssignXzydDownload> yds, OrderBase order) {
|
|
|
+ List<OrderInformation> oilist = new ArrayList<>();
|
|
|
+ List<ItfTblAssignXzydDownload> ups = new ArrayList<>();
|
|
|
+
|
|
|
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);
|
|
|
+
|
|
|
+ getAddOrderInfor(brand, order, oilist, yd);
|
|
|
+
|
|
|
ItfTblAssignXzydDownload up = new ItfTblAssignXzydDownload();
|
|
|
up.setSynReqId(yd.getSynReqId());
|
|
|
up.setSynStatus(1);
|
|
|
up.setSynTime(new Date());
|
|
|
- itfTblAssignXzydDownloadService.updateById(up);
|
|
|
+ ups.add(up);
|
|
|
+ }
|
|
|
+ if (oilist.size()>0){
|
|
|
+ orderInformationService.saveBatch(oilist);
|
|
|
+ oilist.clear();
|
|
|
+ }
|
|
|
+ if (ups.size()>0){
|
|
|
+ itfTblAssignXzydDownloadService.updateBatchById(ups);
|
|
|
+ ups.clear();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void generateXzydUpdate(Brand brand, List<ItfTblAssignXzydDownload> yds, OrderBase order) {
|
|
|
+ List<OrderInformation> oilist = new ArrayList<>();
|
|
|
+ List<OrderInformation> oilistUp = new ArrayList<>();
|
|
|
+ List<ItfTblAssignXzydDownload> ups = new ArrayList<>();
|
|
|
+ Map<String,List<OrderInformation>> oisMap = new HashMap<>();
|
|
|
+
|
|
|
+ List<OrderInformation> ois = orderInformationService.lambdaQuery()
|
|
|
+ .eq(OrderInformation::getOrderBaseId,order.getId()).list();
|
|
|
+ oisMap = ois.stream().collect(Collectors.groupingBy(OrderInformation::getId));
|
|
|
+
|
|
|
+
|
|
|
+ for (ItfTblAssignXzydDownload yd: yds){
|
|
|
+
|
|
|
+ if (oisMap.containsKey(String.valueOf(yd.getXzid()))){
|
|
|
+ getUpOrderInfor(brand, oilistUp, yd);
|
|
|
+ } else {
|
|
|
+ getAddOrderInfor(brand, order, oilist, yd);
|
|
|
+ }
|
|
|
+
|
|
|
+ ItfTblAssignXzydDownload up = new ItfTblAssignXzydDownload();
|
|
|
+ up.setSynReqId(yd.getSynReqId());
|
|
|
+ up.setSynStatus(1);
|
|
|
+ up.setSynTime(new Date());
|
|
|
+ ups.add(up);
|
|
|
+ }
|
|
|
+ if (oilist.size()>0){
|
|
|
+ orderInformationService.saveBatch(oilist);
|
|
|
+ oilist.clear();
|
|
|
+ }
|
|
|
+ if (oilistUp.size()>0){
|
|
|
+ orderInformationService.updateBatchById(oilistUp);
|
|
|
+ oilistUp.clear();
|
|
|
+ }
|
|
|
+ if (ups.size()>0){
|
|
|
+ itfTblAssignXzydDownloadService.updateBatchById(ups);
|
|
|
+ ups.clear();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void getUpOrderInfor(Brand brand, List<OrderInformation> oilistUp, ItfTblAssignXzydDownload yd) {
|
|
|
+ OrderInformation up = new OrderInformation();
|
|
|
+ up.setId(String.valueOf(yd.getXzid()));
|
|
|
+ up.setAskCategoryId(yd.getXzyqlb());
|
|
|
+ up.setAskCategoryName(yd.getXzyq());
|
|
|
+ up.setReadStatus(yd.getYdbz());
|
|
|
+ up.setReadTime(yd.getYdsj());
|
|
|
+ up.setReadName(yd.getYdrmc());
|
|
|
+ WebsitSH websitSH = publicService.WebsitToSH(yd.getWdno(), brand.getBrandId());
|
|
|
+ up.setWebsitId(websitSH.getWdId());
|
|
|
+ up.setWebsitName(websitSH.getWdmc());
|
|
|
+ oilistUp.add(up);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void getAddOrderInfor(Brand brand, OrderBase order, List<OrderInformation> oilist, ItfTblAssignXzydDownload yd) {
|
|
|
+ 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());
|
|
|
+ oilist.add(add);
|
|
|
+ }
|
|
|
+
|
|
|
private void generateSstisfaction(Brand brand, ItfTblAssignDownload item, Map<String, List<SysDictRef>> sysDictRefDLMap, OrderBase order) {
|
|
|
List<ItfTblAssignSatisfactionDownload> satis = itfTblAssignSatisfactionDownloadService.lambdaQuery()
|
|
|
.eq(ItfTblAssignSatisfactionDownload::getDownloadTaskNo, item.getDownloadTaskNo())
|
|
|
+ .orderByAsc(ItfTblAssignSatisfactionDownload::getHfsj)
|
|
|
.list();
|
|
|
|
|
|
for (ItfTblAssignSatisfactionDownload s:satis){
|
|
@@ -568,8 +675,65 @@ public class RepairBusiness {
|
|
|
upSyncstatus(s.getSynReqId(), 9 ,"评价已同步,忽略更新");
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ Integer canInsert =1;
|
|
|
+
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (canInsert.equals(1)){
|
|
|
+
|
|
|
+ WebsitSH websitSH = addappraise(brand, sysDictRefDLMap, s);
|
|
|
+
|
|
|
+ addcpsms(order, s, websitSH);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (order.getAppraiseTime() ==null){
|
|
|
+
|
|
|
+ upOrderBasePJ(order, s);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ upSatisfactionSynstatus(s);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void generateSstisfactionUpdate(Brand brand, ItfTblAssignDownload item, Map<String, List<SysDictRef>> sysDictRefDLMap, OrderBase order) {
|
|
|
+ List<ItfTblAssignSatisfactionDownload> satis = itfTblAssignSatisfactionDownloadService.lambdaQuery()
|
|
|
+ .eq(ItfTblAssignSatisfactionDownload::getDownloadTaskNo, item.getDownloadTaskNo())
|
|
|
+ .orderByAsc(ItfTblAssignSatisfactionDownload::getHfsj)
|
|
|
+ .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())
|
|
|
+ .eq(ItfTblAssignSatisfactionDownload::getId,s.getId())
|
|
|
+ .le(ItfTblAssignSatisfactionDownload::getLastModifiedDate,s.getLastModifiedDate())
|
|
|
+ .eq(ItfTblAssignSatisfactionDownload::getPjly,s.getPjly()).list();
|
|
|
+ if (rec!=null && rec.size()>0){
|
|
|
+ upSyncstatus(s.getSynReqId(), 9 ,"评价已同步,忽略更新");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
Integer canInsert =1;
|
|
|
|
|
|
if (s.getSxlx().equals(0) && s.getSynStatus().equals(0)){
|
|
@@ -580,7 +744,7 @@ public class RepairBusiness {
|
|
|
canInsert = 0;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (canInsert.equals(1)){
|
|
|
|
|
|
WebsitSH websitSH = addappraise(brand, sysDictRefDLMap, s);
|
|
@@ -588,9 +752,10 @@ public class RepairBusiness {
|
|
|
addcpsms(order, s, websitSH);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- upOrderBasePJ(order, s);
|
|
|
+
|
|
|
+ if (order.getAppraiseTime() ==null){
|
|
|
+ upOrderBasePJ(order, s);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
upSatisfactionSynstatus(s);
|
|
@@ -629,7 +794,6 @@ public class RepairBusiness {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if (canAppeal){
|
|
|
ReAppointment req = new ReAppointment();
|
|
|
req.setId(String.valueOf(s.getPgid()));
|
|
@@ -706,43 +870,8 @@ public class RepairBusiness {
|
|
|
.orderByAsc(ItfTblAssignFkmxDownload::getCreatedDate,ItfTblAssignFkmxDownload::getFkid)
|
|
|
.list();
|
|
|
for (ItfTblAssignFkmxDownload fkmx :fkmxRec){
|
|
|
-
|
|
|
-
|
|
|
- OrderRepairOperatingLog add = new OrderRepairOperatingLog();
|
|
|
- add.setWebsitName(order.getWebsitName());
|
|
|
- add.setWebsitId(order.getWebsitId());
|
|
|
- add.setOrderBaseId(order.getId());
|
|
|
- add.setCustomerName(order.getUserName());
|
|
|
- add.setCustomerPhone(order.getUserMobile());
|
|
|
- add.setType(fkmx.getFklb());
|
|
|
- add.setContent(fkmx.getFknr());
|
|
|
- add.setFeedback(fkmx.getFkjg());
|
|
|
- add.setOperator(fkmx.getFkren());
|
|
|
- add.setOperatorNumber(fkmx.getFkrenmc());
|
|
|
- WebsitSH websitSH = publicService.WebsitToSH(fkmx.getFkwdno(), brand.getBrandId());
|
|
|
- add.setOperateWebsit(websitSH.getWdmc());
|
|
|
- add.setWebsitPhone(websitSH.getWdlxdh());
|
|
|
- add.setWorkerOrderStatus(order.getOrderStatus());
|
|
|
- add.setBeforeOrderStatus(order.getLastOrderStatus());
|
|
|
- add.setBeforeDispatchStatus(order.getDispatchStatus());
|
|
|
- add.setOrderStatus("DJS");
|
|
|
-
|
|
|
- add.setDispatchStatus("DJS");
|
|
|
-
|
|
|
- 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);
|
|
|
+
|
|
|
+ getoroldata(brand, order, orols, fkmx);
|
|
|
ItfTblAssignFkmxDownload u = new ItfTblAssignFkmxDownload();
|
|
|
u.setSynReqId(fkmx.getSynReqId());
|
|
|
u.setSynStatus(1);
|
|
@@ -757,6 +886,81 @@ public class RepairBusiness {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void generateFkmxUpdate(Brand brand, ItfTblAssignDownload item, OrderBase order) {
|
|
|
+ List<ItfTblAssignFkmxDownload> fkmxRec = new ArrayList<>();
|
|
|
+ List<OrderRepairOperatingLog> orols = new ArrayList<>();
|
|
|
+ List<ItfTblAssignFkmxDownload> ups = new ArrayList<>();
|
|
|
+ Map<String, List<OrderRepairOperatingLog>> orolMap = new HashMap<>();
|
|
|
+
|
|
|
+
|
|
|
+ List<OrderRepairOperatingLog> olds = orderRepairOperatingLogService.lambdaQuery()
|
|
|
+ .eq(OrderRepairOperatingLog::getOrderBaseId,order.getId()).list();
|
|
|
+ orolMap = olds.stream().collect(Collectors.groupingBy(OrderRepairOperatingLog::getFkid));
|
|
|
+
|
|
|
+
|
|
|
+ fkmxRec = itfTblAssignFkmxDownloadService.lambdaQuery()
|
|
|
+ .eq(ItfTblAssignFkmxDownload::getDownloadTaskNo, item.getDownloadTaskNo())
|
|
|
+ .eq(ItfTblAssignFkmxDownload::getSynStatus,0)
|
|
|
+ .orderByAsc(ItfTblAssignFkmxDownload::getCreatedDate,ItfTblAssignFkmxDownload::getFkid)
|
|
|
+ .list();
|
|
|
+ for (ItfTblAssignFkmxDownload fkmx :fkmxRec){
|
|
|
+
|
|
|
+ if (!orolMap.containsKey(fkmx.getFkid())){
|
|
|
+ getoroldata(brand, order, orols, fkmx);
|
|
|
+ }
|
|
|
+
|
|
|
+ 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 getoroldata(Brand brand, OrderBase order, List<OrderRepairOperatingLog> orols, ItfTblAssignFkmxDownload fkmx) {
|
|
|
+ OrderRepairOperatingLog add = new OrderRepairOperatingLog();
|
|
|
+ add.setWebsitName(order.getWebsitName());
|
|
|
+ add.setWebsitId(order.getWebsitId());
|
|
|
+ add.setOrderBaseId(order.getId());
|
|
|
+ add.setCustomerName(order.getUserName());
|
|
|
+ add.setCustomerPhone(order.getUserMobile());
|
|
|
+ add.setType(fkmx.getFklb());
|
|
|
+ add.setContent(fkmx.getFknr());
|
|
|
+ add.setFeedback(fkmx.getFkjg());
|
|
|
+ add.setOperator(fkmx.getFkren());
|
|
|
+ add.setOperatorNumber(fkmx.getFkrenmc());
|
|
|
+ WebsitSH websitSH = publicService.WebsitToSH(fkmx.getFkwdno(), brand.getBrandId());
|
|
|
+ add.setOperateWebsit(websitSH.getWdmc());
|
|
|
+ add.setWebsitPhone(websitSH.getWdlxdh());
|
|
|
+ add.setWorkerOrderStatus(order.getOrderStatus());
|
|
|
+ add.setBeforeOrderStatus(order.getLastOrderStatus());
|
|
|
+ add.setBeforeDispatchStatus(order.getDispatchStatus());
|
|
|
+ add.setOrderStatus("DJS");
|
|
|
+
|
|
|
+ add.setDispatchStatus("DJS");
|
|
|
+
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
private void getOrderInstall(ItfTblAssignDownload item, OrderBase order) {
|
|
|
OrderInstall oit = new OrderInstall();
|
|
|
oit.setOrderBaseId(order.getId());
|
|
@@ -843,13 +1047,11 @@ public class RepairBusiness {
|
|
|
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));
|
|
|
+ opsMap = ops.stream().collect(Collectors.groupingBy(OrderProduct::getPgmxid));
|
|
|
|
|
|
|
|
|
mxRec = itfTblAssignMxDownloadService.lambdaQuery()
|