| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.activity.dao.ActivitySignAwardSetDao; |
| | |
| | | import com.matrix.system.shopXcx.bean.ShopActivities; |
| | | import com.matrix.system.shopXcx.bean.ShopDeliveryInfo; |
| | | import com.matrix.system.shopXcx.bean.ShopLogisticsInfo; |
| | | import com.matrix.system.shopXcx.bean.ShopReceiveAddress; |
| | | import com.matrix.system.shopXcx.dao.ShopActivitiesDao; |
| | | import com.matrix.system.shopXcx.dao.ShopDeliveryInfoDao; |
| | | import com.matrix.system.shopXcx.dao.ShopLogisticsInfoDao; |
| | | import com.matrix.system.shopXcx.dao.ShopReceiveAddressDao; |
| | | import com.matrix.system.shopXcx.vo.SalesOrderVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | @Autowired |
| | | private ShopLogisticsInfoDao shopLogisticsInfoDao; |
| | | @Autowired |
| | | private ShopReceiveAddressDao shopReceiveAddressDao; |
| | | |
| | | @Autowired |
| | | private WxShopLogisticsQueryService wxShopLogisticsQueryService; |
| | |
| | | seeAwardTextDto.setUserId(loginUser.getId()); |
| | | seeAwardTextDto.setCompanyId(loginUser.getCompanyId()); |
| | | SeeAwardTextVo seeAwardTextVO = activitySignReceiveRecordDao.selectSeeAwardTextVOById(seeAwardTextDto); |
| | | if(ObjectUtil.isEmpty(seeAwardTextVO)){ |
| | | return AjaxResult.buildFailInstance("奖品无法查看物流配送信息"); |
| | | } |
| | | long receiveId = seeAwardTextVO.getId(); |
| | | |
| | | //获取核销记录的ID |
| | | ActivitySignWriteoff activitySignWriteoff = activitySignWriteoffDao.selectActivitySignWriteoffByUserIDAndReceiveId(loginUser.getId(),receiveId); |
| | | Integer logisticsId = activitySignWriteoff.getLogisticsId(); |
| | | ShopDeliveryInfo shopDeliveryInfo = shopDeliveryInfoDao.selectById(logisticsId); |
| | | if(ObjectUtil.isNotEmpty(shopDeliveryInfo)){ |
| | | //查看物流信息 |
| | | wxShopLogisticsQueryService.selectLogisticsInfo(shopDeliveryInfo); |
| | | List<ShopLogisticsInfo> shopLogisticsInfos = shopLogisticsInfoDao.selectByDelieryId(shopDeliveryInfo.getId()); |
| | | seeAwardTextVO.setShopLogisticsInfos(shopLogisticsInfos); |
| | | if(ObjectUtil.isNotEmpty(activitySignWriteoff)){ |
| | | Integer logisticsId = activitySignWriteoff.getLogisticsId(); |
| | | ShopDeliveryInfo shopDeliveryInfo = shopDeliveryInfoDao.selectById(logisticsId); |
| | | if(ObjectUtil.isNotEmpty(shopDeliveryInfo)){ |
| | | //查看物流信息 |
| | | wxShopLogisticsQueryService.selectLogisticsInfo(shopDeliveryInfo); |
| | | List<ShopLogisticsInfo> shopLogisticsInfos = shopLogisticsInfoDao.selectByDelieryId(shopDeliveryInfo.getId()); |
| | | seeAwardTextVO.setShopLogisticsInfos(shopLogisticsInfos); |
| | | } |
| | | } |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(seeAwardTextVO); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 物流配送收货地址保存 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "物流配送收货地址保存", notes = "") |
| | | @GetMapping(value = "logisticsInsureAddress/{addressId}/{receiveId}") |
| | | @ResponseBody |
| | | public AjaxResult logisticsInsureAddress(@PathVariable("addressId") int addressId,@PathVariable("receiveId") long receiveId) { |
| | | ShopReceiveAddress shopReceiveAddress = shopReceiveAddressDao.selectById(addressId); |
| | | if(ObjectUtil.isEmpty(shopReceiveAddress)){ |
| | | return AjaxResult.buildFailInstance("收货地址无效"); |
| | | } |
| | | ActivitySignReceiveRecord activitySignReceiveRecord = activitySignReceiveRecordDao.selectById(receiveId); |
| | | //该奖品不是待领取状态 |
| | | if (ActivitySignReceiveRecord.STATE_ING != activitySignReceiveRecord.getState()) { |
| | | return AjaxResult.buildFailInstance("该奖品不是待领取状态"); |
| | | } |
| | | activitySignReceiveRecord.setConsigneeAddress(shopReceiveAddress.getAddrRegion()+"-"+shopReceiveAddress.getAddrDetailaddr()+"-"+shopReceiveAddress.getDormitory()); |
| | | activitySignReceiveRecord.setConsignee(shopReceiveAddress.getAddrLiaisonman()); |
| | | activitySignReceiveRecord.setConsigneePhone(shopReceiveAddress.getAddrTelephone()); |
| | | activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_THREE); |
| | | activitySignReceiveRecordDao.updateById(activitySignReceiveRecord); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "设置成功!"); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "物流配送确认收货", notes = "") |
| | | @GetMapping(value = "logisticsInsureById/{awardId}") |
| | | @GetMapping(value = "logisticsInsureById/{receiveId}") |
| | | @ResponseBody |
| | | public AjaxResult logisticsInsureById(@PathVariable("awardId") long awardId) { |
| | | ActivitySignReceiveRecord activitySignReceiveRecord = activitySignReceiveRecordDao.selectById(awardId); |
| | | public AjaxResult logisticsInsureById(@PathVariable("receiveId") long receiveId) { |
| | | ActivitySignReceiveRecord activitySignReceiveRecord = activitySignReceiveRecordDao.selectById(receiveId); |
| | | //如果不是待收货状态 |
| | | if (ActivitySignReceiveRecord.STATE_FOUR != activitySignReceiveRecord.getState()) { |
| | | throw new GlobleException("该奖品不是待收货状态!"); |
| | | return AjaxResult.buildFailInstance("该奖品不是待收货状态"); |
| | | } |
| | | activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); |
| | | activitySignReceiveRecordDao.updateById(activitySignReceiveRecord); |