Browse Source

feat(system): 优化合同签约查询功能

- 在 AppContractSignMapper.xml 中添加产品名称模糊查询功能
- 修正签约时间范围查询字段
- 在 AppHomeServiceImpl 中更新课程查询条件,增加上架状态筛选
- 优化 ESignServiceImpl 中的合同信息查询逻辑
SheepHy 2 weeks ago
parent
commit
348eee5b7b

+ 2 - 2
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/AppHomeServiceImpl.java

@@ -61,11 +61,11 @@ public class AppHomeServiceImpl implements IAppHomeService {
 
         // 精品课程(最多3个)
         List<AppCourses> appCoursesFine = appCoursesMapper.selectList(Wrappers.<AppCourses>lambdaQuery()
-                .eq(AppCourses::getPriceType, 0).last("LIMIT 3"));
+                .eq(AppCourses::getPriceType, 0).eq(AppCourses::getRackingStatus,0).last("LIMIT 3"));
 
         // 免费课程(最多3个)
         List<AppCourses> appCoursesFree = appCoursesMapper.selectList(Wrappers.<AppCourses>lambdaQuery()
-                .eq(AppCourses::getPriceType, 1).last("LIMIT 3"));
+                .eq(AppCourses::getPriceType, 1).eq(AppCourses::getRackingStatus,0).last("LIMIT 3"));
 
         // 合并课程信息
         List<CourseVO> courseVO = new ArrayList<>();

+ 1 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/ESignServiceImpl.java

@@ -519,7 +519,7 @@ public class ESignServiceImpl implements IESignService {
     @Override
     public List<AppContractInfo> queryContractInfo(String contractName) {
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        if(null != contractName){
+        if(null != contractName && !contractName.isEmpty()){
             return appAccountMapper.selectList(Wrappers.<AppContractInfo>lambdaQuery()
                     .like(AppContractInfo::getContractName,contractName).like(AppContractInfo::getOrgCode,user.getOrgCode()));
         }else {

+ 2 - 2
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/dto/ContractSignDTO.java

@@ -16,10 +16,10 @@ public class ContractSignDTO{
     public Integer pageSize;
     @JsonFormat(timezone = "GMT+8",pattern = "MM-dd")
     @DateTimeFormat(pattern="MM-dd")
-    private Date signTimeStart;
+    private Date startTime;
     @JsonFormat(timezone = "GMT+8",pattern = "MM-dd")
     @DateTimeFormat(pattern="MM-dd")
-    private Date signTimeEnd;
+    private Date endTime;
     @Schema(description = "关联产品名称")
     private String productName;
 

+ 9 - 6
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppContractSignMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="org.jeecg.modules.system.app.mapper.AppContractSignMapper">
 
     <select id="queryUserSignContractList" resultType="org.jeecg.modules.system.app.vo.ContractSignVO">
-        SELECT
+        SELECT DISTINCT
         a.id,
         o.product_name,
         c.full_name,
@@ -21,11 +21,14 @@
         GROUP BY order_id
         ) o ON a.order_id = o.order_id
         <where>
-            1=1 AND a.sign_flow_id IS NOT NULL
+            1=1
             <!-- 家庭成员姓名模糊查询 -->
             <if test="contractSignDTO.fullName != null and contractSignDTO.fullName != ''">
                 AND c.full_name LIKE CONCAT('%', #{contractSignDTO.fullName}, '%')
             </if>
+            <if test="contractSignDTO.productName != null and contractSignDTO.productName != ''">
+                AND o.product_name LIKE CONCAT('%', #{contractSignDTO.productName}, '%')
+            </if>
 
             <!-- 联系电话模糊查询 -->
             <if test="contractSignDTO.phone != null and contractSignDTO.phone != ''">
@@ -38,11 +41,11 @@
             </if>
 
             <!-- 签约完成时间范围查询 -->
-            <if test="contractSignDTO.signTimeStart != null">
-                AND a.sign_time &gt;= #{contractSignDTO.signTimeStart}
+            <if test="contractSignDTO.startTime != null">
+                AND a.sign_time &gt;= #{contractSignDTO.startTime}
             </if>
-            <if test="contractSignDTO.signTimeEnd != null">
-                AND a.sign_time &lt;= #{contractSignDTO.signTimeEnd}
+            <if test="contractSignDTO.endTime != null">
+                AND a.sign_time &lt;= #{contractSignDTO.endTime}
             </if>
         </where>
     </select>