Browse Source

为出入库查询添加筛选功能

lwx_dev
erdanergou 3 years ago
parent
commit
10b4f6b724
  1. 1
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java
  2. 56
      src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml
  3. 37
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  4. 4
      src/main/java/com/dreamchaser/depository_manage/utils/DateUtil.java
  5. 10
      src/main/resources/templates/pages/depository/table-in.html
  6. 10
      src/main/resources/templates/pages/depository/table-in_mobile.html
  7. 10
      src/main/resources/templates/pages/depository/table-out.html
  8. 10
      src/main/resources/templates/pages/depository/table-out_mobile.html

1
src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java

@ -1040,6 +1040,7 @@ public class DepositoryRecordController {
map.remove("depositoryId");
}
}
if (PublicConfig.roleAdminorgList.contains(maindeparment)) {
list = depositoryRecordService.findApplicationOutRecordPByCondition(map, userByPort, userKey, token);
countBy = depositoryRecordService.findApplicationOutRecordPCountByCondition(map);

56
src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml

@ -413,11 +413,12 @@
<if test="code != null and code != ''">
and aircode like CONCAT('%', #{code}, '%')
</if>
<if test="startDate != null and startDate != ''">
and applicant_time &gt;= #{startDate}
and applicant_time <![CDATA[ >= ]]> #{startDate}
</if>
<if test="endDate != null and endDate != ''">
and applicant_time &lt;= #{endDate}
and applicant_time <![CDATA[ <= ]]> #{endDate}
</if>
and airtoGroupId is null
@ -466,10 +467,10 @@
and aircode like CONCAT('%', #{code}, '%')
</if>
<if test="startDate != null and startDate != ''">
and applicant_time &gt;= #{startDate}
and applicant_time <![CDATA[ >= ]]> #{startDate}
</if>
<if test="endDate != null and endDate != ''">
and applicant_time &lt;= #{endDate}
and applicant_time <![CDATA[ <= ]]> #{endDate}
</if>
and airtoGroupId is null
</select>
@ -502,6 +503,12 @@
<if test="applicantTime != null and applicantTime != ''">
and applicant_time >= #{applicantTime}
</if>
<if test="startDate != null and startDate != ''">
and applicant_time <![CDATA[ >= ]]> #{startDate}
</if>
<if test="endDate != null and endDate != ''">
and applicant_time <![CDATA[ <= ]]> #{endDate}
</if>
<if test="version != null and version != ''">
and mversion = #{version}
</if>
@ -554,14 +561,20 @@
<if test="applicantTime != null and applicantTime != ''">
and applicantTime >= #{applicantTime}
</if>
<if test="startDate != null and startDate != ''">
and applicantTime <![CDATA[ >= ]]> #{startDate}
</if>
<if test="endDate != null and endDate != ''">
and applicantTime <![CDATA[ <= ]]> #{endDate}
</if>
<if test="state != null and state != ''">
AND aorstate LIKE CONCAT('%', #{state}, '%')
</if>
<if test="applyRemark != null and applyRemark != null">
and applyRemark like CONCAT('%', #{applyRemark}, '%')
</if>
<if test="aorcode != null and aorcode != null">
and aorcode = #{aorcode}
<if test="code != null and code != null">
and aorcode = #{code}
</if>
<if test="departmenthead != null and departmenthead != null">
and departmenthead = #{departmenthead}
@ -596,8 +609,8 @@
<if test="version != null and version != ''">
and mversion = #{version}
</if>
<if test="code != null and code != ''">
and mcode = #{code}
<if test="mcode != null and mcode != ''">
and mcode = #{mcode}
</if>
<if test="placeId != null">
and placeId = #{placeId}
@ -659,10 +672,10 @@
and aorcode = #{code}
</if>
<if test="startDate != null and startDate != ''">
and applicantTime &gt;= #{startDate}
and applicantTime <![CDATA[ >= ]]> #{startDate}
</if>
<if test="endDate != null and endDate != ''">
and applicantTime &lt;= #{endDate}
and applicantTime <![CDATA[ <= ]]> #{endDate}
</if>
<if test="adminorgid != null and adminorgid != ''">
and adminorgid = #{adminorgid}
@ -711,10 +724,10 @@
and aorcode = #{code}
</if>
<if test="startDate != null and startDate != ''">
and applicantTime &gt;= #{startDate}
and applicantTime <![CDATA[ >= ]]> #{startDate}
</if>
<if test="endDate != null and endDate != ''">
and applicantTime &lt;= #{endDate}
and applicantTime <![CDATA[ <= ]]> #{endDate}
</if>
<if test="adminorgid != null and adminorgid != ''">
and adminorgid = #{adminorgid}
@ -874,6 +887,12 @@
<if test="applicantTime != null and applicantTime != ''">
and applicant_time >= #{applicantTime}
</if>
<if test="startDate != null and startDate != ''">
and applicant_time <![CDATA[ >= ]]> #{startDate}
</if>
<if test="endDate != null and endDate != ''">
and applicant_time <![CDATA[ <= ]]> #{endDate}
</if>
and airtoGroupId is null
</select>
@ -909,13 +928,19 @@
<if test="applicantTime != null and applicantTime != ''">
and applicantTime >= #{applicantTime}
</if>
<if test="startDate != null and startDate != ''">
and applicantTime <![CDATA[ >= ]]> #{startDate}
</if>
<if test="endDate != null and endDate != ''">
and applicantTime <![CDATA[ <= ]]> #{endDate}
</if>
<if test="state != null and state != ''">
AND aorstate LIKE CONCAT('%', #{state}, '%')
</if>
<if test="applyRemark != null and applyRemark != null">
and applyRemark like CONCAT('%', #{applyRemark}, '%')
</if>
<if test="aorcode != null and aorcode != null">
<if test="code != null and code != null">
and aorcode = #{code}
</if>
<if test="departmenthead != null and departmenthead != null">
@ -951,8 +976,8 @@
<if test="version != null and version != ''">
and mversion = #{version}
</if>
<if test="code != null and code != ''">
and mcode = #{code}
<if test="mcode != null and mcode != ''">
and mcode = #{mcode}
</if>
<if test="placeId != null">
and placeId = #{placeId}
@ -963,6 +988,7 @@
<if test="constructionunitid != null and constructionunitid != ''">
and constructionunitid = #{constructionunitid}
</if>
</select>

37
src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java

@ -4247,6 +4247,16 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
String applyTime = (String) map.get("applyTime");
map.put("applicantTime", DateUtil.DateTimeByDayToTimeStamp(applyTime));
}
if (map.containsKey("startDate")) {
String startDate = (String) map.get("startDate");
map.put("startDate", DateUtil.DateTimeToTimeStamp(startDate));
}
if (map.containsKey("endDate")) {
String endDate = (String) map.get("endDate");
map.put("endDate", DateUtil.DateTimeToTimeStamp(endDate));
}
List<ApplicationInRecord> list = depositoryRecordMapper.findApplicationInRecordPByCondition(map);
List<ApplicationInRecordP> result = new ArrayList<>();
@ -4290,12 +4300,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
map.put("begin", (page - 1) * size);
}
if (map.containsKey("startDate")) {
String applyTime = (String) map.get("startDate");
map.put("startDate", DateUtil.DateTimeByDayToTimeStamp(applyTime));
String startDate = (String) map.get("startDate");
map.put("startDate", DateUtil.DateTimeToTimeStamp(startDate));
}
if (map.containsKey("endDate")) {
String applyTime = (String) map.get("endDate");
map.put("endDate", DateUtil.DateTimeByDayToTimeStamp(applyTime));
String endDate = (String) map.get("endDate");
map.put("endDate", DateUtil.DateTimeToTimeStamp(endDate));
}
List<Integer> depositoryIdList = roleService.findDepositoryIdForUserHas(userByPort);
if (depositoryIdList.size() == 0) {
@ -4358,6 +4368,14 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
if (map.size() <= 2) {
map.put("applicantId", userByPort.getId());
}
if (map.containsKey("startDate")) {
String startDate = (String) map.get("startDate");
map.put("startDate", DateUtil.DateTimeToTimeStamp(startDate));
}
if (map.containsKey("endDate")) {
String endDate = (String) map.get("endDate");
map.put("endDate", DateUtil.DateTimeToTimeStamp(endDate));
}
if (map.containsKey("depositoryId")) {
depositoryIdList.add(ObjectFormatUtil.toInteger(map.get("depositoryId")));
} else if (!map.containsKey("depositoryIdList")) {
@ -4372,6 +4390,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
}
map.put("depositoryIdList", depositoryIdList);
}
List<ApplicationOutRecord> list = depositoryRecordMapper.findApplicationOutRecordPByUser(map);
List<ApplicationOutRecordP> result = new ArrayList<>();
for (ApplicationOutRecord record : list) {
@ -4440,9 +4459,13 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
page = ObjectFormatUtil.toInteger(map.get("page"));
map.put("begin", (page - 1) * size);
}
if (map.containsKey("applyTime")) {
String applyTime = (String) map.get("applyTime");
map.put("applicantTime", DateUtil.DateTimeByDayToTimeStamp(applyTime));
if (map.containsKey("startDate")) {
String startDate = (String) map.get("startDate");
map.put("startDate", DateUtil.DateTimeToTimeStamp(startDate));
}
if (map.containsKey("endDate")) {
String endDate = (String) map.get("endDate");
map.put("endDate", DateUtil.DateTimeToTimeStamp(endDate));
}
List<ApplicationOutRecord> list = depositoryRecordMapper.findApplicationOutRecordPByCondition(map);
List<ApplicationOutRecordP> result = new ArrayList<>();

4
src/main/java/com/dreamchaser/depository_manage/utils/DateUtil.java

@ -93,6 +93,10 @@ public class DateUtil {
return date.getTime();
}
// 将日期转为时间戳
public static Long DateTimeByMonthToTimeStamp(String dateTime){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");

10
src/main/resources/templates/pages/depository/table-in.html

@ -24,9 +24,9 @@
<div class="layui-inline">
<label class="layui-form-label">申请时间</label>
<div class="layui-input-block" >
<input type="text" style="display:inline;width: 101px;" id="startDate" name="startDate" autocomplete="off" placeholder="开始日期" class="layui-input">
<input type="text" style="display:inline;width: 130px;" id="startDate" name="startDate" autocomplete="off" placeholder="开始日期" class="layui-input">
-
<input type="text" style="display:inline;width: 101px;" id="endDate" name="endDate" autocomplete="off" placeholder="结束日期" class="layui-input">
<input type="text" style="display:inline;width: 130px;" id="endDate" name="endDate" autocomplete="off" placeholder="结束日期" class="layui-input">
</div>
</div>
<div class="layui-inline">
@ -133,10 +133,12 @@
//日期
laydate.render({
elem: '#startDate'
elem: '#startDate',
type: 'datetime'
}); //日期
laydate.render({
elem: '#endDate'
elem: '#endDate',
type: 'datetime'
});
table.render({
elem: "#currentTableId",

10
src/main/resources/templates/pages/depository/table-in_mobile.html

@ -31,11 +31,11 @@
<div class="layui-inline">
<label class="layui-form-label">申请时间</label>
<div class="layui-input-block">
<input type="text" style="display:inline;width: 101px;" id="startDate"
<input type="text" style="display:inline;width: 130px;" id="startDate"
name="startDate" autocomplete="off" placeholder="开始日期"
class="layui-input">
-
<input type="text" style="display:inline;width: 101px;" id="endDate"
<input type="text" style="display:inline;width: 130px;" id="endDate"
name="endDate" autocomplete="off" placeholder="结束日期" class="layui-input">
</div>
</div>
@ -173,10 +173,12 @@
//日期
laydate.render({
elem: '#startDate'
elem: '#startDate',
type: 'datetime'
}); //日期
laydate.render({
elem: '#endDate'
elem: '#endDate',
type: 'datetime'
});

10
src/main/resources/templates/pages/depository/table-out.html

@ -24,10 +24,10 @@
<div class="layui-inline">
<label class="layui-form-label">申请时间</label>
<div class="layui-input-block">
<input type="text" style="display:inline;width: 101px;" id="startDate" name="startDate"
<input type="text" style="display:inline;width: 130px;" id="startDate" name="startDate"
autocomplete="off" placeholder="开始日期" class="layui-input">
-
<input type="text" style="display:inline;width: 101px;" id="endDate" name="endDate"
<input type="text" style="display:inline;width: 130px;" id="endDate" name="endDate"
autocomplete="off" placeholder="结束日期" class="layui-input">
</div>
</div>
@ -206,10 +206,12 @@
//日期
laydate.render({
elem: '#startDate'
elem: '#startDate',
type: 'datetime'
}); //日期
laydate.render({
elem: '#endDate'
elem: '#endDate',
type: 'datetime'
});
table.render({
elem: "#currentTableId",

10
src/main/resources/templates/pages/depository/table-out_mobile.html

@ -26,11 +26,11 @@
<div class="layui-inline">
<label class="layui-form-label">申请时间</label>
<div class="layui-input-block">
<input type="text" style="display:inline;width: 101px;" id="startDate"
<input type="text" style="display:inline;width: 130px;" id="startDate"
name="startDate"
autocomplete="off" placeholder="开始日期" class="layui-input">
-
<input type="text" style="display:inline;width: 101px;" id="endDate"
<input type="text" style="display:inline;width: 130px;" id="endDate"
name="endDate"
autocomplete="off" placeholder="结束日期" class="layui-input">
</div>
@ -202,10 +202,12 @@
//日期
laydate.render({
elem: '#startDate'
elem: '#startDate',
type: 'datetime'
}); //日期
laydate.render({
elem: '#endDate'
elem: '#endDate',
type: 'datetime'
});

Loading…
Cancel
Save