|
@@ -34,6 +34,7 @@ import org.apache.commons.lang3.time.DateUtils;
|
|
|
import org.slf4j.MDC;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.io.FileOutputStream;
|
|
@@ -119,11 +120,14 @@ public class KabeiyiServiceImpl implements KabeiyiService {
|
|
|
//审核计划
|
|
|
private static final String CHECK_PLAN = "FORM-A9A7991EEB7D41FDAADADB9B1E1750FE0K5K";
|
|
|
|
|
|
+ //产品实发
|
|
|
+ private static final String PRODUCT_REAL = "FORM-809458EB6D524CF5AE1A91A3492D8B1BZIMN";
|
|
|
+
|
|
|
//内部交易客户
|
|
|
- private static final String INTERNAL_CUSTOMER = "FORM-A4CD6904046E4BB793F3B40B51E310B657YZ";
|
|
|
+ private static final String INTERNAL_CUSTOMER = "FORM-14782CE27EA54D2C94CC5BEF90554E5ALYP7";
|
|
|
|
|
|
//内部工厂
|
|
|
- private static final String INTERNAL_FACTORY = "FORM-CE17FDE72A8541B48D04FD64E89E7C630AQF";
|
|
|
+ private static final String INTERNAL_FACTORY = "FORM-6CD7A1EDE1134AC8B2EE833769595C2EIWQ6";
|
|
|
|
|
|
//关联表单(卡倍亿)
|
|
|
private static final Map<String,String> SCHEMA_MAP = new HashMap<>();
|
|
@@ -399,11 +403,11 @@ public class KabeiyiServiceImpl implements KabeiyiService {
|
|
|
|
|
|
@Override
|
|
|
public McR ocr(String downloadUrl,String name,String type) {
|
|
|
- MDC.put("MDC_KEY_PID","1009");
|
|
|
+ MDC.put("MDC_KEY_PID","1020");
|
|
|
|
|
|
//下载宜搭附件
|
|
|
try {
|
|
|
- String[] yida = McProject.getYida("1009");
|
|
|
+ String[] yida = McProject.getYida("1020");
|
|
|
downloadFile(downloadUrl,filePath + name,yida[0],yida[1]);
|
|
|
log.info("文件下载成功!");
|
|
|
} catch (IOException e) {
|
|
@@ -568,11 +572,12 @@ public class KabeiyiServiceImpl implements KabeiyiService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Async
|
|
|
public McR getDeliveryInfo() {
|
|
|
//现在时间戳
|
|
|
long beginTime = System.currentTimeMillis();
|
|
|
|
|
|
- MDC.put("MDC_KEY_PID","1009");
|
|
|
+ MDC.put("MDC_KEY_PID","1019");
|
|
|
|
|
|
//内部交易客户
|
|
|
DDR_New ddrNew = ydClient.queryData(YDParam.builder()
|
|
@@ -600,14 +605,15 @@ public class KabeiyiServiceImpl implements KabeiyiService {
|
|
|
}
|
|
|
|
|
|
for (Integer dsSequence : factory.keySet()) {
|
|
|
- //todo 同步近一个月内的数据 upsert
|
|
|
- //获取昨天所有发货单
|
|
|
+ //同步当月内的数据 upsert
|
|
|
DateTime dateTime = DateUtil.offsetDay(new Date(), -1);
|
|
|
String yesterday = dateTime.toString("yyyy-MM-dd");
|
|
|
- DateTime beginOfMonth = DateUtil.beginOfMonth(dateTime);
|
|
|
+
|
|
|
+ DateTime beginOfMonth = DateUtil.beginOfMonth(DateUtil.lastMonth());
|
|
|
String beginOfMonthString = beginOfMonth.toString("yyyy-MM-dd");
|
|
|
+// String beginOfMonthString = "2024-10-07";
|
|
|
|
|
|
-// String yesterday = dateTime.toString("2024-09-22");
|
|
|
+// String yesterday = "2024-10-07";
|
|
|
|
|
|
Map<String,Object> param = new HashMap<>();
|
|
|
param.put("from_account",fromAccount);
|
|
@@ -714,8 +720,8 @@ public class KabeiyiServiceImpl implements KabeiyiService {
|
|
|
while (i<=5 && !flag){
|
|
|
try{
|
|
|
ydClient.operateData(YDParam.builder()
|
|
|
- .formUuid("FORM-BE542784AAC04206BD46AF3D9CD1F12DYSKF")
|
|
|
- .searchCondition(JSON.toJSONString(UtilMap.map("textField_m18nvp87",getString(consignment2.get("code")))))
|
|
|
+ .formUuid(PRODUCT_REAL)
|
|
|
+ .searchCondition(JSON.toJSONString(UtilMap.map("textField_m18nvp87, numberField_m18wkih7",getString(consignment2.get("code")),dsSequence)))
|
|
|
.formDataJson(JSON.toJSONString(formData))
|
|
|
.build(), YDConf.FORM_OPERATION.upsert);
|
|
|
flag = true;
|