cjl
2023-09-28 e94e5dbbfc544c558a09fb388e7f4d4341fe8ec4
ci:添加自有权限
11 files modified
65 ■■■■■ changed files
screen-api/src/main/java/com/moral/api/exception/consumer/CruiserDataConsumer.java 2 ●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/exception/consumer/SecondDataConsumer.java 2 ●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/mapper/ResponsibilityUnitMapper.java 2 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationPageExt.java 2 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/ext/allocationextension/AllocationExtensionPageExt.java 2 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationPageVo.java 2 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/vo/allocationextension/AllocationExtensionPageVo.java 3 ●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/AllocationService.java 2 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/impl/AllocationExtensionServiceImpl.java 14 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java 31 ●●●●● patch | view | raw | blame | history
screen-api/src/main/resources/mapper/ResponsibilityUnitMapper.xml 3 ●●●●● patch | view | raw | blame | history
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
@@ -35,7 +35,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
@@ -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>