Commit 93001714 authored by 罗林杰's avatar 罗林杰

完善退单

parent 46909baf
...@@ -60,5 +60,7 @@ public class AddStoreGoodsApplyDTO { ...@@ -60,5 +60,7 @@ public class AddStoreGoodsApplyDTO {
* @default * @default
*/ */
private BigDecimal salesCategories; private BigDecimal salesCategories;
private Integer customerId;
} }
...@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.rcisoft.bean.AdminProperties; import org.rcisoft.bean.AdminProperties;
import org.rcisoft.bus.custinfo.entity.CustInfo;
import org.rcisoft.bus.custinfo.service.CustInfoService;
import org.rcisoft.bus.custrecharge.entity.CustRecharge; import org.rcisoft.bus.custrecharge.entity.CustRecharge;
import org.rcisoft.bus.storegoodsapply.dao.StoreGoodsApplyRepository; import org.rcisoft.bus.storegoodsapply.dao.StoreGoodsApplyRepository;
import org.rcisoft.bus.storegoodsapply.dto.AddStoreGoodsApplyDTO; import org.rcisoft.bus.storegoodsapply.dto.AddStoreGoodsApplyDTO;
...@@ -54,6 +56,8 @@ public class StoreGoodsApplyServiceImpl extends ServiceImpl<StoreGoodsApplyRepos ...@@ -54,6 +56,8 @@ public class StoreGoodsApplyServiceImpl extends ServiceImpl<StoreGoodsApplyRepos
@Autowired @Autowired
private StoreGoodsStockRepository storeGoodsStockRepository; private StoreGoodsStockRepository storeGoodsStockRepository;
@Autowired
private CustInfoService custInfoServiceImpl;
@Autowired @Autowired
protected AdminProperties adminProperties; protected AdminProperties adminProperties;
...@@ -125,6 +129,7 @@ public class StoreGoodsApplyServiceImpl extends ServiceImpl<StoreGoodsApplyRepos ...@@ -125,6 +129,7 @@ public class StoreGoodsApplyServiceImpl extends ServiceImpl<StoreGoodsApplyRepos
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT) @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT)
@Override @Override
public CyPersistModel batchOutPersist(AddStoreGoodsApplyDTO addwmsGoodsApply) { public CyPersistModel batchOutPersist(AddStoreGoodsApplyDTO addwmsGoodsApply) {
//判断余额
// 1. 参数校验 // 1. 参数校验
// 2. 插入 出库申请 // 2. 插入 出库申请
// 3. 循环 // 3. 循环
...@@ -132,6 +137,11 @@ public class StoreGoodsApplyServiceImpl extends ServiceImpl<StoreGoodsApplyRepos ...@@ -132,6 +137,11 @@ public class StoreGoodsApplyServiceImpl extends ServiceImpl<StoreGoodsApplyRepos
// 3.2 库存满足 => 减库存,日志 // 3.2 库存满足 => 减库存,日志
// 4. 批量插入日志 // 4. 批量插入日志
// 1. 集合空 判断 // 1. 集合空 判断
CustInfo custInfo = custInfoServiceImpl.findById(addwmsGoodsApply.getCustomerId());
if (custInfo.getCustomerBalance().compareTo(addwmsGoodsApply.getTotalOutPrice()) < 0) {
throw new CyServiceException(1001, "余额不足!");
}
if (CollectionUtil.isEmpty(addwmsGoodsApply.getBoxList())) { if (CollectionUtil.isEmpty(addwmsGoodsApply.getBoxList())) {
throw new CyServiceException(1001, "入库商品为空!"); throw new CyServiceException(1001, "入库商品为空!");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment