saleUpdateLJpc接口的返回值调整
This commit is contained in:
parent
33bb0d8c2a
commit
ce5886c7b5
|
@ -6,14 +6,15 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import nc.bs.dao.BaseDAO;
|
||||
import nc.bs.framework.common.NCLocator;
|
||||
import nc.itf.uap.IUAPQueryBS;
|
||||
import nc.jdbc.framework.ConnectionFactory;
|
||||
import nc.jdbc.framework.JdbcSession;
|
||||
import nc.jdbc.framework.PersistenceManager;
|
||||
import nc.jdbc.framework.exception.DbException;
|
||||
import nc.jdbc.framework.processor.ColumnProcessor;
|
||||
import nc.jdbc.framework.processor.MapListProcessor;
|
||||
import nc.jdbc.framework.processor.MapProcessor;
|
||||
import nc.vo.pub.BusinessException;
|
||||
import nccloud.api.rest.utils.ResultMessageUtil;
|
||||
import nccloud.commons.lang.StringUtils;
|
||||
import nccloud.ws.rest.resource.AbstractNCCRestResource;
|
||||
import org.json.JSONString;
|
||||
|
||||
|
@ -34,8 +35,10 @@ public class saleUpdateLJpc extends AbstractNCCRestResource {
|
|||
public String getModule() {
|
||||
return "so";
|
||||
}
|
||||
|
||||
// 用于存储手工维护的必填字段和字段说明
|
||||
private Map<String, String> requiredFields;
|
||||
|
||||
// 构造方法,初始化必填字段及其说明
|
||||
public saleUpdateLJpc() {
|
||||
// 初始化必填字段列表及字段说明
|
||||
|
@ -59,7 +62,7 @@ public class saleUpdateLJpc extends AbstractNCCRestResource {
|
|||
}
|
||||
// 校验必填字段
|
||||
String tipsStr = checkRequiredFields(object);
|
||||
if (!tipsStr.equals("")) {
|
||||
if (!tipsStr.isEmpty()) {
|
||||
return ResultMessageUtil.exceptionToJSON(new NullPointerException(tipsStr));
|
||||
}
|
||||
String pk_org = (String) object.getOrDefault("pk_org", "");
|
||||
|
@ -72,6 +75,7 @@ public class saleUpdateLJpc extends AbstractNCCRestResource {
|
|||
|
||||
// StringBuilder sqlStr = new StringBuilder();
|
||||
List sqlStr = new ArrayList();
|
||||
List<JSONObject> resList = new ArrayList<>();
|
||||
for (int i = 0; i < arrayList.size(); i++) {
|
||||
Map dataMap = (Map) arrayList.get(i);
|
||||
|
||||
|
@ -100,6 +104,17 @@ public class saleUpdateLJpc extends AbstractNCCRestResource {
|
|||
+ " AND b.csaleorderbid = '" + dataMap.get("crowno") + "' and b.dr=0 "
|
||||
+ ");");
|
||||
}
|
||||
JSONObject resJson = new JSONObject(dataMap);
|
||||
String csaleorderbid = dataMap.getOrDefault("csaleorderbid", "") + "";
|
||||
if (StringUtils.isNotEmpty(csaleorderbid)) {
|
||||
String sql = " select sb.csaleorderbid,sb.vbdef19,sb.vbdef20" +
|
||||
" from so_saleorder_b sb" +
|
||||
" where sb.csaleorderbid='" + csaleorderbid + "' ";
|
||||
Map<String, Object> soMap = (Map<String, Object>) getQueryService().executeQuery(sql, new MapProcessor());
|
||||
resJson.put("vbdef19", soMap.getOrDefault("vbdef19", ""));
|
||||
resJson.put("vbdef20", soMap.getOrDefault("vbdef20", ""));
|
||||
}
|
||||
resList.add(resJson);
|
||||
}
|
||||
|
||||
// int succState = updateSaleBSQty(sqlStr.toString());
|
||||
|
@ -113,9 +128,8 @@ public class saleUpdateLJpc extends AbstractNCCRestResource {
|
|||
returnJson.put("state", 'N');
|
||||
returnJson.put("msg", "失败,已修改" + succState + "行");
|
||||
}
|
||||
returnJson.put("resList", resList);
|
||||
return ResultMessageUtil.toJSON(returnJson);
|
||||
} catch (DbException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue