|
@@ -156,12 +156,12 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
|
|
|
|
|
|
@Override
|
|
|
public AjaxResult selectTWarehouseAgreementByCorpsId(Long fCorpId) {
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
- List<Map<String,Object>> list = tWarehouseAgreementMapper.selectTWarehouseAgreementByCorpsId(fCorpId);
|
|
|
- for (Map<String,Object> mp : list) {
|
|
|
- mp.put("tPackages",StringUtils.stringArrayDQMToInt((String) mp.get("tPackages")));
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ List<Map<String, Object>> list = tWarehouseAgreementMapper.selectTWarehouseAgreementByCorpsId(fCorpId);
|
|
|
+ for (Map<String, Object> mp : list) {
|
|
|
+ mp.put("tPackages", StringUtils.stringArrayDQMToInt((String) mp.get("tPackages")));
|
|
|
}
|
|
|
- map.put("contractnoList",list);
|
|
|
+ map.put("contractnoList", list);
|
|
|
return AjaxResult.success(map);
|
|
|
}
|
|
|
|
|
@@ -189,7 +189,7 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
|
|
|
// 遍历查询结果
|
|
|
for (TWarehouseAgreement tg : list) {
|
|
|
// 筛选 packages
|
|
|
- if (tg.gettPackages()!=null) {
|
|
|
+ if (tg.gettPackages() != null) {
|
|
|
// 根据货物类别数组字串获取货物数据
|
|
|
List<TGoods> tGoods = tWarehouseAgreementMapper.selectTGoodsTypeByTypeId(StringUtils.stringArrayDQMToInt(tg.gettPackages()));
|
|
|
StringBuilder strGoods = new StringBuilder();
|
|
@@ -217,7 +217,7 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
|
|
|
/**
|
|
|
* 新增
|
|
|
*
|
|
|
- * @param agreement 仓储费对象
|
|
|
+ * @param agreement 仓储费对象
|
|
|
* @param agreementitems 仓储费明细表对象
|
|
|
* @param loginUser
|
|
|
* @return
|
|
@@ -336,22 +336,24 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
|
|
|
annexMapper.deleteByPid(fPid, type);
|
|
|
}
|
|
|
SysConfig sysConfigStatus = sysConfigMapper.checkConfigKeyUnique("agreement");
|
|
|
- if (sysConfigStatus != null && "1".equals(sysConfigStatus.getConfigValue())){
|
|
|
+ if (sysConfigStatus != null && "1".equals(sysConfigStatus.getConfigValue())) {
|
|
|
TEnclosure tEnclosure = new TEnclosure();
|
|
|
tEnclosure.setfPid(tWarehouseAgreement.getfCorpid());
|
|
|
tEnclosure.setfType("合同");
|
|
|
List<TEnclosure> tEnclosureList = tEnclosureMapper.selectTEnclosureList(tEnclosure);
|
|
|
- if (tEnclosureList.isEmpty()){
|
|
|
+ if (tEnclosureList.isEmpty()) {
|
|
|
throw new RuntimeException("客户缺少合同信息,请补充后再请核");
|
|
|
}
|
|
|
- String[] arr = tWarehouseAgreement.getfWarehouseid().split(",");
|
|
|
- for (String item :arr){
|
|
|
- TEnclosure tEnclosure1 = new TEnclosure();
|
|
|
- tEnclosure1.setfPid(Long.parseLong(item));
|
|
|
- tEnclosure1.setfType("协议");
|
|
|
- List<TEnclosure> tEnclosureList1 = tEnclosureMapper.selectTEnclosureList(tEnclosure1);
|
|
|
- if (tEnclosureList1.isEmpty()){
|
|
|
- throw new RuntimeException("仓库缺少协议信息,请补充后再请核");
|
|
|
+ if (StringUtils.isNotNull(tWarehouseAgreement.getfWarehouseid()) && !"[]".equals(tWarehouseAgreement.getfWarehouseid())) {
|
|
|
+ JSONArray jsonDrArray = JSONArray.parseArray(tWarehouseAgreement.getfWarehouseid());
|
|
|
+ for (Object item : jsonDrArray) {
|
|
|
+ TEnclosure tEnclosure1 = new TEnclosure();
|
|
|
+ tEnclosure1.setfPid(Long.parseLong(item.toString()));
|
|
|
+ tEnclosure1.setfType("协议");
|
|
|
+ List<TEnclosure> tEnclosureList1 = tEnclosureMapper.selectTEnclosureList(tEnclosure1);
|
|
|
+ if (tEnclosureList1.isEmpty()) {
|
|
|
+ throw new RuntimeException("仓库缺少协议信息,请补充后再请核");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|