Browse Source

opt: 多项调整

muti_db
Yen 8 months ago
parent
commit
a3482815f3
  1. 2
      src/main/java/com/qs/serve/common/model/dto/SimpleKeyValue.java
  2. 15
      src/main/java/com/qs/serve/controller/AdminPortalController.java
  3. 28
      src/main/java/com/qs/serve/modules/goods/controller/GoodsFeedbackController.java
  4. 33
      src/main/java/com/qs/serve/modules/goods/controller/GoodsImminentBatchController.java
  5. 2
      src/main/java/com/qs/serve/modules/goods/controller/api/GoodsImminentBatchApi.java
  6. 2
      src/main/java/com/qs/serve/modules/goods/entity/bo/GoodsFeedbackCheckBo.java
  7. 5
      src/main/java/com/qs/serve/modules/goods/entity/so/GoodsFeedbackQuery.java
  8. 12
      src/main/java/com/qs/serve/modules/goods/entity/so/GoodsImminentBatchQuery.java
  9. 2
      src/main/java/com/qs/serve/modules/goods/mapper/GoodsFeedbackMapper.java
  10. 5
      src/main/java/com/qs/serve/modules/oms/service/impl/OmsOrderServiceImpl.java
  11. 17
      src/main/java/com/qs/serve/modules/tzc/service/impl/TzcPolicyApplicationServiceImpl.java
  12. 6
      src/main/resources/mapper/goods/GoodsFeedbackMapper.xml
  13. 28
      src/main/resources/mapper/goods/GoodsImminentBatchMapper.xml

2
src/main/java/com/qs/serve/common/model/dto/SimpleKeyValue.java

@ -25,6 +25,8 @@ public class SimpleKeyValue<T> {
private String value2;
private String parentId;
/** 说明 */
private String remark;

15
src/main/java/com/qs/serve/controller/AdminPortalController.java

@ -10,6 +10,7 @@ import com.qs.serve.common.model.annotation.SysLog;
import com.qs.serve.common.model.consts.GySysConst;
import com.qs.serve.common.model.consts.RedisCacheKeys;
import com.qs.serve.common.model.dto.R;
import com.qs.serve.common.model.dto.SimpleKeyValue;
import com.qs.serve.common.model.enums.BizType;
import com.qs.serve.common.model.enums.SystemModule;
import com.qs.serve.common.util.*;
@ -20,12 +21,14 @@ import com.qs.serve.modules.bms.service.BmsSupplierAddressService;
import com.qs.serve.modules.goods.entity.GoodsCategory;
import com.qs.serve.modules.goods.entity.GoodsSku;
import com.qs.serve.modules.goods.entity.GoodsSpu;
import com.qs.serve.modules.goods.mapper.GoodsImminentBatchMapper;
import com.qs.serve.modules.goods.service.GoodsCategoryRuleService;
import com.qs.serve.modules.goods.service.GoodsCategoryService;
import com.qs.serve.modules.goods.service.GoodsSkuService;
import com.qs.serve.modules.goods.service.GoodsSpuService;
import com.qs.serve.modules.oms.entity.OmsOrder;
import com.qs.serve.modules.oms.entity.OmsOrderItem;
import com.qs.serve.modules.oms.mapper.OmsOrderMapper;
import com.qs.serve.modules.oms.service.OmsOrderItemService;
import com.qs.serve.modules.oms.service.OmsOrderService;
import com.qs.serve.modules.seeyon.entity.SyAffairStateResult;
@ -88,6 +91,8 @@ public class AdminPortalController {
private VtbVerificationBatchService verificationBatchService;
private TzcPolicyService policyService;
private TbsActivityService activityService;
private GoodsImminentBatchMapper goodsImminentBatchMapper;
private OmsOrderMapper omsOrderMapper;
private OmsOrderService omsOrderService;
private OmsOrderItemService omsOrderItemService;
@ -317,6 +322,12 @@ public class AdminPortalController {
if(omsOrder==null){return R.errorNotFound();}
omsOrder.setBrandRuleInfo(goodsCategoryRuleService.getById(omsOrder.getBrandRuleId()));
omsOrder.setAddressInfo(bmsSupplierAddressService.getById(omsOrder.getSupplierAddrId()));
// 关联折扣信息
if(StringUtils.hasText(omsOrder.getOaRateId())){
SimpleKeyValue obj = omsOrderMapper.getExpiredRateInfo(omsOrder.getOaRateId());
omsOrder.setDiscountRateInfo(obj);
}
if(omsOrder.getSupplierId().toString().equals(supplierId)){
LambdaQueryWrapper<OmsOrderItem> lqw = new LambdaQueryWrapper<>();
lqw.eq(OmsOrderItem::getOrderId,id);
@ -330,6 +341,10 @@ public class AdminPortalController {
if(goodsSku!=null){
orderItem.setSkuSpecialFlag(goodsSku.getSpecialFlag());
}
//临期品添加批次对象
if(omsOrder.getOrderType().equals(3)&&orderItem.getSkuBatchId()!=null){
orderItem.setBatchInfo(goodsImminentBatchMapper.selectById(orderItem.getSkuBatchId()));
}
}
omsOrder.setOrderItems(list);
return R.ok(omsOrder);

28
src/main/java/com/qs/serve/modules/goods/controller/GoodsFeedbackController.java

@ -2,6 +2,7 @@ package com.qs.serve.modules.goods.controller;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageHelper;
import com.qs.serve.common.model.annotation.SysLog;
import com.qs.serve.common.model.dto.PageVo;
import com.qs.serve.common.model.dto.R;
@ -77,6 +78,8 @@ public class GoodsFeedbackController {
SimpleKeyValue<String> current = roots.computeIfAbsent(parts[0], k -> {
SimpleKeyValue<String> root = new SimpleKeyValue<String>();
root.setValue( k );
root.setLabel( k );
root.setParentId("0");
return root;
});
for (int i = 1; i < parts.length; i++) {
@ -87,7 +90,7 @@ public class GoodsFeedbackController {
}
public SimpleKeyValue<String> findOrCreateChild(SimpleKeyValue<String> parent, String[] values,int idx) {
String finalValue = parent.getValue() + values[idx];
String finalValue = values[idx];
for (SimpleKeyValue<String> child : parent.getChildList()) {
if (child.getValue().equals(finalValue)) {
return child;
@ -95,6 +98,8 @@ public class GoodsFeedbackController {
}
SimpleKeyValue newChild = new SimpleKeyValue();
newChild.setValue(finalValue);
newChild.setLabel(finalValue);
newChild.setParentId(parent.getValue());
parent.addChild(newChild);
return newChild;
}
@ -105,9 +110,9 @@ public class GoodsFeedbackController {
* @param param
* @return
*/
@GetMapping("/pageMy")
public R<PageVo<GoodsFeedbackVo>> getPageMy(GoodsFeedbackQuery param){
PageUtil.startPage();
@PostMapping("/pageMy")
public R<PageVo<GoodsFeedbackVo>> getPageMy(@RequestBody GoodsFeedbackQuery param){
PageHelper.startPage(param.getPageNum(),param.getPageSize());
param.setSelectUserIds(Arrays.asList(AuthContextUtils.getSysUserId()));
List<GoodsFeedbackVo> list = goodsFeedbackService.selectListVo(param);
return R.byPageHelperList(list);
@ -118,12 +123,12 @@ public class GoodsFeedbackController {
* @param param
* @return
*/
@GetMapping("/pageMyAndChild")
public R<PageVo<GoodsFeedbackVo>> getPageMyAndChild(GoodsFeedbackQuery param){
@PostMapping("/pageMyAndChild")
public R<PageVo<GoodsFeedbackVo>> getPageMyAndChild(@RequestBody GoodsFeedbackQuery param){
String userId = AuthContextUtils.getSysUserId();
List<String> userIds = postUserService.listByChildIds(userId);
userIds.add(userId);
PageUtil.startPage();
PageHelper.startPage(param.getPageNum(),param.getPageSize());
param.setSelectUserIds(userIds);
List<GoodsFeedbackVo> list = goodsFeedbackService.selectListVo(param);
return R.byPageHelperList(list);
@ -135,9 +140,9 @@ public class GoodsFeedbackController {
* @param param
* @return
*/
@GetMapping("/page")
public R<PageVo<GoodsFeedbackVo>> getPage(GoodsFeedbackQuery param){
PageUtil.startPage();
@PostMapping("/page")
public R<PageVo<GoodsFeedbackVo>> getPage(@RequestBody GoodsFeedbackQuery param){
PageHelper.startPage(param.getPageNum(),param.getPageSize());
List<GoodsFeedbackVo> list = goodsFeedbackService.selectListVo(param);
return R.byPageHelperList(list);
}
@ -202,9 +207,8 @@ public class GoodsFeedbackController {
@SysLog(module = SystemModule.GOODS, title = "问题反馈", biz = BizType.INSERT)
public R<?> check(@RequestBody @Valid GoodsFeedbackCheckBo param){
GoodsFeedback feedback = goodsFeedbackService.getById(param.getId());
feedback.setGoodsCheckRemark(param.getRemark());
feedback.setGoodsCheckRemark(param.getGoodsCheckRemark());
feedback.setGoodsCheckTime(LocalDateTime.now());
feedback.setGoodsCheckerId(AuthContextUtils.getSysUserId());
SysUser sysUser = sysUserService.getById(AuthContextUtils.getSysUserId());
feedback.setGoodsCheckerId(sysUser.getId());
feedback.setGoodsChecker(sysUser.getName());

33
src/main/java/com/qs/serve/modules/goods/controller/GoodsImminentBatchController.java

@ -1,16 +1,20 @@
package com.qs.serve.modules.goods.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qs.serve.common.config.DevEnvironmentConfig;
import com.qs.serve.common.model.annotation.SysLog;
import com.qs.serve.common.model.dto.PageVo;
import com.qs.serve.common.model.dto.R;
import com.qs.serve.common.model.enums.BizType;
import com.qs.serve.common.model.enums.SystemModule;
import com.qs.serve.common.util.PageUtil;
import com.qs.serve.common.util.CopierUtil;
import com.qs.serve.common.util.StringUtils;
import com.qs.serve.common.util.*;
import com.qs.serve.modules.bms.common.BookAccountUtil;
import com.qs.serve.modules.bms.entity.BmsSupplier;
import com.qs.serve.modules.goods.entity.GoodsCategoryRule;
import com.qs.serve.modules.goods.entity.GoodsSku;
import com.qs.serve.modules.goods.entity.bo.GoodsImminentBatchBo;
import com.qs.serve.modules.goods.entity.so.GoodsImminentBatchQuery;
import com.qs.serve.modules.goods.entity.vo.GoodsImminentBatchVo;
import com.qs.serve.modules.goods.service.GoodsSkuService;
import com.qs.serve.modules.oms.entity.OmsOrderItem;
import com.qs.serve.modules.oms.service.OmsOrderItemService;
@ -23,6 +27,7 @@ import com.qs.serve.modules.goods.entity.GoodsImminentBatch;
import com.qs.serve.modules.goods.service.GoodsImminentBatchService;
import javax.validation.Valid;
import java.util.Arrays;
import java.util.List;
/**
@ -45,13 +50,25 @@ public class GoodsImminentBatchController {
* @param param
* @return
*/
// @GetMapping("/page")
// public R<PageVo<GoodsImminentBatch>> getPage(GoodsImminentBatch param){
// LambdaQueryWrapper<GoodsImminentBatch> lqw = new LambdaQueryWrapper<>(param);
// PageUtil.startPage();
// List<GoodsImminentBatch> list = goodsImminentBatchService.list(lqw);
// list.forEach(a->a.setQuantity(a.getQuantity()-a.getOrderQuantity()));
// return R.byPageHelperList(list);
// }
@GetMapping("/page")
public R<PageVo<GoodsImminentBatch>> getPage(GoodsImminentBatch param){
LambdaQueryWrapper<GoodsImminentBatch> lqw = new LambdaQueryWrapper<>(param);
PageUtil.startPage();
List<GoodsImminentBatch> list = goodsImminentBatchService.list(lqw);
public R<PageVo<GoodsImminentBatchVo>> getPage(GoodsImminentBatchQuery param){
//客户规则设置
long total = goodsImminentBatchService.countVoList(param);
if(total<1){
return R.byEmptyList();
}
List<GoodsImminentBatchVo> list = goodsImminentBatchService.selectVoList(param);
list.forEach(a->a.setQuantity(a.getQuantity()-a.getOrderQuantity()));
return R.byPageHelperList(list);
return R.byPageList(total,list);
}
/**

2
src/main/java/com/qs/serve/modules/goods/controller/api/GoodsImminentBatchApi.java

@ -79,6 +79,8 @@ public class GoodsImminentBatchApi {
if(DevEnvironmentConfig.OPEN_TENANT_BOOK){
param.setBookCodeList(BookAccountUtil.getCurrentUserAccount());
}
// 过滤可下单的
param.setFilterFlag(1);
long total = goodsImminentBatchService.countVoList(param);
if(total<1){
return R.byEmptyList();

2
src/main/java/com/qs/serve/modules/goods/entity/bo/GoodsFeedbackCheckBo.java

@ -12,6 +12,6 @@ public class GoodsFeedbackCheckBo {
String id;
String remark;
String goodsCheckRemark;
}

5
src/main/java/com/qs/serve/modules/goods/entity/so/GoodsFeedbackQuery.java

@ -18,4 +18,9 @@ public class GoodsFeedbackQuery extends GoodsFeedback {
List<String> selectTypesIds;
List<String> feedbackTypeSelectNames;
private Integer pageNum;
private Integer pageSize;
}

12
src/main/java/com/qs/serve/modules/goods/entity/so/GoodsImminentBatchQuery.java

@ -19,6 +19,7 @@ public class GoodsImminentBatchQuery {
private String spuName;
private String spuCode;
private String skuAddCode;
private String batchCode;
/** 供应商编码 */
private String supplierCode;
@ -40,4 +41,15 @@ public class GoodsImminentBatchQuery {
private List<String> selectCateIds;
private List<String> selectNotIntCateIds;
/** 一级类目:品牌名称 */
private String cateFirstLabel;
/** 二级类目:类目名称 */
private String cateSecondLabel;
/** 三级类目:系列名称 */
private String cateThirdLabel;
/**
* 过滤可下单的
*/
private Integer filterFlag;
}

2
src/main/java/com/qs/serve/modules/goods/mapper/GoodsFeedbackMapper.java

@ -18,7 +18,7 @@ import java.util.List;
public interface GoodsFeedbackMapper extends BaseMapper<GoodsFeedback> {
@InterceptorIgnore(tenantLine = "1")
@Select("select feedback_type_names from goods_feedback where del_flag = 0 group by feedback_type_names")
@Select("select feedback_type_names from goods_feedback where del_flag = 0 and feedback_type_names is not null group by feedback_type_names")
List<String> selectHisTypes();
@InterceptorIgnore(tenantLine = "1")

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

@ -1089,7 +1089,10 @@ public class OmsOrderServiceImpl extends ServiceImpl<OmsOrderMapper, OmsOrder> i
//更新订单
omsOrder.setStatus(1);
omsOrder.setCheckTime(LocalDateTime.now());
omsOrder.setCheckUserId(AuthContextUtils.getSysUserId());
omsOrder.setCheckUserId(omsOrder.getCreateBy());
if(!omsOrder.getOrderType().equals(3)){
omsOrder.setCheckUserId(AuthContextUtils.getSysUserId());
}
this.updateById(omsOrder);
}

17
src/main/java/com/qs/serve/modules/tzc/service/impl/TzcPolicyApplicationServiceImpl.java

@ -40,10 +40,7 @@ import com.qs.serve.modules.tbs.common.util.TbsBudgetCostUtil;
import com.qs.serve.modules.tbs.common.util.TbsBudgetLogBuildUtil;
import com.qs.serve.modules.tbs.entity.*;
import com.qs.serve.modules.tbs.entity.bo.TbsAffairCommitBo;
import com.qs.serve.modules.tbs.entity.dto.TbsBudgetCostResult;
import com.qs.serve.modules.tbs.entity.dto.TbsBudgetItemCostResult;
import com.qs.serve.modules.tbs.entity.dto.TbsBudgetLogPreAmount;
import com.qs.serve.modules.tbs.entity.dto.TbsScheduleItemBudgetAmount;
import com.qs.serve.modules.tbs.entity.dto.*;
import com.qs.serve.modules.tbs.entity.vo.TbsBudgetTableVo;
import com.qs.serve.modules.tbs.mapper.TbsBudgetMapper;
import com.qs.serve.modules.tbs.mapper.TbsScheduleItemBudgetMapper;
@ -145,7 +142,7 @@ public class TzcPolicyApplicationServiceImpl implements TzcPolicyApplicationServ
log.error("获取SysConfig政策延迟时间异常: PolicyDelayDays");
}
}
LocalDate endDate = nowDate.plusDays(-7);
LocalDate endDate = nowDate.plusDays(- delayDays);
List<Long> ids = tzcPolicyMapper.listExpireItemIds(endDate);
for (Long id : ids) {
try {
@ -442,6 +439,16 @@ public class TzcPolicyApplicationServiceImpl implements TzcPolicyApplicationServ
data.put("exsp5",urlKey);
data.put("cmsLink",baseJumpUrl);
List<Object> subList = new ArrayList<>();
List<TzcPolicyItem> policyItemList = tzcPolicyItemService.listByPolicyId(policyId);
for (TzcPolicyItem policyItem : policyItemList) {
TbsCostSubItem.CostCenterTranStr costCenter = new TbsCostSubItem.CostCenterTranStr();
costCenter.setChengBenZhongXin(policyItem.getCenterName());
costCenter.setChengBenZhongXinId(policyItem.getCenterType()+"-"+policyItem.getId());
subList.add(costCenter);
}
data.put("sub",subList);
BaseCreateProcessBo createProcess = new BaseCreateProcessBo();
createProcess.setTemplateCode(TbsSeeYonConst.PolicyConf.Code());
createProcess.setMemberLoginName(sysUser.getSyAccount());

6
src/main/resources/mapper/goods/GoodsFeedbackMapper.xml

@ -117,6 +117,12 @@
and FIND_IN_SET(#{query.queryTypeName},`goods_feedback`.`feedback_type_names`)
</if>
<if test="query.feedbackTypeSelectNames!=null and query.feedbackTypeSelectNames.size > 0">
<foreach collection="query.feedbackTypeSelectNames" item ="selectVal" index="i" >
and FIND_IN_SET( #{selectVal} ,`goods_feedback`.`feedback_type_names`)
</foreach>
</if>
</where>
order by goods_feedback.id desc
</select>

28
src/main/resources/mapper/goods/GoodsImminentBatchMapper.xml

@ -39,11 +39,13 @@
LEFT JOIN `goods_category` `cate3` ON `cate3`.`id` = `goods_spu`.`category_third`
<where>
and goods_imminent_batch.del_flag = 0
and goods_imminent_batch.end_date &gt;= now()
and goods_sku.del_flag = 0
and goods_spu.del_flag = 0
and goods_sku.order_flag = 1
and goods_sku.`enable` = 1
<if test="query.filterFlag!=null and query.filterFlag == 1 ">
and goods_imminent_batch.end_date &gt;= now()
and goods_sku.order_flag = 1
and goods_sku.`enable` = 1
</if>
<include refid="spuWherePart"></include>
<include refid="skuWherePart"></include>
</where>
@ -66,11 +68,25 @@
LEFT JOIN `goods_category` `cate3` ON `cate3`.`id` = `goods_spu`.`category_third`
<where>
and goods_imminent_batch.del_flag = 0
and goods_imminent_batch.end_date &gt;= now()
and goods_sku.del_flag = 0
and goods_spu.del_flag = 0
and goods_sku.order_flag = 1
and goods_sku.`enable` = 1
<if test="query.batchCode!=null and query.batchCode != '' ">
and `goods_imminent_batch`.`batch_code` like concat('%',#{query.batchCode},'%')
</if>
<if test="query.cateFirstLabel!=null and query.cateFirstLabel != '' ">
and `cate1`.`name` like concat('%',#{query.cateFirstLabel},'%')
</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.filterFlag!=null and query.filterFlag == 1 ">
and goods_imminent_batch.end_date &gt;= now()
and goods_sku.order_flag = 1
and goods_sku.`enable` = 1
</if>
<include refid="spuWherePart"></include>
<include refid="skuWherePart"></include>
</where>

Loading…
Cancel
Save