优化采购入库单据,改为选择关联单据的方式

This commit is contained in:
季圣华
2020-10-22 00:27:18 +08:00
parent 247dfb3cbf
commit cc7df2b44d
8 changed files with 124 additions and 32 deletions

View File

@@ -344,7 +344,7 @@ public class DepotHeadController {
String rows = body.getRows();
Long billsNumLimit = Long.parseLong(request.getSession().getAttribute("billsNumLimit").toString());
Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString());
Long count = depotHeadService.countDepotHead(null,null,null,null,null,null,null,null);
Long count = depotHeadService.countDepotHead(null,null,null,null,null,null,null,null,null);
if(count>= billsNumLimit) {
throw new BusinessParamCheckingException(ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_CODE,
ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_MSG);

View File

@@ -22,6 +22,7 @@ public interface DepotHeadMapperEx {
@Param("type") String type,
@Param("subType") String subType,
@Param("creatorArray") String[] creatorArray,
@Param("status") String status,
@Param("number") String number,
@Param("beginTime") String beginTime,
@Param("endTime") String endTime,
@@ -34,6 +35,7 @@ public interface DepotHeadMapperEx {
@Param("type") String type,
@Param("subType") String subType,
@Param("creatorArray") String[] creatorArray,
@Param("status") String status,
@Param("number") String number,
@Param("beginTime") String beginTime,
@Param("endTime") String endTime,

View File

@@ -33,12 +33,13 @@ public class DepotHeadComponent implements ICommonQuery {
String type = StringUtil.getInfo(search, "type");
String subType = StringUtil.getInfo(search, "subType");
String roleType = StringUtil.getInfo(search, "roleType");
String status = StringUtil.getInfo(search, "status");
String number = StringUtil.getInfo(search, "number");
String beginTime = StringUtil.getInfo(search, "beginTime");
String endTime = StringUtil.getInfo(search, "endTime");
String materialParam = StringUtil.getInfo(search, "materialParam");
String depotIds = StringUtil.getInfo(search, "depotIds");
return depotHeadService.select(type, subType, roleType, number, beginTime, endTime, materialParam, depotIds, QueryUtils.offset(map), QueryUtils.rows(map));
return depotHeadService.select(type, subType, roleType, status, number, beginTime, endTime, materialParam, depotIds, QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
@@ -47,12 +48,13 @@ public class DepotHeadComponent implements ICommonQuery {
String type = StringUtil.getInfo(search, "type");
String subType = StringUtil.getInfo(search, "subType");
String roleType = StringUtil.getInfo(search, "roleType");
String status = StringUtil.getInfo(search, "status");
String number = StringUtil.getInfo(search, "number");
String beginTime = StringUtil.getInfo(search, "beginTime");
String endTime = StringUtil.getInfo(search, "endTime");
String materialParam = StringUtil.getInfo(search, "materialParam");
String depotIds = StringUtil.getInfo(search, "depotIds");
return depotHeadService.countDepotHead(type, subType, roleType, number, beginTime, endTime, materialParam, depotIds);
return depotHeadService.countDepotHead(type, subType, roleType, status, number, beginTime, endTime, materialParam, depotIds);
}
@Override

View File

@@ -82,13 +82,13 @@ public class DepotHeadService {
return list;
}
public List<DepotHeadVo4List> select(String type, String subType, String roleType, String number, String beginTime, String endTime,
public List<DepotHeadVo4List> select(String type, String subType, String roleType, String status, String number, String beginTime, String endTime,
String materialParam, String depotIds, int offset, int rows)throws Exception {
List<DepotHeadVo4List> resList = new ArrayList<DepotHeadVo4List>();
List<DepotHeadVo4List> list=null;
try{
String [] creatorArray = getCreatorArray(roleType);
list=depotHeadMapperEx.selectByConditionDepotHead(type, subType, creatorArray, number, beginTime, endTime, materialParam, depotIds, offset, rows);
list=depotHeadMapperEx.selectByConditionDepotHead(type, subType, creatorArray, status, number, beginTime, endTime, materialParam, depotIds, offset, rows);
}catch(Exception e){
JshException.readFail(logger, e);
}
@@ -122,12 +122,12 @@ public class DepotHeadService {
return resList;
}
public Long countDepotHead(String type, String subType, String roleType,String number, String beginTime, String endTime,
public Long countDepotHead(String type, String subType, String roleType, String status, String number, String beginTime, String endTime,
String materialParam, String depotIds) throws Exception{
Long result=null;
try{
String [] creatorArray = getCreatorArray(roleType);
result=depotHeadMapperEx.countsByDepotHead(type, subType, creatorArray, number, beginTime, endTime, materialParam, depotIds);
result=depotHeadMapperEx.countsByDepotHead(type, subType, creatorArray, status, number, beginTime, endTime, materialParam, depotIds);
}catch(Exception e){
JshException.readFail(logger, e);
}

View File

@@ -55,6 +55,9 @@
<if test="subType != null">
and dh.sub_type='${subType}'
</if>
<if test="status != null">
and dh.status ='${status}'
</if>
<if test="number != null">
and dh.number like '%${number}%'
</if>
@@ -86,24 +89,27 @@
<select id="countsByDepotHead" resultType="java.lang.Long">
SELECT
COUNT(1) from
(select distinct jsh_depot_head.* FROM jsh_depot_head
left join jsh_depot_item di on jsh_depot_head.Id = di.header_id and ifnull(di.delete_flag,'0') !='1'
(select distinct dh.* FROM jsh_depot_head dh
left join jsh_depot_item di on dh.Id = di.header_id and ifnull(di.delete_flag,'0') !='1'
left join jsh_material m on di.material_id = m.Id and ifnull(m.delete_Flag,'0') !='1'
WHERE 1=1
<if test="type != null">
and type='${type}'
and dh.type='${type}'
</if>
<if test="subType != null">
and sub_type='${subType}'
and dh.sub_type='${subType}'
</if>
<if test="status != null">
and dh.status ='${status}'
</if>
<if test="number != null">
and number like '%${number}%'
and dh.number like '%${number}%'
</if>
<if test="beginTime != null">
and oper_time >= '${beginTime}'
and dh.oper_time >= '${beginTime}'
</if>
<if test="endTime != null">
and oper_time &lt;= '${endTime}'
and dh.oper_time &lt;= '${endTime}'
</if>
<if test="materialParam != null">
and (m.`Name` like '%${materialParam}%' or m.Model like '%${materialParam}%')
@@ -112,13 +118,13 @@
and di.depot_id in (${depotIds})
</if>
<if test="creatorArray != null">
and creator in (
and dh.creator in (
<foreach collection="creatorArray" item="creator" separator=",">
#{creator}
</foreach>
)
</if>
and ifnull(jsh_depot_head.delete_Flag,'0') !='1') tb
and ifnull(dh.delete_Flag,'0') !='1') tb
</select>
<select id="findMaterialsListByHeaderId" resultType="java.lang.String">