opt:单据同步优化;
This commit is contained in:
@@ -320,13 +320,13 @@ public class SyncErpService {
|
||||
K3CloudApi cloudApi = new K3CloudApi(identifyInfo);
|
||||
String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
|
||||
//String filterString = "FUseOrgId='750572'";
|
||||
String filterString = "FBillNo ='JDSCLLSQ240300033'";
|
||||
//String filterString = "FBillNo ='PPBOM240800244'";
|
||||
//String filterString = "FCreateDate >= '" + today + " 00:00:00' and FCreateDate <= '" + today + " 23:59:59'";
|
||||
ErpQuery query = new ErpQuery();
|
||||
query.setFilterString(filterString);
|
||||
//query.setFilterString(filterString);
|
||||
//query.setFormId(syncFormMapping.getForm_type());
|
||||
query.setFormId(syncFormMapping.getForm_type());
|
||||
query.setFieldKeys("FID");
|
||||
query.setFieldKeys("FMATERIALID");
|
||||
query.setLimit(1);
|
||||
String jsonString = JSON.toJSONString(query);
|
||||
List<List<Object>> lists = cloudApi.executeBillQuery(jsonString);
|
||||
|
||||
@@ -7,14 +7,18 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.utils.InterationUtil;
|
||||
import org.nl.wms.base_manage.material.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.dispatch_manage.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.dispatch_manage.point.service.impl.SchBasePointServiceImpl;
|
||||
import org.nl.wms.external_system.dto.InteracteDto;
|
||||
import org.nl.wms.pda_manage.cockpit.service.CockpitService;
|
||||
import org.nl.wms.pda_manage.cockpit.service.dao.PointInfo;
|
||||
import org.nl.wms.pda_manage.cockpit.service.dao.TaskInfo;
|
||||
import org.nl.wms.pda_manage.cockpit.service.mapper.CockpitMapper;
|
||||
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
@@ -312,6 +316,21 @@ public class CockpitServiceImpl implements CockpitService {
|
||||
r.setProduct_area(pointInfo.getProduct_area());
|
||||
}
|
||||
}
|
||||
InteracteDto<Object> dto = InteracteDto.builder().service("wmsToAcsService")
|
||||
.trace_id(MDC.get("trace_id"))
|
||||
.type("getWeight")
|
||||
.data(new JSONObject().put("device_code", code))
|
||||
.build();
|
||||
TableDataInfo result = InterationUtil.notifyExt("/api/wmsToAcs/apply", (JSONObject) JSON.toJSON(dto));
|
||||
String weight;
|
||||
//tofix
|
||||
if (result.getCode().equals("200")) {
|
||||
Object sd = result.getData();
|
||||
JSONObject data = JSONObject.parseObject(sd.toString());
|
||||
if (ObjectUtil.isNotEmpty(data)) {
|
||||
weight = data.getString("weight");
|
||||
}
|
||||
}
|
||||
BigDecimal theoryQty = BigDecimal.ZERO;
|
||||
//根据称重信息计算理论数量
|
||||
if (r.getActual_weight().compareTo(BigDecimal.ZERO) > 0) {
|
||||
|
||||
@@ -57,9 +57,11 @@ public class SyncErpBillsScheduleService {
|
||||
@Autowired
|
||||
private PmFormDataMapper pmFormDataMapper;
|
||||
private static Map<String, String> BillOrg_Mapping = MapOf.of(
|
||||
"PRD_PPBOM", "FPrdOrgId", "PRD_MO", "FPrdOrgId"
|
||||
, "SAL_SaleOrder", "StockOrgId", "PUR_ReceiveBill", "StockOrgId"
|
||||
, "ka7c19edf9d4b4b39b8cc4a06802163b0", "F_PMSY_PrdOrgId_Id");
|
||||
"PRD_PPBOM", "FPrdOrgId",
|
||||
"PRD_MO", "FPrdOrgId",
|
||||
"SAL_SaleOrder", "StockOrgId",
|
||||
"PUR_ReceiveBill", "StockOrgId"
|
||||
, "ka7c19edf9d4b4b39b8cc4a06802163b0", "F_PMSY_StockOrgId_Id");
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
@@ -67,7 +69,7 @@ public class SyncErpBillsScheduleService {
|
||||
MDC.put("requestIp", "127.0.0.1");
|
||||
MDC.put("requestTime", DateUtil.now());
|
||||
LuceneAppender.traceIdTL.set(BaseCode.intToChars(IdUtil.getLongId()));
|
||||
List<SyncFormMapping> list = syncFormMappingServiceImpl.list(new LambdaQueryWrapper<SyncFormMapping>().in(SyncFormMapping::getForm_type, "PRD_PPBOM", "PRD_MO", "PUR_ReceiveBill"));
|
||||
List<SyncFormMapping> list = syncFormMappingServiceImpl.list(new LambdaQueryWrapper<SyncFormMapping>().in(SyncFormMapping::getForm_type, "BD_MATERIAL"));
|
||||
for (SyncFormMapping m : list) {
|
||||
JSONArray mappingJson = m.getMapping_json();
|
||||
String mappingString = JSON.toJSONString(mappingJson);
|
||||
@@ -166,15 +168,21 @@ public class SyncErpBillsScheduleService {
|
||||
BeanUtils.copyProperties(erpSec, identifyInfo);
|
||||
K3CloudApi cloudApi = new K3CloudApi(identifyInfo);
|
||||
String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
|
||||
String BillOrg = BillOrg_Mapping.get(formType);
|
||||
//String filterString = "FBillNo ='CGSL241101132'";
|
||||
//String filterString = BillOrg + "='750572' AND FDocumentStatus='C' AND FCreateDate >= '2024-12-04 00:00:00' and FCreateDate <= '2024-12-04 23:59:59'";
|
||||
//String filterString = " FDocumentStatus='C' AND FCreateDate >= '2024-12-02 00:00:00' and FCreateDate <= '2024-12-02 23:59:59'";
|
||||
String filterString = BillOrg + "='750572' AND FDocumentStatus='C' AND FCreateDate >= '" + today + " 00:00:00' and FCreateDate <= '" + today + " 23:59:59'";
|
||||
String filterString = "FBillNo ='PPBOM240800244'";
|
||||
//String filterString = BillOrg + "='750572' AND FDocumentStatus='C' AND FCreateDate >= '" + today + " 00:00:00' and FCreateDate <= '" + today + " 23:59:59'";
|
||||
//构建查询条件
|
||||
// String BillOrg = BillOrg_Mapping.get(formType);
|
||||
// String filterString = BillOrg + "='750572' AND FDocumentStatus='C' ";
|
||||
// if ("ka7c19edf9d4b4b39b8cc4a06802163b0".equals(formType)) {
|
||||
// filterString += " AND F_PMSY_StockOrgId='750572' AND F_PMSY_BillStatus ='A' AND F_PMSY_CreateDate >= '2024-11-01 00:00:00' and F_PMSY_CreateDate <= '2024-12-04 23:59:59' ";
|
||||
// }else{
|
||||
// filterString += " AND FCreateDate >= '2024-11-01 00:00:00' and FCreateDate <= '2024-12-04 23:59:59' ";
|
||||
// }
|
||||
//String filterString = "FUseOrgId='750572'";
|
||||
ErpQuery query = new ErpQuery();
|
||||
query.setFilterString(filterString);
|
||||
query.setFormId(formType);
|
||||
query.setFieldKeys("FID");
|
||||
query.setFieldKeys("FMATERIALID");
|
||||
query.setLimit(0);
|
||||
String jsonString = JSON.toJSONString(query);
|
||||
List<List<Object>> lists = cloudApi.executeBillQuery(jsonString);
|
||||
@@ -214,6 +222,7 @@ public class SyncErpBillsScheduleService {
|
||||
外部:
|
||||
for (Object r : result) {
|
||||
try {
|
||||
jsonString = JSON.toJSONString(r);
|
||||
JSONArray mappingJsonArray = JSONArray.parseArray(mappingJson);
|
||||
List<PmFormData> formDataList = formDataService.syncAnalyse(mappingJsonArray, formType, dtlSplit, JSON.toJSONString(r));
|
||||
Set<String> materials = formDataList.stream().map(PmFormData::getMaterial_id).collect(Collectors.toSet());
|
||||
|
||||
Reference in New Issue
Block a user