Browse Source

修改出库可视化展示情况

lwx_dev
erdanergou 3 years ago
parent
commit
438ea7f226
  1. 1
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java
  2. 25
      src/main/java/com/dreamchaser/depository_manage/controller/PageController.java
  3. 9
      src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml
  4. 2
      src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationOutRecordP.java
  5. 2
      src/main/java/com/dreamchaser/depository_manage/service/DepositoryRecordService.java
  6. 14
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  7. 8
      src/main/resources/templates/pages/application/form-step-look_back.html

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

@ -1081,6 +1081,7 @@ public class DepositoryController {
// 获取遍历器
Iterator it = depositoryAllNameAndId.keySet().iterator();
// 仓库名称列表
//获取获取系统的当前日历对象
Calendar instance = Calendar.getInstance();
// 获取日期

25
src/main/java/com/dreamchaser/depository_manage/controller/PageController.java

@ -989,12 +989,31 @@ public class PageController {
}
@GetMapping("chart_out_back")
public ModelAndView chart_out_back() {
public ModelAndView chart_out_back(HttpServletRequest request) {
ModelAndView mv = new ModelAndView();
mv.setViewName("pages/chart/chart-out_back");
UserByPort userToken = (UserByPort) request.getAttribute("userToken");
// 获取当前用户所在部门管理的仓库
List<Depository> depositoryByAdminorg = depositoryService.findDepositoryByAdminorg(userToken.getMaindeparment().toString());
// 获取当前用户管理的仓库
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userToken.getId());
List<Integer> depositoryIdList = new ArrayList<>();
for (Depository depository:depositoryByAdminorg
) {
depositoryIdList.add(depository.getId());
}
for (RoleAndDepository rad:depositoryAndRole
) {
if(!depositoryIdList.contains(rad.getDepositoryId())){
depositoryIdList.add(rad.getDepositoryId());
}
}
// 获取已经出库的记录数据
Map<String, Object> mapForOut = depositoryRecordService.CalculateAllApplicationOutCount("已出库");
Map<String, Object> mapForOut = depositoryRecordService.CalculateAllApplicationOutCount("已出库",depositoryIdList);
// 转出物料数量
mv.addObject("OutCount", mapForOut.get("count"));
// 获取数量比值
@ -1005,7 +1024,7 @@ public class PageController {
mv.addObject("outPriceRadio", mapForOut.get("radioForPrice"));
// 获取要出库的记录数据
Map<String, Object> mapForTrueOut = depositoryRecordService.CalculateAllApplicationOutCount("");
Map<String, Object> mapForTrueOut = depositoryRecordService.CalculateAllApplicationOutCount("",depositoryIdList);
// 转出物料金额
mv.addObject("allOutCount", mapForTrueOut.get("count"));
// 获取数量比值

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

@ -662,7 +662,14 @@
select
<include refid="ApplicationOutRecordInfo"/>
from applicationOutRecordInfo
where applicantTime between #{start} and #{end}
where 1 = 1
and applicantTime between #{start} and #{end}
<if test="list != null">
and depositoryId in
<foreach collection="list" index="index" item="depositoryId" open="(" separator="," close=")">
#{depositoryId}
</foreach>
</if>
</select>
<!--根据主键查询出库记录-->
<select id="findApplicationOutRecordPById" parameterType="int" resultMap="applicationOutRecord">

2
src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationOutRecordP.java

@ -100,7 +100,7 @@ public class ApplicationOutRecordP {
private String depositoryManagerName;
/**
* 仓库管理员意见1通过2退回
* 仓库管理员意见1通过2退回3待处理4不需其处理
*/
private String depositoryManagerPass;

2
src/main/java/com/dreamchaser/depository_manage/service/DepositoryRecordService.java

@ -350,7 +350,7 @@ public interface DepositoryRecordService {
* 计算出库物料总数
* @return
*/
Map<String,Object> CalculateAllApplicationOutCount(String state);
Map<String,Object> CalculateAllApplicationOutCount(String state,List<Integer> list);
/**

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

@ -425,8 +425,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
* @return
*/
@Override
public Map<String, Object> CalculateAllApplicationOutCount(String state) {
public Map<String, Object> CalculateAllApplicationOutCount(String state,List<Integer> list) {
// 获取昨天出库订单
// 获取当前时间
long now = System.currentTimeMillis();
@ -439,10 +440,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
Map<String, Object> mapForToday = new HashMap<>();
mapForToday.put("start", nowTimeForCalc);
mapForToday.put("end", now);
mapForToday.put("list",list);
// 用于查询昨天的出库记录
Map<String, Object> mapForYesterday = new HashMap<>();
mapForYesterday.put("start", yesterdayTimeForCalc);
mapForYesterday.put("end", nowTimeForCalc);
mapForYesterday.put("list",list);
// 用于最终的结果
Map<String, Object> result = new HashMap<>();
@ -1880,7 +1883,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
if (flagForDepartmentHeadPass) {
map.put("state", "部门负责人审核通过");
map.put("departmentheadTime", DateUtil.DateTimeToTimeStamp(simpleTime));
map.put("depositoryManagerTime", "0");
map.put("depositoryManagerPass", 4);
map.put("departmenthead", userByPort.getId());
map.put("departmentheadPass", 1);
}
@ -1896,7 +1899,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
map.put("state", "部门负责人审核未通过");
map.put("departmentheadTime", DateUtil.DateTimeToTimeStamp(simpleTime));
map.put("departmenthead", userByPort.getId());
map.put("depositoryManagerTime", "0");
map.put("depositoryManagerPass", 4);
}
}
// 将当前redis中存储的spno删除
@ -2349,7 +2352,8 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
map.put("departmenthead", userid);
map.put("departmentheadPass", 1);
map.put("departmentheadTime", DateUtil.DateTimeToTimeStamp(simpleTime));
map.put("depositoryManagerTime", "0");
map.put("depositoryManagerPass", 4);
}
} else {
updateInventoryForOutRefused(record);
@ -2361,7 +2365,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
map.put("departmenthead", userid);
map.put("departmentheadPass", 2);
map.put("departmentheadTime", DateUtil.DateTimeToTimeStamp(simpleTime));
map.put("depositoryManagerTime", "0");
map.put("depositoryManagerPass", 4);
}
}
// 开启线程更改其他用户卡片模板样式

8
src/main/resources/templates/pages/application/form-step-look_back.html

@ -90,8 +90,12 @@
<td>部门负责人审核时间</td>
<td id="departmentheadTime" th:text="${record.getDepartmentheadTime().equals('1970-01-01 08:00:00')?'':record.getDepartmentheadTime()}">2016-11-28</td>
</tr>
<input id="depositoryManagerPass" style="display: none" th:value="${record.getDepositoryManagerPass()}">
<tr id="depositoryManagerNameT" style="display: none">
<td>仓储负责人</td>
<td id="depositoryManagerName" th:text="${record.getDepositoryManagerName()}">仓储负责人</td>
</tr>
<tr id="depositoryManagerNameMessageT" style="display: none">
@ -163,6 +167,7 @@
let departmentheadTime=$("#departmentheadTime").text();
let depositoryManagerNameTime=$("#depositoryManagerNameTime").text();
let depositoryManagerPass = $("#depositoryManagerPass").val();
if (departmentheadTime!=null&&departmentheadTime!==""){
$("#departmentheadTimeT").show();
$("#departmentheadMessageT").show();
@ -170,7 +175,8 @@
$("#departmentheadMessageT").show();
}
}
if (depositoryManagerNameTime!=null&&depositoryManagerNameTime!==""){
if (depositoryManagerNameTime!=null&&depositoryManagerNameTime!=="" && depositoryManagerPass !== "4"){
$("#depositoryManagerNameT").show();
$("#depositoryManagerNameTimeT").show();
$("#depositoryManagerNameMessageT").show();

Loading…
Cancel
Save