fanxw пре 1 година
родитељ
комит
0a5223b1e7

+ 6 - 0
src/main/java/com/chinaitop/depot/grainSituationCard/service/impl/StorageSealedConfirmationImpl.java

@@ -9,6 +9,8 @@ import com.chinaitop.depot.grainSituationCard.model.StorageSealedConfirmationExa
9 9
 import com.chinaitop.depot.grainSituationCard.service.StorageSealedConfirmationService;
10 10
 import com.chinaitop.depot.param.BasicStorageAndTankParam;
11 11
 import com.chinaitop.depot.param.StorageSealedConfirmationPageParam;
12
+import com.chinaitop.depot.utils.ParameterUtil;
13
+
12 14
 import org.springframework.stereotype.Service;
13 15
 import org.springframework.transaction.annotation.Transactional;
14 16
 import org.springframework.util.CollectionUtils;
@@ -59,6 +61,10 @@ public class StorageSealedConfirmationImpl implements StorageSealedConfirmationS
59 61
         if (!ObjectUtils.isEmpty(param.getWarehouseId())) {
60 62
             criteria.andWarehouseIdEqualTo(param.getWarehouseId());
61 63
         }
64
+        //粮情卡功能校验取数用到
65
+        if (!ObjectUtils.isEmpty(param.getApplyTime())) {
66
+        	criteria.andApplyTimeGreaterThanOrEqualTo(ParameterUtil.string2datetime(param.getApplyTime()));
67
+        }
62 68
         return confirmationMapper.selectByExample(example);
63 69
     }
64 70
 

+ 3 - 0
src/main/java/com/chinaitop/depot/param/StorageSealedConfirmationPageParam.java

@@ -28,4 +28,7 @@ public class StorageSealedConfirmationPageParam extends PageParam {
28 28
 
29 29
     // 列表状态1:申请列表,2:审核列表,3:已审核列表
30 30
     private Integer auditState;
31
+
32
+    //申请时间
33
+    private String applyTime;
31 34
 }

+ 191 - 0
src/main/java/com/chinaitop/depot/utils/ParameterUtil.java

@@ -0,0 +1,191 @@
1
+package com.chinaitop.depot.utils;
2
+
3
+import java.io.BufferedInputStream;
4
+import java.io.InputStream;
5
+import java.text.ParseException;
6
+import java.text.SimpleDateFormat;
7
+import java.util.Date;
8
+import java.util.List;
9
+import java.util.Properties;
10
+import java.util.UUID;
11
+
12
+import org.apache.commons.lang.StringUtils;
13
+
14
+public class ParameterUtil {
15
+
16
+	public static String startTime = " 00:00:00";
17
+    public static String endTime = " 23:59:59";
18
+    
19
+    public static String getSysDateTime(){
20
+        String temp_str="";
21
+        Date dt = new Date();
22
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
23
+        temp_str=sdf.format(dt);
24
+        System.out.println("获取当前时间"+temp_str);
25
+        return temp_str;
26
+    }
27
+    
28
+    public static String getDateYMDHMS(Date date) {
29
+    	String str = "";
30
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
31
+        str=sdf.format(date);
32
+        System.out.println("获取当前时间"+str);
33
+        return str;
34
+    }
35
+
36
+    public static String getDateYMD(Date date) {
37
+    	String str = "";
38
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
39
+        str=sdf.format(date);
40
+        System.out.println("获取当前时间"+str);
41
+        return str;
42
+    }
43
+    
44
+    public static String getSysDate(){
45
+        String temp_str="";
46
+        Date dt = new Date();
47
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
48
+        temp_str=sdf.format(dt);
49
+        return temp_str;
50
+    }
51
+
52
+    public static Date string2datetime(String dateTime){
53
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
54
+        Date date = null;
55
+        try {
56
+            date = dateFormat.parse(dateTime);
57
+        } catch (ParseException e) {
58
+            e.printStackTrace();
59
+        }
60
+        return date;
61
+    }
62
+    public static Date string2date(String dateTime){
63
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
64
+        Date date = null;
65
+        try {
66
+            date = dateFormat.parse(dateTime);
67
+        } catch (ParseException e) {
68
+            e.printStackTrace();
69
+        }
70
+        return date;
71
+    }
72
+
73
+    public static String date2string(Date date){
74
+        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
75
+        String str=sdf.format(date);
76
+        return str;
77
+    }
78
+
79
+    /**
80
+     * 获取指定时间的时间戳
81
+     * @param datatime
82
+     * @return
83
+     */
84
+    public static String getTimeStamp(String datatime){
85
+        long timeStamp = 0;
86
+        SimpleDateFormat format =  new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
87
+        try {
88
+            Date date = format.parse(datatime);
89
+            timeStamp = date.getTime();
90
+        } catch (ParseException e) {
91
+            e.printStackTrace();
92
+        }
93
+        return String.valueOf(timeStamp);
94
+    }
95
+
96
+    /*
97
+     * 将时间戳转换为时间
98
+     */
99
+    public static String stampToDate(String s){
100
+        String res;
101
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
102
+        long lt = new Long(s);
103
+        Date date = new Date(lt);
104
+        res = simpleDateFormat.format(date);
105
+        return res;
106
+    }
107
+
108
+    public static void main(String[] args) {
109
+//        System.out.println(stampToDate("1504689208643"));
110
+//        System.out.println(getTimeStamp(getSysDateTime()));
111
+        String a = null;
112
+        System.out.println(StringUtils.isNotBlank(a));
113
+    }
114
+    public static String getBHS(String BHS){
115
+        String[] str = BHS.split(",");
116
+        StringBuffer sb = new StringBuffer();
117
+        for(int i=0;i<str.length;i++){
118
+            sb.append("'").append(str[i]).append("'").append(",");
119
+        }
120
+        String s=sb.toString();
121
+        String t=s.substring(0,s.length()-1);
122
+        return t;
123
+    }
124
+
125
+    //判断字段值是为空 不为空返回ture
126
+    public static boolean isnotnull(Object name){
127
+        return (null!=name&&!"".equals(name) && !"null".equals(name) && "null" != name);
128
+    }
129
+    
130
+    //判断字段值是为空,为空返回ture
131
+    public static boolean isnull(Object name){
132
+        return (null==name || "".equals(name) || "null".equals(name) || "null" == name);
133
+    }
134
+
135
+    //判断字段值是相等  相等返回ture
136
+    public static boolean isequal(Object name,Object value){
137
+        if(name==value||name.equals(value)){
138
+            return true;
139
+        }
140
+        return false;
141
+    }
142
+
143
+    /**
144
+     * 判断list和str数组是否全等
145
+     * @param list
146
+     * @param str
147
+     * @return
148
+     */
149
+    public static boolean isAllequal(List<String> list,String[] str){
150
+        boolean isbz = true;
151
+        for(int z=0;z<str.length;z++){
152
+            if(!isequal(list.get(z),str[z])){
153
+                isbz = false;
154
+                break;
155
+            }
156
+        }
157
+        return !isbz || !(str.length == list.size());
158
+    }
159
+
160
+    //判断字段值是否在某个集合里  在返回ture
161
+    public static boolean isallequal(Object name,String[] value){
162
+        for(int i=0;i<value.length;i++){
163
+            if(name==value[i]||name.equals(value[i])){
164
+                return true;
165
+            }
166
+        }
167
+        return false;
168
+    }
169
+
170
+    /**
171
+     * 从properties得到路径
172
+     * @param filePath
173
+     * @return
174
+     */
175
+    public static Properties readProperties(String filePath) {
176
+        Properties props = new Properties();
177
+        try {
178
+            InputStream in = new BufferedInputStream(ParameterUtil.class.getResourceAsStream(filePath));
179
+            props.load(in);
180
+        } catch (Exception e) {
181
+            e.printStackTrace();
182
+        }
183
+        return props;
184
+    }
185
+    
186
+    public static String getUuid() {
187
+    	String uuid = UUID.randomUUID().toString().trim().replaceAll("-", "");
188
+    	return uuid;
189
+    }
190
+
191
+}