Browse Source

sku列表查询调整

v1.0
Yen 2 years ago
parent
commit
53462b232a
  1. 4
      src/main/java/com/qs/serve/modules/goods/controller/GoodsSkuController.java
  2. 16
      src/main/java/com/qs/serve/modules/goods/entity/GoodsSku.java
  3. 1
      src/main/java/com/qs/serve/modules/oms/entity/OmsOrder.java
  4. 1
      src/main/java/com/qs/serve/modules/oms/entity/bo/CreateOrderParam.java
  5. 10
      src/main/java/com/qs/serve/modules/oms/service/impl/OmsOrderServiceImpl.java
  6. 1
      src/main/java/com/qs/serve/modules/tbs/service/impl/TbsScheduleItemBudgetServiceImpl.java
  7. 19
      src/main/resources/mapper/goods/GoodsSkuMapper.xml

4
src/main/java/com/qs/serve/modules/goods/controller/GoodsSkuController.java

@ -74,8 +74,8 @@ public class GoodsSkuController {
Random rd = new Random(); Random rd = new Random();
for (GoodSkuVo goodSkuVo : list) { for (GoodSkuVo goodSkuVo : list) {
goodSkuVo.setStock(rd.nextInt(3)); goodSkuVo.setStock(rd.nextInt(3));
List<GoodsSkuSpecValueVo> skuSpecValueVos = goodsSkuSpecValueService.listSpecValueBySkuId(goodSkuVo.getId()); // List<GoodsSkuSpecValueVo> skuSpecValueVos = goodsSkuSpecValueService.listSpecValueBySkuId(goodSkuVo.getId());
goodSkuVo.setSpecValueList(skuSpecValueVos); // goodSkuVo.setSpecValueList(skuSpecValueVos);
} }
return R.ok(list); return R.ok(list);
} }

16
src/main/java/com/qs/serve/modules/goods/entity/GoodsSku.java

@ -156,5 +156,21 @@ public class GoodsSku implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private Integer qty; private Integer qty;
/**
* 品牌
*/
@TableField(exist = false)
private String brandName;
/**
* 分类
*/
@TableField(exist = false)
private String categoryName;
/**
* 系列
*/
@TableField(exist = false)
private String seriesName;
} }

1
src/main/java/com/qs/serve/modules/oms/entity/OmsOrder.java

@ -80,6 +80,7 @@ public class OmsOrder implements Serializable {
@NotNull(message = "品牌ID不能为空") @NotNull(message = "品牌ID不能为空")
private Long brandRuleId; private Long brandRuleId;
@TableField(condition = SqlCondition.LIKE)
private String brandRuleName; private String brandRuleName;
/** 制单人id */ /** 制单人id */

1
src/main/java/com/qs/serve/modules/oms/entity/bo/CreateOrderParam.java

@ -14,4 +14,5 @@ public class CreateOrderParam{
/** 备注 */ /** 备注 */
private String remark; private String remark;
} }

10
src/main/java/com/qs/serve/modules/oms/service/impl/OmsOrderServiceImpl.java

@ -232,7 +232,9 @@ public class OmsOrderServiceImpl extends ServiceImpl<OmsOrderMapper,OmsOrder> im
order.setSupplierAddrId(param.getSupplierAddrId()); order.setSupplierAddrId(param.getSupplierAddrId());
GoodsCategoryRule categoryRule = goodsCategoryRuleMapper.selectById(param.getBrandRuleId()); GoodsCategoryRule categoryRule = goodsCategoryRuleMapper.selectById(param.getBrandRuleId());
order.setBrandRuleId(param.getBrandRuleId()); order.setBrandRuleId(param.getBrandRuleId());
order.setBrandRuleName(categoryRule.getLabel()); if(categoryRule!=null){
order.setBrandRuleName(categoryRule.getLabel());
}
if(param.getSupplierId()!=null && !param.getSupplierId().equals(order.getSupplierId())){ if(param.getSupplierId()!=null && !param.getSupplierId().equals(order.getSupplierId())){
BmsSupplier supplier = bmsSupplierMapper.selectById(param.getSupplierId()); BmsSupplier supplier = bmsSupplierMapper.selectById(param.getSupplierId());
order.setSupplierId(param.getSupplierId()); order.setSupplierId(param.getSupplierId());
@ -368,8 +370,10 @@ public class OmsOrderServiceImpl extends ServiceImpl<OmsOrderMapper,OmsOrder> im
order.setLatitudeFrom(confirmOrder.getLatitudeFrom().toLowerCase(Locale.ROOT)); order.setLatitudeFrom(confirmOrder.getLatitudeFrom().toLowerCase(Locale.ROOT));
order.setOrderSn("SN"+CodeGenUtil.generate(CodeGenUtil.SourceKey.OmsOrder)); order.setOrderSn("SN"+CodeGenUtil.generate(CodeGenUtil.SourceKey.OmsOrder));
GoodsCategoryRule categoryRule = goodsCategoryRuleMapper.selectById(order.getBrandRuleId()); GoodsCategoryRule categoryRule = goodsCategoryRuleMapper.selectById(confirmOrder.getBrandRuleId());
order.setBrandRuleName(categoryRule.getLabel()); if(categoryRule!=null){
order.setBrandRuleName(categoryRule.getLabel());
}
order.setOrderType(confirmOrder.getOrderType()); order.setOrderType(confirmOrder.getOrderType());
order.setSupplierId(Long.parseLong(supplier.getId())); order.setSupplierId(Long.parseLong(supplier.getId()));

1
src/main/java/com/qs/serve/modules/tbs/service/impl/TbsScheduleItemBudgetServiceImpl.java

@ -37,6 +37,7 @@ public class TbsScheduleItemBudgetServiceImpl extends ServiceImpl<TbsScheduleIte
//初始化金额 //初始化金额
List<TbsScheduleItemBudget> scheduleItemBudgetList = this.list(lqw); List<TbsScheduleItemBudget> scheduleItemBudgetList = this.list(lqw);
List<Long> ids = scheduleItemBudgetList.stream().map(TbsScheduleItemBudget::getId).collect(Collectors.toList()); List<Long> ids = scheduleItemBudgetList.stream().map(TbsScheduleItemBudget::getId).collect(Collectors.toList());
ids.add(0L);
List<TbsBudgetLogWithAmount> amountList = this.baseMapper.getSumAmtInList(ids,Arrays.asList(0,2,3)); List<TbsBudgetLogWithAmount> amountList = this.baseMapper.getSumAmtInList(ids,Arrays.asList(0,2,3));
for (TbsScheduleItemBudget itemBudget : scheduleItemBudgetList) { for (TbsScheduleItemBudget itemBudget : scheduleItemBudgetList) {
for (TbsBudgetLogWithAmount withAmount : amountList) { for (TbsBudgetLogWithAmount withAmount : amountList) {

19
src/main/resources/mapper/goods/GoodsSkuMapper.xml

@ -71,6 +71,7 @@
SELECT <include refid="goodsSkuSql"/> FROM `goods_sku` `goods_sku` SELECT <include refid="goodsSkuSql"/> FROM `goods_sku` `goods_sku`
<where> <where>
<if test="query.id != null"> and `goods_sku`.`id` = #{query.id}</if> <if test="query.id != null"> and `goods_sku`.`id` = #{query.id}</if>
<if test="query.skuName != null and query.skuName != ''"> and `goods_sku`.`sku_name` = #{query.skuName}</if>
<if test="query.skuCode != null and query.skuCode != ''"> and `goods_sku`.`sku_code` = #{query.skuCode}</if> <if test="query.skuCode != null and query.skuCode != ''"> and `goods_sku`.`sku_code` = #{query.skuCode}</if>
<if test="query.spuId != null"> and `goods_sku`.`spu_id` = #{query.spuId}</if> <if test="query.spuId != null"> and `goods_sku`.`spu_id` = #{query.spuId}</if>
<if test="query.salesPrice != null"> and `goods_sku`.`sales_price` = #{query.salesPrice}</if> <if test="query.salesPrice != null"> and `goods_sku`.`sales_price` = #{query.salesPrice}</if>
@ -106,21 +107,28 @@
`goods_spu`.`name`, `goods_spu`.`name`,
`goods_spu`.`spu_code`, `goods_spu`.`spu_code`,
`goods_spu`.`shelf`, `goods_spu`.`shelf`,
cate1.`name` as brandName,
cate2.`name` as categoryName,
cate3.`name` as seriesName,
<include refid="goodsSkuSql"/> <include refid="goodsSkuSql"/>
FROM `goods_sku` `goods_sku` FROM `goods_sku` `goods_sku`
LEFT JOIN `goods_spu` ON `goods_sku`.`spu_id` = `goods_spu`.id LEFT JOIN `goods_spu` ON `goods_sku`.`spu_id` = `goods_spu`.id
left join goods_category cate1 on goods_spu.category_first = cate1.id
left join goods_category cate2 on goods_spu.category_second = cate2.id
left join goods_category cate3 on goods_spu.category_third = cate3.id
<where> <where>
and `goods_sku`.`del_flag` = 0 and `goods_sku`.`del_flag` = 0
and `goods_spu`.`del_flag` = 0 and `goods_spu`.`del_flag` = 0
<if test="query.id != null"> and `goods_sku`.`id` = #{query.id}</if> <if test="query.id != null"> and `goods_sku`.`id` = #{query.id}</if>
<if test="query.skuCode != null and query.skuCode != ''"> and `goods_sku`.`sku_code` = #{query.skuCode}</if> <if test="query.skuCode != null and query.skuCode != ''"> and `goods_sku`.`sku_code` like concat('%',#{query.skuCode},'%') </if>
<if test="query.skuName != null and query.skuName != ''"> and `goods_sku`.`sku_name` like concat('%',#{query.skuName},'%') </if>
<if test="query.spuId != null"> and `goods_sku`.`spu_id` = #{query.spuId}</if> <if test="query.spuId != null"> and `goods_sku`.`spu_id` = #{query.spuId}</if>
<if test="query.salesPrice != null"> and `goods_sku`.`sales_price` = #{query.salesPrice}</if> <if test="query.salesPrice != null"> and `goods_sku`.`sales_price` = #{query.salesPrice}</if>
<if test="query.marketPrice != null"> and `goods_sku`.`market_price` = #{query.marketPrice}</if> <if test="query.marketPrice != null"> and `goods_sku`.`market_price` = #{query.marketPrice}</if>
<if test="query.costPrice != null"> and `goods_sku`.`cost_price` = #{query.costPrice}</if> <if test="query.costPrice != null"> and `goods_sku`.`cost_price` = #{query.costPrice}</if>
<if test="query.specInfos != null and query.specInfos != ''"> and `goods_sku`.`spec_infos` = #{query.specInfos}</if> <if test="query.specInfos != null and query.specInfos != ''"> and `goods_sku`.`spec_infos` like concat('%',#{query.specInfos},'%') </if>
<if test="query.stock != null"> and `goods_sku`.`stock` = #{query.stock}</if> <if test="query.stock != null"> and `goods_sku`.`stock` = #{query.stock}</if>
<if test="query.belong != null"> and `goods_sku`.`belong` = #{query.belong}</if> <if test="query.belong != null"> and `goods_sku`.`belong` like concat('%',#{query.belong},'%') </if>
<if test="query.unitId != null"> and `goods_sku`.`unit_id` = #{query.unitId}</if> <if test="query.unitId != null"> and `goods_sku`.`unit_id` = #{query.unitId}</if>
<if test="query.unitName != null and query.unitName != ''"> and `goods_sku`.`unit_name` = #{query.unitName}</if> <if test="query.unitName != null and query.unitName != ''"> and `goods_sku`.`unit_name` = #{query.unitName}</if>
<if test="query.weight != null"> and `goods_sku`.`weight` = #{query.weight}</if> <if test="query.weight != null"> and `goods_sku`.`weight` = #{query.weight}</if>
@ -145,6 +153,11 @@
<if test="query.specialFlag != null"> and `goods_sku`.`special_flag` = #{query.specialFlag}</if> <if test="query.specialFlag != null"> and `goods_sku`.`special_flag` = #{query.specialFlag}</if>
<if test="query.orderFlag != null"> and `goods_sku`.`order_flag` = #{query.orderFlag}</if> <if test="query.orderFlag != null"> and `goods_sku`.`order_flag` = #{query.orderFlag}</if>
<if test="query.brandName != null and query.brandName != ''"> and `cate1`.`name` like concat('%',#{query.brandName},'%') </if>
<if test="query.categoryName != null and query.categoryName != ''"> and `cate2`.`name` like concat('%',#{query.categoryName},'%') </if>
<if test="query.seriesName != null and query.seriesName != ''"> and `cate3`.`name` like concat('%',#{query.seriesName},'%') </if>
</where> </where>
ORDER BY `goods_sku`.`create_time` DESC ORDER BY `goods_sku`.`create_time` DESC
</select> </select>

Loading…
Cancel
Save