Browse Source

修改出库查询排序算法

lwx_dev
erdanergou 2 years ago
parent
commit
bf47909a8d
  1. 2
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java
  2. 15
      src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml
  3. 1
      src/main/resources/templates/pages/depository/table-out.html
  4. 15
      target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml
  5. 3
      target/classes/templates/pages/depository/table-in.html
  6. 14
      target/classes/templates/pages/depository/table-out.html
  7. 13
      target/classes/templates/pages/depository/table-stock.html

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

@ -1061,7 +1061,6 @@ public class DepositoryRecordController {
list = depositoryRecordService.findApplicationOutRecordPByUser(userByPort, map, userKey, token); list = depositoryRecordService.findApplicationOutRecordPByUser(userByPort, map, userKey, token);
countBy = depositoryRecordService.findApplicationOutRecordPCountByUser(userByPort, map); countBy = depositoryRecordService.findApplicationOutRecordPCountByUser(userByPort, map);
} }
for (ApplicationOutRecordP outRecordP : list) { for (ApplicationOutRecordP outRecordP : list) {
// 根据主订单获取所有子订单 // 根据主订单获取所有子订单
List<ApplicationOutRecordMinP> applicationOutMinByParentId = depositoryRecordService.findApplicationOutMinByParentId(outRecordP.getId()); List<ApplicationOutRecordMinP> applicationOutMinByParentId = depositoryRecordService.findApplicationOutMinByParentId(outRecordP.getId());
@ -1157,6 +1156,7 @@ public class DepositoryRecordController {
outRecordP.setPrice(sumPrice); outRecordP.setPrice(sumPrice);
outRecordP.setMnameStringList(mnameForMobiles); outRecordP.setMnameStringList(mnameForMobiles);
} }
return new RestResponse(list, countBy, 200); return new RestResponse(list, countBy, 200);
} }

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

@ -639,7 +639,7 @@
</if> </if>
GROUP BY aorid GROUP BY aorid
<if test="groupByForState != null and groupByForState !=''"> <if test="groupByForState != null and groupByForState !=''">
ORDER BY pass DESC, applicantTime desc ORDER BY pass DESC,depositoryManagerPass asc, applicantTime desc
</if> </if>
<if test="groupByForState == null or groupByForState == ''"> <if test="groupByForState == null or groupByForState == ''">
ORDER BY applicantTime desc ORDER BY applicantTime desc
@ -662,7 +662,7 @@
select select
<include refid="ApplicationOutRecordInfo"/> <include refid="ApplicationOutRecordInfo"/>
from applicationOutRecordInfo from applicationOutRecordInfo
where 1 = 1 where 1 = 1 and mid is not
<if test="depositoryIdList != null"> <if test="depositoryIdList != null">
and ( depositoryId and ( depositoryId
in in
@ -705,7 +705,12 @@
</if> </if>
GROUP BY aorid GROUP BY aorid
order by applicantTime desc <if test="groupByForState != null and groupByForState !=''">
ORDER BY pass DESC,depositoryManagerPass asc, applicantTime desc
</if>
<if test="groupByForState == null or groupByForState == ''">
ORDER BY applicantTime desc
</if>
<if test="begin != null and size != null"> <if test="begin != null and size != null">
LIMIT #{begin},#{size} LIMIT #{begin},#{size}
</if> </if>
@ -715,7 +720,7 @@
select select
count(DISTINCT aorid) count(DISTINCT aorid)
from applicationOutRecordInfo from applicationOutRecordInfo
where 1 = 1 where 1 = 1 and mid is not
<if test="depositoryIdList != null"> <if test="depositoryIdList != null">
and ( depositoryId in and ( depositoryId in
<foreach collection="depositoryIdList" index="index" item="id" open="(" separator="," close=")"> <foreach collection="depositoryIdList" index="index" item="id" open="(" separator="," close=")">
@ -924,7 +929,7 @@
select select
count(DISTINCT aorid) count(DISTINCT aorid)
from applicationOutRecordInfo from applicationOutRecordInfo
where 1 = 1 where 1 = 1 and mid is not
<if test="id != '' and id != null"> <if test="id != '' and id != null">
and aorid = #{id} and aorid = #{id}
</if> </if>

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

@ -364,6 +364,7 @@
if (data.version !== '') { if (data.version !== '') {
req.version = data.version.trim(); req.version = data.version.trim();
} }
req.groupByForState = true;
//执行搜索重载 //执行搜索重载
table.reloadData('currentTableId', { table.reloadData('currentTableId', {
url: '/depositoryRecord/applicationOutView', url: '/depositoryRecord/applicationOutView',

15
target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml

@ -639,7 +639,7 @@
</if> </if>
GROUP BY aorid GROUP BY aorid
<if test="groupByForState != null and groupByForState !=''"> <if test="groupByForState != null and groupByForState !=''">
ORDER BY pass DESC, applicantTime desc ORDER BY pass DESC,depositoryManagerPass asc, applicantTime desc
</if> </if>
<if test="groupByForState == null or groupByForState == ''"> <if test="groupByForState == null or groupByForState == ''">
ORDER BY applicantTime desc ORDER BY applicantTime desc
@ -662,7 +662,7 @@
select select
<include refid="ApplicationOutRecordInfo"/> <include refid="ApplicationOutRecordInfo"/>
from applicationOutRecordInfo from applicationOutRecordInfo
where 1 = 1 where 1 = 1 and mid is not
<if test="depositoryIdList != null"> <if test="depositoryIdList != null">
and ( depositoryId and ( depositoryId
in in
@ -705,7 +705,12 @@
</if> </if>
GROUP BY aorid GROUP BY aorid
order by applicantTime desc <if test="groupByForState != null and groupByForState !=''">
ORDER BY pass DESC,depositoryManagerPass asc, applicantTime desc
</if>
<if test="groupByForState == null or groupByForState == ''">
ORDER BY applicantTime desc
</if>
<if test="begin != null and size != null"> <if test="begin != null and size != null">
LIMIT #{begin},#{size} LIMIT #{begin},#{size}
</if> </if>
@ -715,7 +720,7 @@
select select
count(DISTINCT aorid) count(DISTINCT aorid)
from applicationOutRecordInfo from applicationOutRecordInfo
where 1 = 1 where 1 = 1 and mid is not
<if test="depositoryIdList != null"> <if test="depositoryIdList != null">
and ( depositoryId in and ( depositoryId in
<foreach collection="depositoryIdList" index="index" item="id" open="(" separator="," close=")"> <foreach collection="depositoryIdList" index="index" item="id" open="(" separator="," close=")">
@ -924,7 +929,7 @@
select select
count(DISTINCT aorid) count(DISTINCT aorid)
from applicationOutRecordInfo from applicationOutRecordInfo
where 1 = 1 where 1 = 1 and mid is not
<if test="id != '' and id != null"> <if test="id != '' and id != null">
and aorid = #{id} and aorid = #{id}
</if> </if>

3
target/classes/templates/pages/depository/table-in.html

@ -318,7 +318,8 @@
layer.msg("未选中记录,请确认!"); layer.msg("未选中记录,请确认!");
return false; return false;
} }
} else if (obj.event === 'showEchart') { }
else if (obj.event === 'showEchart') {
let listItem = `<ul class="layui-table-tool-panel" style="max-height: 685px;"> let listItem = `<ul class="layui-table-tool-panel" style="max-height: 685px;">
<li lay-event="showLineEchart">查看面积图</li> <li lay-event="showLineEchart">查看面积图</li>
<li lay-event="showSunburstEchart">查看旭日图</li> <li lay-event="showSunburstEchart">查看旭日图</li>

14
target/classes/templates/pages/depository/table-out.html

@ -364,6 +364,7 @@
if (data.version !== '') { if (data.version !== '') {
req.version = data.version.trim(); req.version = data.version.trim();
} }
req.groupByForState = true;
//执行搜索重载 //执行搜索重载
table.reloadData('currentTableId', { table.reloadData('currentTableId', {
url: '/depositoryRecord/applicationOutView', url: '/depositoryRecord/applicationOutView',
@ -477,8 +478,17 @@
return false; return false;
} }
} }
else if(obj.event === 'showEchart'){ else if (obj.event === 'showEchart') {
let listItem = `<ul class="layui-table-tool-panel" style="max-height: 685px;">
<li lay-event="showLineEchart">查看面积图</li>
<li lay-event="showSunburstEchart">查看旭日图</li>
</ul>`;
$("#showEchart").append(listItem)
}else if(obj.event === 'showLineEchart'){
console.log("showLineEchart")
}else if(obj.event === "showSunburstEchart"){
console.log("showSunburstEchart")
} }
}); });

13
target/classes/templates/pages/depository/table-stock.html

@ -467,8 +467,17 @@
} else if (obj.event === 'downloadFile') { } else if (obj.event === 'downloadFile') {
window.open("/download/inventoryImportDownload", "_self"); window.open("/download/inventoryImportDownload", "_self");
} }
else if(obj.event === 'showEchart'){ else if (obj.event === 'showEchart') {
let listItem = `<ul class="layui-table-tool-panel" style="max-height: 685px;">
<li lay-event="showLineEchart">查看面积图</li>
<li lay-event="showSunburstEchart">查看旭日图</li>
</ul>`;
$("#showEchart").append(listItem)
}else if(obj.event === 'showLineEchart'){
console.log("showLineEchart")
}else if(obj.event === "showSunburstEchart"){
console.log("showSunburstEchart")
} }
}); });

Loading…
Cancel
Save