金思维Mes修改BIP销售订单明细和回写合同销售订单的时间格式调整
This commit is contained in:
parent
a951536045
commit
0879904f2b
|
@ -63,6 +63,11 @@ import java.net.MalformedURLException;
|
|||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
|
@ -1310,9 +1315,11 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain {
|
|||
List<Map<String, Object>> l_map_f = new ArrayList<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
// bomConfigureFinishDate BOM配置完成日期
|
||||
map.put("bomConfigureFinishDate", paramMap.get("vbdef16"));
|
||||
String vbdef16 = convertDateString(paramMap.get("vbdef16") + "");
|
||||
map.put("bomConfigureFinishDate", vbdef16);
|
||||
// craftConfigureFinishDate 工艺配置完成日期
|
||||
map.put("craftConfigureFinishDate", paramMap.get("vbdef17"));
|
||||
String vbdef17 = convertDateString(paramMap.get("vbdef17") + "");
|
||||
map.put("craftConfigureFinishDate", vbdef17);
|
||||
// BIP合同销售订单更新 子表id
|
||||
map.put("id", soMap.get("vbdef11"));
|
||||
l_map_f.add(map);
|
||||
|
@ -1554,6 +1561,28 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain {
|
|||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* ת»»ÈÕÆÚ×Ö·û´®
|
||||
* yyyy-MM-dd HH:mm:ss to yyyy-MM-dd
|
||||
*
|
||||
* @param input ÊäÈë
|
||||
* @return {@link String}
|
||||
*/
|
||||
public String convertDateString(String input) throws BusinessException {
|
||||
if (com.yonyou.cloud.utils.StringUtils.isEmpty(input) || "null".equals(input)) {
|
||||
return input;
|
||||
}
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
try {
|
||||
Date date = formatter.parse(input);
|
||||
LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
return localDate.format(dtf);
|
||||
} catch (ParseException e) {
|
||||
throw new BusinessException("Invalid date format", e);
|
||||
}
|
||||
}
|
||||
|
||||
private void updatePmoBill(SaleOrderVO[] vos) {
|
||||
// 同步修改流程生产订单的国网行项目号、国内采购订单号
|
||||
for (SaleOrderVO vo : vos) {
|
||||
|
|
|
@ -21,6 +21,7 @@ import nccloud.api.rest.utils.NCCRestUtils;
|
|||
import nccloud.api.rest.utils.ResultMessageUtil;
|
||||
import nccloud.api.so.m30.IAPISaleOrderMaitain;
|
||||
import nccloud.api.so.m30.IAPISaleOrderQuery;
|
||||
import nccloud.baseapp.core.log.NCCForUAPLogger;
|
||||
import nccloud.commons.lang.StringUtils;
|
||||
import nccloud.openapi.scmpub.pub.NCCPubRestResource;
|
||||
import nccloud.openapi.scmpub.pub.TransferCodeToPKTool;
|
||||
|
@ -465,7 +466,7 @@ public class SaleOrderResource extends NCCPubRestResource {
|
|||
}
|
||||
|
||||
/**
|
||||
* 金慧软件修改BIP销售订单明细
|
||||
* 쏜鋼郭Mes錦맣BIP饋簡땐데츠玖
|
||||
*
|
||||
* @author mzr
|
||||
* @date 2025/05/14
|
||||
|
@ -483,21 +484,34 @@ public class SaleOrderResource extends NCCPubRestResource {
|
|||
StringBuilder sql = new StringBuilder("update so_saleorder_b set ");
|
||||
SQLParameter parameter = new SQLParameter();
|
||||
for (Map.Entry<String, Object> entry : paramMap.entrySet()) {
|
||||
if (!"csaleorderbid".equals(entry.getKey())) {
|
||||
if ("csaleorderbid".equals(entry.getKey()) ||
|
||||
"csaleorderid".equals(entry.getKey()) ||
|
||||
entry.getKey().startsWith("vdef")
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
sql.append(entry.getKey()).append(" = ?, ");
|
||||
parameter.addParam(entry.getValue());
|
||||
}
|
||||
}
|
||||
if (parameter.getCountParams() <= 0) {
|
||||
return ResultMessageUtil.toJSON("传入参数为空,请检查", APIErrCodeEnum.BUSINESSEXCCODE.getCode());
|
||||
}
|
||||
// 删除最后的", "
|
||||
sql.delete(sql.length() - 2, sql.length());
|
||||
sql.append(" where csaleorderbid = ?");
|
||||
// NCCForUAPLogger.debug("updateDef-sql:" + sql);
|
||||
NCCForUAPLogger.debug("updateDef-sql:" + sql);
|
||||
parameter.addParam(csaleorderbid);
|
||||
BaseDAO baseDAO = new BaseDAO();
|
||||
// 錦맣饋簡땐데綾깊
|
||||
int num = baseDAO.executeUpdate(sql.toString(), parameter);
|
||||
// 錦맣饋簡땐데깊 vdef8 MES묏論쨌窟
|
||||
if (paramMap.containsKey("csaleorderid") && paramMap.containsKey("vdef8")) {
|
||||
String orderSql = "update so_saleorder set vdef8 = '[vdef8]' where csaleorderid = '[csaleorderid]'";
|
||||
orderSql = orderSql.replace("[vdef8]", paramMap.getOrDefault("vdef8", "") + "");
|
||||
orderSql = orderSql.replace("[csaleorderid]", paramMap.getOrDefault("csaleorderid", "") + "");
|
||||
int num1 = baseDAO.executeUpdate(orderSql);
|
||||
NCCForUAPLogger.debug("updateDef-num1:" + num1);
|
||||
}
|
||||
if (num > 0) {
|
||||
// 回写合同平台的对应字段
|
||||
NCLocator.getInstance().lookup(IAPISaleOrderMaitain.class).updateBipFlagSo(paramMap);
|
||||
|
|
Loading…
Reference in New Issue