screen-api/src/main/java/com/moral/api/exception/consumer/CruiserDataConsumer.java
@@ -34,7 +34,7 @@ @Component //@Component @Slf4j public class CruiserDataConsumer implements ConsumerSeekAware { screen-api/src/main/java/com/moral/api/exception/consumer/SecondDataConsumer.java
@@ -38,7 +38,7 @@ @Component //@Component @Slf4j public class SecondDataConsumer implements ConsumerSeekAware { screen-api/src/main/java/com/moral/api/mapper/ResponsibilityUnitMapper.java
@@ -16,6 +16,8 @@ */ List<Integer> selectResultList(@Param("id") Integer id); String selectAreaCode(@Param("id") Integer id); /** * 查询字典id */ screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationPageExt.java
@@ -21,4 +21,6 @@ private Integer applyState; private Integer isApprove; } screen-api/src/main/java/com/moral/api/pojo/ext/allocationextension/AllocationExtensionPageExt.java
@@ -43,4 +43,6 @@ @ApiModelProperty(value = "上报人") private String escalationName; private Integer isApprove; } screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationPageVo.java
@@ -96,6 +96,8 @@ @ApiModelProperty(value = "能否申请延期") private Integer applyState; @ApiModelProperty(value = "能否审批") private Integer isApprove; public static AllocationPageVo convert(AllocationPageExt allocationPageExt) { AllocationPageVo allocationPageVo = BeanConverts.convert(allocationPageExt, AllocationPageVo.class); screen-api/src/main/java/com/moral/api/pojo/vo/allocationextension/AllocationExtensionPageVo.java
@@ -83,7 +83,8 @@ @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date updateTime; @ApiModelProperty(value = "能否审批") private Integer isApprove; public static AllocationExtensionPageVo convert(AllocationExtensionPageExt allocationExtensionPageExt) { AllocationExtensionPageVo allocationExtensionPageVo = BeanConverts.convert(allocationExtensionPageExt, AllocationExtensionPageVo.class); screen-api/src/main/java/com/moral/api/service/AllocationService.java
@@ -27,6 +27,8 @@ List<Integer> unitResult(); Integer unitAreaCode(); Map<String, Object> selectUnitView(Map<String,Object> map); List<Map<String,Object>> unitExel(Map<String,Object> map); screen-api/src/main/java/com/moral/api/service/impl/AllocationExtensionServiceImpl.java
@@ -16,6 +16,7 @@ import com.moral.api.service.AllocationExtensionService; import com.moral.api.service.AllocationService; import com.moral.api.service.FileTableService; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -68,7 +69,18 @@ public Page<AllocationExtensionPageExt> extPage(AllocationExtensionPageCond allocationExtensionPageCond) { List<Integer> unitList = allocationService.unitResult(); allocationExtensionPageCond.setUnitList(unitList); return this.baseMapper.extPage(allocationExtensionPageCond.getPage().convertPage(), allocationExtensionPageCond); Integer codeId = allocationService.unitAreaCode(); Page<AllocationExtensionPageExt> page = this.baseMapper.extPage(allocationExtensionPageCond.getPage().convertPage(), allocationExtensionPageCond); if(CollectionUtils.isNotEmpty(page.getRecords())){ page.getRecords().forEach(it->{ if((CollectionUtils.isEmpty(unitList)&&codeId.equals(1))||codeId.equals(2)){ it.setIsApprove(1); }else { it.setIsApprove(0); } }); } return page; } @Override screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java
@@ -271,7 +271,7 @@ String state = allocation.getState()+""; if (state.equals("40")||state.equals("50")){ complete++; }else if(state.equals("10")||state.equals("20") ||state.equals("30")) { }else { unComplete++; } } @@ -357,9 +357,9 @@ rsMap.put("unitView",allocationUnitViewDtos); //总数 rsMap.put("total",allocations.size()); //完成数 //已完成 rsMap.put("complete",complete); //未完成数 //进行中 rsMap.put("unComplete",unComplete); //预期 rsMap.put("overdue",overdue); @@ -472,8 +472,19 @@ @Override public Page<AllocationPageExt> extPage(AllocationPageCond allocationPageCond) { List<Integer> unitList = unitResult(); Integer codeId = unitAreaCode(); allocationPageCond.setUnitList(unitList); return this.baseMapper.extPage(allocationPageCond.getPage().convertPage(), allocationPageCond); Page<AllocationPageExt> page = this.baseMapper.extPage(allocationPageCond.getPage().convertPage(), allocationPageCond); if(CollectionUtils.isNotEmpty(page.getRecords())){ page.getRecords().forEach(it->{ if((CollectionUtils.isEmpty(unitList)&&codeId.equals(1))||codeId.equals(2)){ it.setIsApprove(1); }else { it.setIsApprove(0); } }); } return page; } @Override @@ -610,4 +621,22 @@ } return Arrays.asList(0); } @Override public Integer unitAreaCode() { QxUser user = UserHelper.getCurrentUser(); List<Integer> userList = responsibilityUnitMapper.selectCodeList("JBD",user.getUserId()); if(CollectionUtils.isNotEmpty(userList)){ return 1; } if(Objects.nonNull(user.getUnitId())){ String code = responsibilityUnitMapper.selectAreaCode(user.getUnitId()); if(code.length()>6){ return 0; }else { return 2; } } return 1; } } screen-api/src/main/resources/mapper/ResponsibilityUnitMapper.xml
@@ -38,5 +38,8 @@ </select> <select id="selectAreaCode" resultType="java.lang.String"> select area_code from responsibility_unit t where unit_id = #{id} </select> </mapper>