优化收款单

This commit is contained in:
季圣华
2021-06-29 01:07:03 +08:00
parent 72ac4ce1a8
commit 225eb16bba
11 changed files with 144 additions and 14 deletions

View File

@@ -12,6 +12,7 @@ import com.jsh.erp.datasource.mappers.AccountItemMapperEx;
import com.jsh.erp.datasource.vo.AccountItemVo4List;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.exception.JshException;
import com.jsh.erp.service.depotHead.DepotHeadService;
import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.StringUtil;
@@ -34,13 +35,14 @@ public class AccountItemService {
@Resource
private AccountItemMapper accountItemMapper;
@Resource
private AccountItemMapperEx accountItemMapperEx;
@Resource
private LogService logService;
@Resource
private UserService userService;
@Resource
private DepotHeadService depotHeadService;
public AccountItem getAccountItem(long id)throws Exception {
AccountItem result=null;
@@ -199,6 +201,10 @@ public class AccountItemService {
if (tempInsertedJson.get("inOutItemId") != null && !tempInsertedJson.get("inOutItemId").equals("")) {
accountItem.setInOutItemId(tempInsertedJson.getLong("inOutItemId"));
}
if (tempInsertedJson.get("billNumber") != null && !tempInsertedJson.get("billNumber").equals("")) {
String billNo = tempInsertedJson.getString("billNumber");
accountItem.setBillId(depotHeadService.getDepotHead(billNo).getId());
}
if (tempInsertedJson.get("eachAmount") != null && !tempInsertedJson.get("eachAmount").equals("")) {
BigDecimal eachAmount = tempInsertedJson.getBigDecimal("eachAmount");
if (type.equals("付款")) {

View File

@@ -670,4 +670,19 @@ public class DepotHeadService {
public BigDecimal getBuyAndSaleRetailStatistics(String type, String subType, Integer hasSupplier, String beginTime, String endTime) {
return depotHeadMapperEx.getBuyAndSaleRetailStatistics(type, subType, hasSupplier, beginTime, endTime);
}
public DepotHead getDepotHead(String number)throws Exception {
DepotHead depotHead = new DepotHead();
try{
DepotHeadExample example = new DepotHeadExample();
example.createCriteria().andNumberEqualTo(number).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<DepotHead> list = depotHeadMapper.selectByExample(example);
if(null!=list && list.size()>0) {
depotHead = list.get(0);
}
}catch(Exception e){
JshException.readFail(logger, e);
}
return depotHead;
}
}