|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.zfire.jiasm.syncdata.base.BaseService;
|
|
|
+import com.zfire.jiasm.syncdata.constant.GDAppointStatusEnum;
|
|
|
import com.zfire.jiasm.syncdata.constant.GDOrderStatusEnum;
|
|
|
import com.zfire.jiasm.syncdata.dao.mapper.*;
|
|
|
import com.zfire.jiasm.syncdata.gree.GreeLogic;
|
|
@@ -14,6 +15,7 @@ import com.zfire.jiasm.syncdata.parameter.*;
|
|
|
import com.zfire.jiasm.syncdata.plus.entity.*;
|
|
|
import com.zfire.jiasm.syncdata.plus.service.*;
|
|
|
import com.zfire.jiasm.syncdata.response.ResultData;
|
|
|
+import com.zfire.jiasm.syncdata.response.WebsitFWS;
|
|
|
import com.zfire.jiasm.syncdata.response.WebsitSH;
|
|
|
import com.zfire.jiasm.syncdata.service.OrderService;
|
|
|
import com.zfire.jiasm.syncdata.service.PublicService;
|
|
@@ -23,11 +25,13 @@ import com.zfire.jiasm.syncdata.utils.oss.OSSUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
+import org.jetbrains.annotations.Nullable;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.io.File;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
|
|
|
@Slf4j
|
|
@@ -109,6 +113,66 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
|
|
|
FaGreeSmsWorkerService faGreeSmsWorkerService;
|
|
|
@Resource
|
|
|
OrderService orderService;
|
|
|
+ @Resource
|
|
|
+ OutJiasmToGreeUploadTaskListService outJiasmToGreeUploadTaskListService;
|
|
|
+ @Resource
|
|
|
+ OrderInstallService orderInstallService;
|
|
|
+ @Resource
|
|
|
+ ItfTblAzAssignFeeUploadService itfTblAzAssignFeeUploadService;
|
|
|
+ @Resource
|
|
|
+ OrderPayOutlayItemService orderPayOutlayItemService;
|
|
|
+ @Resource
|
|
|
+ ItfMessagehuifangentityService itfMessagehuifangentityService;
|
|
|
+ @Resource
|
|
|
+ ItfTblAzWgmxQitaTmmxUploadService itfTblAzWgmxQitaTmmxUploadService;
|
|
|
+ @Resource
|
|
|
+ ItfTblAzWgmxJyktTmmxUploadService itfTblAzWgmxJyktTmmxUploadService;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean orderBaseInstall(Brand brand, @NotNull OutJiasmToGreeUploadTaskList ojtutl, Map<String, List<SysDictRef>> CategoryRefmap){
|
|
|
+ OrderBase orderBase = orderBaseService.lambdaQuery()
|
|
|
+ .eq(OrderBase::getId, ojtutl.getId())
|
|
|
+ .last("limit 1")
|
|
|
+ .one();
|
|
|
+
|
|
|
+ if (orderBase !=null ){
|
|
|
+ // 若工单被删除不再同步 不写生成数据
|
|
|
+
|
|
|
+ // 条件判断
|
|
|
+ if (!checkPare(ojtutl, orderBase)) {
|
|
|
+ return Boolean.FALSE;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 修改采集明细表与采集条码表ID超范围 - 采集表及采集条码明细表中的outid统一修改
|
|
|
+ // 修改采集明细表与采集条码表 outid 依采集明细表的outid为准
|
|
|
+ upOutId(ojtutl.getId());
|
|
|
+
|
|
|
+ // 采集明细表中的pgguid 改成工单基础表的pgguid
|
|
|
+ upInstallDetailPgguid(orderBase);
|
|
|
+
|
|
|
+ // 修改采集明细的序 pgwcmxid(自生成) 生成格力总部-采集明细序号
|
|
|
+ upPgwcmxid(ojtutl);
|
|
|
+
|
|
|
+ // 采集条码表中的pgguid 统一改成工单基础表的pgguid,tmguid自生成
|
|
|
+ upOrderInstallDetailCodePgguid(ojtutl, orderBase);
|
|
|
+
|
|
|
+ // 上传附件表图片信息
|
|
|
+ uploadOrderDetailFile(ojtutl, CategoryRefmap, orderBase);
|
|
|
+
|
|
|
+ // 管理端采集的条码图并没全部给到采集条码表中,这里需要转移到采集条码表中
|
|
|
+ List<OrderInstallDetail> details = orderInstallDetailService.lambdaQuery()
|
|
|
+ .eq(OrderInstallDetail::getOrderBaseId, orderBase.getId()).list();
|
|
|
+ for (OrderInstallDetail detail:details){
|
|
|
+ upCodep(detail);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return orderBaseInstallProc(brand, ojtutl, CategoryRefmap, orderBase);
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public Boolean orderBaseInstallCjOrWg(String cjOrWg, Brand brand, OutJiasmToGreeUploadTaskList ojtutl,
|
|
@@ -130,6 +194,573 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
+ public boolean orderBaseInstallProc(Brand brand, OutJiasmToGreeUploadTaskList ojtutl,
|
|
|
+ Map<String, List<SysDictRef>> CategoryRefmap, OrderBase orderBase) {
|
|
|
+ if (orderBase !=null ){
|
|
|
+ // 安装工单产品信息,操作日志,完工明细,完工明细附件 以主表的pgguid统一修改
|
|
|
+ // 生成待同步的工单主表数据
|
|
|
+ ItfTblAzAssignLcLsUpload lcls = getItfTblAzAssignLcLsUpload(brand, ojtutl, orderBase);
|
|
|
+ // 1: 插入工单主表数据
|
|
|
+ if (!itfTblAzAssignLcLsUploadService.save(lcls)){
|
|
|
+ return Boolean.FALSE;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 2 :生成安装辅材费用数据
|
|
|
+ if (!getFeeUpload(orderBase)){
|
|
|
+ return Boolean.FALSE;
|
|
|
+ }
|
|
|
+
|
|
|
+ //3 :生成采集数据 采集明细,采集附件,采集条码(及家用,商用、其他)
|
|
|
+ if (!generateCJData(brand, CategoryRefmap, orderBase, lcls)){
|
|
|
+ return Boolean.FALSE;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 生成评价短信 只写一次
|
|
|
+ if (!getPJmessage(orderBase, lcls, brand)){
|
|
|
+ return Boolean.FALSE;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 修改数据上传任务表中的状态 这里固定值 22
|
|
|
+ publicService.updateUploadTaskListStatus(ojtutl.getOrderNo(),ojtutl.getSynReqId(),1,22);
|
|
|
+
|
|
|
+ return Boolean.TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private Boolean getPJmessage(OrderBase orderBase, ItfTblAzAssignLcLsUpload lcls,Brand brand) {
|
|
|
+ WebsitSH websitSH = new WebsitSH();
|
|
|
+
|
|
|
+ // 生成评价短信 不能写在产品中要写在表头,只写一次 派工状态为4(1304,1309与工单状态相同) 完工或已关闭的单
|
|
|
+ if ((orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G7.getCode()) ||
|
|
|
+ orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G10.getCode())) &&
|
|
|
+ (orderBase.getDispatchStatus().equals(GDAppointStatusEnum.INSTALL_STATUS_A4_0.getCode()) ||
|
|
|
+ orderBase.getDispatchStatus().equals(GDAppointStatusEnum.INSTALL_STATUS_A4_1.getCode()))) {
|
|
|
+ // 查看是否已发送 工单号,只能插入一次
|
|
|
+ ItfMessagehuifangentity message = itfMessagehuifangentityService.lambdaQuery()
|
|
|
+ .eq(ItfMessagehuifangentity::getOrderBaseId, orderBase.getId())
|
|
|
+ .last("limit 1")
|
|
|
+ .one();
|
|
|
+
|
|
|
+ // 自建工单 这里可放在定时任务中执行,代码是不会走这里的
|
|
|
+ if (!orderBase.getUploadFlag()){
|
|
|
+ if (message == null){
|
|
|
+ // 生成短信数据
|
|
|
+ OrderPar orderPar = new OrderPar();
|
|
|
+ orderPar.setBrandId(brand.getBrandId());
|
|
|
+ orderPar.setOrderNo(orderBase.getId());
|
|
|
+ ItfMessagehuifangentity addms = gdOrderBaseMapper.getAZItfMessagehuifangentity(orderPar);
|
|
|
+ if (addms==null){
|
|
|
+ return Boolean.TRUE;
|
|
|
+ }
|
|
|
+ // 售后网点处理 fjwd
|
|
|
+ websitSH = publicService.ptshwdToshshwd(addms.getFjwd(), orderBase.getMainId());
|
|
|
+ addms.setFjwd(websitSH.getWdId());
|
|
|
+
|
|
|
+ String id = UUID.randomUUID().toString();
|
|
|
+ if (id.length()>32){
|
|
|
+ addms.setSynTaskNo(id.substring(0,32));
|
|
|
+ } else {
|
|
|
+ addms.setSynTaskNo(id);
|
|
|
+ }
|
|
|
+ addms.setFsma(publicService.getfsma(addms.getSjid()));
|
|
|
+ addms.setFsnr("尊敬的用户:请对本次服务评价:满意回复1;一般回复2;不满意回复3。并注明原因!关注官微“格力售后服务”,为您提供更优质服务!");
|
|
|
+ addms.setDxguid(UUID.randomUUID().toString());
|
|
|
+ return publicService.addItfMessagehuifangentity(addms,orderBase.getOrderType(),6);
|
|
|
+ }
|
|
|
+ } else if ((orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G7.getCode()) ||
|
|
|
+ orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G10.getCode())) &&
|
|
|
+ !orderBase.getSaleType().equals("工程机")) {
|
|
|
+ if (message == null){
|
|
|
+ // 生成短信数据 sendtype (1=原总部接口发送,2=用联通的接口进行发送) 默认为1
|
|
|
+ OrderPar orderPar = new OrderPar();
|
|
|
+ orderPar.setBrandId(brand.getBrandId());
|
|
|
+ orderPar.setOrderNo(orderBase.getId());
|
|
|
+ ItfMessagehuifangentity addms = gdOrderBaseMapper.getAZItfMessagehuifangentityT(orderPar);
|
|
|
+ if (addms==null){
|
|
|
+ return Boolean.TRUE;
|
|
|
+ }
|
|
|
+ String id = UUID.randomUUID().toString();
|
|
|
+ if (id.length()>32){
|
|
|
+ addms.setSynTaskNo(id.substring(0,32));
|
|
|
+ } else {
|
|
|
+ addms.setSynTaskNo(id);
|
|
|
+ }
|
|
|
+ addms.setFsnr("尊敬的用户:请对本次服务评价:满意回复1;一般回复2;不满意回复3。并注明原因!关注官微“格力售后服务”,为您提供更优质服务!");
|
|
|
+ addms.setFsma(publicService.getfsma(addms.getSjid()));
|
|
|
+ return publicService.addItfMessagehuifangentity(addms,orderBase.getOrderType(),6);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return Boolean.TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private Boolean generateCJData(Brand brand, Map<String, List<SysDictRef>> CategoryRefmap, OrderBase orderBase, ItfTblAzAssignLcLsUpload lcls) {
|
|
|
+ // 工单状态order_status 6, 7, 9, 10 且为非预派工订单
|
|
|
+ if ((orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G6.getCode()) ||
|
|
|
+ orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G7.getCode()) ||
|
|
|
+ orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G9.getCode()) ||
|
|
|
+ orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G10.getCode())) &&
|
|
|
+ orderBase.getIsReservation().equals(0)){
|
|
|
+ // 提取采集的数据
|
|
|
+ List<OrderInstallDetail> orderInstallDetails = orderInstallDetailService.lambdaQuery()
|
|
|
+ .eq(OrderInstallDetail::getOrderBaseId, orderBase.getId())
|
|
|
+ .orderByAsc(OrderInstallDetail::getId)
|
|
|
+ .list();
|
|
|
+ Map<String, Integer> val = new HashMap<String,Integer>();
|
|
|
+ // 根据产品类别名称 生成不同的完工明细数据
|
|
|
+ String mainName = CategoryRefmap.get(orderBase.getMainId()).get(0).getRefDictName();
|
|
|
+
|
|
|
+ if (orderInstallDetails !=null && orderInstallDetails.size()>0){
|
|
|
+ for (OrderInstallDetail detail :orderInstallDetails){
|
|
|
+ // 状态:3=临时保存;2=作废,1=已采集,0=未采集
|
|
|
+ // 临时保存与未采集的记录不处理
|
|
|
+ if (detail.getStatus().equals(0) || detail.getStatus().equals(3)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取完工采集明细数据 (家用空调、商用空调、其他)
|
|
|
+ getCJMXData(brand, orderBase, lcls, detail,mainName);
|
|
|
+
|
|
|
+ // 获取采集附件数据 (家用、商用、其他)
|
|
|
+ getcjfjdata(orderBase, detail, mainName);
|
|
|
+
|
|
|
+ // 生成条码明细数据
|
|
|
+ getDetailCode(orderBase, detail, mainName);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return Boolean.TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void getDetailCode(OrderBase orderBase, OrderInstallDetail detail, String mainName) {
|
|
|
+ String oldFile ="";
|
|
|
+ String newFile ="";
|
|
|
+
|
|
|
+ // 获取条码采集明细id
|
|
|
+ InstalDetailCode instalDetailCode = new InstalDetailCode();
|
|
|
+ instalDetailCode.setOrderNo(detail.getOrderBaseId());
|
|
|
+ instalDetailCode.setId(detail.getId());
|
|
|
+ List<OrderInstallDetailCode> codes = codeOrderInstallDetailMapper.getId(instalDetailCode);
|
|
|
+ // 处理条码明细
|
|
|
+ for (OrderInstallDetailCode code :codes){
|
|
|
+ if (StringUtils.isEmpty(code.getPath())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(code.getGreeImageId())){
|
|
|
+ // 上传图片
|
|
|
+ /*if (!uploadImage(orderBase, code)) {
|
|
|
+ continue;
|
|
|
+ }*/
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*if (StringUtils.isEmpty(code.getTmguid())){
|
|
|
+ OrderInstallDetailCode upCode = new OrderInstallDetailCode();
|
|
|
+ upCode.setId(code.getId());
|
|
|
+ upCode.setTmguid(UUID.randomUUID().toString());
|
|
|
+ orderInstallDetailCodeService.updateById(upCode);
|
|
|
+ }*/
|
|
|
+ // 采集明细表中取pgwcmxid
|
|
|
+ OrderInstallDetail orderInstallDetail = orderInstallDetailService.lambdaQuery()
|
|
|
+ .eq(OrderInstallDetail::getOrderBaseId,code.getOrderBaseId())
|
|
|
+ .eq(OrderInstallDetail::getId,code.getOrderDetailId())
|
|
|
+ .last("limit 1")
|
|
|
+ .one();
|
|
|
+ if (orderInstallDetail == null || StringUtils.isEmpty(orderInstallDetail.getPgwcmxid())){
|
|
|
+ continue;
|
|
|
+ } /*else {
|
|
|
+ OrderInstallDetailCode upCode = new OrderInstallDetailCode();
|
|
|
+ upCode.setId(code.getId());
|
|
|
+ upCode.setPgwcmxid(orderInstallDetail.getPgwcmxid());
|
|
|
+ orderInstallDetailCodeService.updateById(upCode);
|
|
|
+ }*/
|
|
|
+
|
|
|
+ // 生成采集条码表数据
|
|
|
+ generateDetailCode(orderBase, code, mainName);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void generateDetailCode(OrderBase orderBase, OrderInstallDetailCode code, String mainName) {
|
|
|
+ // 采集条码表中的pgguid 统一改成工单基础表的pgguid
|
|
|
+ /*InstalDetailCode upcode = new InstalDetailCode();
|
|
|
+ upcode.setOrderNo(code.getOrderBaseId());
|
|
|
+ upcode.setPgguId(orderBase.getPgguid());
|
|
|
+ codeOrderInstallDetailMapper.updateCodePgguid(upcode);*/
|
|
|
+
|
|
|
+ InstalDetailCode codep = new InstalDetailCode();
|
|
|
+ codep.setOrderNo(code.getOrderBaseId());
|
|
|
+ codep.setId(code.getId());
|
|
|
+
|
|
|
+ if (mainName.equals("家用空调") ||
|
|
|
+ mainName.equals("家用空气能热水器") ||
|
|
|
+ mainName.equals("驻车空调")) {
|
|
|
+ // 家用空调 完工明细 数据生成(完工采集条码数据)
|
|
|
+ ItfTblAzWgmxJyktTmmxUpload jy = codeOrderInstallDetailMapper.getJyCode(codep);
|
|
|
+ if (jy != null){
|
|
|
+ itfTblAzWgmxJyktTmmxUploadService.save(jy);
|
|
|
+ }
|
|
|
+ } else if (mainName.equals("商用空调")){
|
|
|
+ // 家用空调 完工明细 数据生成(完工采集条码数据)
|
|
|
+ ItfTblAzWgmxSyktTmmxLsUpload sy = codeOrderInstallDetailMapper.getSyCode(codep);
|
|
|
+ if (sy != null){
|
|
|
+ itfTblAzWgmxSyktTmmxLsUploadService.save(sy);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ItfTblAzWgmxQitaTmmxUpload other = codeOrderInstallDetailMapper.getOtherCode(codep);
|
|
|
+ if (other != null){
|
|
|
+ itfTblAzWgmxQitaTmmxUploadService.save(other);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Nullable
|
|
|
+ private void getCJMXData(Brand brand, OrderBase orderBase, ItfTblAzAssignLcLsUpload lcls,
|
|
|
+ OrderInstallDetail detail,String mainName) {
|
|
|
+
|
|
|
+ /*// 修改采集明细的序 pgwcmxid 生成格力总部-采集明细序号
|
|
|
+ if (StringUtils.isEmpty(detail.getPgwcmxid())){
|
|
|
+ upCerrentRec(detail);
|
|
|
+ }
|
|
|
+ // 采集表中的pgguid 统一改成工单基础表的pgguid
|
|
|
+ upInstallDetailPgguid(orderBase);
|
|
|
+
|
|
|
+ // 采集表与采集条码表ID超范围 - 采集表及采集明细表中的outid统一修改
|
|
|
+ upOutId(detail);*/
|
|
|
+
|
|
|
+
|
|
|
+ // 采集标志 1100:保存,1110:作废,1120:转结算
|
|
|
+ Integer cjstat = 1100;
|
|
|
+
|
|
|
+ if (orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G7.getCode()) ||
|
|
|
+ orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G10.getCode())){
|
|
|
+ cjstat = 1120;
|
|
|
+ }
|
|
|
+ if (detail.getStatus().equals(2)){
|
|
|
+ cjstat = 1110;
|
|
|
+ }
|
|
|
+
|
|
|
+ InstallDetail request = new InstallDetail();
|
|
|
+ request.setOrderNo(detail.getOrderBaseId());
|
|
|
+ request.setId(detail.getId());
|
|
|
+ request.setBrandId(brand.getBrandId());
|
|
|
+ // 为空时为 家用空调
|
|
|
+ if (StringUtils.isEmpty(mainName) ||
|
|
|
+ mainName.equals("家用空调") || mainName.equals("家用空气能热水器") || mainName.equals("驻车空调")){
|
|
|
+ // 家用空调 完工明细 数据生成(完工采集数据)
|
|
|
+ ItfTblAzWgmxJyktUpload mxup = detailOrderInstallMapper.getOrderInstallUpload(request);
|
|
|
+ if (mxup != null){
|
|
|
+ // 部分参数单独处理
|
|
|
+ setParma(brand, orderBase, lcls, cjstat, mxup, detail);
|
|
|
+ itfTblAzWgmxJyktUploadService.save(mxup);
|
|
|
+ }
|
|
|
+ } else if (mainName.equals("商用空调")){
|
|
|
+ // 商用空调 完工明细数据生成(完工采集数据)
|
|
|
+ ItfTblAzWgmxSyktUpload mxup = detailOrderInstallMapper.getSyOrderInstallUpload(request);
|
|
|
+ if (mxup != null){
|
|
|
+ // 部分参数单独处理
|
|
|
+ setSyParm(orderBase, lcls, cjstat, mxup, detail, brand);
|
|
|
+ itfTblAzWgmxSyktUploadService.save(mxup);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 其他 完工明细数据生成
|
|
|
+ // 获取家用空调完工明细(完工采集数据)
|
|
|
+ ItfTblAzWgmxQitaUpload mxup = detailOrderInstallMapper.getOtherOrderInstallUpload(request);
|
|
|
+ if (mxup != null){
|
|
|
+ // 部分参数单独处理
|
|
|
+ setOtherParm(orderBase, lcls, cjstat, mxup, detail, brand);
|
|
|
+ itfTblAzWgmxQitaUploadService.save(mxup);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 处理附件采集数据上传
|
|
|
+ public Boolean getcjfjdata(OrderBase orderBase, OrderInstallDetail detail, String mainName) {
|
|
|
+ String oldFile ="";
|
|
|
+ String newFile ="";
|
|
|
+
|
|
|
+ // 附件上传总部标识判断
|
|
|
+ if (orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G7.getCode()) ||
|
|
|
+ orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G10.getCode())){
|
|
|
+ // 安装工单采集附件表提取数据
|
|
|
+ InstallCJDetailFile installCJDetailFile = new InstallCJDetailFile();
|
|
|
+ installCJDetailFile.setOrderNo(detail.getOrderBaseId());
|
|
|
+ installCJDetailFile.setId(detail.getId());
|
|
|
+ List<OrderDetailFile> detailFiles = fileOrderDetailMapper.getId(installCJDetailFile);
|
|
|
+ for (OrderDetailFile file:detailFiles){
|
|
|
+ // 工单号, file的id即附件表的id,uuid统一值
|
|
|
+ // path未准备上传被忽略
|
|
|
+ if (StringUtils.isEmpty(file.getFilePath())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ /*// 品牌方fileindex未获取上传被忽略
|
|
|
+ if (StringUtils.isEmpty(file.getBrandFilePath())){
|
|
|
+ // 上传图片
|
|
|
+ oldFile = IdWorker.getIdStr() + ".jpeg";
|
|
|
+ baseService.saveToFile(ossUtil.getUrlWw(file.getFilePath()),oldFile);
|
|
|
+ // 获取文件
|
|
|
+ newFile = oldFile;
|
|
|
+ WebsitFWS websitFWS = publicService.shshwdToptshwd(orderBase.getWebsitId(),orderBase);
|
|
|
+ Boolean flag = uploadFileexc(newFile, oldFile,websitFWS.getWebsitId(), file);
|
|
|
+ new File(newFile).delete();
|
|
|
+ if (!flag) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+ // 提取获取采集明细表数据中获取pgwcmxid(生成格力总部-采集明细序号)
|
|
|
+ OrderInstallDetail detailone = orderInstallDetailService.lambdaQuery()
|
|
|
+ .eq(OrderInstallDetail::getOrderBaseId,file.getOrderBaseId())
|
|
|
+ .eq(OrderInstallDetail::getId,file.getOrderDetailId())
|
|
|
+ .last("limit 1")
|
|
|
+ .one();
|
|
|
+
|
|
|
+ // 获取完工明细数据(采集附件表) 家用、商用、其他
|
|
|
+ getwgmxData(mainName, file, detailone);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return Boolean.TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void getwgmxData(String mainName, OrderDetailFile file, OrderInstallDetail detailone) {
|
|
|
+ // 修改附件的pgwcmxid
|
|
|
+ /*if (detailone != null){
|
|
|
+ OrderDetailFile upf = new OrderDetailFile();
|
|
|
+ upf.setId(file.getId());
|
|
|
+ upf.setPgwcmxid(detailone.getPgwcmxid());
|
|
|
+ orderDetailFileService.updateById(upf);
|
|
|
+ }
|
|
|
+ // 采集附件表中的pgguid 统一改成工单基础表的pgguid 可以不用,从主表取即可 无pgguid字段
|
|
|
+ InstallCJDetailFile upfile = new InstallCJDetailFile();
|
|
|
+ upfile.setOrderNo(file.getOrderBaseId());
|
|
|
+ upfile.setPgguId(orderBase.getPgguid());
|
|
|
+ fileOrderDetailMapper.updateFilePgguid(upfile);
|
|
|
+
|
|
|
+
|
|
|
+ // 修改附件的fjguid
|
|
|
+ if (detailone != null && StringUtils.isEmpty(file.getFjguid())){
|
|
|
+ OrderDetailFile upf = new OrderDetailFile();
|
|
|
+ upf.setId(file.getId());
|
|
|
+ upf.setFjguid(UUID.randomUUID().toString());
|
|
|
+ orderDetailFileService.updateById(upf);
|
|
|
+ }
|
|
|
+ */
|
|
|
+
|
|
|
+ InstallCJDetailFile request = new InstallCJDetailFile();
|
|
|
+ request.setOrderNo(file.getOrderBaseId());
|
|
|
+ request.setId(file.getId());
|
|
|
+
|
|
|
+ // 生成家用空调 数据采集附件上传记录
|
|
|
+ if (mainName.equals("家用空调") ||
|
|
|
+ mainName.equals("家用空气能热水器") ||
|
|
|
+ mainName.equals("驻车空调")){
|
|
|
+ // 家用空调 完工明细 数据生成
|
|
|
+ ItfTblAzWgmxJyktFjUpload jyktfj = fileOrderDetailMapper.getFileUpload(request);
|
|
|
+ if (jyktfj !=null){
|
|
|
+ itfTblAzWgmxJyktFjUploadService.save(jyktfj);
|
|
|
+ }
|
|
|
+ } else if (mainName.equals("商用空调")){
|
|
|
+ // 商用空调 完工明细 数据生成
|
|
|
+ ItfTblAzWgmxSyktFjUpload syktfj = fileOrderDetailMapper.getSyFileUpload(request);
|
|
|
+ if (syktfj !=null){
|
|
|
+ itfTblAzWgmxSyktFjUploadService.save(syktfj);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 其他 完工明细 数据生成
|
|
|
+ ItfTblAzWgmxQitaFjUpload otherfj = fileOrderDetailMapper.getOtherFileUpload(request);
|
|
|
+ if (otherfj != null){
|
|
|
+ itfTblAzWgmxQitaFjUploadService.save(otherfj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private Boolean getFeeUpload(OrderBase orderBase) {
|
|
|
+ // 根据辅材订单支付表存在支付时生成安装费用数据
|
|
|
+ List<OrderPayOutlayItem> pitems = orderPayOutlayItemService.lambdaQuery()
|
|
|
+ .eq(OrderPayOutlayItem::getOrderBaseId, orderBase.getId()).list();
|
|
|
+ if (pitems!=null && pitems.size()>0){
|
|
|
+ BigDecimal totalAmount=BigDecimal.ZERO;
|
|
|
+ for (OrderPayOutlayItem ps :pitems){
|
|
|
+ totalAmount = totalAmount.add(ps.getTotalAmount());
|
|
|
+ }
|
|
|
+
|
|
|
+ ItfTblAzAssignFeeUpload feeUpload = new ItfTblAzAssignFeeUpload();
|
|
|
+ // 从工单扩展表提取辅材信息
|
|
|
+ OrderInstall orderInstall =orderInstallService.lambdaQuery()
|
|
|
+ .eq(OrderInstall::getOrderBaseId, orderBase.getId())
|
|
|
+ .last("limit 1")
|
|
|
+ .one();
|
|
|
+ if (orderInstall !=null){
|
|
|
+ feeUpload.setWorkerOrderNo(orderBase.getId());
|
|
|
+ feeUpload.setId(orderBase.getPgguid());
|
|
|
+ feeUpload.setCreatedBy("guangfo");
|
|
|
+ feeUpload.setCreatedDate(orderInstall.getCreateTime());
|
|
|
+ feeUpload.setLastModifiedBy("guangfo");
|
|
|
+ feeUpload.setLastModifiedDate(orderInstall.getUpdateTime());
|
|
|
+ feeUpload.setOtherfee(String.valueOf(totalAmount));
|
|
|
+ feeUpload.setTotalfee(String.valueOf(totalAmount));
|
|
|
+ feeUpload.setAjia(orderInstall.getBracket());
|
|
|
+ feeUpload.setJcguan(orderInstall.getPipe());
|
|
|
+ feeUpload.setKqkg(orderInstall.getSwithFlag());
|
|
|
+ feeUpload.setGkzy(orderInstall.getHighAltitude());
|
|
|
+ feeUpload.setYccxqk(orderInstall.getHole());
|
|
|
+ feeUpload.setFlbz(orderBase.getId());
|
|
|
+ } else {
|
|
|
+ feeUpload.setWorkerOrderNo(orderBase.getId());
|
|
|
+ feeUpload.setId(orderBase.getPgguid());
|
|
|
+ feeUpload.setCreatedBy("guangfo");
|
|
|
+ feeUpload.setCreatedDate(orderBase.getCreateTime());
|
|
|
+ feeUpload.setLastModifiedBy("guangfo");
|
|
|
+ feeUpload.setLastModifiedDate(orderBase.getUpdateTime());
|
|
|
+ feeUpload.setOtherfee(String.valueOf(totalAmount));
|
|
|
+ feeUpload.setTotalfee(String.valueOf(totalAmount));
|
|
|
+ feeUpload.setFlbz(orderBase.getId());
|
|
|
+ }
|
|
|
+ return itfTblAzAssignFeeUploadService.save(feeUpload);
|
|
|
+ }
|
|
|
+
|
|
|
+ return Boolean.TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void uploadOrderDetailFile(@NotNull OutJiasmToGreeUploadTaskList ojtutl, Map<String, List<SysDictRef>> CategoryRefmap, OrderBase orderBase) {
|
|
|
+ String oldFile ="";
|
|
|
+ String newFile ="";
|
|
|
+ // 根据产品类别名称 生成不同的完工明细数据
|
|
|
+ String mainName = CategoryRefmap.get(orderBase.getMainId()).get(0).getRefDictName();
|
|
|
+ InstallCJDetailFile installCJDetailFile = new InstallCJDetailFile();
|
|
|
+ List<OrderDetailFile> detailFiles = new ArrayList<>();
|
|
|
+ installCJDetailFile.setOrderNo(ojtutl.getId());
|
|
|
+ detailFiles = orderDetailFileService.lambdaQuery()
|
|
|
+ .eq(OrderDetailFile::getOrderBaseId, ojtutl.getId())
|
|
|
+ .isNull(OrderDetailFile::getBrandFilePath).list();
|
|
|
+ for (OrderDetailFile file:detailFiles){
|
|
|
+ // 工单号, file的id即附件表的id,uuid统一值
|
|
|
+ // path未准备上传被忽略
|
|
|
+ if (StringUtils.isEmpty(file.getFilePath())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ // 品牌方fileindex未获取上传被忽略
|
|
|
+ if (StringUtils.isEmpty(file.getBrandFilePath())){
|
|
|
+ // 上传图片
|
|
|
+ oldFile = IdWorker.getIdStr() + ".jpeg";
|
|
|
+ baseService.saveToFile(ossUtil.getUrlWw(file.getFilePath()),oldFile);
|
|
|
+ // 获取文件
|
|
|
+ newFile = oldFile;
|
|
|
+ WebsitFWS websitFWS = publicService.shshwdToptshwd(orderBase.getWebsitId(), orderBase);
|
|
|
+ Boolean flag = uploadFileexc(newFile, oldFile,websitFWS.getWebsitId(), file);
|
|
|
+ new File(newFile).delete();
|
|
|
+ if (!flag) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 提取获取采集明细表数据中获取pgwcmxid(生成格力总部-采集明细序号)
|
|
|
+ OrderInstallDetail detailone = orderInstallDetailService.lambdaQuery()
|
|
|
+ .eq(OrderInstallDetail::getOrderBaseId,file.getOrderBaseId())
|
|
|
+ .eq(OrderInstallDetail::getId,file.getOrderDetailId())
|
|
|
+ .last("limit 1")
|
|
|
+ .one();
|
|
|
+
|
|
|
+ // 修改附件的pgwcmxid
|
|
|
+ if (detailone != null){
|
|
|
+ OrderDetailFile upf = new OrderDetailFile();
|
|
|
+ upf.setId(file.getId());
|
|
|
+ upf.setPgwcmxid(detailone.getPgwcmxid());
|
|
|
+ orderDetailFileService.updateById(upf);
|
|
|
+ }
|
|
|
+ // 采集附件表中的pgguid 统一改成工单基础表的pgguid 可以不用,从主表取即可 无pgguid字段
|
|
|
+ InstallCJDetailFile upfile = new InstallCJDetailFile();
|
|
|
+ upfile.setOrderNo(file.getOrderBaseId());
|
|
|
+ upfile.setPgguId(orderBase.getPgguid());
|
|
|
+ fileOrderDetailMapper.updateFilePgguid(upfile);
|
|
|
+
|
|
|
+
|
|
|
+ // 修改附件的fjguid
|
|
|
+ if (detailone != null && StringUtils.isEmpty(file.getFjguid())){
|
|
|
+ OrderDetailFile upf = new OrderDetailFile();
|
|
|
+ upf.setId(file.getId());
|
|
|
+ upf.setFjguid(UUID.randomUUID().toString());
|
|
|
+ orderDetailFileService.updateById(upf);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void upOrderInstallDetailCodePgguid(@NotNull OutJiasmToGreeUploadTaskList ojtutl, OrderBase orderBase) {
|
|
|
+ List<OrderInstallDetailCode> oidcs = orderInstallDetailCodeService.lambdaQuery()
|
|
|
+ .eq(OrderInstallDetailCode::getOrderBaseId, ojtutl.getId())
|
|
|
+ .isNull(OrderInstallDetailCode::getPgguid)
|
|
|
+ .list();
|
|
|
+ if (com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isNotEmpty(oidcs)){
|
|
|
+ InstalDetailCode upcode = new InstalDetailCode();
|
|
|
+ upcode.setOrderNo(orderBase.getId());
|
|
|
+ upcode.setPgguId(orderBase.getPgguid());
|
|
|
+ upcode.setTmguid(UUID.randomUUID().toString());
|
|
|
+ codeOrderInstallDetailMapper.updateCodePgguid(upcode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void upPgwcmxid(OutJiasmToGreeUploadTaskList ojtutl) {
|
|
|
+ List<OrderInstallDetail> upList = new ArrayList<>();
|
|
|
+ List<OrderInstallDetail> detaillist = orderInstallDetailService.lambdaQuery()
|
|
|
+ .eq(OrderInstallDetail::getOrderBaseId, ojtutl.getId())
|
|
|
+ .isNull(OrderInstallDetail::getPgwcmxid)
|
|
|
+ .list();
|
|
|
+ if (com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isNotEmpty(detaillist)){
|
|
|
+ for (OrderInstallDetail item:detaillist){
|
|
|
+ if (StringUtils.isEmpty(item.getPgwcmxid())){
|
|
|
+ item.setPgwcmxid(IdWorker.getIdStr());
|
|
|
+ upList.add(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 修改序
|
|
|
+ if (upList.size()>0){
|
|
|
+ orderInstallDetailService.updateBatchById(upList);
|
|
|
+ upList.clear();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void stopUpload(@NotNull OutJiasmToGreeUploadTaskList ojtutl, String msg) {
|
|
|
+ OutJiasmToGreeUploadTaskList up = new OutJiasmToGreeUploadTaskList();
|
|
|
+ up.setSynReqId(ojtutl.getSynReqId());
|
|
|
+ up.setSynStatus(99);
|
|
|
+ up.setSynTime(new Date());
|
|
|
+ up.setSynErrMsg(msg);
|
|
|
+ outJiasmToGreeUploadTaskListService.updateById(up);
|
|
|
+ }
|
|
|
+
|
|
|
+ public void upInstallDetailPgguid(OrderBase orderBase) {
|
|
|
+ List<OrderInstallDetail> detaillist = orderInstallDetailService.lambdaQuery()
|
|
|
+ .eq(OrderInstallDetail::getOrderBaseId, orderBase.getId())
|
|
|
+ .isNull(OrderInstallDetail::getPgguid)
|
|
|
+ .list();
|
|
|
+ if (com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isNotEmpty(detaillist)){
|
|
|
+ InstallDetail installDetail = new InstallDetail();
|
|
|
+ installDetail.setOrderNo(orderBase.getId());
|
|
|
+ installDetail.setPgguId(orderBase.getPgguid());
|
|
|
+ detailOrderInstallMapper.installUpdatePgguid(installDetail);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private boolean checkPare(OutJiasmToGreeUploadTaskList ojtutl, OrderBase orderBase) {
|
|
|
+ // 接收派工网点为空上传忽略
|
|
|
+ if (StringUtils.isEmpty(orderBase.getReceWebsitId()) || orderBase.getReceWebsitId().equals("0")){
|
|
|
+ stopUpload(ojtutl, "接收派工网点为空上传忽略");
|
|
|
+ return Boolean.FALSE;
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(orderBase.getPgguid()) || orderBase.getPgguid().equals("0")){
|
|
|
+ stopUpload(ojtutl, "pgguid异常上传忽略");
|
|
|
+ return Boolean.FALSE;
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(orderBase.getPgid()) || orderBase.getPgid().equals("0")){
|
|
|
+ stopUpload(ojtutl, "pgid异常上传忽略");
|
|
|
+ return Boolean.FALSE;
|
|
|
+ }
|
|
|
+ return Boolean.TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean orderInstallCjOrWg(String cjOrWg, Brand brand, OutJiasmToGreeUploadTaskList ojtutl,
|
|
|
Map<String, List<SysDictRef>> CategoryRefmap, OrderBase orderBase){
|
|
|
if (orderBase !=null ){
|
|
@@ -362,6 +993,78 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
|
|
|
}
|
|
|
|
|
|
@NotNull
|
|
|
+ private ItfTblAzAssignLcLsUpload getItfTblAzAssignLcLsUpload(@NotNull Brand brand, OutJiasmToGreeUploadTaskList ojtutl,
|
|
|
+ OrderBase orderBase) {
|
|
|
+ WebsitSH websitSH = new WebsitSH();
|
|
|
+ OrderPar orderPar = new OrderPar();
|
|
|
+ orderPar.setBrandId(brand.getBrandId());
|
|
|
+ orderPar.setOrderNo(ojtutl.getId());
|
|
|
+ ItfTblAzAssignLcLsUpload lcls = gdOrderBaseMapper.getAzOrderBase(orderPar);
|
|
|
+ lcls.setUploadTaskSynReqId(ojtutl.getSynReqId());
|
|
|
+
|
|
|
+ // 创建人及创建人名称改为对应的创建网点
|
|
|
+ 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());
|
|
|
+ lcls.setXswdmc(websitSH.getWdmc());
|
|
|
+ lcls.setXsdwxtbh(websitSH.getBrandSysWebsitNumber());
|
|
|
+ lcls.setServicewdno(websitSH.getWdId());
|
|
|
+ lcls.setShopno(websitSH.getWdId());
|
|
|
+ lcls.setShopname(websitSH.getWdmc());
|
|
|
+
|
|
|
+
|
|
|
+ // 售后网点处理
|
|
|
+ websitSH = publicService.ptshwdToshshwd(lcls.getAzwdno(), orderBase.getMainId());
|
|
|
+ lcls.setAzwdno(websitSH.getWdId());
|
|
|
+ lcls.setAzwdmc(websitSH.getWdmc());
|
|
|
+ lcls.setAzwdxtbh(websitSH.getBrandSysWebsitNumber());
|
|
|
+ lcls.setCjwdno(websitSH.getWdId());
|
|
|
+ lcls.setCjwdxtbh(websitSH.getBrandSysWebsitNumber());
|
|
|
+ lcls.setZjczwd(websitSH.getWdId());
|
|
|
+ lcls.setZjczwdxtbh(websitSH.getBrandSysWebsitNumber());
|
|
|
+ // 提取安装师傅的账号信息
|
|
|
+ lcls.setAzrenid(publicService.getBrandWorkerId(orderBase.getWorkerId(),websitSH.getWdId(),brand.getBrandId(),orderBase.getWebsitId()));
|
|
|
+
|
|
|
+ // 接收派工网点也可认为是售后网点处理
|
|
|
+ lcls.setJspgwdno(websitSH.getWdId());
|
|
|
+ lcls.setJspgwdmc(websitSH.getWdmc());
|
|
|
+ lcls.setJspgwdxtbh(websitSH.getBrandSysWebsitNumber());
|
|
|
+ // 所属区域处理
|
|
|
+ BrandWebsit bb = brandWebsitService.lambdaQuery()
|
|
|
+ .eq(BrandWebsit::getGroupCompanyId,brand.getBrandId())
|
|
|
+ .eq(BrandWebsit::getBrandWebsitNumber,lcls.getJspgwdno())
|
|
|
+ .last("limit 1")
|
|
|
+ .one();
|
|
|
+ lcls.setSsqy("其他");
|
|
|
+ if (bb!=null){
|
|
|
+ if (bb.getBelongCompany().equals("X2300000") || bb.getBelongCompany().equals("S9219807")) {
|
|
|
+ lcls.setSsqy("佛山");
|
|
|
+ } else if (bb.getBelongCompany().equals("X2100000") || bb.getBelongCompany().equals("S9219801")) {
|
|
|
+ lcls.setSsqy("广州");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(lcls.getQuhao())){
|
|
|
+ if (bb!=null){
|
|
|
+ if (bb.getBelongCompany().equals("S9219807")){
|
|
|
+ lcls.setQuhao("0756");
|
|
|
+ } else if (bb.getBelongCompany().equals("S9219801")){
|
|
|
+ lcls.setQuhao("020");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 省市等信息单独处理
|
|
|
+ orderService.tpPositionTosh(lcls);
|
|
|
+ return lcls;
|
|
|
+ }
|
|
|
+
|
|
|
+ @NotNull
|
|
|
private ItfTblAzAssignLcLsUpload getItfTblAzAssignLcLsUpload(Brand brand, OrderBase orderBase) {
|
|
|
OrderPar orderPar = new OrderPar();
|
|
|
|
|
@@ -1021,6 +1724,82 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void setJysWdno(OrderBase orderBase, ItfTblAzWgmxJyktUpload mxup) {
|
|
|
+ WebsitSH websitSH = new WebsitSH();
|
|
|
+
|
|
|
+ // 先从售后网点查
|
|
|
+ websitSH = publicService.ptshwdToshshwd(mxup.getZjczwdxtbh(), orderBase.getMainId());
|
|
|
+ if (StringUtils.isEmpty(websitSH.getWdId())){
|
|
|
+ websitSH = publicService.ptxswdToshxswd(mxup.getZjczwdxtbh(), orderBase.getMainId());
|
|
|
+ } else {
|
|
|
+ mxup.setJsdwxtbh(websitSH.getBrandSysWebsitNumber());
|
|
|
+ }
|
|
|
+ mxup.setZjczwdxtbh(websitSH.getBrandSysWebsitNumber());
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setParma(Brand brand, OrderBase orderBase, ItfTblAzAssignLcLsUpload lcls, Integer cjstat,
|
|
|
+ ItfTblAzWgmxJyktUpload mxup, OrderInstallDetail detail) {
|
|
|
+ WebsitSH websitSH = new WebsitSH();
|
|
|
+
|
|
|
+ setJysWdno(orderBase, mxup);
|
|
|
+ mxup.setCjren(orderBase.getCreateBy());
|
|
|
+ mxup.setCjrmc(orderBase.getCreateName());
|
|
|
+ // 售后网点处理
|
|
|
+ websitSH = publicService.ptshwdToshshwd(mxup.getCzwd(), orderBase.getMainId());
|
|
|
+ mxup.setCzwd(websitSH.getWdId());
|
|
|
+
|
|
|
+ // 提取安装师傅的账号信息
|
|
|
+ mxup.setAzrenid(publicService.getBrandWorkerId(orderBase.getWorkerId(),websitSH.getWdId(),brand.getBrandId(),orderBase.getWebsitId()));
|
|
|
+
|
|
|
+ mxup.setStat(cjstat);
|
|
|
+ if (cjstat.equals("1120")){
|
|
|
+ if (orderBase.getOverTime()!=null){
|
|
|
+ mxup.setWcsj(orderBase.getOverTime());
|
|
|
+ } else {
|
|
|
+ mxup.setWcsj(mxup.getLastModifiedDate());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ mxup.setAzwdno(lcls.getAzwdno());
|
|
|
+ mxup.setAzwdmc(lcls.getAzwdmc());
|
|
|
+ mxup.setAzwdxtbh(lcls.getAzwdxtbh());
|
|
|
+ if (StringUtils.isEmpty(mxup.getSjcjgps())){
|
|
|
+ if (orderBase.getAddress().length()>140){
|
|
|
+ mxup.setSjcjgps(orderBase.getAddress().substring(0,140));
|
|
|
+ } else {
|
|
|
+ mxup.setSjcjgps(orderBase.getAddress());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ mxup.setGmsj(orderBase.getBuyTime());
|
|
|
+ mxup.setCjwdno(mxup.getAzwdno());
|
|
|
+ mxup.setZjczwd(mxup.getAzwdno());
|
|
|
+ if (StringUtils.isNotEmpty(orderBase.getLat()) && orderBase.getLat().length()>12){
|
|
|
+ mxup.setSjcjjd(orderBase.getLat().substring(0,12));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(orderBase.getLng()) && orderBase.getLng().length()>12){
|
|
|
+ mxup.setSjcjwd(orderBase.getLng().substring(0,12));
|
|
|
+ }
|
|
|
+ mxup.setSjcjjwdu(mxup.getSjcjjd()+","+ mxup.getSjcjwd());
|
|
|
+
|
|
|
+ // 网点维修工ID单独处理
|
|
|
+ // 先找出网点编号对应的品牌商网点编号
|
|
|
+ // 先从售后网点查
|
|
|
+ websitSH = publicService.ptshwdToshshwd(detail.getWebsitId(), orderBase.getMainId());
|
|
|
+ if (StringUtils.isEmpty(websitSH.getWdId())){
|
|
|
+ websitSH = publicService.ptxswdToshxswd(detail.getWebsitId(), orderBase.getMainId());
|
|
|
+ }
|
|
|
+
|
|
|
+ ItfTblWangdianWxgDownload wxg = itfTblWangdianWxgDownloadService.lambdaQuery()
|
|
|
+ .eq(ItfTblWangdianWxgDownload::getSfzen,mxup.getAzrenid())
|
|
|
+ .eq(ItfTblWangdianWxgDownload::getWdno,websitSH.getWdId())
|
|
|
+ .last("limit 1")
|
|
|
+ .one();
|
|
|
+
|
|
|
+ if (wxg !=null){
|
|
|
+ mxup.setAzrenid(wxg.getWxgid());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private void setParm(OrderBase orderBase, ItfTblAzAssignLcLsUpload lcls, Integer cjstat,
|
|
|
ItfTblAzWgmxJyktUpload mxup, Brand brand) {
|
|
|
WebsitSH websitSH = new WebsitSH();
|
|
@@ -1144,6 +1923,70 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
|
|
|
}
|
|
|
|
|
|
private void setSyParm(OrderBase orderBase, ItfTblAzAssignLcLsUpload lcls, Integer cjstat,
|
|
|
+ ItfTblAzWgmxSyktUpload mxup, OrderInstallDetail detail, Brand brand) {
|
|
|
+ WebsitSH websitSH = new WebsitSH();
|
|
|
+
|
|
|
+ setSyWdno(orderBase, mxup);
|
|
|
+ mxup.setCjren(orderBase.getCreateBy());
|
|
|
+ mxup.setCjrmc(orderBase.getCreateName());
|
|
|
+
|
|
|
+ // 售后网点处理
|
|
|
+ websitSH = publicService.ptshwdToshshwd(mxup.getCzwd(), orderBase.getMainId());
|
|
|
+ mxup.setCzwd(websitSH.getWdId());
|
|
|
+
|
|
|
+ // 提取安装师傅的账号信息
|
|
|
+ mxup.setAzrenid(publicService.getBrandWorkerId(orderBase.getWorkerId(),websitSH.getWdId(),brand.getBrandId(),orderBase.getWebsitId()));
|
|
|
+
|
|
|
+ mxup.setStat(cjstat);
|
|
|
+ if (cjstat.equals("1120")){
|
|
|
+ if (orderBase.getOverTime()!=null){
|
|
|
+ mxup.setWcsj(orderBase.getOverTime());
|
|
|
+ } else {
|
|
|
+ mxup.setWcsj(mxup.getLastModifiedDate());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ mxup.setAzwdno(lcls.getAzwdno());
|
|
|
+ mxup.setAzwdmc(lcls.getAzwdmc());
|
|
|
+ mxup.setAzwdxtbh(lcls.getAzwdxtbh());
|
|
|
+ if (StringUtils.isEmpty(mxup.getSjcjgps())){
|
|
|
+ if (orderBase.getAddress().length()>140){
|
|
|
+ mxup.setSjcjgps(orderBase.getAddress().substring(0,140));
|
|
|
+ } else {
|
|
|
+ mxup.setSjcjgps(orderBase.getAddress());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ mxup.setGmsj(orderBase.getBuyTime());
|
|
|
+ mxup.setCjwdno(mxup.getAzwdno());
|
|
|
+ mxup.setZjczwd(mxup.getAzwdno());
|
|
|
+ if (StringUtils.isNotEmpty(orderBase.getLat()) && orderBase.getLat().length()>12){
|
|
|
+ mxup.setSjcjjd(orderBase.getLat().substring(0,12));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(orderBase.getLng()) && orderBase.getLng().length()>12){
|
|
|
+ mxup.setSjcjwd(orderBase.getLng().substring(0,12));
|
|
|
+ }
|
|
|
+ mxup.setSjcjjwdu(mxup.getSjcjjd()+","+ mxup.getSjcjwd());
|
|
|
+
|
|
|
+ // 网点维修工ID单独处理
|
|
|
+ // 先找出网点编号对应的品牌商网点编号
|
|
|
+ // 先从售后网点查
|
|
|
+ websitSH = publicService.ptshwdToshshwd(detail.getWebsitId(), orderBase.getMainId());
|
|
|
+ if (StringUtils.isEmpty(websitSH.getWdId())){
|
|
|
+ websitSH = publicService.ptxswdToshxswd(detail.getWebsitId(), orderBase.getMainId());
|
|
|
+ }
|
|
|
+
|
|
|
+ ItfTblWangdianWxgDownload wxg = itfTblWangdianWxgDownloadService.lambdaQuery()
|
|
|
+ .eq(ItfTblWangdianWxgDownload::getSfzen,mxup.getAzrenid())
|
|
|
+ .eq(ItfTblWangdianWxgDownload::getWdno,websitSH.getWdId())
|
|
|
+ .last("limit 1")
|
|
|
+ .one();
|
|
|
+
|
|
|
+ if (wxg !=null){
|
|
|
+ mxup.setAzrenid(wxg.getWxgid());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setSyParm(OrderBase orderBase, ItfTblAzAssignLcLsUpload lcls, Integer cjstat,
|
|
|
ItfTblAzWgmxSyktUpload mxup, Brand brand) {
|
|
|
WebsitSH websitSH = new WebsitSH();
|
|
|
|