给入库和出库明细增加角色类型字段

This commit is contained in:
季圣华
2022-08-05 00:15:29 +08:00
parent b9c7ee357a
commit 95d6cc3428
4 changed files with 60 additions and 15 deletions

View File

@@ -108,6 +108,7 @@ public class DepotHeadController {
@RequestParam(value = "depotId", required = false) Long depotId, @RequestParam(value = "depotId", required = false) Long depotId,
@RequestParam("beginTime") String beginTime, @RequestParam("beginTime") String beginTime,
@RequestParam("endTime") String endTime, @RequestParam("endTime") String endTime,
@RequestParam(value = "roleType", required = false) String roleType,
@RequestParam("type") String type, @RequestParam("type") String type,
@RequestParam("remark") String remark, @RequestParam("remark") String remark,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
@@ -126,11 +127,13 @@ public class DepotHeadController {
} }
} }
List<DepotHeadVo4InDetail> resList = new ArrayList<DepotHeadVo4InDetail>(); List<DepotHeadVo4InDetail> resList = new ArrayList<DepotHeadVo4InDetail>();
String [] creatorArray = depotHeadService.getCreatorArray(roleType);
beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME); beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME);
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
List<DepotHeadVo4InDetail> list = depotHeadService.findByAll(beginTime, endTime, type, materialParam, List<DepotHeadVo4InDetail> list = depotHeadService.findByAll(beginTime, endTime, type, creatorArray,
depotList, oId, number, remark, (currentPage-1)*pageSize, pageSize); materialParam, depotList, oId, number, remark, (currentPage-1)*pageSize, pageSize);
int total = depotHeadService.findByAllCount(beginTime, endTime, type, materialParam, depotList, oId, number, remark); int total = depotHeadService.findByAllCount(beginTime, endTime, type, creatorArray,
materialParam, depotList, oId, number, remark);
map.put("total", total); map.put("total", total);
//存放数据json数组 //存放数据json数组
if (null != list) { if (null != list) {
@@ -229,6 +232,7 @@ public class DepotHeadController {
@RequestParam("beginTime") String beginTime, @RequestParam("beginTime") String beginTime,
@RequestParam("endTime") String endTime, @RequestParam("endTime") String endTime,
@RequestParam("subType") String subType, @RequestParam("subType") String subType,
@RequestParam(value = "roleType", required = false) String roleType,
@RequestParam("remark") String remark, @RequestParam("remark") String remark,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
@@ -256,11 +260,13 @@ public class DepotHeadController {
depotFList.add(object.getLong("id")); depotFList.add(object.getLong("id"));
} }
} }
String [] creatorArray = depotHeadService.getCreatorArray(roleType);
beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME); beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME);
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
List<DepotHeadVo4InDetail> list = depotHeadService.findAllocationDetail(beginTime, endTime, subType, number, materialParam, List<DepotHeadVo4InDetail> list = depotHeadService.findAllocationDetail(beginTime, endTime, subType, number,
depotList, depotFList, remark, (currentPage-1)*pageSize, pageSize); creatorArray, materialParam, depotList, depotFList, remark, (currentPage-1)*pageSize, pageSize);
int total = depotHeadService.findAllocationDetailCount(beginTime, endTime, subType, number, materialParam, depotList, depotFList, remark); int total = depotHeadService.findAllocationDetailCount(beginTime, endTime, subType, number,
creatorArray, materialParam, depotList, depotFList, remark);
map.put("rows", list); map.put("rows", list);
map.put("total", total); map.put("total", total);
res.code = 200; res.code = 200;

View File

@@ -63,6 +63,7 @@ public interface DepotHeadMapperEx {
@Param("beginTime") String beginTime, @Param("beginTime") String beginTime,
@Param("endTime") String endTime, @Param("endTime") String endTime,
@Param("type") String type, @Param("type") String type,
@Param("creatorArray") String[] creatorArray,
@Param("materialParam") String materialParam, @Param("materialParam") String materialParam,
@Param("depotList") List<Long> depotList, @Param("depotList") List<Long> depotList,
@Param("oId") Integer oId, @Param("oId") Integer oId,
@@ -75,6 +76,7 @@ public interface DepotHeadMapperEx {
@Param("beginTime") String beginTime, @Param("beginTime") String beginTime,
@Param("endTime") String endTime, @Param("endTime") String endTime,
@Param("type") String type, @Param("type") String type,
@Param("creatorArray") String[] creatorArray,
@Param("materialParam") String materialParam, @Param("materialParam") String materialParam,
@Param("depotList") List<Long> depotList, @Param("depotList") List<Long> depotList,
@Param("oId") Integer oId, @Param("oId") Integer oId,
@@ -104,6 +106,7 @@ public interface DepotHeadMapperEx {
@Param("endTime") String endTime, @Param("endTime") String endTime,
@Param("subType") String subType, @Param("subType") String subType,
@Param("number") String number, @Param("number") String number,
@Param("creatorArray") String[] creatorArray,
@Param("materialParam") String materialParam, @Param("materialParam") String materialParam,
@Param("depotList") List<Long> depotList, @Param("depotList") List<Long> depotList,
@Param("depotFList") List<Long> depotFList, @Param("depotFList") List<Long> depotFList,
@@ -116,6 +119,7 @@ public interface DepotHeadMapperEx {
@Param("endTime") String endTime, @Param("endTime") String endTime,
@Param("subType") String subType, @Param("subType") String subType,
@Param("number") String number, @Param("number") String number,
@Param("creatorArray") String[] creatorArray,
@Param("materialParam") String materialParam, @Param("materialParam") String materialParam,
@Param("depotList") List<Long> depotList, @Param("depotList") List<Long> depotList,
@Param("depotFList") List<Long> depotFList, @Param("depotFList") List<Long> depotFList,

View File

@@ -447,21 +447,24 @@ public class DepotHeadService {
return result; return result;
} }
public List<DepotHeadVo4InDetail> findByAll(String beginTime, String endTime, String type, String materialParam, public List<DepotHeadVo4InDetail> findByAll(String beginTime, String endTime, String type, String [] creatorArray,
List<Long> depotList, Integer oId, String number, String remark, Integer offset, Integer rows) throws Exception{ String materialParam, List<Long> depotList, Integer oId, String number,
String remark, Integer offset, Integer rows) throws Exception{
List<DepotHeadVo4InDetail> list = null; List<DepotHeadVo4InDetail> list = null;
try{ try{
list =depotHeadMapperEx.findByAll(beginTime, endTime, type, materialParam, depotList, oId, number, remark, offset, rows); list =depotHeadMapperEx.findByAll(beginTime, endTime, type, creatorArray, materialParam, depotList, oId, number, remark, offset, rows);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
return list; return list;
} }
public int findByAllCount(String beginTime, String endTime, String type, String materialParam, List<Long> depotList, Integer oId, String number, String remark) throws Exception{ public int findByAllCount(String beginTime, String endTime, String type, String [] creatorArray,
String materialParam, List<Long> depotList, Integer oId, String number,
String remark) throws Exception{
int result = 0; int result = 0;
try{ try{
result =depotHeadMapperEx.findByAllCount(beginTime, endTime, type, materialParam, depotList, oId, number, remark); result =depotHeadMapperEx.findByAllCount(beginTime, endTime, type, creatorArray, materialParam, depotList, oId, number, remark);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
@@ -490,10 +493,12 @@ public class DepotHeadService {
} }
public List<DepotHeadVo4InDetail> findAllocationDetail(String beginTime, String endTime, String subType, String number, public List<DepotHeadVo4InDetail> findAllocationDetail(String beginTime, String endTime, String subType, String number,
String materialParam, List<Long> depotList, List<Long> depotFList, String remark, Integer offset, Integer rows) throws Exception{ String [] creatorArray, String materialParam, List<Long> depotList, List<Long> depotFList,
String remark, Integer offset, Integer rows) throws Exception{
List<DepotHeadVo4InDetail> list = null; List<DepotHeadVo4InDetail> list = null;
try{ try{
list =depotHeadMapperEx.findAllocationDetail(beginTime, endTime, subType, number, materialParam, depotList, depotFList, remark, offset, rows); list =depotHeadMapperEx.findAllocationDetail(beginTime, endTime, subType, number, creatorArray,
materialParam, depotList, depotFList, remark, offset, rows);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
@@ -501,10 +506,12 @@ public class DepotHeadService {
} }
public int findAllocationDetailCount(String beginTime, String endTime, String subType, String number, public int findAllocationDetailCount(String beginTime, String endTime, String subType, String number,
String materialParam, List<Long> depotList, List<Long> depotFList, String remark) throws Exception{ String [] creatorArray, String materialParam, List<Long> depotList, List<Long> depotFList,
String remark) throws Exception{
int result = 0; int result = 0;
try{ try{
result =depotHeadMapperEx.findAllocationDetailCount(beginTime, endTime, subType, number, materialParam, depotList, depotFList, remark); result =depotHeadMapperEx.findAllocationDetailCount(beginTime, endTime, subType, number, creatorArray,
materialParam, depotList, depotFList, remark);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }

View File

@@ -244,6 +244,13 @@
<if test="type != null"> <if test="type != null">
and dh.type=#{type} and dh.type=#{type}
</if> </if>
<if test="creatorArray != null">
and dh.creator in (
<foreach collection="creatorArray" item="creator" separator=",">
#{creator}
</foreach>
)
</if>
<if test="number != null and number !=''"> <if test="number != null and number !=''">
<bind name="bindNumber" value="'%'+number+'%'"/> <bind name="bindNumber" value="'%'+number+'%'"/>
and dh.number like #{bindNumber} and dh.number like #{bindNumber}
@@ -285,6 +292,13 @@
<if test="type != null"> <if test="type != null">
and dh.type=#{type} and dh.type=#{type}
</if> </if>
<if test="creatorArray != null">
and dh.creator in (
<foreach collection="creatorArray" item="creator" separator=",">
#{creator}
</foreach>
)
</if>
<if test="number != null and number !=''"> <if test="number != null and number !=''">
<bind name="bindNumber" value="'%'+number+'%'"/> <bind name="bindNumber" value="'%'+number+'%'"/>
and dh.number like #{bindNumber} and dh.number like #{bindNumber}
@@ -419,6 +433,13 @@
<bind name="bindNumber" value="'%'+number+'%'"/> <bind name="bindNumber" value="'%'+number+'%'"/>
and dh.number like #{bindNumber} and dh.number like #{bindNumber}
</if> </if>
<if test="creatorArray != null">
and dh.creator in (
<foreach collection="creatorArray" item="creator" separator=",">
#{creator}
</foreach>
)
</if>
<if test="materialParam != null and materialParam !=''"> <if test="materialParam != null and materialParam !=''">
<bind name="bindKey" value="'%'+materialParam+'%'"/> <bind name="bindKey" value="'%'+materialParam+'%'"/>
and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey} or dh.remark like #{bindKey}) and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey} or dh.remark like #{bindKey})
@@ -461,6 +482,13 @@
<bind name="bindNumber" value="'%'+number+'%'"/> <bind name="bindNumber" value="'%'+number+'%'"/>
and dh.number like #{bindNumber} and dh.number like #{bindNumber}
</if> </if>
<if test="creatorArray != null">
and dh.creator in (
<foreach collection="creatorArray" item="creator" separator=",">
#{creator}
</foreach>
)
</if>
<if test="materialParam != null and materialParam !=''"> <if test="materialParam != null and materialParam !=''">
<bind name="bindKey" value="'%'+materialParam+'%'"/> <bind name="bindKey" value="'%'+materialParam+'%'"/>
and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey} or dh.remark like #{bindKey}) and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey} or dh.remark like #{bindKey})