Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
569413f58f
|
|
@ -31,6 +31,8 @@ public class GoodsController extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private DeptGoodsCategoryService deptGoodsCategoryService;
|
private DeptGoodsCategoryService deptGoodsCategoryService;
|
||||||
@Resource
|
@Resource
|
||||||
|
private GoodsCategoryService goodsCategoryService;
|
||||||
|
@Resource
|
||||||
private GoodsImgsService goodsImgsService;
|
private GoodsImgsService goodsImgsService;
|
||||||
@Resource
|
@Resource
|
||||||
private GoodsAreaService goodsAreaService;
|
private GoodsAreaService goodsAreaService;
|
||||||
|
|
@ -65,6 +67,21 @@ public class GoodsController extends BaseController {
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo appList(@RequestBody Goods goods) {
|
public TableDataInfo appList(@RequestBody Goods goods) {
|
||||||
startPage();
|
startPage();
|
||||||
|
|
||||||
|
// 判断类目id是否为第三级,不是的话需要找到所有符合条件的第三级类目id作为新的条件
|
||||||
|
if (goods.getDeptGoodsCategoryId() != null) {
|
||||||
|
GoodsCategory goodsCategory = goodsCategoryService.selectById(goods.getDeptGoodsCategoryId());
|
||||||
|
if (goodsCategory.getLevel() == 0) {
|
||||||
|
goods.setDeptGoodsCategoryId(null);
|
||||||
|
} else if (goodsCategory.getLevel() == 1) {
|
||||||
|
GoodsCategory params = new GoodsCategory();
|
||||||
|
params.setParentCategoryId(goodsCategory.getGoodsCategoryId());
|
||||||
|
List<GoodsCategory> filteredCategory = goodsCategoryService.selectGoodsCategoryList(params);
|
||||||
|
List<Long> filteredCategoryIds = filteredCategory.stream().map(GoodsCategory::getGoodsCategoryId).collect(Collectors.toList());
|
||||||
|
goods.setDeptGoodsCategoryId(null);
|
||||||
|
goods.setDeptGoodsCategoryIds(filteredCategoryIds);
|
||||||
|
}
|
||||||
|
}
|
||||||
List<Goods> list = goodsService.selectGoodsList(goods);
|
List<Goods> list = goodsService.selectGoodsList(goods);
|
||||||
list.forEach(one -> {
|
list.forEach(one -> {
|
||||||
// 补全商品
|
// 补全商品
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,11 @@ import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
|
|
@ -63,6 +65,29 @@ public class GoodsDeptCategoryController extends BaseController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/app/listByStep")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult appListByStep(@RequestBody DeptGoodsCategory deptGoodsCategory) {
|
||||||
|
List<DeptGoodsCategory> resList = new ArrayList<DeptGoodsCategory>();
|
||||||
|
try {
|
||||||
|
if (deptGoodsCategory.getIsAllNode() == null || !deptGoodsCategory.getIsAllNode()) {
|
||||||
|
List<DeptGoodsCategory> list = deptGoodsCategoryService.listByStep(deptGoodsCategory);
|
||||||
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
|
DeptGoodsCategory allGoodsNode = new DeptGoodsCategory();
|
||||||
|
allGoodsNode.setGoodsCategoryName("全部");
|
||||||
|
allGoodsNode.setIsAllNode(true);
|
||||||
|
resList.add(allGoodsNode);
|
||||||
|
resList.addAll(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return AjaxResult.success(resList);
|
||||||
|
}catch (Exception e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ExceptionUtil.getExceptionMessage(e));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@RequiresPermissions("goods:deptcategory:edit")
|
@RequiresPermissions("goods:deptcategory:edit")
|
||||||
@GetMapping("/edit/{id}")
|
@GetMapping("/edit/{id}")
|
||||||
public String edit(@PathVariable("id") Long id, ModelMap mmap) {
|
public String edit(@PathVariable("id") Long id, ModelMap mmap) {
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import com.ghy.order.domain.OrderGoods;
|
||||||
import com.ghy.order.domain.OrderMaster;
|
import com.ghy.order.domain.OrderMaster;
|
||||||
import com.ghy.order.request.AppOrderAssignRequest;
|
import com.ghy.order.request.AppOrderAssignRequest;
|
||||||
import com.ghy.order.request.AppOrderRequest;
|
import com.ghy.order.request.AppOrderRequest;
|
||||||
|
import com.ghy.order.request.SysOrderAssignRequest;
|
||||||
import com.ghy.order.service.OrderDetailService;
|
import com.ghy.order.service.OrderDetailService;
|
||||||
import com.ghy.order.service.OrderGoodsService;
|
import com.ghy.order.service.OrderGoodsService;
|
||||||
import com.ghy.order.service.OrderMasterService;
|
import com.ghy.order.service.OrderMasterService;
|
||||||
|
|
@ -86,6 +87,9 @@ public class OrderController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private GoodsStandardService goodsStandardService;
|
private GoodsStandardService goodsStandardService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 可派单商品数量
|
||||||
|
* */
|
||||||
@PostMapping("/can/assign")
|
@PostMapping("/can/assign")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult canAssign(@RequestBody AppOrderAssignRequest request){
|
public AjaxResult canAssign(@RequestBody AppOrderAssignRequest request){
|
||||||
|
|
@ -115,6 +119,32 @@ public class OrderController extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后台批量下单
|
||||||
|
* */
|
||||||
|
@PostMapping("/sys/order")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult sysOrder(@RequestBody SysOrderAssignRequest request){
|
||||||
|
try {
|
||||||
|
// 新增商品 -- 商品不关联师傅,状态为不展示在商城页面
|
||||||
|
|
||||||
|
// 选择消费者(消费者类型为渠道商、不需要) --
|
||||||
|
|
||||||
|
// 生成消费者下单地址
|
||||||
|
|
||||||
|
// 生成主单
|
||||||
|
|
||||||
|
// 生成财务单
|
||||||
|
|
||||||
|
// 生成财务细单 -- 平台扣点、提成
|
||||||
|
return AjaxResult.success("下单成功");
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
return AjaxResult.error("系统异常");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/assign")
|
@PostMapping("/assign")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ import com.ghy.common.enums.GoodsStatus;
|
||||||
import com.ghy.common.enums.WorkerStatus;
|
import com.ghy.common.enums.WorkerStatus;
|
||||||
import com.ghy.common.utils.ExceptionUtil;
|
import com.ghy.common.utils.ExceptionUtil;
|
||||||
import com.ghy.goods.domain.Goods;
|
import com.ghy.goods.domain.Goods;
|
||||||
|
import com.ghy.goods.domain.GoodsCategory;
|
||||||
|
import com.ghy.goods.service.GoodsCategoryService;
|
||||||
import com.ghy.goods.service.GoodsService;
|
import com.ghy.goods.service.GoodsService;
|
||||||
import com.ghy.web.pojo.vo.WorkerListRequest;
|
import com.ghy.web.pojo.vo.WorkerListRequest;
|
||||||
import com.ghy.web.pojo.vo.WorkerListResponse;
|
import com.ghy.web.pojo.vo.WorkerListResponse;
|
||||||
|
|
@ -55,6 +57,9 @@ public class WorkerController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private GoodsService goodsService;
|
private GoodsService goodsService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private GoodsCategoryService goodsCategoryService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private WorkerBankService workerBankService;
|
private WorkerBankService workerBankService;
|
||||||
|
|
||||||
|
|
@ -128,7 +133,22 @@ public class WorkerController extends BaseController {
|
||||||
List<Long> workerIdsByArea = workerAreaList.stream().map(WorkerArea::getWorkerId).collect(Collectors.toList());
|
List<Long> workerIdsByArea = workerAreaList.stream().map(WorkerArea::getWorkerId).collect(Collectors.toList());
|
||||||
// 查询满足技能条件的师傅技能记录
|
// 查询满足技能条件的师傅技能记录
|
||||||
WorkerGoodsCategory workerGoodsCategory = new WorkerGoodsCategory();
|
WorkerGoodsCategory workerGoodsCategory = new WorkerGoodsCategory();
|
||||||
workerGoodsCategory.setGoodsCategoryId(workerListRequest.getGoodsCategoryId());
|
// 判断类目id是否为第三级,不是的话需要找到所有符合条件的第三级类目id作为新的条件
|
||||||
|
if (workerListRequest.getGoodsCategoryId() != null) {
|
||||||
|
GoodsCategory goodsCategory = goodsCategoryService.selectById(workerListRequest.getGoodsCategoryId());
|
||||||
|
if (goodsCategory.getLevel() == 0) {
|
||||||
|
workerGoodsCategory.setGoodsCategoryId(null);
|
||||||
|
} else if (goodsCategory.getLevel() == 1) {
|
||||||
|
GoodsCategory params = new GoodsCategory();
|
||||||
|
params.setParentCategoryId(goodsCategory.getGoodsCategoryId());
|
||||||
|
List<GoodsCategory> filteredCategory = goodsCategoryService.selectGoodsCategoryList(params);
|
||||||
|
List<Long> filteredCategoryIds = filteredCategory.stream().map(GoodsCategory::getGoodsCategoryId).collect(Collectors.toList());
|
||||||
|
workerGoodsCategory.setGoodsCategoryId(null);
|
||||||
|
workerGoodsCategory.setGoodsCategoryIds(filteredCategoryIds);
|
||||||
|
} else {
|
||||||
|
workerGoodsCategory.setGoodsCategoryId(workerListRequest.getGoodsCategoryId());
|
||||||
|
}
|
||||||
|
}
|
||||||
List<WorkerGoodsCategory> workerGoodsCategoryList = workerGoodsCategoryService.getWorkerGoodsCategory(workerGoodsCategory);
|
List<WorkerGoodsCategory> workerGoodsCategoryList = workerGoodsCategoryService.getWorkerGoodsCategory(workerGoodsCategory);
|
||||||
List<Long> workerIdsByCategory = workerGoodsCategoryList.stream().map(WorkerGoodsCategory::getWorkerId).collect(Collectors.toList());
|
List<Long> workerIdsByCategory = workerGoodsCategoryList.stream().map(WorkerGoodsCategory::getWorkerId).collect(Collectors.toList());
|
||||||
// 两个list中的workerid取交集
|
// 两个list中的workerid取交集
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ public class DeptGoodsCategory extends GoodsCategory {
|
||||||
|
|
||||||
@Excel(name = "分公司id", cellType = Excel.ColumnType.NUMERIC)
|
@Excel(name = "分公司id", cellType = Excel.ColumnType.NUMERIC)
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
@Excel(name = "分公司备注类目名称", cellType = Excel.ColumnType.STRING)
|
@Excel(name = "分公司备注类目名称", cellType = Excel.ColumnType.STRING)
|
||||||
private String deptCategoryName;
|
private String deptCategoryName;
|
||||||
|
|
||||||
|
|
@ -52,4 +52,5 @@ public class DeptGoodsCategory extends GoodsCategory {
|
||||||
|
|
||||||
private List<DeptGoodsCategory> child;
|
private List<DeptGoodsCategory> child;
|
||||||
|
|
||||||
|
private Boolean isAllNode;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,8 @@ public class Goods extends BaseEntity {
|
||||||
@Excel(name = "类别id,必须是关联到系统的第三级目录")
|
@Excel(name = "类别id,必须是关联到系统的第三级目录")
|
||||||
private Long deptGoodsCategoryId;
|
private Long deptGoodsCategoryId;
|
||||||
|
|
||||||
|
private List<Long> deptGoodsCategoryIds;
|
||||||
|
|
||||||
@Excel(name = "商品图片", cellType = Excel.ColumnType.IMAGE)
|
@Excel(name = "商品图片", cellType = Excel.ColumnType.IMAGE)
|
||||||
private String goodsImgUrl;
|
private String goodsImgUrl;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ public interface GoodsCategoryService {
|
||||||
*/
|
*/
|
||||||
List<GoodsCategory> selectGoodsCategoryList(GoodsCategory goodsCategory);
|
List<GoodsCategory> selectGoodsCategoryList(GoodsCategory goodsCategory);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询类目管理树
|
* 查询类目管理树
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,9 @@
|
||||||
<if test="goodsCategoryName != null and goodsCategoryName != ''">
|
<if test="goodsCategoryName != null and goodsCategoryName != ''">
|
||||||
AND goods_category_name LIKE concat('%', #{goodsCategoryName}, '%')
|
AND goods_category_name LIKE concat('%', #{goodsCategoryName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="parentCategoryId != null">
|
||||||
|
AND parent_category_id = #{parentCategoryId}
|
||||||
|
</if>
|
||||||
<if test="status != null and status != ''">
|
<if test="status != null and status != ''">
|
||||||
AND status = #{status}
|
AND status = #{status}
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -108,4 +111,4 @@
|
||||||
#{goodsCategoryId}
|
#{goodsCategoryId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,11 @@
|
||||||
<if test="deptGoodsCategoryId != null and deptGoodsCategoryId != ''">
|
<if test="deptGoodsCategoryId != null and deptGoodsCategoryId != ''">
|
||||||
AND dept_goods_category_id = #{deptGoodsCategoryId}
|
AND dept_goods_category_id = #{deptGoodsCategoryId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="deptGoodsCategoryIds != null">
|
||||||
|
<foreach collection="deptGoodsCategoryIds" item="deptGoodsCategoryId" open="(" separator="," close=")">
|
||||||
|
#{deptGoodsCategoryId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
<if test="areaId != null and areaId != ''">
|
<if test="areaId != null and areaId != ''">
|
||||||
AND country_area_id = #{areaId}
|
AND country_area_id = #{areaId}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.ghy.order.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SysOrderAssignRequest {
|
||||||
|
|
||||||
|
// 商品相关信息
|
||||||
|
private Long goodsDeptCategoryId;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,8 @@ package com.ghy.worker.domain;
|
||||||
import com.ghy.common.core.domain.BaseEntity;
|
import com.ghy.common.core.domain.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 师傅服务类目
|
* 师傅服务类目
|
||||||
*
|
*
|
||||||
|
|
@ -27,4 +29,6 @@ public class WorkerGoodsCategory extends BaseEntity {
|
||||||
private Long goodsCategoryId;
|
private Long goodsCategoryId;
|
||||||
|
|
||||||
private String goodsCategoryName;
|
private String goodsCategoryName;
|
||||||
|
|
||||||
|
private List<Long> goodsCategoryIds;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,11 @@
|
||||||
<if test="goodsCategoryId != null">
|
<if test="goodsCategoryId != null">
|
||||||
AND wgc.goods_category_id = #{goodsCategoryId}
|
AND wgc.goods_category_id = #{goodsCategoryId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="goodsCategoryIds != null">
|
||||||
|
<foreach collection="goodsCategoryIds" item="goodsCategoryId" open="(" separator="," close=")">
|
||||||
|
#{goodsCategoryId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue