he2802 1 year ago
parent
commit
006f2c6468

+ 1 - 2
run-prod.sh

@@ -1,5 +1,3 @@
-
-
 #!/usr/bin/env bash
 # 定义应用组名
 group_admin_name='zhongzheng'
@@ -34,3 +32,4 @@ docker run \
 -v /data/nginx/conf.d:/data/nginx/conf.d \
 -d ${group_admin_name}/${app_admin_name}:${app_admin_version}
 echo '----start container admin----'
+

+ 2 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseController.java

@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.type.EncryptHandler;
 import com.zhongzheng.common.utils.ServletUtils;
+import com.zhongzheng.framework.web.service.WxTokenService;
 import com.zhongzheng.modules.course.bo.*;
 import com.zhongzheng.modules.course.service.ICourseService;
 import com.zhongzheng.modules.course.vo.CourseVo;
@@ -59,6 +60,7 @@ public class CourseController extends BaseController {
     private final ICourseService iCourseService;
     private final IUserStudyRecordService iUserStudyRecordService;
     private final IUserService iUserService;
+    private final WxTokenService wxTokenService;
 
     /**
      * 查询课程列表

+ 10 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/course/CourseController.java

@@ -219,6 +219,16 @@ public class CourseController extends BaseController {
         return AjaxResult.success(iCourseService.getOldGoodsList(loginUser.getUser().getUserId()));
     }
 
+    /**
+     * 旧系统学员商品信息
+     */
+    @ApiOperation("旧系统学员商品信息")
+    @GetMapping("/old/goods/redirect")
+    public AjaxResult<UserNewGoodsVo> getOldGoodsRedirect() {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        return AjaxResult.success(iCourseService.getOldGoodsRedirect(loginUser.getUser().getUserId()));
+    }
+
 
     @ApiOperation("获取跳转用户Key")
     @GetMapping("/skipPort")

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseService.java

@@ -112,4 +112,6 @@ public interface ICourseService extends IService<Course> {
 	UserNewGoodsVo getOldGoodsList(Long userId);
 
     Map<String, String> getUserSkipPort(Long userId);
+
+	UserNewGoodsVo getOldGoodsRedirect(Long userId);
 }

+ 42 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -1184,6 +1184,48 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
         return map;
     }
 
+    @Override
+    public UserNewGoodsVo getOldGoodsRedirect(Long userId) {
+        UserNewGoodsVo vo = new UserNewGoodsVo();
+        User user = iUserService.getById(userId);
+        if (ObjectUtils.isNull(user)){
+            return null;
+        }
+        SysTenant tenant = iSysTenantService.getById(user.getTenantId());
+        if (tenant.getExamRoom() != 1){
+            //不需要祥粤考场
+            return null;
+        }
+        String idCard = EncryptHandler.decrypt(user.getIdCard());
+        String telPhone = EncryptHandler.decrypt(user.getTelphone());
+        Map<String, String> params = new HashMap<>();
+        Long nowTime = DateUtils.getNowTime();
+        String sign = ToolsUtils.EncoderByMd5(idCard+telPhone+nowTime + "pubilc2022");
+        params.put("stamp", nowTime.toString());
+        params.put("sign", sign);
+        params.put("idNum", idCard);
+        params.put("passwordSign", "2");
+        params.put("telphone",telPhone);
+        String respone = "";
+        try {
+            respone = HttpUtils.postFormBody(OLD_GOODS, params);
+            if (!respone.contains("\"code\":200")) {
+                throw new CustomException("旧系统用户跳转接口错误");
+            }
+            JSONObject jsonObject = JSONObject.parseObject(respone);
+            Object data = jsonObject.get("data");
+            if (ObjectUtils.isNotNull(data)){
+                vo = JSONObject.parseObject(JSONObject.toJSONString(data), UserNewGoodsVo.class);
+            }else {
+                return null;
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+            throw new CustomException("旧系统用户跳转接口错误");
+        }
+        return vo;
+    }
+
     private Long liveTime(Long nowTime, Integer day) {
         for (Integer i = 0; i < day; i++) {
             Long dayAfter = DateUtils.getDayAfter(nowTime, 1);

+ 9 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -1738,6 +1738,13 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                     goods.setCertificateTpId(getNewCertificateTpId(goods.getCertificateTpId(), newTenantId, recordList));
                 }
 
+                //商品关联题库
+                if (StringUtils.isNotBlank(goods.getQuestionRelIds())){
+                    String collect = Arrays.stream(goods.getQuestionRelIds().split(","))
+                            .map(x -> getNewId(Long.valueOf(x), GoodsCopyEnum.GOODS.getType()).toString()).collect(Collectors.joining(","));
+                    goods.setQuestionRelIds(collect);
+                }
+
                 //规格模板
                 if (ObjectUtils.isNotNull(goods.getSpecTemplateId())) {
                     Long oldSpecTemplateId = goods.getSpecTemplateId();
@@ -1814,6 +1821,8 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                     addSysGoodsRecord(oldGoodsId, goods.getGoodsId(), GoodsCopyEnum.GOODS.getType(), newTenantId, recordList);
                 } else {
                     //修改
+                    goods.setPcDetailHtml("");
+                    goods.setMobileDetailHtml("");
                     baseMapper.updateByTenant(goods);
                 }
                 newGoodsId = goods.getGoodsId();

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderBusinessConfigGoodsQueryBo.java

@@ -69,7 +69,7 @@ public class OrderBusinessConfigGoodsQueryBo extends BaseEntity {
 	@ApiModelProperty("业务名称")
 	private String businessName;
 	@ApiModelProperty("科目名称")
-	private Long subjectName;
+	private String subjectName;
 	@ApiModelProperty("年份")
 	private String year;
 }

+ 4 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/tencentcloud/service/impl/VodServiceImpl.java

@@ -88,7 +88,7 @@ public class VodServiceImpl implements IVodService {
         Integer AppId = 1306117675;
     //    String FileId = "4564972818519602447";
     //    String AudioVideoType = "RawAdaptive";
-        String AudioVideoType = "Original";
+        String AudioVideoType = "ProtectedAdaptive";
         Integer RawAdaptiveDefinition = 10;
         Integer ImageSpriteDefinition = 10;
         Long CurrentTime = DateUtils.getNowTime();
@@ -101,6 +101,9 @@ public class VodServiceImpl implements IVodService {
         contentInfo.put("audioVideoType", AudioVideoType);
         contentInfo.put("rawAdaptiveDefinition", RawAdaptiveDefinition);
         contentInfo.put("imageSpriteDefinition", ImageSpriteDefinition);
+        HashMap<String, Object> drmAdaptiveInfo = new HashMap<String, Object>();
+        drmAdaptiveInfo.put("privateEncryptionDefinition", 12);
+        contentInfo.put("drmAdaptiveInfo", drmAdaptiveInfo);
         try {
             Algorithm algorithm = Algorithm.HMAC256(PlayKey);
             String token = JWT.create().withClaim("appId", AppId).withClaim("fileId", FileId)

+ 1 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopOldOrderServiceImpl.java

@@ -517,7 +517,6 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
     }
 
 
-
     private BigDecimal getInstTimeSettleCost(TopOldOrderVo orderVo) {
         List<String> fullName = new ArrayList<>();
         if (orderVo.getOrderFrom() == 1) {
@@ -1979,8 +1978,8 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
                 order.setOrderUncollected(BigDecimal.ZERO);
             } else {
                 //未收比退款多或者相等
-                refundPrice = BigDecimal.ZERO;
                 order.setOrderUncollected(orderUncollected.subtract(refundPrice));
+                refundPrice = BigDecimal.ZERO;
             }
             updateById(order);
         }

+ 5 - 28
zhongzheng-system/src/main/resources/mapper/modules/top/TopOldOrderMapper.xml

@@ -46,13 +46,7 @@
         SELECT
         vto.*
         FROM
-        <if test="businessFullName != null and businessFullName != '' and ((userCard == null or userCard == '') and (userName == null or userName == ''))">
-            ( SELECT DISTINCT order_sn
-            FROM `v_top_order_business` where INSTR( business_full_name,#{businessFullName} ) > 0
-            ) a
-            LEFT JOIN v_top_order vto ON a.order_sn = vto.order_sn
-        </if>
-        <if test="((userCard != null and userCard != '') or (userName != null and userName != '')) and (businessFullName == null or businessFullName == '')">
+        <if test="((userCard != null and userCard != '') or (userName != null and userName != ''))">
             ( SELECT DISTINCT order_sn
             FROM `v_top_order_card` where 1=1
             <if test="userCard != null and userCard != ''">
@@ -64,33 +58,16 @@
             ) a
             LEFT JOIN v_top_order vto ON a.order_sn = vto.order_sn
         </if>
-        <if test="((userCard != null and userCard != '') or (userName != null and userName != '')) and businessFullName != null and businessFullName != ''">
-            ( SELECT DISTINCT order_sn
-            FROM (
-            SELECT
-            DISTINCT order_sn
-            FROM
-            ( SELECT order_sn FROM v_top_order_business WHERE INSTR( business_full_name,#{businessFullName} ) > 0 UNION
-            ALL SELECT order_sn FROM v_top_order_card
-            WHERE 1 = 1
-            <if test="userCard != null and userCard != ''">
-                AND user_card = #{userCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
-            </if>
-            <if test="userName != null and userName != ''">
-                AND user_name LIKE CONCAT( '%', #{userName}, '%' )
-            </if>
-            ) b
-            ) m
-            ) a
-            LEFT JOIN v_top_order vto ON a.order_sn = vto.order_sn
-        </if>
-        <if test="(userCard == null or userCard == '') and (businessFullName == null or businessFullName == '') and (userName == null or userName == '')">
+        <if test="(userCard == null or userCard == '') and (userName == null or userName == '')">
             v_top_order vto
         </if>
         WHERE vto.`status` in (0,1)
         <if test="operationType != null">
             AND vto.operation_type = #{operationType}
         </if>
+        <if test="businessFullName != null and businessFullName != ''">
+            AND vto.business_full_name = #{businessFullName}
+        </if>
         <if test="checkStatus != null and checkStatus.size()!=0 ">
             AND vto.check_status in
             <foreach collection="checkStatus" item="item" index="index" open="(" close=")" separator=",">

+ 2 - 1
zhongzheng-system/src/main/resources/mapper/modules/user/UserExamRecordMapper.xml

@@ -683,13 +683,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </foreach>
         </if>
         <if test="questionIds != null and questionIds.size()!=0 ">
+            AND
             <foreach collection="questionIds" item="item" index="index">
                 <choose>
                     <when test="index == questionIds.size()-1">
                         up.do_question_ids LIKE concat('%', #{item}, '%')
                     </when>
                     <otherwise>
-                        AND up.do_question_ids LIKE concat('%', #{item}, '%') OR
+                        up.do_question_ids LIKE concat('%', #{item}, '%') OR
                     </otherwise>
                 </choose>
             </foreach>

+ 4 - 30
zhongzheng-system/src/main/resources/mapper/modules/user/UserMapper.xml

@@ -229,24 +229,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
         <if test="goodsSearchKey != null and goodsSearchKey != ''" >
             and ( SELECT
-            count(og.*)
+            count(og.order_goods_id)
             FROM
             `order` o
             LEFT JOIN order_goods og on o.order_sn = og.order_sn
-            where 1=1
-            and og.`status` = 1
-            and og.refund_status in (0,1,3)
-            and og.pay_status in (2,3,4))
-            and (g.goods_name like concat('%', #{goodsSearchKey}, '%') or g.code like concat('%', #{goodsSearchKey}, '%'))
-            and o.user_id = u.user_id)>0
-        </if>
-        <if test="goodsSearchKey != null and goodsSearchKey != ''" >
-            and ( SELECT
-            count(*)
-            FROM
-            `order` o
-            LEFT JOIN order_goods og on o.order_sn = og.order_sn
-            LEFT JOIN goods g on og.goods_id = g.goods_id
+            LEFT JOIN goods g ON og.goods_id = g.goods_id
             where 1=1
             and og.`status` = 1
             and og.refund_status in (0,1,3)
@@ -388,24 +375,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
         <if test="goodsSearchKey != null and goodsSearchKey != ''" >
             and ( SELECT
-            count(og.*)
+            count(og.order_goods_id)
             FROM
             `order` o
             LEFT JOIN order_goods og on o.order_sn = og.order_sn
-            where 1=1
-            and og.`status` = 1
-            and og.refund_status in (0,1,3)
-            and og.pay_status in (2,3,4))
-            and (g.goods_name like concat('%', #{goodsSearchKey}, '%') or g.code like concat('%', #{goodsSearchKey}, '%'))
-            and o.user_id = u.user_id)>0
-        </if>
-        <if test="goodsSearchKey != null and goodsSearchKey != ''" >
-            and ( SELECT
-            count(*)
-            FROM
-            `order` o
-            LEFT JOIN order_goods og on o.order_sn = og.order_sn
-            LEFT JOIN goods g on og.goods_id = g.goods_id
+            LEFT JOIN goods g ON og.goods_id = g.goods_id
             where 1=1
             and og.`status` = 1
             and og.refund_status in (0,1,3)