|
|
@@ -843,24 +843,25 @@ public class YidaServiceImpl implements YidaService {
|
|
|
String userId; //用户userId
|
|
|
JSONArray businessLeaderUserIdJSONArray; //业务组长userId(未解析)
|
|
|
String businessLeaderUserId; //业务组长userId
|
|
|
+ String testUse; //测试使用
|
|
|
|
|
|
/*
|
|
|
初始化参数值
|
|
|
*/
|
|
|
- ydSearch = new YDSearch(
|
|
|
- "radioField_mn48qynm",
|
|
|
- "在职",
|
|
|
- "在职情况",
|
|
|
- YDSearch.Type.RADIO_FIELD,
|
|
|
- YDSearch.Operator.EQ
|
|
|
- );
|
|
|
- searchCondition = JSONObject.toJSONString(Arrays.asList(ydSearch));
|
|
|
+// ydSearch = new YDSearch(
|
|
|
+// "radioField_mn48qynm",
|
|
|
+// "在职",
|
|
|
+// "在职情况",
|
|
|
+// YDSearch.Type.RADIO_FIELD,
|
|
|
+// YDSearch.Operator.EQ
|
|
|
+// );
|
|
|
+// searchCondition = JSONObject.toJSONString(Arrays.asList(ydSearch));
|
|
|
hasMore = true; //第一页默认有数据
|
|
|
pageNo = 1;
|
|
|
pageSize = 100;
|
|
|
ydParamBuilder = YDParam.builder();
|
|
|
ydParamBuilder = ydParamBuilder.formUuid(EastarParam.YD_FORMUUID_BUSINESS_USER);
|
|
|
- ydParamBuilder = ydParamBuilder.searchCondition(searchCondition);
|
|
|
+// ydParamBuilder = ydParamBuilder.searchCondition(searchCondition);
|
|
|
|
|
|
/*
|
|
|
翻页获取数据
|
|
|
@@ -891,11 +892,16 @@ public class YidaServiceImpl implements YidaService {
|
|
|
userId = "";
|
|
|
businessLeaderUserId = "";
|
|
|
for (Map record : allRecords){
|
|
|
+ testUse = null;
|
|
|
+
|
|
|
businessUserRecord = new HashMap<>();
|
|
|
+
|
|
|
//获取表单实例ID
|
|
|
formInstId = String.valueOf(record.get("formInstanceId"));
|
|
|
+
|
|
|
//解析字段数据
|
|
|
fields = JSONObject.parseObject(JSONObject.toJSONString(record.get("formData")));
|
|
|
+
|
|
|
/*
|
|
|
获取成员数据
|
|
|
*/
|
|
|
@@ -905,6 +911,7 @@ public class YidaServiceImpl implements YidaService {
|
|
|
userId = String.valueOf(businessUserIdJSONArray.get(0));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/*
|
|
|
获取业务组长数据
|
|
|
*/
|
|
|
@@ -914,10 +921,19 @@ public class YidaServiceImpl implements YidaService {
|
|
|
businessLeaderUserId = String.valueOf(businessLeaderUserIdJSONArray.get(0));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /*
|
|
|
+ 获取测试使用
|
|
|
+ */
|
|
|
+ if(fields.get("radioField_mnxyjnou") != null){
|
|
|
+ testUse = String.valueOf(fields.get("radioField_mnxyjnou"));
|
|
|
+ }
|
|
|
+
|
|
|
if(!formInstId.isEmpty() && !userId.isEmpty()){
|
|
|
businessUserRecord.put("formInstId",formInstId);
|
|
|
businessUserRecord.put("userId",userId);
|
|
|
businessUserRecord.put("businessLeaderUserId",businessLeaderUserId);
|
|
|
+ businessUserRecord.put("testUse",testUse);
|
|
|
businessUserData.add(businessUserRecord);
|
|
|
}
|
|
|
}
|
|
|
@@ -949,6 +965,30 @@ public class YidaServiceImpl implements YidaService {
|
|
|
ydClient.operateData(yidaParam,YDConf.FORM_OPERATION.update);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void updateLtcBusinessUserPrivateCustomerNum(String formInstId, int numOfPrivateCustomer) throws Exception {
|
|
|
+ /*
|
|
|
+ 参数定义
|
|
|
+ */
|
|
|
+ YDParam yidaParam; //HTTP请求体
|
|
|
+ YDParam.YDParamBuilder ydParamBuilder; //宜搭参数构建
|
|
|
+ String updateFormDataJson; //更新内容
|
|
|
+
|
|
|
+ /*
|
|
|
+ 初始化参数值
|
|
|
+ */
|
|
|
+ updateFormDataJson = JSONObject.toJSONString(UtilMap.map("numberField_ms43nslj",numOfPrivateCustomer)); //私海客户数量
|
|
|
+
|
|
|
+ /*
|
|
|
+ 更新数据
|
|
|
+ */
|
|
|
+ ydParamBuilder = YDParam.builder();
|
|
|
+ ydParamBuilder = ydParamBuilder.formInstId(formInstId);
|
|
|
+ ydParamBuilder = ydParamBuilder.updateFormDataJson(updateFormDataJson);
|
|
|
+ yidaParam = ydParamBuilder.build();
|
|
|
+ ydClient.operateData(yidaParam,YDConf.FORM_OPERATION.update);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<Map> queryLtcAllCustomerData() throws Exception {
|
|
|
/*
|
|
|
@@ -1069,6 +1109,10 @@ public class YidaServiceImpl implements YidaService {
|
|
|
JSONObject fields; //字段数据
|
|
|
String formInstId; //表单实例ID
|
|
|
Map saleProjectRecord; //销售项目记录
|
|
|
+ Double projectAmount; //预计销售项目金额(美元)
|
|
|
+ Long yidaEstimatedOrderDate; //预计成单日期
|
|
|
+ Long yidaActualOrderDate; //实际成单日期
|
|
|
+ String clearLevelFlag; //是否计算为通关项目
|
|
|
|
|
|
/*
|
|
|
初始化参数值
|
|
|
@@ -1107,16 +1151,42 @@ public class YidaServiceImpl implements YidaService {
|
|
|
*/
|
|
|
log.info("所有记录数量="+allRecords.size());
|
|
|
for (Map ltcSaleProjectRecord : allRecords){
|
|
|
+ projectAmount = null;
|
|
|
+ yidaEstimatedOrderDate = null;
|
|
|
+ yidaActualOrderDate = null;
|
|
|
+ clearLevelFlag = null;
|
|
|
+
|
|
|
//获取表单实例ID
|
|
|
formInstId = String.valueOf(ltcSaleProjectRecord.get("formInstanceId"));
|
|
|
+
|
|
|
//解析字段数据
|
|
|
fields = JSONObject.parseObject(JSONObject.toJSONString(ltcSaleProjectRecord.get("formData")));
|
|
|
|
|
|
+ if(fields.get("numberField_mdf997x6") != null){ //预计销售项目金额(美元)
|
|
|
+ projectAmount = Double.parseDouble(fields.getString("numberField_mdf997x6"));
|
|
|
+ }
|
|
|
+
|
|
|
+ if(fields.get("dateField_mdf997x7") != null){ //预计成单日期
|
|
|
+ yidaEstimatedOrderDate = Long.parseLong(fields.getString("dateField_mdf997x7"));
|
|
|
+ }
|
|
|
+
|
|
|
+ if(fields.get("dateField_mfm5x6cl") != null){ //实际成单日期
|
|
|
+ yidaActualOrderDate = Long.parseLong(fields.getString("dateField_mfm5x6cl"));
|
|
|
+ }
|
|
|
+
|
|
|
+ if(fields.get("radioField_ms2v43hf") != null){ //是否计算为通关项目
|
|
|
+ clearLevelFlag = fields.getString("radioField_ms2v43hf");
|
|
|
+ }
|
|
|
+
|
|
|
saleProjectRecord = UtilMap.map(
|
|
|
- "formInstId, projectCode, projectName, piCode, testFlag, aiTableId",
|
|
|
+ "formInstId, projectCode, projectName, projectAmount, yidaEstimatedOrderDate, yidaActualOrderDate, clearLevelFlag, piCode, testFlag, aiTableId",
|
|
|
formInstId, //表单实例ID
|
|
|
fields.getString("serialNumberField_mdf997w0"), //项目编号
|
|
|
fields.getString("textField_mdf997vz"), //项目名称
|
|
|
+ projectAmount, //预计销售项目金额(美元)
|
|
|
+ yidaEstimatedOrderDate, //预计成单日期
|
|
|
+ yidaActualOrderDate, //实际成单日期
|
|
|
+ clearLevelFlag, //是否计算为通关项目
|
|
|
fields.getString("textField_mhlrjdz2"), //原系统PI号
|
|
|
fields.getString("radioField_mnppbub6"), //测试使用
|
|
|
fields.getString("textField_mno9p0lf") //AI表格映射ID
|
|
|
@@ -1152,6 +1222,7 @@ public class YidaServiceImpl implements YidaService {
|
|
|
JSONArray businessUserIdJSONArray; //业务员字段值
|
|
|
String businessUserId; //业务员userId
|
|
|
Double projectAmount; //预计销售项目金额(美元)
|
|
|
+ String clearLevelFlag; //是否计算为通关项目
|
|
|
|
|
|
/*
|
|
|
初始化参数值
|
|
|
@@ -1200,6 +1271,28 @@ public class YidaServiceImpl implements YidaService {
|
|
|
ydSearchList.add(ydSearch);
|
|
|
}
|
|
|
|
|
|
+ if(params.containsKey("actualOrderBeginDate")){
|
|
|
+ ydSearch = new YDSearch(
|
|
|
+ "dateField_mfm5x6cl",
|
|
|
+ Long.parseLong(params.get("actualOrderBeginDate").toString()),
|
|
|
+ "实际成单日期",
|
|
|
+ YDSearch.Type.DATE_FIELD,
|
|
|
+ YDSearch.Operator.GE
|
|
|
+ );
|
|
|
+ ydSearchList.add(ydSearch);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(params.containsKey("actualOrderEndDate")){
|
|
|
+ ydSearch = new YDSearch(
|
|
|
+ "dateField_mfm5x6cl",
|
|
|
+ Long.parseLong(params.get("actualOrderEndDate").toString()),
|
|
|
+ "实际成单日期",
|
|
|
+ YDSearch.Type.DATE_FIELD,
|
|
|
+ YDSearch.Operator.LE
|
|
|
+ );
|
|
|
+ ydSearchList.add(ydSearch);
|
|
|
+ }
|
|
|
+
|
|
|
if(params.containsKey("rfqFrom")){
|
|
|
ydSearch = new YDSearch(
|
|
|
"radioField_mrle8vw0",
|
|
|
@@ -1223,6 +1316,8 @@ public class YidaServiceImpl implements YidaService {
|
|
|
}
|
|
|
|
|
|
searchCondition = JSONObject.toJSONString(ydSearchList);
|
|
|
+ log.info("筛选条件:");
|
|
|
+ log.info(searchCondition);
|
|
|
|
|
|
hasMore = true; //第一页默认有数据
|
|
|
pageNo = 1;
|
|
|
@@ -1266,6 +1361,7 @@ public class YidaServiceImpl implements YidaService {
|
|
|
for (Map ltcSaleProjectRecord : allRecords){
|
|
|
businessUserId = "";
|
|
|
projectAmount = 0.0;
|
|
|
+ clearLevelFlag = null;
|
|
|
|
|
|
//获取表单实例ID
|
|
|
formInstId = String.valueOf(ltcSaleProjectRecord.get("formInstanceId"));
|
|
|
@@ -1287,8 +1383,12 @@ public class YidaServiceImpl implements YidaService {
|
|
|
projectAmount = Double.parseDouble(fields.getString("numberField_mdf997x6"));
|
|
|
}
|
|
|
|
|
|
+ if(fields.get("radioField_ms2v43hf") != null){ //是否计算为通关项目
|
|
|
+ clearLevelFlag = fields.getString("radioField_ms2v43hf");
|
|
|
+ }
|
|
|
+
|
|
|
saleProjectRecord = UtilMap.map(
|
|
|
- "formInstId, projectCode, projectName, projectStage, projectAmount, customer, customerCode, businessUserId, piCode, rfqFrom, testUse, aiTableId",
|
|
|
+ "formInstId, projectCode, projectName, projectStage, projectAmount, customer, customerCode, businessUserId, piCode, rfqFrom, testUse, clearLevelFlag, aiTableId",
|
|
|
formInstId, //表单实例ID
|
|
|
fields.getString("serialNumberField_mdf997w0"), //项目编号
|
|
|
fields.getString("textField_mdf997vz"), //项目名称
|
|
|
@@ -1300,6 +1400,7 @@ public class YidaServiceImpl implements YidaService {
|
|
|
fields.getString("textField_mhlrjdz2"), //原系统PI号
|
|
|
fields.getString("radioField_mrle8vw0"), //RFQ来源
|
|
|
fields.getString("radioField_mnppbub6"), //测试使用
|
|
|
+ clearLevelFlag, //是否计算为通关项目
|
|
|
fields.getString("textField_mno9p0lf") //AI表格映射ID
|
|
|
);
|
|
|
saleProjectData.add(saleProjectRecord);
|
|
|
@@ -1613,6 +1714,7 @@ public class YidaServiceImpl implements YidaService {
|
|
|
String newBusinessUserId; //新业务员userId
|
|
|
Long employmentDate; //入职日期
|
|
|
Long deadline; //3个月考核截止日期
|
|
|
+ Long confirmationDate; //试用期结束日期
|
|
|
|
|
|
/*
|
|
|
初始化参数值
|
|
|
@@ -1685,14 +1787,18 @@ public class YidaServiceImpl implements YidaService {
|
|
|
//获取3个月考核截止日期
|
|
|
deadline = fields.getLong("dateField_mrtylxl4");
|
|
|
|
|
|
+ //试用期结束日期
|
|
|
+ confirmationDate = fields.getLong("dateField_mrmtlvou");
|
|
|
+
|
|
|
|
|
|
//添加客户建联跟进记录
|
|
|
newBusinessUserRecord = UtilMap.map(
|
|
|
- "formInstId, newBusinessUserId, employmentDate, deadline",
|
|
|
+ "formInstId, newBusinessUserId, employmentDate, deadline, confirmationDate",
|
|
|
formInstId, //表单实例ID
|
|
|
newBusinessUserId, //新业务员userId
|
|
|
employmentDate, //入职日期
|
|
|
- deadline //3个月考核截止日期
|
|
|
+ deadline, //3个月考核截止日期
|
|
|
+ confirmationDate //试用期结束日期
|
|
|
);
|
|
|
newBusinessUserData.add(newBusinessUserRecord);
|
|
|
}
|
|
|
@@ -1701,7 +1807,7 @@ public class YidaServiceImpl implements YidaService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void updateLtcNewBusinessUserRecord(String formInstId, int numOfRFQ) throws Exception {
|
|
|
+ public void updateLtcNewBusinessUserRecord(String formInstId, int numOfRFQ, Double projectAmountTotal) throws Exception {
|
|
|
/*
|
|
|
参数定义
|
|
|
*/
|
|
|
@@ -1714,8 +1820,9 @@ public class YidaServiceImpl implements YidaService {
|
|
|
*/
|
|
|
updateFormDataJson = JSONObject.toJSONString(
|
|
|
UtilMap.map(
|
|
|
- "numberField_mrtylxl7, dateField_mrtylxld",
|
|
|
+ "numberField_mrtylxl7, numberField_mrtylxlk, dateField_mrtylxld",
|
|
|
numOfRFQ, //3个月RFQ量
|
|
|
+ projectAmountTotal, //试用期成单额
|
|
|
DateUtil.current() //RFQ数据更新时间
|
|
|
)
|
|
|
);
|
|
|
@@ -2227,6 +2334,74 @@ public class YidaServiceImpl implements YidaService {
|
|
|
ydClient.operateData(yidaParam,YDConf.FORM_OPERATION.update);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void updateLtcSaleProjectOrderInfo(String formInstId, Double projectAmount, Long estimatedOrderDate, Long actualOrderDate, String syncFlag) throws Exception {
|
|
|
+ /*
|
|
|
+ 参数定义
|
|
|
+ */
|
|
|
+ YDParam yidaParam; //HTTP请求体
|
|
|
+ YDParam.YDParamBuilder ydParamBuilder; //宜搭参数构建
|
|
|
+ String updateFormDataJson; //更新内容
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ 初始化参数值
|
|
|
+ */
|
|
|
+ Map<String, Object> updateFormData = new HashMap<>();
|
|
|
+ if(projectAmount!=null){
|
|
|
+ updateFormData.put("numberField_mdf997x6",projectAmount); //预计销售项目金额(美元)
|
|
|
+ }
|
|
|
+ if(estimatedOrderDate!=null){
|
|
|
+ updateFormData.put("dateField_mdf997x7",estimatedOrderDate); //预计成单日期
|
|
|
+ }
|
|
|
+ if(actualOrderDate!=null){
|
|
|
+ updateFormData.put("dateField_mfm5x6cl",actualOrderDate); //实际成单日期
|
|
|
+ }
|
|
|
+ updateFormData.put("radioField_mrwuh4nm",syncFlag); //从项目总表同步
|
|
|
+ updateFormDataJson = JSONObject.toJSONString(updateFormData);
|
|
|
+ System.out.println(updateFormDataJson);
|
|
|
+
|
|
|
+ /*
|
|
|
+ 更新数据
|
|
|
+ */
|
|
|
+ ydParamBuilder = YDParam.builder();
|
|
|
+ ydParamBuilder = ydParamBuilder.formInstId(formInstId);
|
|
|
+ ydParamBuilder = ydParamBuilder.updateFormDataJson(updateFormDataJson);
|
|
|
+ yidaParam = ydParamBuilder.build();
|
|
|
+ ydClient.operateData(yidaParam,YDConf.FORM_OPERATION.update);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void updateLtcSaleProjectClearLevel(String formInstId, String clearLevelFlag) throws Exception {
|
|
|
+ /*
|
|
|
+ 参数定义
|
|
|
+ */
|
|
|
+ YDParam yidaParam; //HTTP请求体
|
|
|
+ YDParam.YDParamBuilder ydParamBuilder; //宜搭参数构建
|
|
|
+ String updateFormDataJson; //更新内容
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ 初始化参数值
|
|
|
+ */
|
|
|
+ Map<String, Object> updateFormData = new HashMap<>();
|
|
|
+ if(clearLevelFlag!=null){
|
|
|
+ updateFormData.put("radioField_ms2v43hf",clearLevelFlag); //是否计算为通关项目
|
|
|
+ }
|
|
|
+ updateFormDataJson = JSONObject.toJSONString(updateFormData);
|
|
|
+ System.out.println(updateFormDataJson);
|
|
|
+
|
|
|
+ /*
|
|
|
+ 更新数据
|
|
|
+ */
|
|
|
+ ydParamBuilder = YDParam.builder();
|
|
|
+ ydParamBuilder = ydParamBuilder.formInstId(formInstId);
|
|
|
+ ydParamBuilder = ydParamBuilder.updateFormDataJson(updateFormDataJson);
|
|
|
+ yidaParam = ydParamBuilder.build();
|
|
|
+ ydClient.operateData(yidaParam,YDConf.FORM_OPERATION.update);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public void insertCustomerData(Map row) throws Exception {
|
|
|
YDParam yidaParam; //HTTP请求体
|