| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /****************************************************************************************************************** |
| | | * |
| | | * |
| | | * 金汇微心愿 |
| | | * |
| | | * |
| | | ******************************************************************************************************************/ |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇微心愿列表", response = JinhuiMicroVolunteeringVO.class) |
| | | @GetMapping("/volunteering/getList") |
| | | public R volunteeringGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "state", required = false)String state) |
| | | { |
| | | return jinhuiCommunityService.volunteeringGetList(pageNum,pageSize,getUserId()+"",state); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇微心愿详情", response = JinhuiMicroVolunteeringVO.class) |
| | | @GetMapping("/volunteering/getList") |
| | | public R volunteeringGetDetails(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.volunteeringGetDetails(id); |
| | | } |
| | | /** |
| | | * 新增 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇微心愿新增") |
| | | @PostMapping("/volunteering/addData") |
| | | public R volunteeringAddData(@RequestBody JinhuiMicroVolunteeringVO item) |
| | | { |
| | | item.setUserId(getUserId()+""); |
| | | return jinhuiCommunityService.volunteeringAddData(item); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param item |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇微心愿编辑") |
| | | @PostMapping("/volunteering/editData") |
| | | public R volunteeringEditData(@RequestBody JinhuiMicroVolunteeringVO item) |
| | | { |
| | | return jinhuiCommunityService.volunteeringEditData(item); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇微心愿删除") |
| | | @DeleteMapping("/volunteering/expurgateData") |
| | | public R volunteeringExpurgateData(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.volunteeringExpurgateData(id); |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "图片") |
| | | private String imgUrl; |
| | | |
| | | @ApiModelProperty(value = "回复") |
| | | private String reply; |
| | | |
| | | @ApiModelProperty(value = "回复图片") |
| | | private String replyImgUrl; |
| | | |
| | | @ApiModelProperty(value = "状态(1待处理 2已处理)") |
| | | private String state; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date creationTime; |
| | |
| | | public R applyForExpurgateData(@RequestParam("id") String id); |
| | | |
| | | |
| | | /************************************************************************************************************** |
| | | * |
| | | * |
| | | * 金汇微心愿 |
| | | * |
| | | * |
| | | ***************************************************************************************************************/ |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/micro/volunteering/getList") |
| | | public R volunteeringGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "userId", required = false)String userId, |
| | | @RequestParam(value = "state", required = false)String state); |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/micro/volunteering/getList") |
| | | public R volunteeringGetDetails(@RequestParam("id") String id); |
| | | /** |
| | | * 新增 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/micro/volunteering/addData") |
| | | public R volunteeringAddData(@RequestBody JinhuiMicroVolunteeringVO item); |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param item |
| | | * @return |
| | | */ |
| | | @PostMapping("/micro/volunteering/editData") |
| | | public R volunteeringEditData(@RequestBody JinhuiMicroVolunteeringVO item); |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/micro/volunteering/expurgateData") |
| | | public R volunteeringExpurgateData(@RequestParam("id") String id); |
| | | |
| | | |
| | | |
| | |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiInterspaceApplyForVO; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiInterspaceTypeVO; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiInterspaceVO; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiMicroVolunteeringVO; |
| | | import com.panzhihua.common.service.jinhui.JinhuiCommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | } |
| | | |
| | | |
| | | /****************************************************************************************************************** |
| | | * |
| | | * |
| | | * 金汇微心愿 |
| | | * |
| | | * |
| | | ******************************************************************************************************************/ |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇微心愿列表", response = JinhuiMicroVolunteeringVO.class) |
| | | @GetMapping("/volunteering/getList") |
| | | public R volunteeringGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "state", required = false)String state) |
| | | { |
| | | return jinhuiCommunityService.volunteeringGetList(pageNum,pageSize,null,state); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇微心愿详情", response = JinhuiMicroVolunteeringVO.class) |
| | | @GetMapping("/volunteering/getList") |
| | | public R volunteeringGetDetails(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.volunteeringGetDetails(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param item |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇微心愿编辑") |
| | | @PostMapping("/volunteering/editData") |
| | | public R volunteeringEditData(@RequestBody JinhuiMicroVolunteeringVO item) |
| | | { |
| | | return jinhuiCommunityService.volunteeringEditData(item); |
| | | } |
| | | |
| | | /** |
| | | * 金汇微心愿处理 |
| | | * @param item |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇微心愿处理") |
| | | @PostMapping("/volunteering/dispose") |
| | | public R volunteeringDispose(@RequestBody JinhuiMicroVolunteeringVO item) |
| | | { |
| | | if(item==null) |
| | | { |
| | | return R.fail("参数不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(item.getId())) |
| | | { |
| | | return R.fail("id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(item.getReply())) |
| | | { |
| | | return R.fail("处理回复不能为空"); |
| | | } |
| | | |
| | | item.setState("2"); |
| | | |
| | | return jinhuiCommunityService.volunteeringEditData(item); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇微心愿删除") |
| | | @DeleteMapping("/volunteering/expurgateData") |
| | | public R volunteeringExpurgateData(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.volunteeringExpurgateData(id); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_jinhui_community.api; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiGoldCoinRecordVO; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiMicroVolunteeringVO; |
| | | import com.panzhihua.service_jinhui_community.entity.JinhuiMicroVolunteering; |
| | | import com.panzhihua.service_jinhui_community.service.JinhuiGoldCoinRecordService; |
| | | import com.panzhihua.service_jinhui_community.service.JinhuiMicroVolunteeringService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/Micro") |
| | | @RequestMapping("/micro") |
| | | public class JinhuiMicroVolunteeringApi |
| | | { |
| | | |
| | | @Resource |
| | | private JinhuiMicroVolunteeringService recordService; |
| | | |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | // @GetMapping("/Volunteering/getList") |
| | | // public R volunteeringGetList(int pageNum,int pageSize,String userId) |
| | | // { |
| | | // return recordService.getList(pageNum,pageSize,userId); |
| | | // } |
| | | // |
| | | // @GetMapping("/Volunteering/getList") |
| | | // public R volunteeringGetDetails(String id) |
| | | // { |
| | | // return R.ok(recordService.getDetails(id)); |
| | | // } |
| | | // /** |
| | | // * 新增 |
| | | // * @param |
| | | // * @return |
| | | // */ |
| | | // public R volunteeringAddData(JinhuiMicroVolunteeringVO item) |
| | | // { |
| | | // return recordService.addData(item); |
| | | // } |
| | | // |
| | | // public R volunteeringEditData(JinhuiMicroVolunteeringVO item) |
| | | // { |
| | | // return recordService.editData(item); |
| | | // } |
| | | // |
| | | // public R volunteeringExpurgateData(String id) |
| | | // { |
| | | // return recordService.expurgateData(id); |
| | | // } |
| | | @GetMapping("/volunteering/getList") |
| | | public R volunteeringGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "userId", required = false)String userId, |
| | | @RequestParam(value = "state", required = false)String state) |
| | | { |
| | | return recordService.getList(pageNum,pageSize,userId,state); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/volunteering/getList") |
| | | public R volunteeringGetDetails(@RequestParam("id") String id) |
| | | { |
| | | return R.ok(recordService.getDetails(id)); |
| | | } |
| | | /** |
| | | * 新增 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/volunteering/addData") |
| | | public R volunteeringAddData(@RequestBody JinhuiMicroVolunteeringVO item) |
| | | { |
| | | return recordService.addData(item); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param item |
| | | * @return |
| | | */ |
| | | @PostMapping("/volunteering/editData") |
| | | public R volunteeringEditData(@RequestBody JinhuiMicroVolunteeringVO item) |
| | | { |
| | | return recordService.editData(item); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/volunteering/expurgateData") |
| | | public R volunteeringExpurgateData(@RequestParam("id") String id) |
| | | { |
| | | return recordService.expurgateData(id); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | IPage<JinhuiMicroVolunteering> getList(Page page, |
| | | @Param("userId") String userId); |
| | | @Param("userId") String userId, |
| | | @Param("state") String state); |
| | | |
| | | |
| | | |
| | |
| | | @ApiModelProperty(value = "图片") |
| | | private String imgUrl; |
| | | |
| | | |
| | | @ApiModelProperty(value = "回复") |
| | | private String reply; |
| | | |
| | | @ApiModelProperty(value = "回复图片") |
| | | private String replyImgUrl; |
| | | |
| | | @ApiModelProperty(value = "状态(1待处理 2已处理)") |
| | | private String state; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date creationTime; |
| | | |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | |
| | | * @param |
| | | * @return |
| | | */ |
| | | R getList(int pageNum,int pageSize,String userId); |
| | | R getList(int pageNum,int pageSize,String userId,String state); |
| | | |
| | | JinhuiMicroVolunteering getDetails(String id); |
| | | /** |
| | |
| | | { |
| | | |
| | | @Override |
| | | public R getList(int pageNum,int pageSize,String userId) |
| | | public R getList(int pageNum,int pageSize,String userId,String state) |
| | | { |
| | | Page page = new Page<JinhuiMicroVolunteering>(pageNum,pageSize); |
| | | return R.ok(baseMapper.getList(page,userId)); |
| | | return R.ok(baseMapper.getList(page,userId,state)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public R addData(JinhuiMicroVolunteeringVO item) |
| | | { |
| | | item.setState("1"); |
| | | int num= baseMapper.addData(item); |
| | | if(num>0) |
| | | { |
| | |
| | | <result property="creationTime" column="creation_time" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="imgUrl" column="img_url" /> |
| | | <result property="reply" column="reply" /> |
| | | <result property="replyImgUrl" column="reply_img_url" /> |
| | | <result property="state" column="state" /> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | user_name, |
| | | user_phone, |
| | | img_url, |
| | | reply, |
| | | reply_img_url, |
| | | state, |
| | | created_time, |
| | | update_time |
| | | from jinhui_micro_volunteering |
| | | <where> |
| | | <if test="userId !=null and userId !='' "> |
| | | user_id=#{userId} |
| | | </if> |
| | | <if test="state !=null and state !='' "> |
| | | `state`=#{state} |
| | | </if> |
| | | </where> |
| | | order by creation_time desc |
| | |
| | | user_name, |
| | | user_phone, |
| | | img_url, |
| | | reply, |
| | | reply_img_url, |
| | | state, |
| | | created_time, |
| | | update_time |
| | | from jinhui_micro_volunteering |
| | |
| | | <if test="item.imgUrl != null and item.imgUrl != '' "> |
| | | img_url, |
| | | </if> |
| | | <if test="item.reply != null and item.reply != '' "> |
| | | reply, |
| | | </if> |
| | | <if test="item.replyImgUrl != null and item.replyImgUrl != '' "> |
| | | reply_img_url, |
| | | </if> |
| | | <if test="item.state != null and item.state != '' "> |
| | | `state`, |
| | | </if> |
| | | creation_time |
| | | </trim> |
| | | values |
| | |
| | | </if> |
| | | <if test="item.imgUrl != null and item.imgUrl != '' "> |
| | | #{item.imgUrl}, |
| | | </if> |
| | | <if test="item.reply != null and item.reply != '' "> |
| | | #{item.reply}, |
| | | </if> |
| | | <if test="item.replyImgUrl != null and item.replyImgUrl != '' "> |
| | | #{item.replyImgUrl}, |
| | | </if> |
| | | <if test="item.state != null and item.state != '' "> |
| | | #{item.state}, |
| | | </if> |
| | | sysdate() |
| | | </trim> |
| | |
| | | <if test="item.imgUrl != null and item.imgUrl != '' "> |
| | | img_url=#{item.imgUrl}, |
| | | </if> |
| | | <if test="item.reply != null and item.reply != '' "> |
| | | reply=#{item.reply}, |
| | | </if> |
| | | <if test="item.replyImgUrl != null and item.replyImgUrl != '' "> |
| | | reply_img_url=#{item.replyImgUrl}, |
| | | </if> |
| | | <if test="item.state != null and item.state != '' "> |
| | | `state`=#{item.state}, |
| | | </if> |
| | | update_time=sysdate() |
| | | </set> |
| | | where id = #{item.id} |