Merge remote-tracking branch 'origin/main'

This commit is contained in:
张明 2025-05-15 14:12:51 +08:00
commit 4dd007bbf2
1 changed files with 36 additions and 11 deletions

View File

@ -24,6 +24,7 @@ import nc.itf.uap.IUAPQueryBS;
import nc.jdbc.framework.processor.ArrayListProcessor;
import nc.jdbc.framework.processor.MapProcessor;
import nc.vo.mmpac.pickm.entity.AggPickmVO;
import nc.vo.pub.BusinessException;
import nc.vo.pub.lang.UFDateTime;
@ -83,7 +84,7 @@ public JSONString ClosesoUpdateBL(JSONString json) {
try {
ArrayList<String> bidsList = new ArrayList<>();
operationMap.put("9", "Íê³É");
operationMap.put("9", "冻结");
operationMap.put("10", "办结");
operationMap.put("11", "终止");
operationMap.put("8", "生效");
@ -94,7 +95,7 @@ public JSONString ClosesoUpdateBL(JSONString json) {
}
String operation = (String) jObject.getOrDefault("operation", "");
String pk_org = null;
// operation="9";
// 从解析的JSON对象中获取必要的字段
JSONArray array = jObject.getJSONArray("array");
@ -104,18 +105,42 @@ public JSONString ClosesoUpdateBL(JSONString json) {
if (def1 == null){
return ResultMessageUtil.exceptionToJSON(new NullPointerException("操作类型不存在"));
}
String operationSql = " SELECT bd.pk_defdoc ID from bd_defdoc bd " +
"LEFT join bd_defdoclist bdl ON bd.pk_defdoclist=bdl.pk_defdoclist WHERE bdl.code ='HTZT' AND bd.code = '" + operation.toString() + "' ";
// List<Map<String,Object>> operationresult = (List<Map<String,Object>>) getQueryService().executeQuery(operationSql, new ArrayListProcessor());
Map<String, Object> valList = (Map<String, Object>) getQueryService().executeQuery(operationSql, new MapProcessor());
// if (operationresult == null || operationresult.size() == 0) {
// errojson.put("status", "0");
// errojson.put("message", "操作类型不存在");
// errojson.put("codeList", null);
// // 返回表示操作成功的JSON字符串
// return ResultMessageUtil.toJSON(errojson);
// }
String operationId = null;
// // 循环result取csaleorderbid与ts生成"1001A11000000B0OJ2HI,2024-12-02 10:16:10"这种样式插入bidsList
// for (Map<String,Object> row : operationresult) {
// operationId = (String) row.get("bd.pk_defdoc");
// }
operationId = (String) valList.get("ID");
for (int i = 0; i < array.size(); i++) {
Map item = (Map) array.get(i);
String vctcode = (String) item.getOrDefault("vctcode", "");
// updateSql = " UPDATE so_saleorder h" +
// " SET h.vdef1 = '" + operationId + "' , h.vdef19 = '"+json.toJSONString() +"' '"+
// " WHERE EXISTS (" +
// " SELECT 1" +
// " FROM so_saleorder_b b" +
// " left join bd_defdoc hbd on hbd.pk_defdoc=b.vbdef1 "+
// " WHERE b.csaleorderid = h.csaleorderid" +
// " AND hbd.code = '" + vctcode + "' " +
// " );";
// updateSql = " UPDATE so_saleorder h" +
// " SET h.vdef19 = '" + json.toJSONString() + "' " +
// " WHERE h.vdef6 = '" + "ZKWEQ0400425" + "' " + " ;";
updateSql = " UPDATE so_saleorder h" +
" SET h.vdef7 = '" + operationMap.get(operation.toString()) + "' " +
" WHERE EXISTS (" +
" SELECT 1" +
" FROM so_saleorder_b b" +
" left join bd_defdoc hbd on hbd.pk_defdoc=b.vbdef1 "+
" WHERE b.csaleorderid = h.csaleorderid" +
" AND hbd.code = '" + vctcode + "' " +
" );";
" SET h.vdef1 = '" + operationId + "' , h.vdef19 = '"+json.toJSONString() +"' '"+
" WHERE h.vdef6 = '" + vctcode + "' " + " ;";
// 验证operation字段是否存在
if (vctcode == null) {
return ResultMessageUtil.exceptionToJSON(new NullPointerException("vctcode:null"));
@ -126,7 +151,7 @@ public JSONString ClosesoUpdateBL(JSONString json) {
+ "left join org_salesorg o on h.pk_org=o.pk_salesorg "
+" left join bd_defdoc hbd on hbd.pk_defdoc=b.vbdef1 "+
"where hbd.code='" + vctcode + "' ";
"where h.vdef6='" + vctcode + "' ";
List<Object[]> result = (List<Object[]>) getQueryService().executeQuery(sql, new ArrayListProcessor());
if (result == null || result.size() == 0) {
errojson.put("status", "0");