解决分批出入库状态切换的bug

This commit is contained in:
神话
2022-05-07 18:23:43 +08:00
parent cf55cba2c8
commit dc6cc14df5
5 changed files with 165 additions and 22 deletions

View File

@@ -311,8 +311,14 @@ public class DepotHeadService {
BusinessConstants.SUB_TYPE_SALES.equals(depotHead.getSubType()))
|| (BusinessConstants.DEPOTHEAD_TYPE_OTHER.equals(depotHead.getType()) &&
BusinessConstants.SUB_TYPE_REPLAY.equals(depotHead.getSubType()))) {
String status = BusinessConstants.BILLS_STATUS_AUDIT;
//查询除当前单据之外的关联单据列表
List<DepotHead> exceptCurrentList = getListByLinkNumberExceptCurrent(depotHead.getLinkNumber(), depotHead.getNumber());
if(exceptCurrentList!=null && exceptCurrentList.size()>0) {
status = BusinessConstants.BILLS_STATUS_SKIPING;
}
DepotHead dh = new DepotHead();
dh.setStatus(BusinessConstants.BILLS_STATUS_AUDIT);
dh.setStatus(status);
DepotHeadExample example = new DepotHeadExample();
example.createCriteria().andNumberEqualTo(depotHead.getLinkNumber());
depotHeadMapper.updateByExampleSelective(dh, example);
@@ -661,6 +667,20 @@ public class DepotHeadService {
return resList;
}
/**
* 查询除当前单据之外的关联单据列表
* @param linkNumber
* @param number
* @return
* @throws Exception
*/
public List<DepotHead> getListByLinkNumberExceptCurrent(String linkNumber, String number)throws Exception {
DepotHeadExample example = new DepotHeadExample();
example.createCriteria().andLinkNumberEqualTo(linkNumber).andNumberNotEqualTo(number)
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
return depotHeadMapper.selectByExample(example);
}
/**
* 新增单据主表及单据子表信息
* @param beanJson
@@ -726,7 +746,7 @@ public class DepotHeadService {
if(list!=null) {
Long headId = list.get(0).getId();
/**入库和出库处理单据子表信息*/
depotItemService.saveDetials(rows,headId, request);
depotItemService.saveDetials(rows,headId, "add",request);
}
logService.insertLog("单据",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(depotHead.getNumber()).toString(),
@@ -787,7 +807,7 @@ public class DepotHeadService {
}
}
/**入库和出库处理单据子表信息*/
depotItemService.saveDetials(rows,depotHead.getId(),request);
depotItemService.saveDetials(rows,depotHead.getId(), "update",request);
logService.insertLog("单据",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(depotHead.getNumber()).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());