解决单据查询的时候仓库参数bug

This commit is contained in:
季圣华 2021-06-10 00:28:09 +08:00
parent c32c11f75f
commit 283b4ef97e
3 changed files with 18 additions and 8 deletions

View File

@ -27,7 +27,7 @@ public interface DepotHeadMapperEx {
@Param("beginTime") String beginTime,
@Param("endTime") String endTime,
@Param("materialParam") String materialParam,
@Param("depotIds") String depotIds,
@Param("depotArray") String[] depotArray,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
@ -40,7 +40,7 @@ public interface DepotHeadMapperEx {
@Param("beginTime") String beginTime,
@Param("endTime") String endTime,
@Param("materialParam") String materialParam,
@Param("depotIds") String depotIds);
@Param("depotArray") String[] depotArray);
String findMaterialsListByHeaderId(
@Param("id") Long id);

View File

@ -99,12 +99,13 @@ public class DepotHeadService {
List<DepotHeadVo4List> list=new ArrayList<>();
try{
String depotIds = depotService.findDepotStrByCurrentUser();
String [] depotArray=depotIds.split(",");
String [] creatorArray = getCreatorArray(roleType);
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, status, number, beginTime, endTime, materialParam, depotIds, offset, rows);
list=depotHeadMapperEx.selectByConditionDepotHead(type, subType, creatorArray, status, number, beginTime, endTime, materialParam, depotArray, offset, rows);
if (null != list) {
for (DepotHeadVo4List dh : list) {
if(accountMap!=null && StringUtil.isNotEmpty(dh.getAccountIdList()) && StringUtil.isNotEmpty(dh.getAccountMoneyList())) {
@ -146,10 +147,11 @@ public class DepotHeadService {
Long result=null;
try{
String depotIds = depotService.findDepotStrByCurrentUser();
String [] depotArray=depotIds.split(",");
String [] creatorArray = getCreatorArray(roleType);
beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME);
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
result=depotHeadMapperEx.countsByDepotHead(type, subType, creatorArray, status, number, beginTime, endTime, materialParam, depotIds);
result=depotHeadMapperEx.countsByDepotHead(type, subType, creatorArray, status, number, beginTime, endTime, materialParam, depotArray);
}catch(Exception e){
JshException.readFail(logger, e);
}

View File

@ -74,8 +74,12 @@
<bind name="bindKey" value="'%'+materialParam+'%'"/>
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
</if>
<if test="depotIds != null and depotIds !=''">
and di.depot_id in (#{depotIds})
<if test="depotArray != null and depotArray !=''">
and di.depot_id in (
<foreach collection="depotArray" item="depotId" separator=",">
#{depotId}
</foreach>
)
</if>
<if test="creatorArray != null">
and dh.creator in (
@ -120,8 +124,12 @@
<bind name="bindKey" value="'%'+materialParam+'%'"/>
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
</if>
<if test="depotIds != null and depotIds !=''">
and di.depot_id in (#{depotIds})
<if test="depotArray != null and depotArray !=''">
and di.depot_id in (
<foreach collection="depotArray" item="depotId" separator=",">
#{depotId}
</foreach>
)
</if>
<if test="creatorArray != null">
and dh.creator in (