From 5bdd6244e5a06540811976c640eba0f5194d640a Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期六, 02 四月 2022 14:22:06 +0800
Subject: [PATCH] #
---
src/main/webapp/views/home/console.html | 4
src/main/java/com/zy/asrs/entity/ViewStayTimeBean.java | 682 ++++++++++++---------------------------------------
src/main/resources/mapper/ViewStayTimeMapper.xml | 76 +++--
src/main/java/com/zy/asrs/controller/ReportQueryController.java | 12
4 files changed, 218 insertions(+), 556 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/ReportQueryController.java b/src/main/java/com/zy/asrs/controller/ReportQueryController.java
index ef24c44..39a18e8 100644
--- a/src/main/java/com/zy/asrs/controller/ReportQueryController.java
+++ b/src/main/java/com/zy/asrs/controller/ReportQueryController.java
@@ -2,14 +2,18 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.plugins.Page;
+import com.core.annotations.ManagerAuth;
import com.core.common.Cools;
+import com.core.common.R;
import com.zy.asrs.entity.*;
import com.zy.asrs.mapper.ReportQueryMapper;
+import com.zy.asrs.service.LocDetlService;
import com.zy.common.web.BaseController;
-import com.core.annotations.ManagerAuth;
-import com.core.common.R;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
@@ -26,6 +30,8 @@
public class ReportQueryController extends BaseController {
@Autowired
+ private LocDetlService locDetlService;
+ @Autowired
private ReportQueryMapper reportQueryMapper;
//------------------搴撲綅浣跨敤缁熻--------------------------------------
diff --git a/src/main/java/com/zy/asrs/entity/ViewStayTimeBean.java b/src/main/java/com/zy/asrs/entity/ViewStayTimeBean.java
index d823559..0a172e0 100644
--- a/src/main/java/com/zy/asrs/entity/ViewStayTimeBean.java
+++ b/src/main/java/com/zy/asrs/entity/ViewStayTimeBean.java
@@ -1,6 +1,15 @@
package com.zy.asrs.entity;
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.core.common.Cools;
+import com.core.common.SpringUtils;
+import com.zy.system.entity.User;
+import com.zy.system.service.UserService;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
/**
* 搴撳瓨婊炵暀鏃堕棿瀹炰綋绫�
@@ -9,527 +18,162 @@
*/
@Data
public class ViewStayTimeBean {
- private int tbnum; //杞偍璇锋眰缂栧彿
- private int tbpos; //琛岄」鐩�
- private String zmatid; //鐗╂枡鏍囩ID
-
- private String matnr; //鐗╂枡
- private String maktx; //鐗╂枡鎻忚堪
- private String werks; //宸ュ巶
- private double anfme; //鏁伴噺
- private String altme; //鍗曚綅
- private String zpallet; //鎵樼洏鏉$爜
- private String bname; //鐢ㄦ埛ID
- private String lgnum; //瑙勬牸
- private String type; // 鐗╂枡绫诲埆
- private String color; // 棰滆壊
- private String supplier; // 渚涘簲鍟�
- private String warehouse; // 浠撳簱
- private String brand; // 鍝佺墝
-
- private String loc_no; //搴撲綅鍙�
- private String mat_no; //鍟嗗搧缂栧彿
- private Long ctns; //绠辨暟
- private Long qty; //鏁伴噺
- private double wt; //閲嶉噺
- private String memo; //澶囨敞
- private String mat_name; //鍟嗗搧鍚嶇О
- private String str1;
- private String str2;
- private String str3;
- private String str4;
- private String str5;
- private String str6;
- private String str7;
- private String str8;
- private String str9;
- private String str10;
- private String str11;
- private String str12;
- private String str13;
- private String str14;
- private String str15;
- private String str16;
- private String str17;
- private String str18;
- private String str19;
- private String str20;
- private String str21;
- private String str22;
- private String str23;
- private double num1;
- private double num2;
- private double num3;
- private double num4;
- private double num5;
- private double num6;
- private String modi_user;
- private String modi_time;
- private String stay_time;
- private String appe_time;
- private int pageNumber;
- private int pageSize;
- private String begin_date; //鏌ヨ寮�濮嬫棩鏈�
- private String end_date; //鏌ヨ鎴鏃ユ湡
- private String barcode;
- private String date1;
-
- public String getLgnum() {
- return lgnum;
+ private int pageNumber;
+ private int pageSize;
+
+ private int stay_time;
+
+ private String begin_date;
+ private String end_date;
+
+ private Integer row;
+
+ @ApiModelProperty(value= "搴撲綅鍙�")
+ private String loc_no;
+
+ @ApiModelProperty(value= "鎵樼洏鏉$爜")
+ private String zpallet;
+
+ @ApiModelProperty(value= "鏁伴噺")
+ private Double anfme;
+
+ @ApiModelProperty(value= "鍟嗗搧缂栧彿")
+ private String matnr;
+
+ @ApiModelProperty(value= "鍟嗗搧鍚嶇О")
+ private String maktx;
+
+ @ApiModelProperty(value= "鎵瑰彿")
+ private String batch;
+
+ @ApiModelProperty(value= "鍗曟嵁缂栧彿")
+ @TableField("order_no")
+ private String orderNo;
+
+ @ApiModelProperty(value= "瑙勬牸")
+ private String specs;
+
+ @ApiModelProperty(value= "鍨嬪彿")
+ private String model;
+
+ @ApiModelProperty(value= "棰滆壊")
+ private String color;
+
+ @ApiModelProperty(value= "鍝佺墝")
+ private String brand;
+
+ @ApiModelProperty(value= "鍗曚綅")
+ private String unit;
+
+ @ApiModelProperty(value= "鍗曚环")
+ private Double price;
+
+ @ApiModelProperty(value= "sku")
+ private String sku;
+
+ @ApiModelProperty(value= "鍗曚綅閲�")
+ private Double units;
+
+ @ApiModelProperty(value= "鏉$爜")
+ private String barcode;
+
+ @ApiModelProperty(value= "浜у湴")
+ private String origin;
+
+ @ApiModelProperty(value= "鍘傚")
+ private String manu;
+
+ @ApiModelProperty(value= "鐢熶骇鏃ユ湡")
+ private String manu_date;
+
+ @ApiModelProperty(value= "鍝侀」鏁�")
+ private String item_num;
+
+ @ApiModelProperty(value= "瀹夊叏搴撳瓨閲�")
+ private Double safe_qty;
+
+ @ApiModelProperty(value= "閲嶉噺")
+ private Double weight;
+
+ @ApiModelProperty(value= "闀垮害")
+ private Double length;
+
+ @ApiModelProperty(value= "浣撶Н")
+ private Double volume;
+
+ @ApiModelProperty(value= "涓夋柟缂栫爜")
+ private String three_code;
+
+ @ApiModelProperty(value= "渚涘簲鍟�")
+ private String supp;
+
+ @ApiModelProperty(value= "渚涘簲鍟嗙紪鐮�")
+ private String supp_code;
+
+ @ApiModelProperty(value= "鏄惁鎵规 1: 鏄� 0: 鍚� ")
+ private Integer be_batch;
+
+ @ApiModelProperty(value= "淇濊川鏈�")
+ private String dead_time;
+
+ @ApiModelProperty(value= "棰勮澶╂暟")
+ private Integer dead_warn;
+
+ @ApiModelProperty(value= "鍒惰喘 1: 鍒堕�� 2: 閲囪喘 3: 澶栧崗 ")
+ private Integer source;
+
+ @ApiModelProperty(value= "瑕佹眰妫�楠� 1: 鏄� 0: 鍚� ")
+ private Integer inspect;
+
+ @ApiModelProperty(value= "鍗遍櫓鍝� 1: 鏄� 0: 鍚� ")
+ private Integer danger;
+
+ @ApiModelProperty(value= "淇敼浜哄憳")
+ private Long modi_user;
+
+ @ApiModelProperty(value= "淇敼鏃堕棿")
+ private Date modi_time;
+
+ @ApiModelProperty(value= "鍒涘缓鑰�")
+ private Long appe_user;
+
+ @ApiModelProperty(value= "娣诲姞鏃堕棿")
+ private Date appe_time;
+
+ @ApiModelProperty(value= "澶囨敞")
+ private String memo;
+
+ public String getModiUser$(){
+ UserService service = SpringUtils.getBean(UserService.class);
+ User user = service.selectById(this.modi_user);
+ if (!Cools.isEmpty(user)){
+ return String.valueOf(user.getUsername());
+ }
+ return null;
}
- public void setLgnum(String lgnum) {
- this.lgnum = lgnum;
+
+ public String getModiTime$(){
+ if (Cools.isEmpty(this.modi_time)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modi_time);
}
- public int getTbnum() {
- return tbnum;
+
+ public String getAppeUser$(){
+ UserService service = SpringUtils.getBean(UserService.class);
+ User user = service.selectById(this.appe_user);
+ if (!Cools.isEmpty(user)){
+ return String.valueOf(user.getUsername());
+ }
+ return null;
}
- public void setTbnum(int tbnum) {
- this.tbnum = tbnum;
+
+ public String getAppeTime$(){
+ if (Cools.isEmpty(this.appe_time)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appe_time);
}
- public int getTbpos() {
- return tbpos;
- }
- public void setTbpos(int tbpos) {
- this.tbpos = tbpos;
- }
- public String getZmatid() {
- return zmatid;
- }
- public void setZmatid(String zmatid) {
- this.zmatid = zmatid;
- }
- public String getMatnr() {
- return matnr;
- }
- public void setMatnr(String matnr) {
- this.matnr = matnr;
- }
- public String getMaktx() {
- return maktx;
- }
- public void setMaktx(String maktx) {
- this.maktx = maktx;
- }
- public String getWerks() {
- return werks;
- }
- public void setWerks(String werks) {
- this.werks = werks;
- }
- public double getAnfme() {
- return anfme;
- }
- public void setAnfme(double anfme) {
- this.anfme = anfme;
- }
- public String getAltme() {
- return altme;
- }
- public void setAltme(String altme) {
- this.altme = altme;
- }
- public String getZpallet() {
- return zpallet;
- }
- public void setZpallet(String zpallet) {
- this.zpallet = zpallet;
- }
- public String getBname() {
- return bname;
- }
- public void setBname(String bname) {
- this.bname = bname;
- }
- public String getLoc_no() {
- return loc_no;
- }
- public void setLoc_no(String loc_no) {
- this.loc_no = loc_no;
- }
- /**
- * @return the mat_no
- */
- public String getMat_no() {
- return mat_no;
- }
- /**
- * @param mat_no the mat_no to set
- */
- public void setMat_no(String mat_no) {
- this.mat_no = mat_no;
- }
- public Long getCtns() {
- return ctns;
- }
- public void setCtns(Long ctns) {
- this.ctns = ctns;
- }
- public Long getQty() {
- return qty;
- }
- public void setQty(Long qty) {
- this.qty = qty;
- }
- public double getWt() {
- return wt;
- }
- public void setWt(double wt) {
- this.wt = wt;
- }
- public String getStay_time() {
- return stay_time;
- }
- public void setStay_time(String stay_time) {
- this.stay_time = stay_time;
- }
- /**
- * @return the mat_name
- */
- public String getMat_name() {
- return mat_name;
- }
- /**
- * @param mat_name the mat_name to set
- */
- public void setMat_name(String mat_name) {
- this.mat_name = mat_name;
- }
- /**
- * @return the str1
- */
- public String getStr1() {
- return str1;
- }
- /**
- * @param str1 the str1 to set
- */
- public void setStr1(String str1) {
- this.str1 = str1;
- }
- /**
- * @return the str2
- */
- public String getStr2() {
- return str2;
- }
- /**
- * @param str2 the str2 to set
- */
- public void setStr2(String str2) {
- this.str2 = str2;
- }
- /**
- * @return the str3
- */
- public String getStr3() {
- return str3;
- }
- /**
- * @param str3 the str3 to set
- */
- public void setStr3(String str3) {
- this.str3 = str3;
- }
- /**
- * @return the str4
- */
- public String getStr4() {
- return str4;
- }
- /**
- * @param str4 the str4 to set
- */
- public void setStr4(String str4) {
- this.str4 = str4;
- }
- /**
- * @return the str5
- */
- public String getStr5() {
- return str5;
- }
- /**
- * @param str5 the str5 to set
- */
- public void setStr5(String str5) {
- this.str5 = str5;
- }
- /**
- * @return the str6
- */
- public String getStr6() {
- return str6;
- }
- /**
- * @param str6 the str6 to set
- */
- public void setStr6(String str6) {
- this.str6 = str6;
- }
- /**
- * @return the str7
- */
- public String getStr7() {
- return str7;
- }
- /**
- * @param str7 the str7 to set
- */
- public void setStr7(String str7) {
- this.str7 = str7;
- }
- /**
- * @return the str8
- */
- public String getStr8() {
- return str8;
- }
- /**
- * @param str8 the str8 to set
- */
- public void setStr8(String str8) {
- this.str8 = str8;
- }
- /**
- * @return the str9
- */
- public String getStr9() {
- return str9;
- }
- /**
- * @param str9 the str9 to set
- */
- public void setStr9(String str9) {
- this.str9 = str9;
- }
- /**
- * @return the str10
- */
- public String getStr10() {
- return str10;
- }
- /**
- * @param str10 the str10 to set
- */
- public void setStr10(String str10) {
- this.str10 = str10;
- }
- /**
- * @return the num1
- */
- public double getNum1() {
- return num1;
- }
- /**
- * @param num1 the num1 to set
- */
- public void setNum1(double num1) {
- this.num1 = num1;
- }
- /**
- * @return the num2
- */
- public double getNum2() {
- return num2;
- }
- /**
- * @param num2 the num2 to set
- */
- public void setNum2(double num2) {
- this.num2 = num2;
- }
- /**
- * @return the num3
- */
- public double getNum3() {
- return num3;
- }
- /**
- * @param num3 the num3 to set
- */
- public void setNum3(double num3) {
- this.num3 = num3;
- }
- /**
- * @return the num4
- */
- public double getNum4() {
- return num4;
- }
- /**
- * @param num4 the num4 to set
- */
- public void setNum4(double num4) {
- this.num4 = num4;
- }
- /**
- * @return the num5
- */
- public double getNum5() {
- return num5;
- }
- /**
- * @param num5 the num5 to set
- */
- public void setNum5(double num5) {
- this.num5 = num5;
- }
- /**
- * @return the modi_user
- */
- public String getModi_user() {
- return modi_user;
- }
- /**
- * @param modi_user the modi_user to set
- */
- public void setModi_user(String modi_user) {
- this.modi_user = modi_user;
- }
- /**
- * @return the modi_time
- */
- public String getModi_time() {
- return modi_time;
- }
- /**
- * @param modi_time the modi_time to set
- */
- public void setModi_time(String modi_time) {
- this.modi_time = modi_time;
- }
- public String getMemo() {
- return memo;
- }
- public void setMemo(String memo) {
- this.memo = memo;
- }
- public String getAppe_time() {
- return appe_time.substring(0, 19);
- }
- public void setAppe_time(String appe_time) {
- this.appe_time = appe_time;
- }
- public int getPageNumber() {
- return pageNumber;
- }
- public void setPageNumber(int pageNumber) {
- this.pageNumber = pageNumber;
- }
- public int getPageSize() {
- return pageSize;
- }
- public void setPageSize(int pageSize) {
- this.pageSize = pageSize;
- }
- public String getBegin_date() {
- return begin_date;
- }
- public void setBegin_date(String begin_date) {
- this.begin_date = begin_date;
- }
- public String getEnd_date() {
- return end_date;
- }
- public void setEnd_date(String end_date) {
- this.end_date = end_date;
- }
- public String getStr11() {
- return str11;
- }
- public void setStr11(String str11) {
- this.str11 = str11;
- }
- public String getStr12() {
- return str12;
- }
- public void setStr12(String str12) {
- this.str12 = str12;
- }
- public String getStr13() {
- return str13;
- }
- public void setStr13(String str13) {
- this.str13 = str13;
- }
- public String getStr14() {
- return str14;
- }
- public void setStr14(String str14) {
- this.str14 = str14;
- }
- public String getStr15() {
- return str15;
- }
- public void setStr15(String str15) {
- this.str15 = str15;
- }
- public String getStr16() {
- return str16;
- }
- public void setStr16(String str16) {
- this.str16 = str16;
- }
- public String getStr17() {
- return str17;
- }
- public void setStr17(String str17) {
- this.str17 = str17;
- }
- public String getStr18() {
- return str18;
- }
- public void setStr18(String str18) {
- this.str18 = str18;
- }
- public String getStr19() {
- return str19;
- }
- public void setStr19(String str19) {
- this.str19 = str19;
- }
- public String getStr20() {
- return str20;
- }
- public void setStr20(String str20) {
- this.str20 = str20;
- }
- public String getStr21() {
- return str21;
- }
- public void setStr21(String str21) {
- this.str21 = str21;
- }
- public String getStr22() {
- return str22;
- }
- public void setStr22(String str22) {
- this.str22 = str22;
- }
- public String getStr23() {
- return str23;
- }
- public void setStr23(String str23) {
- this.str23 = str23;
- }
- public double getNum6() {
- return num6;
- }
- public void setNum6(double num6) {
- this.num6 = num6;
- }
- public String getBarcode() {
- return barcode;
- }
- public void setBarcode(String barcode) {
- this.barcode = barcode;
- }
- public String getDate1() {
- return date1;
- }
- public void setDate1(String date1) {
- this.date1 = date1;
- }
-
-}
\ No newline at end of file
+
+}
diff --git a/src/main/resources/mapper/ViewStayTimeMapper.xml b/src/main/resources/mapper/ViewStayTimeMapper.xml
index bc23e60..7ce92fe 100644
--- a/src/main/resources/mapper/ViewStayTimeMapper.xml
+++ b/src/main/resources/mapper/ViewStayTimeMapper.xml
@@ -4,7 +4,7 @@
<mapper namespace="com.zy.asrs.mapper.ReportQueryMapper">
<!-- mapper涓嶆敮鎸乻ql璇彞宓屽鏃讹紝閲囩敤sql鐗囨鍖呭惈鏂瑰紡锛岃В鍐硏ml鏍囩闂 -->
-<sql id="viewStayTimeConditionSql">
+<sql id="viewStayTimeConditionSql">
<if test="loc_no!=null and loc_no!='' ">
and loc_no like '%' + #{loc_no} + '%'
</if>
@@ -14,9 +14,6 @@
<if test="stay_time!=null and stay_time!='' ">
and stay_time > #{stay_time}
</if>
-<!-- <if test="appe_time!=null and appe_time!='' "> -->
-<!-- and appe_time > #{appe_time} -->
-<!-- </if> -->
<if test="maktx!=null and maktx!='' ">
and (maktx like '%' + #{maktx} + '%'
or lgnum like '%' + #{maktx} + '%'
@@ -32,42 +29,57 @@
</if>
<if test="begin_date!=null and begin_date!='' ">
<![CDATA[
- and appe_time >= #{begin_date}
- ]]>
- </if>
+ and appe_time >= #{begin_date}
+ ]]>
+ </if>
<if test="end_date!=null and end_date!='' ">
<![CDATA[
- and appe_time <= #{end_date}
- ]]>
+ and appe_time <= #{end_date}
+ ]]>
</if>
</sql>
<!-- 鍒嗛〉鏌ヨ鎵�鏈変俊鎭� -->
-<select id="queryViewStayTimeList" parameterType="com.zy.asrs.entity.ViewStayTimeBean" resultType="com.zy.asrs.entity.ViewStayTimeBean">
-select * from (
-select *,ROW_NUMBER() OVER(Order by appe_time,loc_no,matnr) as rowid
- from asr_stk_staytime_view
-<where>
- 1=1
- <include refid="viewStayTimeConditionSql"></include>
-</where>
- ) as a
-<where>
- rowid between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
- <![CDATA[
- order by a.appe_time asc
- ]]>
-</where>
+<select id="queryViewStayTimeList" resultType="com.zy.asrs.entity.ViewStayTimeBean">
+ select
+ *
+ from (
+ select
+ ROW_NUMBER() over (order by stay_time desc) as row
+ , *
+ from
+ (
+ SELECT
+ GETDATE() AS today
+ , CONVERT(decimal, DATEDIFF(second,asr_loc_detl.appe_time, GETDATE()) / 86400.0, 9) AS stay_time
+ , dbo.asr_loc_detl.*
+ FROM asr_loc_detl
+ INNER JOIN asr_loc_mast ON asr_loc_detl.loc_no = asr_loc_mast.loc_no
+ where 1=1
+ <include refid="viewStayTimeConditionSql"></include>
+ ) t
+ ) a where a.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
</select>
<select id="getViewStayTimeCount" parameterType="com.zy.asrs.entity.ViewStayTimeBean" resultType="Integer">
-select count(1) from asr_stk_staytime_view a
-<where>
-<![CDATA[
- 1=1
-]]>
-<include refid="viewStayTimeConditionSql"></include>
-</where>
+ select
+ count(1)
+ from (
+ select
+ ROW_NUMBER() over (order by stay_time desc) as row
+ , *
+ from
+ (
+ SELECT
+ GETDATE() AS today
+ , CONVERT(decimal, DATEDIFF(second,asr_loc_detl.appe_time, GETDATE()) / 86400.0, 9) AS stay_time
+ , dbo.asr_loc_detl.*
+ FROM asr_loc_detl
+ INNER JOIN asr_loc_mast ON asr_loc_detl.loc_no = asr_loc_mast.loc_no
+ where 1=1
+ <include refid="viewStayTimeConditionSql"></include>
+ ) t
+ ) a
</select>
<!-- 涓嶅垎椤垫煡璇㈡墍鏈変俊鎭紝鐢ㄤ簬excel瀵煎嚭 -->
@@ -84,4 +96,4 @@
</where>
</select>
-</mapper>
\ No newline at end of file
+</mapper>
diff --git a/src/main/webapp/views/home/console.html b/src/main/webapp/views/home/console.html
index 562662f..ce1ed60 100644
--- a/src/main/webapp/views/home/console.html
+++ b/src/main/webapp/views/home/console.html
@@ -235,7 +235,7 @@
var pageCurr;
function getCol() {
var cols = [
- {field: 'appe_time', title: '鍏ュ簱鏃堕棿', align: 'center', width: 200}
+ {field: 'appeTime$', title: '鍏ュ簱鏃堕棿', align: 'center', width: 200}
,{field: 'stay_time', align: 'center',title: '婊炵暀澶╂暟'}
,{field: 'loc_no', align: 'center',title: '搴撲綅鍙�'}
];
@@ -330,4 +330,4 @@
return fmt;
}
</script>
-</html>
\ No newline at end of file
+</html>
--
Gitblit v1.9.1