|
@@ -80,7 +80,10 @@ public class SupplierService extends BaseService<Supplier> {
|
|
|
// 转账明细
|
|
// 转账明细
|
|
|
List<OtherPayableResponse> itemList = otherPayableMapper.selectByCond(new OtherPayableQuery().setObjectId(list.get(i).getSupId()).setBusinessType(0));
|
|
List<OtherPayableResponse> itemList = otherPayableMapper.selectByCond(new OtherPayableQuery().setObjectId(list.get(i).getSupId()).setBusinessType(0));
|
|
|
if(itemList.size()>0){
|
|
if(itemList.size()>0){
|
|
|
- list.get(i).setSumAmtPayable(itemList.get(0).getSumAmtPayable());
|
|
|
|
|
|
|
+ BigDecimal sumAmtPayableValue = (itemList != null && !itemList.isEmpty() && itemList.get(0).getSumAmtPayable() != null) ?
|
|
|
|
|
+ itemList.get(0).getSumAmtPayable() :
|
|
|
|
|
+ BigDecimal.ZERO;
|
|
|
|
|
+ list.get(i).setSumAmtPayable(sumAmtPayableValue);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -156,10 +159,9 @@ public class SupplierService extends BaseService<Supplier> {
|
|
|
public ResponseResultVO<?> update(SupplierVo supplierVo) {
|
|
public ResponseResultVO<?> update(SupplierVo supplierVo) {
|
|
|
// 转化实体
|
|
// 转化实体
|
|
|
Supplier supplier = supplierConvert.convertToPo(supplierVo);
|
|
Supplier supplier = supplierConvert.convertToPo(supplierVo);
|
|
|
- try {
|
|
|
|
|
- super.updateByUuid(supplier);// 先更新的供应商表
|
|
|
|
|
|
|
+ super.updateByUuid(supplier);// 先更新的供应商表
|
|
|
if ((supplier.getBrandIds() != null) && (supplier.getBrandIds().size()>0)) { //如果有 商品品牌 一起插入品牌
|
|
if ((supplier.getBrandIds() != null) && (supplier.getBrandIds().size()>0)) { //如果有 商品品牌 一起插入品牌
|
|
|
- supplierMapper.batchDeleteBrand(supplier.getBrandIds());//批量删除供应商对应的供应商品牌
|
|
|
|
|
|
|
+ supplierMapper.batchDeleteBrand(supplier.getSupId());//批量删除供应商对应的供应商品牌
|
|
|
List<Supplier> Supplierlst = new ArrayList<>();
|
|
List<Supplier> Supplierlst = new ArrayList<>();
|
|
|
List<String> BrandIdList = new ArrayList<>();
|
|
List<String> BrandIdList = new ArrayList<>();
|
|
|
BrandIdList = supplier.getBrandIds();
|
|
BrandIdList = supplier.getBrandIds();
|
|
@@ -173,10 +175,6 @@ public class SupplierService extends BaseService<Supplier> {
|
|
|
supplierMapper.insertSupplierBrandtBatch(Supplierlst); // 向供应商品牌表插入数据
|
|
supplierMapper.insertSupplierBrandtBatch(Supplierlst); // 向供应商品牌表插入数据
|
|
|
}
|
|
}
|
|
|
return ResponseResultUtil.success();
|
|
return ResponseResultUtil.success();
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); // 手动回滚事务
|
|
|
|
|
|
|
|
|
|
- return ResponseResultUtil.error("更新失败");
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|