|
@@ -785,6 +785,9 @@ public class PublicServiceImpl implements PublicService {
|
|
WebsitSH resultData = new WebsitSH();
|
|
WebsitSH resultData = new WebsitSH();
|
|
List<BrandWebsit> wosn = new ArrayList<>();
|
|
List<BrandWebsit> wosn = new ArrayList<>();
|
|
|
|
|
|
|
|
+ Brand brand = baseService.getBrand();
|
|
|
|
+
|
|
|
|
+
|
|
if (StringUtils.isEmpty(websitNo)) {
|
|
if (StringUtils.isEmpty(websitNo)) {
|
|
return resultData;
|
|
return resultData;
|
|
}
|
|
}
|
|
@@ -792,6 +795,7 @@ public class PublicServiceImpl implements PublicService {
|
|
// 提取平台售后网点对应的商户售后网点信息 存在一对多的关系
|
|
// 提取平台售后网点对应的商户售后网点信息 存在一对多的关系
|
|
List<WebsitOrderSign> wos = new ArrayList<>();
|
|
List<WebsitOrderSign> wos = new ArrayList<>();
|
|
wos = websitOrderSignService.lambdaQuery()
|
|
wos = websitOrderSignService.lambdaQuery()
|
|
|
|
+ .eq(WebsitOrderSign::getGroupCompanyId,brand.getBrandId())
|
|
.eq(WebsitOrderSign::getWebsitId, websitNo)
|
|
.eq(WebsitOrderSign::getWebsitId, websitNo)
|
|
.list();
|
|
.list();
|
|
|
|
|
|
@@ -1424,8 +1428,9 @@ public class PublicServiceImpl implements PublicService {
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public Boolean checkWebsitSyncFlag(String orderNo,String tableName,Long recordId){
|
|
public Boolean checkWebsitSyncFlag(String orderNo,String tableName,Long recordId){
|
|
- WebsitSH websit = new WebsitSH();
|
|
|
|
String msg="";
|
|
String msg="";
|
|
|
|
+ List<String> brandWebsitid = new ArrayList<>();
|
|
|
|
+
|
|
OrderBase order = orderBaseService.lambdaQuery()
|
|
OrderBase order = orderBaseService.lambdaQuery()
|
|
.eq(OrderBase::getId, orderNo)
|
|
.eq(OrderBase::getId, orderNo)
|
|
.last("limit 1")
|
|
.last("limit 1")
|
|
@@ -1437,17 +1442,41 @@ public class PublicServiceImpl implements PublicService {
|
|
uploadService.updateNotSync(tableName, recordId,msg);
|
|
uploadService.updateNotSync(tableName, recordId,msg);
|
|
return Boolean.TRUE;
|
|
return Boolean.TRUE;
|
|
}
|
|
}
|
|
|
|
+ if (StringUtils.isEmpty(order.getWebsitId())) {
|
|
|
|
+ // 不回传 不会存在工单主表无数据的情况 修改无需同步
|
|
|
|
+ msg = "【"+orderNo + "】安装或维修网点编号为空不回传";
|
|
|
|
+ uploadService.updateNotSync(tableName, recordId,msg);
|
|
|
|
+ return Boolean.TRUE;
|
|
|
|
+ }
|
|
|
|
|
|
// 售后网点处理
|
|
// 售后网点处理
|
|
- websit = publicService.ptshwdToshshwd(order.getWebsitId(), order.getMainId());
|
|
|
|
- SynUploadWebsit websitinfo = synUploadWebsitService.lambdaQuery()
|
|
|
|
- .eq(SynUploadWebsit::getBrandWebsitNo,websit.getWdId()).one();
|
|
|
|
- if (websitinfo != null){
|
|
|
|
|
|
+ Brand brand = baseService.getBrand();
|
|
|
|
+ // 提取平台售后网点对应的商户售后网点信息 存在一对多的关系
|
|
|
|
+ List<WebsitOrderSign> wos = websitOrderSignService.lambdaQuery()
|
|
|
|
+ .eq(WebsitOrderSign::getGroupCompanyId,brand.getBrandId())
|
|
|
|
+ .eq(WebsitOrderSign::getWebsitId, order.getWebsitId())
|
|
|
|
+ .list();
|
|
|
|
+ if (CollectionUtils.isEmpty(wos)){
|
|
|
|
+ msg = "【"+order.getWebsitId() + "】无对应的商户网点信息不需要回传";
|
|
|
|
+ uploadService.updateNotSync(tableName, recordId,msg);
|
|
|
|
+ return Boolean.TRUE;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ wos.stream().forEach(wba -> {
|
|
|
|
+ if (StringUtils.isNotEmpty(wba.getBrandWebsitId())){
|
|
|
|
+ brandWebsitid.add(wba.getBrandWebsitId());
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ // 只要存在就可以回传
|
|
|
|
+ List<SynUploadWebsit> websitinfo = synUploadWebsitService.lambdaQuery()
|
|
|
|
+ .in(SynUploadWebsit::getBrandWebsitNo,brandWebsitid).list();
|
|
|
|
+ if (CollectionUtils.isNotEmpty(websitinfo)) {
|
|
// 回传 找到相应的网点说明该网点工单需要回传
|
|
// 回传 找到相应的网点说明该网点工单需要回传
|
|
return Boolean.FALSE;
|
|
return Boolean.FALSE;
|
|
}
|
|
}
|
|
- msg = "【"+order.getWebsitId() + ">"+websit.getWdId()+"】网点工单信息不需要回传";
|
|
|
|
|
|
|
|
|
|
+ msg = "【"+order.getWebsitId() + "】不在指定的同步网点信息内不需要回传";
|
|
// 不回传 修改无需同步
|
|
// 不回传 修改无需同步
|
|
uploadService.updateNotSync(tableName, recordId,msg);
|
|
uploadService.updateNotSync(tableName, recordId,msg);
|
|
return Boolean.TRUE;
|
|
return Boolean.TRUE;
|