jz.kai 3 năm trước cách đây
mục cha
commit
c82b2c003f

+ 2 - 1
common/src/main/java/com/jpsoft/excellent/modules/base/dao/IncidentDAO.java

@@ -3,6 +3,7 @@ package com.jpsoft.excellent.modules.base.dao;
 import java.util.List;
 
 import com.jpsoft.excellent.modules.base.dto.IncidentStepOrgDTO;
+import com.jpsoft.excellent.modules.base.entity.IncidentStep;
 import org.springframework.stereotype.Repository;
 import com.jpsoft.excellent.modules.base.entity.Incident;
 import java.util.Map;
@@ -17,6 +18,6 @@ public interface IncidentDAO {
 	int delete(String id);
 	List<Incident> list();
 	List<Incident> search(Map<String,Object> searchParams,List<Sort> sortList);
-
 	List<IncidentStepOrgDTO> searchStepOrg(Map<String,Object> searchParams, List<Sort> sortList);
+	List<Incident> findTodayListByWarnTime(String startTime, String endTime);
 }

+ 2 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/dao/OrganizationDAO.java

@@ -17,4 +17,6 @@ public interface OrganizationDAO {
 	List<Organization> search(Map<String,Object> searchParams,List<Sort> sortList);
 	String getLevel();
 	Organization findByName(String name);
+	List<Organization> listByDistrict();
+	List<Organization> listByOrg();
 }

+ 1 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/entity/Message.java

@@ -35,6 +35,7 @@ public class Message {
     private Date createTime;
         @ApiModelProperty(value = "创建人")
     private String createBy;
+    private String createByName;
         @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
 	    @ApiModelProperty(value = "更新时间")

+ 1 - 1
common/src/main/java/com/jpsoft/excellent/modules/base/service/IncidentService.java

@@ -16,6 +16,6 @@ public interface IncidentService {
 	int delete(String id);
 	List<Incident> list();
 	Page<Incident> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
-
 	Page<IncidentStepOrgDTO> pageSearchStepOrg(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
+	List<Incident> findTodayListByWarnTime(String startTime, String endTime);
 }

+ 2 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/OrganizationService.java

@@ -16,4 +16,6 @@ public interface OrganizationService {
 	Page<Organization> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
 	String getLevel();
 	Organization findByName(String name);
+	List<Organization> listByDistrict();
+	List<Organization> listByOrg();
 }

+ 6 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/impl/IncidentServiceImpl.java

@@ -78,4 +78,10 @@ public class IncidentServiceImpl implements IncidentService {
 
 		return page;
 	}
+
+	@Override
+	public List<Incident> findTodayListByWarnTime(String startTime, String endTime) {
+		// TODO Auto-generated method stub
+		return incidentDAO.findTodayListByWarnTime(startTime, endTime);
+	}
 }

+ 12 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/impl/OrganizationServiceImpl.java

@@ -78,4 +78,16 @@ public class OrganizationServiceImpl implements OrganizationService {
 		// TODO Auto-generated method stub
 		return organizationDAO.findByName(name);
 	}
+
+	@Override
+	public List<Organization> listByDistrict() {
+		// TODO Auto-generated method stub
+		return organizationDAO.listByDistrict();
+	}
+
+	@Override
+	public List<Organization> listByOrg() {
+		// TODO Auto-generated method stub
+		return organizationDAO.listByOrg();
+	}
 }

+ 7 - 0
common/src/main/resources/mapper/base/Incident.xml

@@ -278,4 +278,11 @@
 			${sort.name} ${sort.order}
 		</foreach>
 	</select>
+	<select id="findTodayListByWarnTime" parameterType="string" resultMap="IncidentMap">
+		<![CDATA[
+		select * from base_incident
+		where del_flag = 0
+		and ((warn_date_1 >= #{startTime} and warn_date_1 < #{endTime}) or (warn_date_2 >= #{startTime} and warn_date_2 < #{endTime}) or (warn_date_3 >= #{startTime} and warn_date_3 < #{endTime}))
+		]]>
+	</select>
 </mapper>

+ 12 - 0
common/src/main/resources/mapper/base/Organization.xml

@@ -123,4 +123,16 @@ id_,name_,parent_id,code_,del_flag,create_time,create_by,update_time,update_by
 	<select id="findByName" parameterType="string" resultMap="OrganizationMap">
 		select * from base_organization where name_=#{0}
 	</select>
+	<select id="listByDistrict" resultMap="OrganizationMap">
+		select * from base_organization
+		where del_flag = 0
+		and (name_ like '%县' or name_ like '%市' or name_ like '%区')
+	</select>
+	<select id="listByOrg" resultMap="OrganizationMap">
+		select * from base_organization
+		where del_flag = 0
+		and name_ not like '%县'
+		and name_ not like '%市'
+		and name_ not like '%区';
+	</select>
 </mapper>

+ 82 - 21
web/src/main/java/com/jpsoft/excellent/modules/base/controller/IncidentController.java

@@ -132,11 +132,11 @@ public class IncidentController {
                 String MessageContent = "";
                 //发送跟踪专班短信
                 templateId = "2431012137069";
-                MessageContent = "您有一条待办提醒,请登录双优督办平台手机端查看。(http://39.104.144.104/excellent-mobile)";
+                MessageContent = String.format("您有一条待办提醒(批次:%s,序号:%s),请登录双优督办平台手机端查看。(http://39.104.144.104/excellent-mobile)",incident.getBatch(),incident.getSerialNo());
                 sendSMSing(MessageContent, templateId, null, incident.getSpecialClassId(), "");
                 //发送交办单位短信
                 templateId = "2431012137069";
-                MessageContent = "您有一条待办提醒,请登录双优督办平台电脑端查看。(http://39.104.144.104/excellent-portal)";
+                MessageContent = String.format("您有一条待办提醒(批次:%s,序号:%s),请登录双优督办平台电脑端查看。(http://39.104.144.104/excellent-portal)",incident.getBatch(),incident.getSerialNo());
                 sendSMSing(MessageContent, templateId, incident.getOrgId(), null, "");
 
                 msgResult.setResult(true);
@@ -309,11 +309,11 @@ public class IncidentController {
                 String MessageContent = "";
                 //发送跟踪专班短信
                 templateId = "2431012152806";
-                MessageContent = "您有一条待办提醒,请登录双优督办平台手机端查看。(http://39.104.144.104/excellent-mobile)";
+                MessageContent = String.format("您有一条待办提醒(批次:%s,序号:%s),请登录双优督办平台手机端查看。(http://39.104.144.104/excellent-mobile)",incident.getBatch(),incident.getSerialNo());
                 sendSMSing(MessageContent, templateId, null, incident.getSpecialClassId(), "");
                 //发送交办单位短信
                 templateId = "2431012152806";
-                MessageContent = "您有一条待办提醒,请登录双优督办平台电脑端查看。(http://39.104.144.104/excellent-portal)";
+                MessageContent = String.format("您有一条待办提醒(批次:%s,序号:%s),请登录双优督办平台电脑端查看。(http://39.104.144.104/excellent-portal)",incident.getBatch(),incident.getSerialNo());
                 sendSMSing(MessageContent, templateId, incident.getOrgId(), null, "");
 
                 msgResult.setResult(true);
@@ -388,7 +388,7 @@ public class IncidentController {
                 String MessageContent = "";
                 //发送跟踪专班短信
                 templateId = "2431012153083";
-                MessageContent = organization.getName() + "责任单位已上传文档,请查阅。";
+                MessageContent = String.format("%s责任单位已上传文档(批次:%s,序号:%s),请查阅。",organization.getName(),incident.getBatch(),incident.getSerialNo());
                 sendSMSing(MessageContent, templateId, null, incident.getSpecialClassId(), "");
             }
 
@@ -528,9 +528,6 @@ public class IncidentController {
 
         Page<Incident> page = incidentService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
         for(Incident incident : page.getResult()){
-            List<IncidentStep> incidentStepList = incidentStepService.findListByIncidentId(incident.getId());
-//            incident.setIncidentStepList(incidentStepList);
-
             if(StringUtils.isNotEmpty(incident.getSpecialClassId())){
                 List<String> nameList = new ArrayList<>();
                 String[] ids = incident.getSpecialClassId().split(",");
@@ -560,10 +557,10 @@ public class IncidentController {
         Map<String,Object> searchParams = new HashMap<>();
         searchParams.put("isFinished", "1");
         if(StringUtils.isNotEmpty(user.getSpecialClassId())) {
-            searchParams.put("orSpecialClassId", user.getSpecialClassId());
+            searchParams.put("orSpecialClassId", "%"+user.getSpecialClassId()+"%");
         }
         if(StringUtils.isNotEmpty(user.getOrgId())) {
-            searchParams.put("orOrgId", user.getOrgId());
+            searchParams.put("orOrgId", "%"+user.getOrgId()+"%");
         }
 //        searchParams.put("createBy", subject);
 
@@ -719,6 +716,66 @@ public class IncidentController {
         return msgResult;
     }
 
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "pageListTracking",method = RequestMethod.POST)
+    public MessageResult<Map> pageListTracking(
+            String batch, String serialNo, String complainant, String complainantPhone, String areaId,
+            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
+            @RequestParam(value="pageSize",defaultValue="20") int pageSize,
+            @RequestAttribute String subject){
+        MessageResult<Map> msgResult = new MessageResult<>();
+        User user = userService.get(subject);
+
+        Map<String,Object> searchParams = new HashMap<>();
+        searchParams.put("isFinished","1");
+        searchParams.put("specialClassId","%"+user.getSpecialClassId()+"%");
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("batch_","asc"));
+        sortList.add(new Sort("serial_no","asc"));
+
+        //当角色为高级用户时,查看所有案件
+        List<Role> roleList = userRoleService.findRoleByUserId(subject);
+        for(Role role : roleList) {
+            if("8d4dd9ac-dcf4-4178-885c-fd309f4be8f6".equals(role.getId()))
+                searchParams.put("createBy", null);
+        }
+
+        //搜索条件
+        if (StringUtils.isNotEmpty(batch)) {
+            searchParams.put("batch","%" + batch + "%");
+        }
+        if (StringUtils.isNotEmpty(serialNo)) {
+            searchParams.put("serialNo","%" + serialNo + "%");
+        }
+        if (StringUtils.isNotEmpty(complainant)) {
+            searchParams.put("complainant","%" + complainant + "%");
+        }
+        if (StringUtils.isNotEmpty(complainantPhone)) {
+            searchParams.put("complainantPhone","%" + complainantPhone + "%");
+        }
+        if (StringUtils.isNotEmpty(areaId)) {
+            searchParams.put("areaId",areaId);
+        }
+
+        Page<Incident> page = incidentService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+        for(Incident incident : page.getResult()){
+            if(StringUtils.isNotEmpty(incident.getSpecialClassId())){
+                List<String> nameList = new ArrayList<>();
+                String[] ids = incident.getSpecialClassId().split(",");
+                for(String id : ids){
+                    nameList.add(dataDictionaryService.getName(id));
+                }
+                incident.setSpecialClassName(String.join(",", nameList));
+            }
+        }
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
     @ApiOperation(value="区域类型数量")
     @RequestMapping(value = "countByArea",method = RequestMethod.POST)
     public MessageResult<List> countByArea(@RequestAttribute String subject){
@@ -754,7 +811,7 @@ public class IncidentController {
         return msgResult;
     }
 
-    @ApiOperation(value="区域类型数量")
+    @ApiOperation(value="专班类型数量")
     @RequestMapping(value = "countBySpecialClass",method = RequestMethod.POST)
     public MessageResult<List> countBySpecialClass(@RequestAttribute String subject){
         MessageResult<List> msgResult = new MessageResult<>();
@@ -794,6 +851,7 @@ public class IncidentController {
     public MessageResult<Map> countByWarningLight(@RequestAttribute String subject){
         MessageResult<Map> msgResult = new MessageResult<>();
         Map<String, Object> map = new HashMap<>();
+        User user = userService.get(subject);
         int intDanger = 0;
         int intWarning = 0;
         int intSafety = 0;
@@ -801,21 +859,24 @@ public class IncidentController {
 
         Map<String,Object> searchParams = new HashMap<>();
         searchParams.put("isFinished", "1");
-        searchParams.put("createBy", subject);
-
-        List<Role> roleList = userRoleService.findRoleByUserId(subject);
-        for(Role role : roleList) {
-            if("8d4dd9ac-dcf4-4178-885c-fd309f4be8f6".equals(role.getId()))
-                searchParams.put("createBy", null);
+        if(StringUtils.isNotEmpty(user.getSpecialClassId())) {
+            searchParams.put("orSpecialClassId", "%"+user.getSpecialClassId()+"%");
         }
+        if(StringUtils.isNotEmpty(user.getOrgId())) {
+            searchParams.put("orOrgId", "%"+user.getOrgId()+"%");
+        }
+
+//        List<Role> roleList = userRoleService.findRoleByUserId(subject);
+//        for(Role role : roleList) {
+//            if("8d4dd9ac-dcf4-4178-885c-fd309f4be8f6".equals(role.getId()))
+//                searchParams.put("createBy", null);
+//        }
         List<Sort> sortList = new ArrayList<>();
         sortList.add(new Sort("create_time","desc"));
 
         Page<Incident> page = incidentService.pageSearch(searchParams,1,10000,false,sortList);
         total = page.size();
         for(Incident incident : page.getResult()){
-            List<IncidentStep> incidentStepList = incidentStepService.findListByIncidentId(incident.getId());
-//            incident.setLastStep(incidentStepList.get(incidentStepList.size()-1));
             //报警灯
             Date currentTime = new Date();
             Date warnTime = incident.getWarnDate1();
@@ -1234,11 +1295,11 @@ public class IncidentController {
                     String MessageContent = "";
                     //发送跟踪专班短信
                     templateId = "2431012137069";
-                    MessageContent = "您有一条待办提醒,请登录双优督办平台手机端查看。(http://39.104.144.104/excellent-mobile)";
+                    MessageContent = String.format("您有一条待办提醒(批次:%s,序号:%s),请登录双优督办平台手机端查看。(http://39.104.144.104/excellent-mobile)",incident.getBatch(),incident.getSerialNo());
                     sendSMSing(MessageContent, templateId, null, incident.getSpecialClassId(), "");
                     //发送交办单位短信
                     templateId = "2431012137069";
-                    MessageContent = "您有一条待办提醒,请登录双优督办平台电脑端查看。(http://39.104.144.104/excellent-portal)";
+                    MessageContent = String.format("您有一条待办提醒(批次:%s,序号:%s),请登录双优督办平台电脑端查看。(http://39.104.144.104/excellent-portal)",incident.getBatch(),incident.getSerialNo());
                     sendSMSing(MessageContent, templateId, incident.getOrgId(), null, "");
 
                     affectCount++;

+ 6 - 2
web/src/main/java/com/jpsoft/excellent/modules/base/controller/MessageController.java

@@ -92,8 +92,8 @@ public class MessageController {
                         String random = String.valueOf((int)((Math.random()*9+1)*100));
                         String SerialNumber = strDate + random;
 
-                        String templateId = "2431012152806";
-                        String MessageContent = "您有一条待办提醒,请登录双优督办平台电脑端查看。(http://39.104.144.104/excellent-portal)";
+                        String templateId = "2431012153393";
+                        String MessageContent = "您有一条站内消息/文件传输,请登录双优督办平台电脑端查看。(http://39.104.144.104/excellent-portal)";
                         String phone = userService.get(userId).getPhone();
                         MessageResult messageResult = SMSUtil.sendSMS(MessageContent, phone, templateId, SerialNumber, "");
                         logger.isInfoEnabled();
@@ -375,6 +375,10 @@ public class MessageController {
         }
 
         Page<Message> page = messageService.pageSearchRec(searchParams,pageIndex,pageSize,true,sortList);
+        for(Message message : page.getResult()){
+            User user = userService.get(message.getCreateBy());
+            message.setCreateByName(user.getRealName());
+        }
 
         msgResult.setResult(true);
         msgResult.setData(PojoUtils.pageWrapper(page));

+ 47 - 5
web/src/main/java/com/jpsoft/excellent/modules/sys/controller/UserController.java

@@ -8,11 +8,9 @@ import com.jpsoft.excellent.modules.common.dto.Sort;
 import com.jpsoft.excellent.modules.common.utils.DES3;
 import com.jpsoft.excellent.modules.common.utils.PojoUtils;
 import com.jpsoft.excellent.modules.common.dto.MessageResult;
-import com.jpsoft.excellent.modules.sys.entity.DataDictionary;
-import com.jpsoft.excellent.modules.sys.entity.Role;
-import com.jpsoft.excellent.modules.sys.entity.User;
-import com.jpsoft.excellent.modules.sys.entity.UserRole;
+import com.jpsoft.excellent.modules.sys.entity.*;
 import com.jpsoft.excellent.modules.sys.service.DataDictionaryService;
+import com.jpsoft.excellent.modules.sys.service.RoleMenuService;
 import com.jpsoft.excellent.modules.sys.service.UserRoleService;
 import com.jpsoft.excellent.modules.sys.service.UserService;
 import io.swagger.annotations.ApiOperation;
@@ -36,6 +34,8 @@ public class UserController {
     private UserService userService;
     @Autowired
     private UserRoleService userRoleService;
+    @Autowired
+    private RoleMenuService roleMenuService;
     @Value("${jwt.secret}")
     private String jwtSecret;
     @Autowired
@@ -458,7 +458,7 @@ public class UserController {
         OptionsDTO optionsDTO2 = new OptionsDTO();
         optionsDTO2.setLabel("交办单位");
         optionsDTO2.setValue("2");
-        List<Organization> organizations = organizationService.list();
+        List<Organization> organizations = organizationService.listByOrg();
         List<OptionsDTO> optionsDTOS2 = new ArrayList<>();
         for(Organization organization : organizations){
             OptionsDTO dto1 = new OptionsDTO();
@@ -478,9 +478,51 @@ public class UserController {
         optionsDTO2.setChildren(optionsDTOS2);
         list.add(optionsDTO2);
 
+        //交办单位
+        OptionsDTO optionsDTO3 = new OptionsDTO();
+        optionsDTO3.setLabel("交办县市区");
+        optionsDTO3.setValue("3");
+        List<Organization> organizations3 = organizationService.listByDistrict();
+        List<OptionsDTO> optionsDTOS3 = new ArrayList<>();
+        for(Organization organization : organizations3){
+            OptionsDTO dto1 = new OptionsDTO();
+            dto1.setLabel(organization.getName());
+            dto1.setValue(organization.getId());
+            List<User> users = userService.findListByOrgId(organization.getId());
+            List<OptionsDTO> optionsUsers = new ArrayList<>();
+            for(User user : users){
+                OptionsDTO dto2 = new OptionsDTO();
+                dto2.setLabel(user.getRealName());
+                dto2.setValue(user.getId());
+                optionsUsers.add(dto2);
+            }
+            dto1.setChildren(optionsUsers);
+            optionsDTOS3.add(dto1);
+        }
+        optionsDTO3.setChildren(optionsDTOS3);
+        list.add(optionsDTO3);
+
         msgResult.setResult(true);
         msgResult.setData(list);
 
         return msgResult;
     }
+
+    @ApiOperation(value="是否有我的案件菜单")
+    @PostMapping("myCaseMenu")
+    public Boolean myCaseMenu(@RequestAttribute String subject) {
+        Boolean bl = false;
+
+        List<Role> roles = userRoleService.findRoleByUserId(subject);
+        for(Role role : roles){
+            List<RoleMenu> roleMenus = roleMenuService.findByRoleId(role.getId());
+            for (RoleMenu roleMenu : roleMenus){
+                if(roleMenu.getMenuId().equals("1188bdbf-b210-46c0-a835-7e4c267f11bd")){
+                    bl = true;
+                }
+            }
+        }
+
+        return bl;
+    }
 }

+ 6 - 8
web/src/main/java/com/jpsoft/excellent/modules/timed/taskSMS.java

@@ -45,20 +45,18 @@ public class taskSMS {
         String startTime = sdf.format(calendar.getTime());
         calendar.add(calendar.DATE,1);
         String endTime = sdf.format(calendar.getTime());
-        List<IncidentStep> incidentStepList = incidentStepService.findTodayListByWarnTime(startTime, endTime);
-        for(IncidentStep incidentStep : incidentStepList){
-            Incident incident = incidentService.get(incidentStep.getIncidentId());
-
+        List<Incident> incidentList = incidentService.findTodayListByWarnTime(startTime, endTime);
+        for(Incident incident : incidentList){
             String templateId = "";
             String MessageContent = "";
             //发送跟踪专班短信
             templateId = "2431012137069";
-            MessageContent = "您有一条待办提醒,请登录双优督办平台手机端查看。(http://39.104.144.104/excellent-mobile)";
-//            sendSMSing(MessageContent, templateId, null, incident.getSpecialClassId(), "");
+            MessageContent = String.format("您有一条待办提醒(批次:%s,序号:%s),请登录双优督办平台手机端查看。(http://39.104.144.104/excellent-mobile)",incident.getBatch(),incident.getSerialNo());
+            sendSMSing(MessageContent, templateId, null, incident.getSpecialClassId(), "");
             //发送交办单位短信
             templateId = "2431012137069";
-            MessageContent = "您有一条待办提醒,请登录双优督办平台电脑端查看。(http://39.104.144.104/excellent-portal)";
-//            sendSMSing(MessageContent, templateId, incidentStep.getOrgId(), null, "");
+            MessageContent = String.format("您有一条待办提醒(批次:%s,序号:%s),请登录双优督办平台电脑端查看。(http://39.104.144.104/excellent-portal)",incident.getBatch(),incident.getSerialNo());
+            sendSMSing(MessageContent, templateId, incident.getOrgId(), null, "");
         }
 
         log.warn("定时任务:提醒短信结束");