cjl
2023-09-27 b8fe4c7b5f4f03dcfadff95702a07040ab9a1b57
feat:补充提交
1 files added
9 files modified
108 ■■■■■ changed files
screen-api/src/main/java/com/moral/api/mapper/ResponsibilityUnitMapper.java 15 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationPageCond.java 4 ●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/query/allocationextension/AllocationExtensionPageCond.java 4 ●●●● 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 4 ●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java 22 ●●●●● patch | view | raw | blame | history
screen-api/src/main/resources/mapper/AllocationExtensionMapper.xml 6 ●●●●● patch | view | raw | blame | history
screen-api/src/main/resources/mapper/AllocationMapper.xml 7 ●●●●● patch | view | raw | blame | history
screen-api/src/main/resources/mapper/ResponsibilityUnitMapper.xml 42 ●●●●● patch | view | raw | blame | history
screen-api/src/main/resources/mapper/UserMapper.xml 2 ●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/mapper/ResponsibilityUnitMapper.java
@@ -3,6 +3,21 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.moral.api.entity.ResponsibilityUnit;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ResponsibilityUnitMapper extends BaseMapper<ResponsibilityUnit> {
    /**
     * 查询责任单位id
     * @param id
     * @return
     */
    List<Integer> selectResultList(@Param("id") Integer id);
    /**
     * 查询字典id
     */
    List<Integer> selectCodeList(@Param("code") String code,@Param("id") Integer id);
}
screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationPageCond.java
@@ -8,6 +8,7 @@
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
/**
 * <p>
@@ -51,4 +52,7 @@
    @ApiModelProperty(value = "分页参数")
    private PageCond page;
    @ApiModelProperty(value = "责任单位list")
    private List<Integer> unitList;
}
screen-api/src/main/java/com/moral/api/pojo/query/allocationextension/AllocationExtensionPageCond.java
@@ -8,6 +8,7 @@
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
/**
 * <p>
@@ -46,4 +47,7 @@
    @ApiModelProperty(value = "分页参数")
    private PageCond page;
    @ApiModelProperty(value = "责任单位list")
    private List<Integer> unitList;
}
screen-api/src/main/java/com/moral/api/service/AllocationService.java
@@ -29,6 +29,8 @@
    List<Allocation> selectAll(Map<String,Object> map);
    List<Integer> unitResult();
    Map<String, Object> selectUnitView(Map<String,Object> map);
screen-api/src/main/java/com/moral/api/service/impl/AllocationExtensionServiceImpl.java
@@ -20,6 +20,8 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
 * <p>
 * 交办单延期 服务实现类
@@ -64,6 +66,8 @@
    @Override
    public Page<AllocationExtensionPageExt> extPage(AllocationExtensionPageCond allocationExtensionPageCond) {
        List<Integer> unitList = allocationService.unitResult();
        allocationExtensionPageCond.setUnitList(unitList);
        return this.baseMapper.extPage(allocationExtensionPageCond.getPage().convertPage(), allocationExtensionPageCond);
    }
screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java
@@ -18,6 +18,7 @@
import com.moral.api.service.AllocationExtensionService;
import com.moral.api.service.ApproveTableService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
@@ -69,9 +70,9 @@
    @Autowired
    private SysDictTypeMapper sysDictTypeMapper;
    @Autowired
    private SysDictDataMapper sysDictDataMapper;
    @Autowired
    private ResponsibilityUnitMapper responsibilityUnitMapper;
    @Autowired
    private SysDictDataMapper sysDictDataMapper;
    @Autowired
    private RedisTemplate redisTemplate;
    @Autowired
@@ -455,6 +456,8 @@
    @Override
    public Page<AllocationPageExt> extPage(AllocationPageCond allocationPageCond) {
        List<Integer> unitList = unitResult();
        allocationPageCond.setUnitList(unitList);
        return this.baseMapper.extPage(allocationPageCond.getPage().convertPage(), allocationPageCond);
    }
@@ -576,4 +579,19 @@
        fileTableService.upDateResult(allocationExtensionAddCond.getFileList(),allocationExtension.getId(), FileTableEnum.ALLOCATION_EXTENSION.value);
        return true;
    }
    @Override
    public List<Integer>  unitResult() {
        QxUser user = UserHelper.getCurrentUser();
        Integer unitId = Objects.nonNull(user.getUnitId())?user.getUnitId():0;
        List<Integer> userList = responsibilityUnitMapper.selectCodeList("JBD",user.getUserId());
        if(CollectionUtils.isNotEmpty(userList)){
            return new ArrayList<>();
        }
        userList = responsibilityUnitMapper.selectResultList(unitId);
        if(CollectionUtils.isNotEmpty(userList)){
            return userList;
        }
        return Arrays.asList(0);
    }
}
screen-api/src/main/resources/mapper/AllocationExtensionMapper.xml
@@ -64,6 +64,12 @@
            <if test="allocation.endTime != null and allocation.endTime !='' ">
                and date(t1.escalation_time) <![CDATA[<=]]>  #{allocation.endTime}
            </if>
            <if test="allocation.unitList != null and allocation.unitList.size !=0">
                and t1.unit_id in
                <foreach collection="allocation.unitList" item="id" index="index" open="(" close=")" separator=",">
                    #{id}
                </foreach>
            </if>
        </where>
        order by t1.escalation_time desc,t1.allocation_id desc
screen-api/src/main/resources/mapper/AllocationMapper.xml
@@ -90,6 +90,13 @@
            <if test="allocation.endTime != null and allocation.endTime !='' ">
                and date(allocation.escalation_time) <![CDATA[<=]]>  #{allocation.endTime}
            </if>
            <if test="allocation.unitList != null and allocation.unitList.size !=0">
                and allocation.unit_id in
                <foreach collection="allocation.unitList" item="id" index="index" open="(" close=")" separator=",">
                    #{id}
                </foreach>
            </if>
        </where>
        order by allocation.escalation_time desc,allocation.allocation_id desc
    </select>
screen-api/src/main/resources/mapper/ResponsibilityUnitMapper.xml
New file
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.moral.api.mapper.ResponsibilityUnitMapper">
    <select id="selectResultList" resultType="java.lang.Integer">
        select c.unit_id
        from responsibility_unit c where c.area_code in (
            SELECT area_code from sys_area where area_code = (select area_code from responsibility_unit where unit_id = #{id})
            union
            SELECT
                area_code
            FROM
                (
                    SELECT
                        t1.area_code,t1.area_name,
                        IF(FIND_IN_SET(parent_code,@pids), @pids := concat(@pids, ',', area_code), 0) as ischild
                    FROM
                        (
                            SELECT
                                area_code, parent_code, area_name
                            FROM
                                sys_area
                            ORDER BY area_code
                        )t1,
                        (SELECT @pids := (select area_code from responsibility_unit where unit_id = #{id})  ) t2
                )t3 where ischild != 0
    )
    </select>
    <select id="selectCodeList" resultType="java.lang.Integer">
        select t.id from sys_dict_type t
        left join sys_dict_data t1 on t1.dict_type_id = t.id
        where t.is_delete = 0 and t.name = #{code} and t1.dataKey = #{id} and t1.is_delete = 0
    </select>
</mapper>
screen-api/src/main/resources/mapper/UserMapper.xml
@@ -38,7 +38,7 @@
    <select id="selectUserInfo" resultMap="userInfoMap">
        SELECT u.id, u.account, u.password, u.user_name, u.email, u.mobile, u.wechat ,u.organization_id, u.expire_time, u.is_delete,u.is_Admin,
        o.name, o.location_level_code, o.expire_time org_expire_time,
        a.id group_id , a.group_name
        a.id group_id , a.group_name,u.unit_id
        FROM `user` u
        LEFT JOIN
            (SELECT ug.user_id,g.id,g.group_name FROM `user_group` ug ,`group` g WHERE ug.group_id=g.id   AND g.is_delete = 0