| | |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | @Slf4j |
| | |
| | | private WrkMastLogService wrkMastLogService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private OrderLogService orderLogService; |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | |
| | | return R.ok(orderService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/order/list/log/auth") |
| | | @ManagerAuth |
| | | public R listLog(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<OrderLog> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){ |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } else { |
| | | wrapper.orderBy("create_time", false); |
| | | } |
| | | return R.ok(orderLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | |
| | | // } |
| | | // orderDetlService.modifyStatus(orderId, 0); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/order/exportOrder/auth") |
| | | @ManagerAuth(memo = "导出订单") |
| | | @Transactional |
| | | public R exportOrder(@RequestParam Long orderId){ |
| | | List<String> fields = new ArrayList<>(); |
| | | fields.add("orderNo"); |
| | | fields.add("matnr"); |
| | | fields.add("maktx"); |
| | | fields.add("specs"); |
| | | fields.add("anfme"); |
| | | fields.add("qty"); |
| | | EntityWrapper<OrderDetl> wrapper = new EntityWrapper<>(); |
| | | List<OrderDetl> orderDetls = orderDetlService.selectList(wrapper.eq("order_id",orderId)); |
| | | return R.ok(exportSupport(orderDetls, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/order/export/auth") |
| | |
| | | // 下单时间 |
| | | String timeStr = dataFormatter.formatCellValue(row.getCell(4)); |
| | | |
| | | if (Cools.isEmpty(timeStr)) { |
| | | timeStr = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(now); |
| | | } |
| | | // 单据类型 |
| | | Long orderType = Long.parseLong(dataFormatter.formatCellValue(row.getCell(5))); |
| | | Date time = null; |
| | |
| | | } |
| | | return R.ok("导入成功"); |
| | | } |
| | | |
| | | } |