3254194295 2 жил өмнө
parent
commit
8dd8303d89

+ 1 - 0
platform-dao/src/main/java/com/platform/dao/vo/NoticeNumberVO.java

@@ -17,6 +17,7 @@ import java.math.BigDecimal;
 @Accessors(chain = true)
 public class NoticeNumberVO implements Serializable {
     private static final long serialVersionUID = 1L;
+    private Integer roleFlag;
 
     //维修
     //维修中

+ 11 - 10
platform-dao/src/main/resources/mapper/repair/RepairApplicationFormMapper.xml

@@ -334,25 +334,26 @@
 
     <select id="getFirstRepairApplicationFormVO" parameterType="com.platform.dao.dto.repair.RepairApplicationFormDTO"
     resultType="com.platform.dao.vo.repair.RepairApplicationFormVO">
-        select * from t_repair_application_form
+        select form.*,info.name sbName,info.cph sbCph from t_repair_application_form form left join t_sb_info info
+        on form.sb_id=info.id
         <where>
             <if test="userId!=null and userId!=''">
-                and user_id=#{userId}
+                and form.user_id=#{userId}
             </if>
             <if test="repairUserId!=null and repairUserId!=''">
-                and repair_user_id=#{repairUserId}
+                and form.repair_user_id=#{repairUserId}
             </if>
             <if test="dispatchUserId!=null and dispatchUserId!=''">
-                and dispatch_user_id=#{dispatchUserId}
+                and form.dispatch_user_id=#{dispatchUserId}
             </if>
         </where>
-        order by update_time desc
+        order by form.update_time desc
         limit 1
     </select>
 
     <select id="getRepairCount1" parameterType="com.platform.dao.dto.repair.RepairApplicationFormDTO"
             resultType="int">
-        select count(*) from t_repair_application_form
+        select count(*) from t_repair_application_form form
         <where>
             <if test="statusList != null and statusList.size > 0">
                 AND form.status in
@@ -361,16 +362,16 @@
                 </foreach>
             </if>
             <if test="userId!=null and userId!=''">
-                form.user_id=#{userId}
+                and form.user_id=#{userId}
             </if>
             <if test="repairUserId!=null and repairUserId!=''">
-                form.repair_user_id=#{repairUserId}
+                and form.repair_user_id=#{repairUserId}
             </if>
             <if test="dispatchUserId!=null and dispatchUserId!=''">
-                form.dispatch_user_id=#{dispatchUserId}
+                and form.dispatch_user_id=#{dispatchUserId}
             </if>
             <if test="status!=null and status!=null">
-                form.status=#{status}
+                and form.status=#{status}
             </if>
         </where>
     </select>

+ 2 - 2
platform-dao/src/main/resources/mapper/store/InStoreFormMapper.xml

@@ -192,7 +192,7 @@ GROUP BY
 
     <select id="getRentleInStoreForm" parameterType="com.platform.dao.dto.store.InStoreFormDTO"
             resultType="com.platform.dao.vo.query.store.InStoreFormVO">
-        select form.* from t_in_store_form form join t_store store
+        select form.*,store.name as storeName,form.created_user_name from t_in_store_form form join t_store store
         where store.id=form.store_id
         and user_id=#{userId}
         order by form.update_time desc
@@ -205,7 +205,7 @@ GROUP BY
         on store.id=form.store_id
         <where>
             <if test="userId!=null and userId!=''">
-                store.user_id=#{userId}>
+                store.user_id=#{userId}
             </if>
             <if test="storeId!=null and storeId!=''">
                 store_id=#{storeId}

+ 1 - 1
platform-dao/src/main/resources/mapper/store/OutStoreFormMapper.xml

@@ -169,7 +169,7 @@
 
     <select id="getRentleOutStoreForm" parameterType="com.platform.dao.dto.store.OutStoreFormDTO"
             resultType="com.platform.dao.vo.query.store.OutStoreFormVO">
-        select form.* from t_out_store_form form join t_store store
+        select form.*,store.name as storeName,form.created_user_name from t_out_store_form form join t_store store
         where store.id=form.store_id
         and user_id=#{userId}
         order by form.update_time desc

+ 3 - 4
platform-rest/src/main/java/com/platform/rest/controller/repair/RepairApplicationFormController.java

@@ -355,11 +355,10 @@ public class RepairApplicationFormController {
     public R getRepairApplicationForm() {
 //        UserInfo userInfo=new UserInfo();
 //        List list=new ArrayList();
-//        list.add("维修人员");
-//        list.add("Maintenance");
-//        userInfo.setUserId("629ec5456f900a3658c472b5");
+//        list.add("workplace_store_manage");
+//        userInfo.setUserId("629ff44ad2b1150bf0e3f834");
 //        userInfo.setRoleCodes(list);
-
+//        userInfo.setSuperAdmin(0);
         UserInfo userInfo= SecurityUtils.getUserInfo();
         // 根据用户的角色来定
         StringBuilder roleCodes = new StringBuilder();

+ 15 - 17
platform-service/src/main/java/com/platform/service/repair/impl/RepairApplicationFormServiceImpl.java

@@ -184,6 +184,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
         CheckJobDTO checkJobDTO=new CheckJobDTO();
         checkJobDTO.setType(2);
         if(userInfo.getSuperAdmin()==1){
+            noticeNumberVO.setRoleFlag(0);
             repairApplicationFormVOS= mapper.getRepairCount(null);
             checkJobVOS=checkJobMapper.getCheckJobCount1(checkJobDTO);
             noticeNumberVO=addRepairNums(noticeNumberVO,repairApplicationFormVOS);
@@ -195,6 +196,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
                 sb.append(vo.getRoleCode());
             }
             if(sb.toString().contains(SysRoleCodeEnum.Maintenance.name())){
+                noticeNumberVO.setRoleFlag(1);
                 //维修人员,获取自己名下的维修数量
                repairApplicationFormDTO.setRepairUserId(userInfo.getUserId());
                 repairApplicationFormDTO.setRepairUserId(userInfo.getUserId());
@@ -205,12 +207,14 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
                 checkJobVOS=checkJobMapper.getCheckJobCount(checkJobDTO);
                 noticeNumberVO=addCheckJobNums(noticeNumberVO,checkJobVOS);
             } if(sb.toString().contains(SysRoleCodeEnum.REPAIR_EXAMINE.name())){
+                noticeNumberVO.setRoleFlag(2);
                 //报修人
                 repairApplicationFormDTO.setUserId(userInfo.getUserId());
                 repairApplicationFormVOS= mapper.getRepairCount(repairApplicationFormDTO);
                 noticeNumberVO=addRepairNums(noticeNumberVO,repairApplicationFormVOS);
             }if(sb.toString().contains(CommonConstants.WORKPLACE_REPAIR_MANAGE) ||sb.toString().contains(SysRoleCodeEnum.REPAIR_MANAGE.name())){
                 //维修主管,先获取其deptid
+                noticeNumberVO.setRoleFlag(3);
                 String deptId=sysUserDeptMapper.selectDeptIdByUserId(userInfo.getUserId());
                 repairApplicationFormDTO.setDeptId(deptId);
                 repairApplicationFormVOS= mapper.getRepairCount(repairApplicationFormDTO);
@@ -221,16 +225,11 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
                 checkJobVOS=checkJobMapper.getCheckJobCount1(checkJobDTO);
                 noticeNumberVO=addCheckJobNums(noticeNumberVO,checkJobVOS);
             }
-            if(sb.toString().contains(CommonConstants.WORKPLACE_STORE_NORMAL)){
-                inStoreFormDTO.setUserId(userInfo.getUserId());
-                outStoreFormDTO.setUserId(userInfo.getUserId());
-                storeCheckJobDTO.setUserId(userInfo.getUserId());
-                noticeNumberVO=addStoreNums(noticeNumberVO,inStoreFormDTO,outStoreFormDTO,storeCheckJobDTO);
-            }
             if(sb.toString().contains(CommonConstants.WORKPLACE_STORE_MANAGE)){
                 //仓库管理员
                 //仓库
                 //入库
+                noticeNumberVO.setRoleFlag(4);
                 noticeNumberVO=addStoreNums(noticeNumberVO,inStoreFormDTO,outStoreFormDTO,storeCheckJobDTO);
             }
         }
@@ -321,9 +320,8 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
         UserInfo userInfo=SecurityUtils.getUserInfo();
 //        UserInfo userInfo=new UserInfo();
 //        List list=new ArrayList();
-////        list.add("维修人员");
 //        list.add("workplace_store_manage");
-//        userInfo.setUserId("1");
+//        userInfo.setUserId("629ff44ad2b1150bf0e3f834");
 //        userInfo.setRoleCodes(list);
 //        userInfo.setSuperAdmin(0);
         InStoreFormDTO inStoreFormDTO=new InStoreFormDTO();
@@ -339,7 +337,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
             return new R(inStoreFormVO);
         }else{
             roleFlag=5;
-            inStoreFormVO.setRoleFlag(roleFlag);
+            outStoreFormVO.setRoleFlag(roleFlag);
             OutStoreFormDTO outStoreFormDTO=new OutStoreFormDTO();
             outStoreFormDTO.setUserId(userInfo.getUserId());
             outStoreFormVO=outStoreFormMapper.getRentleOutStoreForm(outStoreFormDTO);
@@ -357,14 +355,14 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
     public RepairApplicationFormVO getRepairApplicationFormVO() {
         RepairApplicationFormDTO repairApplicationFormDTO=new RepairApplicationFormDTO();
         RepairApplicationFormVO repairApplicationFormVO=new RepairApplicationFormVO();
-//        UserInfo userInfo=SecurityUtils.getUserInfo();
-        UserInfo userInfo=new UserInfo();
-        List list=new ArrayList();
-        list.add("维修人员");
-        list.add("Maintenance");
-        userInfo.setUserId("629ec5456f900a3658c472b5");
-        userInfo.setRoleCodes(list);
-        userInfo.setSuperAdmin(0);
+        UserInfo userInfo=SecurityUtils.getUserInfo();
+//        UserInfo userInfo=new UserInfo();
+//        List list=new ArrayList();
+//        list.add("维修人员");
+//        list.add("Maintenance");
+//        userInfo.setUserId("629ec5456f900a3658c472b5");
+//        userInfo.setRoleCodes(list);
+//        userInfo.setSuperAdmin(0);
         // 根据用户的角色来定
         StringBuilder roleCodes = new StringBuilder();
         userInfo.getRoleCodes().forEach(item-> {