huanghongfa
2021-09-23 64b490e08777edc2630d0f4eef3c9c5e67d4b1a0
微心愿优化接口改动
10个文件已修改
164 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActMicroWishVO.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/user/SysUserVO.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityActivityApi.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActMicroWishDO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActMicroWishService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMicroWishServiceImpl.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActMicroWishDOMapper.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActMicroWishVO.java
@@ -164,5 +164,11 @@
    @ApiModelProperty(value = "单张图片高度")
    private BigDecimal imgHeight;
    @ApiModelProperty(value = "微心愿分配人id集合")
    private List<Long> handleIds;
    @ApiModelProperty(value = "微心愿处理人id,多个以逗号隔开")
    private String handleId;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/user/SysUserVO.java
@@ -47,4 +47,30 @@
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastLoginTime;
    @ApiModelProperty("用户类型(用户类型 1 小程序 2 运营平台 3 社区平台 5 商家后台 6 网格综治APP 7 网格综治后台 8大屏 9城管后台 10一键报警app)")
    private Integer type;
    @ApiModelProperty("是否是志愿者(0.否  1.是)")
    private Integer isVolunteer;
    @ApiModelProperty("是否是党员(0.否  1.是)")
    private Integer isPartymember;
    /**
     * 用户类型(用户类型 1 小程序 2 运营平台 3 社区平台 5 商家后台 6 网格综治APP 7 网格综治后台 8大屏 9城管后台 10一键报警app)
     */
    public interface type{
        int xcx = 1;
        int yyht = 2;
        int sqht = 3;
    }
    /**
     * 是否枚举(0.否  1.是)
     */
    public interface isOk{
        int yes = 1;
        int no = 0;
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -6031,4 +6031,13 @@
     */
    @GetMapping("/comProperty/del")
    R comPropertyDelete(@RequestParam("id") Long id);
    /**
     * 微心愿处理人列表
     * @param communityId   社区id
     * @param type  处理人类型(1.后台用户  2.党员  3.志愿者)
     * @return  处理人列表
     */
    @GetMapping("/wish/handle/list/admin")
    R wishHandleListAdmin(@RequestParam(value = "communityId") Long communityId,@RequestParam("type") Integer type);
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityActivityApi.java
@@ -1044,4 +1044,15 @@
        BASE64Encoder encoder = new BASE64Encoder();
        return encoder.encode(data);
    }
    @ApiOperation(value = "查询微心愿处理人列表接口")
    @GetMapping("wish/handle/list")
    @ApiImplicitParam(name = "type", value = "处理人类型(1.后台用户  2.党员  3.志愿者)", required = true)
    public R wishHandleListAdmin(@RequestParam("type") Integer type) {
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        if (loginUserInfo == null) {
            return R.fail("请先登录");
        }
        return communityService.wishHandleListAdmin(loginUserInfo.getCommunityId(),type);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java
@@ -2435,4 +2435,15 @@
    public R easyPhotoNoHandleList(@RequestParam("communityId") Long communityId) {
        return comActEasyPhotoService.easyPhotoNoHandleList(communityId);
    }
    /**
     * 微心愿处理人列表
     * @param communityId   社区id
     * @param type  处理人类型(1.后台用户  2.党员  3.志愿者)
     * @return  处理人列表
     */
    @GetMapping("wish/handle/list/admin")
    public R wishHandleListAdmin(@RequestParam(value = "communityId") Long communityId,@RequestParam("type") Integer type){
        return R.ok(comActMicroWishService.wishHandleListAdmin(communityId,type));
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java
@@ -7,6 +7,7 @@
import com.panzhihua.common.model.vos.community.ComActMicroWishVO;
import com.panzhihua.common.model.vos.community.TodoEventsVO;
import com.panzhihua.common.model.vos.community.screen.work.MicroListVO;
import com.panzhihua.common.model.vos.user.SysUserVO;
import com.panzhihua.service_community.model.dos.ComActMicroWishDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -49,6 +50,7 @@
            "w.finish_at, " +
            "w.aim_num, " +
            "w.img_height, " +
            "w.handle_id, " +
            "w.create_at  " +
            "FROM " +
            "com_act_micro_wish w " +
@@ -136,6 +138,7 @@
            "w.evaluate_at, " +
            "w.img_width, " +
            "w.img_height, " +
            "w.handle_id, " +
            "w.evaluate  " +
            "FROM " +
            "com_act_micro_wish w " +
@@ -226,4 +229,14 @@
            "ORDER BY  camw.create_at desc "+
            " </script>")
    IPage<MicroListVO> getScreenMicroList(Page page, @Param("microListDTO") ScreenMicroListDTO microListDTO);
    /**
     * 微心愿处理人列表
     * @param communityId   社区id
     * @param type  处理人类型(1.后台用户  2.党员  3.志愿者)
     * @return  处理人列表
     */
    List<SysUserVO> getWishHandleListAdmin(@Param("type") Integer type,@Param("communityId") Long communityId);
    SysUserVO getUserByUserId(@Param("userId") Long userId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActMicroWishDO.java
@@ -147,6 +147,11 @@
    private BigDecimal imgHeight;
    /**
     * 处理人id,多个以逗号隔开
     */
    private String handleId;
    /**
     * 状态 1待审核  2待分配 3进行中  4已驳回 5待确认6 已完成 7集心中
     */
    public interface status{
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActMicroWishService.java
@@ -92,4 +92,12 @@
    R timedTaskActMicroWishAll();
    R getScreenMicroList(ScreenMicroListDTO microListDTO);
    /**
     * 微心愿处理人列表
     * @param communityId   社区id
     * @param type  处理人类型(1.后台用户  2.党员  3.志愿者)
     * @return  处理人列表
     */
    R wishHandleListAdmin(Long communityId,Integer type);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMicroWishServiceImpl.java
@@ -6,6 +6,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.base.Joiner;
import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenMicroListDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComActMicroWishFeedbackVO;
@@ -13,7 +14,9 @@
import com.panzhihua.common.model.vos.community.ComActMicroWishVO;
import com.panzhihua.common.model.vos.community.TodoEventsVO;
import com.panzhihua.common.model.vos.community.screen.work.MicroListVO;
import com.panzhihua.common.model.vos.user.SysUserVO;
import com.panzhihua.common.utlis.SensitiveUtil;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.dao.ComActMicroWishDAO;
import com.panzhihua.service_community.dao.ComActMicroWishFeedbackMapper;
import com.panzhihua.service_community.dao.ComActMicroWishOperationRecordMapper;
@@ -89,6 +92,8 @@
                    }
                }
                comActMicroWishVO1.setSponsorPhone(SensitiveUtil.desensitizedPhoneNumber(comActMicroWishVO1.getSponsorPhone()));
                //查询处理人
                comActMicroWishVO1.setResponsibleName(this.getWishHandleName(comActMicroWishVO1.getHandleId()));
            });
            iPage.setRecords(records);
        }
@@ -164,6 +169,8 @@
        if(!idList.isEmpty()){
            comActMicroWishVO.setIdList(idList);
        }
        //查询处理人
        comActMicroWishVO.setResponsibleName(this.getWishHandleName(comActMicroWishVO.getHandleId()));
        return R.ok(comActMicroWishVO);
    }
@@ -228,6 +235,9 @@
                comActMicroWishDO.setResponsibleId(responsibleId);
                comActMicroWishDO.setStatus(3);//进行中
                comActMicroWishDO.setForm(1);
                if(comActMicroWishVO.getHandleIds() != null && comActMicroWishVO.getHandleIds().size() > 0){
                    comActMicroWishDO.setHandleId(Joiner.on(",").join(comActMicroWishVO.getHandleIds()));
                }
                //添加操作记录
                comActMicroWishOperationRecordDO.setType(ComActMicroWishOperationRecordDO.type.fp);
                comActMicroWishOperationRecordDO.setContent("分配心愿");
@@ -241,6 +251,9 @@
                comActMicroWishDO.setResponsibleId(responsibleId);
                comActMicroWishDO.setStatus(3);//待确认
                comActMicroWishDO.setForm(2);
                if(comActMicroWishVO.getHandleIds() != null && comActMicroWishVO.getHandleIds().size() > 0){
                    comActMicroWishDO.setHandleId(Joiner.on(",").join(comActMicroWishVO.getHandleIds()));
                }
                //添加操作记录
                comActMicroWishOperationRecordDO.setType(ComActMicroWishOperationRecordDO.type.fp);
                comActMicroWishOperationRecordDO.setContent("分配心愿");
@@ -425,4 +438,50 @@
        }
        return R.ok(microListVOIPage);
    }
    /**
     * 微心愿处理人列表
     * @param communityId   社区id
     * @param type  处理人类型(1.后台用户  2.党员  3.志愿者)
     * @return  处理人列表
     */
    @Override
    public R wishHandleListAdmin(Long communityId,Integer type){
        return R.ok(comActMicroWishDAO.getWishHandleListAdmin(type,communityId));
    }
    /**
     * 拼接处理人
     * @param handleId  处理人id字符串
     * @return  处理人名称
     */
    private String getWishHandleName(String handleId){
        StringBuffer sb = new StringBuffer();
        if(StringUtils.isNotEmpty(handleId)){
            String []handleIds = handleId.split(",");
            if(handleIds.length > 0){
                for (String id : handleIds) {
                    SysUserVO user = comActMicroWishDAO.getUserByUserId(Long.parseLong(id));
                    if(user != null){
                        if(user.getType().equals(SysUserVO.type.xcx)){
                            if(user.getIsPartymember().equals(SysUserVO.isOk.yes)){
                                sb.append(user.getName() + "(党员),");
                            }else if(user.getIsVolunteer().equals(SysUserVO.isOk.yes)){
                                sb.append(user.getName() + "(志愿者),");
                            }else{
                                sb.append(user.getName());
                            }
                        }else if(user.getType().equals(SysUserVO.type.sqht)){
                            sb.append(user.getName() + "(后台用户),");
                        }
                    }
                }
            }
        }
        String result = sb.toString();
        if(result.length() > 0){
            result = result.substring(0,result.length()-1);
        }
        return result;
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActMicroWishDOMapper.xml
@@ -92,4 +92,20 @@
        ORDER BY  w.create_at desc
    </select>
    <select id="getWishHandleListAdmin" resultType="com.panzhihua.common.model.vos.user.SysUserVO">
        <if test="type != null and type == 1">
            select user_id,`name` as `name` from sys_user where `type` = 3 and community_id = #{communityId} and status = 1
        </if>
        <if test="type != null and type == 2">
            select user_id,IFNULL(`name`,nick_name) as `name` from sys_user where `type` = 1 and community_id = #{communityId} and status = 1 and is_partymember = 1
        </if>
        <if test="type != null and type == 3">
            select user_id,IFNULL(`name`,nick_name) as `name` from sys_user where `type` = 1 and community_id = #{communityId} and status = 1 and is_volunteer = 1
        </if>
    </select>
    <select id="getUserByUserId" resultType="com.panzhihua.common.model.vos.user.SysUserVO">
        select user_id,IFNULL(`name`,nick_name) as `name`,`type`,is_volunteer,is_partymember from sys_user where user_id = #{userId}
    </select>
</mapper>