| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.entity.mm.FinishedOperateLog; |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.DecimalFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.util.*; |
| | |
| | | deliveryId = ""; |
| | | } |
| | | String deliveryIdType = object.get("deliveryIdType").toString(); |
| | | Integer type = Integer.valueOf(object.get("type").toString()); |
| | | Delivery delivery = JSONObject.parseObject(JSONObject.toJSONString(object.get("title")), Delivery.class); |
| | | List<OrderDetail> orderDetaillist = JSONArray.parseArray(JSONObject.toJSONString(object.get("delivery")), OrderDetail.class); |
| | | List<DeliveryOtherMoney> deliveryOtherMoneyList = JSONArray.parseArray(JSONObject.toJSONString(object.get("otherMoney")), DeliveryOtherMoney.class); |
| | |
| | | int intMoney= (int) Math.round(money+freight+otherMoneys); |
| | | //修改发货明细累加面积数量金额 |
| | | deliveryMapper.updatedelivery(Double.valueOf(String.format("%.2f", area)), quantity, Double.valueOf(intMoney), otherMoneys, oddNumber); |
| | | |
| | | |
| | | if(type.equals(2)){ |
| | | if(Boolean.parseBoolean(object.get("deliveryOutbound").toString())){ |
| | | List<OrderDetail> orderDetaillists=finishedGoodsInventoryMapper.getSelectDeliveryDetailDeliveryId(oddNumber); |
| | | if(!Objects.equals(finishedGoodsInventoryService.deliveryDetailLogic(orderDetaillists,savePoint,delivery.getCreator()), "true")){ |
| | | return finishedGoodsInventoryService.deliveryDetailLogic(orderDetaillists,savePoint,delivery.getCreator()); |
| | | } |
| | | } |
| | | |
| | | deliveryMapper.updateDeliveryToExamine(oddNumber,2); |
| | | } |
| | | logService.saveLog(log); |
| | | } else { |
| | | return "false3"; |
| | |
| | | } |
| | | return saveState; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public String updateDeliveryToExamine(Map<String,Object> object) { |
| | |
| | | } |
| | | |
| | | |
| | | public Object appGetDeliveryList(List<String> dates) { |
| | | //设置当前时间 |
| | | String endDate = LocalDate.now().toString(); |
| | | String startDate = LocalDate.now().minusDays(30).toString(); |
| | | if(dates !=null && dates.size()==2){ |
| | | if(dates.get(0) != null){ |
| | | startDate = String.valueOf(dates.get(0)); |
| | | } |
| | | if(dates.get(1) != null){ |
| | | endDate = String.valueOf(dates.get(1)); |
| | | } |
| | | } |
| | | List<String> date = new ArrayList<>(); |
| | | date.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; |
| | | } |
| | | } |