101captain
2022-05-07 084176b0a99bf0d795ce66727bd85e6c960a982a
Merge remote-tracking branch 'origin/huacheng' into huacheng
6个文件已修改
149 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/acid/ComActAcidDangerMemberDTO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/acid/ComActAcidDangerMemberVO.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/ComActAcidDangerMember.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActAcidRecordServiceImpl.java 71 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComPropertyPublicityServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActAcidDangerMemberMapper.xml 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/acid/ComActAcidDangerMemberDTO.java
@@ -52,6 +52,15 @@
    @ApiModelProperty(value = "当前处理情况 1:集中隔离 2:居家隔离 3:健康监测 4:失联或尚需追踪 5:排除风险 6:暂未管控")
    private Integer status;
    @ApiModelProperty(value = "风险类别")
    private String riskType;
    @ApiModelProperty("有无住址 0无 1有")
    private Integer isAddress;
    @ApiModelProperty(value = "在攀居住地")
    private String localCity;
    @ApiModelProperty(value = "绑定单位", hidden = true)
    private String relationName;
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/acid/ComActAcidDangerMemberVO.java
@@ -87,6 +87,10 @@
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date checkTime;
    @ApiModelProperty(value = "报备时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date reportTime;
    /**
     * 身份证
     */
@@ -99,4 +103,13 @@
    @ApiModelProperty(value = "绑定单位")
    private String relationName;
    @ApiModelProperty(value = "定位地址")
    private String realAddress;
    @ApiModelProperty(value = "风险类别")
    private String riskType;
    @ApiModelProperty(value = "在攀居住地")
    private String localCity;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/ComActAcidDangerMember.java
@@ -95,4 +95,18 @@
    @ApiModelProperty(value = "绑定单位")
    private String relationName;
    /**
     * 风险类别
     */
    @ApiModelProperty(value = "风险类别")
    private String riskType;
    public interface RiskType {
        String COLOR = "红码或黄码";
        String STAR= "行程卡带星";
        String HIGH = "中高风险区返回";
        String OUT = "境外返回";
        String TEST = "核酸呈阳性";
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActAcidRecordServiceImpl.java
@@ -5,12 +5,9 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.dtos.community.acid.ComActAcidRecordDTO;
import com.panzhihua.common.model.dtos.property.CommonPage;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.acid.*;
import com.panzhihua.common.service.user.UserService;
@@ -21,7 +18,6 @@
import com.panzhihua.service_community.entity.ComActAcidDangerMember;
import com.panzhihua.service_community.entity.ComActAcidRecord;
import com.panzhihua.service_community.dao.ComActAcidRecordDao;
import com.panzhihua.service_community.model.dos.ComActDO;
import com.panzhihua.service_community.service.ComActAcidRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
@@ -117,12 +113,13 @@
            if (StringUtils.inStringIgnoreCase(colorMark, "红码", "黄码") || travelCard.equals("是")
                    || dangerArea.equals("是") || outsideCity.equals("是") || acidTest.equals("阳性")) {
                //风险人员
                saveAcidDangerMember(comActAcidRecordVO, comActAcidRecord.getId(), 1);
                String riskType = retrieveRiskType(colorMark, travelCard, dangerArea, outsideCity, acidTest);
                saveAcidDangerMember(comActAcidRecordVO, comActAcidRecord.getId(), 1, riskType);
                return R.ok();
            }
            if (StringUtils.isEmpty(comActAcidRecordVO.getLocalCity())) {
                //未填住址人员
                saveAcidDangerMember(comActAcidRecordVO, comActAcidRecord.getId(), 2);
                saveAcidDangerMember(comActAcidRecordVO, comActAcidRecord.getId(), 2, null);
            }
            return R.ok();
        }
@@ -130,7 +127,32 @@
        return R.fail("操作失败,请重新尝试");
    }
    private void saveAcidDangerMember(ComActAcidRecordVO comActAcidRecordVO, Long recordId, Integer type) {
    private String retrieveRiskType(String colorMark, String travelCard, String dangerArea, String outsideCity, String acidTest) {
        StringBuilder riskType = new StringBuilder();
        if (StringUtils.inStringIgnoreCase(colorMark, "红码", "黄码")) {
            riskType.append(",");
            riskType.append(ComActAcidDangerMember.RiskType.COLOR);
        }
        if (travelCard.equals("是")) {
            riskType.append(",");
            riskType.append(ComActAcidDangerMember.RiskType.STAR);
        }
        if (dangerArea.equals("是")) {
            riskType.append(",");
            riskType.append(ComActAcidDangerMember.RiskType.HIGH);
        }
        if (outsideCity.equals("是")) {
            riskType.append(",");
            riskType.append(ComActAcidDangerMember.RiskType.OUT);
        }
        if (acidTest.equals("阳性")) {
            riskType.append(",");
            riskType.append(ComActAcidDangerMember.RiskType.TEST);
        }
        return riskType.substring(1);
    }
    private void saveAcidDangerMember(ComActAcidRecordVO comActAcidRecordVO, Long recordId, Integer type, String riskType) {
        String localCity = comActAcidRecordVO.getLocalCity();
        String relationName = "panzhihua";
        if (isNotEmpty(localCity)) {
@@ -158,6 +180,7 @@
            dangerMember.setType(type);
            dangerMember.setRelationName(relationName);
            dangerMember.setCreateTime(new Date());
            dangerMember.setRiskType(riskType);
            comActAcidDangerMemberDao.insert(dangerMember);
        } else {
            dangerMember.setName(comActAcidRecordVO.getName());
@@ -169,6 +192,7 @@
            dangerMember.setType(type);
            dangerMember.setRelationName(relationName);
            dangerMember.setUpdateTime(new Date());
            dangerMember.setRiskType(riskType);
            comActAcidDangerMemberDao.updateById(dangerMember);
        }
        ComActAcidDangerMemberVO dangerMemberVO = new ComActAcidDangerMemberVO();
@@ -212,19 +236,26 @@
    @Override
    public R updateLocalCity(ComActAcidRecordVO comActAcidRecordVO) {
        ComActAcidRecord comActAcidRecord=new ComActAcidRecord();
        BeanUtils.copyProperties(comActAcidRecordVO,comActAcidRecord);
        if(StringUtils.isNotEmpty(comActAcidRecord.getLocalCity())){
            ComActAcidDangerMember comActAcidDangerMember= comActAcidDangerMemberDao.selectOne(new QueryWrapper<ComActAcidDangerMember>().lambda().eq(ComActAcidDangerMember::getRecordId,comActAcidRecordVO.getId()));
            if(comActAcidDangerMember!=null){
                if(comActAcidDangerMember.getType()==2){
                    this.comActAcidDangerMemberDao.deleteById(comActAcidDangerMember.getId());
                }
                else {
                    comActAcidDangerMember.setRelationName(comActAcidRecord.getLocalCity());
                    this.comActAcidDangerMemberDao.updateById(comActAcidDangerMember);
                }
            }
        ComActAcidRecord comActAcidRecord = new ComActAcidRecord();
        BeanUtils.copyProperties(comActAcidRecordVO, comActAcidRecord);
        ComActAcidDangerMember comActAcidDangerMember =
            comActAcidDangerMemberDao.selectOne(new QueryWrapper<ComActAcidDangerMember>().lambda()
                .eq(ComActAcidDangerMember::getRecordId, comActAcidRecordVO.getId()));
        String colorMark = comActAcidRecordVO.getColorMark();
        String travelCard = comActAcidRecordVO.getTravelCard();
        String dangerArea = comActAcidRecordVO.getDangerArea();
        String outsideCity = comActAcidRecordVO.getOutsideCity();
        String acidTest = comActAcidRecordVO.getAcidTest();
        if (StringUtils.inStringIgnoreCase(colorMark, "红码", "黄码") || travelCard.equals("是") || dangerArea.equals("是")
            || outsideCity.equals("是") || acidTest.equals("阳性")) {
            // 风险人员
            String riskType = retrieveRiskType(colorMark, travelCard, dangerArea, outsideCity, acidTest);
            saveAcidDangerMember(comActAcidRecordVO, comActAcidRecord.getId(), 1, riskType);
        } else if (StringUtils.isEmpty(comActAcidRecordVO.getLocalCity())) {
            // 未填住址人员
            saveAcidDangerMember(comActAcidRecordVO, comActAcidRecord.getId(), 2, null);
        } else if (comActAcidDangerMember != null && comActAcidDangerMember.getType() == 2) {
            this.comActAcidDangerMemberDao.deleteById(comActAcidDangerMember.getId());
        }
        return R.ok(this.baseMapper.updateById(comActAcidRecord));
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComPropertyPublicityServiceImpl.java
@@ -64,7 +64,7 @@
        } else {
            //非物业用户查看是否拥有菜单权限
            List<String> menuList = this.baseMapper.retrieveUserMenuList(userId);
            if (menuList.isEmpty() || !menuList.contains("物业宣传")) {
            if (menuList.isEmpty() || !menuList.contains("物业宣传栏")) {
                return R.fail("暂无权限");
            }
        }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActAcidDangerMemberMapper.xml
@@ -13,11 +13,14 @@
        <result property="type" column="type"/>
        <result property="updateTime" column="update_time"/>
        <result property="relationName" column="relation_name"/>
        <result property="riskType" column="risk_type"/>
    </resultMap>
    <select id="pageList" resultType="com.panzhihua.common.model.vos.community.acid.ComActAcidDangerMemberVO">
        SELECT t1.id, t1.`name`, t1.`status`, t1.record_id, t1.phone, t1.source, MAX(t3.create_time) AS checkTime
        SELECT t1.id, t1.`name`, t1.`status`, t1.record_id, t1.phone, t1.risk_type, t2.local_city,
        t1.source, t2.create_time AS reportTime, t2.real_address, MAX(t3.create_time) AS checkTime
        FROM com_act_acid_danger_member t1
        LEFT JOIN com_act_acid_record t2 ON t1.record_id = t2.id
        LEFT JOIN com_act_acid_check_record t3 ON t1.id = t3.member_id
        <where>
            <if test="commonPage.keyword!=null and commonPage.keyword !=''">
@@ -37,16 +40,41 @@
            <if test="commonPage.relationName !=null and commonPage.relationName !='' and commonPage.relationName !='panzhihua'">
                and t1.relation_name like concat('%',#{commonPage.relationName},'%')
            </if>
            <if test="commonPage.isAddress !=null">
                <if test="commonPage.isAddress == 0">
                    and t2.local_city is null
                </if>
                <if test="commonPage.isAddress == 1">
                    and t2.local_city is not null
                </if>
            </if>
            <if test="commonPage.localCity !=null and commonPage.localCity !='' and commonPage.localCity !='panzhihua'">
                and t2.local_city like concat('%',#{commonPage.localCity},'%')
            </if>
            <if test="commonPage.riskType != null and commonPage.riskType != &quot;&quot;">
                AND t1.risk_type LIKE CONCAT('%', #{commonPage.riskType}, '%')
            </if>
        </where>
        GROUP BY t1.id
        HAVING 1=1
        <if test="commonPage.startTime!=null">
            and checkTime >= #{commonPage.startTime}
        <if test="commonPage.type == 1">
            <if test="commonPage.startTime!=null">
                AND checkTime >= #{commonPage.startTime}
            </if>
            <if test="commonPage.stopTime!=null">
                AND concat(SUBSTR(#{commonPage.stopTime} FROM 1 FOR 10),' 23:59:59') >= checkTime
            </if>
            order by checkTime desc
        </if>
        <if test="commonPage.stopTime!=null">
            and  concat(SUBSTR(#{commonPage.stopTime} FROM 1 FOR 10),' 23:59:59') >= checkTime
        <if test="commonPage.type == 2">
            <if test="commonPage.startTime!=null">
                AND reportTime >= #{commonPage.startTime}
            </if>
            <if test="commonPage.stopTime!=null">
                AND concat(SUBSTR(#{commonPage.stopTime} FROM 1 FOR 10),' 23:59:59') >= reportTime
            </if>
            order by reportTime desc
        </if>
        order by checkTime desc
    </select>
    <select id="pageDangerMember"
            resultType="com.panzhihua.common.model.vos.community.acid.ComActAcidDangerMemberVO">