| | |
| | | import zy.cloud.wms.manager.entity.result.KeyValueVo; |
| | | import zy.cloud.wms.manager.service.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private PickoutService pickoutService; |
| | | |
| | | @RequestMapping("/stock/pakin") |
| | | @ManagerAuth(memo = "入库") |
| | |
| | | @RequestMapping("/stock/out/print") |
| | | @ManagerAuth(memo = "拣货单打印") |
| | | public R stockOutPrint(@RequestBody StockOutParam stockOutParam) { |
| | | return workService.stockOutPrint(stockOutParam, getUserId(), getHostId()); |
| | | } |
| | | |
| | | |
| | | return workService.stockInPrint(stockOutParam, getUserId(), getHostId()); |
| | | @RequestMapping("/pick/out/print") |
| | | @ManagerAuth(memo = "PickOut打印拣货单") |
| | | public R pickOutPrint(@RequestBody Pickout pickout){ |
| | | return pickoutService.stockOutPrint(pickout,getUserId(), getHostId()); |
| | | } |
| | | |
| | | @RequestMapping("/stock/allot") |
| | |
| | | @ManagerAuth(memo = "生成单据编号") |
| | | public R initOrderNo() { |
| | | long nextId = snowflakeIdWorker.nextId(); |
| | | String orderNo = "AT-" + String.valueOf(nextId).substring(0, 15); |
| | | SimpleDateFormat dateformat = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | String orderNo = "AT-" + String.valueOf(dateformat.format(new Date())); |
| | | //String orderNo = "AT-" + String.valueOf(nextId).substring(0, 15); |
| | | if (orderService.selectByOrderNo(orderNo, getHostId()) != null) { |
| | | return R.error("抱歉,单据编号已存在"); |
| | | } |
| | | return R.ok().add(orderNo); |
| | | } |
| | | |
| | | // @RequestMapping("/orderNo/init1") |
| | | // @ManagerAuth(memo = "生成单据编号") |
| | | // public R initOrderNo1() { |
| | | // long nextId = snowflakeIdWorker.nextId(); |
| | | // SimpleDateFormat dateformat = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | // String orderNo = "AT-" + String.valueOf(dateformat.format(new Date())); |
| | | // //String orderNo = "AT-" + String.valueOf(nextId).substring(0, 15); |
| | | // if (orderService.selectByOrderNo(orderNo, getHostId()) != null) { |
| | | // return R.error("抱歉,单据编号已存在"); |
| | | // } |
| | | // return R.ok().add(orderNo); |
| | | // } |
| | | |
| | | @RequestMapping("/receive/init") |
| | | @ManagerAuth(memo = "生成销售订单") |
| | | public R initReceive(@RequestBody InitOrderParam param) { |
| | | return workService.initReceive(param, getUserId(), getHostId()); |
| | | } |
| | | @RequestMapping("/order/init") |
| | | @ManagerAuth(memo = "生成销售订单") |
| | | public R initOrder(@RequestBody InitOrderParam param) { |
| | | return workService.initOrder(param, getUserId(), getHostId()); |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/stock/transfer") |
| | | @ManagerAuth(memo = "库存调拨") |
| | |
| | | // 获取所有单据类型 |
| | | @RequestMapping("/docType/all/get") |
| | | @ManagerAuth |
| | | public R getDocTypeData() { |
| | | List<DocType> docTypes = docTypeService.selectList(new EntityWrapper<DocType>().eq("status", 1).eq("host_id", getHostId()).orderBy("create_time", false).eq("doc_class",1)); |
| | | public R getDocTypeData(Integer docClass) { |
| | | List<DocType> docTypes = docTypeService.selectList(new EntityWrapper<DocType>().eq("status", 1). |
| | | eq("host_id", getHostId()).orderBy("create_time", false).eq("doc_class",docClass)); |
| | | return R.ok().add(docTypes); |
| | | } |
| | | @RequestMapping("docType/out/get") |
| | | @ManagerAuth |
| | | public R getDocOutTypeData(Integer docClass){ |
| | | List<DocType> docTypes = docTypeService.selectList(new EntityWrapper<DocType>().eq("status", 1). |
| | | eq("host_id", getHostId()).orderBy("create_time", false).eq("doc_class",docClass)); |
| | | return R.ok().add(docTypes); |
| | | } |
| | | |