Bladeren bron

fix: sop 设备发货管理

caozixuan 1 jaar geleden
bovenliggende
commit
75e9fc0a14

+ 12 - 4
sop-api/src/main/java/com/qmth/sop/server/api/TBCrmController.java

@@ -1,6 +1,5 @@
 package com.qmth.sop.server.api;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.boot.api.annotation.Aac;
@@ -54,6 +53,7 @@ public class TBCrmController {
     @ApiResponses({@ApiResponse(code = 200, message = "派单信息表查询结果", response = TBCrmResult.class)})
     public Result query(
             @ApiParam(value = "服务单元") @RequestParam(required = false) Long serviceId,
+            @ApiParam(value = "是否绑定") @RequestParam(required = false) Boolean isBind,
             @ApiParam(value = "大区经理") @RequestParam(required = false) Long leadId,
             @ApiParam(value = "派单人") @RequestParam(required = false) Long crmUserId,
             @ApiParam(value = "客户类型") @RequestParam(required = false) ProductTypeEnum type,
@@ -63,7 +63,7 @@ public class TBCrmController {
             @ApiParam(value = "派单时间结束") @RequestParam(required = false) Long endTime,
             @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
             @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        IPage<TBCrmResult> resultIPage = tBCrmService.query(new Page<>(pageNumber, pageSize), serviceId, leadId, crmUserId, type, custom, crmNo, startTime, endTime);
+        IPage<TBCrmResult> resultIPage = tBCrmService.query(new Page<>(pageNumber, pageSize), serviceId, isBind, leadId, crmUserId, type, custom, crmNo, startTime, endTime);
 
         return ResultUtil.ok(resultIPage);
     }
@@ -111,8 +111,16 @@ public class TBCrmController {
     @ApiOperation(value = "统计待划定数量接口")
     @RequestMapping(value = "/countWaitZone", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
-    public Result countWaitZone() {
-        return ResultUtil.ok(tBCrmService.count(new QueryWrapper<TBCrm>().lambda().isNull(TBCrm::getServiceId).eq(TBCrm::getEnable, true)));
+    public Result countWaitZone(@ApiParam(value = "服务单元") @RequestParam(required = false) Long serviceId,
+                                @ApiParam(value = "是否绑定") @RequestParam(required = false) Boolean isBind,
+                                @ApiParam(value = "大区经理") @RequestParam(required = false) Long leadId,
+                                @ApiParam(value = "派单人") @RequestParam(required = false) Long crmUserId,
+                                @ApiParam(value = "客户类型") @RequestParam(required = false) ProductTypeEnum type,
+                                @ApiParam(value = "客户名称(模糊查询)") @RequestParam(required = false) String custom,
+                                @ApiParam(value = "项目单号(模糊查询) ") @RequestParam(required = false) String crmNo,
+                                @ApiParam(value = "派单时间开始") @RequestParam(required = false) Long startTime,
+                                @ApiParam(value = "派单时间结束") @RequestParam(required = false) Long endTime) {
+        return ResultUtil.ok(tBCrmService.count(serviceId, isBind, leadId, crmUserId, type, custom, crmNo, startTime, endTime));
     }
 
     @ApiOperation(value = "查询项目派单信息")

+ 0 - 2
sop-business/src/main/java/com/qmth/sop/business/bean/dto/UserArchivesImportDto.java

@@ -84,8 +84,6 @@ public class UserArchivesImportDto extends BasicExcelRow implements Serializable
     private Double authenticationScore;
 
     @ExcelProperty(value = "认证有效期")
-    @NotBlank(message = "请选择认证有效期")
-    @NotNull(message = "请选择认证有效期")
     private String authenticationValidTimeStr;
 
     @ExcelProperty(value = "备注")

+ 3 - 1
sop-business/src/main/java/com/qmth/sop/business/mapper/TBCrmMapper.java

@@ -100,7 +100,9 @@ public interface TBCrmMapper extends BaseMapper<TBCrm> {
      * @return
      */
 
-    IPage<TBCrmResult> query(IPage<Map> iPage, @Param("serviceId") Long serviceId, @Param("leadId") Long leadId, @Param("crmUserId") Long crmUserId, @Param("type") String type, @Param("custom") String custom, @Param("crmNo") String crmNo, @Param("startTime") Long startTime, @Param("endTime") Long endTime);
+    IPage<TBCrmResult> query(IPage<Map> iPage, @Param("serviceId") Long serviceId, @Param("isBind") Boolean isBind, @Param("leadId") Long leadId, @Param("crmUserId") Long crmUserId, @Param("type") String type, @Param("custom") String custom, @Param("crmNo") String crmNo, @Param("startTime") Long startTime, @Param("endTime") Long endTime);
+
+    int count(@Param("serviceId") Long serviceId, @Param("isBind") Boolean isBind, @Param("leadId") Long leadId, @Param("crmUserId") Long crmUserId, @Param("type") String type, @Param("custom") String custom, @Param("crmNo") String crmNo, @Param("startTime") Long startTime, @Param("endTime") Long endTime);
 
     /**
      * 根据sopNo查询派单项目信息

+ 3 - 1
sop-business/src/main/java/com/qmth/sop/business/service/TBCrmService.java

@@ -104,7 +104,9 @@ public interface TBCrmService extends IService<TBCrm> {
      * @param iPage
      * @return
      */
-    IPage<TBCrmResult> query(IPage<Map> iPage, Long serviceId, Long leadId, Long crmUserId, ProductTypeEnum type, String custom, String crmNo, Long startTime, Long endTime);
+    IPage<TBCrmResult> query(IPage<Map> iPage, Long serviceId,Boolean isBind, Long leadId, Long crmUserId, ProductTypeEnum type, String custom, String crmNo, Long startTime, Long endTime);
+
+    int count(Long serviceId,Boolean isBind, Long leadId, Long crmUserId, ProductTypeEnum type, String custom, String crmNo, Long startTime, Long endTime);
 
     /**
      * 新增修改派单信息表

+ 19 - 2
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBCrmServiceImpl.java

@@ -164,8 +164,25 @@ public class TBCrmServiceImpl extends ServiceImpl<TBCrmMapper, TBCrm> implements
     }
 
     @Override
-    public IPage<TBCrmResult> query(IPage<Map> iPage, Long serviceId, Long leadId, Long crmUserId, ProductTypeEnum type, String custom, String crmNo, Long startTime, Long endTime) {
-        return this.baseMapper.query(iPage, serviceId, leadId, crmUserId, Objects.nonNull(type) ? type.name() : null, custom, crmNo, startTime, endTime);
+    public IPage<TBCrmResult> query(IPage<Map> iPage, Long serviceId,Boolean isBind, Long leadId, Long crmUserId, ProductTypeEnum type, String custom, String crmNo, Long startTime, Long endTime) {
+        if (custom != null && custom.length() > 0){
+            custom = SystemConstant.translateSpecificSign(custom);
+        }
+        if (crmNo != null && crmNo.length() > 0){
+            crmNo = SystemConstant.translateSpecificSign(crmNo);
+        }
+        return this.baseMapper.query(iPage, serviceId,isBind, leadId, crmUserId, Objects.nonNull(type) ? type.name() : null, custom, crmNo, startTime, endTime);
+    }
+
+    @Override
+    public int count(Long serviceId, Boolean isBind, Long leadId, Long crmUserId, ProductTypeEnum type, String custom, String crmNo, Long startTime, Long endTime) {
+        if (custom != null && custom.length() > 0){
+            custom = SystemConstant.translateSpecificSign(custom);
+        }
+        if (crmNo != null && crmNo.length() > 0){
+            crmNo = SystemConstant.translateSpecificSign(crmNo);
+        }
+        return this.baseMapper.count(serviceId,isBind, leadId, crmUserId, Objects.nonNull(type) ? type.name() : null, custom, crmNo, startTime, endTime);
     }
 
 

+ 4 - 2
sop-business/src/main/java/com/qmth/sop/business/templete/service/impl/TaskLogicServiceImpl.java

@@ -208,8 +208,10 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                     userArchivesParam.setAuthenticationScore(userArchivesImportDto.getAuthenticationScore());
 
                     String authenticationValidTimeStr = userArchivesImportDto.getAuthenticationValidTimeStr();
-                    Long authenticationValidTime = DateDisposeUtils.parseDate(authenticationValidTimeStr).getTime();
-                    userArchivesParam.setAuthenticationValidTime(authenticationValidTime);
+                    if (authenticationValidTimeStr != null && authenticationValidTimeStr.length() > 0){
+                        Long authenticationValidTime = DateDisposeUtils.parseDate(authenticationValidTimeStr).getTime();
+                        userArchivesParam.setAuthenticationValidTime(authenticationValidTime);
+                    }
                     userArchivesParam.setRemark(userArchivesImportDto.getRemark());
                     tbUserArchivesService.editUserArchives(userArchivesParam, requestUser);
                 }

+ 50 - 1
sop-business/src/main/resources/mapper/TBCrmMapper.xml

@@ -219,6 +219,9 @@
             <if test="serviceId != null and serviceId != ''">
                 and a.service_id = #{serviceId}
             </if>
+            <if test="isBind != null and !isBind">
+                and a.service_id IS NULL
+            </if>
             <if test="leadId != null and leadId != ''">
                 and a.lead_id = #{leadId}
             </if>
@@ -248,7 +251,7 @@
 
 
         ORDER BY
-        a.create_time DESC
+        a.update_time DESC
     </select>
     <select id="findCrmProjectBySopNo" resultType="com.qmth.sop.business.bean.result.CrmProjectResult">
         SELECT
@@ -390,6 +393,52 @@
             </if>
         </where>
     </select>
+    <select id="count" resultType="java.lang.Integer">
+        SELECT
+        count(*)
+        FROM
+        t_b_crm a
+        LEFT JOIN sys_user cru ON cru.id = a.crm_user_id
+        LEFT JOIN sys_user lu ON lu.id = a.lead_id
+        LEFT JOIN sys_user cu ON cu.id = a.create_id
+        LEFT JOIN t_b_product p ON p.id = a.product_id
+        LEFT JOIN t_b_service tbs ON a.service_id = tbs.id
+        LEFT JOIN sys_custom sc ON sc.id = a.custom_id
+        <where>
+            and a.enable=1
+            <if test="serviceId != null and serviceId != ''">
+                and a.service_id = #{serviceId}
+            </if>
+            <if test="isBind != null and !isBind">
+                and a.service_id IS NULL
+            </if>
+            <if test="leadId != null and leadId != ''">
+                and a.lead_id = #{leadId}
+            </if>
+            <if test="crmUserId != null and crmUserId != ''">
+                and a.crm_user_id = #{crmUserId}
+            </if>
+            <if test="type != null and type != ''">
+                and sc.type = #{type}
+            </if>
+            <if test="custom != null and custom != ''">
+                and sc.name like concat('%', #{custom} , '%')
+            </if>
+            <if test="crmNo != null and crmNo != ''">
+                and a.crm_no like concat('%', #{crmNo} , '%')
+            </if>
+            <if test="startTime != null and startTime != '' ">
+                <![CDATA[
+               and a.create_time >= #{startTime}
+               ]]>
+            </if>
+            <if test="endTime != null and endTime != ''">
+                <![CDATA[
+                and a.create_time <= #{endTime}
+                ]]>
+            </if>
+        </where>
+    </select>
 
 
 </mapper>

+ 1 - 0
sop-business/src/main/resources/mapper/TBUserArchivesMapper.xml

@@ -74,6 +74,7 @@
                                 AND sr.type = #{roleType})
             </if>
         </where>
+        ORDER BY tbua.update_time DESC,tbua.code DESC
     </select>
     <select id="findSubTotal" resultType="com.qmth.sop.business.bean.result.UserArchivesResult">
         SELECT