Ver código fonte

Merge branch 'wanghaicheng' of lift-manager/lift-server into develop

wanghaicheng 4 anos atrás
pai
commit
e09efae35c

+ 5 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/annualinspection/dto/InspectionRequest.java

@@ -154,4 +154,9 @@ public class InspectionRequest extends PageRequest {
      * 当前用户角色code
      */
     private String currentRoleCode;
+
+    /**
+     * 电梯注册代码
+     */
+    private String registrationCode;
 }

+ 29 - 15
lift-business-service/src/main/resources/mapper/lift/LiftMapper.xml

@@ -254,22 +254,36 @@
         LEFT JOIN user_info ui ON re.user_id = ui.user_id
         LEFT JOIN annual_inspection ai ON ai.lift_id = li.id AND ai.mt_company_id = plr.mt_company_id
                  AND ai.plan_date = li.annual_inspection_date AND pu.mt_company_id = ai.mt_company_id
-        WHERE
-            li.annual_inspection_date <= date_add(curdate(), INTERVAL 45 DAY)
-        AND li.annual_inspection_date >= curdate() AND isnull(ai.id)
-        <if test="request.mtCompanyId != null and request.mtCompanyId > 0">
-            AND plr.mt_company_id = #{request.mtCompanyId}
-        </if>
-        <choose>
-            <when test="request.currentRoleCode == 'REGION_DIRECTOR' or request.currentRoleCode == 'CLERK' ">
-                AND pu.user_id = #{request.userId,jdbcType=BIGINT}
-            </when>
-            <when test="request.currentRoleCode == 'ROLEMTWORK' ">
-                AND plr.worker_id = #{request.userId,jdbcType=BIGINT}
-            </when>
-            <otherwise/>
-        </choose>
+        <where>
+                li.annual_inspection_date &lt;= date_add(curdate(), INTERVAL 45 DAY)
+            AND li.annual_inspection_date &gt;= curdate() AND isnull(ai.id)
+            <if test="request.mtCompanyId != null and request.mtCompanyId > 0">
+                AND plr.mt_company_id = #{request.mtCompanyId}
+            </if>
+            <if test="request.regionId != null and request.regionId > 0">
+                AND re.id = #{request.regionId}
+            </if>
+            <if test="request.projectId != null and request.projectId > 0">
+                AND plr.project_id = #{request.projectId}
+            </if>
+            <if test="request.workerId != null and request.workerId > 0">
+                AND plr.worker_id = #{request.workerId}
+            </if>
+            <if test="request.registrationCode != null and request.registrationCode !=''">
+                AND li.registration_code = #{request.registrationCode}
+            </if>
+            <choose>
+                <when test="request.currentRoleCode == 'REGION_DIRECTOR' or request.currentRoleCode == 'CLERK' ">
+                    AND pu.user_id = #{request.userId,jdbcType=BIGINT}
+                </when>
+                <when test="request.currentRoleCode == 'ROLEMTWORK' ">
+                    AND plr.worker_id = #{request.userId,jdbcType=BIGINT}
+                </when>
+                <otherwise/>
+            </choose>
+        </where>
     </select>
+
     <select id="groupByRegistrationCode" resultType="cn.com.ty.lift.business.library.dao.entity.Lift">
         SELECT
             *

+ 6 - 1
lift-system-service/src/main/java/cn/com/ty/lift/system/settings/dao/entity/model/ConfirmCompanyResponse.java

@@ -16,7 +16,12 @@ public class ConfirmCompanyResponse {
     /**
      * 公司id
      */
-    private Long CompanyId;
+    private Long companyId;
+
+    /**
+     *  公司认证id
+     */
+    private Long attestationId;
 
     /**
      * 是否vip

+ 8 - 6
lift-system-service/src/main/java/cn/com/ty/lift/system/settings/service/impl/MaintenanceCompanyServiceImpl.java

@@ -374,8 +374,10 @@ public class MaintenanceCompanyServiceImpl extends ServiceImpl<MaintenanceCompan
                                    Map<Long, Integer> limitedNums) {
         ConfirmCompanyResponse confirmCompanyResponse = new ConfirmCompanyResponse(maintenanceCompany);
         Long companyId = maintenanceCompany.getId();
-        //设置公司认证表id,非公司id
-        confirmCompanyResponse.setCompanyId(companyAttestationMap.get(companyId));
+        //设置公司id
+        confirmCompanyResponse.setCompanyId(maintenanceCompany.getId());
+        //设置公司认证表id
+        confirmCompanyResponse.setAttestationId(companyAttestationMap.get(companyId));
         //设置认证时间
         if (companyIdToDealTime.size() > 0) {
             confirmCompanyResponse.setConfirmTime(companyIdToDealTime.get(companyId));
@@ -449,10 +451,10 @@ public class MaintenanceCompanyServiceImpl extends ServiceImpl<MaintenanceCompan
                 long totalLiftNum = liftMapDataModels.size();
                 //总停保台量
                 long totalStopLiftNum = liftMapDataModels.stream()
-                        .filter(liftMapDataModel -> {
-                            return StringUtils.isNotBlank(liftMapDataModel.getLiftCompanyStatus()) &&
-                                    CommonEnum.LiftStatus.STOP_INSURANCE.equals(liftMapDataModel.getLiftCompanyStatus());
-                        }).count();
+                        .filter(liftMapDataModel ->
+                             StringUtils.isNotBlank(liftMapDataModel.getLiftCompanyStatus()) &&
+                                    CommonEnum.LiftStatus.STOP_INSURANCE.getCode().equals(liftMapDataModel.getLiftCompanyStatus())).
+                                count();
                 //总活跃台量
                 long totalActiveLiftNum = totalLiftNum - totalStopLiftNum;
                 confirmCompanyResponse.setTotalLiftNum(totalLiftNum);