zq-erp/src/main/java/com/matrix/system/app/action/ApiOrderAction.java | ●●●●● patch | view | raw | blame | history | |
zq-erp/src/main/java/com/matrix/system/app/dto/ShoppingGoodsListDto.java | ●●●●● patch | view | raw | blame | history | |
zq-erp/src/main/java/com/matrix/system/hive/bean/ShoppingGoodsCategory2.java | ●●●●● patch | view | raw | blame | history | |
zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml | ●●●●● patch | view | raw | blame | history |
zq-erp/src/main/java/com/matrix/system/app/action/ApiOrderAction.java
@@ -15,7 +15,9 @@ import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.tools.DataAuthUtil; import com.matrix.system.hive.action.util.QueryUtil; import com.matrix.system.hive.bean.ShoppingGoods; import com.matrix.system.hive.bean.ShoppingGoodsCategory; import com.matrix.system.hive.bean.ShoppingGoodsCategory2; import com.matrix.system.hive.bean.SysOrder; import com.matrix.system.hive.plugin.util.CollectionUtils; import com.matrix.system.hive.pojo.ShoppingCarItem; @@ -32,6 +34,7 @@ import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** @@ -58,11 +61,24 @@ }) @GetMapping(value = "/findShoppingGoodsType") public AjaxResult findShoppingGoodsType() { SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); ShoppingGoodsCategory category = new ShoppingGoodsCategory(); category.setShopId(user.getShopId()); return AjaxResult.buildSuccessInstance(shoppingGoodsCategoryService.findByModel(category)); List<ShoppingGoodsCategory2> list=new ArrayList<>(); ShoppingGoodsCategory2 jjcp=new ShoppingGoodsCategory2(); jjcp.setId("家居产品"); jjcp.setName("家居产品"); jjcp.setParentId(0L); ShoppingGoodsCategory2 xm=new ShoppingGoodsCategory2(); xm.setId("项目"); xm.setName("项目"); xm.setParentId(0L); ShoppingGoodsCategory2 tc=new ShoppingGoodsCategory2(); tc.setId("套餐"); tc.setName("套餐"); tc.setParentId(0L); ShoppingGoodsCategory2 czk=new ShoppingGoodsCategory2(); czk.setId("充值卡"); czk.setName("充值卡"); czk.setParentId(0L); return AjaxResult.buildSuccessInstance(Arrays.asList(jjcp,xm,tc,czk)); } @ApiOperation(value = "获取商品列表", notes = "获取商品列表") @@ -71,7 +87,8 @@ }) @PostMapping(value = "/findShoppingGoods") public AjaxResult findShoppingGoods(@RequestBody @Validated ShoppingGoodsListDto shoppingGoodsListDto) { SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); shoppingGoodsListDto.setShopId(user.getShopId()); return AjaxResult.buildSuccessInstance(shoppingGoodsService.findShoppingGoodsListForApi(shoppingGoodsListDto), shoppingGoodsService.findShoppingGoodsListTotalForApi(shoppingGoodsListDto)); } zq-erp/src/main/java/com/matrix/system/app/dto/ShoppingGoodsListDto.java
@@ -15,6 +15,9 @@ @ApiModelProperty(value = "商品名称/编号/拼音") private String queryKey; @ApiModelProperty(value = "商品类型") private String goodType; @ApiModelProperty(value = "类型ID", example = "13") private Long cateId; @@ -29,6 +32,14 @@ @ApiModelProperty(hidden = true) private Long shopId; public String getGoodType() { return goodType; } public void setGoodType(String goodType) { this.goodType = goodType; } public Long getShopId() { return shopId; } zq-erp/src/main/java/com/matrix/system/hive/bean/ShoppingGoodsCategory2.java
New file @@ -0,0 +1,112 @@ package com.matrix.system.hive.bean; import java.io.Serializable; /** * * @date 2016-07-30 09:54 */ public class ShoppingGoodsCategory2 implements Serializable{ private static final long serialVersionUID = 1L; private String id; /** * 类型名称 */ private String name; /** * 父类型 */ private Long parentId; /** * 排序 */ private Integer sequence; /** * 销售平台 */ private String salePlatform; private Long shopId; private Long companyId; public Long getShopId() { return shopId; } public void setShopId(Long shopId) { this.shopId = shopId; } public Long getCompanyId() { return companyId; } public void setCompanyId(Long companyId) { this.companyId = companyId; } public String getId() { return id; } public void setId(String id) { this.id=id; } public String getName() { return name; } public void setName(String name) { this.name=name; } public Long getParentId() { return parentId; } public void setParentId(Long parentId) { this.parentId=parentId; } public Integer getSequence() { return sequence; } public void setSequence(Integer sequence) { this.sequence=sequence; } public String getSalePlatform() { return salePlatform; } public void setSalePlatform(String salePlatform) { this.salePlatform = salePlatform; } @Override public String toString() { return "ShoppingGoodsCategory [id=" + id + ", name=" + name + ", parentId=" + parentId + ", sequence=" + sequence + ", salePlatform=" + salePlatform + "]"; } } zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml
@@ -1255,6 +1255,13 @@ <if test="record.cateId!=null"> and a.cate_id in ( select b.id from shopping_goods_category b where (b.id=#{record.cateId} or b.parent_id=#{record.cateId})) </if> <if test="record.shopId != null and record.shopId !='' "> <![CDATA[ and ( a.shop_id = #{record.shopId} or ( a.headquarters=1 and ( ISNULL(a.use_shop) or LENGTH(trim(a.use_shop))<1 or FIND_IN_SET(#{record.shopId},a.use_shop))))]]> </if> <if test="record.goodType!=null"> and a.good_type=#{record.goodType} </if> <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> <if test="pageVo.sort !=null and pageVo.order !=null"> order by ${pageVo.sort} ${pageVo.order} @@ -1275,5 +1282,12 @@ <if test="record.cateId!=null"> and a.cate_id in ( select b.id from shopping_goods_category b where (b.id=#{record.cateId} or b.parent_id=#{record.cateId})) </if> <if test="record.shopId != null and record.shopId !='' "> <![CDATA[ and ( a.shop_id = #{record.shopId} or ( a.headquarters=1 and ( ISNULL(a.use_shop) or LENGTH(trim(a.use_shop))<1 or FIND_IN_SET(#{record.shopId},a.use_shop))))]]> </if> <if test="record.goodType!=null"> and a.good_type=#{record.goodType} </if> </select> </mapper>