|
@@ -15,6 +15,7 @@ import com.zfire.jiasm.syncdata.response.WebsitFWS;
|
|
|
import com.zfire.jiasm.syncdata.service.OrderService;
|
|
|
import com.zfire.jiasm.syncdata.service.PublicService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
@@ -206,10 +207,10 @@ public class InstallBusiness {
|
|
|
OrderInstall oldOrderInstall = orderInstallService.lambdaQuery()
|
|
|
.eq(OrderInstall::getOrderBaseId,old.getId()).one();
|
|
|
// 获取安装费用清单
|
|
|
- ItfTblAzAssignFeeDownload fyqd = itfTblAzAssignFeeDownloadService.lambdaQuery()
|
|
|
+ List<ItfTblAzAssignFeeDownload> fyqd = itfTblAzAssignFeeDownloadService.lambdaQuery()
|
|
|
.eq(ItfTblAzAssignFeeDownload::getDownloadTaskNo, item.getDownloadTaskNo())
|
|
|
.eq(ItfTblAzAssignFeeDownload::getSynStatus,0)
|
|
|
- .one();
|
|
|
+ .list();
|
|
|
OrderInstall orderInstall = getOrderInstall(newLCLS, brand, item, fyqd);
|
|
|
// 已同步的有数据,后期的一定有数据 直接修改
|
|
|
if (oldOrderInstall != null && orderInstall!=null){
|
|
@@ -232,7 +233,7 @@ public class InstallBusiness {
|
|
|
public void addOrUpdateOrderData(ItfTblAzAssignLcLsDownload item, OrderBase upInfo, OrderWorker own,
|
|
|
List<ItfTblAzAssignMxDownload> mxsynreqids, List<OrderProduct> orderProductsUpdate,
|
|
|
List<ItfTblAzAssignFkmxDownload> synreqids, List<OrderInstallOperatingLog> addoiolList,
|
|
|
- ItfTblAzAssignFeeDownload fyqd, OrderInstall orderInstall, List<Long> synReqYfYyIds,
|
|
|
+ List<ItfTblAzAssignFeeDownload> fyqd, OrderInstall orderInstall, List<Long> synReqYfYyIds,
|
|
|
List<OrderReAppointment> addoalists, List<Long> getpjSynReqId, List<OrderAppraise> addoalist) {
|
|
|
// 同步修改订单基础表
|
|
|
if (upInfo !=null){
|
|
@@ -840,10 +841,11 @@ public class InstallBusiness {
|
|
|
// 获取工单操作明细- 操作日志表
|
|
|
List<OrderInstallOperatingLog> oiolList = getOrderInstallOperatingLogs(fkmxs, orderBase, brand, item);
|
|
|
// 获取安装费用清单 - 对应扩展表
|
|
|
- ItfTblAzAssignFeeDownload fyqd = itfTblAzAssignFeeDownloadService.lambdaQuery()
|
|
|
+ List<ItfTblAzAssignFeeDownload> fyqd = itfTblAzAssignFeeDownloadService.lambdaQuery()
|
|
|
.eq(ItfTblAzAssignFeeDownload::getDownloadTaskNo, item.getDownloadTaskNo())
|
|
|
.eq(ItfTblAzAssignFeeDownload::getSynStatus,0)
|
|
|
- .one();
|
|
|
+ .orderByDesc(ItfTblAzAssignFeeDownload::getSynReqId)
|
|
|
+ .list();
|
|
|
// 获取工单扩展信息 - 费用清单是不能放在扩展表的,这里有误 从订单表取才可以
|
|
|
OrderInstall orderInstall = getOrderInstall(orderBase, brand, item, fyqd);
|
|
|
// 获取用户预约改约信息
|
|
@@ -872,7 +874,7 @@ public class InstallBusiness {
|
|
|
public void addOrderData(OrderBase orderBase, OrderWorker orderWorker, OrderInstall orderInstall, List<OrderProduct> orderProducts,
|
|
|
List<OrderInstallOperatingLog> oiolList, List<OrderReAppointment> oa, List<OrderAppraise> oanew,
|
|
|
Long synReqId, List<Long> synReqIds, List<Long> synReqFkMxIds, List<Long> synReqYfYyIds,
|
|
|
- ItfTblAzAssignFeeDownload fyqd, List<Long> getpjSynReqId) {
|
|
|
+ List<ItfTblAzAssignFeeDownload> fyqd, List<Long> getpjSynReqId) {
|
|
|
// 工单基础表
|
|
|
if (orderBase != null) {
|
|
|
orderBaseService.save(orderBase);
|
|
@@ -908,7 +910,7 @@ public class InstallBusiness {
|
|
|
if (orderInstall != null){
|
|
|
orderInstallService.save(orderInstall);
|
|
|
}
|
|
|
- if (fyqd !=null){
|
|
|
+ if (CollectionUtils.isNotEmpty(fyqd)){
|
|
|
upItfTblAzAssignFeeDownload(fyqd);
|
|
|
}
|
|
|
|
|
@@ -933,13 +935,17 @@ public class InstallBusiness {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void upItfTblAzAssignFeeDownload(ItfTblAzAssignFeeDownload fyqd) {
|
|
|
- ItfTblAzAssignFeeDownload add = new ItfTblAzAssignFeeDownload();
|
|
|
- add.setSynReqId(fyqd.getSynReqId());
|
|
|
- add.setSynStatus(1);
|
|
|
- add.setSynTime(new Date());
|
|
|
- add.setSynErrMsg("成功");
|
|
|
- itfTblAzAssignFeeDownloadService.updateById(add);
|
|
|
+ private void upItfTblAzAssignFeeDownload(List<ItfTblAzAssignFeeDownload> fyqd) {
|
|
|
+ List<ItfTblAzAssignFeeDownload> adds = new ArrayList<>();
|
|
|
+ for (ItfTblAzAssignFeeDownload item:fyqd){
|
|
|
+ ItfTblAzAssignFeeDownload add = new ItfTblAzAssignFeeDownload();
|
|
|
+ add.setSynReqId(item.getSynReqId());
|
|
|
+ add.setSynStatus(1);
|
|
|
+ add.setSynTime(new Date());
|
|
|
+ add.setSynErrMsg("成功");
|
|
|
+ adds.add(add);
|
|
|
+ }
|
|
|
+ itfTblAzAssignFeeDownloadService.updateBatchById(adds);
|
|
|
}
|
|
|
|
|
|
private void upItfTblAzAssignMxDownload(List<Long> synReqIds) {
|
|
@@ -1082,13 +1088,13 @@ public class InstallBusiness {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private OrderInstall getOrderInstall(OrderBase orderBase, Brand brand, ItfTblAzAssignLcLsDownload item,ItfTblAzAssignFeeDownload fyqd) {
|
|
|
+ private OrderInstall getOrderInstall(OrderBase orderBase, Brand brand, ItfTblAzAssignLcLsDownload item,List<ItfTblAzAssignFeeDownload> fyqd) {
|
|
|
OrderInstall orderInstall = new OrderInstall();
|
|
|
WebsitFWS websitFWS = new WebsitFWS();
|
|
|
|
|
|
- if (fyqd !=null){
|
|
|
+ if (CollectionUtils.isNotEmpty(fyqd)){
|
|
|
OrderPar request = new OrderPar();
|
|
|
- request.setSynReqId(fyqd.getSynReqId());
|
|
|
+ request.setSynReqId(fyqd.get(0).getSynReqId());
|
|
|
request.setBrandId(brand.getBrandId());
|
|
|
request.setMainSynReqId(item.getSynReqId());
|
|
|
|