解决BUG:采购订单选择销售订单的时候状态没有筛选
This commit is contained in:
parent
5e536d7bbd
commit
8f00b2c91f
@ -23,6 +23,7 @@ public interface DepotHeadMapperEx {
|
||||
@Param("subType") String subType,
|
||||
@Param("creatorArray") String[] creatorArray,
|
||||
@Param("statusArray") String[] statusArray,
|
||||
@Param("purchaseStatusArray") String[] purchaseStatusArray,
|
||||
@Param("number") String number,
|
||||
@Param("linkNumber") String linkNumber,
|
||||
@Param("beginTime") String beginTime,
|
||||
@ -42,6 +43,7 @@ public interface DepotHeadMapperEx {
|
||||
@Param("subType") String subType,
|
||||
@Param("creatorArray") String[] creatorArray,
|
||||
@Param("statusArray") String[] statusArray,
|
||||
@Param("purchaseStatusArray") String[] purchaseStatusArray,
|
||||
@Param("number") String number,
|
||||
@Param("linkNumber") String linkNumber,
|
||||
@Param("beginTime") String beginTime,
|
||||
|
||||
@ -35,6 +35,7 @@ public class DepotHeadComponent implements ICommonQuery {
|
||||
String subType = StringUtil.getInfo(search, "subType");
|
||||
String roleType = StringUtil.getInfo(search, "roleType");
|
||||
String status = StringUtil.getInfo(search, "status");
|
||||
String purchaseStatus = StringUtil.getInfo(search, "purchaseStatus");
|
||||
String number = StringUtil.getInfo(search, "number");
|
||||
String linkNumber = StringUtil.getInfo(search, "linkNumber");
|
||||
String beginTime = StringUtil.getInfo(search, "beginTime");
|
||||
@ -45,7 +46,7 @@ public class DepotHeadComponent implements ICommonQuery {
|
||||
Long depotId = StringUtil.parseStrLong(StringUtil.getInfo(search, "depotId"));
|
||||
Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId"));
|
||||
String remark = StringUtil.getInfo(search, "remark");
|
||||
return depotHeadService.select(type, subType, roleType, status, number, linkNumber, beginTime, endTime, materialParam,
|
||||
return depotHeadService.select(type, subType, roleType, status, purchaseStatus, number, linkNumber, beginTime, endTime, materialParam,
|
||||
organId, creator, depotId, accountId, remark, QueryUtils.offset(map), QueryUtils.rows(map));
|
||||
}
|
||||
|
||||
@ -56,6 +57,7 @@ public class DepotHeadComponent implements ICommonQuery {
|
||||
String subType = StringUtil.getInfo(search, "subType");
|
||||
String roleType = StringUtil.getInfo(search, "roleType");
|
||||
String status = StringUtil.getInfo(search, "status");
|
||||
String purchaseStatus = StringUtil.getInfo(search, "purchaseStatus");
|
||||
String number = StringUtil.getInfo(search, "number");
|
||||
String linkNumber = StringUtil.getInfo(search, "linkNumber");
|
||||
String beginTime = StringUtil.getInfo(search, "beginTime");
|
||||
@ -66,7 +68,7 @@ public class DepotHeadComponent implements ICommonQuery {
|
||||
Long depotId = StringUtil.parseStrLong(StringUtil.getInfo(search, "depotId"));
|
||||
Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId"));
|
||||
String remark = StringUtil.getInfo(search, "remark");
|
||||
return depotHeadService.countDepotHead(type, subType, roleType, status, number, linkNumber, beginTime, endTime, materialParam,
|
||||
return depotHeadService.countDepotHead(type, subType, roleType, status, purchaseStatus, number, linkNumber, beginTime, endTime, materialParam,
|
||||
organId, creator, depotId, accountId, remark);
|
||||
}
|
||||
|
||||
|
||||
@ -98,7 +98,7 @@ public class DepotHeadService {
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<DepotHeadVo4List> select(String type, String subType, String roleType, String status, String number, String linkNumber,
|
||||
public List<DepotHeadVo4List> select(String type, String subType, String roleType, String status, String purchaseStatus, String number, String linkNumber,
|
||||
String beginTime, String endTime, String materialParam, Long organId, Long creator, Long depotId, Long accountId, String remark, int offset, int rows) throws Exception {
|
||||
List<DepotHeadVo4List> resList = new ArrayList<>();
|
||||
List<DepotHeadVo4List> list=new ArrayList<>();
|
||||
@ -106,11 +106,12 @@ public class DepotHeadService {
|
||||
String [] depotArray = getDepotArray(subType);
|
||||
String [] creatorArray = getCreatorArray(roleType);
|
||||
String [] statusArray = StringUtil.isNotEmpty(status) ? status.split(",") : null;
|
||||
String [] purchaseStatusArray = StringUtil.isNotEmpty(purchaseStatus) ? purchaseStatus.split(",") : null;
|
||||
Map<Long,String> personMap = personService.getPersonMap();
|
||||
Map<Long,String> accountMap = accountService.getAccountMap();
|
||||
beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME);
|
||||
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
|
||||
list=depotHeadMapperEx.selectByConditionDepotHead(type, subType, creatorArray, statusArray, number, linkNumber, beginTime, endTime,
|
||||
list=depotHeadMapperEx.selectByConditionDepotHead(type, subType, creatorArray, statusArray, purchaseStatusArray, number, linkNumber, beginTime, endTime,
|
||||
materialParam, organId, creator, depotId, depotArray, accountId, remark, offset, rows);
|
||||
if (null != list) {
|
||||
for (DepotHeadVo4List dh : list) {
|
||||
@ -152,16 +153,17 @@ public class DepotHeadService {
|
||||
return resList;
|
||||
}
|
||||
|
||||
public Long countDepotHead(String type, String subType, String roleType, String status, String number, String linkNumber,
|
||||
public Long countDepotHead(String type, String subType, String roleType, String status, String purchaseStatus, String number, String linkNumber,
|
||||
String beginTime, String endTime, String materialParam, Long organId, Long creator, Long depotId, Long accountId, String remark) throws Exception{
|
||||
Long result=null;
|
||||
try{
|
||||
String [] depotArray = getDepotArray(subType);
|
||||
String [] creatorArray = getCreatorArray(roleType);
|
||||
String [] statusArray = StringUtil.isNotEmpty(status) ? status.split(",") : null;
|
||||
String [] purchaseStatusArray = StringUtil.isNotEmpty(purchaseStatus) ? purchaseStatus.split(",") : null;
|
||||
beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME);
|
||||
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
|
||||
result=depotHeadMapperEx.countsByDepotHead(type, subType, creatorArray, statusArray, number, linkNumber, beginTime, endTime,
|
||||
result=depotHeadMapperEx.countsByDepotHead(type, subType, creatorArray, statusArray, purchaseStatusArray, number, linkNumber, beginTime, endTime,
|
||||
materialParam, organId, creator, depotId, depotArray, accountId, remark);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
@ -750,10 +752,13 @@ public class DepotHeadService {
|
||||
if(depotHead.getDeposit()!=null && StringUtil.isNotEmpty(depotHead.getLinkNumber())) {
|
||||
BigDecimal finishDeposit = depotHeadMapperEx.getFinishDepositByNumberExceptCurrent(depotHead.getLinkNumber(), depotHead.getNumber());
|
||||
//订单中的订金金额
|
||||
BigDecimal preDeposit = getDepotHead(depotHead.getLinkNumber()).getChangeAmount().abs();
|
||||
if(depotHead.getDeposit().add(finishDeposit).compareTo(preDeposit)>0) {
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_DEPOSIT_OVER_PRE_CODE,
|
||||
String.format(ExceptionConstants.DEPOT_HEAD_DEPOSIT_OVER_PRE_MSG));
|
||||
BigDecimal changeAmount = getDepotHead(depotHead.getLinkNumber()).getChangeAmount();
|
||||
if(changeAmount!=null) {
|
||||
BigDecimal preDeposit = changeAmount.abs();
|
||||
if(depotHead.getDeposit().add(finishDeposit).compareTo(preDeposit)>0) {
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_DEPOSIT_OVER_PRE_CODE,
|
||||
String.format(ExceptionConstants.DEPOT_HEAD_DEPOSIT_OVER_PRE_MSG));
|
||||
}
|
||||
}
|
||||
}
|
||||
try{
|
||||
@ -833,10 +838,13 @@ public class DepotHeadService {
|
||||
if(depotHead.getDeposit()!=null && StringUtil.isNotEmpty(depotHead.getLinkNumber())) {
|
||||
BigDecimal finishDeposit = depotHeadMapperEx.getFinishDepositByNumberExceptCurrent(depotHead.getLinkNumber(), depotHead.getNumber());
|
||||
//订单中的订金金额
|
||||
BigDecimal preDeposit = getDepotHead(depotHead.getLinkNumber()).getChangeAmount().abs();
|
||||
if(depotHead.getDeposit().add(finishDeposit).compareTo(preDeposit)>0) {
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_DEPOSIT_OVER_PRE_CODE,
|
||||
String.format(ExceptionConstants.DEPOT_HEAD_DEPOSIT_OVER_PRE_MSG));
|
||||
BigDecimal changeAmount = getDepotHead(depotHead.getLinkNumber()).getChangeAmount();
|
||||
if(changeAmount!=null) {
|
||||
BigDecimal preDeposit = changeAmount.abs();
|
||||
if(depotHead.getDeposit().add(finishDeposit).compareTo(preDeposit)>0) {
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_DEPOSIT_OVER_PRE_CODE,
|
||||
String.format(ExceptionConstants.DEPOT_HEAD_DEPOSIT_OVER_PRE_MSG));
|
||||
}
|
||||
}
|
||||
}
|
||||
try{
|
||||
|
||||
@ -72,6 +72,13 @@
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="purchaseStatusArray != null and purchaseStatusArray !=''">
|
||||
and dh.purchase_status in (
|
||||
<foreach collection="purchaseStatusArray" item="purchaseStatus" separator=",">
|
||||
#{purchaseStatus}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="number != null">
|
||||
<bind name="bindNumber" value="'%'+number+'%'"/>
|
||||
and dh.number like #{bindNumber}
|
||||
@ -148,6 +155,13 @@
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="purchaseStatusArray != null and purchaseStatusArray !=''">
|
||||
and dh.purchase_status in (
|
||||
<foreach collection="purchaseStatusArray" item="purchaseStatus" separator=",">
|
||||
#{purchaseStatus}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="number != null">
|
||||
<bind name="bindNumber" value="'%'+number+'%'"/>
|
||||
and dh.number like #{bindNumber}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user