| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.example.erp.dto.sd.DeliveryDetailDTO; |
| | | import com.example.erp.dto.sd.DeliveryDetailProductDTO; |
| | | import com.example.erp.dto.sd.DeliverySearchDTO; |
| | | import com.example.erp.dto.sd.OrderSearchDTO; |
| | | import com.example.erp.entity.mm.FinishedOperateLog; |
| | | import com.example.erp.entity.sd.*; |
| | | import com.example.erp.entity.userInfo.Log; |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.DecimalFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.util.*; |
| | |
| | | FinishedGoodsInventoryService finishedGoodsInventoryService; |
| | | |
| | | |
| | | public Map<String, Object> getSelectShippingOrder(Integer pageNum, Integer pageSize,List<String> selectDate, Delivery delivery) throws JsonProcessingException { |
| | | public Map<String, Object> getSelectShippingOrder(Integer pageNum, Integer pageSize,List<String> selectDate, Map<String,Object> config) throws JsonProcessingException { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | String endDate = LocalDate.now().toString(); |
| | | String startDate = LocalDate.now().minusDays(15).toString(); |
| | |
| | | endDate = selectDate.get(1); |
| | | } |
| | | } |
| | | JSONObject orderJson = new JSONObject(config); |
| | | DeliverySearchDTO delivery = JSONObject.parseObject(JSONObject.toJSONString(orderJson.get("filter")), DeliverySearchDTO.class); |
| | | Map<String,String> sortDate = (Map<String, String>) config.get("sort"); |
| | | String field = sortDate.get("field").replaceAll("(?<!^)([A-Z])", "_$1").toLowerCase(); |
| | | String orderBy = sortDate.get("order"); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", deliveryMapper.getSelectShippingOrder(offset, pageSize,startDate,endDate, delivery)); |
| | | map.put("data", deliveryMapper.getSelectShippingOrder(offset, pageSize,startDate,endDate, delivery,field, orderBy)); |
| | | map.put("total", deliveryMapper.getSelectShippingOrderPageTotal(offset, pageSize,startDate,endDate, delivery)); |
| | | List<String> list = new ArrayList<>(); |
| | | list.add(startDate); |
| | |
| | | date.add(endDate); |
| | | |
| | | List<Delivery> deliveryList = deliveryMapper.selectByDate(startDate, endDate); |
| | | Integer quantity = 0; |
| | | Double area = 0.00; |
| | | Double money = 0.00; |
| | | for(Delivery delivery:deliveryList){ |
| | | quantity += Integer.parseInt(String.valueOf(delivery.getQuantity())); |
| | | area += Double.parseDouble(String.valueOf(delivery.getArea())); |
| | | money += delivery.getMoney(); |
| | | } |
| | | Map<String, Object> totalSum = new HashMap<>(); |
| | | DecimalFormat df = new DecimalFormat("#.00"); |
| | | totalSum.put("quantity",quantity); |
| | | totalSum.put("area", df.format(area)); |
| | | totalSum.put("perimeter", df.format(money)); |
| | | totalSum.put("count", deliveryList.size()); |
| | | |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("data",deliveryList); |
| | | map.put("date",date); |
| | | |
| | | map.put("totalSum",totalSum); |
| | | return map; |
| | | } |
| | | } |