| | |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.GlobleParameter; |
| | | import com.zy.asrs.entity.result.KeyValueVo; |
| | | import com.zy.asrs.mapper.ManPakOutMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.PlaExcelListener; |
| | | import com.zy.asrs.utils.SaasUtils; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | return R.ok(plaQtyService.getDeliveryDate()); |
| | | } |
| | | |
| | | @Resource |
| | | private ManPakOutMapper manPakOutMapper; |
| | | |
| | | @RequestMapping(value = "/pla/sellout/auth") |
| | | @ManagerAuth(memo = "sellout") |
| | | @Transactional |
| | | @Synchronized |
| | | public R sellout(@RequestBody List<Pla> plas) { |
| | | // 判断发货时间段内,是否超 |
| | | String pakoutTime = plas.get(0).getPakoutTime().split("\\(")[0]; |
| | | if (!Cools.isEmpty(pakoutTime)) { |
| | | // 获取时间段内发货重量限额 |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "MAX_WEIGHT_PER_HOUR").eq("status", 1)); |
| | | if (config != null) { |
| | | pakoutTime = pakoutTime.split("\\(")[0].trim(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | // 解析 |
| | | LocalDateTime dateTime = LocalDateTime.parse(pakoutTime, formatter); |
| | | |
| | | // 当小时起点 |
| | | LocalDateTime startHour = dateTime.withMinute(0).withSecond(0); |
| | | |
| | | // 下一个小时 |
| | | LocalDateTime endHour = startHour.plusHours(1); // 自动处理跨天 |
| | | |
| | | // 转回字符串 |
| | | String startStr = startHour.format(formatter); // 2026-01-28 23:00:00 |
| | | String endStr = endHour.format(formatter); // 2026-01-29 00:00:00 |
| | | |
| | | long anfme = manPakOutMapper.maxWeightPerHour(startStr, endStr); |
| | | long weightMax = Long.parseLong(config.getValue()); |
| | | if (anfme + plas.get(0).getOrderWeight().longValue() > weightMax) { |
| | | throw new CoolException("超小时重量限额:" + weightMax + ",该小时发货量已有:" + anfme); |
| | | } |
| | | } |
| | | } |
| | | |
| | | String orderNo = plas.get(0).getOrderNo(); |
| | | String maktx = plas.get(0).getBrand(); |