1 files added
9 files modified
| | |
| | | |
| | | 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); |
| | | } |
| | |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @ApiModelProperty(value = "分页参数") |
| | | private PageCond page; |
| | | |
| | | @ApiModelProperty(value = "责任单位list") |
| | | private List<Integer> unitList; |
| | | |
| | | } |
| | |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @ApiModelProperty(value = "分页参数") |
| | | private PageCond page; |
| | | |
| | | @ApiModelProperty(value = "责任单位list") |
| | | private List<Integer> unitList; |
| | | } |
| | |
| | | |
| | | List<Allocation> selectAll(Map<String,Object> map); |
| | | |
| | | List<Integer> unitResult(); |
| | | |
| | | |
| | | Map<String, Object> selectUnitView(Map<String,Object> map); |
| | | |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 交办单延期 服务实现类 |
| | |
| | | |
| | | @Override |
| | | public Page<AllocationExtensionPageExt> extPage(AllocationExtensionPageCond allocationExtensionPageCond) { |
| | | List<Integer> unitList = allocationService.unitResult(); |
| | | allocationExtensionPageCond.setUnitList(unitList); |
| | | return this.baseMapper.extPage(allocationExtensionPageCond.getPage().convertPage(), allocationExtensionPageCond); |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | @Autowired |
| | | private SysDictTypeMapper sysDictTypeMapper; |
| | | @Autowired |
| | | private SysDictDataMapper sysDictDataMapper; |
| | | @Autowired |
| | | private ResponsibilityUnitMapper responsibilityUnitMapper; |
| | | @Autowired |
| | | private SysDictDataMapper sysDictDataMapper; |
| | | @Autowired |
| | | private RedisTemplate redisTemplate; |
| | | @Autowired |
| | |
| | | |
| | | @Override |
| | | public Page<AllocationPageExt> extPage(AllocationPageCond allocationPageCond) { |
| | | List<Integer> unitList = unitResult(); |
| | | allocationPageCond.setUnitList(unitList); |
| | | return this.baseMapper.extPage(allocationPageCond.getPage().convertPage(), allocationPageCond); |
| | | } |
| | | |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | <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 |
| | |
| | | <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> |
New file |
| | |
| | | <?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> |
| | |
| | | <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 |