Commit 69eb8a3f authored by 王果's avatar 王果

21052 改造告知限制设备不能多次出现在执行的流程中

parent a9f7b20e
package com.yeejoin.amos.boot.module.jg.api.mapper; package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgReformNoticeDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgReformNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgReformNotice; import com.yeejoin.amos.boot.module.jg.api.entity.JgReformNotice;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo; import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
...@@ -40,4 +41,6 @@ public interface JgReformNoticeMapper extends CustomBaseMapper<JgReformNotice> { ...@@ -40,4 +41,6 @@ public interface JgReformNoticeMapper extends CustomBaseMapper<JgReformNotice> {
List<Map<String, Object>> queryEquipInformation(@Param("sequenceNbr") long sequenceNbr); List<Map<String, Object>> queryEquipInformation(@Param("sequenceNbr") long sequenceNbr);
void updatePromoter(@Param("id") Long id); void updatePromoter(@Param("id") Long id);
List<CompanyEquipCountDto> queryForFlowingEquipList();
} }
...@@ -203,4 +203,16 @@ ...@@ -203,4 +203,16 @@
set promoter = null set promoter = null
where sequence_nbr = #{id} where sequence_nbr = #{id}
</update> </update>
<select id="queryForFlowingEquipList" resultType="com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto">
select
a.install_unit_credit_code as companyCode,
group_concat(b.equ_id) as records
from
tzs_jg_reform_notice a,
tzs_jg_reform_notice_eq b
where
a.sequence_nbr = b.equip_transfer_id
and a.notice_status not in('6614','6615','6610','6617','6616')
GROUP BY a.install_unit_credit_code
</select>
</mapper> </mapper>
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgReformNoticeMapper;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RBucket;
import org.redisson.api.RedissonClient;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* @author Administrator
*/
@Component
@Slf4j
public class ReformNoticeEquipUsedCheckImpl extends BaseEquipUsedCheckService {
private RedissonClient redissonClient;
private String bizType = "renovationNoticeNew";
private JgReformNoticeMapper reformNoticeMapper;
public ReformNoticeEquipUsedCheckImpl(RedissonClient redissonClient, JgReformNoticeMapper reformNoticeMapper) {
this.redissonClient = redissonClient;
this.reformNoticeMapper = reformNoticeMapper;
}
@Override
public RedissonClient getRedisClient() {
return redissonClient;
}
@Override
public String getApplyBizType() {
return bizType;
}
@Override
public void init() {
// 初始化已经完成或者在流程中安装告知的设备数据
List<CompanyEquipCountDto> companyEquipCountDtos = reformNoticeMapper.queryForFlowingEquipList();
companyEquipCountDtos.forEach(c -> {
RBucket<Set<String>> rBucket = redissonClient.getBucket(getFlowingEquipRedisKey(c.getCompanyCode(), bizType));
rBucket.set(Arrays.stream(c.getRecords().split(",")).collect(Collectors.toSet()));
});
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment