screen-api/src/main/java/com/moral/api/controller/AllocationController.java
@@ -8,6 +8,7 @@ import org.apache.commons.collections4.CollectionUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.moral.api.entity.AllocationLog; import com.moral.api.pojo.enums.SysDictTypeEnum; import com.moral.api.pojo.ext.allocation.AllocationExt; import com.moral.api.pojo.ext.allocation.AllocationPageExt; import com.moral.api.pojo.query.allocation.*; screen-api/src/main/java/com/moral/api/pojo/enums/SysDictTypeEnum.java
@@ -41,6 +41,7 @@ SYS_DEVICE("DEVICE","设备秒机数据"), SYS_AMEND("AMEND","立行立改修改数据"), ; screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationPageExt.java
@@ -29,6 +29,10 @@ @ApiModelProperty(value = "状态名字") private String stateName; @ApiModelProperty(value = "pc端修改权限标识") private String isCode; //上报单位名字 private String escalationUnitName; } screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationPageCond.java
@@ -25,13 +25,13 @@ public class AllocationPageCond implements Serializable{ @ApiModelProperty(value = "责任单位id") private Integer unitId; private List<Integer> unitId; @ApiModelProperty(value = "污染分类id") private Integer polluteType; private List<Integer> polluteType; @ApiModelProperty(value = "流程状态") private Integer state; private List<Integer> state; @ApiModelProperty(value = "排查方式id") private Integer investigationType; screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationPageVo.java
@@ -99,6 +99,9 @@ @ApiModelProperty(value = "能否审批") private Integer isApprove; @ApiModelProperty(value = "pc端修改权限标识") private String isCode; public static AllocationPageVo convert(AllocationPageExt allocationPageExt) { AllocationPageVo allocationPageVo = BeanConverts.convert(allocationPageExt, AllocationPageVo.class); return allocationPageVo; screen-api/src/main/java/com/moral/api/service/AllocationService.java
@@ -153,4 +153,11 @@ * @return */ List<AllocationLog> getLog(String allocationNum); /** * 根据字典名称获取权限 空值无权,有值有权 * @param code * @return */ List<Integer> getUnitAuthority(String code); } screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java
@@ -222,32 +222,7 @@ } } // Map<String, Object> userInfo = (Map<String, Object>) TokenUtils.getUserInfo(); // Object unitId = userInfo.get("unitId"); // Map<String, Object> orgInfo = (Map<String, Object>) userInfo.get("organization"); // Integer orgId = (Integer) orgInfo.get("id"); // if (!ObjectUtils.isEmpty(map.get("unitId"))){ // wrapper.in("unit_id",map.get("unitId").toString()); // }else { // if (orgId!=24){ // if (ObjectUtils.isEmpty(unitId)){ // return null; // } // ResponsibilityUnit responsibilityUnit1 = responsibilityUnitMapper.selectById(Integer.parseInt(unitId.toString())); // Integer areaCode = responsibilityUnit1.getAreaCode(); // List<ResponsibilityUnit> responsibilityUnits = responsibilityUnitService.selectUnit(areaCode); // if (ObjectUtils.isEmpty(responsibilityUnits)){ // List<ResponsibilityUnit> responsibilityUnits1 = responsibilityUnitService.selectAreaUnit(areaCode); // Map<Integer, List<ResponsibilityUnit>> collect = responsibilityUnits1.stream().collect(Collectors.groupingBy(o -> o.getUnitId())); // List<Integer> collect1 = collect.keySet().stream().collect(Collectors.toList()); // wrapper.in("unit_id",collect1); // }else { // Map<Integer, List<ResponsibilityUnit>> collect = responsibilityUnits.stream().collect(Collectors.groupingBy(o -> o.getUnitId())); // List<Integer> collect1 = collect.keySet().stream().collect(Collectors.toList()); // wrapper.in("unit_id",collect1); // } // } // } HashMap<String, Object> rsMap = new HashMap<>(); ArrayList<Map<String, Object>> polluteArrayList = new ArrayList<>(); @@ -405,29 +380,7 @@ } } } // Map<String, Object> userInfo = (Map<String, Object>) TokenUtils.getUserInfo(); // Object unitId = userInfo.get("unitId"); // Map<String, Object> orgInfo = (Map<String, Object>) userInfo.get("organization"); // Integer orgId = (Integer) orgInfo.get("id"); // // if (ObjectUtils.isEmpty(unitId)){ // return null; // } // if (orgId!=24){ // ResponsibilityUnit responsibilityUnit1 = responsibilityUnitMapper.selectById(Integer.parseInt(unitId.toString())); // Integer areaCode = responsibilityUnit1.getAreaCode(); // List<ResponsibilityUnit> responsibilityUnits = responsibilityUnitService.selectUnit(areaCode); // if (ObjectUtils.isEmpty(responsibilityUnits)){ // List<ResponsibilityUnit> responsibilityUnits1 = responsibilityUnitService.selectAreaUnit(areaCode); // Map<Integer, List<ResponsibilityUnit>> collect = responsibilityUnits1.stream().collect(Collectors.groupingBy(o -> o.getUnitId())); // List<Integer> collect1 = collect.keySet().stream().collect(Collectors.toList()); // wrapper.in("unit_id",collect1); // }else { // Map<Integer, List<ResponsibilityUnit>> collect = responsibilityUnits.stream().collect(Collectors.groupingBy(o -> o.getUnitId())); // List<Integer> collect1 = collect.keySet().stream().collect(Collectors.toList()); // wrapper.in("unit_id",collect1); // } // } ArrayList<Map<String, Object>> rsMap = new ArrayList<>(); Object number1 = map.get("number"); @@ -496,6 +449,7 @@ @Override public Page<AllocationPageExt> extPage(AllocationPageCond allocationPageCond) { List<Integer> unitAuthority = this.getUnitAuthority(SysDictTypeEnum.SYS_AMEND.value); List<Integer> unitList = unitResult(); Integer codeId = unitAreaCode(); allocationPageCond.setUnitList(unitList); @@ -507,6 +461,7 @@ }else { it.setIsApprove(0); } it.setIsCode(ObjectUtils.isEmpty(unitAuthority)?"2":"1"); }); } return page; @@ -979,6 +934,19 @@ return allocationLogs; } /** * 根据字典名称获取权限 * * @param code * @return */ @Override public List<Integer> getUnitAuthority(String code) { QxUser user = UserHelper.getCurrentUser(); List<Integer> userList = responsibilityUnitMapper.selectCodeList(code,user.getUserId()); return userList; } @Override public List<Integer> unitResult() { QxUser user = UserHelper.getCurrentUser(); screen-api/src/main/resources/mapper/AllocationMapper.xml
@@ -67,14 +67,23 @@ left join allocation_extension t1 on t1.allocation_id = allocation.allocation_id and t1.is_del =0 and t1.is_invalid = 0 and t1.state = 30 <where> 1 = 1 and allocation.is_del = 0 <if test="allocation.unitId != null"> and allocation.unit_id = #{allocation.unitId} <if test="allocation.unitId != null and allocation.unitId.size != 0"> and allocation.unit_id in <foreach collection="allocation.unitId" item="id" index="index" open="(" close=")" separator=","> #{id} </foreach> </if> <if test="allocation.polluteType != null and allocation.polluteType != 0"> and allocation.pollute_type = #{allocation.polluteType} <if test="allocation.polluteType != null and allocation.polluteType.size != 0"> and allocation.pollute_type in <foreach collection="allocation.polluteType" item="id" index="index" open="(" close=")" separator=","> #{id} </foreach> </if> <if test="allocation.state != null and allocation.state != 0"> and allocation.state = #{allocation.state} <if test="allocation.state != null and allocation.state.size != 0"> and allocation.state in <foreach collection="allocation.state" item="id" index="index" open="(" close=")" separator=","> #{id} </foreach> </if> <if test="allocation.investigationType != null and allocation.investigationType != 0"> and allocation.investigation_type = #{allocation.investigationType}