Browse Source

特殊品查询

v1.0
Yen 2 years ago
parent
commit
0cfbf74bcf
  1. 1
      src/main/java/com/qs/serve/modules/biz/entity/BizUserGroup.java
  2. 2
      src/main/java/com/qs/serve/modules/biz/entity/BizUserGroupItem.java
  3. 2
      src/main/java/com/qs/serve/modules/bms/entity/vo/BmsSubjectTreeVo.java
  4. 7
      src/main/java/com/qs/serve/modules/bms/service/impl/BmsSupplierServiceImpl.java
  5. 2
      src/main/java/com/qs/serve/modules/goods/service/impl/GoodsSkuServiceImpl.java
  6. 6
      src/main/java/com/qs/serve/modules/oms/service/impl/OmsOrderServiceImpl.java
  7. 6
      src/main/java/com/qs/serve/modules/sys/service/impl/SysDeleteLogServiceImpl.java
  8. 3
      src/main/java/com/qs/serve/modules/tbs/service/impl/TbsCostApplyPart1ServiceImpl.java
  9. 10
      src/main/java/com/qs/serve/modules/tbs/service/impl/TbsCostApplyServiceImpl.java
  10. 4
      src/main/java/com/qs/serve/modules/tzc/controller/TzcPolicyItemController.java
  11. 19
      src/main/resources/mapper/goods/GoodsSpuMapper.xml

1
src/main/java/com/qs/serve/modules/biz/entity/BizUserGroup.java

@ -34,6 +34,7 @@ public class BizUserGroup implements Serializable {
/** 分组名称 */ /** 分组名称 */
@Length(max = 255,message = "分组名称长度不能超过255字") @Length(max = 255,message = "分组名称长度不能超过255字")
@TableField(condition = SqlCondition.LIKE)
private String groupName; private String groupName;
/** 用户ID */ /** 用户ID */

2
src/main/java/com/qs/serve/modules/biz/entity/BizUserGroupItem.java

@ -44,10 +44,12 @@ public class BizUserGroupItem implements Serializable {
/** 目标 */ /** 目标 */
@Length(max = 255,message = "目标长度不能超过255字") @Length(max = 255,message = "目标长度不能超过255字")
@TableField(condition = SqlCondition.LIKE)
private String targetName; private String targetName;
/** 目标编码 */ /** 目标编码 */
@Length(max = 255,message = "目标编码长度不能超过255字") @Length(max = 255,message = "目标编码长度不能超过255字")
@TableField(condition = SqlCondition.LIKE)
private String targetCode; private String targetCode;
/** 备注 */ /** 备注 */

2
src/main/java/com/qs/serve/modules/bms/entity/vo/BmsSubjectTreeVo.java

@ -38,6 +38,8 @@ public class BmsSubjectTreeVo extends TreeNode {
/** 行政区域:0全部可见;1-部分可见;2-全部不可见 */ /** 行政区域:0全部可见;1-部分可见;2-全部不可见 */
private Integer bizRegionFlag; private Integer bizRegionFlag;
private Integer level;
/** 备注 */ /** 备注 */
@Length(max = 255,message = "备注长度不能超过255字") @Length(max = 255,message = "备注长度不能超过255字")
private String remark; private String remark;

7
src/main/java/com/qs/serve/modules/bms/service/impl/BmsSupplierServiceImpl.java

@ -54,6 +54,13 @@ public class BmsSupplierServiceImpl extends ServiceImpl<BmsSupplierMapper,BmsSup
BmsSupplier dbSupplier = this.getById(param.getId()); BmsSupplier dbSupplier = this.getById(param.getId());
orgSaleRegionId = dbSupplier.getRegionLast(); orgSaleRegionId = dbSupplier.getRegionLast();
orgBizRegionId = dbSupplier.getRegion2Last(); orgBizRegionId = dbSupplier.getRegion2Last();
}else if(StringUtils.hasText(param.getCode())){
LambdaQueryWrapper<BmsSupplier> checkCode = new LambdaQueryWrapper<>();
checkCode.eq(BmsSupplier::getCode,param.getCode());
long count = baseMapper.selectCount(checkCode);
if(count>0){
Assert.throwEx("编码重复");
}
} }
if(StringUtils.hasText(param.getMgrId())){ if(StringUtils.hasText(param.getMgrId())){
SysUser sysUser = sysUserService.getById(param.getMgrId()); SysUser sysUser = sysUserService.getById(param.getMgrId());

2
src/main/java/com/qs/serve/modules/goods/service/impl/GoodsSkuServiceImpl.java

@ -242,7 +242,9 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper,GoodsSku> im
if(dbGoodSku!=null){ if(dbGoodSku!=null){
skuCheckLqw.ne(GoodsSku::getId,dbGoodSku.getId()); skuCheckLqw.ne(GoodsSku::getId,dbGoodSku.getId());
} }
skuCheckLqw.eq(GoodsSku::getSpuId,goodSkuVo.getSpuId());
skuCheckLqw.eq(GoodsSku::getBelong,goodSkuVo.getBelong()); skuCheckLqw.eq(GoodsSku::getBelong,goodSkuVo.getBelong());
skuCheckLqw.eq(GoodsSku::getSpecialFlag,0);
skuCheckLqw.eq(GoodsSku::getOrderFlag,1); skuCheckLqw.eq(GoodsSku::getOrderFlag,1);
if(this.count(skuCheckLqw)>0){ if(this.count(skuCheckLqw)>0){
Assert.throwEx("下单的产地需唯一"); Assert.throwEx("下单的产地需唯一");

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

@ -237,12 +237,12 @@ public class OmsOrderServiceImpl extends ServiceImpl<OmsOrderMapper,OmsOrder> im
order.setSupplierName(supplier.getSupplierName()); order.setSupplierName(supplier.getSupplierName());
order.setSupplierCode(supplier.getSupplierCode()); order.setSupplierCode(supplier.getSupplierCode());
} }
if(StringUtils.hasText(param.getUserId())){ //if(StringUtils.hasText(param.getUserId())){
SysUser sysUser = sysUserService.getById(param.getUserId()); SysUser sysUser = sysUserService.getById(AuthContextUtils.getSysUserId());
order.setUserId(param.getUserId()); order.setUserId(param.getUserId());
order.setUserPhone(sysUser.getMobile()); order.setUserPhone(sysUser.getMobile());
order.setUserCode(sysUser.getCode()); order.setUserCode(sysUser.getCode());
} //}
order.setBillType(param.getBillType()); order.setBillType(param.getBillType());
order.setUrgentFlag(param.getUrgentFlag()); order.setUrgentFlag(param.getUrgentFlag());
order.setRemark(param.getRemark()); order.setRemark(param.getRemark());

6
src/main/java/com/qs/serve/modules/sys/service/impl/SysDeleteLogServiceImpl.java

@ -85,9 +85,9 @@ public class SysDeleteLogServiceImpl extends ServiceImpl<SysDeleteLogMapper,SysD
tbsCostApplyRemoveMapper.tbs_budget_cost_item(costApplyId); tbsCostApplyRemoveMapper.tbs_budget_cost_item(costApplyId);
tbsCostApplyRemoveMapper.tbs_budget_cost_item_split(costApplyId); tbsCostApplyRemoveMapper.tbs_budget_cost_item_split(costApplyId);
tbsCostApplyRemoveMapper.vtb_fund_flow(costApplyId); tbsCostApplyRemoveMapper.vtb_fund_flow(costApplyId);
tbsCostApplyRemoveMapper.bir_activity_center_goods(costApplyId); //tbsCostApplyRemoveMapper.bir_activity_center_goods(costApplyId);
tbsCostApplyRemoveMapper.bir_base_activity(costApplyId); //tbsCostApplyRemoveMapper.bir_base_activity(costApplyId);
tbsCostApplyRemoveMapper.bir_payment_item(costApplyId); //tbsCostApplyRemoveMapper.bir_payment_item(costApplyId);
tbsCostApplyRemoveMapper.vtb_verification_subject(costApplyId); tbsCostApplyRemoveMapper.vtb_verification_subject(costApplyId);
tbsCostApplyRemoveMapper.vtb_verification_yard_item(costApplyId); tbsCostApplyRemoveMapper.vtb_verification_yard_item(costApplyId);
tbsCostApplyRemoveMapper.vtb_verification_yard_center_item(costApplyId); tbsCostApplyRemoveMapper.vtb_verification_yard_center_item(costApplyId);

3
src/main/java/com/qs/serve/modules/tbs/service/impl/TbsCostApplyPart1ServiceImpl.java

@ -64,6 +64,9 @@ public class TbsCostApplyPart1ServiceImpl implements TbsCostApplyPart1Service {
final String newCostApplyCode = CodeGenUtil.generate(CodeGenUtil.SourceKey.CostApply); final String newCostApplyCode = CodeGenUtil.generate(CodeGenUtil.SourceKey.CostApply);
TbsCostApply costApply = tbsCostApplyService.getById(costId); TbsCostApply costApply = tbsCostApplyService.getById(costId);
costApply.setId(null); costApply.setId(null);
costApply.setUserId(null);
costApply.setUserCode(null);
costApply.setUserName(null);
costApply.setCode(newCostApplyCode); costApply.setCode(newCostApplyCode);
costApply.setCreateBy(null); costApply.setCreateBy(null);
costApply.setCreateTime(null); costApply.setCreateTime(null);

10
src/main/java/com/qs/serve/modules/tbs/service/impl/TbsCostApplyServiceImpl.java

@ -179,13 +179,9 @@ public class TbsCostApplyServiceImpl extends ServiceImpl<TbsCostApplyMapper,TbsC
rmLogLqw.eq(TbsBudgetLog::getCostApplyId,id); rmLogLqw.eq(TbsBudgetLog::getCostApplyId,id);
budgetLogService.remove(rmLogLqw); budgetLogService.remove(rmLogLqw);
//删除BIR //删除BIR
LambdaQueryWrapper<BirActivityCenterGoods> birActivityCenterGoodsLqw = new LambdaQueryWrapper<>(); // LambdaQueryWrapper<BirActivityCenterGoods> birActivityCenterGoodsLqw = new LambdaQueryWrapper<>();
birActivityCenterGoodsLqw.eq(BirActivityCenterGoods::getCostApplyId,id); // birActivityCenterGoodsLqw.eq(BirActivityCenterGoods::getCostApplyId,id);
birActivityCenterGoodsMapper.delete(birActivityCenterGoodsLqw); // birActivityCenterGoodsMapper.delete(birActivityCenterGoodsLqw);
LambdaQueryWrapper<BirBaseActivity> birBaseActivityLqw = new LambdaQueryWrapper<>();
birBaseActivityLqw.eq(BirBaseActivity::getCostApplyId,id);
birBaseActivityMapper.delete(birBaseActivityLqw);
//命中预算 //命中预算
budgetCostItemService.removeByCostApplyId(id); budgetCostItemService.removeByCostApplyId(id);

4
src/main/java/com/qs/serve/modules/tzc/controller/TzcPolicyItemController.java

@ -53,6 +53,10 @@ public class TzcPolicyItemController {
public R<List<TzcPolicyItem>> getList(TzcPolicyItem param){ public R<List<TzcPolicyItem>> getList(TzcPolicyItem param){
LambdaQueryWrapper<TzcPolicyItem> lqw = new LambdaQueryWrapper<>(param); LambdaQueryWrapper<TzcPolicyItem> lqw = new LambdaQueryWrapper<>(param);
List<TzcPolicyItem> list = tzcPolicyItemService.list(lqw); List<TzcPolicyItem> list = tzcPolicyItemService.list(lqw);
for (TzcPolicyItem policyItem : list) {
List<TzcPolicyGoods> policyGoodsList = tzcPolicyGoodsService.listByItemId(policyItem.getId());
policyItem.setPolicyGoodsList(policyGoodsList);
}
return R.ok(list); return R.ok(list);
} }

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

@ -67,14 +67,13 @@
<sql id="skuWherePart"> <sql id="skuWherePart">
<if test="query.belong != null"> and (`goods_sku`.`belong` = #{query.belong} or goods_sku.special_flag=1) </if> <if test="query.belong != null"> and (`goods_sku`.`belong` = #{query.belong} or goods_sku.special_flag=1) </if>
<if test="query.selectSpecialFlag != null and query.selectSpecialFlag == 1">
and `goods_sku`.`special_flag` = 1
and `goods_sku`.id = goods_spu.special_sku_id
</if>
<if test="query.selectSpecialFlag != null and query.selectSpecialFlag == 0"> <if test="query.selectSpecialFlag != null and query.selectSpecialFlag == 0">
and `goods_sku`.`special_flag` = 0 and `goods_sku`.`special_flag` = #{query.selectSpecialFlag}
</if>
<if test="query.orderFlag != null ">
and (`goods_sku`.`order_flag` = #{query.orderFlag} or `goods_sku`.`special_flag` = 1)
</if> </if>
<if test="query.orderFlag != null"> and `goods_sku`.`order_flag` = #{query.orderFlag}</if>
<if test="query.keyword != null and query.keyword != '' "> <if test="query.keyword != null and query.keyword != '' ">
and ( and (
@ -98,7 +97,9 @@
<if test="query.cateSecondLabel != null and query.cateSecondLabel != ''"> and `cate2`.`name` like concat('%',#{query.cateSecondLabel},'%') </if> <if test="query.cateSecondLabel != null and query.cateSecondLabel != ''"> and `cate2`.`name` like concat('%',#{query.cateSecondLabel},'%') </if>
<if test="query.cateThirdLabel != null and query.cateThirdLabel != ''"> and `cate3`.`name` like concat('%',#{query.cateThirdLabel},'%') </if> <if test="query.cateThirdLabel != null and query.cateThirdLabel != ''"> and `cate3`.`name` like concat('%',#{query.cateThirdLabel},'%') </if>
<if test="query.categoryLast != null"> and `goods_spu`.`category_last` = #{query.categoryLast}</if> <if test="query.categoryLast != null"> and `goods_spu`.`category_last` = #{query.categoryLast}</if>
<if test="query.shelf != null and query.shelf != ''"> and `goods_spu`.`shelf` = #{query.shelf}</if> <if test="query.shelf != null"> and `goods_spu`.`shelf` = #{query.shelf}</if>
<if test="query.costFlag != null"> and `goods_spu`.`cost_flag` = #{query.costFlag}</if>
<if test="query.orderFlag != null"> and `goods_spu`.`order_flag` = #{query.orderFlag}</if>
<if test="query.sort != null"> and `goods_spu`.`sort` = #{query.sort}</if> <if test="query.sort != null"> and `goods_spu`.`sort` = #{query.sort}</if>
<if test="query.saleNum != null"> and `goods_spu`.`sale_num` = #{query.saleNum}</if> <if test="query.saleNum != null"> and `goods_spu`.`sale_num` = #{query.saleNum}</if>
<if test="query.tasteValue != null and query.tasteValue != ''"> and `goods_spu`.`taste_value` like concat('%',#{query.tasteValue},'%') </if> <if test="query.tasteValue != null and query.tasteValue != ''"> and `goods_spu`.`taste_value` like concat('%',#{query.tasteValue},'%') </if>
@ -163,7 +164,7 @@
FROM ( FROM (
(SELECT sku.*,ROW_NUMBER() OVER(PARTITION BY sku.spu_id ORDER BY sku.belong_sort) AS rn FROM goods_sku sku WHERE sku.order_flag = 1 AND sku.special_flag = 0) (SELECT sku.*,ROW_NUMBER() OVER(PARTITION BY sku.spu_id ORDER BY sku.belong_sort) AS rn FROM goods_sku sku WHERE sku.order_flag = 1 AND sku.special_flag = 0)
UNION ALL UNION ALL
SELECT sku.*,1 as rn FROM goods_sku sku WHERE sku.order_flag = 1 AND sku.special_flag = 1 SELECT sku.*,1 as rn FROM goods_sku sku WHERE sku.special_flag = 1
) AS goods_sku ) AS 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 `cate1`.`id` = `goods_spu`.`category_first` LEFT JOIN `goods_category` `cate1` ON `cate1`.`id` = `goods_spu`.`category_first`
@ -183,7 +184,7 @@
FROM ( FROM (
(SELECT sku.*,ROW_NUMBER() OVER(PARTITION BY sku.spu_id ORDER BY sku.belong_sort) AS rn FROM goods_sku sku WHERE sku.order_flag = 1 AND sku.special_flag = 0) (SELECT sku.*,ROW_NUMBER() OVER(PARTITION BY sku.spu_id ORDER BY sku.belong_sort) AS rn FROM goods_sku sku WHERE sku.order_flag = 1 AND sku.special_flag = 0)
UNION ALL UNION ALL
SELECT sku.*,1 as rn FROM goods_sku sku WHERE sku.order_flag = 1 AND sku.special_flag = 1 SELECT sku.*,1 as rn FROM goods_sku sku WHERE sku.special_flag = 1
) AS goods_sku ) AS 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
<where> <where>

Loading…
Cancel
Save