Commit 5eb3e947 authored by 王果's avatar 王果

21052 移装告知检验设备是否在流程中

parent 69eb8a3f
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.JgTransferNoticeDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgTransferNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice; import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo; import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
...@@ -26,4 +27,6 @@ public interface JgTransferNoticeMapper extends CustomBaseMapper<JgTransferNotic ...@@ -26,4 +27,6 @@ public interface JgTransferNoticeMapper extends CustomBaseMapper<JgTransferNotic
@MapKey("sequenceNbr") @MapKey("sequenceNbr")
List<Map<String, Object>> queryEquipInformation(@Param("sequenceNbr") long sequenceNbr); List<Map<String, Object>> queryEquipInformation(@Param("sequenceNbr") long sequenceNbr);
List<CompanyEquipCountDto> queryForFlowingEquipList();
} }
...@@ -217,4 +217,16 @@ ...@@ -217,4 +217,16 @@
tjtn.sequence_nbr = #{sequenceNbr} tjtn.sequence_nbr = #{sequenceNbr}
LIMIT 1 LIMIT 1
</select> </select>
<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_transfer_notice a,
tzs_jg_transfer_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.JgMaintainNoticeMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgTransferNoticeMapper;
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 TransferNoticeEquipUsedCheckImpl extends BaseEquipUsedCheckService {
private RedissonClient redissonClient;
private String bizType = "transferNotice";
private JgTransferNoticeMapper noticeMapper;
public TransferNoticeEquipUsedCheckImpl(RedissonClient redissonClient, JgTransferNoticeMapper noticeMapper) {
this.redissonClient = redissonClient;
this.noticeMapper = noticeMapper;
}
@Override
public RedissonClient getRedisClient() {
return redissonClient;
}
@Override
public String getApplyBizType() {
return bizType;
}
@Override
public void init() {
// 初始化已经完成或者在流程中安装告知的设备数据
List<CompanyEquipCountDto> companyEquipCountDtos = noticeMapper.queryForFlowingEquipList();
companyEquipCountDtos.forEach(c -> {
RBucket<Set<String>> rBucket = redissonClient.getBucket(getFlowingEquipRedisKey(c.getCompanyCode(), bizType));
rBucket.set(Arrays.stream(c.getRecords().split(",")).collect(Collectors.toSet()));
});
}
}
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
"name": "移装告知", "name": "移装告知",
"code": "GZ_YZ", "code": "GZ_YZ",
"image": "upload/tzs/common/image/移装告知.png", "image": "upload/tzs/common/image/移装告知.png",
"disabled": true "disabled": false
} }
], ],
"DJGL": [ "DJGL": [
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
"name": "移装变更登记", "name": "移装变更登记",
"code": "DJ_YZ", "code": "DJ_YZ",
"image": "upload/tzs/common/image/移装变更登记.png", "image": "upload/tzs/common/image/移装变更登记.png",
"disabled": true "disabled": false
}, },
{ {
"name": "单位变更登记", "name": "单位变更登记",
...@@ -88,16 +88,16 @@ ...@@ -88,16 +88,16 @@
"image": "upload/tzs/common/image/注销报废.png" "image": "upload/tzs/common/image/注销报废.png"
}, },
{ {
"name": "设备启用", "name": "启用",
"code": "SB_QY", "code": "SB_QY",
"image": "upload/tzs/common/image/设备启用.png", "image": "upload/tzs/common/image/设备启用.png",
"disabled": true "disabled": false
}, },
{ {
"name": "设备停用", "name": "停用",
"code": "SB_TY", "code": "SB_TY",
"image": "upload/tzs/common/image/设备停用.png", "image": "upload/tzs/common/image/设备停用.png",
"disabled": true "disabled": false
} }
], ],
"XZSB": [ "XZSB": [
......
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