diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java index 9a8a6c39..2bd4f76a 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java @@ -263,6 +263,9 @@ public class OrderController extends BaseController { orderMaster.setGoodsBrand(request.getGoodsBrand()); orderMaster.setGoodsSpecification(request.getGoodsSpecification()); orderMaster.setConsultMode(request.getConsultMode()); + if("01".equalsIgnoreCase(orderMaster.getConsultMode())){ + orderMaster.setOrderMode("02"); + } // 存在登陆用户的情况下 if(getSysUser() != null){ orderMaster.setCreateBy(getSysUser().getUserId().toString()); @@ -387,7 +390,7 @@ public class OrderController extends BaseController { return AjaxResult.error("派单金额不能大于订单总金额"); } boolean checkInTeam = workerService.checkInTeam(assignWorker.getWorkerId(), acceptWorker.getWorkerId()); - Assert.isTrue(checkInTeam, "接单师傅不在本团队"); +// Assert.isTrue(checkInTeam, "接单师傅不在本团队"); } // 创建子订单 OrderDetail od = new OrderDetail(); @@ -1388,13 +1391,21 @@ public class OrderController extends BaseController { Goods goods = goodsService.selectById(goodsStandard.getGoodsId()); // 填充商品三级类目 if(goods.getDeptGoodsCategoryId() != null){ - DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goods.getDeptGoodsCategoryId()); - if(deptGoodsCategory == null){ - deptGoodsCategory = new DeptGoodsCategory(); - deptGoodsCategory.setGoodsCategoryId(goods.getDeptGoodsCategoryId()); + Long categoryId = null; + // 前端发单和后台派单 + if(com.ghy.common.utils.StringUtils.isEmpty(orderMaster.getOrderMode())){ + DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.selectOneByGoodsCategoryId(goods.getDeptGoodsCategoryId()); + if(deptGoodsCategory != null){ + categoryId = deptGoodsCategory.getGoodsCategoryId(); + } + }else { + DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goods.getDeptGoodsCategoryId()); + if(deptGoodsCategory != null){ + categoryId = deptGoodsCategory.getGoodsCategoryId(); + } } - if(deptGoodsCategory != null){ - GoodsCategory one = goodsCategoryService.selectById(deptGoodsCategory.getGoodsCategoryId()); + if(categoryId != null){ + GoodsCategory one = goodsCategoryService.selectById(categoryId); if(one != null && one.getParentCategoryId() != null){ GoodsCategory two = goodsCategoryService.selectById(one.getParentCategoryId()); if(two != null && two.getParentCategoryId() != null){ @@ -1513,13 +1524,21 @@ public class OrderController extends BaseController { Goods goods = goodsService.selectById(goodsStandard.getGoodsId()); // 填充商品三级类目 if(goods.getDeptGoodsCategoryId() != null){ - DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goods.getDeptGoodsCategoryId()); - if(deptGoodsCategory == null){ - deptGoodsCategory = new DeptGoodsCategory(); - deptGoodsCategory.setGoodsCategoryId(goods.getDeptGoodsCategoryId()); + Long categoryId = null; + // 前端发单和后台派单 + if(com.ghy.common.utils.StringUtils.isEmpty(orderMaster.getOrderMode())){ + DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.selectOneByGoodsCategoryId(goods.getDeptGoodsCategoryId()); + if(deptGoodsCategory != null){ + categoryId = deptGoodsCategory.getGoodsCategoryId(); + } + }else { + DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goods.getDeptGoodsCategoryId()); + if(deptGoodsCategory != null){ + categoryId = deptGoodsCategory.getGoodsCategoryId(); + } } - if(deptGoodsCategory != null){ - GoodsCategory one = goodsCategoryService.selectById(deptGoodsCategory.getGoodsCategoryId()); + if(categoryId != null){ + GoodsCategory one = goodsCategoryService.selectById(categoryId); if(one != null && one.getParentCategoryId() != null){ GoodsCategory two = goodsCategoryService.selectById(one.getParentCategoryId()); if(two != null && two.getParentCategoryId() != null){ diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderDetailController.java b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderDetailController.java index 70845636..eae14317 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderDetailController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderDetailController.java @@ -205,13 +205,21 @@ public class OrderDetailController extends BaseController { detail.setGoods(good); // 填充商品三级类目 if(good.getDeptGoodsCategoryId() != null){ - DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(good.getDeptGoodsCategoryId()); - if(deptGoodsCategory == null){ - deptGoodsCategory = new DeptGoodsCategory(); - deptGoodsCategory.setGoodsCategoryId(good.getDeptGoodsCategoryId()); + Long categoryId = null; + // 前端发单和后台派单 + if(StringUtils.isEmpty(orderMaster.getOrderMode())){ + DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.selectOneByGoodsCategoryId(good.getDeptGoodsCategoryId()); + if(deptGoodsCategory != null){ + categoryId = deptGoodsCategory.getGoodsCategoryId(); + } + }else { + DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(good.getDeptGoodsCategoryId()); + if(deptGoodsCategory != null){ + categoryId = deptGoodsCategory.getGoodsCategoryId(); + } } - if(deptGoodsCategory != null){ - GoodsCategory one = goodsCategoryService.selectById(deptGoodsCategory.getGoodsCategoryId()); + if(categoryId != null){ + GoodsCategory one = goodsCategoryService.selectById(categoryId); if(one != null && one.getParentCategoryId() != null){ GoodsCategory two = goodsCategoryService.selectById(one.getParentCategoryId()); if(two != null && two.getParentCategoryId() != null){ @@ -317,21 +325,34 @@ public class OrderDetailController extends BaseController { // 商品信息 GoodsStandard goodsStandard = goodsStandardService.selectById(orderStandardList.get(0).getGoodsStandardId()); - Goods goods = goodsService.selectById(goodsStandard.getGoodsId()); + Goods goods = goodsService.selectById(orderMaster.getGoodsId()); if (goods != null) { // 填充商品三级类目 if(goods.getDeptGoodsCategoryId() != null){ - DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goods.getDeptGoodsCategoryId()); - if(deptGoodsCategory != null){ - GoodsCategory one = goodsCategoryService.selectById(deptGoodsCategory.getGoodsCategoryId()); + Long categoryId = null; + // 前端发单和后台派单 + if(StringUtils.isEmpty(orderMaster.getOrderMode())){ + DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.selectOneByGoodsCategoryId(goods.getDeptGoodsCategoryId()); + if(deptGoodsCategory != null){ + categoryId = deptGoodsCategory.getGoodsCategoryId(); + } + }else { + DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goods.getDeptGoodsCategoryId()); + if(deptGoodsCategory != null){ + categoryId = deptGoodsCategory.getGoodsCategoryId(); + } + } + if(categoryId != null){ + GoodsCategory one = goodsCategoryService.selectById(categoryId); if(one != null && one.getParentCategoryId() != null){ GoodsCategory two = goodsCategoryService.selectById(one.getParentCategoryId()); if(two != null && two.getParentCategoryId() != null){ GoodsCategory three = goodsCategoryService.selectById(two.getParentCategoryId()); if(three != null){ - orderListResponse.setTotalName(three.getGoodsCategoryName() + goods.setGoodsName(three.getGoodsCategoryName() + "-" + two.getGoodsCategoryName() + "-" + one.getGoodsCategoryName()); + orderListResponse.setTotalName(goods.getGoodsName()); } } } @@ -543,16 +564,24 @@ public class OrderDetailController extends BaseController { // 商品信息 GoodsStandard goodsStandard = goodsStandardService.selectById(orderStandardList.get(0).getGoodsStandardId()); - Goods goods = goodsService.selectById(goodsStandard.getGoodsId()); + Goods goods = goodsService.selectById(orderMaster.getGoodsId()); // 填充商品三级类目 if(goods.getDeptGoodsCategoryId() != null){ - DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goods.getDeptGoodsCategoryId()); - if(deptGoodsCategory == null){ - deptGoodsCategory = new DeptGoodsCategory(); - deptGoodsCategory.setGoodsCategoryId(goods.getDeptGoodsCategoryId()); + Long categoryId = null; + // 前端发单和后台派单 + if(StringUtils.isEmpty(orderMaster.getOrderMode())){ + DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.selectOneByGoodsCategoryId(goods.getDeptGoodsCategoryId()); + if(deptGoodsCategory != null){ + categoryId = deptGoodsCategory.getGoodsCategoryId(); + } + }else { + DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goods.getDeptGoodsCategoryId()); + if(deptGoodsCategory != null){ + categoryId = deptGoodsCategory.getGoodsCategoryId(); + } } - if(deptGoodsCategory != null){ - GoodsCategory one = goodsCategoryService.selectById(deptGoodsCategory.getGoodsCategoryId()); + if(categoryId != null){ + GoodsCategory one = goodsCategoryService.selectById(categoryId); if(one != null && one.getParentCategoryId() != null){ GoodsCategory two = goodsCategoryService.selectById(one.getParentCategoryId()); if(two != null && two.getParentCategoryId() != null){ @@ -655,6 +684,7 @@ public class OrderDetailController extends BaseController { orderListResponse.setDrawCashTime(detail.getDrawCashTime()); orderListResponse.setDrawCashStatus(detail.getDrawCashStatus()); orderListResponse.setArrivalTime(detail.getArrivalTime()); + orderListResponse.setConsultMode(orderMaster.getConsultMode()); orderListResponses.add(orderListResponse); }); return voDataTable(orderListResponses, list); diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java index df0ca300..3a2c4da2 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java @@ -639,13 +639,21 @@ public class OrderMasterController extends BaseController { Goods goods = goodsService.selectById(goodsStandard.getGoodsId()); // 填充商品三级类目 if(goods.getDeptGoodsCategoryId() != null){ - DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goods.getDeptGoodsCategoryId()); - if(deptGoodsCategory == null){ - deptGoodsCategory = new DeptGoodsCategory(); - deptGoodsCategory.setGoodsCategoryId(goods.getDeptGoodsCategoryId()); + Long categoryId = null; + // 前端发单和后台派单 + if(com.ghy.common.utils.StringUtils.isEmpty(master.getOrderMode())){ + DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.selectOneByGoodsCategoryId(goods.getDeptGoodsCategoryId()); + if(deptGoodsCategory != null){ + categoryId = deptGoodsCategory.getGoodsCategoryId(); + } + }else { + DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goods.getDeptGoodsCategoryId()); + if(deptGoodsCategory != null){ + categoryId = deptGoodsCategory.getGoodsCategoryId(); + } } - if(deptGoodsCategory != null){ - GoodsCategory one = goodsCategoryService.selectById(deptGoodsCategory.getGoodsCategoryId()); + if(categoryId != null){ + GoodsCategory one = goodsCategoryService.selectById(categoryId); if(one != null && one.getParentCategoryId() != null){ GoodsCategory two = goodsCategoryService.selectById(one.getParentCategoryId()); if(two != null && two.getParentCategoryId() != null){ @@ -1054,9 +1062,21 @@ public class OrderMasterController extends BaseController { if (goods != null) { // 填充商品三级类目 if(goods.getDeptGoodsCategoryId() != null){ - DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goods.getDeptGoodsCategoryId()); - if(deptGoodsCategory != null){ - GoodsCategory one = goodsCategoryService.selectById(deptGoodsCategory.getGoodsCategoryId()); + Long categoryId = null; + // 前端发单和后台派单 + if(com.ghy.common.utils.StringUtils.isEmpty(orderMaster.getOrderMode())){ + DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.selectOneByGoodsCategoryId(goods.getDeptGoodsCategoryId()); + if(deptGoodsCategory != null){ + categoryId = deptGoodsCategory.getGoodsCategoryId(); + } + }else { + DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goods.getDeptGoodsCategoryId()); + if(deptGoodsCategory != null){ + categoryId = deptGoodsCategory.getGoodsCategoryId(); + } + } + if(categoryId != null){ + GoodsCategory one = goodsCategoryService.selectById(categoryId); if(one != null && one.getParentCategoryId() != null){ GoodsCategory two = goodsCategoryService.selectById(one.getParentCategoryId()); if(two != null && two.getParentCategoryId() != null){ @@ -1211,13 +1231,21 @@ public class OrderMasterController extends BaseController { master.setGoods(good); // 填充商品三级类目 if(good.getDeptGoodsCategoryId() != null){ - DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(good.getDeptGoodsCategoryId()); - if(deptGoodsCategory == null){ - deptGoodsCategory = new DeptGoodsCategory(); - deptGoodsCategory.setGoodsCategoryId(good.getDeptGoodsCategoryId()); + Long categoryId = null; + // 前端发单和后台派单 + if(com.ghy.common.utils.StringUtils.isEmpty(master.getOrderMode())){ + DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.selectOneByGoodsCategoryId(good.getDeptGoodsCategoryId()); + if(deptGoodsCategory != null){ + categoryId = deptGoodsCategory.getGoodsCategoryId(); + } + }else { + DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(good.getDeptGoodsCategoryId()); + if(deptGoodsCategory != null){ + categoryId = deptGoodsCategory.getGoodsCategoryId(); + } } - if(deptGoodsCategory != null){ - GoodsCategory one = goodsCategoryService.selectById(deptGoodsCategory.getGoodsCategoryId()); + if(categoryId != null){ + GoodsCategory one = goodsCategoryService.selectById(categoryId); if(one != null && one.getParentCategoryId() != null){ GoodsCategory two = goodsCategoryService.selectById(one.getParentCategoryId()); if(two != null && two.getParentCategoryId() != null){ diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/worker/WorkerController.java b/ghy-admin/src/main/java/com/ghy/web/controller/worker/WorkerController.java index f5f51ddd..8a4a5d54 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/worker/WorkerController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/worker/WorkerController.java @@ -150,7 +150,7 @@ public class WorkerController extends BaseController { startPage(); Worker worker = new Worker(); worker.setWorkerIds(CollectionUtils.isNotEmpty(resWorkerIds) ? resWorkerIds : null); - worker.setName(workerListRequest.getWorkerName()); + worker.setKeyWords(workerListRequest.getWorkerName()); if(this.getSysUser().getDept().getParentId() != 101){ worker.setDeptId(this.getSysUser().getDept().getParentId()); } diff --git a/ghy-admin/src/main/java/com/ghy/web/pojo/vo/WorkerListRequest.java b/ghy-admin/src/main/java/com/ghy/web/pojo/vo/WorkerListRequest.java index 8716ffe5..9255034e 100644 --- a/ghy-admin/src/main/java/com/ghy/web/pojo/vo/WorkerListRequest.java +++ b/ghy-admin/src/main/java/com/ghy/web/pojo/vo/WorkerListRequest.java @@ -24,4 +24,6 @@ public class WorkerListRequest { private Long exceptParentAreaId; private boolean justShowCurWorkerArea; + + private String keyWords; } diff --git a/ghy-admin/src/main/resources/templates/order/assignWholeOrder.html b/ghy-admin/src/main/resources/templates/order/assignWholeOrder.html index 7bb1e6b4..909c96f0 100644 --- a/ghy-admin/src/main/resources/templates/order/assignWholeOrder.html +++ b/ghy-admin/src/main/resources/templates/order/assignWholeOrder.html @@ -89,8 +89,8 @@