|
@@ -1,12 +1,9 @@
|
|
|
-package com.zfire.jiasm.syncdata.download.order.install;
|
|
|
+package com.zfire.jiasm.syncdata.download.order;
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.zfire.jiasm.syncdata.base.BaseService;
|
|
|
-import com.zfire.jiasm.syncdata.constant.DictTypeEnum;
|
|
|
-import com.zfire.jiasm.syncdata.constant.DispatchStatusEnum;
|
|
|
-import com.zfire.jiasm.syncdata.constant.GDOrderStatusEnum;
|
|
|
-import com.zfire.jiasm.syncdata.constant.OrderStatusEnum;
|
|
|
+import com.zfire.jiasm.syncdata.constant.*;
|
|
|
import com.zfire.jiasm.syncdata.dao.mapper.AZGDFYQDDownloadMapper;
|
|
|
import com.zfire.jiasm.syncdata.dao.mapper.AZGDFkMxDownloadMapper;
|
|
|
import com.zfire.jiasm.syncdata.dao.mapper.AZGDLcLsDownloadMapper;
|
|
@@ -33,10 +30,10 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
|
@Slf4j
|
|
|
@Component
|
|
|
-public class Business {
|
|
|
+public class InstallBusiness {
|
|
|
|
|
|
@Resource
|
|
|
- Business business;
|
|
|
+ InstallBusiness installBusiness;
|
|
|
@Resource
|
|
|
ItfTblAzAssignLcLsDownloadService itfTblAzAssignLcLsDownloadService;
|
|
|
@Resource
|
|
@@ -72,7 +69,7 @@ public class Business {
|
|
|
@Resource
|
|
|
ItfTblAzAssignAppointmentDownloadService itfTblAzAssignAppointmentDownloadService;
|
|
|
@Resource
|
|
|
- OrderAppointmentService orderAppointmentService;
|
|
|
+ OrderReAppointmentService orderReAppointmentService;
|
|
|
@Resource
|
|
|
ItfTblAzAssignSatisfactionDownloadService itfTblAzAssignSatisfactionDownloadService;
|
|
|
@Resource
|
|
@@ -139,10 +136,10 @@ public class Business {
|
|
|
try{
|
|
|
if (orderBaselist.contains(item.getPgguid())){
|
|
|
// 修改 TL_SynDataFrom_tbl_az_assign_lc_ls_batch
|
|
|
- business.orderUpdate(sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap, brand, item);
|
|
|
+ installBusiness.orderUpdate(sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap, brand, item);
|
|
|
} else {
|
|
|
// 新增 TL_SynDataFrom_tbl_az_assign_lc_ls_batch
|
|
|
- business.orderAdd(sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap, brand, item);
|
|
|
+ installBusiness.orderAdd(sysDictRefDLMap, sysDictRefXLMap, sysDictRefXiLieMap, brand, item);
|
|
|
orderBaselist.add(item.getPgguid());
|
|
|
}
|
|
|
} catch (Exception ex) {
|
|
@@ -157,7 +154,7 @@ public class Business {
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void orderUpdate(Map<String, List<SysDictRef>> sysDictRefDLMap, Map<String, List<SysDictRef>> sysDictRefXLMap, Map<String, List<SysDictRef>> sysDictRefXiLieMap, Brand brand, ItfTblAzAssignLcLsDownload item) {
|
|
|
List<Long> synReqYfYyIds = new ArrayList<>();
|
|
|
- List<OrderAppointment> addoalists = new ArrayList<>();
|
|
|
+ List<OrderReAppointment> addoalists = new ArrayList<>();
|
|
|
List<ItfTblAzAssignMxDownload> mxsynreqids = new ArrayList<>();
|
|
|
List<ItfTblAzAssignFkmxDownload> synreqids = new ArrayList<>();
|
|
|
List<OrderProduct> orderProductsUpdate = new ArrayList<>();
|
|
@@ -219,7 +216,7 @@ public class Business {
|
|
|
List<ItfTblAzAssignMxDownload> mxsynreqids, List<OrderProduct> orderProductsUpdate,
|
|
|
List<ItfTblAzAssignFkmxDownload> synreqids, List<OrderInstallOperatingLog> addoiolList,
|
|
|
ItfTblAzAssignFeeDownload fyqd, OrderInstall orderInstall, List<Long> synReqYfYyIds,
|
|
|
- List<OrderAppointment> addoalists, List<Long> getpjSynReqId, List<OrderAppraise> addoalist) {
|
|
|
+ List<OrderReAppointment> addoalists, List<Long> getpjSynReqId, List<OrderAppraise> addoalist) {
|
|
|
// 同步修改订单基础表
|
|
|
if (upInfo !=null){
|
|
|
orderBaseService.updateById(upInfo);
|
|
@@ -262,7 +259,7 @@ public class Business {
|
|
|
|
|
|
// 同步用户预约表
|
|
|
if (addoalists.size()>0){
|
|
|
- orderAppointmentService.saveBatch(addoalists);
|
|
|
+ orderReAppointmentService.saveBatch(addoalists);
|
|
|
addoalist.clear();
|
|
|
}
|
|
|
if (synReqYfYyIds.size()>0){
|
|
@@ -282,14 +279,14 @@ public class Business {
|
|
|
}
|
|
|
|
|
|
@NotNull
|
|
|
- private List<Long> getYfYyLongs(ItfTblAzAssignLcLsDownload item, OrderBase old, OrderBase newLCLS, List<OrderAppointment> addoalists) {
|
|
|
+ private List<Long> getYfYyLongs(ItfTblAzAssignLcLsDownload item, OrderBase old, OrderBase newLCLS, List<OrderReAppointment> addoalists) {
|
|
|
List<Long> synReqYfYyIds;
|
|
|
- List<OrderAppointment> oaps = new ArrayList<>();
|
|
|
+ List<OrderReAppointment> oaps = new ArrayList<>();
|
|
|
// 提取已同步的
|
|
|
- List<OrderAppointment> oapps = orderAppointmentService.lambdaQuery()
|
|
|
- .select(OrderAppointment::getId)
|
|
|
- .eq(OrderAppointment::getOrderBaseId, old.getId()).list();
|
|
|
- List<String> oappslist = oapps.stream().map(OrderAppointment::getId).collect(Collectors.toList());
|
|
|
+ List<OrderReAppointment> oapps = orderReAppointmentService.lambdaQuery()
|
|
|
+ .select(OrderReAppointment::getId)
|
|
|
+ .eq(OrderReAppointment::getOrderBaseId, old.getId()).list();
|
|
|
+ List<String> oappslist = oapps.stream().map(OrderReAppointment::getId).collect(Collectors.toList());
|
|
|
|
|
|
// 获取用户预约改约信息
|
|
|
List<ItfTblAzAssignAppointmentDownload> appointments = itfTblAzAssignAppointmentDownloadService.lambdaQuery()
|
|
@@ -302,7 +299,7 @@ public class Business {
|
|
|
getOrderAppointment(newLCLS, oaps, appointments);
|
|
|
|
|
|
// 移除已同步过的
|
|
|
- for (OrderAppointment oa:oaps){
|
|
|
+ for (OrderReAppointment oa:oaps){
|
|
|
if (!oappslist.contains(oa.getId())){
|
|
|
addoalists.add(oa);
|
|
|
}
|
|
@@ -795,7 +792,7 @@ public class Business {
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void orderAdd(Map<String, List<SysDictRef>> sysDictRefDLMap, Map<String, List<SysDictRef>> sysDictRefXLMap,
|
|
|
Map<String, List<SysDictRef>> sysDictRefXiLieMap, Brand brand, ItfTblAzAssignLcLsDownload item) {
|
|
|
- List<OrderAppointment> oa = new ArrayList<>();
|
|
|
+ List<OrderReAppointment> oa = new ArrayList<>();
|
|
|
List<OrderAppraise> oanew = new ArrayList<>();
|
|
|
List<OrderProduct> orderProducts = new ArrayList<>();
|
|
|
List<ItfTblAzAssignFkmxDownload> fkmxs = new ArrayList<>();
|
|
@@ -856,7 +853,7 @@ public class Business {
|
|
|
* 工单评价表order_appraise
|
|
|
*/
|
|
|
public void addOrderData(OrderBase orderBase, OrderWorker orderWorker, OrderInstall orderInstall, List<OrderProduct> orderProducts,
|
|
|
- List<OrderInstallOperatingLog> oiolList, List<OrderAppointment> oa, List<OrderAppraise> oanew,
|
|
|
+ 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) {
|
|
|
// 工单基础表
|
|
@@ -900,7 +897,7 @@ public class Business {
|
|
|
|
|
|
// 用户预约改约信息表
|
|
|
if (oa.size()>0){
|
|
|
- orderAppointmentService.saveBatch(oa);
|
|
|
+ orderReAppointmentService.saveBatch(oa);
|
|
|
oa.clear();
|
|
|
}
|
|
|
if (synReqYfYyIds.size()>0){
|
|
@@ -1050,18 +1047,25 @@ public class Business {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void getOrderAppointment(OrderBase orderBase, List<OrderAppointment> oa, List<ItfTblAzAssignAppointmentDownload> appointments) {
|
|
|
+ private void getOrderAppointment(OrderBase orderBase, List<OrderReAppointment> oa, List<ItfTblAzAssignAppointmentDownload> appointments) {
|
|
|
for (ItfTblAzAssignAppointmentDownload a :appointments){
|
|
|
- OrderAppointment v = new OrderAppointment();
|
|
|
+ OrderReAppointment v = new OrderReAppointment();
|
|
|
v.setId(a.getId());
|
|
|
v.setOrderBaseId(orderBase.getId());
|
|
|
- v.setStartTime(a.getKssj());
|
|
|
- v.setEndTime(a.getJssj());
|
|
|
- v.setType(a.getLeix());
|
|
|
- v.setDelayType(a.getReason());
|
|
|
- v.setRemark(a.getBeiz());
|
|
|
+ v.setOrderType(OrderTypeEnum.ORDER_TYPE_INSTALL.getCode());
|
|
|
+ v.setWorkerId(orderBase.getWorkerId());
|
|
|
+ v.setWorkerName(orderBase.getWorkerName());
|
|
|
+ v.setWebsitId(orderBase.getWebsitId());
|
|
|
+ v.setWebsitName(orderBase.getWebsitName());
|
|
|
+ v.setNewAppointmentRemark(a.getBeiz());
|
|
|
+ v.setUserName(orderBase.getUserName());
|
|
|
+ v.setUserMobile(orderBase.getUserMobile());
|
|
|
v.setCreateBy(a.getCzren());
|
|
|
v.setCreateTime(a.getCzsj());
|
|
|
+ v.setUpdateBy(a.getLastModifiedBy());
|
|
|
+ v.setUpdateTime(a.getLastModifiedDate());
|
|
|
+ v.setNewAppointmentTime(a.getKssj());
|
|
|
+ v.setNewAppointmentEndTime(a.getJssj());
|
|
|
oa.add(v);
|
|
|
}
|
|
|
}
|