Merge branch 'test_bak' into 'master'
Test bak
See merge request root/zhihuishequ!246
| New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ApplyStatistics; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseApplyVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.QRCodeVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 物品申请表(ComActWarehouseApply)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-09 17:13:53 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"爱心义仓申领记录接口"}) |
| | | @RestController |
| | | @RequestMapping("comActWarehouseApply") |
| | | public class ComActWarehouseApplyApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询所有数据",response = ComActWarehouseApplyVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setParamId(this.getCommunityId()); |
| | | return this.communityService.comActWarehouseApplySelectAll(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 统计查询 |
| | | * |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "统计查询",response = ApplyStatistics.class) |
| | | @GetMapping("selectStatics") |
| | | public R selectAll() { |
| | | return this.communityService.comActWarehouseApplySelectAll(this.getCommunityId()); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "通过主键查询单条数据",response = ComActWarehouseApplyVO.class) |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Integer id) { |
| | | return this.communityService.comActWarehouseApplySelectOne(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActWarehouseApply 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation("新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActWarehouseApplyVO comActWarehouseApply) { |
| | | comActWarehouseApply.setCommunityId(this.getCommunityId()); |
| | | comActWarehouseApply.setCreateTime(new Date()); |
| | | comActWarehouseApply.setApplyUserId(this.getUserId()); |
| | | comActWarehouseApply.setStatus(ComActWarehouseApplyVO.status.dcl); |
| | | comActWarehouseApply.setApplyName(this.getLoginUserInfo().getName()!=null?this.getLoginUserInfo().getName():""); |
| | | comActWarehouseApply.setApplyPhone(this.getLoginUserInfo().getPhone()!=null?this.getLoginUserInfo().getPhone():""); |
| | | return this.communityService.comActWarehouseApplyInsert(comActWarehouseApply); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActWarehouseApply 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("修改数据") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActWarehouseApplyVO comActWarehouseApply) { |
| | | if(comActWarehouseApply.getStatus().equals(ComActWarehouseApplyVO.status.yqx)){ |
| | | comActWarehouseApply.setCancelTime(new Date()); |
| | | } |
| | | if(comActWarehouseApply.getStatus().equals(ComActWarehouseApplyVO.status.dlq)||comActWarehouseApply.getStatus().equals(ComActWarehouseApplyVO.status.ybh)){ |
| | | comActWarehouseApply.setSolveTime(new Date()); |
| | | comActWarehouseApply.setSolveUserId(this.getUserId()); |
| | | } |
| | | if(comActWarehouseApply.getStatus().equals(ComActWarehouseApplyVO.status.ylq)){ |
| | | comActWarehouseApply.setActualTime(new Date()); |
| | | comActWarehouseApply.setWriteOffUserId(this.getUserId()); |
| | | } |
| | | return this.communityService.comActWarehouseApplyUpdate(comActWarehouseApply); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation("删除数据") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return this.communityService.comActWarehouseApplyDelete(id); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | * @param qrCodeVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("生成二维码") |
| | | @PostMapping("/getQRCode") |
| | | public R getQRCode(@RequestBody QRCodeVO qrCodeVO){ |
| | | return this.communityService.comActWarehouseApplyGetQRCode(qrCodeVO); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseBaseVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 义仓基础设置表(ComActWarehouseBase)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-11 09:21:53 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"爱心义仓基础记录接口"}) |
| | | @RestController |
| | | @RequestMapping("comActWarehouseBase") |
| | | public class ComActWarehouseBaseApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 通过社区id查询单条数据 |
| | | * |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "查询单条数据",response = ComActWarehouseBaseVO.class) |
| | | @GetMapping |
| | | public R selectOne() { |
| | | return this.communityService.comActWarehouseBaseSelectOne(this.getCommunityId()); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import org.hibernate.validator.constraints.Length; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.panzhihua.common.constants.HttpStatus; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ComActWarehouseDonatesDTO; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.PageDonatesDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseDonatesVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @title: ComActWarehouseApi |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 爱心义仓捐赠小程序相关接口 |
| | | * @author: hans |
| | | * @date: 2021/10/11 15:45 |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Api(tags = {"爱心义仓捐赠相关"}) |
| | | @RestController |
| | | @RequestMapping("/warehouse/donates") |
| | | public class ComActWarehouseDonatesApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "分页查询捐赠物品", response = ComActWarehouseDonatesVO.class) |
| | | @PostMapping("/page") |
| | | public R pageDonates(@RequestBody PageDonatesDTO pageDonatesDTO) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfoSureNoLogin(); |
| | | Integer isWhich = pageDonatesDTO.getIsWhich(); |
| | | if (isNull(isWhich)) { |
| | | return R.fail("缺少isWhich参数"); |
| | | } |
| | | if (isNull(pageDonatesDTO.getCommunityId())) { |
| | | return R.fail("社区id不能为空"); |
| | | } |
| | | if (isNull(loginUserInfo) && isWhich.intValue() != 3) { |
| | | return R.fail(HttpStatus.UNAUTHORIZED, "未登录"); |
| | | } |
| | | if (isWhich.intValue() == 2 && loginUserInfo.getIsCommunityWorker().intValue() != 1) { |
| | | return R.fail("非社区工作人员"); |
| | | } |
| | | if (nonNull(loginUserInfo)) { |
| | | pageDonatesDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | return communityService.pageDonates(pageDonatesDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增物品捐赠") |
| | | @PostMapping("/add") |
| | | public R addDonates(@RequestBody @Validated(AddGroup.class) ComActWarehouseDonatesDTO comActWarehouseDonatesDTO) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | comActWarehouseDonatesDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | comActWarehouseDonatesDTO.setRegisterBy(userId); |
| | | comActWarehouseDonatesDTO.setUserId(userId); |
| | | comActWarehouseDonatesDTO.setName(loginUserInfo.getName()); |
| | | comActWarehouseDonatesDTO.setPhone(loginUserInfo.getPhone()); |
| | | return communityService.addDonates(comActWarehouseDonatesDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查看物品捐赠详情", response = ComActWarehouseDonatesVO.class) |
| | | @ApiImplicitParam(name = "isWhich", value = "1.个人中心捐赠详情 2.捐赠物品管理详情 3.爱心义仓捐赠列表详情", required = true) |
| | | @GetMapping("/get") |
| | | public R getDonates(@RequestParam("donatesId") Long donatesId, @RequestParam("isWhich") Integer isWhich) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfoSureNoLogin(); |
| | | if (isNull(isWhich)) { |
| | | return R.fail("缺少isWhich参数"); |
| | | } |
| | | if (isNull(loginUserInfo) && isWhich.intValue() != 3) { |
| | | return R.fail(HttpStatus.UNAUTHORIZED, "未登录"); |
| | | } |
| | | if (isWhich.intValue() == 2 && loginUserInfo.getIsCommunityWorker().intValue() != 1) { |
| | | return R.fail("非社区工作人员"); |
| | | } |
| | | Long userId = 0L; |
| | | if (nonNull(loginUserInfo)) { |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | return communityService.getDonates(donatesId, isWhich, userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "捐赠物品签收") |
| | | @PostMapping("/signing") |
| | | public R signingDonates(@RequestBody @Validated(PutGroup.class) ComActWarehouseDonatesDTO comActWarehouseDonatesDTO) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | Integer isCommunityWorker = loginUserInfo.getIsCommunityWorker(); |
| | | if (isCommunityWorker.intValue() == 2) { |
| | | return R.fail("非社区工作人员"); |
| | | } |
| | | comActWarehouseDonatesDTO.setSigningBy(loginUserInfo.getUserId()); |
| | | return communityService.signingDonates(comActWarehouseDonatesDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户取消捐赠") |
| | | @GetMapping("/cancel") |
| | | public R cancelDonates(@RequestParam("donatesId") Long donatesId) { |
| | | return communityService.cancelDonates(donatesId, getUserId()); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseBaseVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseOperationVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 义仓基础设置表(ComActWarehouseBase)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-11 09:21:53 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"爱心义仓爱心接力接口"}) |
| | | @RestController |
| | | @RequestMapping("comActWarehouseOperation") |
| | | public class ComActWarehouseOperationApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "分页",response = ComActWarehouseOperationVO.class) |
| | | @PostMapping("queryAll") |
| | | public R queryAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setCommunityId(this.getCommunityId()); |
| | | return this.communityService.comActWarehouseOperationSelectAll(commonPage); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.panzhihua.applets_backstage.config.SFTPConfig; |
| | | import com.panzhihua.common.excel.CustomSheetWriteHandler; |
| | | import com.panzhihua.common.model.dtos.DataKanBansDto; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.community.IndexUserStatisticsVo; |
| | | import com.panzhihua.common.model.vos.community.IndexUserStreetExcelExportVo; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.common.model.vos.IndexDataKanbanVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 首页接口 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2021-01-05 15:17 |
| | | **/ |
| | | @Slf4j |
| | | @Api(tags = {"首页接口"}) |
| | | @RestController |
| | | @RequestMapping("/index/") |
| | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @Resource |
| | | private SFTPConfig sftpConfig; |
| | | |
| | | @ApiOperation(value = "数据看板", response = IndexDataKanbanVO.class) |
| | | @GetMapping("datakanban") |
| | | public R dataKanban() { |
| | | return userService.dataKanban(); |
| | | } |
| | | |
| | | @ApiOperation(value = "数据看板", response = IndexDataKanbanVO.class) |
| | | @PostMapping("datakanbans") |
| | | public R dataKanBans(@RequestBody DataKanBansDto dataKanBansDto) { |
| | | return userService.dataKanBans(dataKanBansDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区通统计数据汇总", response = IndexUserStatisticsVo.class) |
| | | @GetMapping("statistics") |
| | | public R communityStatistics() { |
| | | return userService.communityStatistics(); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区通统计数据导出") |
| | | @GetMapping("statistics/export") |
| | | public R communityStatisticsExport() { |
| | | String url = sftpConfig.getExcelUrl(); |
| | | String name = "社区通用户统计导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | R r = userService.communityStatisticsExport(); |
| | | if (R.isOk(r)) { |
| | | List<IndexUserStreetExcelExportVo> resultList = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), IndexUserStreetExcelExportVo.class); |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(sftpConfig.getUserName(), sftpConfig.getPassword(), sftpConfig.getHost(), sftpConfig.getPort()); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | excelWriter = EasyExcel.write(fileName, IndexUserStreetExcelExportVo.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("社区通用户统计导出数据").build(); |
| | | excelWriter.write(resultList, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(url + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.applets_backstage.config; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * @Author: llming |
| | | * @Description: |
| | | */ |
| | | @Configuration |
| | | @Data |
| | | public class SFTPConfig { |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | @Value("${ftp.password}") |
| | | private String password; |
| | | // FTP 服务器地址IP地址 |
| | | @Value("${ftp.host}") |
| | | private String host; |
| | | // FTP 端口 |
| | | @Value("${ftp.port}") |
| | | private int port; |
| | | @Value("${ftp.url}") |
| | | private String url; |
| | | @Value("${excel.userurl}") |
| | | private String excelUrl; |
| | | } |
| | |
| | | |
| | | public static final String POPULATION_ERROR_LIST = "POPULATION_ERROR_LIST_"; |
| | | |
| | | public static final String BUILDING_ERROR_LIST = "BUILDING_ERROR_LIST_"; |
| | | |
| | | public static final String DRUG_POPULATION_ERROR_LIST = "DRUG_POPULATION_ERROR_LIST_"; |
| | | |
| | | public static final String CORRECT_POPULATION_ERROR_LIST = "CORRECT_POPULATION_ERROR_LIST_"; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngBuildingExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationImportErrorVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.grid.GridService; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | |
| | | /** |
| | | * @description: 社区楼栋导入监听 |
| | |
| | | private static int headSize = 0; |
| | | List<Map<Integer, String>> list = new ArrayList<Map<Integer, String>>(); |
| | | private CommunityService communityService; |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | private GridService gridService; |
| | | private Long communityId; |
| | | private Map<Integer, String> headData; |
| | | public ComMngBuildingExcelListen(CommunityService communityService, Long communityId) { |
| | | public ComMngBuildingExcelListen(CommunityService communityService, Long communityId, StringRedisTemplate stringRedisTemplate) { |
| | | this.communityService = communityService; |
| | | this.communityId = communityId; |
| | | this.stringRedisTemplate = stringRedisTemplate; |
| | | } |
| | | |
| | | @Override |
| | |
| | | int index = 2; |
| | | ArrayList<ComMngBuildingExcelVO> voList = Lists.newArrayList(); |
| | | List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); |
| | | for (int i = 1; i < list.size(); i++) { |
| | | ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); |
| | | String key = Constants.BUILDING_ERROR_LIST + communityId; |
| | | for (int i = 0; i < list.size(); i++) { |
| | | Map<Integer, String> oneData = list.get(i); |
| | | ComMngBuildingExcelVO vo = new ComMngBuildingExcelVO(); |
| | | vo.setId(Snowflake.getId()); |
| | | vo.setUseType(oneData.get(1)); |
| | | vo.setBuildType(oneData.get(2)); |
| | | if (StringUtils.isEmpty(oneData.get(oneData.get(3)))) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // vo.setUseType(oneData.get(0)); |
| | | // vo.setBuildType(oneData.get(1)); |
| | | if (StringUtils.isEmpty(oneData.get(0))) { |
| | | ComMngPopulationImportErrorVO importErrorVO = setError(oneData); |
| | | importErrorVO.setErrorMsg("街路巷不能为空"); |
| | | importErrorVO.setErrorPosition("第" + index + "行"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | vo.setAlley(oneData.get(3)); |
| | | continue; |
| | | } |
| | | |
| | | vo.setVillageName(oneData.get(4)); |
| | | vo.setDoorNo(oneData.get(5)); |
| | | vo.setName(oneData.get(6)); |
| | | try { |
| | | vo.setUnitTotal(oneData.get(7) == null ? 0 : Integer.valueOf(oneData.get(7))); |
| | | } catch (Exception e) { |
| | | if (StringUtils.isEmpty(oneData.get(oneData.get(5)))) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorMsg("门牌号不能为空"); |
| | | importErrorVO.setErrorPosition("第" + index + "行"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | vo.setDoorNo(oneData.get(5)); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(oneData.get(oneData.get(5)))) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorMsg("楼栋号不能为空"); |
| | | importErrorVO.setErrorPosition("第" + index + "行"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | vo.setName(oneData.get(6)); |
| | | } |
| | | |
| | | try { |
| | | vo.setUnitTotal(oneData.get(7) == null ? 0 : Integer.valueOf(oneData.get(7))); |
| | | } catch (Exception e1) { |
| | | vo.setUnitTotal(0); |
| | | } |
| | | try { |
| | | vo.setBuildFloorSum(oneData.get(8) == null ? 0 : Integer.valueOf(oneData.get(8))); |
| | | } catch (Exception e1) { |
| | | vo.setBuildFloorSum(0); |
| | | } |
| | | |
| | | try { |
| | | vo.setEveryFloorSum(oneData.get(9) == null ? 0 : Integer.valueOf(oneData.get(9))); |
| | | } catch (Exception e1) { |
| | | vo.setEveryFloorSum(0); |
| | | } |
| | | |
| | | try { |
| | | vo.setBuildUserSum(oneData.get(10) == null ? 0 : Integer.valueOf(oneData.get(10))); |
| | | } catch (Exception e1) { |
| | | vo.setBuildUserSum(0); |
| | | } |
| | | try { |
| | | vo.setElevatorTotal(oneData.get(11) == null ? 0 : Integer.valueOf(oneData.get(11))); |
| | | } catch (Exception e1) { |
| | | vo.setElevatorTotal(0); |
| | | } |
| | | |
| | | vo.setPropertyCompanyName(oneData.get(12)); |
| | | try { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); |
| | | vo.setBuildDate(sdf.parse(oneData.get(13))); |
| | | } catch (Exception e1) { |
| | | |
| | | } |
| | | vo.setRemark(oneData.get(14)); |
| | | vo.setGridId(oneData.get(15)); |
| | | vo.setGridName(oneData.get(15)); |
| | | voList.add(vo); |
| | | index++; |
| | | vo.setAlley(oneData.get(0)); |
| | | vo.setVillageName(oneData.get(1)); |
| | | if (StringUtils.isEmpty(oneData.get(2))) { |
| | | ComMngPopulationImportErrorVO importErrorVO = setError(oneData); |
| | | importErrorVO.setErrorMsg("门牌号不能为空"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | continue; |
| | | } |
| | | vo.setDoorNo(oneData.get(2)); |
| | | |
| | | R r = communityService.listSaveBuildingExcelVO(voList, communityId); |
| | | if (!R.isOk(r)) { |
| | | String errMsg = r.getMsg(); |
| | | List<ComMngPopulationImportErrorVO> errorList = |
| | | JSON.parseArray(errMsg, ComMngPopulationImportErrorVO.class); |
| | | if (!errorList.isEmpty()) { |
| | | populationImportErrorVOList.addAll(errorList); |
| | | } |
| | | throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList)); |
| | | } else { |
| | | if (!populationImportErrorVOList.isEmpty()) { |
| | | throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList)); |
| | | } |
| | | if (StringUtils.isEmpty(oneData.get(3))) { |
| | | ComMngPopulationImportErrorVO importErrorVO = setError(oneData); |
| | | importErrorVO.setErrorMsg("楼栋号不能为空"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | continue; |
| | | } |
| | | vo.setName(oneData.get(3)); |
| | | |
| | | // try { |
| | | // vo.setUnitTotal(oneData.get(6) == null ? 0 : Integer.valueOf(oneData.get(6))); |
| | | // } catch (Exception e1) { |
| | | // vo.setUnitTotal(0); |
| | | // } |
| | | // try { |
| | | // vo.setBuildFloorSum(oneData.get(7) == null ? 0 : Integer.valueOf(oneData.get(7))); |
| | | // } catch (Exception e1) { |
| | | // vo.setBuildFloorSum(0); |
| | | // } |
| | | // |
| | | // try { |
| | | // vo.setEveryFloorSum(oneData.get(8) == null ? 0 : Integer.valueOf(oneData.get(8))); |
| | | // } catch (Exception e1) { |
| | | // vo.setEveryFloorSum(0); |
| | | // } |
| | | // |
| | | // try { |
| | | // vo.setBuildUserSum(oneData.get(9) == null ? 0 : Integer.valueOf(oneData.get(9))); |
| | | // } catch (Exception e1) { |
| | | // vo.setBuildUserSum(0); |
| | | // } |
| | | // try { |
| | | // vo.setElevatorTotal(oneData.get(10) == null ? 0 : Integer.valueOf(oneData.get(10))); |
| | | // } catch (Exception e1) { |
| | | // vo.setElevatorTotal(0); |
| | | // } |
| | | // |
| | | // vo.setPropertyCompanyName(oneData.get(11)); |
| | | // try { |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); |
| | | // vo.setBuildDate(sdf.parse(oneData.get(12))); |
| | | // } catch (Exception e1) { |
| | | // vo.setBuildDate(null); |
| | | // } |
| | | // vo.setRemark(oneData.get(13)); |
| | | // vo.setGridId(oneData.get(14)); |
| | | // vo.setGridName(oneData.get(14)); |
| | | voList.add(vo); |
| | | index++; |
| | | } |
| | | |
| | | R r = communityService.listSaveBuildingExcelVO(voList, communityId); |
| | | if (!R.isOk(r)) { |
| | | List<ComMngPopulationImportErrorVO> errorList = |
| | | JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComMngPopulationImportErrorVO.class); |
| | | if (!errorList.isEmpty()) { |
| | | populationImportErrorVOList.addAll(errorList); |
| | | } |
| | | log.info("将错误数据存入redis中"); |
| | | valueOperations.set(key, JSONArray.toJSONString(populationImportErrorVOList), 1, TimeUnit.HOURS); |
| | | log.info("将错误数据存入redis中成功"); |
| | | throw new ServiceException("500", key); |
| | | } else { |
| | | if (!populationImportErrorVOList.isEmpty()) { |
| | | log.info("将错误数据存入redis中"); |
| | | valueOperations.set(key, JSONArray.toJSONString(populationImportErrorVOList), 1, TimeUnit.HOURS); |
| | | log.info("将错误数据存入redis中成功"); |
| | | throw new ServiceException("500", key); |
| | | } |
| | | } |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | private ComMngPopulationImportErrorVO setError(Map<Integer, String> oneData){ |
| | | ComMngPopulationImportErrorVO result = new ComMngPopulationImportErrorVO(); |
| | | if(oneData != null){ |
| | | // result.setUseType(oneData.get(0)); |
| | | // result.setBuildType(oneData.get(1)); |
| | | result.setAlley(oneData.get(0)); |
| | | result.setVillageName(oneData.get(1)); |
| | | result.setDoorNo(oneData.get(2)); |
| | | result.setName(oneData.get(3)); |
| | | // result.setUnitTotal(Integer.parseInt(oneData.get(6))); |
| | | // result.setBuildFloorSum(Integer.parseInt(oneData.get(7))); |
| | | // result.setEveryFloorSum(Integer.parseInt(oneData.get(8))); |
| | | // result.setBuildUserSum(Integer.parseInt(oneData.get(9))); |
| | | // result.setElevatorTotal(Integer.parseInt(oneData.get(10))); |
| | | // result.setPropertyCompanyName(oneData.get(11)); |
| | | // result.setBuildDate(DateUtils.stringToDate(oneData.get(12),DateUtils.format_yyyy)); |
| | | // result.setRemark(oneData.get(13)); |
| | | // result.setGridId(oneData.get(14)); |
| | | } |
| | | return result; |
| | | } |
| | | } |
| | |
| | | for (Map<Integer, String> oneData : list) { |
| | | ComMngPopulationServeExcelVO vo = new ComMngPopulationServeExcelVO(); |
| | | // 姓名和身份证都为空,为空户,无需操作,否则就解析年龄,性别,出生年月日 |
| | | if (StringUtils.isNotEmpty(oneData.get(0)) || StringUtils.isNotEmpty(oneData.get(1))) { |
| | | if (StringUtils.isEmpty(oneData.get(0))) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第1列"); |
| | | importErrorVO.setErrorMsg("名字不可为空,请填写姓名"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setName(oneData.get(0)); |
| | | if (StringUtils.isEmpty(oneData.get(1))) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第2列" + oneData.get(1)); |
| | | importErrorVO.setErrorMsg("身份证号不可为空,请填写身份证号"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | |
| | | // 判断身份证号码位数 |
| | | if (oneData.get(1).length() != 18) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第2列" + oneData.get(1)); |
| | | importErrorVO.setErrorMsg("身份证号位数有误,请检查身份证号码是否正确"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setCardNo(oneData.get(1)); |
| | | // 根据身份证号码解析年龄以及性别 |
| | | // 获取用户生日 |
| | | String birthday = vo.getCardNo().substring(6, 14); |
| | | if (StringUtils.isNotEmpty(birthday)) { |
| | | String year = birthday.substring(0, 4); |
| | | String month = birthday.substring(4, 6); |
| | | String day = birthday.substring(6, 8); |
| | | vo.setBirthday(year + "-" + month + "-" + day); |
| | | } |
| | | // //设置用户年龄 |
| | | // vo.setAge(AgeUtils.getAgeFromBirthTime(birthday)); |
| | | // 获取用户性别 |
| | | int sex = Integer.parseInt(vo.getCardNo().substring(16, 17)); |
| | | if (sex % 2 == 1) { |
| | | vo.setSex(PopulSexEnum.nan.getCode()); |
| | | } else { |
| | | vo.setSex(PopulSexEnum.nv.getCode()); |
| | | } |
| | | } |
| | | // if (StringUtils.isNotEmpty(oneData.get(0)) || StringUtils.isNotEmpty(oneData.get(1))) { |
| | | // if (StringUtils.isEmpty(oneData.get(0))) { |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第1列"); |
| | | // importErrorVO.setErrorMsg("名字不可为空,请填写姓名"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | // } |
| | | // vo.setName(oneData.get(0)); |
| | | // if (StringUtils.isEmpty(oneData.get(1))) { |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第2列" + oneData.get(1)); |
| | | // importErrorVO.setErrorMsg("身份证号不可为空,请填写身份证号"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | // } |
| | | // |
| | | // // 判断身份证号码位数 |
| | | // if (oneData.get(1).length() != 18) { |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第2列" + oneData.get(1)); |
| | | // importErrorVO.setErrorMsg("身份证号位数有误,请检查身份证号码是否正确"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | // } |
| | | // vo.setCardNo(oneData.get(1)); |
| | | // // 根据身份证号码解析年龄以及性别 |
| | | // // 获取用户生日 |
| | | // String birthday = vo.getCardNo().substring(6, 14); |
| | | // if (StringUtils.isNotEmpty(birthday)) { |
| | | // String year = birthday.substring(0, 4); |
| | | // String month = birthday.substring(4, 6); |
| | | // String day = birthday.substring(6, 8); |
| | | // vo.setBirthday(year + "-" + month + "-" + day); |
| | | // } |
| | | // // //设置用户年龄 |
| | | // // vo.setAge(AgeUtils.getAgeFromBirthTime(birthday)); |
| | | // // 获取用户性别 |
| | | // int sex = Integer.parseInt(vo.getCardNo().substring(16, 17)); |
| | | // if (sex % 2 == 1) { |
| | | // vo.setSex(PopulSexEnum.nan.getCode()); |
| | | // } else { |
| | | // vo.setSex(PopulSexEnum.nv.getCode()); |
| | | // } |
| | | // } |
| | | if (StringUtils.isNotEmpty(oneData.get(2))) { |
| | | // String nation = oneData.get(2); |
| | | // if(!nation.contains("族")){ |
| | |
| | | if (StringUtils.isNotEmpty(oneData.get(3))) { |
| | | vo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCodeByName(oneData.get(3))); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(4))) { |
| | | Integer isOk = PopulHouseUseEnum.getCodeByName(oneData.get(4)); |
| | | if (isOk.equals(-1)) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第5列"); |
| | | importErrorVO.setErrorMsg("您填写的是否租住有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setIsRent(isOk); |
| | | } |
| | | // if (StringUtils.isNotEmpty(oneData.get(4))) { |
| | | // Integer isOk = PopulHouseUseEnum.getCodeByName(oneData.get(4)); |
| | | // if (isOk.equals(-1)) { |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第5列"); |
| | | // importErrorVO.setErrorMsg("您填写的是否租住有误"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | // } |
| | | // vo.setIsRent(isOk); |
| | | // } |
| | | if (StringUtils.isNotEmpty(oneData.get(5))) { |
| | | |
| | | // String ra = convertRelation(oneData.get(5)); |
| | |
| | | } |
| | | |
| | | } |
| | | if (StringUtils.isEmpty(oneData.get(6))) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第7列"); |
| | | importErrorVO.setErrorMsg("街路巷不可为空"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setRoad(oneData.get(6)); |
| | | if (StringUtils.isEmpty(oneData.get(7))) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第8列"); |
| | | importErrorVO.setErrorMsg("小区号不可为空"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setDoorNo(oneData.get(7).trim()); |
| | | if (StringUtils.isEmpty(oneData.get(8))) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第9列"); |
| | | importErrorVO.setErrorMsg("楼排号不可为空"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setFloor(oneData.get(8).trim()); |
| | | if (StringUtils.isEmpty(oneData.get(9))) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第10列"); |
| | | importErrorVO.setErrorMsg("单元号不可为空"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setUnitNo(oneData.get(9).trim()); |
| | | if (StringUtils.isEmpty(oneData.get(10))) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第11列"); |
| | | importErrorVO.setErrorMsg("户室不可为空"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | // if (StringUtils.isEmpty(oneData.get(6))) { |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第7列"); |
| | | // importErrorVO.setErrorMsg("街路巷不可为空"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | // } |
| | | // vo.setRoad(oneData.get(6)); |
| | | // if (StringUtils.isEmpty(oneData.get(7))) { |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第8列"); |
| | | // importErrorVO.setErrorMsg("小区号不可为空"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | // } |
| | | // vo.setDoorNo(oneData.get(7).trim()); |
| | | // if (StringUtils.isEmpty(oneData.get(8))) { |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第9列"); |
| | | // importErrorVO.setErrorMsg("楼排号不可为空"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | // } |
| | | // vo.setFloor(oneData.get(8).trim()); |
| | | // if (StringUtils.isEmpty(oneData.get(9))) { |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第10列"); |
| | | // importErrorVO.setErrorMsg("单元号不可为空"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | // } |
| | | // vo.setUnitNo(oneData.get(9).trim()); |
| | | // if (StringUtils.isEmpty(oneData.get(10))) { |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第11列"); |
| | | // importErrorVO.setErrorMsg("户室不可为空"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | // } |
| | | vo.setHouseNo(oneData.get(10).trim()); |
| | | if (StringUtils.isNotEmpty(oneData.get(11))) { |
| | | vo.setBuildPurpose(oneData.get(11).trim()); |
| | |
| | | if (StringUtils.isNotEmpty(oneData.get(12))) { |
| | | vo.setBuildArea(oneData.get(12).trim()); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(13))) { |
| | | Integer isOk = PopulHouseStatusEnum.getCodeByName(oneData.get(13).trim()); |
| | | if (isOk.equals(-1)) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第14列"); |
| | | importErrorVO.setErrorMsg("您填写的房屋状态有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setHouseStatus(isOk); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(14))) { |
| | | Integer isOk = PopulHousePurposeEnum.getCodeByName(oneData.get(14).trim()); |
| | | if (isOk.equals(-1)) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第15列"); |
| | | importErrorVO.setErrorMsg("您填写的房屋用途有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setHousePurpose(PopulHousePurposeEnum.getCodeByName(oneData.get(14).trim())); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(15))) { |
| | | Integer isOk = PopulHouseControlStatusEnum.getCodeByName(oneData.get(15)); |
| | | if (isOk.equals(-1)) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第16列"); |
| | | importErrorVO.setErrorMsg("您填写的管控状态有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setControlStatus(isOk); |
| | | } |
| | | // if (StringUtils.isNotEmpty(oneData.get(13))) { |
| | | // Integer isOk = PopulHouseStatusEnum.getCodeByName(oneData.get(13).trim()); |
| | | // if (isOk.equals(-1)) { |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第14列"); |
| | | // importErrorVO.setErrorMsg("您填写的房屋状态有误"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | // } |
| | | // vo.setHouseStatus(isOk); |
| | | // } |
| | | // if (StringUtils.isNotEmpty(oneData.get(14))) { |
| | | // Integer isOk = PopulHousePurposeEnum.getCodeByName(oneData.get(14).trim()); |
| | | // if (isOk.equals(-1)) { |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第15列"); |
| | | // importErrorVO.setErrorMsg("您填写的房屋用途有误"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | // } |
| | | // vo.setHousePurpose(PopulHousePurposeEnum.getCodeByName(oneData.get(14).trim())); |
| | | // } |
| | | // if (StringUtils.isNotEmpty(oneData.get(15))) { |
| | | // Integer isOk = PopulHouseControlStatusEnum.getCodeByName(oneData.get(15)); |
| | | // if (isOk.equals(-1)) { |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第16列"); |
| | | // importErrorVO.setErrorMsg("您填写的管控状态有误"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | // } |
| | | // vo.setControlStatus(isOk); |
| | | // } |
| | | |
| | | if (StringUtils.isNotEmpty(oneData.get(16))) { |
| | | vo.setPhone(oneData.get(16).trim()); |
| | |
| | | if (StringUtils.isNotEmpty(oneData.get(17))) { |
| | | vo.setNativePlace(oneData.get(17).trim()); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(18))) { |
| | | Integer isOk = PopulCultureLevelEnum.getCodeByName(oneData.get(18)); |
| | | if (isOk.equals(-1)) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第19列"); |
| | | importErrorVO.setErrorMsg("您填写的文化程度有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setCultureLevel(isOk); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(19))) { |
| | | // String ma = convertMarriage(oneData.get(19)); |
| | | Integer isOk = PopulMarriageEnum.getCodeByName(oneData.get(19)); |
| | | if (isOk.equals(-1)) { |
| | | // vo.setMarriageStr(ma); |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第20列"); |
| | | importErrorVO.setErrorMsg("您填写的婚姻状况有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } else { |
| | | vo.setMarriage(isOk); |
| | | } |
| | | |
| | | } |
| | | // if (StringUtils.isNotEmpty(oneData.get(18))) { |
| | | // Integer isOk = PopulCultureLevelEnum.getCodeByName(oneData.get(18)); |
| | | // if (isOk.equals(-1)) { |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第19列"); |
| | | // importErrorVO.setErrorMsg("您填写的文化程度有误"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | // } |
| | | // vo.setCultureLevel(isOk); |
| | | // } |
| | | // if (StringUtils.isNotEmpty(oneData.get(19))) { |
| | | // // String ma = convertMarriage(oneData.get(19)); |
| | | // Integer isOk = PopulMarriageEnum.getCodeByName(oneData.get(19)); |
| | | // if (isOk.equals(-1)) { |
| | | // // vo.setMarriageStr(ma); |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第20列"); |
| | | // importErrorVO.setErrorMsg("您填写的婚姻状况有误"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | // } else { |
| | | // vo.setMarriage(isOk); |
| | | // } |
| | | // |
| | | // } |
| | | if (StringUtils.isNotEmpty(oneData.get(20))) { |
| | | vo.setHealthy(oneData.get(20).trim()); |
| | | } |
| | |
| | | if (StringUtils.isNotEmpty(oneData.get(24))) { |
| | | vo.setWorkCompany(oneData.get(24).trim()); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(25))) { |
| | | Integer isOk = PopulOutOrLocalEnum.getCodeByName(oneData.get(25)); |
| | | if (isOk.equals(-1)) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第26列"); |
| | | importErrorVO.setErrorMsg("您填写的本地/外地有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setOutOrLocal(isOk); |
| | | } |
| | | // if (StringUtils.isNotEmpty(oneData.get(25))) { |
| | | // Integer isOk = PopulOutOrLocalEnum.getCodeByName(oneData.get(25)); |
| | | // if (isOk.equals(-1)) { |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第26列"); |
| | | // importErrorVO.setErrorMsg("您填写的本地/外地有误"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | // } |
| | | // vo.setOutOrLocal(isOk); |
| | | // } |
| | | if (StringUtils.isNotEmpty(oneData.get(26))) { |
| | | vo.setCensusRegister(oneData.get(26).trim()); |
| | | } |
| | |
| | | } else { |
| | | vo.setResidence(PopulIsOkEnum.getCodeByName(oneData.get(27).trim())); |
| | | } |
| | | if (StringUtils.isNotEmpty(oneData.get(28))) { |
| | | Integer isOk = PopulPersonTypeEnum.getCodeByName(oneData.get(28)); |
| | | if (isOk.equals(-1)) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第30列"); |
| | | importErrorVO.setErrorMsg("您填写的人员类型有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setPersonType(isOk); |
| | | } |
| | | // if (StringUtils.isNotEmpty(oneData.get(28))) { |
| | | // Integer isOk = PopulPersonTypeEnum.getCodeByName(oneData.get(28)); |
| | | // if (isOk.equals(-1)) { |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第30列"); |
| | | // importErrorVO.setErrorMsg("您填写的人员类型有误"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // continue; |
| | | // } |
| | | // vo.setPersonType(isOk); |
| | | // } |
| | | if (StringUtils.isNotEmpty(oneData.get(29))) { |
| | | vo.setCountry(oneData.get(29).trim()); |
| | | } |
| | |
| | | e.printStackTrace(); |
| | | List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行"); |
| | | // importErrorVO.setErrorPosition("第" + index + "行"); |
| | | importErrorVO.setErrorMsg("数据格式有误,请检查文档内数据"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList)); |
| | |
| | | e1.printStackTrace(); |
| | | List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行"); |
| | | // importErrorVO.setErrorPosition("第" + index + "行"); |
| | | importErrorVO.setErrorMsg("数据格式有误,请检查文档内数据"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList)); |
| New file |
| | |
| | | package com.panzhihua.common.listen; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.warehouse.WarehouseDonatesExcelVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @title: WarehouseDonatesExcelListen |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 爱心义仓物品捐赠导入监听 |
| | | * @author: hans |
| | | * @date: 2021/10/09 17:45 |
| | | */ |
| | | @Slf4j |
| | | public class WarehouseDonatesExcelListen extends AnalysisEventListener<WarehouseDonatesExcelVO> { |
| | | |
| | | private static final int BATCH_COUNT = 3000; |
| | | private CommunityService communityService; |
| | | private Long communityId; |
| | | private Long registerBy; |
| | | private List<WarehouseDonatesExcelVO> list = new ArrayList<>(); |
| | | |
| | | public WarehouseDonatesExcelListen(CommunityService communityService, Long communityId, Long registerBy) { |
| | | this.communityService = communityService; |
| | | this.communityId = communityId; |
| | | this.registerBy = registerBy; |
| | | } |
| | | |
| | | @Override |
| | | public void invoke(WarehouseDonatesExcelVO warehouseDonatesExcelVO, AnalysisContext analysisContext) { |
| | | Integer quantity = warehouseDonatesExcelVO.getQuantity(); |
| | | if (!StringUtils.isEmpty(warehouseDonatesExcelVO.getItem()) && nonNull(quantity)) { |
| | | if (quantity <= 0) { |
| | | throw new ServiceException("捐赠数量有误"); |
| | | } |
| | | if (StringUtils.isEmpty(warehouseDonatesExcelVO.getName()) |
| | | || isNull(warehouseDonatesExcelVO.getIsAnonymous())) { |
| | | warehouseDonatesExcelVO.setIsAnonymous("是"); |
| | | } |
| | | if (isNull(warehouseDonatesExcelVO.getSigningAt())) { |
| | | Date nowDate = new Date(); |
| | | warehouseDonatesExcelVO.setSigningAt(nowDate); |
| | | warehouseDonatesExcelVO.setRegisterAt(nowDate); |
| | | } else { |
| | | warehouseDonatesExcelVO.setRegisterAt(warehouseDonatesExcelVO.getSigningAt()); |
| | | } |
| | | warehouseDonatesExcelVO.setCommunityId(this.communityId); |
| | | warehouseDonatesExcelVO.setStatus(2); |
| | | warehouseDonatesExcelVO.setSurplusQuantity(quantity); |
| | | warehouseDonatesExcelVO.setRegisterBy(this.registerBy); |
| | | warehouseDonatesExcelVO.setSigningBy(this.registerBy); |
| | | list.add(warehouseDonatesExcelVO); |
| | | // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM |
| | | if (list.size() >= BATCH_COUNT) { |
| | | doAfterAllAnalysed(analysisContext); |
| | | list.clear(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
| | | R r = this.communityService.batchImportWarehouseDonates(list); |
| | | if (!R.isOk(r)) { |
| | | throw new ServiceException(r.getMsg()); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.dtos; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 运营后台数据看板请求参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("运营后台数据看板请求参数") |
| | | public class DataKanBansDto { |
| | | |
| | | @ApiModelProperty("社区用户量统计类型(1.累计用户 2.本月新增)") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 社区用户量统计类型(1.累计用户 2.本月新增) |
| | | */ |
| | | public interface type{ |
| | | int lj = 1; |
| | | int by = 2; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.building; |
| | | |
| | | public class BuildingDto { |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.building.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 添加楼栋户室请求参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("添加楼栋户室请求参数") |
| | | public class AddBuildingHouseDto { |
| | | |
| | | @ApiModelProperty("楼栋id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("单元号") |
| | | private String unitNo; |
| | | |
| | | @ApiModelProperty("门牌号") |
| | | private String houseNo; |
| | | |
| | | @ApiModelProperty("楼层数") |
| | | private Integer floorNum; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.building.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 分页查询楼栋列表请求参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("分页查询楼栋列表请求参数") |
| | | public class AddBuildingUnitDto { |
| | | |
| | | @ApiModelProperty("楼栋id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("单元号") |
| | | private String unitNo; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.building.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 删除楼栋户室人员关系请求参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("删除楼栋户室人员关系请求参数") |
| | | public class DeleteBuildingHousePopulationDto { |
| | | |
| | | @ApiModelProperty("房屋id") |
| | | private Long houseId; |
| | | |
| | | @ApiModelProperty("人员类型(1.业主 2.居住人)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("人员id") |
| | | private Long populationId; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 人员类型(1.业主 2.居住人) |
| | | */ |
| | | public interface type{ |
| | | int yz = 1; |
| | | int jzr = 2; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.building.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 修改楼栋户室请求参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("修改楼栋户室请求参数") |
| | | public class EditBuildingHouseDto { |
| | | |
| | | @ApiModelProperty("房屋id") |
| | | private Long houseId; |
| | | |
| | | @ApiModelProperty("门牌号") |
| | | private String houseNo; |
| | | |
| | | @ApiModelProperty("楼层数") |
| | | private Integer floorNum; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.building.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 分页查询楼栋列表请求参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("分页查询楼栋列表请求参数") |
| | | public class EditBuildingUnitDto { |
| | | |
| | | @ApiModelProperty("楼栋id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("原单元号") |
| | | private String oldUnitNo; |
| | | |
| | | @ApiModelProperty("新单元号") |
| | | private String newUnitNo; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.building.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 分页查询楼栋列表请求参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("分页查询楼栋列表请求参数") |
| | | public class PageBuildingListDto { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty("关键词") |
| | | private String keyWord; |
| | | |
| | | @ApiModelProperty("小区id") |
| | | private Long villageId; |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.building.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 分页查询楼栋单元下房屋列表请求参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("分页查询楼栋单元下房屋列表请求参数") |
| | | public class PageBuildingUnitHouseListDto { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty("单元号") |
| | | private String unit; |
| | | |
| | | @ApiModelProperty("楼栋id") |
| | | private Long id; |
| | | |
| | | private Long villageId; |
| | | |
| | | private String floor; |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.warehouse; |
| | | |
| | | import java.util.List; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.Pattern; |
| | | |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseApplyVO; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: ComActWarehouseApplyDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 后台物品领用信息 |
| | | * @author: hans |
| | | * @date: 2021/10/13 14:33 |
| | | */ |
| | | @Data |
| | | @ApiModel("后台物品领用信息") |
| | | public class ComActWarehouseApplyDTO { |
| | | |
| | | @ApiModelProperty("领用人") |
| | | @Length(groups = {AddGroup.class}, max = 10, message = "领用人最多支持10个字符") |
| | | private String applyName; |
| | | |
| | | @ApiModelProperty("联系电话") |
| | | @Pattern(groups = {AddGroup.class}, message = "联系电话格式错误", regexp = "^(13[0-9]|14[01456879]|15[0-3,5-9]|16[2567]|17[0-8]|18[0-9]|19[0-3,5-9])\\d{8}$") |
| | | private String applyPhone; |
| | | |
| | | @ApiModelProperty("领用物品,传入goodsId,goodsNum即可") |
| | | @NotEmpty(groups = {AddGroup.class}, message = "领用物品不能为空") |
| | | private List<ComActWarehouseApplyVO> applyItems; |
| | | |
| | | @ApiModelProperty("遇到的困难") |
| | | @NotBlank(groups = {AddGroup.class}, message = "困难描述不可为空") |
| | | @Length(groups = {AddGroup.class}, max = 100, message = "遇到的困难最多支持100个字符") |
| | | private String reason; |
| | | |
| | | @ApiModelProperty("领用图片") |
| | | private String receiveUrl; |
| | | |
| | | @ApiModelProperty(value = "操作人id", hidden = true) |
| | | private Long operateUserId; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.warehouse; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Pattern; |
| | | |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: ComActWarehouseDonatesDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 新增/编辑物品捐赠 |
| | | * @author: hans |
| | | * @date: 2021/10/11 14:18 |
| | | */ |
| | | @Data |
| | | @ApiModel("新增/编辑物品捐赠") |
| | | public class ComActWarehouseDonatesDTO { |
| | | |
| | | @ApiModelProperty("捐赠物品ID") |
| | | @NotNull(groups = {PutGroup.class}, message = "捐赠物品ID不能为空") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("捐赠用户") |
| | | @Length(groups = {AddGroup.class}, max = 10, message = "捐赠用户最多支持10个字符") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("联系电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("捐赠物品") |
| | | @NotBlank(groups = {AddGroup.class}, message = "捐赠物品不能为空") |
| | | @Length(groups = {AddGroup.class}, max = 10, message = "捐赠物品名称最多支持10个字符") |
| | | private String item; |
| | | |
| | | @ApiModelProperty("捐赠数量") |
| | | @NotNull(groups = {AddGroup.class}, message = "捐赠数量不能为空") |
| | | @Min(1) |
| | | private Integer quantity; |
| | | |
| | | @ApiModelProperty("物品图片") |
| | | @NotBlank(groups = {AddGroup.class}, message = "物品图片不能为空") |
| | | private String image; |
| | | |
| | | @ApiModelProperty("匿名捐赠(1.是 2.否)") |
| | | @NotNull(groups = {AddGroup.class}, message = "是否匿名捐赠不能为空") |
| | | private Integer isAnonymous; |
| | | |
| | | @ApiModelProperty("留言信息") |
| | | @Length(groups = {AddGroup.class}, max = 100, message = "留言信息最多支持100个字符") |
| | | private String message; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "登记人", hidden = true) |
| | | private Long registerBy; |
| | | |
| | | @ApiModelProperty(value = "捐赠人用户绑定id", hidden = true) |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "签收人", hidden = true) |
| | | private Long signingBy; |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.warehouse; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: ExportDonatesDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 捐赠物品导出请求参数 |
| | | * @author: hans |
| | | * @date: 2021/10/11 11:09 |
| | | */ |
| | | @Data |
| | | @ApiModel("捐赠物品导出请求参数") |
| | | public class ExportDonatesDTO { |
| | | |
| | | @ApiModelProperty(value = "批量勾选时传参数组") |
| | | private List<Long> ids; |
| | | |
| | | @ApiModelProperty("关键词") |
| | | private String keyword; |
| | | |
| | | @ApiModelProperty("捐赠状态(1.待签收 2.已签收 3.已取消)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("是否匿名捐赠(1.是 2.否)") |
| | | private Integer isAnonymous; |
| | | |
| | | @ApiModelProperty("签收时间-起") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date signingAtBegin; |
| | | |
| | | @ApiModelProperty("签收时间-止") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date signingAtEnd; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.warehouse; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: PageDonatesDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 分页查询捐赠物品请求参数 |
| | | * @author: hans |
| | | * @date: 2021/10/11 13:56 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询捐赠物品请求参数") |
| | | public class PageDonatesDTO { |
| | | |
| | | @ApiModelProperty("关键词") |
| | | private String keyword; |
| | | |
| | | @ApiModelProperty("捐赠状态(1.待签收 2.已签收 3.已取消)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("是否匿名捐赠(1.是 2.否)") |
| | | private Integer isAnonymous; |
| | | |
| | | @ApiModelProperty("签收时间-起") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date signingAtBegin; |
| | | |
| | | @ApiModelProperty("签收时间-止") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date signingAtEnd; |
| | | |
| | | @ApiModelProperty("小程序使用,1.个人中心捐赠记录 2.捐赠物品管理 3.爱心义仓捐赠列表") |
| | | private Integer isWhich; |
| | | |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageSize; |
| | | |
| | | |
| | | @ApiModelProperty(value = "当前访问用户", hidden = true) |
| | | private Long userId; |
| | | } |
| | |
| | | private String keyword; |
| | | @ApiModelProperty("职务") |
| | | private String position; |
| | | @ApiModelProperty("参数id2") |
| | | private Integer paramId2; |
| | | @ApiModelProperty("社区id") |
| | | private Long communityId; |
| | | } |
| | |
| | | private List<Integer> communityUserY; |
| | | @ApiModelProperty("社区活跃度x轴") |
| | | private List<String> communityActiveUserX; |
| | | @ApiModelProperty("社区活跃度y轴") |
| | | @ApiModelProperty("用户新增数量y轴") |
| | | private List<Integer> communityAddUserY; |
| | | @ApiModelProperty("日活跃用户数量y轴") |
| | | private List<Integer> communityActiveUserY; |
| | | } |
| | |
| | | @ApiModelProperty("是否四长四员 1.是 2.否") |
| | | private Integer isFourMember; |
| | | |
| | | @ApiModelProperty("是否社区工作人员 1.是 2.否") |
| | | private Integer isCommunityWorker; |
| | | |
| | | } |
| | |
| | | private static final long serialVersionUID = 1719392023800643085L; |
| | | |
| | | private Long id; |
| | | @ExcelProperty(value = "楼房属性", index = 1) |
| | | private String useType; |
| | | @ExcelProperty(value = "建筑类型", index = 2) |
| | | private String buildType; |
| | | // @ExcelProperty(value = "楼房属性", index = 0) |
| | | // private String useType; |
| | | // @ExcelProperty(value = "建筑类型", index = 1) |
| | | // private String buildType; |
| | | |
| | | @ExcelProperty(value = "街路巷", index = 3) |
| | | @ExcelProperty(value = "街路巷", index = 0) |
| | | private String alley; |
| | | |
| | | @ExcelProperty(value = "小区名称", index = 4) |
| | | @ExcelProperty(value = "小区名称", index = 1) |
| | | private String villageName; |
| | | |
| | | @ExcelProperty(value = "门牌号", index = 5) |
| | | @ExcelProperty(value = "门牌号", index = 2) |
| | | private String doorNo; |
| | | |
| | | @ExcelProperty(value = "楼栋号/楼栋名称", index = 6) |
| | | @ExcelProperty(value = "楼栋号/楼栋名称", index = 3) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "单元数", index = 7) |
| | | private Integer unitTotal; |
| | | |
| | | @ExcelProperty(value = "楼层数", index = 8) |
| | | private Integer buildFloorSum; |
| | | |
| | | @ExcelProperty(value = "每层户数", index = 9) |
| | | private Integer everyFloorSum; |
| | | |
| | | @ExcelProperty(value = "总户数", index = 10) |
| | | private Integer buildUserSum; |
| | | |
| | | @ExcelProperty(value = "电梯", index = 11) |
| | | private Integer elevatorTotal; |
| | | |
| | | @ExcelProperty(value = "物业公司名称", index = 12) |
| | | private String propertyCompanyName; |
| | | |
| | | @ExcelProperty(value = "建筑年代", index = 13) |
| | | private Date buildDate; |
| | | |
| | | @ExcelProperty(value = "备注", index = 14) |
| | | private String remark; |
| | | |
| | | @ExcelProperty(value = "网格划分", index = 15) |
| | | private String gridId; |
| | | // @ExcelProperty(value = "单元数", index = 6) |
| | | // private Integer unitTotal; |
| | | // |
| | | // @ExcelProperty(value = "楼层数", index = 7) |
| | | // private Integer buildFloorSum; |
| | | // |
| | | // @ExcelProperty(value = "每层户数", index = 8) |
| | | // private Integer everyFloorSum; |
| | | // |
| | | // @ExcelProperty(value = "总户数", index = 9) |
| | | // private Integer buildUserSum; |
| | | // |
| | | // @ExcelProperty(value = "电梯", index = 10) |
| | | // private Integer elevatorTotal; |
| | | // |
| | | // @ExcelProperty(value = "物业公司名称", index = 11) |
| | | // private String propertyCompanyName; |
| | | // |
| | | // @ExcelProperty(value = "建筑年代", index = 12) |
| | | // private Date buildDate; |
| | | // |
| | | // @ExcelProperty(value = "备注", index = 13) |
| | | // private String remark; |
| | | // |
| | | // @ExcelProperty(value = "网格划分", index = 14) |
| | | // private String gridId; |
| | | |
| | | private String gridName; |
| | | } |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | |
| | |
| | | @Data |
| | | public class ComMngPopulationImportErrorVO implements Serializable { |
| | | |
| | | @ExcelProperty(value = "错误位置", index = 0) |
| | | private String errorPosition; |
| | | // @ExcelProperty(value = "楼房属性", index = 0) |
| | | // private String useType; |
| | | // @ExcelProperty(value = "建筑类型", index = 1) |
| | | // private String buildType; |
| | | |
| | | @ExcelProperty(value = "错误原因", index = 0) |
| | | @ExcelProperty(value = "街路巷", index = 0) |
| | | private String alley; |
| | | |
| | | @ExcelProperty(value = "小区名称", index = 1) |
| | | private String villageName; |
| | | |
| | | @ExcelProperty(value = "门牌号", index = 2) |
| | | private String doorNo; |
| | | |
| | | @ExcelProperty(value = "楼栋号/楼栋名称", index = 3) |
| | | private String name; |
| | | |
| | | // @ExcelProperty(value = "单元数", index = 6) |
| | | // private Integer unitTotal; |
| | | // |
| | | // @ExcelProperty(value = "楼层数", index = 7) |
| | | // private Integer buildFloorSum; |
| | | // |
| | | // @ExcelProperty(value = "每层户数", index = 8) |
| | | // private Integer everyFloorSum; |
| | | // |
| | | // @ExcelProperty(value = "总户数", index = 9) |
| | | // private Integer buildUserSum; |
| | | // |
| | | // @ExcelProperty(value = "电梯", index = 10) |
| | | // private Integer elevatorTotal; |
| | | // |
| | | // @ExcelProperty(value = "物业公司名称", index = 11) |
| | | // private String propertyCompanyName; |
| | | // |
| | | // @ExcelProperty(value = "建筑时间", index = 12) |
| | | // private Date buildDate; |
| | | // |
| | | // @ExcelProperty(value = "备注", index = 13) |
| | | // private String remark; |
| | | // |
| | | // @ExcelProperty(value = "网格划分", index = 14) |
| | | // private String gridId; |
| | | |
| | | @ExcelProperty(value = "错误原因", index = 4) |
| | | private String errorMsg; |
| | | |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 运营后台-首页社区通用户街道下社区统计汇总 |
| | | */ |
| | | @Data |
| | | @ApiModel("运营后台-首页社区通用户街道下社区统计汇总") |
| | | public class IndexUserCommunityVo { |
| | | |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "社区下注册用户数量") |
| | | private Integer userNum; |
| | | |
| | | @ApiModelProperty(value = "社区名称") |
| | | private String name; |
| | | |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 运营后台-首页社区通用户统计汇总 |
| | | */ |
| | | @Data |
| | | @ApiModel("运营后台-首页社区通用户统计汇总") |
| | | public class IndexUserStatisticsVo { |
| | | |
| | | @ApiModelProperty(value = "街道统计数据") |
| | | private List<IndexUserStreetVo> streetList; |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 运营后台-首页社区通用户街道统计汇总 |
| | | */ |
| | | @Data |
| | | @ApiModel("运营后台-首页社区通用户街道统计汇总") |
| | | public class IndexUserStreetExcelExportVo { |
| | | |
| | | @ExcelProperty(value = "街道名称", index = 0) |
| | | private String streetName; |
| | | |
| | | @ExcelProperty(value = "社区名称", index = 1) |
| | | private String communityName; |
| | | |
| | | @ExcelProperty(value = "街道下注册用户数量", index = 2) |
| | | private Integer streetNum; |
| | | |
| | | @ExcelProperty(value = "社区下注册用户数量", index = 3) |
| | | private Integer userNum; |
| | | |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 运营后台-首页社区通用户街道统计汇总 |
| | | */ |
| | | @Data |
| | | @ApiModel("运营后台-首页社区通用户街道统计汇总") |
| | | public class IndexUserStreetVo { |
| | | |
| | | @ApiModelProperty(value = "街道下社区统计数据") |
| | | private List<IndexUserCommunityVo> communityList; |
| | | |
| | | @ApiModelProperty(value = "街道id") |
| | | private Long streetId; |
| | | |
| | | @ApiModelProperty(value = "街道下注册用户数量") |
| | | private Integer userNum; |
| | | |
| | | @ApiModelProperty(value = "街道名称") |
| | | private String name; |
| | | |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community.building; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class BuildingVO { |
| | | private String label; |
| | | private String value; |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community.building.admin; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 楼栋详情返回参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("楼栋详情返回参数") |
| | | public class BuildingDetailAdminVo { |
| | | |
| | | @ApiModelProperty("楼栋主键") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("街路巷") |
| | | private String alley; |
| | | |
| | | @ApiModelProperty("街路巷号") |
| | | private String doorNum; |
| | | |
| | | @ApiModelProperty("楼栋号") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("小区名称") |
| | | private String villageName; |
| | | |
| | | @ApiModelProperty("小区id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long villageId; |
| | | |
| | | @ApiModelProperty("房屋总户数") |
| | | private Integer houseNum; |
| | | |
| | | @ApiModelProperty("自住房屋数量") |
| | | private Integer liveTotal; |
| | | |
| | | @ApiModelProperty("出租房屋数量") |
| | | private Integer leaseTotal; |
| | | |
| | | @ApiModelProperty("空置房屋数量") |
| | | private Integer vacantNum; |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community.building.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 楼栋列表表头统计返回参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("楼栋列表表头统计返回参数") |
| | | public class BuildingListHeaderStatisticsAdminVo { |
| | | |
| | | @ApiModelProperty("楼栋数") |
| | | private Integer buildNum; |
| | | |
| | | @ApiModelProperty("总户数") |
| | | private Integer houseNum; |
| | | |
| | | @ApiModelProperty("居民人数") |
| | | private Integer populationNum; |
| | | |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community.building.admin; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 楼栋单元下房屋列表返回参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("楼栋单元下房屋列表返回参数") |
| | | public class BuildingUnitHouseListAdminVo { |
| | | |
| | | @ApiModelProperty("楼栋单元下房屋列表") |
| | | private List<ComMngVillageBuildingHouseVO> houseList; |
| | | |
| | | @ApiModelProperty("房屋总户数") |
| | | private Integer houseNum = 0; |
| | | |
| | | @ApiModelProperty("自住房屋数量") |
| | | private Integer liveTotal = 0; |
| | | |
| | | @ApiModelProperty("出租房屋数量") |
| | | private Integer leaseTotal = 0; |
| | | |
| | | @ApiModelProperty("空置房屋数量") |
| | | private Integer vacantNum = 0; |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community.building.admin; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 分页查询楼栋列表返回参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("分页查询楼栋列表返回参数") |
| | | public class PageBuildingListAdminVo { |
| | | |
| | | @ApiModelProperty("楼栋主键") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("街路巷") |
| | | private String alley; |
| | | |
| | | @ApiModelProperty("楼栋号") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("小区名称") |
| | | private String villageName; |
| | | |
| | | @ApiModelProperty("小区id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long villageId; |
| | | |
| | | @ApiModelProperty("单元数") |
| | | private Integer unitTotal; |
| | | |
| | | @ApiModelProperty("楼层数") |
| | | private String buildFloorSum; |
| | | |
| | | @ApiModelProperty("总户数") |
| | | private Integer houseNum; |
| | | |
| | | @ApiModelProperty("居民人数") |
| | | private Integer populationNum; |
| | | |
| | | @ApiModelProperty("门牌号") |
| | | private String doorNum; |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community.warehouse; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zzj |
| | | */ |
| | | @Data |
| | | @ApiModel("申领统计") |
| | | public class ApplyStatistics { |
| | | /** |
| | | * 待处理 |
| | | */ |
| | | @ApiModelProperty("待处理") |
| | | private Integer pending; |
| | | |
| | | /** |
| | | * 待领取 |
| | | */ |
| | | @ApiModelProperty("待领取") |
| | | private Integer unclaimed; |
| | | |
| | | /** |
| | | * 已领取 |
| | | */ |
| | | @ApiModelProperty("已领取") |
| | | private Integer received; |
| | | |
| | | /** |
| | | *已取消 |
| | | */ |
| | | @ApiModelProperty("已取消") |
| | | private Integer cancelled; |
| | | |
| | | /** |
| | | * 已驳回 |
| | | */ |
| | | @ApiModelProperty("已驳回") |
| | | private Integer rejected; |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community.warehouse; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnore; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.converters.string.StringImageConverter; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import lombok.Data; |
| | | |
| | | import java.net.URL; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zzj |
| | | */ |
| | | @Data |
| | | public class ComActWarehouseApplyExcelVO { |
| | | |
| | | @ExcelProperty(value = "申领流水",index = 10) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 物品数量 |
| | | */ |
| | | @ExcelProperty(value = "物品数量",index = 6) |
| | | private Integer goodsNum; |
| | | |
| | | /** |
| | | * 预约时间 |
| | | */ |
| | | @ExcelProperty(value = "预约领用时间",index = 7) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | |
| | | /** |
| | | * 实际时间 |
| | | */ |
| | | @ExcelProperty(value = "实际领用时间",index = 8) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date actualTime; |
| | | |
| | | /** |
| | | * 理由 |
| | | */ |
| | | @ExcelProperty(value = "主要困难",index = 9) |
| | | private String reason; |
| | | |
| | | /** |
| | | * 领取图片 |
| | | */ |
| | | @ExcelIgnore |
| | | private URL receiveUrl; |
| | | |
| | | /** |
| | | * 提交时间 |
| | | */ |
| | | @ExcelProperty(value = "提交时间",index = 13) |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 状态 0待处理 1 待领取 2已拒绝 3已领取 -1已取消 |
| | | */ |
| | | @ExcelProperty(value = "状态",index =14) |
| | | private String status; |
| | | @ExcelProperty(value = "核销人",index = 12) |
| | | private String writeOffUserName; |
| | | |
| | | /** |
| | | * 申请人 |
| | | */ |
| | | @ExcelProperty(value = "申请人",index = 0) |
| | | private String applyName; |
| | | |
| | | /** |
| | | * 申请人联系电话 |
| | | */ |
| | | @ExcelProperty(value = "申请人联系电话",index = 1) |
| | | private String applyPhone; |
| | | |
| | | /** |
| | | * 申请物品 |
| | | */ |
| | | @ExcelProperty(value = "申请物品",index = 2) |
| | | private String item; |
| | | |
| | | /** |
| | | * 捐赠人 |
| | | */ |
| | | @ExcelProperty(value = "捐赠人",index = 3) |
| | | private String donateName; |
| | | |
| | | /** |
| | | * 捐赠人联系方式 |
| | | */ |
| | | @ExcelProperty(value = "捐赠人联系方式",index = 4) |
| | | private String donatePhone; |
| | | |
| | | /** |
| | | * 物品图片 |
| | | */ |
| | | @ExcelIgnore |
| | | private URL image; |
| | | |
| | | public void setStatus(String status) { |
| | | if(StringUtils.isNotEmpty(status)){ |
| | | if("-1".equals(status)){ |
| | | status="已取消"; |
| | | }else if("0".equals(status)){ |
| | | status="待处理"; |
| | | } |
| | | else if("1".equals(status)){ |
| | | status="待领取"; |
| | | } |
| | | else if("2".equals(status)){ |
| | | status="已驳回"; |
| | | } |
| | | else if("3".equals(status)){ |
| | | status="已领取"; |
| | | } |
| | | this.status=status; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community.warehouse; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zzj |
| | | */ |
| | | @Data |
| | | @ApiModel("义仓物品申领记录实体") |
| | | public class ComActWarehouseApplyVO { |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 物品id |
| | | */ |
| | | @ApiModelProperty(value = "物品id") |
| | | private Integer goodsId; |
| | | |
| | | /** |
| | | * 物品数量 |
| | | */ |
| | | @ApiModelProperty(value = "物品数量") |
| | | private Integer goodsNum; |
| | | |
| | | /** |
| | | * 预约时间 |
| | | */ |
| | | @ApiModelProperty(value = "预约时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date reserveTime; |
| | | |
| | | /** |
| | | * 实际时间 |
| | | */ |
| | | @ApiModelProperty(value = "实际时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date actualTime; |
| | | |
| | | /** |
| | | * 理由 |
| | | */ |
| | | @ApiModelProperty(value = "理由") |
| | | private String reason; |
| | | |
| | | /** |
| | | * 领取图片 |
| | | */ |
| | | @ApiModelProperty(value = "领取图片") |
| | | private String receiveUrl; |
| | | |
| | | /** |
| | | * 提交时间 |
| | | */ |
| | | @ApiModelProperty(value = "提交时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 状态 0待处理 1 待领取 2已拒绝 3已领取 -1已取消 |
| | | */ |
| | | @ApiModelProperty(value = "状态 0待处理 1 待领取 2已拒绝 3已领取 -1已取消") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 申请人id |
| | | */ |
| | | @ApiModelProperty("申请人id") |
| | | private Long applyUserId; |
| | | |
| | | /** |
| | | * 处理人id |
| | | */ |
| | | @ApiModelProperty(value = "处理人id") |
| | | private Long solveUserId; |
| | | |
| | | /** |
| | | * 处理人时间 |
| | | */ |
| | | @ApiModelProperty(value = "处理人时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date solveTime; |
| | | |
| | | /** |
| | | * 处理人备注 |
| | | */ |
| | | @ApiModelProperty(value = "处理人备注") |
| | | private String solveContent; |
| | | |
| | | /** |
| | | * 处理人 |
| | | */ |
| | | @ApiModelProperty(value = "处理人") |
| | | private String solveName; |
| | | |
| | | /** |
| | | * 核销人id |
| | | */ |
| | | @ApiModelProperty(value = "核销人id") |
| | | private Long writeOffUserId; |
| | | |
| | | /** |
| | | * 取消时间 |
| | | */ |
| | | @ApiModelProperty(value = "取消时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date cancelTime; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 申请人 |
| | | */ |
| | | @ApiModelProperty("申请人") |
| | | private String applyName; |
| | | |
| | | /** |
| | | * 申请人联系电话 |
| | | */ |
| | | @ApiModelProperty("申请人联系电话") |
| | | private String applyPhone; |
| | | |
| | | /** |
| | | * 申请物品 |
| | | */ |
| | | @ApiModelProperty("申请物品") |
| | | private String item; |
| | | |
| | | /** |
| | | * 捐赠人 |
| | | */ |
| | | @ApiModelProperty("捐赠人") |
| | | private String donateName; |
| | | |
| | | /** |
| | | * 捐赠人联系方式 |
| | | */ |
| | | @ApiModelProperty("捐赠人联系方式") |
| | | private String donatePhone; |
| | | |
| | | /** |
| | | * 物品图片 |
| | | */ |
| | | @ApiModelProperty("物品图片") |
| | | private String image; |
| | | |
| | | /** |
| | | * 核销人 |
| | | */ |
| | | @ApiModelProperty("核销人") |
| | | private String writeOffUserName; |
| | | |
| | | /** |
| | | *剩下数量 |
| | | */ |
| | | @ApiModelProperty("剩下数量") |
| | | private Integer surplusQuantity; |
| | | |
| | | /** |
| | | * 状态 0待处理 1 待领取 2已拒绝 3已领取 -1已取消 |
| | | */ |
| | | public interface status{ |
| | | int dcl=0; |
| | | int dlq=1; |
| | | int ybh=2; |
| | | int ylq=3; |
| | | int yqx=-1; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community.warehouse; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zzj |
| | | */ |
| | | @Data |
| | | @ApiModel("义仓基础设置实体") |
| | | public class ComActWarehouseBaseVO { |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 义仓说明 |
| | | */ |
| | | @ApiModelProperty(value = "义仓说明") |
| | | private String warehouseExplain; |
| | | |
| | | /** |
| | | * 工作时间 |
| | | */ |
| | | @ApiModelProperty(value = "工作时间") |
| | | private String warehouseWorkTime; |
| | | |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String warehouseContact; |
| | | |
| | | /** |
| | | * 接收地点 |
| | | */ |
| | | @ApiModelProperty(value = "接收地点") |
| | | private String receivePosition; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | *经度 |
| | | */ |
| | | @ApiModelProperty("经度") |
| | | private String longitude; |
| | | |
| | | /** |
| | | *纬度 |
| | | */ |
| | | @ApiModelProperty("纬度") |
| | | private String latitude; |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community.warehouse; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: ComActWarehouseDonatesVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 爱心义仓/物品捐赠信息 |
| | | * @author: hans |
| | | * @date: 2021/10/11 14:06 |
| | | */ |
| | | @Data |
| | | @ApiModel("爱心义仓/物品捐赠信息") |
| | | public class ComActWarehouseDonatesVO { |
| | | |
| | | @ApiModelProperty("捐赠物品id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("捐赠人") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("联系电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("捐赠物品") |
| | | private String item; |
| | | |
| | | @ApiModelProperty("物品图片") |
| | | private String image; |
| | | |
| | | @ApiModelProperty("捐赠数量") |
| | | private Integer quantity; |
| | | |
| | | @ApiModelProperty("剩余数量") |
| | | private Integer surplusQuantity; |
| | | |
| | | @ApiModelProperty("是否匿名(1.是 2.否)") |
| | | private Integer isAnonymous; |
| | | |
| | | @ApiModelProperty("留言信息") |
| | | private String message; |
| | | |
| | | @ApiModelProperty("物品登记时间/捐赠时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date registerAt; |
| | | |
| | | @ApiModelProperty("物品签收时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date signingAt; |
| | | |
| | | @ApiModelProperty("捐赠状态(1.待签收 2.已签收 3.已取消)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("签收人") |
| | | private String signingBy; |
| | | |
| | | @ApiModelProperty("物品捐赠操作记录") |
| | | private List<ComActWarehouseOperationVO> operationList; |
| | | |
| | | @ApiModelProperty("捐赠用户") |
| | | @JsonIgnore |
| | | private Long userId; |
| | | |
| | | public interface isAnonymous { |
| | | int yes = 1; |
| | | int no = 2; |
| | | } |
| | | |
| | | public interface status { |
| | | int dqs = 1; |
| | | int yqs = 2; |
| | | int yqx = 3; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community.warehouse; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: ComActWarehouseOperationVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 爱心义仓操作记录vo |
| | | * @author: hans |
| | | * @date: 2021/10/11 16:32 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("爱心义仓操作记录vo") |
| | | public class ComActWarehouseOperationVO { |
| | | |
| | | @ApiModelProperty(value = "操作记录id") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "物品id") |
| | | private Integer goodsId; |
| | | |
| | | @ApiModelProperty(value = "操作内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "操作时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value = "操作人") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("申请人姓名") |
| | | private String applyName; |
| | | |
| | | @ApiModelProperty("捐赠人名称") |
| | | private String donateName; |
| | | |
| | | @ApiModelProperty("捐赠物品名称") |
| | | private String item; |
| | | |
| | | @ApiModelProperty("捐赠物品图片") |
| | | private String image; |
| | | |
| | | @ApiModelProperty("捐赠物品数量") |
| | | private Integer goodsNum; |
| | | |
| | | /** |
| | | * 实际时间 |
| | | */ |
| | | @ApiModelProperty(value = "实际时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date actualTime; |
| | | |
| | | @ApiModelProperty("是否匿名(1.是 2.否)") |
| | | private Integer isAnonymous; |
| | | |
| | | /** |
| | | * 理由 |
| | | */ |
| | | @ApiModelProperty("理由") |
| | | private String reason; |
| | | |
| | | /** |
| | | * 领取图片 |
| | | */ |
| | | @ApiModelProperty("领取图片") |
| | | private String receiveUrl; |
| | | |
| | | @ApiModelProperty("类型 1 content 2其他") |
| | | private Integer type; |
| | | |
| | | public void setDonateName(String donateName) { |
| | | if(StringUtils.isNotEmpty(donateName)){ |
| | | this.donateName = donateName.charAt(0)+"**"; |
| | | } |
| | | } |
| | | |
| | | public void setApplyName(String applyName) { |
| | | if(StringUtils.isNotEmpty(applyName)){ |
| | | this.applyName = applyName.charAt(0)+"**"; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community.warehouse; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: DonatesStatisticsVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 爱心义仓/物品捐赠统计信息 |
| | | * @author: hans |
| | | * @date: 2021/10/12 15:56 |
| | | */ |
| | | @Data |
| | | @ApiModel("爱心义仓/物品捐赠统计信息") |
| | | public class DonatesStatisticsVO { |
| | | |
| | | @ApiModelProperty("累计物品数量") |
| | | private Integer totalInc; |
| | | |
| | | @ApiModelProperty("当前剩余物品") |
| | | private Integer surplus; |
| | | |
| | | @ApiModelProperty("今日新增") |
| | | private Integer dayInc; |
| | | |
| | | @ApiModelProperty("本月新增") |
| | | private Integer mothInc; |
| | | |
| | | @ApiModelProperty("本年新增") |
| | | private Integer yearInc; |
| | | |
| | | @ApiModelProperty("累计领用物品") |
| | | private Integer totalDec; |
| | | |
| | | @ApiModelProperty("今日领用") |
| | | private Integer dayDec; |
| | | |
| | | @ApiModelProperty("本月领用") |
| | | private Integer mothDec; |
| | | |
| | | @ApiModelProperty("本年领用") |
| | | private Integer yearDec; |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community.warehouse; |
| | | |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: ExportDonatesVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 爱心义仓捐赠物品导出VO |
| | | * @author: hans |
| | | * @date: 2021/10/11 11:20 |
| | | */ |
| | | @Data |
| | | public class ExportDonatesVO { |
| | | |
| | | private Long id; |
| | | |
| | | @ExcelProperty("捐赠用户") |
| | | private String name; |
| | | |
| | | @ExcelProperty("联系电话") |
| | | private String phone; |
| | | |
| | | @ExcelProperty("捐赠物品") |
| | | private String item; |
| | | |
| | | @ExcelProperty("捐赠数量") |
| | | private Integer quantity; |
| | | |
| | | @ExcelProperty("剩余数量") |
| | | private Integer surplusQuantity; |
| | | |
| | | @ExcelProperty("匿名捐赠") |
| | | private String isAnonymous; |
| | | |
| | | @ExcelProperty("留言信息") |
| | | private String message; |
| | | |
| | | @ExcelProperty("物品登记时间") |
| | | private Date registerAt; |
| | | |
| | | @ExcelProperty("物品签收时间") |
| | | private Date signingAt; |
| | | |
| | | @ExcelProperty("状态") |
| | | private String status; |
| | | |
| | | public void setIsAnonymous(String isAnonymous) { |
| | | if (StringUtils.isNumber(isAnonymous)) { |
| | | this.isAnonymous = nonNull(isAnonymous) && isAnonymous.equals("1") ? "是" : "否"; |
| | | } else { |
| | | this.isAnonymous = isAnonymous; |
| | | } |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | if (StringUtils.isNumber(status)) { |
| | | switch (status) { |
| | | case "1": |
| | | this.status = "待签收"; |
| | | break; |
| | | case "2": |
| | | this.status = "已签收"; |
| | | break; |
| | | default: |
| | | this.status = "已取消"; |
| | | break; |
| | | } |
| | | } else { |
| | | this.status = status; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community.warehouse; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zzj |
| | | */ |
| | | @Data |
| | | @ApiModel("生成二维码传参") |
| | | public class QRCodeVO { |
| | | @ApiModelProperty("数据主键id") |
| | | private Integer id; |
| | | @ApiModelProperty("二维码类型 1签收 2核销") |
| | | private Integer type; |
| | | } |
| New file |
| | |
| | | package com.panzhihua.common.model.vos.community.warehouse; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: WarehouseDonatesExcelVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 捐赠物品ExcelVO |
| | | * @author: hans |
| | | * @date: 2021/10/09 17:42 |
| | | */ |
| | | @Data |
| | | public class WarehouseDonatesExcelVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -7026869907781559301L; |
| | | |
| | | @ExcelProperty(value = "捐赠用户", index = 0) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "联系电话", index = 1) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "捐赠物品", index = 2) |
| | | private String item; |
| | | |
| | | @ExcelProperty(value = "捐赠数量", index = 3) |
| | | private Integer quantity; |
| | | |
| | | @ExcelProperty(value = "匿名捐赠", index = 4) |
| | | private String isAnonymous; |
| | | |
| | | @ExcelProperty(value = "留言信息", index = 5) |
| | | private String message; |
| | | |
| | | @ExcelProperty(value = "物品签收时间", index = 6) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date signingAt; |
| | | |
| | | /** |
| | | * 剩余数量 |
| | | */ |
| | | private Integer surplusQuantity; |
| | | /** |
| | | * 捐赠状态 |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | /** |
| | | * 物品登记时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date registerAt; |
| | | /** |
| | | * 登记人 |
| | | */ |
| | | private Long registerBy; |
| | | /** |
| | | * 签收人 |
| | | */ |
| | | private Long signingBy; |
| | | } |
| | |
| | | @ApiModelProperty("户室号") |
| | | private String houseNo; |
| | | |
| | | @ApiModelProperty("房屋状态(1.自住 2.租住 3.其他)") |
| | | @ApiModelProperty("房屋状态(1.自住 2.租住 3.空置 4.其他)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("在住居民数") |
| | |
| | | @ApiModelProperty(value = "纬度") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty(value = "政治面貌文字描述") |
| | | private String outlook; |
| | | |
| | | @ApiModelProperty(value = "人和房屋关系(1.业主 2.业主家属 3.租户)") |
| | | private Integer relationId; |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ComActWarehouseApplyDTO; |
| | | import com.panzhihua.common.model.dtos.community.GetIdentityEidTokenDTO; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.dtos.community.building.admin.*; |
| | | import com.panzhihua.common.model.dtos.community.cluster.PageClusterMemberDto; |
| | | import com.panzhihua.common.model.dtos.community.cluster.admin.*; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationEditDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseEditAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseInsertAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseUserVO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationTagDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngRealCompanyBelongsDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComOpsHouseDTO; |
| | |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityPeopleListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenDiscussListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenMicroListDTO; |
| | | import com.panzhihua.common.model.dtos.community.cluster.PageClusterMemberDto; |
| | | import com.panzhihua.common.model.dtos.community.cluster.admin.AddClusterAdminDto; |
| | | import com.panzhihua.common.model.dtos.community.cluster.admin.AddClusterMemberAdminDto; |
| | | import com.panzhihua.common.model.dtos.community.cluster.admin.EditClusterAdminDto; |
| | | import com.panzhihua.common.model.dtos.community.cluster.admin.EditClusterMemberAdminDto; |
| | | import com.panzhihua.common.model.dtos.community.cluster.admin.PageClusterAdminDto; |
| | | import com.panzhihua.common.model.dtos.community.cluster.admin.PageClusterMemberAdminDto; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientProductCategoryDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientProductDTO; |
| | |
| | | import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeDTO; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ComActWarehouseDonatesDTO; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ExportDonatesDTO; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.PageDonatesDTO; |
| | | import com.panzhihua.common.model.dtos.elders.ComEldersAuthGetResultDTO; |
| | | import com.panzhihua.common.model.dtos.elders.ComEldersAuthPageDTO; |
| | | import com.panzhihua.common.model.dtos.elders.ComEldersAuthUserAddAppDTO; |
| | |
| | | import com.panzhihua.common.model.vos.DictionaryVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.SystemmanagementConfigVO; |
| | | import com.panzhihua.common.model.vos.community.ActivitySignVO; |
| | | import com.panzhihua.common.model.vos.community.BatchhouseVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | | import com.panzhihua.common.model.vos.community.ComActCommiteeVO; |
| | | import com.panzhihua.common.model.vos.community.ComActDynVO; |
| | | import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; |
| | | import com.panzhihua.common.model.vos.community.ComActFourMemberVO; |
| | | import com.panzhihua.common.model.vos.community.ComActMessageBackVO; |
| | | import com.panzhihua.common.model.vos.community.ComActMessageVO; |
| | | import com.panzhihua.common.model.vos.community.ComActMicroWishVO; |
| | | import com.panzhihua.common.model.vos.community.ComActReserveCommitVO; |
| | | import com.panzhihua.common.model.vos.community.ComActSocialOrgVO; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.ComActWorkGuideClassifyVO; |
| | | import com.panzhihua.common.model.vos.community.ComActWorkGuideVO; |
| | | import com.panzhihua.common.model.vos.community.ComCvtServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComElderAuthRecordImportExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComElderAuthRecordVO; |
| | | import com.panzhihua.common.model.vos.community.ComEldersAuthElderlyDetailsVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngBuildingExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngCarExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationCorrectExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationCultExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationDisabilityExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationDrugExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationElderExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationKeyExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationLowSecurityExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationMajorExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationPensionExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationRehabilitationExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationSentenceExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationVeteransExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngRealAssetsExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngRealAssetsVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngRealCompanyExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngRealCompanyVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructAreaVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructHouseVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructOtherBuildVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; |
| | | import com.panzhihua.common.model.vos.community.ComOpsHouseUndercarriageVO; |
| | | import com.panzhihua.common.model.vos.community.ComOpsHouseVO; |
| | | import com.panzhihua.common.model.vos.community.ComPensionAuthRecordImportExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComPensionAuthRecordVO; |
| | | import com.panzhihua.common.model.vos.community.ComPropertyVO; |
| | | import com.panzhihua.common.model.vos.community.ComStreetVO; |
| | | import com.panzhihua.common.model.vos.community.ComSwRotaExcelVO; |
| | | import com.panzhihua.common.model.vos.community.EldersAuthDetailsVO; |
| | | import com.panzhihua.common.model.vos.community.EldersAuthElderlyExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ResetComActMessageVO; |
| | | import com.panzhihua.common.model.vos.community.SignactivityVO; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticAgeGender; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticPartyActivity; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticPartyBuild; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.PartyBuildingMemberVO; |
| | | import com.panzhihua.common.model.vos.community.cluster.admin.ComClusterMemberExcelVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; |
| | | import com.panzhihua.common.model.vos.community.questnaire.EditComActQuestnaireVo; |
| | | import com.panzhihua.common.model.vos.community.questnaire.QuestnaireVO; |
| | | import com.panzhihua.common.model.vos.community.questnaire.UsersAnswerQuestnaireVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseApplyVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseBaseVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.QRCodeVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.WarehouseDonatesExcelVO; |
| | | import com.panzhihua.common.model.vos.neighbor.AddNeighborCircleAdminVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ChangeCommentReplyStatusByAdminVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ChangeCommentStatusByAdminVO; |
| | |
| | | /** |
| | | * 批量删除实有人口 |
| | | * |
| | | * @param Ids |
| | | * @param ids |
| | | * 实有人口id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/common/data/population/delete") |
| | | R deletePopulations(@RequestBody List<Long> Ids); |
| | | R deletePopulations(@RequestBody List<Long> ids,@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 根据社区id查询所有实有人口 |
| | |
| | | */ |
| | | @GetMapping("/common/data/population/house/user/detail") |
| | | public R detailHousesUser(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 社区后台-分页查询楼栋列表 |
| | | * @param pageBuildingListDto 请求参数 |
| | | * @return 楼栋列表 |
| | | */ |
| | | @PostMapping("/building/page/admin/") |
| | | R pageBuildingAdmin(@RequestBody PageBuildingListDto pageBuildingListDto); |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋列表表头统计数据 |
| | | * @param communityId 社区id |
| | | * @return 楼栋列表表头统计数据 |
| | | */ |
| | | @GetMapping("/building/header/statistics/") |
| | | R buildingListHeaderStatisticsAdmin(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋详情 |
| | | * @param id 楼栋id |
| | | * @return 楼栋详情 |
| | | */ |
| | | @GetMapping("/building/detail/admin/") |
| | | R detailBuildAdmin(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 查询楼栋下单元列表 |
| | | * @param id 楼栋id |
| | | * @return 单元列表 |
| | | */ |
| | | @GetMapping("/building/unit/list/admin") |
| | | R buildingUnitListAdmin(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 查询楼栋单元下房屋列表 |
| | | * @param unitHouseListDto 请求参数 |
| | | * @return 单元列表 |
| | | */ |
| | | @PostMapping("/building/unit/house/list/admin") |
| | | R buildingUnitHouseListAdmin(@RequestBody PageBuildingUnitHouseListDto unitHouseListDto); |
| | | |
| | | /** |
| | | * 查询楼栋单元下房屋详情 |
| | | * @param houseId 房屋id |
| | | * @param communityId 社区id |
| | | * @return 房屋详情 |
| | | */ |
| | | @GetMapping("/building/unit/house/detail/admin") |
| | | R unitHouseDetailAdmin(@RequestParam("houseId") Long houseId,@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 查询社区下小区列表 |
| | | * @param communityId 社区id |
| | | * @return 小区列表 |
| | | */ |
| | | @GetMapping("/building/village/list/admin") |
| | | R buildingVillageListAdmin(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 添加楼栋下单元 |
| | | * @param addBuildingUnitDto 请求参数 |
| | | * @return 添加结果 |
| | | */ |
| | | @PostMapping("/building/unit/add/admin") |
| | | R addBuildingUnitAdmin(@RequestBody AddBuildingUnitDto addBuildingUnitDto); |
| | | |
| | | /** |
| | | * 修改楼栋下单元 |
| | | * @param editBuildingUnitDto 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/building/unit/edit/admin") |
| | | R editBuildingUnitAdmin(@RequestBody EditBuildingUnitDto editBuildingUnitDto); |
| | | |
| | | /** |
| | | * 添加户室 |
| | | * @param addBuildingHouseDto 请求参数 |
| | | * @return 添加结果 |
| | | */ |
| | | @PostMapping("/building/house/add/admin") |
| | | R addBuildingHouseAdmin(@RequestBody AddBuildingHouseDto addBuildingHouseDto); |
| | | |
| | | /** |
| | | * 修改户室 |
| | | * @param editBuildingHouseDto 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/building/house/edit/admin") |
| | | R editBuildingHouseAdmin(@RequestBody EditBuildingHouseDto editBuildingHouseDto); |
| | | |
| | | /** |
| | | * 删除户室下人员关联信息 |
| | | * @param housePopulationDto 请求参数 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/building/house/population/delete/admin") |
| | | R deleteBuildingHousePopulationAdmin(@RequestBody DeleteBuildingHousePopulationDto housePopulationDto); |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("/comActWarehouseApply/queryAll") |
| | | public R comActWarehouseApplySelectAll(@RequestBody CommonPage commonPage); |
| | | |
| | | /** |
| | | * 统计查询 |
| | | * |
| | | * @param communityId |
| | | * @return 所有数据 |
| | | */ |
| | | @GetMapping("/comActWarehouseApply/selectStatics") |
| | | public R comActWarehouseApplySelectAll(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("/comActWarehouseApply/{id}") |
| | | public R comActWarehouseApplySelectOne(@PathVariable("id") Integer id); |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActWarehouseApply 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/comActWarehouseApply") |
| | | public R comActWarehouseApplyInsert(@RequestBody ComActWarehouseApplyVO comActWarehouseApply); |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActWarehouseApply 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/comActWarehouseApply/update") |
| | | public R comActWarehouseApplyUpdate(@RequestBody ComActWarehouseApplyVO comActWarehouseApply); |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("/comActWarehouseApply/del") |
| | | public R comActWarehouseApplyDelete(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | * @param qrCodeVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/comActWarehouseApply/getQRCode") |
| | | public R comActWarehouseApplyGetQRCode(@RequestBody QRCodeVO qrCodeVO); |
| | | |
| | | /** |
| | | * 社区Id查询基础配置 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/comActWarehouseBase") |
| | | public R comActWarehouseBaseSelectOne(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActWarehouseBase 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/comActWarehouseBase") |
| | | public R comActWarehouseBaseInsert(@RequestBody ComActWarehouseBaseVO comActWarehouseBase); |
| | | |
| | | /** |
| | | * 导出数据 |
| | | */ |
| | | @PostMapping("/comActWarehouseApply/export") |
| | | public R comActWarehouseApplyExport(@RequestBody CommonPage commonPage); |
| | | |
| | | /** |
| | | * 后台导入捐赠物品 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | @PostMapping("/comActWarehouseDonates/import") |
| | | R batchImportWarehouseDonates(@RequestBody List<WarehouseDonatesExcelVO> list); |
| | | |
| | | /** |
| | | * 后台导出捐赠物品表格 |
| | | * @param exportDonatesDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/comActWarehouseDonates/donates/export") |
| | | R exportDonates(@RequestBody ExportDonatesDTO exportDonatesDTO); |
| | | |
| | | /** |
| | | * 分页查询捐赠物品 |
| | | * @param pageDonatesDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/comActWarehouseDonates/donates/page") |
| | | R pageDonates(@RequestBody PageDonatesDTO pageDonatesDTO); |
| | | |
| | | /** |
| | | * 新增物品捐赠 |
| | | * @param comActWarehouseDonatesDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/comActWarehouseDonates/donates/add") |
| | | R addDonates(@RequestBody ComActWarehouseDonatesDTO comActWarehouseDonatesDTO); |
| | | |
| | | /** |
| | | * 查看物品捐赠详情 |
| | | * @param donatesId |
| | | * @param isWhich |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/comActWarehouseDonates/donates/get") |
| | | R getDonates(@RequestParam("donatesId") Long donatesId, @RequestParam("isWhich") Integer isWhich, @RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 捐赠物品后台签收 |
| | | * @param comActWarehouseDonatesDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/comActWarehouseDonates/donates/signing") |
| | | R signingDonates(@RequestBody ComActWarehouseDonatesDTO comActWarehouseDonatesDTO); |
| | | |
| | | /** |
| | | * 用户取消捐赠 |
| | | * @param donatesId |
| | | * @param currentUser |
| | | * @return |
| | | */ |
| | | @GetMapping("/comActWarehouseDonates/donates/cancel") |
| | | R cancelDonates(@RequestParam("donatesId") Long donatesId, @RequestParam("currentUser") Long currentUser); |
| | | |
| | | /** |
| | | * 捐赠物品统计查询 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/comActWarehouseDonates/donates/statistics") |
| | | R getDonatesStatistics(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("/comActWarehouseOperation/queryAll") |
| | | public R comActWarehouseOperationSelectAll(@RequestBody CommonPage commonPage); |
| | | |
| | | /** |
| | | * 物品领用 |
| | | * @param comActWarehouseApplyDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/comActWarehouseDonates/donates/apply") |
| | | R applyDonates(@RequestBody ComActWarehouseApplyDTO comActWarehouseApplyDTO); |
| | | |
| | | /** |
| | | * 实有房屋数据修复定时任务 |
| | | * @return 实有房屋数据修复定时任务 |
| | | */ |
| | | @GetMapping("/population/house/status/task") |
| | | R timedTaskHouseJobHandler(); |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.panzhihua.common.model.dtos.DataKanBansDto; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.DisableOrEnableConvenientMerchantDTO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | |
| | | */ |
| | | @GetMapping("judgeCommunityTeam") |
| | | void judgeCommunityTeam(@RequestParam("openid") String openid); |
| | | |
| | | /** |
| | | * 数据看板升级版 |
| | | * |
| | | * @return 运营后台数据看板升级版 |
| | | */ |
| | | @PostMapping("datakanbans") |
| | | R dataKanBans(@RequestBody DataKanBansDto dataKanBansDto); |
| | | |
| | | /** |
| | | * 运营后台-用户数据统计汇总 |
| | | * @return 用户数据统计汇总 |
| | | */ |
| | | @GetMapping("community/statistics") |
| | | R communityStatistics(); |
| | | |
| | | /** |
| | | * 运营后台-用户数据统计导出 |
| | | * @return 用户数据 |
| | | */ |
| | | @GetMapping("community/statistics/export") |
| | | R communityStatisticsExport(); |
| | | } |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.*; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | |
| | | public static DateTimeFormatter format_ymd_String = DateTimeFormatter.ofPattern("yyMMdd"); |
| | | public static SimpleDateFormat yyyyMM_format = new SimpleDateFormat("yyyy-MM"); |
| | | public static SimpleDateFormat format_yyymmdd = new SimpleDateFormat("yyyyMMdd"); |
| | | public static SimpleDateFormat format_yyyy = new SimpleDateFormat("yyyy"); |
| | | private static DateTimeFormatter format_ymdhmssss = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"); |
| | | private static DateTimeFormatter format_ymds = DateTimeFormatter.ofPattern("yyyyMMdd"); |
| | | private static DateTimeFormatter format_yms = DateTimeFormatter.ofPattern("yyyyMM"); |
| | |
| | | String lastMonthEndTime = yyyyMMdd_format.format(lastMonthEndDateCal.getTime()) + " 23:59:59"; |
| | | return stringToDateStandard(lastMonthEndTime); |
| | | } |
| | | |
| | | /** |
| | | * 获取近20天日期 |
| | | * @return 近20天日期 |
| | | */ |
| | | public static List<Date> getOldDays() { |
| | | List<Date> dates = new ArrayList<>(); |
| | | Date date = new Date(); |
| | | for (int i = 19; i >= 0; i--) { |
| | | Date date1 = DateUtils.addDay(date, -i); |
| | | dates.add(date1); |
| | | } |
| | | return dates; |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.panzhihua.common.model.dtos.community.building.admin.*; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationImportErrorVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.model.vos.community.building.admin.BuildingDetailAdminVo; |
| | | import com.panzhihua.common.model.vos.community.building.admin.BuildingListHeaderStatisticsAdminVo; |
| | | import com.panzhihua.common.model.vos.community.building.admin.BuildingUnitHouseListAdminVo; |
| | | import com.panzhihua.common.model.vos.community.building.admin.PageBuildingListAdminVo; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseDetailVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingVO; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.listen.ComMngBuildingExcelListen; |
| | | import com.panzhihua.common.model.vos.R; |
| | |
| | | * @date 2021/6/10 12:34 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"社区管理"}) |
| | | @Api(tags = {"楼栋管理"}) |
| | | @RestController |
| | | @RequestMapping("/building") |
| | | public class BuildingApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | @ApiOperation(value = "excel导入楼栋信息") |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | @Value("${ftp.password}") |
| | | private String password; |
| | | // FTP 服务器地址IP地址 |
| | | @Value("${ftp.host}") |
| | | private String host; |
| | | // FTP 端口 |
| | | @Value("${ftp.port}") |
| | | private int port; |
| | | @Value("${excel.userurl}") |
| | | private String excelUrl; |
| | | |
| | | @ApiOperation(value = "excel导入楼栋信息--注:以前的接口,不需要对接") |
| | | @PostMapping(value = "/import", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R downloadPopulationTemplate(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | // String fileName = file.getOriginalFilename(); |
| | | // log.info("传入文件名字【{}】", fileName); |
| | | public R downloadPopulationTemplate(@RequestParam MultipartFile file) { |
| | | InputStream inputStream; |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | | ComMngBuildingExcelListen comMngBuildingExcelListen = |
| | | new ComMngBuildingExcelListen(communityService, this.getCommunityId()); |
| | | new ComMngBuildingExcelListen(communityService, this.getCommunityId(),stringRedisTemplate); |
| | | EasyExcel.read(inputStream, null, comMngBuildingExcelListen).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | log.error("导入模板失败【{}】", e.getMessage()); |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询楼栋列表", response = PageBuildingListAdminVo.class) |
| | | @PostMapping("/page") |
| | | public R page(@RequestBody PageBuildingListDto pageBuildingListDto) { |
| | | // 获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | pageBuildingListDto.setCommunityId(communityId); |
| | | return communityService.pageBuildingAdmin(pageBuildingListDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "楼栋列表表头统计", response = BuildingListHeaderStatisticsAdminVo.class) |
| | | @GetMapping("/header/statistics") |
| | | public R headerStatistics() { |
| | | // 获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | return communityService.buildingListHeaderStatisticsAdmin(communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "楼栋详情", response = BuildingDetailAdminVo.class) |
| | | @GetMapping("/detail") |
| | | public R detail(@RequestParam("id") Long id) { |
| | | return communityService.detailBuildAdmin(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询楼栋下单元列表", response = ComMngVillageBuildingVO.class) |
| | | @GetMapping("/unit/list") |
| | | public R unitList(@RequestParam("id") Long id) { |
| | | return communityService.buildingUnitListAdmin(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询单元下房屋列表", response = BuildingUnitHouseListAdminVo.class) |
| | | @PostMapping("/unit/house/list") |
| | | public R unitHouseList(@RequestBody PageBuildingUnitHouseListDto unitHouseListDto) { |
| | | return communityService.buildingUnitHouseListAdmin(unitHouseListDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询房屋详情", response = ComMngVillageBuildingHouseDetailVO.class) |
| | | @GetMapping("/unit/house/detail") |
| | | public R unitHouseDetail(@RequestParam("houseId") Long houseId) { |
| | | // 获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | return communityService.unitHouseDetailAdmin(houseId,communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询小区列表", response = ComMngVillageVO.class) |
| | | @GetMapping("/village/list") |
| | | public R villageList() { |
| | | // 获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | return communityService.buildingVillageListAdmin(communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加单元") |
| | | @PostMapping("/add/unit") |
| | | public R addUnit(@RequestBody AddBuildingUnitDto addBuildingUnitDto) { |
| | | // 获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | addBuildingUnitDto.setCommunityId(communityId); |
| | | |
| | | if(addBuildingUnitDto.getId() == null || addBuildingUnitDto.getUnitNo() == null){ |
| | | return R.fail("参数有误"); |
| | | } |
| | | return communityService.addBuildingUnitAdmin(addBuildingUnitDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改单元") |
| | | @PostMapping("/edit/unit") |
| | | public R editUnit(@RequestBody EditBuildingUnitDto editBuildingUnitDto) { |
| | | // 获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | editBuildingUnitDto.setCommunityId(communityId); |
| | | |
| | | if(editBuildingUnitDto.getId() == null || editBuildingUnitDto.getOldUnitNo() == null || editBuildingUnitDto.getNewUnitNo() == null){ |
| | | return R.fail("参数有误"); |
| | | } |
| | | return communityService.editBuildingUnitAdmin(editBuildingUnitDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加户室") |
| | | @PostMapping("/add/house") |
| | | public R addHouse(@RequestBody AddBuildingHouseDto addBuildingHouseDto) { |
| | | // 获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | addBuildingHouseDto.setCommunityId(communityId); |
| | | |
| | | if(addBuildingHouseDto.getId() == null || addBuildingHouseDto.getHouseNo() == null || addBuildingHouseDto.getUnitNo() == null){ |
| | | return R.fail("参数有误"); |
| | | } |
| | | return communityService.addBuildingHouseAdmin(addBuildingHouseDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改户室") |
| | | @PostMapping("/edit/house") |
| | | public R editHouse(@RequestBody EditBuildingHouseDto editBuildingHouseDto) { |
| | | // 获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | editBuildingHouseDto.setCommunityId(communityId); |
| | | |
| | | if(editBuildingHouseDto.getHouseId() == null || editBuildingHouseDto.getHouseNo() == null){ |
| | | return R.fail("参数有误"); |
| | | } |
| | | return communityService.editBuildingHouseAdmin(editBuildingHouseDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除户室下人员") |
| | | @PostMapping("/delete/population") |
| | | public R deletePopulation(@RequestBody DeleteBuildingHousePopulationDto housePopulationDto) { |
| | | // 获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | housePopulationDto.setCommunityId(communityId); |
| | | |
| | | if(housePopulationDto.getHouseId() == null || housePopulationDto.getPopulationId() == null || housePopulationDto.getType() == null){ |
| | | return R.fail("参数有误"); |
| | | } |
| | | return communityService.deleteBuildingHousePopulationAdmin(housePopulationDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载导入楼栋模板") |
| | | @GetMapping("/export/template") |
| | | public R exportTemplate() { |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String name = "楼栋导入模板.xlsx"; |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | List<List<String>> list = headDrugDataFilling(); |
| | | // List<List<Object>> dataList = new ArrayList<>(); |
| | | |
| | | EasyExcel.write(fileName).head(list).sheet("楼栋导入模板").doWrite(null); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(excelUrl + "楼栋导入模板.xlsx"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 楼栋导入模板拼接 |
| | | * @return 导入模板 |
| | | */ |
| | | private List<List<String>> headDrugDataFilling() { |
| | | List<List<String>> list = new ArrayList<List<String>>(); |
| | | List<String> head2 = new ArrayList<String>(); |
| | | head2.add("*街路巷"); |
| | | List<String> head3 = new ArrayList<String>(); |
| | | head3.add("小区名称"); |
| | | List<String> head4 = new ArrayList<String>(); |
| | | head4.add("*街路巷号"); |
| | | List<String> head5 = new ArrayList<String>(); |
| | | head5.add("*楼栋号"); |
| | | list.add(head2); |
| | | list.add(head3); |
| | | list.add(head4); |
| | | list.add(head5); |
| | | return list; |
| | | } |
| | | |
| | | @ApiOperation(value = "下载导入失败楼栋数据") |
| | | @PostMapping("/download/error") |
| | | public R downloadError(@RequestParam(value = "key") String key) { |
| | | List<ComMngPopulationImportErrorVO> list = new ArrayList<>(); |
| | | Boolean isExits = stringRedisTemplate.hasKey(key); |
| | | ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); |
| | | if (isExits) { |
| | | String json = valueOperations.get(key); |
| | | list = JSONArray.parseArray(json, ComMngPopulationImportErrorVO.class); |
| | | } |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String nowDate = DateUtils.getCurrentDateString(); |
| | | String name = "楼栋错误数据" + nowDate + ".xlsx"; |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | excelWriter = EasyExcel.write(fileName, ComMngPopulationImportErrorVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("楼栋错误数据").build(); |
| | | excelWriter.write(list, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.ExportUserDTO; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.dtos.user.EexcelUserDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActUserWalletTradeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComActUserWalletTradeRewardExcelVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ApplyStatistics; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseApplyExcelVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseApplyVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.QRCodeVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStream; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * 物品申请表(ComActWarehouseApply)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-09 17:13:53 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"爱心义仓申领记录接口"}) |
| | | @RestController |
| | | @RequestMapping("comActWarehouseApply") |
| | | public class ComActWarehouseApplyApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @Value("${excel.userurl}") |
| | | private String excelUrl; |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | @Value("${ftp.password}") |
| | | private String password; |
| | | // FTP 服务器地址IP地址 |
| | | @Value("${ftp.host}") |
| | | private String host; |
| | | // FTP 端口 |
| | | @Value("${ftp.port}") |
| | | private int port; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询所有数据",response = ComActWarehouseApplyVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setParamId(this.getCommunityId()); |
| | | return this.communityService.comActWarehouseApplySelectAll(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 统计查询 |
| | | * |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "统计查询",response = ApplyStatistics.class) |
| | | @GetMapping("selectStatics") |
| | | public R selectAll() { |
| | | return this.communityService.comActWarehouseApplySelectAll(this.getCommunityId()); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "通过主键查询单条数据",response = ComActWarehouseApplyVO.class) |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Integer id) { |
| | | return this.communityService.comActWarehouseApplySelectOne(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActWarehouseApply 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation("新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActWarehouseApplyVO comActWarehouseApply) { |
| | | comActWarehouseApply.setCommunityId(this.getCommunityId()); |
| | | comActWarehouseApply.setCreateTime(new Date()); |
| | | return this.communityService.comActWarehouseApplyInsert(comActWarehouseApply); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActWarehouseApply 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("修改数据") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActWarehouseApplyVO comActWarehouseApply) { |
| | | if(comActWarehouseApply.getStatus().equals(ComActWarehouseApplyVO.status.yqx)){ |
| | | comActWarehouseApply.setCancelTime(new Date()); |
| | | } |
| | | if(comActWarehouseApply.getStatus().equals(ComActWarehouseApplyVO.status.dlq)||comActWarehouseApply.getStatus().equals(ComActWarehouseApplyVO.status.ybh)){ |
| | | comActWarehouseApply.setSolveTime(new Date()); |
| | | comActWarehouseApply.setSolveUserId(this.getUserId()); |
| | | } |
| | | if(comActWarehouseApply.getStatus().equals(ComActWarehouseApplyVO.status.ylq)){ |
| | | comActWarehouseApply.setActualTime(new Date()); |
| | | comActWarehouseApply.setWriteOffUserId(this.getUserId()); |
| | | } |
| | | return this.communityService.comActWarehouseApplyUpdate(comActWarehouseApply); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation("删除数据") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return this.communityService.comActWarehouseApplyDelete(id); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | * @param qrCodeVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("生成二维码") |
| | | @PostMapping("/getQRCode") |
| | | public R getQRCode(@RequestBody QRCodeVO qrCodeVO){ |
| | | return this.communityService.comActWarehouseApplyGetQRCode(qrCodeVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出") |
| | | @PostMapping("/export") |
| | | public R export(@RequestBody CommonPage commonPage) { |
| | | Long communityId = this.getCommunityId(); |
| | | commonPage.setParamId(communityId); |
| | | |
| | | |
| | | String name = "物品领取.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | // 用户搜索了就下载搜索的用户否则下载所有用户 |
| | | R r = communityService.comActWarehouseApplyExport(commonPage); |
| | | if (R.isOk(r)) { |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | excelWriter = EasyExcel.write(fileName, ComActWarehouseApplyExcelVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet( "导出").build(); |
| | | excelWriter.write(JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActWarehouseApplyExcelVO.class), writeSheet); |
| | | |
| | | |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseBaseVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 义仓基础设置表(ComActWarehouseBase)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-11 09:21:53 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"爱心义仓基础记录接口"}) |
| | | @RestController |
| | | @RequestMapping("comActWarehouseBase") |
| | | public class ComActWarehouseBaseApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 通过社区id查询单条数据 |
| | | * |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "查询单条数据",response = ComActWarehouseBaseVO.class) |
| | | @GetMapping |
| | | public R selectOne() { |
| | | return this.communityService.comActWarehouseBaseSelectOne(this.getCommunityId()); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActWarehouseBase 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation("新增接口") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActWarehouseBaseVO comActWarehouseBase) { |
| | | comActWarehouseBase.setCreateTime(new Date()); |
| | | comActWarehouseBase.setCommunityId(this.getCommunityId()); |
| | | return communityService.comActWarehouseBaseInsert(comActWarehouseBase); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.listen.WarehouseDonatesExcelListen; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ComActWarehouseApplyDTO; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ComActWarehouseDonatesDTO; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ExportDonatesDTO; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.PageDonatesDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseDonatesVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.DonatesStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ExportDonatesVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.WarehouseDonatesExcelVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @title: ComActWarehouseApi |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 爱心义仓相关接口 |
| | | * @author: hans |
| | | * @date: 2021/10/09 17:35 |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Api(tags = {"爱心义仓捐赠相关"}) |
| | | @RestController |
| | | @RequestMapping("/warehouse/donates") |
| | | public class ComActWarehouseDonatesApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @Value("${excel.donatesimporturl}") |
| | | private String donatesImportUrl; |
| | | @Value("${excel.userurl}") |
| | | private String excelUrl; |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | | @Value("${ftp.password}") |
| | | private String password; |
| | | @Value("${ftp.host}") |
| | | private String host; |
| | | @Value("${ftp.port}") |
| | | private int port; |
| | | @Value("${ftp.url}") |
| | | private String url; |
| | | |
| | | @PostMapping("/import") |
| | | @ApiOperation(value = "捐赠物品导入", response = R.class) |
| | | public R importDonates(@RequestParam MultipartFile file) { |
| | | InputStream inputStream; |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | | EasyExcel.read(inputStream, WarehouseDonatesExcelVO.class, |
| | | new WarehouseDonatesExcelListen(communityService, getCommunityId(), getUserId())).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | log.error("导入捐赠物品失败【{}】", e.getMessage()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/import/templates") |
| | | @ApiOperation(value = "获取物品捐赠导入模板", response = R.class) |
| | | public R getDonatesImportTemplate() { |
| | | return R.ok(donatesImportUrl); |
| | | } |
| | | |
| | | @ApiOperation(value = "捐赠物品导出") |
| | | @PostMapping("/export") |
| | | public R exportDonates(@RequestBody ExportDonatesDTO exportDonatesDTO) { |
| | | String communityName = getCommunityName(); |
| | | exportDonatesDTO.setCommunityId(getCommunityId()); |
| | | String url = excelUrl; |
| | | String name = "爱心义仓" + communityName + "捐赠物品导出.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | R r = communityService.exportDonates(exportDonatesDTO); |
| | | if (R.isOk(r)) { |
| | | List<ExportDonatesVO> exportDonatesVOList = |
| | | JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ExportDonatesVO.class); |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | excelWriter = EasyExcel.write(fileName, ExportDonatesVO.class).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("爱心义仓捐赠物品导出").build(); |
| | | excelWriter.write(exportDonatesVOList, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(url + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return R.fail("未查询到数据"); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询捐赠物品", response = ComActWarehouseDonatesVO.class) |
| | | @PostMapping("/page") |
| | | public R pageDonates(@RequestBody PageDonatesDTO pageDonatesDTO) { |
| | | pageDonatesDTO.setCommunityId(getCommunityId()); |
| | | return communityService.pageDonates(pageDonatesDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增物品捐赠") |
| | | @PostMapping("/add") |
| | | public R addDonates(@RequestBody @Validated(AddGroup.class) ComActWarehouseDonatesDTO comActWarehouseDonatesDTO) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | comActWarehouseDonatesDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | comActWarehouseDonatesDTO.setRegisterBy(loginUserInfo.getUserId()); |
| | | comActWarehouseDonatesDTO.setSigningBy(loginUserInfo.getUserId()); |
| | | return communityService.addDonates(comActWarehouseDonatesDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查看物品捐赠详情", response = ComActWarehouseDonatesVO.class) |
| | | @GetMapping("/get") |
| | | public R getDonates(@RequestParam("donatesId") Long donatesId) { |
| | | return communityService.getDonates(donatesId, 0, 0L); |
| | | } |
| | | |
| | | @ApiOperation(value = "捐赠物品签收") |
| | | @PostMapping("/signing") |
| | | public R signingDonates(@RequestBody @Validated(PutGroup.class) ComActWarehouseDonatesDTO comActWarehouseDonatesDTO) { |
| | | comActWarehouseDonatesDTO.setSigningBy(getUserId()); |
| | | return communityService.signingDonates(comActWarehouseDonatesDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "捐赠物品统计查询", response = DonatesStatisticsVO.class) |
| | | @GetMapping("/statistics") |
| | | public R getDonatesStatistics() { |
| | | return communityService.getDonatesStatistics(getCommunityId()); |
| | | } |
| | | |
| | | @ApiOperation("物品领用") |
| | | @PostMapping("/apply") |
| | | public R applyDonates(@RequestBody @Validated(AddGroup.class) ComActWarehouseApplyDTO comActWarehouseApplyDTO) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | comActWarehouseApplyDTO.setOperateUserId(loginUserInfo.getUserId()); |
| | | comActWarehouseApplyDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return communityService.applyDonates(comActWarehouseApplyDTO); |
| | | } |
| | | } |
| | |
| | | |
| | | @ApiOperation(value = "批量删除实有人口") |
| | | @PostMapping("/delete") |
| | | public R deletePopulations(@RequestBody List<Long> Ids) { |
| | | return communityService.deletePopulations(Ids); |
| | | public R deletePopulations(@RequestBody List<Long> ids) { |
| | | return communityService.deletePopulations(ids,this.getCommunityId()); |
| | | } |
| | | |
| | | private List<List<String>> headDataFilling() { |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | comMngVillageVO.setCommunityId(communityId); |
| | | if(StringUtils.isEmpty(comMngVillageVO.getGroupAt())){ |
| | | comMngVillageVO.setName(comMngVillageVO.getAlley() + comMngVillageVO.getHouseNum()); |
| | | }else{ |
| | | comMngVillageVO.setName(comMngVillageVO.getGroupAt()); |
| | | } |
| | | return communityService.addVillage(comMngVillageVO); |
| | | } |
| | | |
| | |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-actuator</artifactId> |
| | | </dependency> |
| | | <!-- zxing生成二维码 --> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>core</artifactId> |
| | | <version>3.3.3</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>javase</artifactId> |
| | | <version>3.3.3</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.building.admin.*; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/building") |
| | | @RequestMapping("/building/") |
| | | public class BuildingApi { |
| | | |
| | | @Resource |
| | |
| | | @PostMapping("/batchSave") |
| | | R listSaveBuildingExcelVO(@RequestBody List<ComMngBuildingExcelVO> newVoList, |
| | | @RequestParam("communityId") Long communityId) { |
| | | |
| | | return comActBuildingService.batchSaveBuilding(newVoList, communityId); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-分页查询楼栋列表 |
| | | * @param pageBuildingListDto 请求参数 |
| | | * @return 楼栋列表 |
| | | */ |
| | | @PostMapping("/page/admin") |
| | | public R pageBuildingAdmin(@RequestBody PageBuildingListDto pageBuildingListDto) { |
| | | return comActBuildingService.pageBuildingAdmin(pageBuildingListDto); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋列表表头统计数据 |
| | | * @param communityId 社区id |
| | | * @return 楼栋列表表头统计数据 |
| | | */ |
| | | @GetMapping("/header/statistics/") |
| | | public R buildingListHeaderStatisticsAdmin(@RequestParam("communityId") Long communityId) { |
| | | return comActBuildingService.buildingListHeaderStatisticsAdmin(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋详情 |
| | | * @param id 楼栋id |
| | | * @return 楼栋详情 |
| | | */ |
| | | @GetMapping("/detail/admin") |
| | | public R detailBuildAdmin(@RequestParam("id") Long id) { |
| | | return comActBuildingService.detailBuildAdmin(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询楼栋下单元列表 |
| | | * @param id 楼栋id |
| | | * @return 单元列表 |
| | | */ |
| | | @GetMapping("/unit/list/admin") |
| | | public R buildingUnitListAdmin(@RequestParam("id") Long id) { |
| | | return comActBuildingService.buildingUnitListAdmin(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询楼栋单元下房屋列表 |
| | | * @param unitHouseListDto 请求参数 |
| | | * @return 单元列表 |
| | | */ |
| | | @PostMapping("/unit/house/list/admin") |
| | | public R buildingUnitHouseListAdmin(@RequestBody PageBuildingUnitHouseListDto unitHouseListDto) { |
| | | return comActBuildingService.buildingUnitHouseListAdmin(unitHouseListDto); |
| | | } |
| | | |
| | | @GetMapping("/unit/house/detail/admin") |
| | | public R buildingUnitHouseDetailAdmin(@RequestParam("houseId") Long houseId,@RequestParam("communityId") Long communityId) { |
| | | return comActBuildingService.buildingUnitHouseDetailAdmin(houseId,communityId); |
| | | } |
| | | |
| | | @GetMapping("/village/list/admin") |
| | | public R buildingVillageListAdmin(@RequestParam("communityId") Long communityId) { |
| | | return comActBuildingService.buildingVillageListAdmin(communityId); |
| | | } |
| | | |
| | | @PostMapping("/unit/add/admin") |
| | | public R addBuildingUnitAdmin(@RequestBody AddBuildingUnitDto addBuildingUnitDto) { |
| | | return comActBuildingService.addBuildingUnitAdmin(addBuildingUnitDto); |
| | | } |
| | | |
| | | @PostMapping("/unit/edit/admin") |
| | | public R editBuildingUnitAdmin(@RequestBody EditBuildingUnitDto editBuildingUnitDto) { |
| | | return comActBuildingService.editBuildingUnitAdmin(editBuildingUnitDto); |
| | | } |
| | | |
| | | @PostMapping("/house/add/admin") |
| | | public R addBuildingHouseAdmin(@RequestBody AddBuildingHouseDto addBuildingHouseDto) { |
| | | return comActBuildingService.addBuildingHouseAdmin(addBuildingHouseDto); |
| | | } |
| | | |
| | | @PostMapping("/house/edit/admin") |
| | | public R editBuildingHouseAdmin(@RequestBody EditBuildingHouseDto editBuildingHouseDto) { |
| | | return comActBuildingService.editBuildingHouseAdmin(editBuildingHouseDto); |
| | | } |
| | | |
| | | @PostMapping("/house/population/delete/admin") |
| | | public R deleteBuildingHousePopulationAdmin(@RequestBody DeleteBuildingHousePopulationDto housePopulationDto) { |
| | | return comActBuildingService.deleteBuildingHousePopulationAdmin(housePopulationDto); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseApplyVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.QRCodeVO; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseApply; |
| | | import com.panzhihua.service_community.service.ComActWarehouseApplyService; |
| | | import com.panzhihua.service_community.util.QRCodeUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 物品申请表(ComActWarehouseApply)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-09 17:13:53 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("comActWarehouseApply") |
| | | public class ComActWarehouseApplyApi { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private ComActWarehouseApplyService comActWarehouseApplyService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return this.comActWarehouseApplyService.pageList(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 统计查询 |
| | | * |
| | | * @param communityId |
| | | * @return 所有数据 |
| | | */ |
| | | @GetMapping("selectStatics") |
| | | public R selectAll(@RequestParam("communityId") Long communityId) { |
| | | return this.comActWarehouseApplyService.selectStatics(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Integer id) { |
| | | return this.comActWarehouseApplyService.selectById(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActWarehouseApplyVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActWarehouseApplyVO comActWarehouseApplyVO) { |
| | | ComActWarehouseApply comActWarehouseApply=new ComActWarehouseApply(); |
| | | BeanUtils.copyProperties(comActWarehouseApplyVO,comActWarehouseApply); |
| | | return R.ok(this.comActWarehouseApplyService.save(comActWarehouseApply)); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActWarehouseApplyVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActWarehouseApplyVO comActWarehouseApplyVO) { |
| | | ComActWarehouseApply comActWarehouseApply=new ComActWarehouseApply(); |
| | | BeanUtils.copyProperties(comActWarehouseApplyVO,comActWarehouseApply); |
| | | return this.comActWarehouseApplyService.update(comActWarehouseApply); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return R.ok(this.comActWarehouseApplyService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | * @param qrCodeVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/getQRCode") |
| | | public R getQRCode(@RequestBody QRCodeVO qrCodeVO){ |
| | | return R.ok(QRCodeUtil.getBase64QRCode(JSONObject.toJSONString(qrCodeVO))); |
| | | } |
| | | /** |
| | | * 社区团队权限校验 |
| | | */ |
| | | @GetMapping("/check") |
| | | public R check(@RequestParam("phone") String phone){ |
| | | return this.comActWarehouseApplyService.check(phone); |
| | | } |
| | | |
| | | /** |
| | | * 导出数据 |
| | | */ |
| | | @PostMapping("/export") |
| | | public R export(@RequestBody CommonPage commonPage){ |
| | | return this.comActWarehouseApplyService.export(commonPage); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseBaseVO; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseBase; |
| | | import com.panzhihua.service_community.service.ComActWarehouseBaseService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 义仓基础设置表(ComActWarehouseBase)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-11 09:21:53 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("comActWarehouseBase") |
| | | public class ComActWarehouseBaseApi { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private ComActWarehouseBaseService comActWarehouseBaseService; |
| | | |
| | | /** |
| | | * 通过社区id查询单条数据 |
| | | * |
| | | * @param communityId 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping |
| | | public R selectOne(@RequestParam("communityId") Long communityId) { |
| | | return R.ok(this.comActWarehouseBaseService.getOne(new QueryWrapper<ComActWarehouseBase>().lambda().eq(ComActWarehouseBase::getCommunityId,communityId))); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActWarehouseBaseVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActWarehouseBaseVO comActWarehouseBaseVO) { |
| | | ComActWarehouseBase comActWarehouseBase=new ComActWarehouseBase(); |
| | | BeanUtils.copyProperties(comActWarehouseBaseVO,comActWarehouseBase); |
| | | if(comActWarehouseBase.getId()!=null){ |
| | | return R.ok(this.comActWarehouseBaseService.updateById(comActWarehouseBase)); |
| | | } |
| | | return R.ok(this.comActWarehouseBaseService.save(comActWarehouseBase)); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActWarehouseBase 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActWarehouseBase comActWarehouseBase) { |
| | | return R.ok(this.comActWarehouseBaseService.updateById(comActWarehouseBase)); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return R.ok(this.comActWarehouseBaseService.removeById(id)); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ComActWarehouseApplyDTO; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ComActWarehouseDonatesDTO; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ExportDonatesDTO; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.PageDonatesDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.community.warehouse.WarehouseDonatesExcelVO; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseDonates; |
| | | import com.panzhihua.service_community.service.ComActWarehouseDonatesService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 爱心义仓/物品捐赠表(ComActWarehouseDonates)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-09 17:14:16 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("comActWarehouseDonates") |
| | | public class ComActWarehouseDonatesApi { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private ComActWarehouseDonatesService comActWarehouseDonatesService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return this.comActWarehouseDonatesService.pageList(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Serializable id) { |
| | | return R.ok(this.comActWarehouseDonatesService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActWarehouseDonates 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActWarehouseDonates comActWarehouseDonates) { |
| | | return R.ok(this.comActWarehouseDonatesService.save(comActWarehouseDonates)); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActWarehouseDonates 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActWarehouseDonates comActWarehouseDonates) { |
| | | return R.ok(this.comActWarehouseDonatesService.updateById(comActWarehouseDonates)); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return R.ok(this.comActWarehouseDonatesService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 后台导入捐赠物品 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | @PostMapping("/import") |
| | | public R batchImportWarehouseDonates(@RequestBody List<WarehouseDonatesExcelVO> list) { |
| | | return comActWarehouseDonatesService.batchImportWarehouseDonates(list); |
| | | } |
| | | |
| | | /** |
| | | * 后台导出捐赠物品表格 |
| | | * @param exportDonatesDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/donates/export") |
| | | public R exportDonates(@RequestBody ExportDonatesDTO exportDonatesDTO) { |
| | | return comActWarehouseDonatesService.exportDonates(exportDonatesDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询捐赠物品 |
| | | * @param pageDonatesDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/donates/page") |
| | | public R pageDonates(@RequestBody PageDonatesDTO pageDonatesDTO) { |
| | | return comActWarehouseDonatesService.pageDonates(pageDonatesDTO); |
| | | } |
| | | |
| | | /** |
| | | * 新增物品捐赠 |
| | | * @param comActWarehouseDonatesDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/donates/add") |
| | | public R addDonates(@RequestBody ComActWarehouseDonatesDTO comActWarehouseDonatesDTO) { |
| | | return comActWarehouseDonatesService.addDonates(comActWarehouseDonatesDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查看物品捐赠详情 |
| | | * @param donatesId |
| | | * @return |
| | | */ |
| | | @GetMapping("/donates/get") |
| | | public R getDonates(@RequestParam("donatesId") Long donatesId, @RequestParam("isWhich") Integer isWhich, @RequestParam("userId") Long userId) { |
| | | return comActWarehouseDonatesService.getDonates(donatesId, isWhich, userId); |
| | | } |
| | | |
| | | /** |
| | | * 捐赠物品后台签收 |
| | | * @param comActWarehouseDonatesDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/donates/signing") |
| | | public R signingDonates(@RequestBody ComActWarehouseDonatesDTO comActWarehouseDonatesDTO) { |
| | | return comActWarehouseDonatesService.signingDonates(comActWarehouseDonatesDTO); |
| | | } |
| | | |
| | | /** |
| | | * 用户取消捐赠 |
| | | * @param donatesId |
| | | * @param currentUser |
| | | * @return |
| | | */ |
| | | @GetMapping("/donates/cancel") |
| | | public R cancelDonates(@RequestParam("donatesId") Long donatesId, @RequestParam("currentUser") Long currentUser) { |
| | | return comActWarehouseDonatesService.cancelDonates(donatesId, currentUser); |
| | | } |
| | | |
| | | /** |
| | | * 捐赠物品统计查询 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/donates/statistics") |
| | | public R getDonatesStatistics(@RequestParam("communityId") Long communityId) { |
| | | return comActWarehouseDonatesService.getDonatesStatistics(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台物品领用 |
| | | * @param comActWarehouseApplyDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/donates/apply") |
| | | public R applyDonates(@RequestBody ComActWarehouseApplyDTO comActWarehouseApplyDTO) { |
| | | return comActWarehouseDonatesService.applyDonates(comActWarehouseApplyDTO); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseOperation; |
| | | import com.panzhihua.service_community.service.ComActWarehouseOperationService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 爱心义操作表(ComActWarehouseOperation)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-09 17:14:34 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("comActWarehouseOperation") |
| | | public class ComActWarehouseOperationApi { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private ComActWarehouseOperationService comActWarehouseOperationService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return this.comActWarehouseOperationService.pageList(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Serializable id) { |
| | | return R.ok(this.comActWarehouseOperationService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActWarehouseOperation 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActWarehouseOperation comActWarehouseOperation) { |
| | | return R.ok(this.comActWarehouseOperationService.save(comActWarehouseOperation)); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActWarehouseOperation 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActWarehouseOperation comActWarehouseOperation) { |
| | | return R.ok(this.comActWarehouseOperationService.updateById(comActWarehouseOperation)); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return R.ok(this.comActWarehouseOperationService.removeById(id)); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 批量删除实有人口 |
| | | * |
| | | * @param Ids |
| | | * @param ids |
| | | * 删除id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/population/delete") |
| | | public R deletePopulations(@RequestBody List<Long> Ids) { |
| | | return comMngPopulationService.deletePopulations(Ids); |
| | | public R deletePopulations(@RequestBody List<Long> ids, Long communityId) { |
| | | return comMngPopulationService.deletePopulations(ids,communityId); |
| | | } |
| | | |
| | | /** |
| | |
| | | return comExServicemanService.getPageExServiceman(comExServicemanDTO); |
| | | } |
| | | |
| | | /** |
| | | * 实有房屋数据修复定时任务 |
| | | * @return 实有房屋数据修复定时任务 |
| | | */ |
| | | @GetMapping("/house/status/task") |
| | | public R timedTaskHouseJobHandler() { |
| | | return comMngPopulationHouseService.timedTaskHouseJobHandler(); |
| | | } |
| | | |
| | | } |
| | |
| | | @Update("update com_act_micro_wish set `status`=6, evaluate_at=now() where `status`=5 and TIMESTAMPDIFF(HOUR, finish_at, SYSDATE())>=72") |
| | | int updateStatusAutoConfirm(); |
| | | |
| | | @Select("select id from com_act_micro_wish where `status`=5 and TIMESTAMPDIFF(HOUR, feedback_at, SYSDATE())>=72 ") |
| | | @Select("select id from com_act_micro_wish where `status`=5 and TIMESTAMPDIFF(HOUR, finish_at, SYSDATE())>=72 ") |
| | | List<Long> getWishAutoConfirmIds(); |
| | | |
| | | @Select("SELECT COUNT(id) AS completedNum," + |
| | |
| | | + " from com_mng_population_house where village_id = #{villageId}") |
| | | ComMngVillageVO getStatisticsCount(@Param("villageId") Long villageId); |
| | | |
| | | @Select("select count(village_id) as villageTotal" |
| | | + ",(select count(village_id) from com_mng_village where community_id = #{communityId} and type = 1) as townTotal" |
| | | + ",(select count(village_id) from com_mng_village where community_id = #{communityId} and type = 2) as countrysideTotal" |
| | | @Select("select count(distinct `name`) as villageTotal" |
| | | + ",(select count(distinct `name`) from com_mng_village where community_id = #{communityId} and type = 1) as townTotal" |
| | | + ",(select count(distinct `name`) from com_mng_village where community_id = #{communityId} and type = 2) as countrysideTotal" |
| | | + " from com_mng_village where community_id = #{communityId}") |
| | | ComMngVillageTotalVO getVillageStatisticsCount(@Param("communityId") Long communityId); |
| | | |
| New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ApplyStatistics; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseApplyVO; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseApply; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 物品申请表(ComActWarehouseApply)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-09 17:13:52 |
| | | */ |
| | | @Mapper |
| | | public interface ComActWarehouseApplyDao extends BaseMapper<ComActWarehouseApply> { |
| | | /** |
| | | * 分页查询 |
| | | * @param page |
| | | * @param commonPage |
| | | * @return |
| | | */ |
| | | IPage<ComActWarehouseApplyVO> queryAll(Page page, @Param("commonPage")CommonPage commonPage); |
| | | |
| | | /** |
| | | * 申领统计 |
| | | * @param communityId |
| | | * @return ApplyStatistics |
| | | */ |
| | | ApplyStatistics selectStatics(Long communityId); |
| | | |
| | | /** |
| | | * 主键查询详情 |
| | | * @param id |
| | | * @return ComActWarehouseApplyVO |
| | | */ |
| | | ComActWarehouseApplyVO selectById(Integer id); |
| | | |
| | | /** |
| | | * 条件导出 |
| | | * @param commonPage |
| | | * @return |
| | | */ |
| | | List<ComActWarehouseApplyVO> queryAll(@Param("commonPage") CommonPage commonPage); |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseBase; |
| | | |
| | | /** |
| | | * 义仓基础设置表(ComActWarehouseBase)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-11 09:21:52 |
| | | */ |
| | | @Mapper |
| | | public interface ComActWarehouseBaseDao extends BaseMapper<ComActWarehouseBase> { |
| | | |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.PageDonatesDTO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseDonatesVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.DonatesStatisticsVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ExportDonatesDTO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ExportDonatesVO; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseDonates; |
| | | |
| | | /** |
| | | * 爱心义仓/物品捐赠表(ComActWarehouseDonates)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-09 17:14:15 |
| | | */ |
| | | @Mapper |
| | | public interface ComActWarehouseDonatesDao extends BaseMapper<ComActWarehouseDonates> { |
| | | |
| | | /** |
| | | * 批量插入捐赠物品 |
| | | * @param donateList |
| | | * @return |
| | | */ |
| | | int batchInsertDonates(@Param("donateList") List<ComActWarehouseDonates> donateList); |
| | | |
| | | /** |
| | | * 根据id查找导出数据 |
| | | * @param needExportIds |
| | | * @return |
| | | */ |
| | | List<ExportDonatesVO> exportDonatesByIds(@Param("needExportIds") List<Long> needExportIds); |
| | | |
| | | /** |
| | | * 根据查询条件导出数据 |
| | | * @param exportDonatesDTO |
| | | * @return |
| | | */ |
| | | List<ExportDonatesVO> exportDonatesBySearch(@Param("exportDonatesDTO") ExportDonatesDTO exportDonatesDTO); |
| | | |
| | | /** |
| | | * 社区后台分页查询捐赠物品 |
| | | * @param page |
| | | * @param pageDonatesDTO |
| | | * @return |
| | | */ |
| | | IPage<ComActWarehouseDonatesVO> pageDonates(@Param("page") Page page, @Param("pageDonatesDTO") PageDonatesDTO pageDonatesDTO); |
| | | |
| | | /** |
| | | * 查看捐赠详情 |
| | | * @param donatesId |
| | | * @return |
| | | */ |
| | | ComActWarehouseDonatesVO selectDetailById(@Param("donatesId") Long donatesId); |
| | | |
| | | /** |
| | | * 捐赠物品统计查询 |
| | | * @param communityId |
| | | * @param currentYear |
| | | * @param currentMonth |
| | | * @param today |
| | | * @return |
| | | */ |
| | | DonatesStatisticsVO selectDonatesStatistics(@Param("communityId") Long communityId, @Param("currentYear") String currentYear, |
| | | @Param("currentMonth") String currentMonth, @Param("today") String today); |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseOperationVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseOperation; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 爱心义操作表(ComActWarehouseOperation)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-09 17:14:34 |
| | | */ |
| | | @Mapper |
| | | public interface ComActWarehouseOperationDao extends BaseMapper<ComActWarehouseOperation> { |
| | | |
| | | /** |
| | | * 批量插入操作记录 |
| | | * @param operationList |
| | | * @return |
| | | */ |
| | | int batchInsertOperation(@Param("operationList") List<ComActWarehouseOperation> operationList); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param page |
| | | * @param commonPage |
| | | * @return |
| | | */ |
| | | IPage<ComActWarehouseOperationVO> pageList(Page page, @Param("commonPage")CommonPage commonPage); |
| | | |
| | | /** |
| | | * 获取捐赠物品相关操作记录 |
| | | * @param donatesId |
| | | * @return |
| | | */ |
| | | List<ComActWarehouseOperationVO> selectList(@Param("donatesId") Long donatesId); |
| | | } |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.building.admin.PageBuildingListDto; |
| | | import com.panzhihua.common.model.dtos.community.building.admin.PageBuildingUnitHouseListDto; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.model.vos.community.VillageVO; |
| | | import com.panzhihua.common.model.vos.community.building.admin.BuildingDetailAdminVo; |
| | | import com.panzhihua.common.model.vos.community.building.admin.BuildingListHeaderStatisticsAdminVo; |
| | | import com.panzhihua.common.model.vos.community.building.admin.PageBuildingListAdminVo; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseDetailVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingVO; |
| | | import com.panzhihua.common.model.vos.grid.PopulationListVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | |
| | | List<String> findByVillage(String ids); |
| | | |
| | | List<VillageVO> select(Long id); |
| | | |
| | | /** |
| | | * 社区后台-分页查询楼栋列表 |
| | | * |
| | | * @param pageBuildingListDto 请求参数 |
| | | * @return 楼栋列表 |
| | | */ |
| | | IPage<PageBuildingListAdminVo> pageBuildingAdmin(Page page, @Param(value = "pageBuildingListDto") PageBuildingListDto pageBuildingListDto); |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋列表表头统计数据 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 楼栋列表表头统计数据 |
| | | */ |
| | | BuildingListHeaderStatisticsAdminVo buildingListHeaderStatisticsAdmin(@Param(value = "communityId") Long communityId); |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋详情 |
| | | * |
| | | * @param id 楼栋id |
| | | * @return 楼栋详情 |
| | | */ |
| | | BuildingDetailAdminVo detailBuildAdmin(@Param(value = "id") Long id); |
| | | |
| | | /** |
| | | * 查询楼栋下的单元列表 |
| | | * @param villageId 小区id |
| | | * @param floor 楼栋号 |
| | | * @return 单元列表 |
| | | */ |
| | | List<ComMngVillageBuildingVO> buildingUnitList(@Param(value = "villageId") Long villageId, @Param(value = "floor") String floor); |
| | | |
| | | /** |
| | | * 查询楼栋单元下房屋列表 |
| | | * @param unitHouseListDto 请求参数 |
| | | * @return 房屋列表 |
| | | */ |
| | | IPage<ComMngVillageBuildingHouseVO> getBuildingUnitHouseList(Page page, @Param(value = "pageBuildingListDto") PageBuildingUnitHouseListDto unitHouseListDto); |
| | | |
| | | /** |
| | | * 查询楼栋单元下统计数据 |
| | | * @param villageId 小区id |
| | | * @param floor 楼栋号 |
| | | * @param unit 单元号 |
| | | * @return 统计数据 |
| | | */ |
| | | Map<String,Object> getBuildingUnitHouseStatistics(@Param(value = "villageId") Long villageId, @Param(value = "floor") String floor, @Param(value = "unit") String unit); |
| | | |
| | | ComMngVillageBuildingHouseDetailVO buildingUnitHouseDetailAdmin(@Param("houseId") Long houseId); |
| | | |
| | | List<PopulationListVO> getGridVillageBuildingPopulationList(@Param("houseId") Long houseId,@Param("communityId") Long communityId, |
| | | @Param("relation") Integer relation, @Param("relationId") Integer relationId); |
| | | |
| | | List<ComMngVillageVO> buildingVillageListAdmin(@Param("communityId") Long communityId); |
| | | } |
| | |
| | | |
| | | void updateAll(@Param("comMngPopulationCommunityTagsDOS") List<ComMngPopulationCommunityTagsDO> comMngPopulationCommunityTagsDOS); |
| | | |
| | | /** |
| | | * 删除实有人口与社区绑定关系 |
| | | * @param ids 实有人口id集合 |
| | | * @param communityId 社区id |
| | | */ |
| | | void deletePopulationRelation(@Param("ids") List<Long> ids,@Param("communityId") Long communityId); |
| | | |
| | | } |
| | |
| | | * 居民详情 |
| | | */ |
| | | ComMngPopulationDetailVO getById(Long id); |
| | | |
| | | /** |
| | | * 修改实有人口绑定单元号 |
| | | * @param villageId 小区id |
| | | * @param floor 楼栋号 |
| | | * @param oldUnitNo 原单元号 |
| | | * @param newUnitNo 新单元号 |
| | | */ |
| | | void updatePopulationUnit(@Param("villageId") Long villageId, @Param("floor") String floor,@Param("oldUnitNo") String oldUnitNo,@Param("newUnitNo") String newUnitNo); |
| | | } |
| | |
| | | + ",#{item.purpose},#{item.controlStatus},#{item.isEmpty},#{item.constructPurpose}" |
| | | + ",#{item.constructArea},#{item.path},now())" + " </foreach>" + " </script>") |
| | | void insertAll(@Param("houseList") List<ComMngPopulationHouseDO> houseList); |
| | | |
| | | /** |
| | | * 修改房屋关联单元号 |
| | | * @param villageId 小区id |
| | | * @param floor 楼栋号 |
| | | * @param oldUnitNo 原单元号 |
| | | * @param newUnitNo 新单元号 |
| | | */ |
| | | void updateHouseUnit(@Param("villageId") Long villageId, @Param("floor") String floor,@Param("oldUnitNo") String oldUnitNo,@Param("newUnitNo") String newUnitNo); |
| | | |
| | | /** |
| | | * 修改房屋关联单元号 |
| | | * @param houseList 需要修改的数据 |
| | | */ |
| | | void updateUnitAll(@Param("houseList") List<ComMngPopulationHouseDO> houseList); |
| | | } |
| | |
| | | + " left join com_mng_population_house as cmph on cmph.id = cmphu.house_id " |
| | | + " where cmphu.id = #{id}") |
| | | ComMngHouseVo detail(Long id); |
| | | |
| | | /** |
| | | * 查询指定人员是否存在租住的数量 |
| | | * @param ids 指定实有人口 |
| | | * @return 存在租住的数量 |
| | | */ |
| | | Integer getHouseUserIsRent(@Param("ids") List<Long> ids); |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.ComPbServiceTeam; |
| | | |
| | | /** |
| | | * 服务团队(ComPbServiceTeam)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-11 13:24:35 |
| | | */ |
| | | @Mapper |
| | | public interface ComPbServiceTeamDao extends BaseMapper<ComPbServiceTeam> { |
| | | |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * 物品申请表(ComActWarehouseApply)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-11 13:47:37 |
| | | */ |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel("物品申请表") |
| | | public class ComActWarehouseApply implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 225290522401641721L; |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 物品id |
| | | */ |
| | | @ApiModelProperty(value = "物品id") |
| | | private Integer goodsId; |
| | | |
| | | /** |
| | | * 物品数量 |
| | | */ |
| | | @ApiModelProperty(value = "物品数量") |
| | | private Integer goodsNum; |
| | | |
| | | /** |
| | | * 预约时间 |
| | | */ |
| | | @ApiModelProperty(value = "预约时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | |
| | | /** |
| | | * 实际时间 |
| | | */ |
| | | @ApiModelProperty(value = "实际时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date actualTime; |
| | | |
| | | /** |
| | | * 理由 |
| | | */ |
| | | @ApiModelProperty(value = "理由") |
| | | private String reason; |
| | | |
| | | /** |
| | | * 领取图片 |
| | | */ |
| | | @ApiModelProperty(value = "领取图片") |
| | | private String receiveUrl; |
| | | |
| | | /** |
| | | * 提交时间 |
| | | */ |
| | | @ApiModelProperty(value = "提交时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 状态 0待处理 1 待领取 2已拒绝 3已领取 -1已取消 |
| | | */ |
| | | @ApiModelProperty(value = "状态 0待处理 1 待领取 2已拒绝 3已领取 -1已取消") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 申请人id |
| | | */ |
| | | @ApiModelProperty("申请人id") |
| | | private Long applyUserId; |
| | | |
| | | /** |
| | | * 申请人 |
| | | */ |
| | | @ApiModelProperty("申请人") |
| | | private String applyName; |
| | | |
| | | /** |
| | | * 申请人联系电话 |
| | | */ |
| | | @ApiModelProperty("申请人联系电话") |
| | | private String applyPhone; |
| | | |
| | | /** |
| | | * 处理人id |
| | | */ |
| | | @ApiModelProperty(value = "处理人id") |
| | | private Long solveUserId; |
| | | |
| | | /** |
| | | * 处理人时间 |
| | | */ |
| | | @ApiModelProperty(value = "处理人时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date solveTime; |
| | | |
| | | /** |
| | | * 处理人备注 |
| | | */ |
| | | @ApiModelProperty(value = "处理人备注") |
| | | private String solveContent; |
| | | |
| | | /** |
| | | * 核销人id |
| | | */ |
| | | @ApiModelProperty(value = "核销人id") |
| | | private Long writeOffUserId; |
| | | |
| | | /** |
| | | * 取消时间 |
| | | */ |
| | | @ApiModelProperty(value = "取消时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date cancelTime; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * 义仓基础设置表(ComActWarehouseBase)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-11 09:21:52 |
| | | */ |
| | | @Data |
| | | @ApiModel("义仓基础设置表") |
| | | public class ComActWarehouseBase implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -68726161070095574L; |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 义仓说明 |
| | | */ |
| | | @ApiModelProperty(value = "义仓说明") |
| | | private String warehouseExplain; |
| | | |
| | | /** |
| | | * 工作时间 |
| | | */ |
| | | @ApiModelProperty(value = "工作时间") |
| | | private String warehouseWorkTime; |
| | | |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String warehouseContact; |
| | | |
| | | /** |
| | | * 接收地点 |
| | | */ |
| | | @ApiModelProperty(value = "接收地点") |
| | | private String receivePosition; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | *经度 |
| | | */ |
| | | @ApiModelProperty("经度") |
| | | private String longitude; |
| | | |
| | | /** |
| | | *纬度 |
| | | */ |
| | | @ApiModelProperty("纬度") |
| | | private String latitude; |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * 爱心义仓/物品捐赠表(ComActWarehouseDonates)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-09 17:14:15 |
| | | */ |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel("爱心义仓/物品捐赠表") |
| | | public class ComActWarehouseDonates implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 957879321976072909L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 用户关联id |
| | | */ |
| | | @ApiModelProperty(value = "用户关联id") |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 捐赠人 |
| | | */ |
| | | @ApiModelProperty(value = "捐赠人") |
| | | private String name; |
| | | |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String phone; |
| | | |
| | | /** |
| | | * 捐赠物品 |
| | | */ |
| | | @ApiModelProperty(value = "捐赠物品") |
| | | private String item; |
| | | |
| | | /** |
| | | * 物品图片 |
| | | */ |
| | | @ApiModelProperty(value = "物品图片") |
| | | private String image; |
| | | |
| | | /** |
| | | * 捐赠数量 |
| | | */ |
| | | @ApiModelProperty(value = "捐赠数量") |
| | | private Integer quantity; |
| | | |
| | | /** |
| | | * 剩余数量 |
| | | */ |
| | | @ApiModelProperty(value = "剩余数量") |
| | | private Integer surplusQuantity; |
| | | |
| | | /** |
| | | * 是否匿名(1.是 2.否) |
| | | */ |
| | | @ApiModelProperty(value = "是否匿名(1.是 2.否)") |
| | | private Integer isAnonymous; |
| | | |
| | | /** |
| | | * 留言信息 |
| | | */ |
| | | @ApiModelProperty(value = "留言信息") |
| | | private String message; |
| | | |
| | | /** |
| | | * 物品登记时间 |
| | | */ |
| | | @ApiModelProperty(value = "物品登记时间") |
| | | private Date registerAt; |
| | | |
| | | /** |
| | | * 物品签收时间 |
| | | */ |
| | | @ApiModelProperty(value = "物品签收时间") |
| | | private Date signingAt; |
| | | |
| | | /** |
| | | * 捐赠状态(1.待签收 2.已签收 3.已取消) |
| | | */ |
| | | @ApiModelProperty(value = "捐赠状态(1.待签收 2.已签收 3.已取消)") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 登记人 |
| | | */ |
| | | @ApiModelProperty(value = "登记人") |
| | | private Long registerBy; |
| | | |
| | | /** |
| | | * 签收人 |
| | | */ |
| | | @ApiModelProperty(value = "签收人") |
| | | private Long signingBy; |
| | | |
| | | public interface status { |
| | | int dqs = 1; |
| | | int yqs = 2; |
| | | int yqx = 3; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * 爱心义操作表(ComActWarehouseOperation)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-09 17:14:33 |
| | | */ |
| | | @Data |
| | | @ApiModel("爱心义操作表") |
| | | public class ComActWarehouseOperation implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -74893029545359720L; |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 物品id |
| | | */ |
| | | @ApiModelProperty(value = "物品id") |
| | | private Integer goodsId; |
| | | |
| | | /** |
| | | * 操作内容 |
| | | */ |
| | | @ApiModelProperty(value = "操作内容") |
| | | private String content; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | @ApiModelProperty(value = "操作时间") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 操作人 |
| | | */ |
| | | @ApiModelProperty(value = "操作人") |
| | | private Integer userId; |
| | | |
| | | /** |
| | | *类型 1签收,取消操作 2捐赠操作 |
| | | */ |
| | | @ApiModelProperty(value = "类型 1签收,取消操作 2捐赠操作") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 申请id |
| | | */ |
| | | @ApiModelProperty(value = "申请id") |
| | | private Integer applyId; |
| | | |
| | | public interface type{ |
| | | int bxs=1; |
| | | int xs=2; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * 服务团队(ComPbServiceTeam)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-11 13:24:35 |
| | | */ |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel("服务团队") |
| | | public class ComPbServiceTeam implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -12211594984638204L; |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | @ApiModelProperty(value = "姓名") |
| | | private String name; |
| | | |
| | | /** |
| | | * 职位 |
| | | */ |
| | | @ApiModelProperty(value = "职位") |
| | | private String job; |
| | | |
| | | /** |
| | | * 职位2 |
| | | */ |
| | | @ApiModelProperty(value = "职位2") |
| | | private String jobTwo; |
| | | |
| | | /** |
| | | * 照片 |
| | | */ |
| | | @ApiModelProperty(value = "照片") |
| | | private String url; |
| | | |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | |
| | | private String jobResponsibilities; |
| | | |
| | | private String phone; |
| | | |
| | | private Integer isReg; |
| | | |
| | | /** |
| | | * 身份证号码 |
| | | */ |
| | | @ApiModelProperty(value = "身份证号码") |
| | | private String cardNo; |
| | | |
| | | } |
| | |
| | | private String houseNo; |
| | | |
| | | /** |
| | | * 房屋状态(1.自住 2.租住 3.其他) |
| | | * 房屋状态(1.自住 2.租住 3.空置 4.其他) |
| | | */ |
| | | private Integer status; |
| | | |
| | |
| | | */ |
| | | private String path; |
| | | |
| | | /** |
| | | * 楼层数 |
| | | */ |
| | | private Integer floorNum; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComMngPopulationHouseDO{" + "id=" + id + ", streetId=" + streetId + ", address=" + address + ", code=" |
| | |
| | | + ", constructArea=" + constructArea + ", path=" + path + ", createAt=" + createAt + ", updateAt=" |
| | | + updateAt + "}"; |
| | | } |
| | | |
| | | /** |
| | | * 房屋状态(1.自住 2.租住 3.空置 4.其他) |
| | | */ |
| | | public interface status{ |
| | | int zizhu = 1; |
| | | int zuzhu = 2; |
| | | int kongzhi = 3; |
| | | int qita = 4; |
| | | } |
| | | } |
| | |
| | | private Integer relation; |
| | | |
| | | /** |
| | | * 人和房屋关系’ (1.自住2、租住) |
| | | * 人和房屋关系’ (1.自住2、租住) 该字段类型改为(1.业主 2.业主家属 3.租户) |
| | | */ |
| | | private Integer relationId; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 人和房屋关系’ (1.自住2、租住) |
| | | * 人和房屋关系’ (1.自住2、租住) 该字段类型改为(1.业主 2.业主家属 3.租户) |
| | | */ |
| | | public interface relationId { |
| | | int zizhu = 1; |
| | | int zuzhu = 2; |
| | | int zuhu = 3; |
| | | } |
| | | } |
| | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.building.admin.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngBuildingExcelVO; |
| | | import com.panzhihua.service_community.model.dos.ComMngBuildingDO; |
| | |
| | | public interface ComActBuildingService extends IService<ComMngBuildingDO> { |
| | | |
| | | R batchSaveBuilding(List<ComMngBuildingExcelVO> newVoList, Long communityId); |
| | | |
| | | /** |
| | | * 社区后台-分页查询楼栋列表 |
| | | * @param pageBuildingListDto 请求参数 |
| | | * @return 楼栋列表 |
| | | */ |
| | | R pageBuildingAdmin(PageBuildingListDto pageBuildingListDto); |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋列表表头统计数据 |
| | | * @param communityId 社区id |
| | | * @return 楼栋列表表头统计数据 |
| | | */ |
| | | R buildingListHeaderStatisticsAdmin(Long communityId); |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋详情 |
| | | * @param id 楼栋id |
| | | * @return 楼栋详情 |
| | | */ |
| | | R detailBuildAdmin(Long id); |
| | | |
| | | /** |
| | | * 查询楼栋下单元列表 |
| | | * @param id 楼栋id |
| | | * @return 单元列表 |
| | | */ |
| | | R buildingUnitListAdmin(Long id); |
| | | |
| | | /** |
| | | * 查询楼栋单元下房屋列表 |
| | | * @param unitHouseListDto 请求参数 |
| | | * @return 单元列表 |
| | | */ |
| | | R buildingUnitHouseListAdmin(PageBuildingUnitHouseListDto unitHouseListDto); |
| | | |
| | | R buildingUnitHouseDetailAdmin(Long houseId,Long communityId); |
| | | |
| | | R buildingVillageListAdmin(Long communityId); |
| | | |
| | | R addBuildingUnitAdmin(AddBuildingUnitDto addBuildingUnitDto); |
| | | |
| | | R editBuildingUnitAdmin(EditBuildingUnitDto editBuildingUnitDto); |
| | | |
| | | R addBuildingHouseAdmin(AddBuildingHouseDto addBuildingHouseDto); |
| | | |
| | | R editBuildingHouseAdmin(EditBuildingHouseDto editBuildingHouseDto); |
| | | |
| | | R deleteBuildingHousePopulationAdmin(DeleteBuildingHousePopulationDto housePopulationDto); |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseApply; |
| | | |
| | | /** |
| | | * 物品申请表(ComActWarehouseApply)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-09 17:13:52 |
| | | */ |
| | | public interface ComActWarehouseApplyService extends IService<ComActWarehouseApply> { |
| | | /** |
| | | * 分页查询 |
| | | * @param commonPage |
| | | * @return |
| | | */ |
| | | R pageList(CommonPage commonPage); |
| | | |
| | | /** |
| | | * 社区id查询统计数据 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R selectStatics(Long communityId); |
| | | |
| | | /** |
| | | * 主键查询详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R selectById(Integer id); |
| | | |
| | | /** |
| | | * 验证用户是否社区团队 |
| | | * @param phone |
| | | * @return |
| | | */ |
| | | R check(String phone); |
| | | |
| | | /** |
| | | * 更新 |
| | | * @param comActWarehouseApply |
| | | * @return |
| | | */ |
| | | R update(ComActWarehouseApply comActWarehouseApply); |
| | | |
| | | /** |
| | | * 导出 |
| | | */ |
| | | R export(CommonPage commonPage); |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseBase; |
| | | |
| | | /** |
| | | * 义仓基础设置表(ComActWarehouseBase)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-11 09:21:53 |
| | | */ |
| | | public interface ComActWarehouseBaseService extends IService<ComActWarehouseBase> { |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ComActWarehouseApplyDTO; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ComActWarehouseDonatesDTO; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ExportDonatesDTO; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.PageDonatesDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.vos.community.warehouse.WarehouseDonatesExcelVO; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseDonates; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 爱心义仓/物品捐赠表(ComActWarehouseDonates)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-09 17:14:16 |
| | | */ |
| | | public interface ComActWarehouseDonatesService extends IService<ComActWarehouseDonates> { |
| | | R pageList(CommonPage commonPage); |
| | | |
| | | /** |
| | | * 后台导入捐赠物品 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | R batchImportWarehouseDonates(List<WarehouseDonatesExcelVO> list); |
| | | |
| | | /** |
| | | * 后台导出捐赠物品表格 |
| | | * @param exportDonatesDTO |
| | | * @return |
| | | */ |
| | | R exportDonates(ExportDonatesDTO exportDonatesDTO); |
| | | |
| | | /** |
| | | * 分页查询捐赠物品 |
| | | * @param pageDonatesDTO |
| | | * @return |
| | | */ |
| | | R pageDonates(PageDonatesDTO pageDonatesDTO); |
| | | |
| | | /** |
| | | * 新增物品捐赠 |
| | | * @param comActWarehouseDonatesDTO |
| | | * @return |
| | | */ |
| | | R addDonates(ComActWarehouseDonatesDTO comActWarehouseDonatesDTO); |
| | | |
| | | /** |
| | | * 查看物品捐赠详情 |
| | | * @param donatesId |
| | | * @param isWhich |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R getDonates(Long donatesId, Integer isWhich, Long userId); |
| | | |
| | | /** |
| | | * 捐赠物品后台签收 |
| | | * @param comActWarehouseDonatesDTO |
| | | * @return |
| | | */ |
| | | R signingDonates(ComActWarehouseDonatesDTO comActWarehouseDonatesDTO); |
| | | |
| | | /** |
| | | * 用户取消捐赠 |
| | | * @param donatesId |
| | | * @param currentUser |
| | | * @return |
| | | */ |
| | | R cancelDonates(Long donatesId, Long currentUser); |
| | | |
| | | /** |
| | | * 捐赠物品统计查询 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R getDonatesStatistics(Long communityId); |
| | | |
| | | /** |
| | | * 社区后台物品领用 |
| | | * @param comActWarehouseApplyDTO |
| | | * @return |
| | | */ |
| | | R applyDonates(ComActWarehouseApplyDTO comActWarehouseApplyDTO); |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseOperation; |
| | | |
| | | /** |
| | | * 爱心义操作表(ComActWarehouseOperation)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-09 17:14:34 |
| | | */ |
| | | public interface ComActWarehouseOperationService extends IService<ComActWarehouseOperation> { |
| | | R pageList(CommonPage commonPage); |
| | | } |
| | |
| | | * @return 编辑结果 |
| | | */ |
| | | R insertHouse(ComMngPopulationHouseInsertAdminDTO houseEditAdminDTO); |
| | | |
| | | /** |
| | | * 实有房屋数据修复定时任务 |
| | | * @return 实有房屋数据修复定时任务 |
| | | */ |
| | | R timedTaskHouseJobHandler(); |
| | | } |
| | |
| | | /** |
| | | * 批量删除实有人口 |
| | | * |
| | | * @param Ids |
| | | * @param ids |
| | | * 实有人口id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | R deletePopulations(List<Long> Ids); |
| | | R deletePopulations(List<Long> ids, Long communityId); |
| | | |
| | | /** |
| | | * 根据社区id查询所有实有人口 |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.enums.PopulIsOksEnum; |
| | | import com.panzhihua.common.enums.PopulPoliticalOutlookEnum; |
| | | import com.panzhihua.common.model.dtos.community.building.admin.*; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.model.vos.community.ComPopulationActVO; |
| | | import com.panzhihua.common.model.vos.community.building.admin.BuildingUnitHouseListAdminVo; |
| | | import com.panzhihua.common.model.vos.community.building.admin.PageBuildingListAdminVo; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseDetailVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingVO; |
| | | import com.panzhihua.common.model.vos.grid.PopulationListVO; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Lists; |
| | |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationImportErrorVO; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.dao.ComActVillageDAO; |
| | | import com.panzhihua.service_community.dao.ComMngBuildingDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngBuildingDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngVillageDO; |
| | | import com.panzhihua.service_community.model.dos.GridBuildRelationDO; |
| | | import com.panzhihua.service_community.service.ComActBuildingService; |
| | | import com.panzhihua.service_community.service.GridBuildRelationService; |
| | | |
| | |
| | | private ComActDAO comActDAO; |
| | | @Resource |
| | | private GridBuildRelationService gridBuildRelationService; |
| | | @Resource |
| | | private ComMngPopulationHouseDAO comMngPopulationHouseDAO; |
| | | @Resource |
| | | private ComMngPopulationDAO comMngPopulationDAO; |
| | | @Resource |
| | | private ComMngPopulationHouseUserDAO comMngPopulationHouseUserDAO; |
| | | |
| | | @Override |
| | | public R batchSaveBuilding(List<ComMngBuildingExcelVO> newVoList, Long communityId) { |
| | | ArrayList<ComMngBuildingDO> list = Lists.newArrayList(); |
| | | List<GridBuildRelationDO> keyList = new ArrayList<>(); |
| | | List<ComMngPopulationImportErrorVO> errorList = new ArrayList<>(); |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorMsg("重复楼栋"); |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (ComMngBuildingExcelVO vo : newVoList) { |
| | | ComMngVillageDO comMngVillageDO = comActVillageDAO.selectOne(new QueryWrapper<ComMngVillageDO>() |
| | | .eq("alley", vo.getAlley()).eq("house_num", vo.getDoorNo()).eq("community_id", communityId)); |
| | | if (comMngVillageDO == null) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | BeanUtils.copyProperties(vo,importErrorVO); |
| | | importErrorVO.setErrorMsg("该社区不存在此街路巷"); |
| | | errorList.add(importErrorVO); |
| | | continue; |
| | | } |
| | | vo.setName(vo.getName().replace("栋", "")); |
| | | List<ComMngBuildingDO> buildingDOList = this.baseMapper.selectList(new QueryWrapper<ComMngBuildingDO>() |
| | | .eq("street_id", comMngVillageDO.getStreetId()).eq("act_id", communityId) |
| | | .eq("village_id", comMngVillageDO.getVillageId()).eq("name", vo.getName())); |
| | | .eq("act_id", communityId).eq("village_id", comMngVillageDO.getVillageId()).eq("name", vo.getName())); |
| | | if (buildingDOList.size() > 0) { |
| | | sb.append("街路巷:").append(vo.getAlley()).append(",门牌号:").append(vo.getDoorNo()).append(",楼栋号:") |
| | | .append(vo.getName()).append(";"); |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | BeanUtils.copyProperties(vo,importErrorVO); |
| | | importErrorVO.setErrorMsg("该楼栋已存在"); |
| | | errorList.add(importErrorVO); |
| | | continue; |
| | | } |
| | | ComMngBuildingDO comMngBuildingDO = new ComMngBuildingDO(); |
| | |
| | | comMngBuildingDO.setActId(comMngVillageDO.getCommunityId()); |
| | | comMngBuildingDO.setStreetId(comMngVillageDO.getStreetId()); |
| | | comMngBuildingDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | // comMngBuildingDO.setElevatorTotal(vo.getElevatorTotal()); |
| | | ComActDO actDO = comActDAO.selectById(comMngVillageDO.getCommunityId()); |
| | | StringBuilder path = new StringBuilder(); |
| | | path.append(vo.getAlley()).append(">").append(actDO.getName()).append(comMngVillageDO.getName()).append(">") |
| | | .append(vo.getName()); |
| | | comMngBuildingDO.setPath(path.toString()); |
| | | comMngBuildingDO.setGridId(vo.getGridId()); |
| | | // comMngBuildingDO.setGridId(vo.getGridId()); |
| | | list.add(comMngBuildingDO); |
| | | GridBuildRelationDO gridBuildRelation = |
| | | getGridBuildRelationDO(communityId, comMngVillageDO.getStreetId(), vo, comMngBuildingDO); |
| | |
| | | |
| | | if (list.size() > 0) { |
| | | this.saveBatch(list); |
| | | if(keyList.size() > 0){ |
| | | gridBuildRelationService.saveBatchGridBuildRelation(keyList); |
| | | } |
| | | } |
| | | if (sb.length() > 0 && !StringUtils.isEmpty(sb.toString())) { |
| | | errorList.add(importErrorVO); |
| | | return R.fail(JSON.toJSONString(errorList)); |
| | | if (errorList.size() > 0) { |
| | | return R.fail(errorList); |
| | | } |
| | | gridBuildRelationService.saveBatchGridBuildRelation(keyList); |
| | | this.saveBatch(list); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | gridBuildRelation.setVillageId(comMngBuildingDO.getVillageId()); |
| | | gridBuildRelation.setGridCommunityId(communityId); |
| | | gridBuildRelation.setGridStreetId(streetId); |
| | | if (vo.getGridId() != null) { |
| | | gridBuildRelation.setGridId(Long.valueOf(vo.getGridId())); |
| | | } |
| | | // if (vo.getGridId() != null) { |
| | | // gridBuildRelation.setGridId(Long.valueOf(vo.getGridId())); |
| | | // } |
| | | gridBuildRelation.setGridName(vo.getGridName()); |
| | | gridBuildRelation.setType(1); |
| | | gridBuildRelation.setCreateAt(new Date()); |
| | | return gridBuildRelation; |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-分页查询楼栋列表 |
| | | * @param pageBuildingListDto 请求参数 |
| | | * @return 楼栋列表 |
| | | */ |
| | | @Override |
| | | public R pageBuildingAdmin(PageBuildingListDto pageBuildingListDto){ |
| | | IPage<PageBuildingListAdminVo> pageBuildingList = this.baseMapper.pageBuildingAdmin( |
| | | new Page(pageBuildingListDto.getPageNum(),pageBuildingListDto.getPageSize()),pageBuildingListDto); |
| | | pageBuildingList.getRecords().forEach(building -> { |
| | | //查询该楼栋下最高的楼层 |
| | | if(StringUtils.isNotEmpty(building.getBuildFloorSum())){ |
| | | if(building.getBuildFloorSum().length() == 3){ |
| | | building.setBuildFloorSum(building.getBuildFloorSum().substring(0,1)); |
| | | }else if(building.getBuildFloorSum().length() == 4){ |
| | | building.setBuildFloorSum(building.getBuildFloorSum().substring(0,2)); |
| | | }else if(building.getBuildFloorSum().length() > 4){ |
| | | building.setBuildFloorSum(building.getBuildFloorSum().substring(0,2)); |
| | | } |
| | | } |
| | | }); |
| | | return R.ok(pageBuildingList); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋列表表头统计数据 |
| | | * @param communityId 社区id |
| | | * @return 楼栋列表表头统计数据 |
| | | */ |
| | | @Override |
| | | public R buildingListHeaderStatisticsAdmin(Long communityId){ |
| | | return R.ok(this.baseMapper.buildingListHeaderStatisticsAdmin(communityId)); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋详情 |
| | | * @param id 楼栋id |
| | | * @return 楼栋详情 |
| | | */ |
| | | @Override |
| | | public R detailBuildAdmin(Long id){ |
| | | return R.ok(this.baseMapper.detailBuildAdmin(id)); |
| | | } |
| | | |
| | | /** |
| | | * 查询楼栋下单元列表 |
| | | * @param id 楼栋id |
| | | * @return 单元列表 |
| | | */ |
| | | @Override |
| | | public R buildingUnitListAdmin(Long id){ |
| | | //查询该楼栋信息 |
| | | ComMngBuildingDO buildingDO = this.baseMapper.selectById(id); |
| | | if(buildingDO == null){ |
| | | return R.fail("未查询到该楼栋信息"); |
| | | } |
| | | List<ComMngVillageBuildingVO> buildList = new ArrayList<>(); |
| | | if(StringUtils.isNotEmpty(buildingDO.getName())){ |
| | | buildList = this.baseMapper.buildingUnitList(buildingDO.getVillageId(),buildingDO.getName()); |
| | | buildList.forEach(villageBuilding -> { |
| | | if(StringUtils.isNotEmpty(villageBuilding.getFloor())){ |
| | | if (!villageBuilding.getFloor().contains("栋")) { |
| | | villageBuilding.setFloorString(villageBuilding.getFloor() + "栋"); |
| | | } else { |
| | | villageBuilding.setFloorString(villageBuilding.getFloor()); |
| | | } |
| | | } |
| | | if(StringUtils.isNotEmpty(villageBuilding.getUnitNo())){ |
| | | if (!villageBuilding.getUnitNo().contains("单元")) { |
| | | villageBuilding.setUnitNoString(villageBuilding.getUnitNo() + "单元"); |
| | | } else { |
| | | villageBuilding.setUnitNoString(villageBuilding.getUnitNo()); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(buildList); |
| | | } |
| | | |
| | | /** |
| | | * 查询楼栋单元下房屋列表 |
| | | * @param unitHouseListDto 请求参数 |
| | | * @return 单元列表 |
| | | */ |
| | | @Override |
| | | public R buildingUnitHouseListAdmin(PageBuildingUnitHouseListDto unitHouseListDto){ |
| | | |
| | | BuildingUnitHouseListAdminVo houseListAdminVo = new BuildingUnitHouseListAdminVo(); |
| | | //查询该楼栋信息 |
| | | ComMngBuildingDO buildingDO = this.baseMapper.selectById(unitHouseListDto.getId()); |
| | | if(buildingDO == null){ |
| | | return R.fail("未查询到该楼栋信息"); |
| | | } |
| | | unitHouseListDto.setVillageId(buildingDO.getVillageId()); |
| | | unitHouseListDto.setFloor(buildingDO.getName()); |
| | | List<ComMngVillageBuildingHouseVO> buildHouseList = new ArrayList<>(); |
| | | if(StringUtils.isNotEmpty(buildingDO.getName())){ |
| | | IPage<ComMngVillageBuildingHouseVO> buildingHousePage = this.baseMapper.getBuildingUnitHouseList(new Page(unitHouseListDto.getPageNum(),unitHouseListDto.getPageSize()),unitHouseListDto); |
| | | buildingHousePage.getRecords().forEach(house -> { |
| | | if(StringUtils.isEmpty(house.getBuildingNum())){ |
| | | if(StringUtils.isNotEmpty(house.getHouseNo())){ |
| | | boolean result = house.getHouseNo().matches("[0-9]+"); |
| | | if (result) {// 该字段为纯数字 |
| | | if (house.getHouseNo().length() == 4) { |
| | | house.setBuildingNum(house.getHouseNo().substring(0, 2).replaceAll("^(0+)", "")); |
| | | } else if (house.getHouseNo().length() == 3) { |
| | | house.setBuildingNum(house.getHouseNo().substring(0, 1).replaceAll("^(0+)", "")); |
| | | } |
| | | } else { |
| | | house.setBuildingNum("-"); |
| | | } |
| | | } else { |
| | | house.setBuildingNum("-"); |
| | | } |
| | | } |
| | | }); |
| | | buildHouseList = buildingHousePage.getRecords(); |
| | | |
| | | //查询统计数据 |
| | | Map<String,Object> statisticsMap = this.baseMapper.getBuildingUnitHouseStatistics(buildingDO.getVillageId(),buildingDO.getName(),unitHouseListDto.getUnit()); |
| | | if(statisticsMap != null){ |
| | | houseListAdminVo.setHouseNum(Integer.parseInt(statisticsMap.get("houseNum").toString())); |
| | | houseListAdminVo.setLiveTotal(Integer.parseInt(statisticsMap.get("liveTotal").toString())); |
| | | houseListAdminVo.setLeaseTotal(Integer.parseInt(statisticsMap.get("leaseTotal").toString())); |
| | | houseListAdminVo.setVacantNum(Integer.parseInt(statisticsMap.get("vacantNum").toString())); |
| | | } |
| | | } |
| | | houseListAdminVo.setHouseList(buildHouseList); |
| | | |
| | | return R.ok(houseListAdminVo); |
| | | } |
| | | |
| | | @Override |
| | | public R buildingUnitHouseDetailAdmin(Long houseId,Long communityId){ |
| | | ComMngVillageBuildingHouseDetailVO buildingHouseDetailVO = |
| | | this.baseMapper.buildingUnitHouseDetailAdmin(houseId); |
| | | if (buildingHouseDetailVO != null) { |
| | | |
| | | // 转换楼层数 |
| | | String houseNo = buildingHouseDetailVO.getHouseNo(); |
| | | boolean result = houseNo.matches("[0-9]+"); |
| | | if (result) {// 该字段为纯数字 |
| | | if (houseNo.length() == 4) { |
| | | buildingHouseDetailVO.setBuildingNum(houseNo.substring(0, 2).replaceAll("^(0+)", "")); |
| | | } else if (houseNo.length() == 3) { |
| | | buildingHouseDetailVO.setBuildingNum(houseNo.substring(0, 1).replaceAll("^(0+)", "")); |
| | | } |
| | | } else { |
| | | buildingHouseDetailVO.setBuildingNum("-"); |
| | | } |
| | | |
| | | // 查询该房屋的户主信息 |
| | | List<PopulationListVO> householderList = |
| | | this.baseMapper.getGridVillageBuildingPopulationList(buildingHouseDetailVO.getId(),communityId, null, 1); |
| | | if (!householderList.isEmpty()) { |
| | | householderList.forEach(householder -> { |
| | | if(householder.getPoliticalOutlook() != null){ |
| | | householder.setOutlook(PopulPoliticalOutlookEnum.getCnDescByName(householder.getPoliticalOutlook())); |
| | | }else{ |
| | | householder.setOutlook("暂无"); |
| | | } |
| | | try { |
| | | Integer age = IdcardUtil.getAgeByIdCard(householder.getCardNo()); |
| | | householder.setAge(age); |
| | | } catch (Exception e) { |
| | | log.error("身份证号码转换年龄失败,人员id:" + householder.getId()); |
| | | } |
| | | }); |
| | | buildingHouseDetailVO.setHouseholderList(householderList); |
| | | } |
| | | // 查询该房屋的住户信息 |
| | | List<PopulationListVO> populationList = |
| | | this.baseMapper.getGridVillageBuildingPopulationList(buildingHouseDetailVO.getId(),communityId, null, null); |
| | | if (!populationList.isEmpty()) { |
| | | populationList.forEach(population -> { |
| | | if(population.getPoliticalOutlook() != null){ |
| | | population.setOutlook(PopulPoliticalOutlookEnum.getCnDescByName(population.getPoliticalOutlook())); |
| | | }else{ |
| | | population.setOutlook("暂无"); |
| | | } |
| | | try { |
| | | Integer age = IdcardUtil.getAgeByIdCard(population.getCardNo()); |
| | | population.setAge(age); |
| | | } catch (Exception e) { |
| | | log.error("身份证号码转换年龄失败,人员id:" + population.getId()); |
| | | } |
| | | }); |
| | | buildingHouseDetailVO.setPopulationList(populationList); |
| | | } |
| | | } |
| | | return R.ok(buildingHouseDetailVO); |
| | | } |
| | | |
| | | @Override |
| | | public R buildingVillageListAdmin(Long communityId){ |
| | | List<ComMngVillageVO> villageList = this.baseMapper.buildingVillageListAdmin(communityId); |
| | | villageList.forEach(village -> { |
| | | if(StringUtils.isEmpty(village.getName())){ |
| | | village.setName(village.getAlley() + village.getHouseNum()); |
| | | } |
| | | }); |
| | | return R.ok(villageList); |
| | | } |
| | | |
| | | @Override |
| | | public R addBuildingUnitAdmin(AddBuildingUnitDto addBuildingUnitDto){ |
| | | //查询该楼栋信息 |
| | | ComMngBuildingDO buildingDO = this.baseMapper.selectById(addBuildingUnitDto.getId()); |
| | | if(buildingDO == null){ |
| | | return R.fail("未查询到该楼栋信息"); |
| | | } |
| | | |
| | | Integer count = comMngPopulationHouseDAO.selectCount(new QueryWrapper<ComMngPopulationHouseDO>().lambda() |
| | | .eq(ComMngPopulationHouseDO::getVillageId,buildingDO.getVillageId()) |
| | | .eq(ComMngPopulationHouseDO::getFloor,buildingDO.getName()) |
| | | .eq(ComMngPopulationHouseDO::getUnitNo,addBuildingUnitDto.getUnitNo())); |
| | | if(count > 0){ |
| | | return R.fail("该单元号已存在"); |
| | | } |
| | | |
| | | //查询小区信息 |
| | | ComMngVillageDO villageDO = comActVillageDAO.selectById(buildingDO.getVillageId()); |
| | | if(villageDO != null){ |
| | | StringBuilder address = new StringBuilder(); |
| | | StringBuilder housePath = new StringBuilder(); |
| | | ComPopulationActVO populationActVO = comActDAO.getPopulationActById(addBuildingUnitDto.getCommunityId()); |
| | | if(populationActVO != null){ |
| | | address.append(populationActVO.getProvinceName()).append(populationActVO.getCityName()) |
| | | .append(populationActVO.getDistrictName()).append(populationActVO.getStreetName()) |
| | | .append(villageDO.getAlley()).append(villageDO.getHouseNum()).append("号"); |
| | | if (StringUtils.isNotEmpty(buildingDO.getName())) { |
| | | address.append(buildingDO.getName()).append("栋"); |
| | | } |
| | | if (StringUtils.isNotEmpty(addBuildingUnitDto.getUnitNo())) { |
| | | address.append(addBuildingUnitDto.getUnitNo()).append("单元"); |
| | | } |
| | | housePath.append(populationActVO.getProvinceName()).append(">").append(populationActVO.getCityName()).append(">") |
| | | .append(villageDO.getAlley()).append(">").append(populationActVO.getName()).append(">").append(villageDO.getName()).append(">").append(address.toString()); |
| | | } |
| | | ComMngPopulationHouseDO populationHouseDO = new ComMngPopulationHouseDO(); |
| | | populationHouseDO.setId(Snowflake.getId()); |
| | | populationHouseDO.setStreetId(buildingDO.getStreetId()); |
| | | populationHouseDO.setVillageId(buildingDO.getVillageId()); |
| | | populationHouseDO.setAlley(villageDO.getAlley()); |
| | | populationHouseDO.setHouseNum(villageDO.getHouseNum()); |
| | | populationHouseDO.setStatus(ComMngPopulationHouseDO.status.kongzhi); |
| | | populationHouseDO.setCommunityId(addBuildingUnitDto.getCommunityId()); |
| | | populationHouseDO.setFloor(buildingDO.getName()); |
| | | populationHouseDO.setUnitNo(addBuildingUnitDto.getUnitNo()); |
| | | populationHouseDO.setAddress(address.toString()); |
| | | populationHouseDO.setUpdateAt(new Date()); |
| | | populationHouseDO.setPath(housePath.toString()); |
| | | populationHouseDO.setIsEmpty(PopulIsOksEnum.YES.getCode()); |
| | | comMngPopulationHouseDAO.insert(populationHouseDO); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R editBuildingUnitAdmin(EditBuildingUnitDto editBuildingUnitDto){ |
| | | //查询该楼栋信息 |
| | | ComMngBuildingDO buildingDO = this.baseMapper.selectById(editBuildingUnitDto.getId()); |
| | | if(buildingDO == null){ |
| | | return R.fail("未查询到该楼栋信息"); |
| | | } |
| | | |
| | | Integer oldCount = comMngPopulationHouseDAO.selectCount(new QueryWrapper<ComMngPopulationHouseDO>().lambda() |
| | | .eq(ComMngPopulationHouseDO::getVillageId,buildingDO.getVillageId()) |
| | | .eq(ComMngPopulationHouseDO::getFloor,buildingDO.getName()) |
| | | .eq(ComMngPopulationHouseDO::getUnitNo,editBuildingUnitDto.getOldUnitNo())); |
| | | if(oldCount <= 0){ |
| | | return R.fail("原单元号不存在"); |
| | | } |
| | | |
| | | Integer newCount = comMngPopulationHouseDAO.selectCount(new QueryWrapper<ComMngPopulationHouseDO>().lambda() |
| | | .eq(ComMngPopulationHouseDO::getVillageId,buildingDO.getVillageId()) |
| | | .eq(ComMngPopulationHouseDO::getFloor,buildingDO.getName()) |
| | | .eq(ComMngPopulationHouseDO::getUnitNo,editBuildingUnitDto.getNewUnitNo())); |
| | | if(newCount > 0){ |
| | | return R.fail("新单元号已存在"); |
| | | } |
| | | |
| | | //查询小区信息 |
| | | ComMngVillageDO villageDO = comActVillageDAO.selectById(buildingDO.getVillageId()); |
| | | if(villageDO != null){ |
| | | String unitString = editBuildingUnitDto.getNewUnitNo() + "单元"; |
| | | |
| | | List<ComMngPopulationHouseDO> editHouseList = new ArrayList<>(); |
| | | //查询需要修改的房屋列表信息 |
| | | List<ComMngPopulationHouseDO> houseList = comMngPopulationHouseDAO.selectList(new QueryWrapper<ComMngPopulationHouseDO>().lambda() |
| | | .eq(ComMngPopulationHouseDO::getVillageId,villageDO.getVillageId()) |
| | | .eq(ComMngPopulationHouseDO::getFloor,buildingDO.getName()) |
| | | .eq(ComMngPopulationHouseDO::getUnitNo,editBuildingUnitDto.getOldUnitNo())); |
| | | houseList.forEach(house -> { |
| | | ComMngPopulationHouseDO houseDO = new ComMngPopulationHouseDO(); |
| | | houseDO.setId(house.getId()); |
| | | houseDO.setAddress(house.getAddress().replace(house.getUnitNo() + "单元", unitString)); |
| | | houseDO.setPath(house.getPath().replace(house.getUnitNo() + "单元", unitString)); |
| | | houseDO.setUnitNo(editBuildingUnitDto.getNewUnitNo()); |
| | | editHouseList.add(houseDO); |
| | | }); |
| | | |
| | | List<ComMngPopulationDO> editPopulationList = new ArrayList<>(); |
| | | //查询需要修改的人口信息 |
| | | List<ComMngPopulationDO> populationList = comMngPopulationDAO.selectList(new QueryWrapper<ComMngPopulationDO>().lambda() |
| | | .eq(ComMngPopulationDO::getVillageId,villageDO.getVillageId()) |
| | | .eq(ComMngPopulationDO::getFloor,buildingDO.getName()) |
| | | .eq(ComMngPopulationDO::getUnitNo,editBuildingUnitDto.getOldUnitNo())); |
| | | populationList.forEach(population -> { |
| | | ComMngPopulationDO populationDO = new ComMngPopulationDO(); |
| | | populationDO.setId(population.getId()); |
| | | populationDO.setAddress(population.getAddress().replace(population.getUnitNo() + "单元", unitString)); |
| | | populationDO.setUnitNo(editBuildingUnitDto.getNewUnitNo()); |
| | | editPopulationList.add(populationDO); |
| | | }); |
| | | |
| | | if(!editHouseList.isEmpty()){ |
| | | comMngPopulationHouseDAO.updateUnitAll(editHouseList); |
| | | } |
| | | |
| | | if(!editPopulationList.isEmpty()){ |
| | | comMngPopulationDAO.updateAll(editPopulationList); |
| | | } |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R addBuildingHouseAdmin(AddBuildingHouseDto addBuildingHouseDto){ |
| | | |
| | | //查询该楼栋信息 |
| | | ComMngBuildingDO buildingDO = this.baseMapper.selectById(addBuildingHouseDto.getId()); |
| | | if(buildingDO == null){ |
| | | return R.fail("未查询到该楼栋信息"); |
| | | } |
| | | |
| | | Integer count = comMngPopulationHouseDAO.selectCount(new QueryWrapper<ComMngPopulationHouseDO>().lambda() |
| | | .eq(ComMngPopulationHouseDO::getVillageId,buildingDO.getVillageId()) |
| | | .eq(ComMngPopulationHouseDO::getFloor,buildingDO.getName()) |
| | | .eq(ComMngPopulationHouseDO::getUnitNo,addBuildingHouseDto.getUnitNo()) |
| | | .eq(ComMngPopulationHouseDO::getHouseNo,addBuildingHouseDto.getHouseNo())); |
| | | if(count > 0){ |
| | | return R.fail("该房间已存在"); |
| | | } |
| | | |
| | | //查询小区信息 |
| | | ComMngVillageDO villageDO = comActVillageDAO.selectById(buildingDO.getVillageId()); |
| | | if(villageDO != null){ |
| | | StringBuilder address = new StringBuilder(); |
| | | StringBuilder housePath = new StringBuilder(); |
| | | ComPopulationActVO populationActVO = comActDAO.getPopulationActById(addBuildingHouseDto.getCommunityId()); |
| | | if(populationActVO != null){ |
| | | address.append(populationActVO.getProvinceName()).append(populationActVO.getCityName()) |
| | | .append(populationActVO.getDistrictName()).append(populationActVO.getStreetName()) |
| | | .append(villageDO.getAlley()).append(villageDO.getHouseNum()).append("号"); |
| | | if (StringUtils.isNotEmpty(buildingDO.getName())) { |
| | | address.append(buildingDO.getName()).append("栋"); |
| | | } |
| | | if (StringUtils.isNotEmpty(addBuildingHouseDto.getUnitNo())) { |
| | | address.append(addBuildingHouseDto.getUnitNo()).append("单元"); |
| | | } |
| | | if (StringUtils.isNotEmpty(addBuildingHouseDto.getHouseNo())) { |
| | | address.append(addBuildingHouseDto.getHouseNo()).append("号"); |
| | | } |
| | | housePath.append(populationActVO.getProvinceName()).append(">").append(populationActVO.getCityName()).append(">") |
| | | .append(villageDO.getAlley()).append(">").append(populationActVO.getName()).append(">").append(villageDO.getName()).append(">").append(address.toString()); |
| | | } |
| | | ComMngPopulationHouseDO populationHouseDO = new ComMngPopulationHouseDO(); |
| | | populationHouseDO.setId(Snowflake.getId()); |
| | | populationHouseDO.setStreetId(buildingDO.getStreetId()); |
| | | populationHouseDO.setVillageId(buildingDO.getVillageId()); |
| | | populationHouseDO.setAlley(villageDO.getAlley()); |
| | | populationHouseDO.setHouseNum(villageDO.getHouseNum()); |
| | | populationHouseDO.setStatus(ComMngPopulationHouseDO.status.kongzhi); |
| | | populationHouseDO.setCommunityId(addBuildingHouseDto.getCommunityId()); |
| | | populationHouseDO.setFloor(buildingDO.getName()); |
| | | populationHouseDO.setUnitNo(addBuildingHouseDto.getUnitNo()); |
| | | populationHouseDO.setHouseNo(addBuildingHouseDto.getHouseNo()); |
| | | populationHouseDO.setFloorNum(addBuildingHouseDto.getFloorNum()); |
| | | populationHouseDO.setAddress(address.toString()); |
| | | populationHouseDO.setUpdateAt(new Date()); |
| | | populationHouseDO.setPath(housePath.toString()); |
| | | populationHouseDO.setIsEmpty(PopulIsOksEnum.YES.getCode()); |
| | | comMngPopulationHouseDAO.insert(populationHouseDO); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R editBuildingHouseAdmin(EditBuildingHouseDto editBuildingHouseDto){ |
| | | |
| | | ComMngPopulationHouseDO houseDO = comMngPopulationHouseDAO.selectById(editBuildingHouseDto.getHouseId()); |
| | | if(houseDO == null){ |
| | | return R.fail("未查询到该户室"); |
| | | } |
| | | |
| | | Integer count = comMngPopulationHouseDAO.selectCount(new QueryWrapper<ComMngPopulationHouseDO>().lambda() |
| | | .eq(ComMngPopulationHouseDO::getVillageId,houseDO.getVillageId()) |
| | | .eq(ComMngPopulationHouseDO::getFloor,houseDO.getFloor()) |
| | | .eq(ComMngPopulationHouseDO::getUnitNo,houseDO.getUnitNo()) |
| | | .eq(ComMngPopulationHouseDO::getHouseNo,editBuildingHouseDto.getHouseNo())); |
| | | if(count > 0){ |
| | | return R.fail("该房间已存在"); |
| | | } |
| | | |
| | | //查询小区信息 |
| | | ComMngVillageDO villageDO = comActVillageDAO.selectById(houseDO.getVillageId()); |
| | | if(villageDO != null){ |
| | | StringBuilder address = new StringBuilder(); |
| | | StringBuilder housePath = new StringBuilder(); |
| | | ComPopulationActVO populationActVO = comActDAO.getPopulationActById(editBuildingHouseDto.getCommunityId()); |
| | | if(populationActVO != null){ |
| | | address.append(populationActVO.getProvinceName()).append(populationActVO.getCityName()) |
| | | .append(populationActVO.getDistrictName()).append(populationActVO.getStreetName()) |
| | | .append(villageDO.getAlley()).append(villageDO.getHouseNum()).append("号"); |
| | | if (StringUtils.isNotEmpty(houseDO.getFloor())) { |
| | | address.append(houseDO.getFloor()).append("栋"); |
| | | } |
| | | if (StringUtils.isNotEmpty(houseDO.getUnitNo())) { |
| | | address.append(houseDO.getUnitNo()).append("单元"); |
| | | } |
| | | if (StringUtils.isNotEmpty(editBuildingHouseDto.getHouseNo())) { |
| | | address.append(editBuildingHouseDto.getHouseNo()).append("号"); |
| | | } |
| | | housePath.append(populationActVO.getProvinceName()).append(">").append(populationActVO.getCityName()).append(">") |
| | | .append(villageDO.getAlley()).append(">").append(populationActVO.getName()).append(">").append(villageDO.getName()).append(">").append(address.toString()); |
| | | houseDO.setAddress(address.toString()); |
| | | houseDO.setPath(housePath.toString()); |
| | | } |
| | | List<ComMngPopulationDO> editPopulationList = new ArrayList<>(); |
| | | //查询需要修改的人口信息 |
| | | List<ComMngPopulationDO> populationList = comMngPopulationDAO.selectList(new QueryWrapper<ComMngPopulationDO>().lambda() |
| | | .eq(ComMngPopulationDO::getVillageId,villageDO.getVillageId()) |
| | | .eq(ComMngPopulationDO::getFloor,houseDO.getFloor()) |
| | | .eq(ComMngPopulationDO::getUnitNo,houseDO.getUnitNo()) |
| | | .eq(ComMngPopulationDO::getHouseNo,houseDO.getHouseNo())); |
| | | populationList.forEach(population -> { |
| | | ComMngPopulationDO populationDO = new ComMngPopulationDO(); |
| | | populationDO.setId(population.getId()); |
| | | populationDO.setAddress(address.toString()); |
| | | populationDO.setHouseNo(editBuildingHouseDto.getHouseNo()); |
| | | editPopulationList.add(populationDO); |
| | | }); |
| | | |
| | | houseDO.setHouseNo(editBuildingHouseDto.getHouseNo()); |
| | | houseDO.setFloorNum(editBuildingHouseDto.getFloorNum()); |
| | | comMngPopulationHouseDAO.updateById(houseDO); |
| | | |
| | | if(!editPopulationList.isEmpty()){ |
| | | comMngPopulationDAO.updateAll(editPopulationList); |
| | | } |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R deleteBuildingHousePopulationAdmin(DeleteBuildingHousePopulationDto housePopulationDto){ |
| | | |
| | | ComMngPopulationHouseDO houseDO = comMngPopulationHouseDAO.selectById(housePopulationDto.getHouseId()); |
| | | if(houseDO == null){ |
| | | return R.fail("未查询到该户室"); |
| | | } |
| | | |
| | | if(housePopulationDto.getType().equals(DeleteBuildingHousePopulationDto.type.yz)){ |
| | | ComMngPopulationHouseUserDO houseUserDO = comMngPopulationHouseUserDAO.selectOne(new QueryWrapper<ComMngPopulationHouseUserDO>().lambda() |
| | | .eq(ComMngPopulationHouseUserDO::getHouseId,housePopulationDto.getHouseId()) |
| | | .eq(ComMngPopulationHouseUserDO::getPopulId,housePopulationDto.getPopulationId())); |
| | | if(houseUserDO != null){ |
| | | houseUserDO.setRelationId(ComMngPopulationHouseUserDO.relationId.zuzhu); |
| | | houseUserDO.setUpdateAt(new Date()); |
| | | comMngPopulationHouseUserDAO.updateById(houseUserDO); |
| | | } |
| | | }else if(housePopulationDto.getType().equals(DeleteBuildingHousePopulationDto.type.jzr)){ |
| | | //清理人员和房屋关联关系 |
| | | comMngPopulationHouseUserDAO.delete(new QueryWrapper<ComMngPopulationHouseUserDO>().lambda() |
| | | .eq(ComMngPopulationHouseUserDO::getHouseId,housePopulationDto.getHouseId()) |
| | | .eq(ComMngPopulationHouseUserDO::getPopulId,housePopulationDto.getPopulationId())); |
| | | |
| | | //查询该房屋是否还有人居住 |
| | | Integer count = comMngPopulationHouseUserDAO.selectCount(new QueryWrapper<ComMngPopulationHouseUserDO>().lambda() |
| | | .eq(ComMngPopulationHouseUserDO::getHouseId,housePopulationDto.getHouseId())); |
| | | if(count <= 0){ |
| | | houseDO.setStatus(ComMngPopulationHouseDO.status.kongzhi); |
| | | comMngPopulationHouseDAO.updateById(houseDO); |
| | | }else{ |
| | | //查询该房屋的居住人中是否还有租住的人 |
| | | Integer zCount = comMngPopulationHouseUserDAO.selectCount(new QueryWrapper<ComMngPopulationHouseUserDO>().lambda() |
| | | .eq(ComMngPopulationHouseUserDO::getHouseId,housePopulationDto.getHouseId()) |
| | | .eq(ComMngPopulationHouseUserDO::getRelationId,ComMngPopulationHouseUserDO.relationId.zuhu)); |
| | | if(zCount <= 0){ |
| | | houseDO.setStatus(ComMngPopulationHouseDO.status.zizhu); |
| | | comMngPopulationHouseDAO.updateById(houseDO); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseApplyVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseOperationVO; |
| | | import com.panzhihua.service_community.dao.ComActWarehouseDonatesDao; |
| | | import com.panzhihua.service_community.dao.ComActWarehouseOperationDao; |
| | | import com.panzhihua.service_community.dao.ComPbServiceTeamDao; |
| | | import com.panzhihua.service_community.dao.ComActWarehouseApplyDao; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseApply; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseDonates; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseOperation; |
| | | import com.panzhihua.service_community.entity.ComPbServiceTeam; |
| | | import com.panzhihua.service_community.service.ComActWarehouseApplyService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 物品申请表(ComActWarehouseApply)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-09 17:13:53 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActWarehouseApplyServiceImpl extends ServiceImpl<ComActWarehouseApplyDao, ComActWarehouseApply> implements ComActWarehouseApplyService { |
| | | @Resource |
| | | private ComActWarehouseApplyDao comActWarehouseApplyDao; |
| | | @Resource |
| | | private ComPbServiceTeamDao comPbServiceTeamDao; |
| | | @Resource |
| | | private ComActWarehouseDonatesDao comActWarehouseDonatesDao; |
| | | @Resource |
| | | private ComActWarehouseOperationDao comActWarehouseOperationDao; |
| | | @Override |
| | | public R pageList(CommonPage commonPage) { |
| | | IPage<ComActWarehouseApplyVO> iPage=this.comActWarehouseApplyDao.queryAll(new Page<>(commonPage.getPage(),commonPage.getSize()),commonPage); |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | | @Override |
| | | public R selectStatics(Long communityId) { |
| | | return R.ok(this.comActWarehouseApplyDao.selectStatics(communityId)); |
| | | } |
| | | |
| | | @Override |
| | | public R selectById(Integer id) { |
| | | return R.ok(this.comActWarehouseApplyDao.selectById(id)); |
| | | } |
| | | |
| | | @Override |
| | | public R check(String phone) { |
| | | Integer count=comPbServiceTeamDao.selectCount(new QueryWrapper<ComPbServiceTeam>().lambda().eq(ComPbServiceTeam::getPhone,phone)); |
| | | return count>0? R.ok():R.fail("无权限"); |
| | | } |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public R update(ComActWarehouseApply comActWarehouseApply) { |
| | | ComActWarehouseApplyVO comActWarehouseApply1=this.comActWarehouseApplyDao.selectById(comActWarehouseApply.getId()); |
| | | if(comActWarehouseApply.getStatus().equals(ComActWarehouseApplyVO.status.ylq)){ |
| | | ComActWarehouseDonates comActWarehouseDonates=this.comActWarehouseDonatesDao.selectById(comActWarehouseApply1.getGoodsId()); |
| | | if(comActWarehouseDonates!=null&&comActWarehouseDonates.getSurplusQuantity()>=comActWarehouseApply1.getGoodsNum()){ |
| | | comActWarehouseDonates.setSurplusQuantity(comActWarehouseDonates.getSurplusQuantity()-comActWarehouseApply1.getGoodsNum()); |
| | | this.comActWarehouseDonatesDao.updateById(comActWarehouseDonates); |
| | | ComActWarehouseOperation comActWarehouseOperation=new ComActWarehouseOperation(); |
| | | comActWarehouseOperation.setGoodsId(comActWarehouseApply1.getGoodsId()); |
| | | comActWarehouseOperation.setCreateTime(new Date()); |
| | | comActWarehouseOperation.setType(ComActWarehouseOperation.type.xs); |
| | | comActWarehouseOperation.setApplyId(comActWarehouseApply.getId()); |
| | | this.comActWarehouseOperationDao.insert(comActWarehouseOperation); |
| | | } |
| | | else { |
| | | return R.fail("库存不足"); |
| | | } |
| | | } |
| | | return R.ok(this.comActWarehouseApplyDao.updateById(comActWarehouseApply)); |
| | | } |
| | | |
| | | @Override |
| | | public R export(CommonPage commonPage) { |
| | | return R.ok(this.comActWarehouseApplyDao.queryAll(commonPage)); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseBase; |
| | | import com.panzhihua.service_community.dao.ComActWarehouseBaseDao; |
| | | import com.panzhihua.service_community.service.ComActWarehouseBaseService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 义仓基础设置表(ComActWarehouseBase)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-11 09:21:53 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActWarehouseBaseServiceImpl extends ServiceImpl<ComActWarehouseBaseDao, ComActWarehouseBase> implements ComActWarehouseBaseService { |
| | | |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | import static org.apache.commons.lang3.StringUtils.isBlank; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | 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.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ComActWarehouseApplyDTO; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ComActWarehouseDonatesDTO; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ExportDonatesDTO; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.PageDonatesDTO; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseApplyVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseDonatesVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseOperationVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.DonatesStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.WarehouseDonatesExcelVO; |
| | | import com.panzhihua.service_community.dao.ComActWarehouseApplyDao; |
| | | import com.panzhihua.service_community.dao.ComActWarehouseDonatesDao; |
| | | import com.panzhihua.service_community.dao.ComActWarehouseOperationDao; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseApply; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseDonates; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseOperation; |
| | | import com.panzhihua.service_community.service.ComActWarehouseDonatesService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * 爱心义仓/物品捐赠表(ComActWarehouseDonates)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-09 17:14:16 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActWarehouseDonatesServiceImpl extends ServiceImpl<ComActWarehouseDonatesDao, ComActWarehouseDonates> implements ComActWarehouseDonatesService { |
| | | |
| | | @Resource |
| | | private ComActWarehouseOperationDao comActWarehouseOperationDao; |
| | | @Resource |
| | | private ComActWarehouseApplyDao comActWarehouseApplyDao; |
| | | |
| | | @Override |
| | | public R pageList(CommonPage commonPage) { |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 后台导入捐赠物品 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R batchImportWarehouseDonates(List<WarehouseDonatesExcelVO> list) { |
| | | try { |
| | | if (!list.isEmpty()) { |
| | | List<ComActWarehouseDonates> donateList = list.stream().map(excelVO -> { |
| | | ComActWarehouseDonates donates = new ComActWarehouseDonates(); |
| | | BeanUtils.copyProperties(excelVO, donates); |
| | | if (excelVO.getIsAnonymous().equals("是")) { |
| | | donates.setIsAnonymous(1); |
| | | } else { |
| | | donates.setIsAnonymous(2); |
| | | } |
| | | return donates; |
| | | }).collect(Collectors.toList()); |
| | | this.baseMapper.batchInsertDonates(donateList); |
| | | List<ComActWarehouseOperation> operationList = new ArrayList<>(); |
| | | Date nowDate = new Date(); |
| | | donateList.forEach(donate -> { |
| | | Long donateId = donate.getId(); |
| | | if (nonNull(donateId)) { |
| | | ComActWarehouseOperation comActWarehouseOperation = new ComActWarehouseOperation(); |
| | | comActWarehouseOperation.setGoodsId(donateId.intValue()); |
| | | comActWarehouseOperation.setUserId(donate.getSigningBy().intValue()); |
| | | comActWarehouseOperation.setContent("工作人员完成了物品签收"); |
| | | comActWarehouseOperation.setCreateTime(nowDate); |
| | | comActWarehouseOperation.setType(ComActWarehouseOperation.type.bxs); |
| | | operationList.add(comActWarehouseOperation); |
| | | } |
| | | }); |
| | | if (!operationList.isEmpty()) { |
| | | comActWarehouseOperationDao.batchInsertOperation(operationList); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("导入捐赠物品失败【{}】", e.getMessage()); |
| | | return R.fail("导入捐赠物品失败"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 后台导出捐赠物品表格 |
| | | * @param exportDonatesDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R exportDonates(ExportDonatesDTO exportDonatesDTO) { |
| | | List<Long> needExportIds = exportDonatesDTO.getIds(); |
| | | if (nonNull(needExportIds) && !needExportIds.isEmpty()) { |
| | | //根据id导出 |
| | | return R.ok(this.baseMapper.exportDonatesByIds(needExportIds)); |
| | | } |
| | | return R.ok(this.baseMapper.exportDonatesBySearch(exportDonatesDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询捐赠物品 |
| | | * @param pageDonatesDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pageDonates(PageDonatesDTO pageDonatesDTO) { |
| | | Page page = new Page<>(); |
| | | page.setCurrent(pageDonatesDTO.getPageNum()); |
| | | page.setSize(pageDonatesDTO.getPageSize()); |
| | | IPage<ComActWarehouseDonatesVO> donatesVOIPage = this.baseMapper.pageDonates(page, pageDonatesDTO); |
| | | Integer isWhich = pageDonatesDTO.getIsWhich(); |
| | | if (nonNull(isWhich) && isWhich.intValue() == 3) { |
| | | List<ComActWarehouseDonatesVO> records = donatesVOIPage.getRecords(); |
| | | if (!records.isEmpty()) { |
| | | records.forEach(record -> { |
| | | String name = record.getName(); |
| | | if (record.getIsAnonymous().equals(ComActWarehouseDonatesVO.isAnonymous.yes) || isBlank(name)) { |
| | | record.setName("匿名用户"); |
| | | } else { |
| | | record.setName(name.substring(0, 1).concat(name.substring(1).replaceAll("\\S", "*"))); |
| | | } |
| | | record.setPhone(null); |
| | | }); |
| | | } |
| | | } |
| | | return R.ok(donatesVOIPage); |
| | | } |
| | | |
| | | /** |
| | | * 新增物品捐赠 |
| | | * @param comActWarehouseDonatesDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R addDonates(ComActWarehouseDonatesDTO comActWarehouseDonatesDTO) { |
| | | ComActWarehouseDonates comActWarehouseDonates = new ComActWarehouseDonates(); |
| | | BeanUtils.copyProperties(comActWarehouseDonatesDTO, comActWarehouseDonates); |
| | | Date nowDate = new Date(); |
| | | comActWarehouseDonates.setRegisterAt(nowDate); |
| | | comActWarehouseDonates.setSurplusQuantity(comActWarehouseDonatesDTO.getQuantity()); |
| | | if (isNull(comActWarehouseDonatesDTO.getUserId())) { |
| | | //userId为空代表后台新增 |
| | | comActWarehouseDonates.setSigningAt(nowDate); |
| | | comActWarehouseDonates.setStatus(2); |
| | | } else { |
| | | comActWarehouseDonates.setStatus(1); |
| | | } |
| | | int result = this.baseMapper.insert(comActWarehouseDonates); |
| | | if (result > 0) { |
| | | if (comActWarehouseDonates.getStatus().intValue() == 2) { |
| | | ComActWarehouseOperation comActWarehouseOperation = new ComActWarehouseOperation(); |
| | | comActWarehouseOperation.setGoodsId(comActWarehouseDonates.getId().intValue()); |
| | | comActWarehouseOperation.setUserId(comActWarehouseDonates.getSigningBy().intValue()); |
| | | comActWarehouseOperation.setContent("工作人员完成了物品签收"); |
| | | comActWarehouseOperation.setCreateTime(nowDate); |
| | | comActWarehouseOperation.setType(ComActWarehouseOperation.type.bxs); |
| | | comActWarehouseOperationDao.insert(comActWarehouseOperation); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | return R.fail("添加失败,请重试"); |
| | | } |
| | | |
| | | /** |
| | | * 查看物品捐赠详情 |
| | | * @param donatesId |
| | | * @param isWhich |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getDonates(Long donatesId, Integer isWhich, Long userId) { |
| | | ComActWarehouseDonatesVO comActWarehouseDonatesVO = this.baseMapper.selectDetailById(donatesId); |
| | | if (isNull(comActWarehouseDonatesVO)) { |
| | | return R.fail("捐赠物品记录不存在"); |
| | | } |
| | | if (nonNull(isWhich) && isWhich.intValue() != 0) { |
| | | if (isWhich.intValue() == 3) { |
| | | String name = comActWarehouseDonatesVO.getName(); |
| | | if (comActWarehouseDonatesVO.getIsAnonymous().equals(ComActWarehouseDonatesVO.isAnonymous.yes) || isBlank(name)) { |
| | | comActWarehouseDonatesVO.setName("匿名用户"); |
| | | } else { |
| | | comActWarehouseDonatesVO.setName(name.substring(0, 1).concat(name.substring(1).replaceAll("\\S", "*"))); |
| | | } |
| | | comActWarehouseDonatesVO.setPhone(null); |
| | | } |
| | | if (isWhich.intValue() == 1 && !userId.equals(comActWarehouseDonatesVO.getUserId())) { |
| | | return R.fail("无法获取他人捐赠记录"); |
| | | } |
| | | List<ComActWarehouseOperationVO> operationList = comActWarehouseOperationDao.selectList(donatesId); |
| | | comActWarehouseDonatesVO.setOperationList(operationList); |
| | | } |
| | | return R.ok(comActWarehouseDonatesVO); |
| | | } |
| | | |
| | | /** |
| | | * 捐赠物品后台签收 |
| | | * @param comActWarehouseDonatesDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R signingDonates(ComActWarehouseDonatesDTO comActWarehouseDonatesDTO) { |
| | | ComActWarehouseDonates comActWarehouseDonates = this.baseMapper.selectById(comActWarehouseDonatesDTO.getId()); |
| | | if (isNull(comActWarehouseDonates)) { |
| | | return R.fail("捐赠物品记录不存在"); |
| | | } |
| | | if (comActWarehouseDonates.getStatus().intValue() != 1) { |
| | | return R.fail("捐赠物品已被签收或已被取消"); |
| | | } |
| | | BeanUtils.copyProperties(comActWarehouseDonatesDTO, comActWarehouseDonates); |
| | | Date nowDate = new Date(); |
| | | if (nonNull(comActWarehouseDonatesDTO.getQuantity())) { |
| | | comActWarehouseDonates.setSurplusQuantity(comActWarehouseDonatesDTO.getQuantity()); |
| | | } |
| | | comActWarehouseDonates.setSigningAt(nowDate); |
| | | comActWarehouseDonates.setStatus(2); |
| | | int result = this.baseMapper.updateById(comActWarehouseDonates); |
| | | if (result > 0) { |
| | | ComActWarehouseOperation comActWarehouseOperation = new ComActWarehouseOperation(); |
| | | comActWarehouseOperation.setGoodsId(comActWarehouseDonates.getId().intValue()); |
| | | comActWarehouseOperation.setUserId(comActWarehouseDonates.getSigningBy().intValue()); |
| | | comActWarehouseOperation.setContent("工作人员完成了物品签收"); |
| | | comActWarehouseOperation.setCreateTime(nowDate); |
| | | comActWarehouseOperation.setType(ComActWarehouseOperation.type.bxs); |
| | | comActWarehouseOperationDao.insert(comActWarehouseOperation); |
| | | return R.ok(); |
| | | } |
| | | return R.fail("签收失败"); |
| | | } |
| | | |
| | | /** |
| | | * 用户取消捐赠 |
| | | * @param donatesId |
| | | * @param currentUser |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R cancelDonates(Long donatesId, Long currentUser) { |
| | | ComActWarehouseDonates comActWarehouseDonates = this.baseMapper.selectById(donatesId); |
| | | if (isNull(comActWarehouseDonates)) { |
| | | return R.fail("没有你的捐赠记录"); |
| | | } |
| | | if (!currentUser.equals(comActWarehouseDonates.getUserId())) { |
| | | return R.fail("不能取消他人的捐赠记录"); |
| | | } |
| | | if (comActWarehouseDonates.getStatus().equals(ComActWarehouseDonates.status.yqx)) { |
| | | return R.ok(); |
| | | } |
| | | comActWarehouseDonates.setStatus(ComActWarehouseDonates.status.yqx); |
| | | int result = this.baseMapper.updateById(comActWarehouseDonates); |
| | | if (result > 0) { |
| | | ComActWarehouseOperation comActWarehouseOperation = new ComActWarehouseOperation(); |
| | | comActWarehouseOperation.setGoodsId(comActWarehouseDonates.getId().intValue()); |
| | | comActWarehouseOperation.setUserId(currentUser.intValue()); |
| | | comActWarehouseOperation.setContent("已取消捐赠"); |
| | | comActWarehouseOperation.setCreateTime(new Date()); |
| | | comActWarehouseOperation.setType(ComActWarehouseOperation.type.bxs); |
| | | comActWarehouseOperationDao.insert(comActWarehouseOperation); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 捐赠物品统计查询 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getDonatesStatistics(Long communityId) { |
| | | Date nowDate = new Date(); |
| | | SimpleDateFormat yearFormat = new SimpleDateFormat("yyyy"); |
| | | SimpleDateFormat monthFormat = new SimpleDateFormat("yyyy-MM"); |
| | | SimpleDateFormat dayFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String currentYear = yearFormat.format(nowDate).concat("%"); |
| | | String currentMonth = monthFormat.format(nowDate).concat("%"); |
| | | String today = dayFormat.format(nowDate).concat("%"); |
| | | DonatesStatisticsVO donatesStatisticsVO = this.baseMapper.selectDonatesStatistics(communityId, currentYear, currentMonth, today); |
| | | donatesStatisticsVO.setTotalDec(donatesStatisticsVO.getTotalInc().intValue() - donatesStatisticsVO.getSurplus().intValue()); |
| | | return R.ok(donatesStatisticsVO); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台物品领用 |
| | | * @param comActWarehouseApplyDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R applyDonates(ComActWarehouseApplyDTO comActWarehouseApplyDTO) { |
| | | List<ComActWarehouseApplyVO> applyItems = comActWarehouseApplyDTO.getApplyItems(); |
| | | if (!applyItems.isEmpty()) { |
| | | Date nowDate = new Date(); |
| | | applyItems.forEach(item -> { |
| | | Integer goodsId = item.getGoodsId(); |
| | | Integer goodsNum = item.getGoodsNum(); |
| | | if (isNull(goodsId) || isNull(goodsNum)) { |
| | | throw new ServiceException("请求参数有误"); |
| | | } |
| | | ComActWarehouseDonates warehouseDonates = this.baseMapper.selectById(goodsId); |
| | | if (nonNull(warehouseDonates) && warehouseDonates.getSurplusQuantity() - goodsNum >= 0) { |
| | | warehouseDonates.setSurplusQuantity(warehouseDonates.getSurplusQuantity() - goodsNum); |
| | | this.baseMapper.updateById(warehouseDonates); |
| | | |
| | | ComActWarehouseApply apply = new ComActWarehouseApply(); |
| | | BeanUtils.copyProperties(comActWarehouseApplyDTO, apply); |
| | | apply.setActualTime(nowDate); |
| | | apply.setCreateTime(nowDate); |
| | | apply.setGoodsId(goodsId); |
| | | apply.setGoodsNum(goodsNum); |
| | | apply.setReserveTime(nowDate); |
| | | apply.setStatus(ComActWarehouseApplyVO.status.ylq); |
| | | apply.setWriteOffUserId(comActWarehouseApplyDTO.getOperateUserId()); |
| | | comActWarehouseApplyDao.insert(apply); |
| | | |
| | | ComActWarehouseOperation comActWarehouseOperation=new ComActWarehouseOperation(); |
| | | comActWarehouseOperation.setGoodsId(goodsId); |
| | | comActWarehouseOperation.setCreateTime(nowDate); |
| | | comActWarehouseOperation.setContent("爱心传递给了"+comActWarehouseApplyDTO.getApplyName().charAt(0)+"**,"+"减少了"+comActWarehouseApplyDTO.getReason()+"的困难,谢谢你的帮助"); |
| | | comActWarehouseOperation.setType(ComActWarehouseOperation.type.xs); |
| | | comActWarehouseOperation.setApplyId(apply.getId()); |
| | | comActWarehouseOperationDao.insert(comActWarehouseOperation); |
| | | } |
| | | }); |
| | | } |
| | | return R.ok("领取成功,部分物品可能因剩余数量不足领取失败,请以实际领取记录为准"); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseOperationVO; |
| | | import com.panzhihua.service_community.entity.ComActWarehouseOperation; |
| | | import com.panzhihua.service_community.dao.ComActWarehouseOperationDao; |
| | | import com.panzhihua.service_community.service.ComActWarehouseOperationService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 爱心义操作表(ComActWarehouseOperation)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-09 17:14:34 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActWarehouseOperationServiceImpl extends ServiceImpl<ComActWarehouseOperationDao, ComActWarehouseOperation> implements ComActWarehouseOperationService { |
| | | @Resource |
| | | private ComActWarehouseOperationDao comActWarehouseOperationDao; |
| | | @Override |
| | | public R pageList(CommonPage commonPage) { |
| | | IPage<ComActWarehouseOperationVO> page=comActWarehouseOperationDao.pageList(new Page<>(commonPage.getPage(),commonPage.getSize()),commonPage); |
| | | return R.ok(page); |
| | | } |
| | | } |
| | |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorMsg(String.format("导入失败:商家【%s】下已有服务【%s】", |
| | | comCvtServeExcelVO.getBusinessName(), comCvtServeExcelVO.getServiceName())); |
| | | importErrorVO.setErrorPosition("第" + index + "行"); |
| | | // importErrorVO.setErrorPosition("第" + index + "行"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | log.error(String.format("导入失败:商家【%s】下已有服务【%s】", comCvtServeExcelVO.getBusinessName(), |
| | | comCvtServeExcelVO.getServiceName())); |
| | |
| | | if (!categoryMap.containsKey(comCvtServeExcelVO.getCategoryName())) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorMsg("导入失败: 服务分类" + comCvtServeExcelVO.getCategoryName() + "不存在"); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第1列"); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第1列"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | // errorInfo.add(comCvtServeExcelVO.getCategoryName() +"导入失败: 服务分类不存在"); |
| | | } |
| | | if (!businessMap.containsKey(comCvtServeExcelVO.getBusinessName())) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorMsg("导入失败: 便民服务商家" + comCvtServeExcelVO.getBusinessName() + "不存在"); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第5列"); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第5列"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | } |
| | | } |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseInsertAdminDTO; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.service.ComMngPopulationHouseUserService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private ComActVillageDAO comActVillageDAO; |
| | | @Resource |
| | | private ComMngPopulationHouseDAO comMngPopulationHouseDAO; |
| | | @Resource |
| | | private ComMngPopulationHouseService comMngPopulationHouseService; |
| | | @Resource |
| | | private ComMngPopulationHouseUserService comMngPopulationHouseUserService; |
| | | |
| | | private static <T> Predicate<T> distinctByKey(Function<? super T, Object> keyExtractor) { |
| | | Map<Object, Boolean> seen = new ConcurrentHashMap<>(); |
| | |
| | | cascadeHouseVOList = this.baseMapper.getHouseLevelByAlley(cascadeHouseDTO.getCommunityId(), |
| | | cascadeHouseDTO.getVillageId()); |
| | | cascadeHouseVOList = cascadeHouseVOList.stream() |
| | | .collect(Collectors.collectingAndThen( |
| | | Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getAlley()))), |
| | | ArrayList::new)); |
| | | .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>( |
| | | Comparator.comparing(ComMngCascadeHouseVO::getAlley))),ArrayList::new)); |
| | | cascadeHouseVOList.forEach(cascade -> { |
| | | cascade.setName(cascade.getAlley()); |
| | | }); |
| | |
| | | return R.ok(subordinateList); |
| | | } |
| | | |
| | | @Override |
| | | public R populationRelationHouse(ComMngPopulationRelationHouseDTO relationHouseDTO) { |
| | | |
| | | if (relationHouseDTO.getPopulationId().isEmpty()) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 实有房屋数据修复定时任务 |
| | | * @return 实有房屋数据修复定时任务 |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public R timedTaskHouseJobHandler(){ |
| | | |
| | | //需要修改的房屋信息 |
| | | List<ComMngPopulationHouseDO> updateHouseList = new ArrayList<>(); |
| | | //需要修改的房屋人员关系信息 |
| | | List<ComMngPopulationHouseUserDO> updateHouseUserList = new ArrayList<>(); |
| | | |
| | | ComMngPopulationDO population = new ComMngPopulationDO(); |
| | | |
| | | //查询所有房屋列表信息 |
| | | List<ComMngPopulationHouseDO> houseList = comMngPopulationHouseDAO.selectList(null); |
| | | //遍历房屋信息 |
| | | for (ComMngPopulationHouseDO house : houseList) { |
| | | List<ComMngPopulationHouseUserDO> houseUserList = comMngPopulationHouseUserDAO.selectList(new QueryWrapper<ComMngPopulationHouseUserDO>() |
| | | .lambda().eq(ComMngPopulationHouseUserDO::getHouseId,house.getId())); |
| | | if(houseUserList.isEmpty()){ |
| | | house.setStatus(ComMngPopulationHouseDO.status.kongzhi); |
| | | }else{ |
| | | house.setStatus(ComMngPopulationHouseDO.status.zizhu); |
| | | |
| | | //查询该房屋下人员是否是租住状态 |
| | | List<Long> populationIds = houseUserList.stream().map(ComMngPopulationHouseUserDO::getPopulId).collect(Collectors.toList()); |
| | | Integer count = comMngPopulationHouseUserDAO.getHouseUserIsRent(populationIds); |
| | | if(count > 0){ |
| | | house.setStatus(ComMngPopulationHouseDO.status.zuzhu); |
| | | } |
| | | |
| | | //查询该房屋下人员的关联信息的关系 |
| | | for (ComMngPopulationHouseUserDO houseUser : houseUserList) { |
| | | population = comMngPopulationDAO.selectById(houseUser.getPopulId()); |
| | | if(population != null){ |
| | | if(population.getIsRent() != null && population.getIsRent().equals(ComMngPopulationDO.isOk.yes)){ |
| | | houseUser.setRelationId(ComMngPopulationHouseUserDO.relationId.zuhu); |
| | | }else { |
| | | houseUser.setRelationId(ComMngPopulationHouseUserDO.relationId.zuzhu); |
| | | } |
| | | updateHouseUserList.add(houseUser); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //查看房子的楼层排序 |
| | | if(house.getFloorNum() == null && StringUtils.isNotEmpty(house.getHouseNo())){ |
| | | boolean result = house.getHouseNo().matches("[0-9]+"); |
| | | if (result) {// 该字段为纯数字 |
| | | if (house.getHouseNo().length() == 4) { |
| | | String floorNum = house.getHouseNo().substring(0, 2).replaceAll("^(0+)", ""); |
| | | if(StringUtils.isNotEmpty(floorNum)){ |
| | | house.setFloorNum(Integer.parseInt(floorNum)); |
| | | } |
| | | } else if (house.getHouseNo().length() == 3) { |
| | | String floorNum = house.getHouseNo().substring(0, 1).replaceAll("^(0+)", ""); |
| | | if(StringUtils.isNotEmpty(floorNum)){ |
| | | house.setFloorNum(Integer.parseInt(floorNum)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | updateHouseList.add(house); |
| | | } |
| | | |
| | | if(!updateHouseList.isEmpty()){ |
| | | comMngPopulationHouseService.updateBatchById(updateHouseList); |
| | | } |
| | | |
| | | if(!updateHouseUserList.isEmpty()){ |
| | | comMngPopulationHouseUserService.updateBatchById(updateHouseUserList); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | /** |
| | | * 批量删除实有人口 |
| | | * |
| | | * @param Ids |
| | | * @return |
| | | * @param ids 实有人口id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R deletePopulations(List<Long> Ids) { |
| | | if (!Ids.isEmpty()) { |
| | | Ids.forEach(id -> { |
| | | // 清除用户房屋居住信息 |
| | | comMngPopulationHouseUserDAO.deletePopulationHouseByUserId(id); |
| | | }); |
| | | } |
| | | int delete = populationDAO.deleteBatchIds(Ids); |
| | | if (delete > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | public R deletePopulations(List<Long> ids, Long communityId) { |
| | | comMngPopulationCommunityTagsDAO.deletePopulationRelation(ids,communityId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | Page userPage = new Page(pageComMngVillageDTO.getPageNum(), pageComMngVillageDTO.getPageSize()); |
| | | IPage<ComMngVillageDO> doPager = |
| | | comActVillageDAO.selectPage(userPage, userLambdaQueryWrapper.orderByDesc(ComMngVillageDO::getCreateAt)); |
| | | comActVillageDAO.selectPage(userPage, userLambdaQueryWrapper.orderByDesc(ComMngVillageDO::getName)); |
| | | |
| | | IPage<ComMngVillageVO> villageVOIPage = new Page<>(); |
| | | villageVOIPage.setCurrent(doPager.getCurrent()); |
| | |
| | | return R.fail("id有误!"); |
| | | } |
| | | BeanUtils.copyProperties(comMngVillageVO, comMngVillageDO); |
| | | comMngVillageDO.setName(comMngVillageVO.getGroupAt()); |
| | | ComActDO comActDO = comActDAO.selectById(comMngVillageDO.getCommunityId()); |
| | | if (comActDO == null || comActDO.getStreetId() == null) { |
| | | return R.fail("社区没有绑定街道,请绑定后操作!"); |
| New file |
| | |
| | | package com.panzhihua.service_community.util; |
| | | |
| | | import cn.hutool.core.codec.Base64; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.google.zxing.BarcodeFormat; |
| | | import com.google.zxing.EncodeHintType; |
| | | import com.google.zxing.common.BitMatrix; |
| | | import com.google.zxing.qrcode.QRCodeWriter; |
| | | import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; |
| | | import lombok.experimental.UtilityClass; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import javax.servlet.ServletOutputStream; |
| | | import java.awt.*; |
| | | import java.awt.geom.RoundRectangle2D; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.OutputStream; |
| | | import java.net.URL; |
| | | import java.util.HashMap; |
| | | |
| | | @Slf4j |
| | | @UtilityClass |
| | | public class QRCodeUtil { |
| | | /** |
| | | * 默认宽度 |
| | | */ |
| | | private static final Integer WIDTH = 140; |
| | | /** |
| | | * 默认高度 |
| | | */ |
| | | private static final Integer HEIGHT = 140; |
| | | |
| | | /** |
| | | * LOGO 默认宽度 |
| | | */ |
| | | private static final Integer LOGO_WIDTH = 22; |
| | | /** |
| | | * LOGO 默认高度 |
| | | */ |
| | | private static final Integer LOGO_HEIGHT = 22; |
| | | |
| | | /** |
| | | * 图片格式 |
| | | */ |
| | | private static final String IMAGE_FORMAT = "png"; |
| | | private static final String CHARSET = "utf-8"; |
| | | /** |
| | | * 原生转码前面没有 data:image/png;base64 这些字段,返回给前端是无法被解析 |
| | | */ |
| | | private static final String BASE64_IMAGE = "data:image/png;base64,%s"; |
| | | |
| | | /** |
| | | * 生成二维码,使用默认尺寸 |
| | | * |
| | | * @param content 内容 |
| | | * @return |
| | | */ |
| | | public String getBase64QRCode(String content) { |
| | | return getBase64Image(content, WIDTH, HEIGHT, null, null, null); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码,使用默认尺寸二维码,插入默认尺寸logo |
| | | * |
| | | * @param content 内容 |
| | | * @param logoUrl logo地址 |
| | | * @return |
| | | */ |
| | | public String getBase64QRCode(String content, String logoUrl) { |
| | | return getBase64Image(content, WIDTH, HEIGHT, logoUrl, LOGO_WIDTH, LOGO_HEIGHT); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | * |
| | | * @param content 内容 |
| | | * @param width 二维码宽度 |
| | | * @param height 二维码高度 |
| | | * @param logoUrl logo 在线地址 |
| | | * @param logoWidth logo 宽度 |
| | | * @param logoHeight logo 高度 |
| | | * @return |
| | | */ |
| | | public String getBase64QRCode(String content, Integer width, Integer height, String logoUrl, Integer logoWidth, Integer logoHeight) { |
| | | return getBase64Image(content, width, height, logoUrl, logoWidth, logoHeight); |
| | | } |
| | | |
| | | private String getBase64Image(String content, Integer width, Integer height, String logoUrl, Integer logoWidth, Integer logoHeight) { |
| | | ByteArrayOutputStream os = new ByteArrayOutputStream(); |
| | | BufferedImage bufferedImage = crateQRCode(content, width, height, logoUrl, logoWidth, logoHeight); |
| | | try { |
| | | ImageIO.write(bufferedImage, IMAGE_FORMAT, os); |
| | | } catch (IOException e) { |
| | | log.error("[生成二维码,错误{}]", e); |
| | | } |
| | | // 转出即可直接使用 |
| | | return String.format(BASE64_IMAGE, Base64.encode(os.toByteArray())); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | * |
| | | * @param content 内容 |
| | | * @param width 二维码宽度 |
| | | * @param height 二维码高度 |
| | | * @param logoUrl logo 在线地址 |
| | | * @param logoWidth logo 宽度 |
| | | * @param logoHeight logo 高度 |
| | | * @return |
| | | */ |
| | | private BufferedImage crateQRCode(String content, Integer width, Integer height, String logoUrl, Integer logoWidth, Integer logoHeight) { |
| | | if (StrUtil.isNotBlank(content)) { |
| | | ServletOutputStream stream = null; |
| | | HashMap<EncodeHintType, Comparable> hints = new HashMap<>(4); |
| | | // 指定字符编码为utf-8 |
| | | hints.put(EncodeHintType.CHARACTER_SET, CHARSET); |
| | | // 指定二维码的纠错等级为中级 |
| | | hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M); |
| | | // 设置图片的边距 |
| | | hints.put(EncodeHintType.MARGIN, 2); |
| | | try { |
| | | QRCodeWriter writer = new QRCodeWriter(); |
| | | BitMatrix bitMatrix = writer.encode(content, BarcodeFormat.QR_CODE, width, height, hints); |
| | | BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); |
| | | for (int x = 0; x < width; x++) { |
| | | for (int y = 0; y < height; y++) { |
| | | bufferedImage.setRGB(x, y, bitMatrix.get(x, y) ? 0xFF000000 : 0xFFFFFFFF); |
| | | } |
| | | } |
| | | if (StrUtil.isNotBlank(logoUrl)) { |
| | | insertLogo(bufferedImage, width, height, logoUrl, logoWidth, logoHeight); |
| | | } |
| | | return bufferedImage; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | if (stream != null) { |
| | | try { |
| | | stream.flush(); |
| | | stream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 二维码插入logo |
| | | * |
| | | * @param source 二维码 |
| | | * @param width 二维码宽度 |
| | | * @param height 二维码高度 |
| | | * @param logoUrl logo 在线地址 |
| | | * @param logoWidth logo 宽度 |
| | | * @param logoHeight logo 高度 |
| | | * @throws Exception |
| | | */ |
| | | private void insertLogo(BufferedImage source, Integer width, Integer height, String logoUrl, Integer logoWidth, Integer logoHeight) throws Exception { |
| | | // logo 源可为 File/InputStream/URL |
| | | Image src = ImageIO.read(new URL(logoUrl)); |
| | | // 插入LOGO |
| | | Graphics2D graph = source.createGraphics(); |
| | | int x = (width - logoWidth) / 2; |
| | | int y = (height - logoHeight) / 2; |
| | | graph.drawImage(src, x, y, logoWidth, logoHeight, null); |
| | | Shape shape = new RoundRectangle2D.Float(x, y, logoWidth, logoHeight, 6, 6); |
| | | graph.setStroke(new BasicStroke(3f)); |
| | | graph.draw(shape); |
| | | graph.dispose(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取二维码 |
| | | * |
| | | * @param content 内容 |
| | | * @param output 输出流 |
| | | * @throws IOException |
| | | */ |
| | | public void getQRCode(String content, OutputStream output) throws IOException { |
| | | BufferedImage image = crateQRCode(content, WIDTH, HEIGHT, null, null, null); |
| | | ImageIO.write(image, IMAGE_FORMAT, output); |
| | | } |
| | | |
| | | /** |
| | | * 获取二维码 |
| | | * |
| | | * @param content 内容 |
| | | * @param logoUrl logo资源 |
| | | * @param output 输出流 |
| | | * @throws Exception |
| | | */ |
| | | public void getQRCode(String content, String logoUrl, OutputStream output) throws Exception { |
| | | BufferedImage image = crateQRCode(content, WIDTH, HEIGHT, logoUrl, LOGO_WIDTH, LOGO_HEIGHT); |
| | | ImageIO.write(image, IMAGE_FORMAT, output); |
| | | } |
| | | |
| | | } |
| | |
| | | ca.`name` as classifyName, |
| | | p.examine_at, |
| | | c.name communityName, |
| | | p.urban_status |
| | | p.urban_status, |
| | | p.transfer_reason |
| | | FROM |
| | | com_act_easy_photo p |
| | | LEFT JOIN sys_user u ON p.sponsor_id = u.user_id |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActWarehouseApplyDao"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.ComActWarehouseApply" |
| | | id="ComActWarehouseApplyBaseResultMap"> |
| | | <result property="id" column="id"/> |
| | | <result property="goodsId" column="goods_id"/> |
| | | <result property="goodsNum" column="goods_num"/> |
| | | <result property="reserveTime" column="reserve_time"/> |
| | | <result property="actualTime" column="actual_time"/> |
| | | <result property="reason" column="reason"/> |
| | | <result property="receiveUrl" column="receive_url"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="status" column="status"/> |
| | | <result property="applyUserId" column="apply_user_id"/> |
| | | <result property="applyName" column="apply_name"/> |
| | | <result property="applyPhone" column="apply_phone"/> |
| | | <result property="solveUserId" column="solve_user_id"/> |
| | | <result property="solveTime" column="solve_time"/> |
| | | <result property="solveContent" column="solve_content"/> |
| | | <result property="writeOffUserId" column="write_off_user_id"/> |
| | | <result property="cancelTime" column="cancel_time"/> |
| | | <result property="communityId" column="community_id"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="queryAll" resultType="com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseApplyVO"> |
| | | select t.*,t1.name as donateName,t1.item,t1.image,t1.phone as donatePhone,t2.name as writeOffUserName from com_act_warehouse_apply t inner join com_act_warehouse_donates t1 on t.goods_id = t1.id left join sys_user t2 on t.write_off_user_id = t2.user_id |
| | | <where> |
| | | 1=1 |
| | | <if test="commonPage.paramId !=null"> |
| | | and t.community_id=#{commonPage.paramId} |
| | | </if> |
| | | <if test="commonPage.status !=null"> |
| | | and t.status=#{commonPage.status} |
| | | </if> |
| | | <if test="commonPage.paramId2 != null"> |
| | | and t.goods_id = #{commonPage.paramId2} |
| | | </if> |
| | | <if test="commonPage.keyword !=null and commonPage.keyword !=''"> |
| | | and (t.id like concat('%',#{commonPage.keyword},'%') or t1.item like concat('%',#{commonPage.keyword},'%') or t.apply_phone like concat('%',#{commonPage.keyword},'%') or t.apply_name like concat('%',#{commonPage.keyword},'%') or t.id like concat('%',#{commonPage.keyword},'%')) |
| | | </if> |
| | | <if test="commonPage.userId !=null"> |
| | | and t.apply_user_id = #{commonPage.userId} |
| | | </if> |
| | | <if test="commonPage.beginTime !=null"> |
| | | and t.actual_time >=#{commonPage.beginTime} |
| | | </if> |
| | | <if test="commonPage.endTime !=null"> |
| | | and #{commonPage.endTime} >=t.actual_time |
| | | </if> |
| | | </where> |
| | | order by t.create_time desc |
| | | </select> |
| | | |
| | | <select id="selectStatics" resultType="com.panzhihua.common.model.vos.community.warehouse.ApplyStatistics"> |
| | | select |
| | | (select count(*) from com_act_warehouse_apply where status = 0 and community_id =#{communityId}) as pending, |
| | | (select count(*) from com_act_warehouse_apply where status = 1 and community_id =#{communityId}) as unclaimed, |
| | | (select count(*) from com_act_warehouse_apply where status = 2 and community_id =#{communityId}) as rejected, |
| | | (select count(*) from com_act_warehouse_apply where status = 3 and community_id =#{communityId}) as received, |
| | | (select count(*) from com_act_warehouse_apply where status = -1 and community_id =#{communityId}) as cancelled |
| | | </select> |
| | | |
| | | <select id="selectById" resultType="com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseApplyVO"> |
| | | select t.*,t1.name as donateName,t1.item,t1.image,t1.phone as donatePhone,t2.name as writeOffUserName,t3.name as solveName,t1.surplus_quantity as surplusQuantity from com_act_warehouse_apply t inner join com_act_warehouse_donates t1 on t.goods_id = t1.id left join sys_user t2 on t.write_off_user_id = t2.user_id left join sys_user t3 on t.solve_user_id = t3.user_id |
| | | where t.id=#{id} |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActWarehouseBaseDao"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.ComActWarehouseBase" id="ComActWarehouseBaseBaseResultMap"> |
| | | <result property="id" column="id"/> |
| | | <result property="warehouseExplain" column="warehouse_explain"/> |
| | | <result property="warehouseWorkTime" column="warehouse_work_time"/> |
| | | <result property="warehouseContact" column="warehouse_contact"/> |
| | | <result property="receivePosition" column="receive_position"/> |
| | | <result property="communityId" column="community_id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActWarehouseDonatesDao"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.ComActWarehouseDonates" |
| | | id="ComActWarehouseDonatesBaseResultMap"> |
| | | <result property="id" column="id"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="name" column="name"/> |
| | | <result property="phone" column="phone"/> |
| | | <result property="item" column="item"/> |
| | | <result property="image" column="image"/> |
| | | <result property="quantity" column="quantity"/> |
| | | <result property="surplusQuantity" column="surplus_quantity"/> |
| | | <result property="isAnonymous" column="is_anonymous"/> |
| | | <result property="message" column="message"/> |
| | | <result property="registerAt" column="register_at"/> |
| | | <result property="signingAt" column="signing_at"/> |
| | | <result property="status" column="status"/> |
| | | <result property="communityId" column="community_id"/> |
| | | <result property="registerBy" column="register_by"/> |
| | | <result property="signingBy" column="signing_by"/> |
| | | </resultMap> |
| | | <insert id="batchInsertDonates" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id"> |
| | | INSERT INTO `com_act_warehouse_donates`(`name`,phone,item,quantity,surplus_quantity, |
| | | is_anonymous,message,register_at,signing_at,status,community_id,register_by,signing_by) |
| | | VALUES |
| | | <foreach collection="donateList" item="item" index="index" separator="," > |
| | | (#{item.name}, #{item.phone}, #{item.item}, #{item.quantity}, #{item.surplusQuantity},#{item.isAnonymous}, |
| | | #{item.message}, #{item.registerAt}, #{item.signingAt}, #{item.status}, #{item.communityId}, #{item.registerBy}, #{item.signingBy}) |
| | | </foreach> |
| | | </insert> |
| | | <select id="exportDonatesByIds" |
| | | resultType="com.panzhihua.common.model.vos.community.warehouse.ExportDonatesVO"> |
| | | SELECT * FROM com_act_warehouse_donates |
| | | WHERE id IN |
| | | <foreach collection="needExportIds" open="(" separator="," close=")" index="index" item="item"> |
| | | #{item} |
| | | </foreach> |
| | | </select> |
| | | <select id="exportDonatesBySearch" |
| | | resultType="com.panzhihua.common.model.vos.community.warehouse.ExportDonatesVO"> |
| | | SELECT * FROM com_act_warehouse_donates |
| | | WHERE community_id = #{exportDonatesDTO.communityId} |
| | | <if test="exportDonatesDTO.status != null"> |
| | | AND status = #{exportDonatesDTO.status} |
| | | </if> |
| | | <if test="exportDonatesDTO.isAnonymous != null"> |
| | | AND is_anonymous = #{exportDonatesDTO.isAnonymous} |
| | | </if> |
| | | <if test="exportDonatesDTO.signingAtBegin != null"> |
| | | AND signing_at >= #{exportDonatesDTO.signingAtBegin} |
| | | </if> |
| | | <if test="exportDonatesDTO.signingAtEnd != null"> |
| | | AND signing_at <= #{exportDonatesDTO.signingAtEnd} |
| | | </if> |
| | | <if test="exportDonatesDTO.keyword != null and exportDonatesDTO.keyword != """> |
| | | AND ( |
| | | `name` LIKE CONCAT('%', #{exportDonatesDTO.keyword}, '%') |
| | | OR phone LIKE CONCAT('%', #{exportDonatesDTO.keyword}, '%') |
| | | OR item LIKE CONCAT('%', #{exportDonatesDTO.keyword}, '%') |
| | | ) |
| | | </if> |
| | | ORDER BY id DESC |
| | | </select> |
| | | <select id="pageDonates" |
| | | resultType="com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseDonatesVO"> |
| | | SELECT * FROM com_act_warehouse_donates |
| | | WHERE community_id = #{pageDonatesDTO.communityId} |
| | | <if test="pageDonatesDTO.isWhich != null and pageDonatesDTO.isWhich == 1"> |
| | | AND user_id = #{pageDonatesDTO.userId} |
| | | </if> |
| | | <if test="pageDonatesDTO.status != null"> |
| | | AND status = #{pageDonatesDTO.status} |
| | | </if> |
| | | <if test="pageDonatesDTO.isAnonymous != null"> |
| | | AND is_anonymous = #{pageDonatesDTO.isAnonymous} |
| | | </if> |
| | | <if test="pageDonatesDTO.signingAtBegin != null"> |
| | | AND signing_at >= #{pageDonatesDTO.signingAtBegin} |
| | | </if> |
| | | <if test="pageDonatesDTO.signingAtEnd != null"> |
| | | AND signing_at <= #{pageDonatesDTO.signingAtEnd} |
| | | </if> |
| | | <if test="pageDonatesDTO.keyword != null and pageDonatesDTO.keyword != """> |
| | | <if test="pageDonatesDTO.isWhich != null"> |
| | | AND status = 2 |
| | | AND item LIKE CONCAT('%', #{pageDonatesDTO.keyword}, '%') |
| | | </if> |
| | | <if test="pageDonatesDTO.isWhich == null"> |
| | | AND ( |
| | | `name` LIKE CONCAT('%', #{pageDonatesDTO.keyword}, '%') |
| | | OR phone LIKE CONCAT('%', #{pageDonatesDTO.keyword}, '%') |
| | | OR item LIKE CONCAT('%', #{pageDonatesDTO.keyword}, '%') |
| | | ) |
| | | </if> |
| | | </if> |
| | | ORDER BY id DESC |
| | | </select> |
| | | <select id="selectDetailById" |
| | | resultType="com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseDonatesVO"> |
| | | SELECT temp.*,IF(su.name IS NULL, su.nick_name, su.name) AS signingBy FROM ( |
| | | SELECT * FROM com_act_warehouse_donates WHERE id = #{donatesId} |
| | | ) temp LEFT JOIN sys_user su ON temp.signing_by = su.user_id |
| | | </select> |
| | | <select id="selectDonatesStatistics" |
| | | resultType="com.panzhihua.common.model.vos.community.warehouse.DonatesStatisticsVO"> |
| | | SELECT |
| | | (SELECT IF(SUM(quantity) IS NULL,0,SUM(quantity)) FROM com_act_warehouse_donates WHERE community_id = #{communityId} AND `status` = 2) as totalInc , |
| | | (SELECT IF(SUM(surplus_quantity) IS NULL,0,SUM(surplus_quantity)) FROM com_act_warehouse_donates WHERE community_id = #{communityId} AND `status` = 2) as surplus, |
| | | (SELECT IF(SUM(quantity) IS NULL,0,SUM(quantity)) FROM com_act_warehouse_donates WHERE community_id = #{communityId} AND `status` = 2 AND signing_at LIKE #{currentYear}) as yearInc, |
| | | (SELECT IF(SUM(quantity) IS NULL,0,SUM(quantity)) FROM com_act_warehouse_donates WHERE community_id = #{communityId} AND `status` = 2 AND signing_at LIKE #{currentMonth}) as mothInc, |
| | | (SELECT IF(SUM(quantity) IS NULL,0,SUM(quantity)) FROM com_act_warehouse_donates WHERE community_id = #{communityId} AND `status` = 2 AND signing_at LIKE #{today}) as dayInc, |
| | | (SELECT IF(SUM(goods_num) IS NULL,0,SUM(goods_num)) FROM com_act_warehouse_apply WHERE community_id = #{communityId} AND `status` = 3 AND actual_time LIKE #{currentYear}) as yearDec, |
| | | (SELECT IF(SUM(goods_num) IS NULL,0,SUM(goods_num)) FROM com_act_warehouse_apply WHERE community_id = #{communityId} AND `status` = 3 AND actual_time LIKE #{currentMonth}) as mothDec, |
| | | (SELECT IF(SUM(goods_num) IS NULL,0,SUM(goods_num)) FROM com_act_warehouse_apply WHERE community_id = #{communityId} AND `status` = 3 AND actual_time LIKE #{today}) as dayDec |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActWarehouseOperationDao"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.ComActWarehouseOperation" |
| | | id="ComActWarehouseOperationBaseResultMap"> |
| | | <result property="id" column="id"/> |
| | | <result property="goodsId" column="goods_id"/> |
| | | <result property="content" column="content"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="userId" column="user_id"/> |
| | | </resultMap> |
| | | <insert id="batchInsertOperation" parameterType="java.util.List"> |
| | | INSERT INTO `com_act_warehouse_operation` (goods_id,content,create_time,user_id) |
| | | VALUES |
| | | <foreach collection="operationList" item="item" index="index" separator="," > |
| | | (#{item.goodsId}, #{item.content}, #{item.createTime}, #{item.userId}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <select id="pageList" resultType="com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseOperationVO"> |
| | | select t.*,t1.image,t1.item,t1.`name` as donateName,t2.actual_time,t2.apply_name,t2.reason,t1.is_anonymous,t2.goods_num,t2.receive_url as receiveUrl from com_act_warehouse_operation t LEFT JOIN com_act_warehouse_donates t1 on t.goods_id =t1.id LEFT JOIN com_act_warehouse_apply t2 on t.apply_id = t2.id |
| | | <where> |
| | | t.type = 2 |
| | | <if test="commonPage.paramId != null"> |
| | | and t.goods_id=#{commonPage.paramId} |
| | | </if> |
| | | <if test="commonPage.communityId !=null"> |
| | | and t1.community_id =#{commonPage.communityId} |
| | | </if> |
| | | <if test="commonPage.keyword !=null and commonPage.keyword !=''"> |
| | | and t1.item like concat('%',#{commonPage.keyword},'%') |
| | | </if> |
| | | </where> |
| | | order by t.create_time desc |
| | | </select> |
| | | <select id="selectList" |
| | | resultType="com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseOperationVO"> |
| | | SELECT t.*,t1.image,t1.item,t1.`name` AS donateName,t2.actual_time,t2.apply_name,t2.reason,t1.is_anonymous |
| | | FROM com_act_warehouse_operation t |
| | | LEFT JOIN com_act_warehouse_donates t1 ON t.goods_id =t1.id |
| | | LEFT JOIN com_act_warehouse_apply t2 ON t.apply_id = t2.id |
| | | WHERE t.goods_id = #{donatesId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | select t.village_id as villageId,t.name as villageName,t1.id,t1.name from com_mng_village t left join com_mng_building t1 on t.village_id = t1.village_id where t.community_id=#{id} and t1.id is not null |
| | | </select> |
| | | |
| | | <select id="pageBuildingAdmin" resultType="com.panzhihua.common.model.vos.community.building.admin.PageBuildingListAdminVo"> |
| | | SELECT |
| | | cmb.id, |
| | | cmv.village_id, |
| | | cmv.alley, |
| | | cmb.`name`, |
| | | cmv.`name` AS villageName, |
| | | cmv.house_num as doorNum, |
| | | (select count(distinct unit_no) from com_mng_population_house where village_id = cmb.village_id AND floor = cmb.`name`) as unit_total, |
| | | (select max(CAST(house_no as SIGNED)) from com_mng_population_house where village_id = cmb.village_id AND floor = cmb.`name`) as buildFloorSum, |
| | | (select count(id) from com_mng_population_house where village_id = cmb.village_id and floor = cmb.`name`) as houseNum, |
| | | (select count(id) from com_mng_population where village_id = cmb.village_id and floor = cmb.`name`) as populationNum |
| | | FROM |
| | | com_mng_building AS cmb |
| | | LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmb.village_id |
| | | <where> |
| | | <if test="pageBuildingListDto.communityId != null"> |
| | | and cmb.act_id = #{pageBuildingListDto.communityId} |
| | | </if> |
| | | <if test="pageBuildingListDto.villageId != null"> |
| | | and cmb.village_id = #{pageBuildingListDto.villageId} |
| | | </if> |
| | | <if test="pageBuildingListDto.keyWord != null and pageBuildingListDto.keyWord != """> |
| | | and cmv.alley like concat(#{pageBuildingListDto.keyWord},'%') |
| | | </if> |
| | | </where> |
| | | order by alley asc |
| | | </select> |
| | | |
| | | <select id="buildingListHeaderStatisticsAdmin" resultType="com.panzhihua.common.model.vos.community.building.admin.BuildingListHeaderStatisticsAdminVo"> |
| | | SELECT count( id ) AS buildNum,( SELECT count( id ) FROM com_mng_population_house WHERE community_id = cmb.act_id ) AS houseNum, |
| | | ( SELECT count( id ) FROM com_mng_population_community_tags WHERE community_id = cmb.act_id ) AS populationNum |
| | | FROM |
| | | com_mng_building AS cmb |
| | | WHERE |
| | | cmb.act_id = #{communityId} |
| | | </select> |
| | | |
| | | <select id="detailBuildAdmin" resultType="com.panzhihua.common.model.vos.community.building.admin.BuildingDetailAdminVo"> |
| | | SELECT |
| | | cmb.id, |
| | | cmv.alley, |
| | | cmv.house_num AS doorNum, |
| | | cmb.`name`, |
| | | cmv.`name` AS village, |
| | | cmv.village_id, |
| | | (select count(id) from com_mng_population_house where village_id = cmb.village_id and floor = cmb.`name`) as houseNum, |
| | | (select count(id) from com_mng_population_house where village_id = cmb.village_id and floor = cmb.`name` and `status` = 1) as liveTotal, |
| | | (select count(id) from com_mng_population_house where village_id = cmb.village_id and floor = cmb.`name` and `status` = 2) as leaseTotal, |
| | | (select count(id) from com_mng_population_house where village_id = cmb.village_id and floor = cmb.`name` and `status` = 3) as vacantNum |
| | | FROM |
| | | com_mng_building AS cmb |
| | | LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmb.village_id |
| | | where cmb.id = #{id} |
| | | </select> |
| | | |
| | | <select id="buildingUnitList" resultType="com.panzhihua.common.model.vos.grid.ComMngVillageBuildingVO"> |
| | | SELECT DISTINCT |
| | | village_id, |
| | | floor, |
| | | unit_no |
| | | FROM |
| | | com_mng_population_house AS cmph |
| | | WHERE |
| | | village_id = #{villageId} and floor = #{floor} |
| | | </select> |
| | | |
| | | <select id="getBuildingUnitHouseList" resultType="com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO"> |
| | | SELECT id, floor, unit_no, house_no, `status`,floor_num as buildingNum, |
| | | ( SELECT count( id ) FROM com_mng_population_house_user WHERE house_id = cmph.id ) AS userNum |
| | | FROM |
| | | com_mng_population_house AS cmph |
| | | where cmph.village_id = #{pageBuildingListDto.villageId} |
| | | and cmph.floor = #{pageBuildingListDto.floor} |
| | | and cmph.unit_no = #{pageBuildingListDto.unit} |
| | | and cmph.house_no is not null |
| | | |
| | | order by floor_num asc |
| | | </select> |
| | | |
| | | <select id="getBuildingUnitHouseStatistics" resultType="Map"> |
| | | SELECT |
| | | count( id ) as houseNum, |
| | | (select count(id) from com_mng_population_house where village_id = #{villageId} and floor = #{floor} and unit_no = #{unit} and house_no is not null and `status` = 1) as liveTotal, |
| | | (select count(id) from com_mng_population_house where village_id = #{villageId} and floor = #{floor} and unit_no = #{unit} and house_no is not null and `status` = 2) as leaseTotal, |
| | | (select count(id) from com_mng_population_house where village_id = #{villageId} and floor = #{floor} and unit_no = #{unit} and house_no is not null and `status` = 3) as vacantNum |
| | | FROM |
| | | com_mng_population_house |
| | | WHERE |
| | | village_id = #{villageId} and floor = #{floor} and unit_no = #{unit} and house_no is not null |
| | | </select> |
| | | |
| | | <select id="buildingUnitHouseDetailAdmin" resultType="com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseDetailVO"> |
| | | SELECT |
| | | cmph.id, |
| | | cmv.`name` AS villageName, |
| | | cmph.floor, |
| | | cmph.unit_no, |
| | | cmph.house_no, |
| | | cmph.address, |
| | | cmph.`status`, |
| | | cmv.lat, |
| | | cmv.lng |
| | | FROM |
| | | com_mng_population_house AS cmph |
| | | LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmph.village_id |
| | | WHERE |
| | | cmph.id = #{houseId} |
| | | </select> |
| | | |
| | | <select id="getGridVillageBuildingPopulationList" resultType="com.panzhihua.common.model.vos.grid.PopulationListVO"> |
| | | SELECT |
| | | cmp.id, |
| | | cmphu.id AS housePopulationId, |
| | | cmp.sex, |
| | | cmp.`name`, |
| | | IFNULL( cmp.phone, '暂无' ) AS phone, |
| | | cmp.card_no, |
| | | cmpct.label, |
| | | cmp.address, |
| | | cmp.nation, |
| | | cmphu.create_at, |
| | | cmphu.relation_id, |
| | | cmp.political_outlook |
| | | FROM |
| | | com_mng_population_house_user AS cmphu |
| | | LEFT JOIN com_mng_population AS cmp ON cmp.id = cmphu.popul_id |
| | | LEFT JOIN com_mng_population_community_tags AS cmpct ON cmp.id = cmpct.population_id and community_id = #{communityId} |
| | | WHERE |
| | | cmphu.house_id = #{houseId} |
| | | <if test='relation != null '> |
| | | AND cmphu.relation = #{relation} |
| | | </if> |
| | | <if test='relationId != null '> |
| | | AND cmphu.relation_id = #{relationId} |
| | | </if> |
| | | group by id |
| | | </select> |
| | | |
| | | <select id="buildingVillageListAdmin" resultType="com.panzhihua.common.model.vos.community.ComMngVillageVO"> |
| | | SELECT |
| | | village_id, |
| | | alley, |
| | | house_num, |
| | | `name` |
| | | FROM |
| | | com_mng_village |
| | | WHERE |
| | | community_id = #{communityId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | ; |
| | | </update> |
| | | |
| | | <delete id="deletePopulationRelation"> |
| | | delete from com_mng_population_community_tags where community_id = #{communityId} and population_id in |
| | | <foreach item="item" collection="ids" separator="," open="(" close=")" index=""> |
| | | #{item} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | </mapper> |
| | |
| | | AND e.create_at <![CDATA[<=]]> #{screenEventDTO.endTime} |
| | | </if> |
| | | </select> |
| | | |
| | | <update id="updatePopulationUnit"> |
| | | update com_mng_population set unit_no = #{newUnitNo} where village_id = #{villageId} and floor = #{floor} and unit_no = #{oldUnitNo} |
| | | </update> |
| | | </mapper> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComMngPopulationHouseDAO"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComMngPopulationHouseDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="street_id" property="streetId" /> |
| | | <result column="community_id" property="communityId" /> |
| | | <result column="village_id" property="villageId" /> |
| | | <result column="alley" property="alley" /> |
| | | <result column="house_num" property="houseNum" /> |
| | | <result column="unit_no" property="unitNo" /> |
| | | <result column="floor" property="floor" /> |
| | | <result column="house_no" property="houseNo" /> |
| | | <result column="code" property="code" /> |
| | | <result column="address" property="address" /> |
| | | <result column="status" property="status" /> |
| | | <result column="purpose" property="purpose" /> |
| | | <result column="control_status" property="controlStatus" /> |
| | | <result column="is_empty" property="isEmpty" /> |
| | | <result column="construct_purpose" property="constructPurpose" /> |
| | | <result column="construct_area" property="constructArea" /> |
| | | <result column="path" property="path" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="update_at" property="updateAt" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, street_id, community_id, village_id, alley, house_num, unit_no, floor, house_no, code, address, status, purpose, control_status, is_empty, construct_purpose, construct_area, path, create_at, update_at |
| | | </sql> |
| | | |
| | | <update id="updateHouseUnit"> |
| | | update com_mng_population_house set unit_no = #{newUnitNo} where village_id = #{villageId} and floor = #{floor} and unit_no = #{oldUnitNo} |
| | | </update> |
| | | |
| | | <update id="updateUnitAll" parameterType="java.util.List"> |
| | | <foreach collection="houseList" item="item" index="index" separator=";"> |
| | | update com_mng_population_house |
| | | <set> |
| | | <if test="item.address != null and item.address != """> |
| | | `address` = #{item.address}, |
| | | </if> |
| | | <if test="item.path != null and item.path != """> |
| | | `path` = #{item.path}, |
| | | </if> |
| | | <if test="item.unitNo != null and item.unitNo != """> |
| | | `unit_no` = #{item.unitNo}, |
| | | </if> |
| | | `update_at` = NOW() |
| | | </set> |
| | | WHERE `id` = #{item.id} |
| | | </foreach> |
| | | </update> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComMngPopulationHouseUserDAO"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComMngPopulationHouseUserDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="popul_id" property="populId" /> |
| | | <result column="house_id" property="houseId" /> |
| | | <result column="relation_id" property="relationId" /> |
| | | <result column="relation" property="relation" /> |
| | | <result column="residence" property="residence" /> |
| | | <result column="start_at" property="startAt" /> |
| | | <result column="end_at" property="endAt" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="update_at" property="updateAt" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, popul_id, house_id, relation_id, relation, residence, start_at, end_at, create_at, update_at |
| | | </sql> |
| | | |
| | | <select id="getHouseUserIsRent" resultType="integer"> |
| | | select count(id) from com_mng_population where is_rent = 1 and id in |
| | | <foreach collection="ids" item="id" open="(" separator="," close=")" > |
| | | #{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComPbServiceTeamDao"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.ComPbServiceTeam" id="ComPbServiceTeamBaseResultMap"> |
| | | <result property="id" column="id"/> |
| | | <result property="name" column="name"/> |
| | | <result property="job" column="job"/> |
| | | <result property="jobTwo" column="job_two"/> |
| | | <result property="url" column="url"/> |
| | | <result property="createAt" column="create_at"/> |
| | | <result property="communityId" column="community_id"/> |
| | | <result property="jobResponsibilities" column="job_responsibilities"/> |
| | | <result property="phone" column="phone"/> |
| | | <result property="isReg" column="is_reg"/> |
| | | <result property="cardNo" column="card_no"/> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | e.grid_member_id, |
| | | su.image_url, |
| | | su.nick_name AS userName, |
| | | e.create_at, |
| | | e.happen_time as createAt, |
| | | e.urgent, |
| | | e.danger_level, |
| | | e.major, |
| | |
| | | |
| | | <select id="list" parameterType="com.panzhihua.common.model.query.visit.EventTasksQuery" resultType="com.panzhihua.common.model.vos.visit.AppVisitTasksVO"> |
| | | SELECT vt.id,vt.visiter_name,vt.grid_member,vt.grid_member_name,vt.grid_menber_tele,vt.visiter_id,vt.visiter_name,vt.visiter_tele,vt.dell_user_id,vt.dell_user_name,vt.submit_date,vt.cancel_time,vt.create_at,u.name as creator,vt.event_status,vt.visiter_address,vt.happent_lat_lng, |
| | | p.card_no_str,vt.exception,p.name,REPLACE(cmpct.label,',','#') |
| | | p.card_no_str,vt.exception,p.name |
| | | FROM event_visiting_tasks vt LEFT JOIN com_mng_population p ON vt.visiter_id = p.id |
| | | left join com_mng_population_community_tags AS cmpct on p.id = cmpct.population_id |
| | | left join sys_user u on vt.create_by = u.user_id |
| | | WHERE 1=1 |
| | | <if test = "query.visiterId !=null"> |
| | |
| | | SysUserVO getSysUserByPhone(@Param("phone") String phone); |
| | | |
| | | /** |
| | | * 根据手机号查询小程序用户数量 |
| | | * 根据手机号查询小程序用户id |
| | | * @param phone 手机号 |
| | | * @return 小程序用户数量 |
| | | * @return 小程序用户id |
| | | */ |
| | | Integer getSysUserByPhoneCount(@Param("phone") String phone); |
| | | Long getSysUserIdByPhone(@Param("phone") String phone); |
| | | |
| | | @Update("update sys_user u set u.phone=#{newphone} where u.phone=#{oldphone}") |
| | | void updateUserPhone(@Param("newphone") String newphone, @Param("oldphone") String oldphone); |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.constants.SecurityConstants; |
| | | import com.panzhihua.common.constants.TokenConstant; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | |
| | | import com.panzhihua.service_dangjian.service.ComPbServiceTeamService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | ComPbServiceTeamDO comPbServiceTeamDO = new ComPbServiceTeamDO(); |
| | | BeanUtils.copyProperties(comPbServiceTeamDTO, comPbServiceTeamDO); |
| | | comPbServiceTeamDO.setIsReg(2); |
| | | if (comPbMemberRoleDAO.getSysUserByPhoneCount(comPbServiceTeamDTO.getPhone()) > 0) { |
| | | Long userId = comPbMemberRoleDAO.getSysUserIdByPhone(comPbServiceTeamDTO.getPhone()); |
| | | if (nonNull(userId)) { |
| | | comPbServiceTeamDO.setIsReg(1); |
| | | } |
| | | int insert = comPbServiceTeamDAO.insert(comPbServiceTeamDO); |
| | | if (insert > 0) { |
| | | if (nonNull(userId)) { |
| | | String userKey = UserConstants.LOGIN_USER_INFO + userId; |
| | | Boolean hasKeyLoginUserInfo = stringRedisTemplate.hasKey(userKey); |
| | | if (hasKeyLoginUserInfo) { |
| | | ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); |
| | | String userInfo = valueOperations.get(userKey); |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(userInfo, LoginUserInfoVO.class); |
| | | loginUserInfoVO.setIsmemberrole(1); |
| | | loginUserInfoVO.setIsCommunityWorker(1); |
| | | userInfo = JSONObject.toJSONString(loginUserInfoVO); |
| | | valueOperations.set(userKey, userInfo, TokenConstant.EXPIRETIME_REFRESH * 60 * 60 * 1000); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | |
| | | id, phone, is_reg, name, sex, birth_time, position, position_two, job_responsibilities, photo_path, create_at, update_at, community_id |
| | | </sql> |
| | | |
| | | <select id="getSysUserByPhoneCount" resultType="integer"> |
| | | select count(user_id) from sys_user where phone=#{phone} and type=1 |
| | | <select id="getSysUserIdByPhone" resultType="long"> |
| | | SELECT user_id FROM sys_user WHERE phone = #{phone} AND `type` = 1 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.DataKanBansDto; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.DisableOrEnableConvenientMerchantDTO; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | public void judgeCommunityTeam(@RequestParam("openid") String openid) { |
| | | userService.judgeCommunityTeam(openid); |
| | | } |
| | | |
| | | /** |
| | | * 数据看板升级版 |
| | | * |
| | | * @return 运营后台数据看板升级版 |
| | | */ |
| | | @PostMapping("datakanbans") |
| | | public R dataKanBans(@RequestBody DataKanBansDto dataKanBansDto) { |
| | | return userService.dataKanBans(dataKanBansDto); |
| | | } |
| | | |
| | | /** |
| | | * 运营后台-用户数据统计汇总 |
| | | * @return 用户数据统计汇总 |
| | | */ |
| | | @GetMapping("community/statistics") |
| | | public R communityStatistics() { |
| | | return userService.communityStatistics(); |
| | | } |
| | | |
| | | @GetMapping("community/statistics/export") |
| | | public R communityStatisticsExport() { |
| | | return userService.communityStatisticsExport(); |
| | | } |
| | | } |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.*; |
| | |
| | | import com.panzhihua.common.model.vos.IndexDataKanbanVO; |
| | | import com.panzhihua.common.model.vos.IndexDataVO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; |
| | | import com.panzhihua.common.model.vos.community.screen.event.EventGridMemberVO; |
| | | import com.panzhihua.common.model.vos.grid.GridMemberVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.ComPbServiceTeamWishVO; |
| | |
| | | |
| | | List<DataKanbanDTO> selectCommunityUserOrder(); |
| | | |
| | | List<DataKanbanDTO> selectCommunityUserOrderMonth(); |
| | | |
| | | |
| | | DataKanbanDTO selectCommunityActiveUserOrder(Date date1); |
| | | |
| | | DataKanbanDTO selectCommunityAddUserOrder(Date date1); |
| | | |
| | | |
| | | IndexDataVO indexDataCommunityBackstage(Long communityId); |
| | |
| | | * @return 用户数量 |
| | | */ |
| | | Integer getCommunityTeamCount(@Param("phone") String phone); |
| | | |
| | | /** |
| | | * 查询西区所有街道列表以及统计人数 |
| | | * @return 西区所有街道列表以及统计人数 |
| | | */ |
| | | List<IndexUserStreetVo> getUserStreetList(); |
| | | |
| | | /** |
| | | * 查询街道下社区列表以及统计人数 |
| | | * @param streetId 街道id |
| | | * @return 社区列表以及统计人数 |
| | | */ |
| | | List<IndexUserCommunityVo> getUserCommunityList(@Param("streetId") Long streetId); |
| | | |
| | | /** |
| | | * 查询街道下社区注册人数统计数据导出 |
| | | * @return 社区注册人数统计数据导出 |
| | | */ |
| | | List<IndexUserStreetExcelExportVo> getUserCommunityExcelExport(); |
| | | } |
| | |
| | | |
| | | private String name; |
| | | private Integer num; |
| | | private Integer dayNum; |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.panzhihua.common.model.dtos.DataKanBansDto; |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import com.panzhihua.common.model.dtos.community.ExportUserDTO; |
| | | import com.panzhihua.common.model.dtos.community.NoticeReadDTO; |
| | |
| | | * @param openid 用户微信唯一标识 |
| | | */ |
| | | void judgeCommunityTeam(String openid); |
| | | |
| | | /** |
| | | * 数据看板升级版 |
| | | * |
| | | * @return 运营后台数据看板升级版 |
| | | */ |
| | | R dataKanBans(DataKanBansDto dataKanBansDto); |
| | | |
| | | /** |
| | | * 运营后台-用户数据统计汇总 |
| | | * @return 用户数据统计汇总 |
| | | */ |
| | | R communityStatistics(); |
| | | |
| | | R communityStatisticsExport(); |
| | | } |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import com.panzhihua.common.model.dtos.DataKanBansDto; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.service_user.dao.*; |
| | | import com.panzhihua.service_user.model.dos.*; |
| | | import org.apache.commons.lang.time.DateFormatUtils; |
| | |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.SystemmanagementConfigVO; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; |
| | | import com.panzhihua.common.model.vos.grid.GridMemberVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.GridMemberBuildingVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.ActivityManagerVO; |
| | |
| | | } |
| | | loginUserInfoVO.setIsmemberrole(2); |
| | | loginUserInfoVO.setIsFourMember(2); |
| | | loginUserInfoVO.setIsCommunityWorker(2); |
| | | // 志愿者状态 |
| | | String phone = sysUserDO.getPhone(); |
| | | Long userCommunityId = sysUserDO.getCommunityId(); |
| | |
| | | Integer isSysUser = userDao.selectCountSysUser(phone, userCommunityId); |
| | | if (countTeam != null && countTeam > 0) { |
| | | loginUserInfoVO.setIsmemberrole(1); |
| | | loginUserInfoVO.setIsCommunityWorker(1); |
| | | } else if (selectCountMemberRole != null && selectCountMemberRole > 0) { |
| | | loginUserInfoVO.setIsmemberrole(1); |
| | | } else if (isSysUser != null && isSysUser > 0) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 数据看板升级版 |
| | | * |
| | | * @return 运营后台数据看板升级版 |
| | | */ |
| | | @Override |
| | | public R dataKanBans(DataKanBansDto dataKanBansDto){ |
| | | IndexDataKanbanVO indexDataKanbanVO = userDao.selectIndexDataKanban(); |
| | | List<String> communityUserX = new ArrayList<>(); |
| | | List<Integer> communityUserY = new ArrayList<>(); |
| | | |
| | | List<String> communityActiveUserX = new ArrayList<>(); |
| | | List<Integer> communityActiveUserY = new ArrayList<>(); |
| | | List<Integer> communityActiveUserZ = new ArrayList<>(); |
| | | |
| | | List<DataKanbanDTO> dataKanbanDTOS = null; |
| | | if(dataKanBansDto.getType() != null && dataKanBansDto.getType().equals(DataKanBansDto.type.by)){ |
| | | dataKanbanDTOS = userDao.selectCommunityUserOrderMonth(); |
| | | }else{ |
| | | dataKanbanDTOS = userDao.selectCommunityUserOrder(); |
| | | } |
| | | if (!ObjectUtils.isEmpty(dataKanbanDTOS)) { |
| | | dataKanbanDTOS.forEach(dataKanbanDTO -> { |
| | | communityUserX.add(dataKanbanDTO.getName()); |
| | | communityUserY.add(dataKanbanDTO.getNum()); |
| | | }); |
| | | } |
| | | |
| | | // 获取最近二十天数据 |
| | | List<Date> serverndays = com.panzhihua.common.utlis.DateUtils.getOldDays(); |
| | | serverndays.forEach(date -> { |
| | | // 查询社区活动数量 |
| | | DataKanbanDTO dataKanbanDTO = userDao.selectCommunityAddUserOrder(date); |
| | | communityActiveUserX.add(DateFormatUtils.format(date, "MM-dd")); |
| | | communityActiveUserY.add(dataKanbanDTO.getNum()); |
| | | communityActiveUserZ.add(dataKanbanDTO.getDayNum()); |
| | | }); |
| | | indexDataKanbanVO.setCommunityActiveUserX(communityActiveUserX); |
| | | indexDataKanbanVO.setCommunityAddUserY(communityActiveUserY); |
| | | indexDataKanbanVO.setCommunityActiveUserY(communityActiveUserZ); |
| | | indexDataKanbanVO.setCommunityUserX(communityUserX); |
| | | indexDataKanbanVO.setCommunityUserY(communityUserY); |
| | | return R.ok(indexDataKanbanVO); |
| | | } |
| | | |
| | | /** |
| | | * 运营后台-用户数据统计汇总 |
| | | * @return 用户数据统计汇总 |
| | | */ |
| | | @Override |
| | | public R communityStatistics(){ |
| | | //返回结果数据 |
| | | IndexUserStatisticsVo userStatisticsVo = new IndexUserStatisticsVo(); |
| | | //查询所有街道 |
| | | List<IndexUserStreetVo> streetList = userDao.getUserStreetList(); |
| | | streetList.forEach(street -> { |
| | | List<IndexUserCommunityVo> communityList = userDao.getUserCommunityList(street.getStreetId()); |
| | | street.setCommunityList(communityList); |
| | | }); |
| | | userStatisticsVo.setStreetList(streetList); |
| | | return R.ok(userStatisticsVo); |
| | | } |
| | | |
| | | @Override |
| | | public R communityStatisticsExport(){ |
| | | return R.ok(userDao.getUserCommunityExcelExport()); |
| | | } |
| | | } |
| | |
| | | select t.* from ( |
| | | SELECT |
| | | a.`name`, |
| | | COUNT(u.user_id)num |
| | | COUNT(u.user_id)num, |
| | | (SELECT count( user_id ) FROM sys_user WHERE type = 1 and community_id = a.community_id |
| | | AND last_login_time > DATE_FORMAT( date_sub( SYSDATE(), INTERVAL 0 DAY ), '%Y-%m-%d 00:00:00')) as dayNum |
| | | FROM |
| | | com_act a |
| | | LEFT JOIN sys_user u ON a.community_id = u.community_id and u.type=1 |
| | | GROUP BY a.community_id)t ORDER BY t.num desc |
| | | </select> |
| | | |
| | | <select id="selectCommunityUserOrderMonth" resultType="com.panzhihua.service_user.model.dtos.DataKanbanDTO"> |
| | | select t.* from ( |
| | | SELECT |
| | | a.`name`, |
| | | COUNT(u.user_id)num, |
| | | (SELECT count( user_id ) FROM sys_user WHERE type = 1 and community_id = a.community_id |
| | | AND last_login_time > DATE_FORMAT( date_sub( SYSDATE(), INTERVAL 0 DAY ), '%Y-%m-%d 00:00:00')) as dayNum |
| | | FROM |
| | | com_act a |
| | | LEFT JOIN sys_user u ON a.community_id = u.community_id |
| | | and u.type=1 and u.create_at <![CDATA[ >= ]]> DATE_SUB(DATE_FORMAT(CURDATE(),'%Y-%m-%d 00:00:00'),INTERVAL 0 DAY) |
| | | GROUP BY a.community_id)t ORDER BY t.num desc |
| | | </select> |
| | | |
| | |
| | | com_act_activity a |
| | | WHERE |
| | | DATE_FORMAT( #{date1}, '%Y-%m-%d' )= DATE_FORMAT( a.create_at,'%Y-%m-%d') |
| | | </select> |
| | | |
| | | <select id="selectCommunityAddUserOrder" resultType="com.panzhihua.service_user.model.dtos.DataKanbanDTO"> |
| | | select count(user_id) as num, |
| | | (SELECT count( user_id ) FROM sys_user WHERE type = 1 |
| | | AND last_login_time <![CDATA[ >= ]]> DATE_FORMAT( #{date1}, '%Y-%m-%d 00:00:00') |
| | | AND last_login_time <![CDATA[ <= ]]> DATE_FORMAT( #{date1}, '%Y-%m-%d 23:59:59')) as dayNum from sys_user as su |
| | | where su.create_at <![CDATA[ >= ]]> DATE_SUB(DATE_FORMAT(#{date1},'%Y-%m-%d 00:00:00'),INTERVAL 0 DAY) |
| | | and su.create_at <![CDATA[ <= ]]> DATE_SUB(DATE_FORMAT(#{date1},'%Y-%m-%d 23:59:59'),INTERVAL 0 DAY) |
| | | and su.type = 1 |
| | | </select> |
| | | |
| | | <update id="gridMemberEditStatus"> |
| | |
| | | select count(id) from com_pb_service_team where is_reg = 2 and phone = #{phone} |
| | | </select> |
| | | |
| | | <select id="getUserStreetList" resultType="com.panzhihua.common.model.vos.community.IndexUserStreetVo"> |
| | | SELECT |
| | | street_id, |
| | | `name`,( |
| | | SELECT |
| | | count( user_id ) |
| | | FROM |
| | | sys_user AS su |
| | | LEFT JOIN com_act AS ca ON ca.community_id = su.community_id |
| | | WHERE |
| | | type = 1 |
| | | AND ca.street_id = cs.street_id |
| | | ) AS userNum |
| | | FROM |
| | | `com_street` AS cs |
| | | order by userNum desc |
| | | </select> |
| | | |
| | | <select id="getUserCommunityList" resultType="com.panzhihua.common.model.vos.community.IndexUserCommunityVo"> |
| | | SELECT |
| | | ca.community_id, |
| | | ca.`name`, |
| | | count( user_id ) as userNum |
| | | FROM |
| | | sys_user as su |
| | | left join com_act as ca on ca.community_id = su.community_id |
| | | WHERE |
| | | type = 1 |
| | | AND ca.street_id = #{streetId} |
| | | group by ca.community_id |
| | | order by userNum desc |
| | | </select> |
| | | |
| | | <select id="getUserCommunityExcelExport" resultType="com.panzhihua.common.model.vos.community.IndexUserStreetExcelExportVo"> |
| | | SELECT |
| | | cs.`name` AS streetName, |
| | | ca.`name` AS communityName, |
| | | ( |
| | | SELECT |
| | | count( user_id ) |
| | | FROM |
| | | sys_user AS su1 |
| | | LEFT JOIN com_act AS ca1 ON ca1.community_id = su1.community_id |
| | | WHERE |
| | | su1.type = 1 |
| | | AND su1.community_id IS NOT NULL |
| | | AND ca1.street_id = ca.street_id |
| | | ) AS streetNum, |
| | | count( user_id ) AS userNum |
| | | FROM |
| | | sys_user AS su |
| | | LEFT JOIN com_act AS ca ON ca.community_id = su.community_id |
| | | LEFT JOIN com_street AS cs ON cs.street_id = ca.street_id |
| | | WHERE |
| | | su.type = 1 |
| | | AND su.community_id IS NOT NULL |
| | | GROUP BY |
| | | ca.community_id |
| | | ORDER BY |
| | | ca.street_id DESC, |
| | | userNum DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | log.info("执行结果【{}】", r.toString()); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | @XxlJob("timedTaskHouseJobHandler") |
| | | public ReturnT<String> timedTaskHouseJobHandler(String param) { |
| | | log.info("实有房屋定时任务修复数据"); |
| | | R r = communityService.timedTaskHouseJobHandler(); |
| | | log.info("执行结果【{}】", r.toString()); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | } |
| | |
| | | noLoginUrl.add("/api/applets/convenient/merchant/incr-view"); |
| | | noLoginUrl.add("/api/applets/convenient/product/incr-view"); |
| | | noLoginUrl.add("/api/shopbackstage/convenient/upload/file"); |
| | | noLoginUrl.add("/api/applets/warehouse/donates/page"); |
| | | noLoginUrl.add("/api/applets/warehouse/donates/get"); |
| | | if (noLoginUrl.contains(requestURI)) { |
| | | List<SimpleGrantedAuthority> authorities = new ArrayList<>(); |
| | | authorities.add(new SimpleGrantedAuthority(SecurityConstants.ROLE_APPLETS)); |