| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import zy.cloud.wms.common.web.BaseController; |
| | | import zy.cloud.wms.manager.entity.CustOrder; |
| | | import zy.cloud.wms.manager.entity.Pakout; |
| | | import zy.cloud.wms.manager.entity.WrkSts; |
| | | import zy.cloud.wms.manager.entity.param.InitPakoutParam; |
| | | import zy.cloud.wms.manager.entity.param.StockConfirmParam; |
| | | import zy.cloud.wms.manager.entity.param.StockInParam; |
| | | import zy.cloud.wms.manager.entity.param.StockOutParam; |
| | | import zy.cloud.wms.manager.service.CustOrderService; |
| | | import zy.cloud.wms.manager.service.PakoutService; |
| | | import zy.cloud.wms.manager.service.WorkService; |
| | | import zy.cloud.wms.manager.service.WrkStsService; |
| | | import zy.cloud.wms.manager.entity.*; |
| | | import zy.cloud.wms.manager.entity.param.*; |
| | | import zy.cloud.wms.manager.entity.result.KeyValueVo; |
| | | import zy.cloud.wms.manager.service.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | @Autowired |
| | | private CustOrderService custOrderService; |
| | | private OrderService orderService; |
| | | |
| | | @RequestMapping("/stock/pakin") |
| | | @ManagerAuth(memo = "入库") |
| | | public R stockPakin(@RequestBody PakinParam number) { |
| | | return workService.stockPakin(number, getUserId()); |
| | | } |
| | | |
| | | @RequestMapping("/stock/in") |
| | | @ManagerAuth(memo = "上架") |
| | |
| | | return workService.stockOutCheck(number, getUserId()); |
| | | } |
| | | |
| | | @RequestMapping("/stock/out") |
| | | @ManagerAuth(memo = "拣货") |
| | | @RequestMapping("/stock/out/preview") |
| | | @ManagerAuth(memo = "拣货预览") |
| | | public R stockOutPreview(@RequestBody StockOutParam stockOutParam) { |
| | | return workService.stockOutPreview(stockOutParam, getUserId()); |
| | | } |
| | | |
| | | @RequestMapping("/stock/out/create") |
| | | @ManagerAuth(memo = "生成拣货单") |
| | | public R stockOut(@RequestBody StockOutParam stockOutParam) { |
| | | return workService.stockOut(stockOutParam, getUserId()); |
| | | return workService.stockOutCreate(stockOutParam, getUserId()); |
| | | } |
| | | |
| | | @RequestMapping("/stock/out/print") |
| | |
| | | } |
| | | Long sts = pakouts.get(0).getWrkSts(); |
| | | if (sts == 1) { |
| | | sts =2L; |
| | | sts = 2L; |
| | | } |
| | | WrkSts wrkSts = wrkStsService.selectById(sts); |
| | | return R.ok().add(Cools |
| | |
| | | } |
| | | |
| | | @RequestMapping("/orderNo/init") |
| | | @ManagerAuth(memo = "生成销售订单编号") |
| | | @ManagerAuth(memo = "生成单据编号") |
| | | public R initOrderNo() { |
| | | long nextId = snowflakeIdWorker.nextId(); |
| | | if (custOrderService.selectCount(new EntityWrapper<CustOrder>().eq("number", String.valueOf(nextId))) > 0) { |
| | | return R.error("抱歉运气不好,请再生成一次"); |
| | | String orderNo = "AT-" + String.valueOf(nextId).substring(0, 15); |
| | | if (orderService.selectByOrderNo(orderNo) != null) { |
| | | return R.error("抱歉,单据编号已存在"); |
| | | } |
| | | return R.ok().add(String.valueOf(nextId)); |
| | | return R.ok().add(orderNo); |
| | | } |
| | | |
| | | @RequestMapping("/order/init") |
| | | @ManagerAuth(memo = "生成订单") |
| | | public R initOrder(@RequestBody InitOrderParam param) { |
| | | return workService.initOrder(param, getUserId()); |
| | | } |
| | | |
| | | @RequestMapping("/stock/transfer") |
| | | @ManagerAuth(memo = "库存调拨") |
| | | public R stockTransfer(@RequestBody AsrsTransferParam number) { |
| | | return workService.asrsStockTransfer(number, getUserId()); |
| | | } |
| | | |
| | | @RequestMapping("/stock/check") |
| | | @ManagerAuth(memo = "库存盘点") |
| | | public R stockCheck(@RequestBody StoCheckParam param) { |
| | | return workService.stockCheck(param, getUserId()); |
| | | } |
| | | |
| | | @RequestMapping("/stock/check/auditing") |
| | | @ManagerAuth(memo = "盘点记录审核") |
| | | public R checkAuditing(@RequestParam Long checkId) { |
| | | return workService.stockCheckAuditing(checkId, getUserId()); |
| | | } |
| | | |
| | | |
| | | /******************************************************************************************************/ |
| | | |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | @Autowired |
| | | private CstmrService cstmrService; |
| | | @Autowired |
| | | private ItemService itemService; |
| | | |
| | | // 获取所有单据类型 |
| | | @RequestMapping("/docType/all/get") |
| | | @ManagerAuth |
| | | public R getDocTypeData() { |
| | | List<DocType> docTypes = docTypeService.selectList(new EntityWrapper<DocType>().eq("status", 1).orderBy("create_time", false)); |
| | | return R.ok().add(docTypes); |
| | | } |
| | | |
| | | // 获取所有客户 |
| | | @RequestMapping("/cstmr/all/get") |
| | | @ManagerAuth |
| | | public R getCstmrData() { |
| | | List<Cstmr> cstmrs = cstmrService.selectList(new EntityWrapper<Cstmr>().eq("status", 1).orderBy("create_time", false)); |
| | | return R.ok().add(cstmrs); |
| | | } |
| | | |
| | | // 获取所有客户 [键值对版] |
| | | @RequestMapping("/cstmr/all/get/kv") |
| | | @ManagerAuth |
| | | public R getCstmrDataKV() { |
| | | List<Cstmr> cstmrs = cstmrService.selectList(new EntityWrapper<Cstmr>().eq("status", 1).orderBy("create_time", false)); |
| | | List<KeyValueVo> valueVos = new ArrayList<>(); |
| | | for (Cstmr cstmr : cstmrs) { |
| | | KeyValueVo vo = new KeyValueVo(); |
| | | vo.setName(cstmr.getName()); |
| | | vo.setValue(cstmr.getId()); |
| | | valueVos.add(vo); |
| | | } |
| | | return R.ok().add(valueVos); |
| | | } |
| | | |
| | | // 获取所有项目 |
| | | @RequestMapping("/item/all/get") |
| | | @ManagerAuth |
| | | public R getItemData() { |
| | | List<Item> items = itemService.selectList(new EntityWrapper<Item>().eq("status", 1).orderBy("create_time", false)); |
| | | return R.ok().add(items); |
| | | } |
| | | // 获取所有项目 |
| | | @RequestMapping("/item/all/get/kv") |
| | | @ManagerAuth |
| | | public R getItemDataKV() { |
| | | List<Item> items = itemService.selectList(new EntityWrapper<Item>().eq("status", 1).orderBy("create_time", false)); |
| | | List<KeyValueVo> valueVos = new ArrayList<>(); |
| | | for (Item item : items) { |
| | | KeyValueVo vo = new KeyValueVo(); |
| | | vo.setName(item.getName()); |
| | | vo.setValue(item.getId()); |
| | | valueVos.add(vo); |
| | | } |
| | | return R.ok().add(valueVos); |
| | | } |
| | | |
| | | } |