Commit 332ba8bf authored by xixinzhao's avatar xixinzhao

消防监督检查计划修改

parent 62698a38
...@@ -223,7 +223,7 @@ public interface IOrgUsrService { ...@@ -223,7 +223,7 @@ public interface IOrgUsrService {
/** /**
* 获取登陆人关联机场单位人员信息,部门信息 * 获取登陆人关联机场单位人员信息,部门信息
*/ */
List<Map<String, Object>> getLoginUserDetails(String userId); List<Map<String, Object>> getLoginUserDetails(String userId, AgencyUserModel user);
List<OrgUsr> getPersonListByParentId(Long id); List<OrgUsr> getPersonListByParentId(Long id);
......
package com.yeejoin.amos.supervision.common.enums;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public enum PlanCheckLevelEnum {
DRAFT("单位级",0),
EXAMINE_ONE("公司级",1);
/**
* 名称
*/
private String name;
/**
* 值
*/
private int value;
private PlanCheckLevelEnum(String name, int value) {
this.name = name;
this.value = value;
}
public static String getName(int value) {
for (PlanCheckLevelEnum c : PlanCheckLevelEnum.values()) {
if (c.getValue() == value) {
return c.name;
}
}
return null;
}
public static int getValue(String name) {
for (PlanCheckLevelEnum c : PlanCheckLevelEnum.values()) {
if (c.getName().equals(name)) {
return c.value;
}
}
return -1;
}
public static PlanCheckLevelEnum getEnum(int value) {
for (PlanCheckLevelEnum c : PlanCheckLevelEnum.values()) {
if (c.getValue() == value) {
return c;
}
}
return null;
}
public static PlanCheckLevelEnum getEnum(String name) {
for (PlanCheckLevelEnum c : PlanCheckLevelEnum.values()) {
if (c.getName().equals(name)) {
return c;
}
}
return null;
}
public static List<Map<String,String>> getEnumList() {
List<Map<String,String>> nameList = new ArrayList<>();
for (PlanCheckLevelEnum c: PlanCheckLevelEnum.values()) {
Map<String, String> map = new HashMap<String, String>();
map.put("name", c.getName());
map.put("value", c.getValue() +"");
nameList.add(map);
}
return nameList;
}
public static List<String> getEnumNameList() {
List<String> nameList = new ArrayList<String>();
for (PlanCheckLevelEnum c: PlanCheckLevelEnum.values()) {
nameList.add(c.getName());
}
return nameList;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
}
package com.yeejoin.amos.supervision.common.enums;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public enum PlanStatusEnum {
DRAFT("草稿",0),
EXAMINE_ONE("一级待审核",1),
EXAMINE_TWO("二级待审核",2),
EXAMINE_THREE("三级待审核",3),
EXAMINE_FORMULATE("已审核/检查内容未制定",4),
EXAMINE_DEVELOPED("已审核/检查内容已制定",5);
/**
* 名称
*/
private String name;
/**
* 值
*/
private int value;
private PlanStatusEnum(String name, int value) {
this.name = name;
this.value = value;
}
public static String getName(int value) {
for (PlanStatusEnum c : PlanStatusEnum.values()) {
if (c.getValue() == value) {
return c.name;
}
}
return null;
}
public static int getValue(String name) {
for (PlanStatusEnum c : PlanStatusEnum.values()) {
if (c.getName().equals(name)) {
return c.value;
}
}
return -1;
}
public static PlanStatusEnum getEnum(int value) {
for (PlanStatusEnum c : PlanStatusEnum.values()) {
if (c.getValue() == value) {
return c;
}
}
return null;
}
public static PlanStatusEnum getEnum(String name) {
for (PlanStatusEnum c : PlanStatusEnum.values()) {
if (c.getName().equals(name)) {
return c;
}
}
return null;
}
public static List<Map<String,String>> getEnumList() {
List<Map<String,String>> nameList = new ArrayList<>();
for (PlanStatusEnum c: PlanStatusEnum.values()) {
Map<String, String> map = new HashMap<String, String>();
map.put("name", c.getName());
map.put("value", c.getValue() +"");
nameList.add(map);
}
return nameList;
}
public static List<String> getEnumNameList() {
List<String> nameList = new ArrayList<String>();
for (PlanStatusEnum c: PlanStatusEnum.values()) {
nameList.add(c.getName());
}
return nameList;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
}
...@@ -163,6 +163,13 @@ public class Plan extends BasicEntity { ...@@ -163,6 +163,13 @@ public class Plan extends BasicEntity {
*/ */
@Column(name="plan_type") @Column(name="plan_type")
private String planType; private String planType;
/**
* 检查级别
*/
@Column(name="check_level")
private String checkLevel;
/** /**
* 备注 * 备注
*/ */
...@@ -745,4 +752,12 @@ public class Plan extends BasicEntity { ...@@ -745,4 +752,12 @@ public class Plan extends BasicEntity {
public void setMakerUserDeptName(String makerUserDeptName) { public void setMakerUserDeptName(String makerUserDeptName) {
this.makerUserDeptName = makerUserDeptName; this.makerUserDeptName = makerUserDeptName;
} }
public String getCheckLevel() {
return checkLevel;
}
public void setCheckLevel(String checkLevel) {
this.checkLevel = checkLevel;
}
} }
\ No newline at end of file
...@@ -413,7 +413,7 @@ public class OrgUsrController extends BaseController { ...@@ -413,7 +413,7 @@ public class OrgUsrController extends BaseController {
if (StringUtils.isEmpty(userIds)) { if (StringUtils.isEmpty(userIds)) {
userIds = user.getUserId(); userIds = user.getUserId();
} }
List<Map<String, Object>> loginUserDetails = iOrgUsrService.getLoginUserDetails(userIds); List<Map<String, Object>> loginUserDetails = iOrgUsrService.getLoginUserDetails(userIds, user);
return ResponseHelper.buildResponse(loginUserDetails); return ResponseHelper.buildResponse(loginUserDetails);
} }
......
...@@ -1406,7 +1406,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1406,7 +1406,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override @Override
public List<Map<String, Object>> getLoginUserDetails (String userId) { public List<Map<String, Object>> getLoginUserDetails (String userId, AgencyUserModel user) {
// 获取登陆人关联账号 // 获取登陆人关联账号
List<OrgUsr> orgUsrs = getUsrList(userId); List<OrgUsr> orgUsrs = getUsrList(userId);
...@@ -1420,7 +1420,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1420,7 +1420,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
wrapper.eq(OrgUsr::getIsDelete, false); wrapper.eq(OrgUsr::getIsDelete, false);
wrapper.eq(BaseEntity::getSequenceNbr, orgUsr.getParentId()); wrapper.eq(BaseEntity::getSequenceNbr, orgUsr.getParentId());
OrgUsr one = this.getOne(wrapper); OrgUsr one = this.getOne(wrapper);
map.put("other",one); map.put(OrgPersonEnum.部门.getKey(),one);
map.put("AMOSUSER",user);
list.add(map); list.add(map);
}); });
......
...@@ -10,6 +10,7 @@ import com.yeejoin.amos.supervision.business.dao.mapper.RouteMapper; ...@@ -10,6 +10,7 @@ import com.yeejoin.amos.supervision.business.dao.mapper.RouteMapper;
import com.yeejoin.amos.supervision.business.dao.repository.*; import com.yeejoin.amos.supervision.business.dao.repository.*;
import com.yeejoin.amos.supervision.business.param.PlanInfoPageParam; import com.yeejoin.amos.supervision.business.param.PlanInfoPageParam;
import com.yeejoin.amos.supervision.business.service.intfc.IPlanService; import com.yeejoin.amos.supervision.business.service.intfc.IPlanService;
import com.yeejoin.amos.supervision.common.enums.PlanStatusEnum;
import com.yeejoin.amos.supervision.core.common.request.AddPlanRequest; import com.yeejoin.amos.supervision.core.common.request.AddPlanRequest;
import com.yeejoin.amos.supervision.core.common.response.PlanPointRespone; import com.yeejoin.amos.supervision.core.common.response.PlanPointRespone;
import com.yeejoin.amos.supervision.core.util.DateUtil; import com.yeejoin.amos.supervision.core.util.DateUtil;
...@@ -81,6 +82,10 @@ public class PlanServiceImpl implements IPlanService { ...@@ -81,6 +82,10 @@ public class PlanServiceImpl implements IPlanService {
Map<String, String> userIdNameMap = userModels.stream().collect(Collectors.toMap(AgencyUserModel::getUserId, AgencyUserModel::getRealName)); Map<String, String> userIdNameMap = userModels.stream().collect(Collectors.toMap(AgencyUserModel::getUserId, AgencyUserModel::getRealName));
content.forEach(c -> { content.forEach(c -> {
this.buildUserName(c, "createBy", userIdNameMap); this.buildUserName(c, "createBy", userIdNameMap);
if (c.containsKey("status")) {
String finishStatusDesc = PlanStatusEnum.getName(Integer.parseInt(c.get("status").toString()));
c.put("statusDesc", finishStatusDesc);
}
}); });
return new PageImpl<>(content, param, total); return new PageImpl<>(content, param, total);
} }
...@@ -110,7 +115,7 @@ public class PlanServiceImpl implements IPlanService { ...@@ -110,7 +115,7 @@ public class PlanServiceImpl implements IPlanService {
String orgCode = map.get("org_code") == null ? "" : map.get("org_code").toString(); String orgCode = map.get("org_code") == null ? "" : map.get("org_code").toString();
String userId = map.get("user_id") == null ? "" : map.get("user_id").toString(); String userId = map.get("user_id") == null ? "" : map.get("user_id").toString();
param.setOrgCode(orgCode); param.setOrgCode(orgCode);
param.setStatus(Byte.parseByte(XJConstant.PLAN_STATUS_STOP)); // param.setStatus(Byte.parseByte(XJConstant.PLAN_STATUS_STOP));
param.setNextGenDate(DateUtil.getIntervalDate(new Date(), 0)); param.setNextGenDate(DateUtil.getIntervalDate(new Date(), 0));
param.setCreateBy(userId); param.setCreateBy(userId);
addPlanRequest.setPlan(param); addPlanRequest.setPlan(param);
...@@ -144,7 +149,7 @@ public class PlanServiceImpl implements IPlanService { ...@@ -144,7 +149,7 @@ public class PlanServiceImpl implements IPlanService {
if (plan.getId()>0) { if (plan.getId()>0) {
// 删除相关点项内容 // 删除相关点项内容
iRoutePointDao.delRoutePointByRouteId(plan.getRouteId()); iRoutePointDao.delRoutePointByRouteId(plan.getRouteId());
iRoutePointItemDao.delRoutePointItem(plan.getRouteId()); // iRoutePointItemDao.delRoutePointItem(plan.getRouteId());
saveRoute.setId(plan.getRouteId()); saveRoute.setId(plan.getRouteId());
} }
...@@ -173,16 +178,16 @@ public class PlanServiceImpl implements IPlanService { ...@@ -173,16 +178,16 @@ public class PlanServiceImpl implements IPlanService {
iRoutePointDao.save(routePoint); iRoutePointDao.save(routePoint);
// List<PointInputItem> pointInputItems = pointMapper.getCheckPointById(point); // List<PointInputItem> pointInputItems = pointMapper.getCheckPointById(point);
List<PointInputItem> pointInputItems = iPointInputItemDao.getPointInputItemByPointId(point); // List<PointInputItem> pointInputItems = iPointInputItemDao.getPointInputItemByPointId(point);
pointMapper.getPointClassInputItemById(point); // pointMapper.getPointClassInputItemById(point);
if (!ObjectUtils.isEmpty(pointInputItems)) { // if (!ObjectUtils.isEmpty(pointInputItems)) {
pointInputItems.forEach(pointInputItem -> { // pointInputItems.forEach(pointInputItem -> {
RoutePointItem routePointItem = new RoutePointItem(); // RoutePointItem routePointItem = new RoutePointItem();
routePointItem.setRoutePointId(routePoint.getId()); // routePointItem.setRoutePointId(routePoint.getId());
routePointItem.setPointInputItemId(pointInputItem.getId()); // routePointItem.setPointInputItemId(pointInputItem.getId());
iRoutePointItemDao.save(routePointItem); // iRoutePointItemDao.save(routePointItem);
}); // });
} // }
}); });
} }
} }
......
...@@ -53,7 +53,7 @@ public class PersonIdentifyAspect { ...@@ -53,7 +53,7 @@ public class PersonIdentifyAspect {
ReginParams.PersonIdentity personIdentity = new ReginParams.PersonIdentity(); ReginParams.PersonIdentity personIdentity = new ReginParams.PersonIdentity();
if (!ObjectUtils.isEmpty(result)) { if (!ObjectUtils.isEmpty(result)) {
Map map = (Map)result.get(0); Map map = (Map)result.get(0);
Map other = (Map)map.get("other"); Map other = (Map)map.get("DEPARTMENT");
Map person = (Map)map.get("PERSON"); Map person = (Map)map.get("PERSON");
if (!ObjectUtils.isEmpty(person)) { if (!ObjectUtils.isEmpty(person)) {
personIdentity.setPersonSeq((String) person.get("sequenceNbr")); personIdentity.setPersonSeq((String) person.get("sequenceNbr"));
......
...@@ -119,12 +119,13 @@ ...@@ -119,12 +119,13 @@
WHERE WHERE
a.route_Id = b.id and a.is_delete = 0 a.route_Id = b.id and a.is_delete = 0
<if test="planName!=null"> and a.name like concat(concat("%",#{planName}),"%")</if> <if test="planName!=null"> and a.name like concat(concat("%",#{planName}),"%")</if>
<if test="planType!=null"> and a.plan_Type = #{planType}</if> <if test="checkTypeId!=null and checkTypeId != '' "> and a.check_type_id = #{checkTypeId}</if>
<if test="leadPerson!=null and leadPerson != '' "> and a.lead_people_ids = #{leadPerson}</if>
<if test="routeId!=null"> and a.route_Id = #{routeId}</if> <if test="routeId!=null"> and a.route_Id = #{routeId}</if>
<if test="remark!=null"> and a.remark like concat(concat("%",#{remark}),"%")</if> <if test="remark!=null"> and a.remark1 like concat(concat("%",#{remark}),"%")</if>
<if test="deptId!=null"> and a.dept_id = #{deptId}</if>
<if test="orgCode!=null"> and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if>
<if test="userId!=null"> and FIND_IN_SET(#{userId},a.user_id)</if> <if test="userId!=null"> and FIND_IN_SET(#{userId},a.user_id)</if>
<if test="orgCode!=null"> and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if>
<if test="ownerId!=null"> and b.owner_id = #{ownerId}</if>
</select> </select>
<!--巡检计划查询 --> <!--巡检计划查询 -->
<select id="getPlanInfo" resultType="java.util.HashMap"> <select id="getPlanInfo" resultType="java.util.HashMap">
...@@ -156,6 +157,7 @@ ...@@ -156,6 +157,7 @@
a.maker_user_id as makerUserId, a.maker_user_id as makerUserId,
a.maker_user_name as makerUserName, a.maker_user_name as makerUserName,
a.maker_user_dept_name as makerUserDeptName, a.maker_user_dept_name as makerUserDeptName,
a.check_level as checkLevel,
(select count(1) from p_route_point ppo where ppo.route_id = b.id) as totalPoint, (select count(1) from p_route_point ppo where ppo.route_id = b.id) as totalPoint,
(select count(1) from p_plan_task t where t.plan_id = a.id) as totalPlanTask, (select count(1) from p_plan_task t where t.plan_id = a.id) as totalPlanTask,
(select count(1) from p_plan_task t where t.plan_id = a.id and t.finish_status <![CDATA[<=]]> 1 ) as waitFinishPlanTask (select count(1) from p_plan_task t where t.plan_id = a.id and t.finish_status <![CDATA[<=]]> 1 ) as waitFinishPlanTask
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment