Kaynağa Gözat

人员管理
督查督办添加人员

jz.kai 4 yıl önce
ebeveyn
işleme
53cb084966

+ 4 - 0
common/src/main/java/com/jpsoft/supervision/modules/base/entity/Incident.java

@@ -73,6 +73,8 @@ public class Incident {
     private String stepOrgId;
     @ApiModelProperty(value = "责任单位名称")
     private String stepOrgName;
+    @ApiModelProperty(value = "责任人")
+    private String stepPersonId;
     @DateTimeFormat(pattern="yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
     @ApiModelProperty(value = "提醒时间")
@@ -85,6 +87,8 @@ public class Incident {
     private String subContent;
     @ApiModelProperty(value = "责任单位")
     private String subOrgId;
+    @ApiModelProperty(value = "责任单位")
+    private String subPersonId;
     @ApiModelProperty(value = "提醒时间")
     private Date subWarnTime;
 }

+ 4 - 0
common/src/main/java/com/jpsoft/supervision/modules/base/entity/IncidentStep.java

@@ -24,6 +24,10 @@ public class IncidentStep {
     private String orgId;
         @ApiModelProperty(value = "责任单位名称")
     private String orgName;
+        @ApiModelProperty(value = "责任人")
+    private String personId;
+        @ApiModelProperty(value = "责任人姓名")
+    private String personName;
         @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
 	    @ApiModelProperty(value = "提醒时间")

+ 2 - 0
common/src/main/java/com/jpsoft/supervision/modules/base/entity/Person.java

@@ -20,6 +20,8 @@ public class Person {
     private String id;
         @ApiModelProperty(value = "机构编号")
     private String orgId;
+        @ApiModelProperty(value = "机构名称")
+    private String orgName;
         @ApiModelProperty(value = "姓名")
     private String name;
         @ApiModelProperty(value = "电话")

+ 7 - 2
common/src/main/resources/mapper/base/IncidentStep.xml

@@ -7,6 +7,7 @@
 		<id property="id" column="id_" />
 			<result property="incidentId" column="incident_id" />
 			<result property="orgId" column="org_id" />
+			<result property="personId" column="person_id" />
 			<result property="warnTime" column="warn_time" />
 			<result property="content" column="content_" />
 			<result property="createTime" column="create_time" />
@@ -22,12 +23,13 @@
 	-->
 	<![CDATA[
 		insert into base_incident_step
-	    (id_,incident_id,org_id,warn_time,content_,create_time,create_by,update_time,update_by)
+	    (id_,incident_id,org_id,person_id,warn_time,content_,create_time,create_by,update_time,update_by)
 		values
 		(
 #{id,jdbcType=VARCHAR}
 ,#{incidentId,jdbcType=VARCHAR}
 ,#{orgId,jdbcType=VARCHAR}
+,#{personId,jdbcType=VARCHAR}
 ,#{warnTime,jdbcType= TIMESTAMP }
 ,#{content,jdbcType=VARCHAR}
 ,#{createTime,jdbcType= TIMESTAMP }
@@ -49,6 +51,9 @@
 				<if test="orgId!=null">
 		org_id=#{orgId,jdbcType=VARCHAR},
 		</if>
+			<if test="personId!=null">
+				person_id=#{personId,jdbcType=VARCHAR},
+			</if>
 				<if test="warnTime!=null">
 		warn_time=#{warnTime,jdbcType= TIMESTAMP },
 		</if>
@@ -72,7 +77,7 @@
 	</update>
 	<select id="get" parameterType="string" resultMap="IncidentStepMap">
 		select 
-id_,incident_id,org_id,warn_time,content_,create_time,create_by,update_time,update_by		from base_incident_step where id_=#{0}
+id_,incident_id,org_id,person_id,warn_time,content_,create_time,create_by,update_time,update_by		from base_incident_step where id_=#{0}
 	</select>
 	<select id="exist" parameterType="string" resultType="int">
 		select count(*) from base_incident_step where id_=#{0}

+ 9 - 2
common/src/main/resources/mapper/base/Person.xml

@@ -85,8 +85,15 @@ id_,org_id,name_,phone_,del_flag,create_time,create_by,update_time,update_by		fr
 			select * from base_person
 		]]>
 		<where>
-			<if test="searchParams.id != null">
-				and ID_ like #{searchParams.id}
+			and del_flag=0
+			<if test="searchParams.orgId != null">
+				and org_id = #{searchParams.orgId}
+			</if>
+			<if test="searchParams.name != null">
+				and name_ like #{searchParams.name}
+			</if>
+			<if test="searchParams.phone != null">
+				and phone_ like #{searchParams.phone}
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">

+ 4 - 0
web/src/main/java/com/jpsoft/supervision/modules/base/controller/IncidentController.java

@@ -109,6 +109,7 @@ public class IncidentController {
                     incidentStep.setId(UUID.randomUUID().toString());
                     incidentStep.setIncidentId(incident.getId());
                     incidentStep.setOrgId(incident.getStepOrgId());
+                    incidentStep.setPersonId(incident.getStepPersonId());
                     incidentStep.setWarnTime(incident.getStepWarnTime());
 //                    incidentStep.setContent(incident.getStepContent());
                     incidentStep.setCreateBy(subject);
@@ -181,6 +182,7 @@ public class IncidentController {
                 incident.setIncidentStepList(incidentStepList);
                 incident.setStepId(incidentStepList.get(0).getId());
                 incident.setStepOrgId(incidentStepList.get(0).getOrgId());
+                incident.setStepPersonId(incidentStepList.get(0).getPersonId());
                 incident.setStepWarnTime(incidentStepList.get(incidentStepList.size()-1).getWarnTime());
                 incident.setStepContent(incidentStepList.get(0).getContent());
 
@@ -255,6 +257,7 @@ public class IncidentController {
                 if(StringUtils.isNotEmpty(incident.getStepId())) {
                     IncidentStep incidentStep = incidentStepService.get(incident.getStepId());
                     incidentStep.setOrgId(incident.getStepOrgId());
+                    incidentStep.setPersonId(incident.getStepPersonId());
                     incidentStep.setWarnTime(incident.getStepWarnTime());
 //                    incidentStep.setContent(incident.getStepContent());
                     incidentStepService.update(incidentStep);
@@ -303,6 +306,7 @@ public class IncidentController {
                 incidentStepNext.setId(UUID.randomUUID().toString());
                 incidentStepNext.setIncidentId(incident.getId());
                 incidentStepNext.setOrgId(incident.getSubOrgId());
+                incidentStepNext.setPersonId(incident.getSubPersonId());
                 incidentStepNext.setWarnTime(incident.getSubWarnTime());
                 incidentStepNext.setCreateBy(subject);
                 incidentStepNext.setCreateTime(new Date());

+ 39 - 3
web/src/main/java/com/jpsoft/supervision/modules/base/controller/PersonController.java

@@ -1,6 +1,8 @@
 package com.jpsoft.supervision.modules.base.controller;
 
 import com.github.pagehelper.Page;
+import com.jpsoft.supervision.modules.base.entity.Organization;
+import com.jpsoft.supervision.modules.base.service.OrganizationService;
 import com.jpsoft.supervision.modules.common.utils.PojoUtils;
 import com.jpsoft.supervision.modules.common.dto.Sort;
 import com.jpsoft.supervision.modules.common.dto.MessageResult;
@@ -26,6 +28,8 @@ public class PersonController {
 
     @Autowired
     private PersonService personService;
+    @Autowired
+    private OrganizationService organizationService;
 
     @ApiOperation(value="创建空记录")
     @GetMapping("create")
@@ -196,7 +200,7 @@ public class PersonController {
     @ApiOperation(value="列表")
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
-            String id,
+            String orgId, String name, String phone,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             @RequestAttribute String subject){
@@ -211,15 +215,47 @@ public class PersonController {
         List<Sort> sortList = new ArrayList<>();
         sortList.add(new Sort("id_","asc"));
 
-        if (StringUtils.isNotEmpty(id)) {
-            searchParams.put("id","%" + id + "%");
+        if (StringUtils.isNotEmpty(orgId)) {
+            searchParams.put("orgId",orgId);
+        }
+        if (StringUtils.isNotEmpty(name)) {
+            searchParams.put("name","%" + name + "%");
+        }
+        if (StringUtils.isNotEmpty(phone)) {
+            searchParams.put("phone","%" + phone + "%");
         }
 
         Page<Person> page = personService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+        for(Person person : page.getResult()){
+            Organization organization = organizationService.get(person.getOrgId());
+            person.setOrgName(organization.getName());
+        }
 
         msgResult.setResult(true);
         msgResult.setData(PojoUtils.pageWrapper(page));
 
         return msgResult;
     }
+
+    @ApiOperation(value = "查询")
+    @RequestMapping(value = "query", method = RequestMethod.POST)
+    public MessageResult<List> query(String orgId, @RequestAttribute String subject) {
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        Map<String, Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("create_time", "asc"));
+
+        if (StringUtils.isNotEmpty(orgId)) {
+            searchParams.put("orgId", orgId);
+        }
+
+        Page<Person> page = personService.pageSearch(searchParams,1,1000,false,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(page.getResult());
+
+        return msgResult;
+    }
 }