|
|
@@ -257,7 +257,7 @@ public class ScheduleTask8 {
|
|
|
* 同步销售项目数据到项目总表
|
|
|
* 业务员
|
|
|
*/
|
|
|
-// @Scheduled(cron = "0 10 9 * * ?")
|
|
|
+ @Scheduled(cron = "0 45 2 * * ?")
|
|
|
public void syncSaleProjectBusinessUser() {
|
|
|
log.info("同步销售项目数据到项目总表(业务员)开始");
|
|
|
|
|
|
@@ -339,22 +339,39 @@ public class ScheduleTask8 {
|
|
|
String aiTableId2;
|
|
|
String unionId1; //易思达系统客户业务员userId对应的unionId
|
|
|
String unionId2; //项目总表客户业务员的unionId
|
|
|
+ Map<String,Object> fields = new HashMap<>();
|
|
|
+ JSONArray userJSONArray = new JSONArray();
|
|
|
+ JSONObject userJSONObject = new JSONObject();
|
|
|
for (Map ltcSaleProjectRecord : ltcSaleProjectList){
|
|
|
try {
|
|
|
isNotMatch = false;
|
|
|
projectName = ltcSaleProjectRecord.get("projectName").toString();
|
|
|
aiTableId1 = ltcSaleProjectRecord.get("aiTableId").toString();
|
|
|
- businessUserId = ltcSaleProjectRecord.get("businessUserId").toString();
|
|
|
- unionId1 = userIdUnionIdMap.get(businessUserId);
|
|
|
- for (int i = 0; i < sys1SaleData.size(); i++) {
|
|
|
- aiTableId2 = sys1SaleData.get(i).get("aiTableId").toString();
|
|
|
- if(aiTableId1.equals(aiTableId2)){
|
|
|
- unionId2 = sys1SaleData.get(i).get("unionId").toString();
|
|
|
- if(!unionId1.equals(unionId2)){
|
|
|
- log.info(projectName+" 业务员不一致 "+unionId1+" "+unionId2);
|
|
|
- isNotMatch = true;
|
|
|
+ if(ltcSaleProjectRecord.get("businessUserId") != null){
|
|
|
+ businessUserId = ltcSaleProjectRecord.get("businessUserId").toString();
|
|
|
+ unionId1 = userIdUnionIdMap.get(businessUserId);
|
|
|
+ if (unionId1 == null || StringUtils.isEmpty(unionId1)) {
|
|
|
+// log.info("业务员userId="+businessUserId+",unionId为空!");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ for (int i = 0; i < sys1SaleData.size(); i++) {
|
|
|
+ aiTableId2 = sys1SaleData.get(i).get("aiTableId").toString();
|
|
|
+ if(aiTableId1.equals(aiTableId2)){
|
|
|
+ unionId2 = sys1SaleData.get(i).get("unionId").toString();
|
|
|
+ if(!unionId1.equals(unionId2)){
|
|
|
+ log.info(projectName+" 业务员不一致 "+unionId1+" "+unionId2);
|
|
|
+ isNotMatch = true;
|
|
|
+ log.info("更新项目总表售前台账数据业务员");
|
|
|
+ fields = new HashMap<>();
|
|
|
+ userJSONArray = new JSONArray();
|
|
|
+ userJSONObject = new JSONObject();
|
|
|
+ userJSONObject.put("unionId",unionId1);
|
|
|
+ userJSONArray.add(userJSONObject);
|
|
|
+ fields.put("Iz0yaro",JSONObject.toJSONString(userJSONArray)); //业务 - S1【人事】
|
|
|
+ aitableService.updateSys1SaleData(aiTableId2,fields);
|
|
|
+ }
|
|
|
+ break;
|
|
|
}
|
|
|
- break;
|
|
|
}
|
|
|
}
|
|
|
if(isNotMatch){
|