| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | |
| | | //审核通过才会生成委托编号 |
| | | insOrder.setEntrustCode(giveCode.giveCode2("WT-", "ins_order", "-", "yyMMdd")); |
| | | insOrder.setSendTime(LocalDateTime.now()); |
| | | /*todo 根据订单类型判断是否需要推送企业微信 @zss*/ |
| | | /*if (!order.getFormType().equals("其他成品")) { |
| | | //todo 根据订单类型判断是否需要推送企业微信 @zss |
| | | /* if (!order.getFormType().equals("其他成品")) { |
| | | String account = userMapper.selectById(order.getIssueUser()).getAccount(); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("touser", account);//接收消息成员的账号'ZT-031292'这种类型(如果有多个用'|'分隔) |
| | |
| | | } |
| | | insOrderMapper.updateById(order); |
| | | //查询该订单是A类还是B类 |
| | | if (order.getOrderType().equals("A")) { |
| | | //如果是A类,1和2和3都审核通过这个单子就审核通过 |
| | | if (order.getOrderType().equals("B")) { |
| | | //如果是B类,1和2和3都审核通过这个单子就审核通过 |
| | | if (order.getCheckState1() == 1 && order.getCheckState2() == 1 && order.getCheckState3() == 1) { |
| | | order.setState(1); |
| | | upInsOrderOfState(order); |
| | |
| | | order.setState(2); |
| | | upInsOrderOfState(order); |
| | | } |
| | | } else if (order.getOrderType().equals("B")) { |
| | | //如果是B类,1和2审核通过后这个单子就审核通过 |
| | | } else if (order.getOrderType().equals("A")) { |
| | | //如果是A类,1和2审核通过后这个单子就审核通过 |
| | | if (order.getCheckState1() == 1 && order.getCheckState2() == 1) { |
| | | order.setState(1); |
| | | upInsOrderOfState(order); |
| | |
| | | .filter(dto -> dto.getPrice() != null) // 过滤掉价格为 null 的对象 |
| | | .mapToDouble(value -> value.getPrice().doubleValue() * value.getNum()) |
| | | .sum(); |
| | | map.put("total", totalPrice); |
| | | BigDecimal bd = new BigDecimal(totalPrice).setScale(2, RoundingMode.HALF_UP); |
| | | double roundedTotalPrice = bd.doubleValue(); |
| | | map.put("total", roundedTotalPrice); |
| | | return map; |
| | | } |
| | | |
| | |
| | | public List<SampleProductDto3> labelPrinting(String ids) { |
| | | List<Integer> list = Arrays.stream(ids.split(",")).map(Integer::parseInt).collect(Collectors.toList()); |
| | | List<SampleProductDto3> sampleProductDtos = insSampleMapper.selectSampleProductListByOrderId3(list); |
| | | Set<String> processedCodes = new HashSet<>(); |
| | | /* List<SampleProductDto3> sampleProductDto3s = sampleProductDtos.stream().filter(sampleProductDto3 -> { |
| | | if (processedCodes.contains(sampleProductDto3.getCode())) { |
| | | return false; |
| | | } else { |
| | | processedCodes.add(sampleProductDto3.getCode()); |
| | | return true; |
| | | } |
| | | }).collect(Collectors.toList());*/ |
| | | return sampleProductDtos; |
| | | } |
| | | |