编码改完GBK

This commit is contained in:
zhangxinah@yonyou.com 2025-03-27 16:03:51 +08:00
parent a783655c15
commit 9705b3b9fc
4 changed files with 52 additions and 52 deletions

View File

@ -28,7 +28,7 @@ import nc.vo.pubapp.pattern.pub.MathTool;
import nccloud.baseapp.core.log.NCCForUAPLogger; import nccloud.baseapp.core.log.NCCForUAPLogger;
/** /**
* 合并备料计划保存前校验申请数量是否超过计划数量-2005适配2312 * 合并备料计划保存前校验申请数量是否超过计划数量-2005适配2312
* *
* @author mzr * @author mzr
* @date 2025/3/26 * @date 2025/3/26
@ -57,16 +57,16 @@ public class N_4455_WRITE extends AbstractCompiler2 {
context.setICPFParameter(pfparam); context.setICPFParameter(pfparam);
SapplyBillVO[] outVOs = (SapplyBillVO[])this.getVos(); SapplyBillVO[] outVOs = (SapplyBillVO[])this.getVos();
// 保存前校验申请数量是否超过计划数量 // 保存前校验申请数量是否超过计划数量
for (SapplyBillVO billVO : outVOs) { for (SapplyBillVO billVO : outVOs) {
SapplyBillBodyVO[] bodyVOS = billVO.getBodys(); SapplyBillBodyVO[] bodyVOS = billVO.getBodys();
for (SapplyBillBodyVO bodyVO : bodyVOS) { for (SapplyBillBodyVO bodyVO : bodyVOS) {
// 只判断来源单据是备料计划的出库申请 // 只判断来源单据是备料计划的出库申请
if (!"55A3".equals(bodyVO.getCsourcetype())) { if (!"55A3".equals(bodyVO.getCsourcetype())) {
continue; continue;
} }
String csourcebillbid = bodyVO.getCsourcebillbid(); String csourcebillbid = bodyVO.getCsourcebillbid();
// 查询备料计划中的计划出库数量通过备料计划的表体主键 // 查询备料计划中的计划出库数量通过备料计划的表体主键
String getPlanNumSql = "SELECT nplanoutastnum " String getPlanNumSql = "SELECT nplanoutastnum "
+ "FROM mm_pickm_b " + "FROM mm_pickm_b "
+ "WHERE NVL(dr,0) = 0 AND cpickm_bid = '[csourcebillbid]'"; + "WHERE NVL(dr,0) = 0 AND cpickm_bid = '[csourcebillbid]'";
@ -77,12 +77,12 @@ public class N_4455_WRITE extends AbstractCompiler2 {
continue; continue;
} }
UFDouble plantNum = new UFDouble(String.valueOf(nplanoutastnum)); UFDouble plantNum = new UFDouble(String.valueOf(nplanoutastnum));
// 通过备料计划的表体主键查询已申请数量 // 通过备料计划的表体主键查询已申请数量
String getApplyNumSql = "SELECT NVL(SUM(nassistnum),0) nassistnum " String getApplyNumSql = "SELECT NVL(SUM(nassistnum),0) nassistnum "
+ "FROM ic_sapply_b " + "FROM ic_sapply_b "
+ "WHERE NVL(dr,0) = 0 AND csourcebillbid = '[csourcebillbid]'"; + "WHERE NVL(dr,0) = 0 AND csourcebillbid = '[csourcebillbid]'";
getApplyNumSql = getApplyNumSql.replace("[csourcebillbid]", csourcebillbid); getApplyNumSql = getApplyNumSql.replace("[csourcebillbid]", csourcebillbid);
// 修改的时候加上子表主键 // 修改的时候加上子表主键
if (null != outVOs[0] && null != outVOs[0].getHead() && null != outVOs[0].getHead().getCgeneralhid()) { if (null != outVOs[0] && null != outVOs[0].getHead() && null != outVOs[0].getHead().getCgeneralhid()) {
getApplyNumSql += " AND cgeneralbid != '" + bodyVO.getPrimaryKey() + "'"; getApplyNumSql += " AND cgeneralbid != '" + bodyVO.getPrimaryKey() + "'";
} }
@ -90,12 +90,12 @@ public class N_4455_WRITE extends AbstractCompiler2 {
new ColumnProcessor("nassistnum")); new ColumnProcessor("nassistnum"));
UFDouble applyNum = new UFDouble(String.valueOf(nassistnum)); UFDouble applyNum = new UFDouble(String.valueOf(nassistnum));
NCCForUAPLogger.debug(String.format( NCCForUAPLogger.debug(String.format(
"出库申请保存: 来源单据表体主键 = [%S], 计划出库数量 = [%S], 已申请数量 = [%S], 本次申请数量 = [%S],", "出库申请保存: 来源单据表体主键 = [%S], 计划出库数量 = [%S], 已申请数量 = [%S], 本次申请数量 = [%S],",
csourcebillbid, plantNum, applyNum, bodyVO.getNassistnum() csourcebillbid, plantNum, applyNum, bodyVO.getNassistnum()
)); ));
UFDouble applyNum1 = applyNum.add(bodyVO.getNassistnum()); UFDouble applyNum1 = applyNum.add(bodyVO.getNassistnum());
if (MathTool.compareTo(plantNum, applyNum1) < 0) { if (MathTool.compareTo(plantNum, applyNum1) < 0) {
nccloud.framework.core.exception.ExceptionUtils.wrapBusinessException("申请数量已超出计划数量,请检查!"); nccloud.framework.core.exception.ExceptionUtils.wrapBusinessException("申请数量已超出计划数量,请检查!");
} }
} }
} }

View File

@ -35,7 +35,7 @@ import nc.vo.pub.lang.UFBoolean;
import nccloud.commons.lang.StringUtils; import nccloud.commons.lang.StringUtils;
/** /**
* 物料基本信息外部交互平台导入 * 物料基本信息外部交互平台导入
* *
* @author jiangjuna * @author jiangjuna
* @since NC6.0 * @since NC6.0
@ -51,7 +51,7 @@ public class MaterialPfxxPlugin extends nc.bs.pfxx.plugin.AbstractPfxxPlugin {
String pk = null; String pk = null;
try { try {
MaterialVO materialVO = (MaterialVO) vo; MaterialVO materialVO = (MaterialVO) vo;
// by_zhangzhyz_20220113//项目专项需求 根据物料编码和组织进行查询不通过ID对照表 // by_zhangzhyz_20220113//项目专项需求 根据物料编码和组织进行查询不通过ID对照表
String whereSql = MaterialVO.CODE + " = '" + materialVO.getCode() + "'"; String whereSql = MaterialVO.CODE + " = '" + materialVO.getCode() + "'";
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
Collection<MaterialVO> cols = new BaseDAO().retrieveByClause(MaterialVO.class, whereSql); Collection<MaterialVO> cols = new BaseDAO().retrieveByClause(MaterialVO.class, whereSql);
@ -67,9 +67,9 @@ public class MaterialPfxxPlugin extends nc.bs.pfxx.plugin.AbstractPfxxPlugin {
this.getService().updateMaterial(this.getUpdateVO(materialVO, pk)); this.getService().updateMaterial(this.getUpdateVO(materialVO, pk));
String sender = swapContext.getSender(); String sender = swapContext.getSender();
if("pdm".equalsIgnoreCase(sender)) { if("pdm".equalsIgnoreCase(sender)) {
// 物料更新后更新计划信息 // 物料更新后更新计划信息
updatePlanVOsAfterMaterialUpdate(materialVO); updatePlanVOsAfterMaterialUpdate(materialVO);
// 物料更新后更新库存信息 // 物料更新后更新库存信息
updateStockVOsAfterMaterialUpdate(materialVO); updateStockVOsAfterMaterialUpdate(materialVO);
} }
} }
@ -81,7 +81,7 @@ public class MaterialPfxxPlugin extends nc.bs.pfxx.plugin.AbstractPfxxPlugin {
} }
/** /**
* 物料更新后更新计划信息 * 物料更新后更新计划信息
* *
* @param materialVO * @param materialVO
* @throws BusinessException * @throws BusinessException
@ -92,11 +92,11 @@ public class MaterialPfxxPlugin extends nc.bs.pfxx.plugin.AbstractPfxxPlugin {
String pk_org = materialVO.getPk_org(); String pk_org = materialVO.getPk_org();
String pk_material = materialVO.getPk_material(); String pk_material = materialVO.getPk_material();
IMaterialPlanQueryService queryService = NCLocator.getInstance().lookup(IMaterialPlanQueryService.class); IMaterialPlanQueryService queryService = NCLocator.getInstance().lookup(IMaterialPlanQueryService.class);
// 查询物料计划信息 // 查询物料计划信息
MaterialPlanVO[] pvos = queryService.queryMaterialPlanVOs(new String[] { pk_org }, pk_material); MaterialPlanVO[] pvos = queryService.queryMaterialPlanVOs(new String[] { pk_org }, pk_material);
IMaterialPlanService planService = NCLocator.getInstance().lookup(IMaterialPlanService.class); IMaterialPlanService planService = NCLocator.getInstance().lookup(IMaterialPlanService.class);
for (MaterialPlanVO planVO : pvos) { for (MaterialPlanVO planVO : pvos) {
// PLM计划虚项映射到计划信息 // PLM计划虚项映射到计划信息
if (materialVO.getDef19() != null && UFBoolean.TRUE.toString().equals(materialVO.getDef19())) if (materialVO.getDef19() != null && UFBoolean.TRUE.toString().equals(materialVO.getDef19()))
planVO.setIsvirtual(UFBoolean.TRUE); planVO.setIsvirtual(UFBoolean.TRUE);
else else
@ -107,7 +107,7 @@ public class MaterialPfxxPlugin extends nc.bs.pfxx.plugin.AbstractPfxxPlugin {
} }
/** /**
* 物料更新后更新库存信息 * 物料更新后更新库存信息
* *
* @param materialVO * @param materialVO
* @throws BusinessException * @throws BusinessException
@ -120,7 +120,7 @@ public class MaterialPfxxPlugin extends nc.bs.pfxx.plugin.AbstractPfxxPlugin {
IMaterialStockService stockService = NCLocator.getInstance().lookup(IMaterialStockService.class); IMaterialStockService stockService = NCLocator.getInstance().lookup(IMaterialStockService.class);
for (MaterialStockVO stockVO : svos) { for (MaterialStockVO stockVO : svos) {
if (stockVO.getMartype() != null) { if (stockVO.getMartype() != null) {
// PLM物料类型映射到库存信息 // PLM物料类型映射到库存信息
switch (materialVO.getDef18()) { switch (materialVO.getDef18()) {
case IMaterialEnumConst.MATERTYPE_DR: case IMaterialEnumConst.MATERTYPE_DR:
stockVO.setMartype(IMaterialEnumConst.MATERTYPE_DR); stockVO.setMartype(IMaterialEnumConst.MATERTYPE_DR);
@ -141,7 +141,7 @@ public class MaterialPfxxPlugin extends nc.bs.pfxx.plugin.AbstractPfxxPlugin {
stockVO.setMartype(IMaterialEnumConst.MATERTYPE_ET); stockVO.setMartype(IMaterialEnumConst.MATERTYPE_ET);
break; break;
default: default:
// 物料类型默认为MR // 物料类型默认为MR
stockVO.setMartype(IMaterialEnumConst.MATERTYPE_MR); stockVO.setMartype(IMaterialEnumConst.MATERTYPE_MR);
break; break;
} }
@ -216,7 +216,7 @@ public class MaterialPfxxPlugin extends nc.bs.pfxx.plugin.AbstractPfxxPlugin {
new String[] { MaterialVO.CREATOR, MaterialVO.CREATIONTIME, MaterialVO.PK_SOURCE, MaterialVO.VERSION, MaterialVO.LATEST, MaterialVO.ENABLESTATE }); new String[] { MaterialVO.CREATOR, MaterialVO.CREATIONTIME, MaterialVO.PK_SOURCE, MaterialVO.VERSION, MaterialVO.LATEST, MaterialVO.ENABLESTATE });
if (oldVO == null) { if (oldVO == null) {
throw new BusinessException(nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("bdpub", "0bdpub0057") throw new BusinessException(nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("bdpub", "0bdpub0057")
/* @res "该数据已被删除" */); /* @res "该数据已被删除" */);
} }
materialVO.setPrimaryKey(pk); materialVO.setPrimaryKey(pk);
materialVO.setCreator(oldVO.getCreator()); materialVO.setCreator(oldVO.getCreator());
@ -251,7 +251,7 @@ public class MaterialPfxxPlugin extends nc.bs.pfxx.plugin.AbstractPfxxPlugin {
if (vos != null && vos.length > 0) { if (vos != null && vos.length > 0) {
String message = nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("10140mag", "010140mag0200", null, String message = nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("10140mag", "010140mag0200", null,
new String[] { Integer.toString(value.getTotalNum()), Integer.toString(value.getErrLogResult().getErrorMessagegNum()) }) new String[] { Integer.toString(value.getTotalNum()), Integer.toString(value.getErrLogResult().getErrorMessagegNum()) })
/* @res "外部交换平台导入物料新版本数据时,分配操作部分成功,共处理了{0}条记录,其中有{1}条处理失败:" */+ "\n"; /* @res "外部交换平台导入物料新版本数据时,分配操作部分成功,共处理了{0}条记录,其中有{1}条处理失败:" */+ "\n";
for (int i = 0; i < vos.length; i++) { for (int i = 0; i < vos.length; i++) {
message += vos[i].getErrormsg() + "\n"; message += vos[i].getErrormsg() + "\n";
} }

View File

@ -37,7 +37,7 @@ import nccloud.ws.rest.resource.AbstractNCCRestResource;
import org.json.JSONString; import org.json.JSONString;
/** /**
* 物料接口适配2312 * 物料接口适配2312
*/ */
@Path("uapbd/material/material") @Path("uapbd/material/material")
@ -64,7 +64,7 @@ public class MaterialManageMaterial extends AbstractNCCRestResource {
public JSONString queryMaterialIsExist(JSONString json) { public JSONString queryMaterialIsExist(JSONString json) {
boolean bool = false;// false 不存在 true 存在 boolean bool = false;// false 不存在 true 存在
JSONObject jObject = JSONObject.parseObject(json.toJSONString()); JSONObject jObject = JSONObject.parseObject(json.toJSONString());
if (jObject == null) { if (jObject == null) {
@ -72,11 +72,11 @@ public class MaterialManageMaterial extends AbstractNCCRestResource {
} }
if (StringUtils.isEmpty(jObject.getString("code"))) { if (StringUtils.isEmpty(jObject.getString("code"))) {
return ResultMessageUtil.exceptionToJSON("code 不能为空", APIErrCodeEnum.UNKNOWEXCCODE.getCode()); return ResultMessageUtil.exceptionToJSON("code 不能为空", APIErrCodeEnum.UNKNOWEXCCODE.getCode());
} }
String code = jObject.getString("code"); String code = jObject.getString("code");
String version = jObject.getString("version"); String version = jObject.getString("version");
String pk_org = jObject.getString("pk_org");// 所属组织编码 String pk_org = jObject.getString("pk_org");// 所属组织编码
String sql = "select bd_material.code,bd_material.version,org_orgs.code From bd_material , org_orgs where bd_material.pk_org=org_orgs.pk_org and bd_material.code='" String sql = "select bd_material.code,bd_material.version,org_orgs.code From bd_material , org_orgs where bd_material.pk_org=org_orgs.pk_org and bd_material.code='"
+ code + "'"; + code + "'";
@ -97,7 +97,7 @@ public class MaterialManageMaterial extends AbstractNCCRestResource {
return ResultMessageUtil.toJSONUnTranslate(bool); return ResultMessageUtil.toJSONUnTranslate(bool);
} else { } else {
bool = false; bool = false;
return ResultMessageUtil.toJSONUnTranslate(bool, "没有符合条件的数据"); return ResultMessageUtil.toJSONUnTranslate(bool, "没有符合条件的数据");
} }
} catch (DAOException e) { } catch (DAOException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
@ -213,10 +213,10 @@ public class MaterialManageMaterial extends AbstractNCCRestResource {
Map<String, Object> param = new HashMap<String, Object>(); Map<String, Object> param = new HashMap<String, Object>();
if (StringUtils.isBlank(pk_org) && StringUtils.isBlank(code) && StringUtils.isBlank(version)) { if (StringUtils.isBlank(pk_org) && StringUtils.isBlank(code) && StringUtils.isBlank(version)) {
return ResultMessageUtil.exceptionToJSON(new Exception("所属组织、物料编码、版本号,不能同时为空")); return ResultMessageUtil.exceptionToJSON(new Exception("所属组织、物料编码、版本号,不能同时为空"));
} }
if (assignorgs == null || (assignorgs != null && assignorgs.size() <= 0)) { if (assignorgs == null || (assignorgs != null && assignorgs.size() <= 0)) {
return ResultMessageUtil.exceptionToJSON(new Exception("分配组织不能为空")); return ResultMessageUtil.exceptionToJSON(new Exception("分配组织不能为空"));
} }
if (StringUtils.isNotBlank(pk_org)) { if (StringUtils.isNotBlank(pk_org)) {
param.put("pk_org", pk_org); param.put("pk_org", pk_org);
@ -237,7 +237,7 @@ public class MaterialManageMaterial extends AbstractNCCRestResource {
MaterialVO[] vos = (MaterialVO[]) (new BaseDAO()).retrieveByClause(MaterialVO.class, condition) MaterialVO[] vos = (MaterialVO[]) (new BaseDAO()).retrieveByClause(MaterialVO.class, condition)
.toArray(new MaterialVO[0]); .toArray(new MaterialVO[0]);
if (vos == null || (vos != null && vos.length <= 0)) { if (vos == null || (vos != null && vos.length <= 0)) {
return ResultMessageUtil.exceptionToJSON(new Exception("未查询到物料信息")); return ResultMessageUtil.exceptionToJSON(new Exception("未查询到物料信息"));
} }
IMaterialAssignService IMaterialAssignService = (IMaterialAssignService) NCLocator.getInstance() IMaterialAssignService IMaterialAssignService = (IMaterialAssignService) NCLocator.getInstance()
.lookup(IMaterialAssignService.class); .lookup(IMaterialAssignService.class);
@ -253,7 +253,7 @@ public class MaterialManageMaterial extends AbstractNCCRestResource {
(String[]) pk_orgs.toArray(new String[0]), null); (String[]) pk_orgs.toArray(new String[0]), null);
} }
} }
return ResultMessageUtil.toJSON(null, "分配成功!"); return ResultMessageUtil.toJSON(null, "分配成功!");
} catch (Exception e) { } catch (Exception e) {
return ResultMessageUtil.exceptionToJSON(e); return ResultMessageUtil.exceptionToJSON(e);
} }
@ -292,11 +292,11 @@ public class MaterialManageMaterial extends AbstractNCCRestResource {
} }
if (StringUtils.isBlank(pk_org) && StringUtils.isBlank(code)) { if (StringUtils.isBlank(pk_org) && StringUtils.isBlank(code)) {
return ResultMessageUtil.exceptionToJSON(new Exception("所属组织和编码 pk_org、code不能同时为空")); return ResultMessageUtil.exceptionToJSON(new Exception("所属组织和编码 pk_org、code不能同时为空"));
} }
if (saleorgs == null || saleorgs.size() == 0) { if (saleorgs == null || saleorgs.size() == 0) {
return ResultMessageUtil.exceptionToJSON(new NullPointerException("saleorgs:" + saleorgs + ",不能为空")); return ResultMessageUtil.exceptionToJSON(new NullPointerException("saleorgs:" + saleorgs + ",不能为空"));
} }
try { try {
ApiResourceParamUtils ApiResourceParamUtils = new ApiResourceParamUtils(); ApiResourceParamUtils ApiResourceParamUtils = new ApiResourceParamUtils();
@ -373,10 +373,10 @@ public class MaterialManageMaterial extends AbstractNCCRestResource {
param.put("version", version); param.put("version", version);
} }
if (StringUtils.isBlank(pk_org) && StringUtils.isBlank(code)) { if (StringUtils.isBlank(pk_org) && StringUtils.isBlank(code)) {
return ResultMessageUtil.exceptionToJSON(new Exception("所属组织和编码 pk_org、code不能同时为空")); return ResultMessageUtil.exceptionToJSON(new Exception("所属组织和编码 pk_org、code不能同时为空"));
} }
if (prodorgs == null || prodorgs.size() == 0) { if (prodorgs == null || prodorgs.size() == 0) {
return ResultMessageUtil.exceptionToJSON(new Exception("prodorgs:" + prodorgs + ",不能为空")); return ResultMessageUtil.exceptionToJSON(new Exception("prodorgs:" + prodorgs + ",不能为空"));
} }
try { try {
ApiResourceParamUtils ApiResourceParamUtils = new ApiResourceParamUtils(); ApiResourceParamUtils ApiResourceParamUtils = new ApiResourceParamUtils();
@ -453,11 +453,11 @@ public class MaterialManageMaterial extends AbstractNCCRestResource {
} }
if (StringUtils.isBlank(pk_org) && StringUtils.isBlank(code)) { if (StringUtils.isBlank(pk_org) && StringUtils.isBlank(code)) {
return ResultMessageUtil.exceptionToJSON(new Exception("所属组织和编码 pk_org、code不能同时为空")); return ResultMessageUtil.exceptionToJSON(new Exception("所属组织和编码 pk_org、code不能同时为空"));
} }
if (stockorgs == null || stockorgs.size() == 0) { if (stockorgs == null || stockorgs.size() == 0) {
return ResultMessageUtil.exceptionToJSON(new Exception("stockorgs:" + stockorgs + ",不能为空")); return ResultMessageUtil.exceptionToJSON(new Exception("stockorgs:" + stockorgs + ",不能为空"));
} }
try { try {
ApiResourceParamUtils ApiResourceParamUtils = new ApiResourceParamUtils(); ApiResourceParamUtils ApiResourceParamUtils = new ApiResourceParamUtils();
@ -533,7 +533,7 @@ public class MaterialManageMaterial extends AbstractNCCRestResource {
} catch (Exception e) { } catch (Exception e) {
return ResultMessageUtil.exceptionToJSON(e); return ResultMessageUtil.exceptionToJSON(e);
} }
return ResultMessageUtil.exceptionToJSON(new Exception("未知异常")); return ResultMessageUtil.exceptionToJSON(new Exception("未知异常"));
} }
public String getModule() { public String getModule() {

View File

@ -14,9 +14,9 @@ import nc.vo.bd.supplier.SupplierVO;
import nc.vo.pub.BusinessException; import nc.vo.pub.BusinessException;
/** /**
* 适配2005代码 * 适配2005代码
* zhangxinah * zhangxinah
* 供应商变更名称后供应商银行户名同时变更 * 供应商变更名称后供应商银行户名同时变更
*/ */
public class updateAfterCheck implements IBusinessListener { public class updateAfterCheck implements IBusinessListener {
@ -28,41 +28,41 @@ public class updateAfterCheck implements IBusinessListener {
String eventType = event.getEventType(); String eventType = event.getEventType();
Map<String, Object> map = this.getBills(event); Map<String, Object> map = this.getBills(event);
Object reObj = map.get("obj"); Object reObj = map.get("obj");
if (reObj instanceof Object[]) { // 检查 object 是否是 Object[] 类型 if (reObj instanceof Object[]) { // 检查 object 是否是 Object[] 类型
Object[] objectArray = (Object[]) reObj; // Object 强制转换为 Object[] 类型 Object[] objectArray = (Object[]) reObj; // Object 强制转换为 Object[] 类型
for (Object item : objectArray) { for (Object item : objectArray) {
SupplierVO itemVo = (SupplierVO) item; SupplierVO itemVo = (SupplierVO) item;
String pk_supplierStr = itemVo.getPk_supplier(); String pk_supplierStr = itemVo.getPk_supplier();
String nameStr = itemVo.getName(); String nameStr = itemVo.getName();
List<Map<String, Object>> pk_bankaccsubList = getSaleorderPK(pk_supplierStr); List<Map<String, Object>> pk_bankaccsubList = getSaleorderPK(pk_supplierStr);
StringBuilder vsrcbidStr = new StringBuilder();//客商银行账户子户PK StringBuilder vsrcbidStr = new StringBuilder();//客商银行账户子户PK
StringBuilder bankaccbasStr = new StringBuilder();//客商银行账户PK StringBuilder bankaccbasStr = new StringBuilder();//客商银行账户PK
for (int i = 0; i < pk_bankaccsubList.size(); i++) { for (int i = 0; i < pk_bankaccsubList.size(); i++) {
Map itemvo = pk_bankaccsubList.get(i); Map itemvo = pk_bankaccsubList.get(i);
if (i > 0) { if (i > 0) {
vsrcbidStr.append(","); // 在每个元素前加逗号避免首个元素前有逗号 vsrcbidStr.append(","); // 在每个元素前加逗号避免首个元素前有逗号
bankaccbasStr.append(","); bankaccbasStr.append(",");
} }
vsrcbidStr.append("'").append(itemvo.get("pk_bankaccsub")).append("'"); // 每个值加上单引号 vsrcbidStr.append("'").append(itemvo.get("pk_bankaccsub")).append("'"); // 每个值加上单引号
bankaccbasStr.append("'").append(itemvo.get("pk_bankaccbas")).append("'"); // 每个值加上单引号 bankaccbasStr.append("'").append(itemvo.get("pk_bankaccbas")).append("'"); // 每个值加上单引号
} }
if (!vsrcbidStr.toString().equals("")) { if (!vsrcbidStr.toString().equals("")) {
String updateSql = String updateSql =
"update bd_bankaccsub set accname='" + nameStr + "' where pk_bankaccsub in (" "update bd_bankaccsub set accname='" + nameStr + "' where pk_bankaccsub in ("
+ vsrcbidStr + ")";//客商银行账户子户 + vsrcbidStr + ")";//客商银行账户子户
updateSaleBSQty(updateSql.toString()); updateSaleBSQty(updateSql.toString());
} }
if (!bankaccbasStr.toString().equals("")) { if (!bankaccbasStr.toString().equals("")) {
String updateSql2 = String updateSql2 =
"update bd_bankaccbas set accname='" + nameStr + "' where pk_bankaccbas in (" "update bd_bankaccbas set accname='" + nameStr + "' where pk_bankaccbas in ("
+ bankaccbasStr + ")";//客商银行账户 + bankaccbasStr + ")";//客商银行账户
updateSaleBSQty(updateSql2); updateSaleBSQty(updateSql2);
} }
} }
} }
} }
} catch (Exception e) { } catch (Exception e) {
throw new BusinessException("根据供应商更新供应商银行账号户名失败" + e); throw new BusinessException("根据供应商更新供应商银行账号户名失败" + e);
} }
} }
@ -86,18 +86,18 @@ public class updateAfterCheck implements IBusinessListener {
Object object = null; Object object = null;
Object old = null; Object old = null;
Map<String, Object> retMap = new HashMap<>(); Map<String, Object> retMap = new HashMap<>();
//类型判断和赋值 //类型判断和赋值
if (event instanceof BDCommonEvent) { if (event instanceof BDCommonEvent) {
BDCommonEvent e = (BDCommonEvent) event; BDCommonEvent e = (BDCommonEvent) event;
object = e.getNewObjs(); object = e.getNewObjs();
old = e.getOldObjs(); old = e.getOldObjs();
} else { } else {
throw new BusinessException("未找到单据类型"); throw new BusinessException("未找到单据类型");
} }
// object old 转换为 SupplierVO[] 并添加到 retMap // object old 转换为 SupplierVO[] 并添加到 retMap
retMap.put("new", object); retMap.put("new", object);
retMap.put("old", old); retMap.put("old", old);
// 根据 new old 来设置 "obj" // 根据 new old 来设置 "obj"
retMap.put("obj", retMap.get("new") != null ? retMap.get("new") : retMap.get("old")); retMap.put("obj", retMap.get("new") != null ? retMap.get("new") : retMap.get("old"));
return retMap; return retMap;
} }