Ver código fonte

角色更新成CODE匹配

DLC 1 ano atrás
pai
commit
7867e97549

+ 1 - 1
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/dao/CommonDao.java

@@ -112,7 +112,7 @@ public interface CommonDao {
             "LEFT JOIN sys_user su ON sur.USERID = su.ID and su.DELETED = 0 \n" +
             "LEFT JOIN sys_user_org suo ON suo.USERID = su.ID AND suo.DELETED = 0 \n" +
             "LEFT JOIN sys_organization so ON suo.ORGID = so.ID AND so.DELETED = 0 \n" +
-            "WHERE sr.NAME in(${roles}) AND ${whr}")
+            "WHERE sr.CODE in(${roles}) AND ${whr}")
     List<String> getRoleUserIds(@Param("roles") String roles,@Param("whr") String whr);
 
 }

+ 2 - 2
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquOverhaulPlanningTasksServiceImpl.java

@@ -188,8 +188,8 @@ public class EquOverhaulPlanningTasksServiceImpl extends ServiceImpl<EquOverhaul
                     dataMap.put("list",dataList);
                     Workbook workbook = ExcelExportUtil.exportExcel(params,dataMap);
                     String fileItemId = ExcelUtils.workBookCommonUpload(workbook,  PLANNING_TASK_FILE_NAME.split("\\.")[0], "."+ PLANNING_TASK_FILE_NAME.split("\\.")[1]);
-                    List<String> useDeptRoleUserIds = commonDao.getRoleUserIds("'车间主任','车间维修主管'","so.id in ("+ workShopUserIds.stream().distinct().collect(Collectors.joining(","))+")");
-                    List<String> factoryRoleUserIds = commonDao.getRoleUserIds("'设备部部门长','设备部维修主管'", "(so.FULLPID like '," + planningTasksVo.getTenantid() + "%' or so.ID='" + planningTasksVo.getTenantid() + "')");
+                    List<String> useDeptRoleUserIds = commonDao.getRoleUserIds("'lczg','wms'","so.id in ("+ workShopUserIds.stream().distinct().collect(Collectors.joining(","))+")");
+                    List<String> factoryRoleUserIds = commonDao.getRoleUserIds("'hoed','edms'", "(so.FULLPID like '," + planningTasksVo.getTenantid() + "%' or so.ID='" + planningTasksVo.getTenantid() + "')");
                     if (useDeptRoleUserIds.size() > 0 && factoryRoleUserIds.size() > 0) {
                         userId = Stream.of(useDeptRoleUserIds, factoryRoleUserIds).flatMap(Collection::stream).distinct().collect(Collectors.toList());
                     } else if (useDeptRoleUserIds.size() == 0) {

+ 6 - 6
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquipmentSendNotifyServiceImpl.java

@@ -252,8 +252,8 @@ public class EquipmentSendNotifyServiceImpl implements EquipmentSendNotifyServic
 
         // 发送人
         List<String> userId;
-        List<String> useDeptRoleUserIds = commonDao.getRoleUserIds("'车间主任','车间维修主管','车间保养主管'", "so.ID='" + aspCheckItems.getUsedeptid() + "'");
-        List<String> factoryRoleUserIds = commonDao.getRoleUserIds("'设备部部门长'", "(so.FULLPID like '," + aspCheckItems.getTenantid() + "%' or so.ID='" + aspCheckItems.getTenantid() + "')");
+        List<String> useDeptRoleUserIds = commonDao.getRoleUserIds("'lczg','wms','role054'", "so.ID='" + aspCheckItems.getUsedeptid() + "'");
+        List<String> factoryRoleUserIds = commonDao.getRoleUserIds("'hoed'", "(so.FULLPID like '," + aspCheckItems.getTenantid() + "%' or so.ID='" + aspCheckItems.getTenantid() + "')");
         if (useDeptRoleUserIds.size() > 0 && factoryRoleUserIds.size() > 0) {
             userId = Stream.of(useDeptRoleUserIds, factoryRoleUserIds).flatMap(Collection::stream).distinct().collect(Collectors.toList());
         } else if (useDeptRoleUserIds.size() == 0) {
@@ -292,8 +292,8 @@ public class EquipmentSendNotifyServiceImpl implements EquipmentSendNotifyServic
 
         // 发送人
         List<String> userId;
-        List<String> useDeptRoleUserIds = commonDao.getRoleUserIds("'车间主任','车间维修主管'", "so.ID='" + equMaintenanceOrderDo.getWorkshopid() + "'");
-        List<String> factoryRoleUserIds = commonDao.getRoleUserIds("'设备部部门长','设备部维修主管'", "(so.FULLPID like '," + equMaintenanceOrderDo.getTenantid() + "%' or so.ID='" + equMaintenanceOrderDo.getTenantid() + "')");
+        List<String> useDeptRoleUserIds = commonDao.getRoleUserIds("'lczg','wms'", "so.ID='" + equMaintenanceOrderDo.getWorkshopid() + "'");
+        List<String> factoryRoleUserIds = commonDao.getRoleUserIds("'hoed','edms'", "(so.FULLPID like '," + equMaintenanceOrderDo.getTenantid() + "%' or so.ID='" + equMaintenanceOrderDo.getTenantid() + "')");
         if (useDeptRoleUserIds.size() > 0 && factoryRoleUserIds.size() > 0) {
             userId = Stream.of(useDeptRoleUserIds, factoryRoleUserIds).flatMap(Collection::stream).distinct().collect(Collectors.toList());
         } else if (useDeptRoleUserIds.size() == 0) {
@@ -597,11 +597,11 @@ public class EquipmentSendNotifyServiceImpl implements EquipmentSendNotifyServic
         }
         // 需接收提醒用户ID
         List<String> userIds = commonDao.getRoleUserIds(
-                "'车间主任','车间保养主管'", "so.ID IN (" + stringBuilder + ")"
+                "'lczg','role054'", "so.ID IN (" + stringBuilder + ")"
         );
         userIds.addAll(
                 commonDao.getRoleUserIds(
-                        "'设备部部门长','设备部保养主管'", "(so.FULLPID like '," + plantId + "%' or so.ID='" + plantId + "')"
+                        "'hoed','equ_byzg'", "(so.FULLPID like '," + plantId + "%' or so.ID='" + plantId + "')"
                 )
         );