|
@@ -111,17 +111,28 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
|
|
|
OrderService orderService;
|
|
|
|
|
|
@Override
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
- public Boolean orderBaseInstallCjOrWg(String cjOrWg, Brand brand, OutJiasmToGreeUploadTaskList ojtutl, Map<String, List<SysDictRef>> CategoryRefmap){
|
|
|
+ public Boolean orderBaseInstallCjOrWg(String cjOrWg, Brand brand, OutJiasmToGreeUploadTaskList ojtutl,
|
|
|
+ Map<String, List<SysDictRef>> CategoryRefmap){
|
|
|
OrderBase orderBase = orderBaseService.lambdaQuery()
|
|
|
.eq(OrderBase::getId, ojtutl.getId())
|
|
|
.last("limit 1")
|
|
|
.one();
|
|
|
+
|
|
|
+ // 采集表与采集条码表ID超范围 - 采集表及采集条码明细表中的outid统一修改
|
|
|
+ upOutId(ojtutl.getId());
|
|
|
if (orderBase !=null ){
|
|
|
// 安装工单产品信息,操作日志,完工明细,完工明细附件
|
|
|
// 预约改约-总部短信发送请求表,派服务人员-短信发送请求表 以主表的pgguid统一修改
|
|
|
upPgguid(orderBase);
|
|
|
+ }
|
|
|
|
|
|
+ return orderInstallCjOrWg(cjOrWg, brand, ojtutl, CategoryRefmap,orderBase);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public Boolean orderInstallCjOrWg(String cjOrWg, Brand brand, OutJiasmToGreeUploadTaskList ojtutl,
|
|
|
+ Map<String, List<SysDictRef>> CategoryRefmap, OrderBase orderBase){
|
|
|
+ if (orderBase !=null ){
|
|
|
// 生成待同步的安装工单主表
|
|
|
ItfTblAzAssignLcLsUpload lcls = getItfTblAzAssignLcLsUpload(brand, orderBase);
|
|
|
// 1: 插入工单主表数据
|
|
@@ -139,12 +150,12 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
|
|
|
("wg".equals(cjOrWg) && detail.getIsWgSend().equals("NO")))) {
|
|
|
// 生成taskno,pgwcmxid 共用
|
|
|
String taskno = IdWorker.getIdStr();
|
|
|
- String pgwcmxid = IdWorker.getIdStr();
|
|
|
+
|
|
|
// 根据产品类别名称 生成不同的完工明细数据
|
|
|
String mainName = CategoryRefmap.get(orderBase.getMainId()).get(0).getRefDictName();
|
|
|
|
|
|
// 数据生成
|
|
|
- if (! installDtailJS(cjOrWg, brand, orderBase, lcls, detail, taskno, pgwcmxid, mainName,ojtutl.getSynReqId())){
|
|
|
+ if (! installDtailJS(cjOrWg, brand, orderBase, lcls, detail, taskno, mainName,ojtutl.getSynReqId())){
|
|
|
return Boolean.FALSE;
|
|
|
}
|
|
|
|
|
@@ -367,6 +378,14 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
|
|
|
private void setWebsit(Brand brand, OrderBase orderBase, ItfTblAzAssignLcLsUpload lcls) {
|
|
|
WebsitSH websitSH = new WebsitSH();
|
|
|
|
|
|
+ // 创建人及创建人名称改为对应的创建网点
|
|
|
+ websitSH = publicService.ptxswdToshxswd(lcls.getCjren(), orderBase.getMainId());
|
|
|
+ if (StringUtils.isEmpty(websitSH.getWdId())){
|
|
|
+ websitSH = publicService.ptshwdToshshwd(lcls.getCjren(), orderBase.getMainId());
|
|
|
+ }
|
|
|
+ lcls.setCjren(websitSH.getWdId());
|
|
|
+ lcls.setCjrmc(websitSH.getWdmc());
|
|
|
+
|
|
|
// 销售单位处理 xsdwno
|
|
|
websitSH = publicService.ptxswdToshxswd(lcls.getXsdwno(), orderBase.getMainId());
|
|
|
lcls.setXsdwno(websitSH.getWdId());
|
|
@@ -425,10 +444,10 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
|
|
|
}
|
|
|
|
|
|
private Boolean installDtailJS(String cjOrWg, Brand brand, OrderBase orderBase, ItfTblAzAssignLcLsUpload lcls,
|
|
|
- OrderInstallDetail detail, String taskno, String pgwcmxid, String mainName,
|
|
|
+ OrderInstallDetail detail, String taskno, String mainName,
|
|
|
Long synReqId) {
|
|
|
// 获取完工采集明细数据 (家用空调、商用空调、其他) TL_fa_order_install_detail_js
|
|
|
- if (!getCJMXDataCj(cjOrWg, brand, orderBase, lcls, detail, pgwcmxid, mainName, taskno)){
|
|
|
+ if (!getCJMXDataCj(cjOrWg, brand, orderBase, lcls, detail, mainName, taskno)){
|
|
|
return Boolean.FALSE;
|
|
|
}
|
|
|
|
|
@@ -852,13 +871,13 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
|
|
|
}
|
|
|
|
|
|
private Boolean getCJMXDataCj(String cjOrWg, Brand brand, OrderBase orderBase, ItfTblAzAssignLcLsUpload lcls,
|
|
|
- OrderInstallDetail item, String pgwcmxid, String mainName, String taskno) {
|
|
|
- if (org.apache.commons.lang3.StringUtils.isEmpty(item.getPgwcmxid())){
|
|
|
+ OrderInstallDetail item, String mainName, String taskno) {
|
|
|
+ /*if (org.apache.commons.lang3.StringUtils.isEmpty(item.getPgwcmxid())){
|
|
|
item.setPgwcmxid(pgwcmxid);
|
|
|
item.updateById();
|
|
|
}
|
|
|
// 采集表与采集条码表ID超范围 - 采集表及采集条码明细表中的outid统一修改
|
|
|
- upOutId(item);
|
|
|
+ upOutId(item);*/
|
|
|
|
|
|
// 采集标志 1100:保存,1110:作废,1120:转结算
|
|
|
Integer cjstat = 1100;
|
|
@@ -873,8 +892,8 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
|
|
|
cjstat = 1110;
|
|
|
}
|
|
|
// 修改首次提交时间
|
|
|
- item.setFirstTime(new Date());
|
|
|
- item.updateById();
|
|
|
+ /*item.setFirstTime(new Date());
|
|
|
+ item.updateById();*/
|
|
|
|
|
|
InstallDetail request = new InstallDetail();
|
|
|
request.setOrderNo(item.getOrderBaseId());
|
|
@@ -951,10 +970,11 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
|
|
|
return itfTblazwgmxqitaService.save(ta);
|
|
|
}
|
|
|
|
|
|
- private void upOutId(OrderInstallDetail detail) {
|
|
|
+ @Override
|
|
|
+ public void upOutId(String orderBaseId) {
|
|
|
List<OrderInstallDetail> upList = new ArrayList<>();
|
|
|
List<OrderInstallDetail> detaillist = orderInstallDetailService.lambdaQuery()
|
|
|
- .eq(OrderInstallDetail::getOrderBaseId, detail.getOrderBaseId())
|
|
|
+ .eq(OrderInstallDetail::getOrderBaseId, orderBaseId)
|
|
|
.list();
|
|
|
// 找出最大的序 默认值为0
|
|
|
int outId=0;
|
|
@@ -968,6 +988,9 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
|
|
|
if (ite.getOutId() == 0){
|
|
|
outId++;
|
|
|
ite.setOutId(outId);
|
|
|
+ // 修改首次提交时间
|
|
|
+ ite.setFirstTime(new Date());
|
|
|
+ ite.setPgwcmxid(IdWorker.getIdStr());
|
|
|
upList.add(ite);
|
|
|
}
|
|
|
}
|
|
@@ -982,11 +1005,11 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
|
|
|
// 采集条码码 outid统一修改
|
|
|
// 采集表与采集条码表ID超范围 - 采集表及采集明细表中的outid统一修改
|
|
|
List<OrderInstallDetailCode> codelist = orderInstallDetailCodeService.lambdaQuery()
|
|
|
- .eq(OrderInstallDetailCode::getOrderBaseId, detail.getOrderBaseId())
|
|
|
+ .eq(OrderInstallDetailCode::getOrderBaseId, orderBaseId)
|
|
|
.eq(OrderInstallDetailCode::getOutId,0).list();
|
|
|
if (CollectionUtils.isNotEmpty(codelist)){
|
|
|
InstalDetailCode codep = new InstalDetailCode();
|
|
|
- codep.setOrderNo(detail.getOrderBaseId());
|
|
|
+ codep.setOrderNo(orderBaseId);
|
|
|
codeOrderInstallDetailMapper.updateCodeOutId(codep);
|
|
|
}
|
|
|
}
|