|
@@ -17,7 +17,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
+import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -211,9 +214,38 @@ public class OmstruckOrderSeparateController extends BaseRESTfulController {
|
|
@PostMapping("/getCapacityAllOrder")
|
|
@PostMapping("/getCapacityAllOrder")
|
|
public RESTfulResult getCapacityAllOrder(String capacityNumber,String date){
|
|
public RESTfulResult getCapacityAllOrder(String capacityNumber,String date){
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
+ date += "-01 00:00:00";
|
|
map.put("capacityNumber",capacityNumber);
|
|
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);
|
|
List<Map<String, Object>> capacityAllOrderList = omstruckOrderSeparateService.getCapacityAllOrder(map);
|
|
return success(capacityAllOrderList);
|
|
return success(capacityAllOrderList);
|