renqianlong 1 year ago
parent
commit
caa13a4338

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/goods/bo/BsUserGoodsCollectionAddBo.java

@@ -32,7 +32,7 @@ public class BsUserGoodsCollectionAddBo {
     private Long companyId;
     /** 类型 */
     @ApiModelProperty("类型")
-    private Long type;
+    private Long goodsType;
     /** 状态 1有效 0无效 */
     @ApiModelProperty("状态 1有效 0无效")
     private Integer status;

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/goods/bo/BsUserGoodsCollectionEditBo.java

@@ -30,7 +30,7 @@ public class BsUserGoodsCollectionEditBo {
     private Long configId;
     /** 类型 */
     @ApiModelProperty("类型")
-    private Long type;
+    private Long goodsType;
     /** 用户id */
     @ApiModelProperty("用户id")
     private Long userId;

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/goods/bo/BsUserGoodsCollectionQueryBo.java

@@ -38,7 +38,7 @@ public class BsUserGoodsCollectionQueryBo extends BaseEntity {
 	private Long configId;
 	/** 类型 */
 	@ApiModelProperty("类型")
-	private Long type;
+	private Long goodsType;
 	/** 商品名称 */
 	private String goodsName;
 	/** 教育类型 */

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/goods/domain/BsUserGoodsCollection.java

@@ -47,7 +47,7 @@ private static final long serialVersionUID=1L;
     /** 状态 1有效 0无效 */
     private Integer status;
     /** 类型 */
-    private Long type;
+    private Long goodsType;
     /** 收藏状态 1有效 0无效 */
     private Integer collectStatus;
     /** 添加时间 */

+ 8 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/goods/service/impl/BsUserGoodsCollectionServiceImpl.java

@@ -89,7 +89,7 @@ public class BsUserGoodsCollectionServiceImpl extends ServiceImpl<BsUserGoodsCol
     public List<BsUserGoodsCollectionVo> queryList(BsUserGoodsCollectionQueryBo bo) {
         LambdaQueryWrapper<BsUserGoodsCollection> lqw = Wrappers.lambdaQuery();
         lqw.eq(bo.getGoodsId() != null, BsUserGoodsCollection::getGoodsId, bo.getGoodsId());
-        lqw.eq(bo.getType() != null, BsUserGoodsCollection::getType, bo.getType());
+        lqw.eq(bo.getGoodsType() != null, BsUserGoodsCollection::getGoodsType, bo.getGoodsType());
         lqw.eq(bo.getEducationType() != null, BsUserGoodsCollection::getEducationType, bo.getEducationType());
         lqw.eq(bo.getEducationName() != null, BsUserGoodsCollection::getEducationName, bo.getEducationName());
         lqw.eq(bo.getProjectId() != null, BsUserGoodsCollection::getProjectId, bo.getProjectId());
@@ -103,7 +103,9 @@ public class BsUserGoodsCollectionServiceImpl extends ServiceImpl<BsUserGoodsCol
         List<BsUserGoodsCollectionVo> bsUserGoodsCollectionVos = entity2Vo(this.list(lqw));
         bsUserGoodsCollectionVos.forEach(item -> {
             if (Validator.isNotEmpty(item.getConfigId())) {
-                item.setTypeName(getTypeName(item.getType()));
+                item.setTypeName(getTypeName(item.getGoodsType()));
+                OrderBusinessConfigVo orderBusinessConfigVo = iOrderBusinessConfigService.queryById(item.getConfigId());
+                item.setBusinessName(orderBusinessConfigVo.getBusinessName());
                 OrderBusinessConfigGoodsQueryBo orderBusinessConfigGoodsQueryBo = new OrderBusinessConfigGoodsQueryBo();
                 orderBusinessConfigGoodsQueryBo.setConfigId(item.getConfigId());
                 orderBusinessConfigGoodsQueryBo.setStatus(1);
@@ -167,7 +169,8 @@ public class BsUserGoodsCollectionServiceImpl extends ServiceImpl<BsUserGoodsCol
             }
             if(Validator.isNotEmpty(item.getGoodsId())){
                 GoodsVo goodsVo = iGoodsService.selectDetail(item.getGoodsId());
-                item.setTypeName(getTypeName(item.getType()));
+                item.setTypeName(getTypeName(item.getGoodsType()));
+                item.setBusinessName(goodsVo.getBusinessName());
                 item.setSubjectName(goodsVo.getSubjectNames());
                 item.setGoods(goodsVo.getGoodsName());
                 item.setYear(goodsVo.getYear().toString());
@@ -212,7 +215,7 @@ public class BsUserGoodsCollectionServiceImpl extends ServiceImpl<BsUserGoodsCol
             OrderBusinessConfigQueryBo orderBusinessConfigQueryBo = new OrderBusinessConfigQueryBo();
             orderBusinessConfigQueryBo.setId(bo.getConfigId());
             OrderBusinessConfigVo detail = iOrderBusinessConfigService.getDetail(orderBusinessConfigQueryBo);
-            add.setType(10L);
+            add.setGoodsType(10L);
             add.setGoodsName(detail.getConfigName());
             add.setEducationType(detail.getEducationType());
             add.setEducationName(detail.getEducationName());
@@ -235,7 +238,7 @@ public class BsUserGoodsCollectionServiceImpl extends ServiceImpl<BsUserGoodsCol
             List<CompanyGoodsVo> list = iGoodsService.selectBsGoodList(goodsQueryBo);
             if (Validator.isNotEmpty(list)) {
                 CompanyGoodsVo goods = list.get(0);
-                add.setType(goods.getGoodsType().longValue());
+                add.setGoodsType(goods.getGoodsType().longValue());
                 add.setGoodsName(goods.getGoodsName());
                 add.setEducationType(goods.getEducationTypeId());
                 add.setEducationName(goods.getEducationName());

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/goods/vo/BsUserGoodsCollectionVo.java

@@ -36,7 +36,7 @@ public class BsUserGoodsCollectionVo {
 	private Long companyId;
 	/** 类型 */
 	@ApiModelProperty("类型")
-	private Long type;
+	private Long goodsType;
 	private String typeName;
 	/** 用户id */
 	@Excel(name = "用户id")
@@ -53,6 +53,7 @@ public class BsUserGoodsCollectionVo {
 	private String mainImg;
 	private String goodsName;
 	private String educationName;
+	private String businessName;
 	private String projectName;
 	private String subjectName;
 	private String goods;

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/staff/mapper/StaffMapper.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.bs.staff.mapper;
 
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.zhongzheng.modules.bs.staff.bo.StaffQueryBo;
 import com.zhongzheng.modules.bs.staff.vo.StaffVo;
 import com.zhongzheng.modules.bs.staff.domain.Staff;

+ 21 - 8
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/staff/service/impl/StaffServiceImpl.java

@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.common.utils.poi.EasyPoiUtil;
 import com.zhongzheng.modules.bs.staff.bo.*;
 import com.zhongzheng.modules.bs.staff.domain.*;
@@ -34,7 +35,11 @@ import com.github.pagehelper.Page;
 import com.zhongzheng.modules.bs.staff.mapper.StaffMapper;
 import com.zhongzheng.modules.bs.staff.vo.StaffVo;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.context.request.RequestAttributes;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
 import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.servlet.mvc.condition.RequestConditionHolder;
 
 import java.util.*;
 import java.util.stream.Collectors;
@@ -247,6 +252,7 @@ public class StaffServiceImpl extends ServiceImpl<StaffMapper, Staff> implements
         if (ObjectUtil.isEmpty(staffIds)) {
             throw new CustomException("请先勾勾选数据");
         }
+
         for (Long id : staffIds) {
             Staff staff = this.baseMapper.selectById(id);
             staff.setStatus(0);
@@ -327,6 +333,7 @@ public class StaffServiceImpl extends ServiceImpl<StaffMapper, Staff> implements
     @Override
     public List<StaffVo> getMatchGoods(StaffQueryBo bo) {
         bo.setStatus(1);
+        bo.setCompanyId(Long.valueOf(ServletUtils.getRequest().getHeader("companyId")));
         List<StaffVo> staffVos = this.queryList(bo);
         if (ObjectUtil.isNotEmpty(bo.getConfigId())) {
             GoodsQueryBo goodsQueryBo = new GoodsQueryBo();
@@ -340,9 +347,11 @@ public class StaffServiceImpl extends ServiceImpl<StaffMapper, Staff> implements
                 CompanyOrderBusinessConfigGoodsVo companyGoodsVo = bsGoodsPackageList.get(0);
                 if (!staffVos.isEmpty()) {
                     staffVos.forEach(item -> {
-                        List<StaffEduBg> staffEduBgs = iStaffEduBgService.list(new LambdaQueryWrapper<StaffEduBg>().eq(StaffEduBg::getStaffId, item.getStaffId()).eq(StaffEduBg::getStatus, 1));
-                        item.setDegree(staffEduBgs.stream().map(StaffEduBg::getDegree).collect(Collectors.toList()).toString().replace("[","").replace("]",""));
-                        item.setCourseSubjectList(companyGoodsVo.getCourseSubjectList());
+                        List<StaffEduBg> staffEduBgs = iStaffEduBgService.list(new LambdaQueryWrapper<StaffEduBg>().eq(StaffEduBg::getStaffId, item.getStaffId()).eq(StaffEduBg::getStatus, 1).orderByDesc(StaffEduBg::getDegree).last("limit 1"));
+                        if(!staffEduBgs.isEmpty()){
+                            item.setDegree(staffEduBgs.stream().map(StaffEduBg::getDegree).collect(Collectors.toList()).toString().replace("[","").replace("]",""));
+                            item.setCourseSubjectList(companyGoodsVo.getCourseSubjectList());
+                        }
                     });
                 }
             }
@@ -611,17 +620,21 @@ public class StaffServiceImpl extends ServiceImpl<StaffMapper, Staff> implements
                         courseSubject.setGoodsName(goodsVo.getGoodsName());
                         courseSubject.setStandPrice(goodsVo.getStandPrice());
                         courseSubject.setGoodsTypeName(this.getGoodType(goodsVo.getGoodsType()));
-                        if (goodsVo.getSubjectNames().contains(item.getSubjectName())) {
-                            if (item.getYear().equals(goodsVo.getYear())) {
+                        if (Validator.isNotEmpty(goodsVo.getSubjectNames())){
+                            if (goodsVo.getSubjectNames().contains(item.getSubjectName())) {
                                 courseSubject.setSubjectName(item.getSubjectName());
-                                courseSubject.setYear(Long.valueOf(item.getYear()));
                                 courseSubjects.add(courseSubject);
                                 item.setCourseSubjectList(courseSubjects);
+                                if (Validator.isNotEmpty(item.getYear())){
+                                    if (item.getYear().equals(goodsVo.getYear())) {
+                                        courseSubject.setYear(Long.valueOf(item.getYear()));
+                                        courseSubjects.add(courseSubject);
+                                        item.setCourseSubjectList(courseSubjects);
+                                    }
+                                }
                             }else {
                                 item.setCourseSubjectList(null);
                             }
-                        }else {
-                            item.setCourseSubjectList(null);
                         }
                     }
                 }

+ 36 - 33
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -551,6 +551,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
             orderBusinessConfigQueryBo.setStatus(1);
             List<CompanyOrderBusinessConfigGoodsVo> orderBusinessConfigGoodsVos = iOrderBusinessConfigGoodsService.selectCompanyMergeList(orderBusinessConfigQueryBo);
             orderBusinessConfigGoodsVos.forEach(item -> {
+                item.setGoodsType(10L);
                 List<String> goodIds = Arrays.stream(item.getGoodsIds().split(",")).distinct().collect(Collectors.toList());
                 String goodsIds = goodIds.stream().collect(Collectors.joining(","));
                 item.setGoodsIds(goodsIds);
@@ -675,15 +676,16 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
     @Override
     public GoodsVo selectDetail(Long goodsId) {
         GoodsVo goodsVo = baseMapper.selectDetail(goodsId);
-        BsUserGoodsCollectionQueryBo bsUserGoodsCollection = new BsUserGoodsCollectionQueryBo();
-        bsUserGoodsCollection.setGoodsId(goodsId);
-        bsUserGoodsCollection.setStatus(1);
-        BsUserGoodsCollection bsUserGoodsCollectionVo = iBsUserGoodsCollectionService.selectById(bsUserGoodsCollection);
-        if (ObjectUtil.isEmpty(bsUserGoodsCollectionVo)) {
-            goodsVo.setCollectStatus(0);
-        } else {
-            goodsVo.setCollectStatus(bsUserGoodsCollectionVo.getCollectStatus());
-        }
+        if (ObjectUtil.isNotEmpty(goodsVo)){
+            BsUserGoodsCollectionQueryBo bsUserGoodsCollection = new BsUserGoodsCollectionQueryBo();
+            bsUserGoodsCollection.setGoodsId(goodsId);
+            bsUserGoodsCollection.setStatus(1);
+            BsUserGoodsCollection bsUserGoodsCollectionVo = iBsUserGoodsCollectionService.selectById(bsUserGoodsCollection);
+            if (ObjectUtil.isEmpty(bsUserGoodsCollectionVo)) {
+                goodsVo.setCollectStatus(0);
+            } else {
+                goodsVo.setCollectStatus(bsUserGoodsCollectionVo.getCollectStatus());
+            }
 //        if (ObjectUtils.isNull(goodsVo.getSpecTemplateId()) ||
 //                goodsSpecTemplateService.count(new LambdaQueryWrapper<GoodsSpecTemplate>()
 //                        .eq(GoodsSpecTemplate::getSpecTemplateId,goodsVo.getSpecTemplateId())
@@ -701,31 +703,32 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
 //                goodsVo.setSpecTemplateId(relation.getSpecTemplateId());
 //            }
 //        }
-        //多规格下的价格区间
-        if (ObjectUtils.isNotNull(goodsVo.getSpecTemplateId())) {
-            List<GoodsSpecAttributeRelation> list = goodsSpecAttributeRelationService
-                    .list(new LambdaQueryWrapper<GoodsSpecAttributeRelation>()
-                            .eq(GoodsSpecAttributeRelation::getSpecTemplateId, goodsVo.getSpecTemplateId()));
-            if (CollectionUtils.isNotEmpty(list)) {
-                List<Long> goodsIds = list.stream().filter(x -> ObjectUtils.isNotNull(x.getGoodsId())).map(GoodsSpecAttributeRelation::getGoodsId).collect(Collectors.toList());
-                List<Goods> goodsList = listByIds(goodsIds);
-                //从小到大排序
-                List<Goods> collect = goodsList.stream().filter(x -> ObjectUtils.isNotNull(x.getStandPrice())).sorted(Comparator.comparing(Goods::getStandPrice)).collect(Collectors.toList());
-                goodsVo.setMinPrice(collect.get(0).getStandPrice());
-                goodsVo.setMaxPrice(collect.get(collect.size() - 1).getStandPrice());
-            }
-        }
-        CourseBusinessQueryBo queryBo = new CourseBusinessQueryBo();
-        queryBo.setId(goodsVo.getBusinessId());
-        String fullName = iCourseBusinessService.queryFullName(queryBo);
-        goodsVo.setErJianErZao(false);
-        goodsVo.setJjShiGongYuan(false);
-        if (Validator.isNotEmpty(fullName)) {
-            if (fullName.equals("继续教育二级建造师") || fullName.equals("继续教育二级造价师")) {
-                goodsVo.setErJianErZao(true);
+            //多规格下的价格区间
+            if (ObjectUtils.isNotNull(goodsVo.getSpecTemplateId())) {
+                List<GoodsSpecAttributeRelation> list = goodsSpecAttributeRelationService
+                        .list(new LambdaQueryWrapper<GoodsSpecAttributeRelation>()
+                                .eq(GoodsSpecAttributeRelation::getSpecTemplateId, goodsVo.getSpecTemplateId()));
+                if (CollectionUtils.isNotEmpty(list)) {
+                    List<Long> goodsIds = list.stream().filter(x -> ObjectUtils.isNotNull(x.getGoodsId())).map(GoodsSpecAttributeRelation::getGoodsId).collect(Collectors.toList());
+                    List<Goods> goodsList = listByIds(goodsIds);
+                    //从小到大排序
+                    List<Goods> collect = goodsList.stream().filter(x -> ObjectUtils.isNotNull(x.getStandPrice())).sorted(Comparator.comparing(Goods::getStandPrice)).collect(Collectors.toList());
+                    goodsVo.setMinPrice(collect.get(0).getStandPrice());
+                    goodsVo.setMaxPrice(collect.get(collect.size() - 1).getStandPrice());
+                }
             }
-            if (fullName.contains("继续教育") && fullName.contains("施工现场专业人员")) {
-                goodsVo.setJjShiGongYuan(true);
+            CourseBusinessQueryBo queryBo = new CourseBusinessQueryBo();
+            queryBo.setId(goodsVo.getBusinessId());
+            String fullName = iCourseBusinessService.queryFullName(queryBo);
+            goodsVo.setErJianErZao(false);
+            goodsVo.setJjShiGongYuan(false);
+            if (Validator.isNotEmpty(fullName)) {
+                if (fullName.equals("继续教育二级建造师") || fullName.equals("继续教育二级造价师")) {
+                    goodsVo.setErJianErZao(true);
+                }
+                if (fullName.contains("继续教育") && fullName.contains("施工现场专业人员")) {
+                    goodsVo.setJjShiGongYuan(true);
+                }
             }
         }
         return goodsVo;

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/CompanyOrderBusinessConfigGoodsVo.java

@@ -32,6 +32,10 @@ public class CompanyOrderBusinessConfigGoodsVo {
 	@Excel(name = "业务层次配置id")
 	@ApiModelProperty("业务层次配置id")
 	private Long configId;
+	/** 业务层次配置id */
+	@Excel(name = "商品类型")
+	@ApiModelProperty("商品类型")
+	private Long goodsType;
 	/** 科目ID */
 	@Excel(name = "科目ID")
 	@ApiModelProperty("科目ID")

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserSubscribeImport.java

@@ -90,4 +90,7 @@ public class UserSubscribeImport {
 
 	@Excel(name = "失败原因")
 	private String cause;
+
+	@Excel(name = "是否补考学员(是/否)")
+	private String studentType;
 }

+ 1 - 0
zhongzheng-system/src/main/resources/mapper/modules/goods/BsUserGoodsCollectionMapper.xml

@@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="createTime" column="create_time"/>
         <result property="updateTime" column="update_time"/>
         <result property="goodsName" column="goods_name"/>
+        <result property="goodsType" column="goods_type"/>
         <result property="educationType" column="education_type"/>
         <result property="educationName" column="education_name"/>
         <result property="projectId" column="project_id"/>