|
|
@@ -16,6 +16,7 @@ import com.malk.server.aliwork.YDParam;
|
|
|
import com.malk.server.dingtalk.DDR_New;
|
|
|
import com.malk.service.aliwork.YDClient;
|
|
|
import com.malk.utils.UtilMap;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringEscapeUtils;
|
|
|
import org.slf4j.MDC;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -30,7 +31,7 @@ import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
- * 服务实现类
|
|
|
+ * 服务实现类
|
|
|
* </p>
|
|
|
*
|
|
|
* @author LQY
|
|
|
@@ -44,6 +45,7 @@ public class KdYdDeliveryServiceImpl extends ServiceImpl<KdYdDeliveryMapper, KdY
|
|
|
private KdYdDeliveryMapper kdYdDeliveryMapper;
|
|
|
@Autowired
|
|
|
private KdYdDeliveryDetailMapper kdYdDeliveryDetailMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public void insertDelivery(Map map) {
|
|
|
MDC.put("MDC_KEY_PID", "1003");
|
|
|
@@ -70,8 +72,8 @@ public class KdYdDeliveryServiceImpl extends ServiceImpl<KdYdDeliveryMapper, KdY
|
|
|
String kh = UtilMap.getString(formData, "textField_mejnamf2");
|
|
|
String jsbb = UtilMap.getString(formData, "selectField_mg3fuqvn");
|
|
|
String djbh = UtilMap.getString(formData, "serialNumberField_mheazm7w");
|
|
|
- if("2".equals(type)){
|
|
|
- djbh = UtilMap.getString(formData, "textField_miwwha1a");
|
|
|
+ if ("2".equals(type)) {
|
|
|
+ djbh = UtilMap.getString(formData, "textField_miwwha1a");
|
|
|
}
|
|
|
String xsbm = UtilMap.getString(formData, "textField_krnn5bmr");
|
|
|
// String xsy = UtilMap.getString(formData, "employeeField_mejowmng").replace("[\"", "").replace("\"]", "").trim();
|
|
|
@@ -120,7 +122,7 @@ public class KdYdDeliveryServiceImpl extends ServiceImpl<KdYdDeliveryMapper, KdY
|
|
|
}
|
|
|
|
|
|
Long id = kdYdDelivery.getId();
|
|
|
- System.out.println("id:"+id);
|
|
|
+ System.out.println("id:" + id);
|
|
|
// int count = 1;
|
|
|
for (Map item : tableField) {
|
|
|
String wlbm = safeGetString(item, "textField_mejnamff");
|
|
|
@@ -258,15 +260,14 @@ public class KdYdDeliveryServiceImpl extends ServiceImpl<KdYdDeliveryMapper, KdY
|
|
|
// 2. 添加需要特殊处理的主表字段
|
|
|
updateMap.put("associationFormField_mejmml36", sealjsonlist);
|
|
|
// updateMap.put("associationFormField_mfavc4ve", khjsonlist);
|
|
|
- updateMap.put("associationFormField_mk0gzflu", Arrays.asList(getfhdAss(fhtzd,formInstId)));
|
|
|
+ updateMap.put("associationFormField_mk0gzflu", Arrays.asList(getfhdAss(fhtzd, formInstId)));
|
|
|
updateMap.put("employeeField_krbgloal", sqr);
|
|
|
updateMap.put("employeeField_mejnamf3", xsy);
|
|
|
updateMap.put("textField_mjzk47so", fhtzd);
|
|
|
-
|
|
|
// 3. 添加处理后的子表数据
|
|
|
updateMap.put("tableField_mejnamfd", newSubTable);
|
|
|
String sqrid = sqr.substring(2, sqr.length() - 2);
|
|
|
- System.out.println("sqrid=="+sqrid);
|
|
|
+ System.out.println("sqrid==" + sqrid);
|
|
|
// 创建新表单实例
|
|
|
try {
|
|
|
ydClient.operateData(
|
|
|
@@ -319,6 +320,7 @@ public class KdYdDeliveryServiceImpl extends ServiceImpl<KdYdDeliveryMapper, KdY
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
private static int parseInt(String str, int defaultValue) {
|
|
|
if (str == null || str.trim().isEmpty()) {
|
|
|
return defaultValue;
|
|
|
@@ -329,10 +331,12 @@ public class KdYdDeliveryServiceImpl extends ServiceImpl<KdYdDeliveryMapper, KdY
|
|
|
return defaultValue;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
private String safeGetString(Map formData, String key) {
|
|
|
Object val = formData.get(key);
|
|
|
return val == null ? "" : String.valueOf(val);
|
|
|
}
|
|
|
+
|
|
|
public static BigDecimal toBigDecimal(String str) {
|
|
|
if (str == null || str.trim().isEmpty()) {
|
|
|
return BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP);
|