|
@@ -96,7 +96,7 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void addOrder(Map<String, List<SysDictRef>> sysDictRefDLMap, Map<String, List<SysDictRef>> sysDictRefXLMap,
|
|
|
- Map<String, List<SysDictRef>> sysDictRefXiLieMap, Brand brand, ItfTblAzAssignLcLsDownload item) {
|
|
|
+ Map<String, List<SysDictRef>> sysDictRefXiLieMap, Brand brand, ItfTblAzAssignLcLsDownload item, Map<String,String> productMap) {
|
|
|
List<OrderReAppointment> oa = new ArrayList<>();
|
|
|
List<OrderAppraise> oanew = new ArrayList<>();
|
|
|
List<OrderProduct> orderProducts = new ArrayList<>();
|
|
@@ -143,7 +143,8 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
// 获取工单师傅信息
|
|
|
OrderWorker orderWorker = getOrderWorker(orderBase);
|
|
|
// 获取工单机型 + 生成采集明细数据+附件数据
|
|
|
- getOrderProduct(orderBase, orderProducts, sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap, orderMx,oids,odfs);
|
|
|
+ getOrderProduct(orderBase, orderProducts, sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap,
|
|
|
+ orderMx,oids,odfs, productMap);
|
|
|
// 获取工单操作明细- 操作日志表
|
|
|
List<OrderInstallOperatingLog> oiolList = getOrderInstallOperatingLogs(fkmxs, orderBase,item);
|
|
|
// 获取安装费用清单 - 对应扩展表
|
|
@@ -176,7 +177,8 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void addOrderApi(Map<String, List<SysDictRef>> sysDictRefDLMap, Map<String, List<SysDictRef>> sysDictRefXLMap,
|
|
|
- Map<String, List<SysDictRef>> sysDictRefXiLieMap, Brand brand, ItfTblAzAssignLcLsDownload item, Boolean flag) throws Exception {
|
|
|
+ Map<String, List<SysDictRef>> sysDictRefXiLieMap, Brand brand,
|
|
|
+ ItfTblAzAssignLcLsDownload item, Boolean flag, Map<String,String> productMap) throws Exception {
|
|
|
List<OrderReAppointment> oa = new ArrayList<>();
|
|
|
List<OrderAppraise> oanew = new ArrayList<>();
|
|
|
List<OrderProduct> orderProducts = new ArrayList<>();
|
|
@@ -216,7 +218,8 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
// 获取工单师傅信息
|
|
|
OrderWorker orderWorker = getOrderWorker(orderBase);
|
|
|
// 获取工单机型 + 生成采集明细数据+附件数据
|
|
|
- getOrderProduct(orderBase, orderProducts, sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap, orderMx,oids,odfs);
|
|
|
+ getOrderProduct(orderBase, orderProducts, sysDictRefDLMap, sysDictRefXLMap,
|
|
|
+ sysDictRefXiLieMap, orderMx,oids,odfs, productMap);
|
|
|
|
|
|
// 获取工单操作明细- 操作日志表
|
|
|
List<OrderInstallOperatingLog> oiolList = getOrderInstallOperatingLogs(fkmxs, orderBase, item);
|
|
@@ -341,8 +344,8 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
OrderWorker own =getOrderWorkerUpdate(old.getId(), upInfo, newLCLS);
|
|
|
|
|
|
// 获取产品明细要同步的数据 -只存在修改,减少与增加的情况不存在
|
|
|
- getOrderProductsUpdate(sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap, old, newLCLS,
|
|
|
- item.getDownloadTaskNo(),mxsynreqids,orderProductsUpdate,oids,delOrderInstallDetail,odfs,delOrderProduct);
|
|
|
+ /*getOrderProductsUpdate(sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap, old, newLCLS,
|
|
|
+ item.getDownloadTaskNo(),mxsynreqids,orderProductsUpdate,oids,delOrderInstallDetail,odfs,delOrderProduct);*/
|
|
|
|
|
|
// 获取操作明细同步数据,即反馈明细
|
|
|
addoiolList = getOrderInstallOperatingLogsadd(item, old, newLCLS, synreqids);
|
|
@@ -380,7 +383,8 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void updateOrderApi(Map<String, List<SysDictRef>> sysDictRefDLMap, Map<String, List<SysDictRef>> sysDictRefXLMap,
|
|
|
- Map<String, List<SysDictRef>> sysDictRefXiLieMap, Brand brand, ItfTblAzAssignLcLsDownload item, Boolean flag) throws Exception {
|
|
|
+ Map<String, List<SysDictRef>> sysDictRefXiLieMap, Brand brand,
|
|
|
+ ItfTblAzAssignLcLsDownload item, Boolean flag, Map<String,String> productMap) throws Exception {
|
|
|
List<Long> synReqYfYyIds = new ArrayList<>();
|
|
|
List<OrderReAppointment> addoalists = new ArrayList<>();
|
|
|
List<ItfTblAzAssignMxDownload> mxsynreqids = new ArrayList<>();
|
|
@@ -426,7 +430,8 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
|
|
|
// 获取产品明细要同步的数据 -只存在修改,减少与增加的情况不存在
|
|
|
getOrderProductsUpdate(sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap, old, newLCLS,
|
|
|
- item.getDownloadTaskNo(),mxsynreqids,orderProductsUpdate,oids,delOrderInstallDetail,odfs,delOrderProduct);
|
|
|
+ item.getDownloadTaskNo(),mxsynreqids,orderProductsUpdate,oids,delOrderInstallDetail,
|
|
|
+ odfs,delOrderProduct, productMap);
|
|
|
|
|
|
// 获取操作明细同步数据,即反馈明细
|
|
|
addoiolList = getOrderInstallOperatingLogsadd(item, old, newLCLS, synreqids);
|
|
@@ -944,7 +949,7 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
List<OrderProduct> orderProductsUpdate,
|
|
|
List<OrderInstallDetail> oids,List<String> oiddels,
|
|
|
List<OrderDetailFile> odfs,
|
|
|
- List<String> delOrderProduct) {
|
|
|
+ List<String> delOrderProduct, Map<String,String> productMap) {
|
|
|
List<OrderProduct> orderProductsOld = new ArrayList<>();
|
|
|
List<String> orderMxList = new ArrayList<>();
|
|
|
|
|
@@ -964,7 +969,7 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
|
|
|
// 新增或是修改
|
|
|
if (addOrUp(sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap, old, newLCLS, synreqids,
|
|
|
- orderProductsUpdate, oids, oiddels, odfs, orderProductsOld,orderMx)){
|
|
|
+ orderProductsUpdate, oids, oiddels, odfs, orderProductsOld,orderMx, productMap)){
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -991,7 +996,7 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
List<ItfTblAzAssignMxDownload> synreqids, List<OrderProduct> orderProductsUpdate,
|
|
|
List<OrderInstallDetail> oids, List<String> oiddels, List<OrderDetailFile> odfs,
|
|
|
List<OrderProduct> orderProductsOld,
|
|
|
- List<ItfTblAzAssignMxDownload> orderMx) {
|
|
|
+ List<ItfTblAzAssignMxDownload> orderMx, Map<String,String> productMap) {
|
|
|
// 提取现有的采集明细数据
|
|
|
List<OrderInstallDetail> oldOids = new ArrayList<>();
|
|
|
Map<String,List<OrderProduct>> oldProductMap = new HashMap<>();
|
|
@@ -1005,7 +1010,8 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
for (ItfTblAzAssignMxDownload mx: orderMx){
|
|
|
// 这里做法为重新生成新的产品机型,然后与本地比较是新增还是修改
|
|
|
// 生成工单产品对象 获取新同步的工单机型
|
|
|
- OrderProduct n = getProductInfo(sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap, newLCLS, mx);
|
|
|
+ OrderProduct n = getProductInfo(sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap,
|
|
|
+ newLCLS, mx, productMap);
|
|
|
// 存在修改 不存在新增
|
|
|
for (OrderProduct o : orderProductsOld) {
|
|
|
if (n.getPgmxid().equals(o.getPgmxid())) {
|
|
@@ -1116,7 +1122,8 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
private OrderProduct getProductInfo(Map<String, List<SysDictRef>> sysDictRefDLMap,
|
|
|
Map<String, List<SysDictRef>> sysDictRefXLMap,
|
|
|
Map<String, List<SysDictRef>> sysDictRefXiLieMap,
|
|
|
- OrderBase newLCLS, ItfTblAzAssignMxDownload mx) {
|
|
|
+ OrderBase newLCLS, ItfTblAzAssignMxDownload mx,
|
|
|
+ Map<String,String> productMap) {
|
|
|
OrderProduct op = new OrderProduct();
|
|
|
op.setId(publicService.getUUID());
|
|
|
op.setOrderBaseId(newLCLS.getId());
|
|
@@ -1146,7 +1153,13 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- op.setProductId(mx.getJxno());
|
|
|
+ // 改成 product 表中的 product_id
|
|
|
+ // op.setProductId(mx.getJxno());
|
|
|
+ op.setProductId("");
|
|
|
+ if (productMap.containsKey(mx.getJxno())){
|
|
|
+ op.setProductId(productMap.get(mx.getJxno()));
|
|
|
+ }
|
|
|
+
|
|
|
op.setProductName(mx.getJxmc());
|
|
|
op.setInsideCode(mx.getNjtm());
|
|
|
op.setOutCode(mx.getWjtm());
|
|
@@ -2594,10 +2607,10 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
|
|
|
// pgmxid主键
|
|
|
// 生成工单产品对象
|
|
|
- for (ItfTblAzAssignMxDownload mx:orderMx){
|
|
|
+ /*for (ItfTblAzAssignMxDownload mx:orderMx){
|
|
|
OrderProduct op = getOrderProduct(orderBase, orderProducts, sysDictRefDLMap, sysDictRefXLMap,
|
|
|
sysDictRefXiLieMap, mx);
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
|
|
|
|
|
@@ -2605,7 +2618,7 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
List<SysDictRef>> sysDictRefDLMap, Map<String, List<SysDictRef>> sysDictRefXLMap,
|
|
|
Map<String, List<SysDictRef>> sysDictRefXiLieMap,
|
|
|
List<ItfTblAzAssignMxDownload> orderMx,List<OrderInstallDetail> oids,
|
|
|
- List<OrderDetailFile> odfs) {
|
|
|
+ List<OrderDetailFile> odfs, Map<String,String> productMap) {
|
|
|
int insertnum=1;
|
|
|
int outid=1;
|
|
|
|
|
@@ -2614,7 +2627,7 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
insertnum=1;
|
|
|
outid=1;
|
|
|
// 生成工单产品对象
|
|
|
- OrderProduct op = getOrderProduct(orderBase, orderProducts, sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap, mx);
|
|
|
+ OrderProduct op = getOrderProduct(orderBase, orderProducts, sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap, mx, productMap);
|
|
|
// 生成采集明细数据+附件数据
|
|
|
// 总数量一条条插入,内外机数量不再拆分
|
|
|
// extracted(orderBase, oids, odfs, insertnum, outid, mx, op);
|
|
@@ -2649,7 +2662,7 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
|
|
|
private OrderProduct getOrderProduct(OrderBase orderBase, List<OrderProduct> orderProducts,
|
|
|
Map<String, List<SysDictRef>> sysDictRefDLMap, Map<String, List<SysDictRef>> sysDictRefXLMap,
|
|
|
- Map<String, List<SysDictRef>> sysDictRefXiLieMap, ItfTblAzAssignMxDownload mx) {
|
|
|
+ Map<String, List<SysDictRef>> sysDictRefXiLieMap, ItfTblAzAssignMxDownload mx, Map<String,String> productMap) {
|
|
|
OrderProduct op = new OrderProduct();
|
|
|
op.setId(publicService.getUUID());
|
|
|
op.setOrderBaseId(orderBase.getId());
|
|
@@ -2678,7 +2691,12 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
}
|
|
|
|
|
|
// 改成 product 表中的 product_id
|
|
|
- op.setProductId(mx.getJxno());
|
|
|
+ // op.setProductId(mx.getJxno());
|
|
|
+ op.setProductId("");
|
|
|
+ if (productMap.containsKey(mx.getJxno())){
|
|
|
+ op.setProductId(productMap.get(mx.getJxno()));
|
|
|
+ }
|
|
|
+
|
|
|
op.setProductName(mx.getJxmc());
|
|
|
op.setInsideCode(mx.getNjtm());
|
|
|
op.setOutCode(mx.getWjtm());
|
|
@@ -2845,6 +2863,9 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
|
|
|
// 生成工单基础表 对象
|
|
|
orderBase = azGDLcLsDownloadMapper.getOrderBase(orderPar);
|
|
|
+ // 处理用户等级
|
|
|
+ publicService.setUserLevel(orderBase);
|
|
|
+
|
|
|
// 未完成数据修改 如果工单关闭就用wwsl,否则用安装数量
|
|
|
if (!(item.getDqjd().equals(1304) || item.getDqjd().equals(1309))){
|
|
|
orderBase.setUndoneNum(item.getAzsl());
|
|
@@ -2924,6 +2945,8 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
orderPar.setBrandId(brand.getBrandId());
|
|
|
// 生成工单基础表 对象
|
|
|
orderBase = azGDLcLsDownloadMapper.getOrderBase(orderPar);
|
|
|
+ // 处理用户等级
|
|
|
+ publicService.setUserLevel(orderBase);
|
|
|
|
|
|
// 总部的为 1302 无对应关系,根据工单的过程处理
|
|
|
if (StringUtils.isEmpty(orderBase.getOrderStatus())){
|