| | |
| | | @ApiModelProperty("理由") |
| | | private String reason; |
| | | |
| | | /** |
| | | * 领取图片 |
| | | */ |
| | | @ApiModelProperty("领取图片") |
| | | private String receiveUrl; |
| | | |
| | | @ApiModelProperty("类型 1 content 2其他") |
| | | private Integer type; |
| | | |
| | |
| | | public R update(@RequestBody ComActWarehouseApplyVO comActWarehouseApplyVO) { |
| | | ComActWarehouseApply comActWarehouseApply=new ComActWarehouseApply(); |
| | | BeanUtils.copyProperties(comActWarehouseApplyVO,comActWarehouseApply); |
| | | return R.ok(this.comActWarehouseApplyService.update(comActWarehouseApply)); |
| | | return this.comActWarehouseApplyService.update(comActWarehouseApply); |
| | | } |
| | | |
| | | /** |
| | |
| | | public R update(ComActWarehouseApply comActWarehouseApply) { |
| | | ComActWarehouseApplyVO comActWarehouseApply1=this.comActWarehouseApplyDao.selectById(comActWarehouseApply.getId()); |
| | | if(comActWarehouseApply.getStatus().equals(ComActWarehouseApplyVO.status.ylq)){ |
| | | ComActWarehouseDonates comActWarehouseDonates=this.comActWarehouseDonatesDao.selectById(comActWarehouseApply.getGoodsId()); |
| | | ComActWarehouseDonates comActWarehouseDonates=this.comActWarehouseDonatesDao.selectById(comActWarehouseApply1.getGoodsId()); |
| | | if(comActWarehouseDonates!=null&&comActWarehouseDonates.getSurplusQuantity()>0){ |
| | | comActWarehouseDonates.setSurplusQuantity(comActWarehouseDonates.getSurplusQuantity()-1); |
| | | this.comActWarehouseDonatesDao.updateById(comActWarehouseDonates); |
| | | ComActWarehouseOperation comActWarehouseOperation=new ComActWarehouseOperation(); |
| | | comActWarehouseOperation.setGoodsId(comActWarehouseApply.getGoodsId()); |
| | | comActWarehouseOperation.setCreateTime(new Date()); |
| | | comActWarehouseOperation.setContent("爱心传递给了"+comActWarehouseApply1.getApplyName().charAt(0)+"**,"+"减少了"+comActWarehouseApply1.getReason()+"的困难,谢谢你的帮助"); |
| | | comActWarehouseOperation.setType(ComActWarehouseOperation.type.xs); |
| | | comActWarehouseOperation.setApplyId(comActWarehouseApply.getId()); |
| | | this.comActWarehouseOperationDao.insert(comActWarehouseOperation); |
| | |
| | | </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 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 |
| | | 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 |
| | | t.type = 2 and t.goods_id=#{commonPage.paramId} |
| | | </where> |
| | | order by t.create_time desc |
| | | </select> |