Browse Source

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU2/DAI_DAZHOU-OMS

luobang 2 years ago
parent
commit
ebc5c8b3a9

+ 34 - 2
src/main/java/com/steerinfo/dil/controller/OmstruckOrderSeparateController.java

@@ -17,7 +17,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 
 /**
@@ -211,9 +214,38 @@ public class OmstruckOrderSeparateController extends BaseRESTfulController {
     @PostMapping("/getCapacityAllOrder")
     public RESTfulResult getCapacityAllOrder(String capacityNumber,String date){
         Map<String, Object> map = new HashMap<>();
+        date += "-01 00:00:00";
         map.put("capacityNumber",capacityNumber);
-        if(date != null){
-            map.put("date",date);
+        DateTimeFormatter sdf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        LocalDateTime ldt = LocalDateTime.parse(date,sdf);
+        try {
+            if(date != null){
+                int month = ldt.getMonth().getValue();
+                int year = ldt.getYear();
+                // 判断是否是一月,一月则减一年,月份回到12
+                if (month == 1) {
+                    map.put("startDate", (year - 1) + "-" + 12 + "-" + 26);
+                }
+                // 非一月只需减少一个月份
+                if (month != 1){
+                    if (month > 10) {
+                        map.put("startDate", year + "-" + (month - 1) + "-" + 26);
+                    }
+                    else {
+                        map.put("startDate", year + "-0" + (month - 1) + "-" + 26);
+                    }
+                }
+                if (month >= 10) {
+                    // 结束时间为当月25号
+                    map.put("endDate", year + "-" + month + "-" + 25);
+                }
+                if (month < 10) {
+                    // 结束时间为当月25号
+                    map.put("endDate", year + "-0" + month + "-" + 25);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
         }
         List<Map<String, Object>> capacityAllOrderList = omstruckOrderSeparateService.getCapacityAllOrder(map);
         return success(capacityAllOrderList);

+ 72 - 0
src/main/java/com/steerinfo/dil/util/EASDeleteTestUtil.java

@@ -0,0 +1,72 @@
+package com.steerinfo.dil.util;
+
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 配置金蝶正式环境连接常量Map
+ * @Description:
+ * @Author:HuJianGuo
+ * @GreateTime:2021/11/15 19:44
+ * @Version:V2.0
+ */
+@Component
+public class EASDeleteTestUtil {
+    // totalMap
+    public final Map<String,Object> totalMap = new HashMap<>();
+    // context
+    public final Map<String,Object> context = new HashMap<>();
+    public final boolean logError = true;
+    public final boolean logData = true;
+    // context
+    public final Map<String,Object> login = new HashMap<>();
+    public final String password = "dgjt@kingdee";
+    public final String dcName = "A004";
+    public final String dbType = "0";
+    public final String userName = "user";
+    // context
+    public final String command = "saveSaleOrderBillHandler";
+
+    /**
+     * 得到context的map
+     * @return
+     */
+    public Map<String,Object> getContext(){
+        this.context.put("logError",logError);
+        this.context.put("logData",logData);
+        return this.context;
+    }
+
+    /**
+     * 得到login的map
+     * @return
+     */
+    public Map<String,Object> getLogin(){
+        this.login.put("password",password);
+        this.login.put("dcName",dcName);
+        this.login.put("dbType",dbType);
+        this.login.put("userName",userName);
+        return this.login;
+    }
+
+    /**
+     * 得到command字符串
+     * @return
+     */
+    public String getCommand(){
+        return this.command;
+    }
+
+    /**
+     * 将所有的配置放入到totalMap的map里面
+     * @return
+     */
+    public Map<String,Object> getTotalMap() {
+        totalMap.put("context",getContext());
+        totalMap.put("login",getLogin());
+        totalMap.put("command",getCommand());
+        return this.totalMap;
+    }
+}

+ 72 - 0
src/main/java/com/steerinfo/dil/util/EASDeleteUtil.java

@@ -0,0 +1,72 @@
+package com.steerinfo.dil.util;
+
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 配置金蝶正式环境连接常量Map
+ * @Description:
+ * @Author:HuJianGuo
+ * @GreateTime:2021/11/15 19:44
+ * @Version:V2.0
+ */
+@Component
+public class EASDeleteUtil {
+    // totalMap
+    public final Map<String,Object> totalMap = new HashMap<>();
+    // context
+    public final Map<String,Object> context = new HashMap<>();
+    public final boolean logError = true;
+    public final boolean logData = true;
+    // context
+    public final Map<String,Object> login = new HashMap<>();
+    public final String password = "dgjt@kingdee";
+    public final String dcName = "FDDGEAS85";
+    public final String dbType = "0";
+    public final String userName = "user";
+    // context
+    public final String command = "saveSaleOrderBillHandler";
+
+    /**
+     * 得到context的map
+     * @return
+     */
+    public Map<String,Object> getContext(){
+        this.context.put("logError",logError);
+        this.context.put("logData",logData);
+        return this.context;
+    }
+
+    /**
+     * 得到login的map
+     * @return
+     */
+    public Map<String,Object> getLogin(){
+        this.login.put("password",password);
+        this.login.put("dcName",dcName);
+        this.login.put("dbType",dbType);
+        this.login.put("userName",userName);
+        return this.login;
+    }
+
+    /**
+     * 得到command字符串
+     * @return
+     */
+    public String getCommand(){
+        return this.command;
+    }
+
+    /**
+     * 将所有的配置放入到totalMap的map里面
+     * @return
+     */
+    public Map<String,Object> getTotalMap() {
+        totalMap.put("context",getContext());
+        totalMap.put("login",getLogin());
+        totalMap.put("command",getCommand());
+        return this.totalMap;
+    }
+}

+ 3 - 2
src/main/resources/com/steerinfo/dil/mapper/OmstruckOrderSeparateMapper.xml

@@ -458,8 +458,9 @@
                    and OO.ORDER_STATUS = 2
                  order by OO.ORDER_RECEIVE_REFUSE_TIME desc
              )
-        <if test="date != null">
-            Where to_char("orderDate",'YYYY-MM') = #{date}
+        <if test="startDate != null">
+            Where to_char("orderDate",'YYYY-MM-DD') &gt;= #{startDate}
+            AND to_char("orderDate",'YYYY-MM-DD') &lt;= #{endDate}
         </if>
     </select>