Merge remote-tracking branch 'origin/test' into test
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); |
| | | } |
| | | |
| | | } |
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.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("联系电话") |
| | | @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 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 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("签收时间-起") |
| | | private Date signingAtBegin; |
| | | |
| | | @ApiModelProperty("签收时间-止") |
| | | 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 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("签收时间-起") |
| | | private Date signingAtBegin; |
| | | |
| | | @ApiModelProperty("签收时间-止") |
| | | 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; |
| | | } |
| | |
| | | @ApiModelProperty("是否四长四员 1.是 2.否") |
| | | private Integer isFourMember; |
| | | |
| | | @ApiModelProperty("是否社区工作人员 1.是 2.否") |
| | | private Integer isCommunityWorker; |
| | | |
| | | } |
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.ExcelProperty; |
| | | import com.alibaba.excel.converters.string.StringImageConverter; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | 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; |
| | | |
| | | /** |
| | | * 领取图片 |
| | | */ |
| | | @ExcelProperty(value = "领取图片",index = 11) |
| | | 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; |
| | | |
| | | /** |
| | | * 物品图片 |
| | | */ |
| | | @ExcelProperty(value = "物品图片",index = 5) |
| | | private URL image; |
| | | } |
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 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) { |
| | | this.isAnonymous = nonNull(isAnonymous) && isAnonymous.equals("1") ? "是" : "否"; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | if (nonNull(status)) { |
| | | switch (status) { |
| | | case "1": |
| | | this.status = "待签收"; |
| | | break; |
| | | case "2": |
| | | this.status = "已签收"; |
| | | break; |
| | | default: |
| | | this.status = "已取消"; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
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; |
| | | } |
| | |
| | | |
| | | 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.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; |
| | |
| | | */ |
| | | @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); |
| | | } |
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) { |
| | | 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); |
| | | } |
| | | } |
| | |
| | | <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> |
| | | |
| | | |
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)); |
| | | } |
| | | } |
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); |
| | | } |
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; |
| | | |
| | | } |
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); |
| | | } |
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()>=comActWarehouseApply.getGoodsNum()){ |
| | | comActWarehouseDonates.setSurplusQuantity(comActWarehouseDonates.getSurplusQuantity()-comActWarehouseApply.getGoodsNum()); |
| | | this.comActWarehouseDonatesDao.updateById(comActWarehouseDonates); |
| | | ComActWarehouseOperation comActWarehouseOperation=new ComActWarehouseOperation(); |
| | | comActWarehouseOperation.setGoodsId(comActWarehouseApply.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(); |
| | | 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); |
| | | } |
| | | } |
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); |
| | | } |
| | | |
| | | } |
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},'%')) |
| | | </if> |
| | | <if test="commonPage.userId !=null"> |
| | | and t.apply_user_id = #{commonPage.userId} |
| | | </if> |
| | | </where> |
| | | order by t.actual_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 =#{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> |
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> |
| | |
| | | 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> |
| | |
| | | } |
| | | 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) { |
| | |
| | | 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)); |