| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ltkj.common.core.domain.entity.SysDictData; |
| | | import com.ltkj.common.core.redis.RedisCache; |
| | | import com.ltkj.common.utils.SecurityUtils; |
| | | import com.ltkj.common.utils.StringUtils; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | |
| | | private ITjCustomerService tjCustomerService; |
| | | @Resource |
| | | private ISysDictDataService dictDataService; |
| | | |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | /** |
| | | * 查询收费员日结列表 |
| | | */ |
| | |
| | | collectorDetail.setAccountId(tjTollCollector.getAccountId()); |
| | | collectorDetailService.save(collectorDetail); |
| | | } |
| | | for (String id : tjTollCollector.getIds()) { |
| | | TjFlowingWater water = tjFlowingWaterService.getById(id); |
| | | water.setIsCheckout("Y"); |
| | | tjFlowingWaterService.updateById(water); |
| | | if(redisCache.hasKey("longList"+tjTollCollector.getTollCollectorId())){ |
| | | List<Long> longList= redisCache.getCacheObject("longList" + tjTollCollector.getTollCollectorId()); |
| | | for (Long id : longList) { |
| | | TjFlowingWater water = tjFlowingWaterService.getById(id); |
| | | water.setIsCheckout(tjTollCollector.getId()); |
| | | water.setUpdateTime(new Date()); |
| | | tjFlowingWaterService.updateById(water); |
| | | } |
| | | redisCache.deleteObject("longList"+tjTollCollector.getTollCollectorId()); |
| | | } |
| | | return AjaxResult.success(accountId); |
| | | } |
| | |
| | | if (!userId.equals(tollCollectorId)) { |
| | | return AjaxResult.error("非当前用户禁止操作"); |
| | | } |
| | | // LambdaQueryWrapper<TjTollCollector> wqq = new LambdaQueryWrapper<>(); |
| | | // wqq.orderByDesc(TjTollCollector::getCreateTime); |
| | | // List<TjTollCollector> list = tjTollCollectorService.list(wqq); |
| | | // if (null != list && list.size() > 0) { |
| | | // TjTollCollector collector = list.get(0); |
| | | // if (null != collector && !collector.getId().equals(id)) { |
| | | // return AjaxResult.error("请撤销最后一次结账记录"); |
| | | // } |
| | | // } |
| | | String ids = tjTollCollectorService.getTjTollCollectorByLastOne(); |
| | | if (null != ids && !id.equals(ids)) { |
| | | return AjaxResult.error("请撤销最后一次结账记录"); |
| | | } |
| | | // TjTollCollector collector = tjTollCollectorService.getById(id); |
| | | TjTollCollector collector = tjTollCollectorService.getTjTollCollectorById(id); |
| | | if (null != collector) { |
| | | if("Y".equals(collector.getIsHz())){ |
| | | if(null !=collector.getIsHz()){ |
| | | return AjaxResult.error("该账单已汇总不可撤销"); |
| | | } |
| | | LambdaQueryWrapper<TjTollCollectorDetail> wq = new LambdaQueryWrapper<>(); |
| | |
| | | collectorDetailService.remove(wq); |
| | | tjTollCollectorService.removeById(collector); |
| | | LambdaQueryWrapper<TjFlowingWater> wqq1 = new LambdaQueryWrapper<>(); |
| | | wqq1.eq(TjFlowingWater::getIsCheckout, "Y"); |
| | | wqq1.between(TjFlowingWater::getUpdateTime, collector.getAccountBeginTime(), collector.getAccountEndTime()); |
| | | wqq1.eq(TjFlowingWater::getIsCheckout,id); |
| | | List<TjFlowingWater> waterList = tjFlowingWaterService.list(wqq1); |
| | | for (TjFlowingWater tjFlowingWater : waterList) { |
| | | tjFlowingWater.setIsCheckout("N"); |
| | | tjFlowingWater.setIsCheckout(null); |
| | | tjFlowingWater.setUpdateTime(new Date()); |
| | | tjFlowingWaterService.updateById(tjFlowingWater); |
| | | } |
| | | return AjaxResult.success("该账单已成功撤销"); |
| | |
| | | wq.orderByDesc(TjTollCollector::getAccountEndTime); |
| | | List<TjTollCollector> list = tjTollCollectorService.list(wq); |
| | | if (null != list && list.size() > 0) return success(list.get(0).getAccountEndTime()); |
| | | String dateStr = "1970-01-01 00:00:00"; |
| | | String dateStr = "2023-10-01 00:00:00"; |
| | | Date date = DateUtil.parse(dateStr, "yyyy-MM-dd HH:mm:ss"); |
| | | return AjaxResult.success(date); |
| | | } |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | LambdaQueryWrapper<TjFlowingWater> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjFlowingWater::getTollCollectorId, userId); |
| | | wq.eq(TjFlowingWater::getIsCheckout, "N"); |
| | | wq.isNull(TjFlowingWater::getIsCheckout); |
| | | wq.ne(TjFlowingWater::getPayStasus,0); |
| | | wq.between(TjFlowingWater::getUpdateTime, beginTime, endTime); |
| | | Page<TjFlowingWater> page =new Page<>(pageNum,pageSize); |
| | | Page<TjFlowingWater> waterPage = tjFlowingWaterService.page(page, wq); |
| | | |
| | | //缓存所统计的流水id |
| | | List<Long> longList = tjFlowingWaterService.getFlowingWaterIdList(userId, beginTime, endTime); |
| | | redisCache.setCacheObject("longList"+userId,longList); |
| | | |
| | | List<TjFlowingWater> list1 = waterPage.getRecords(); |
| | | List<TjFlowingWater> list = tjFlowingWaterService.list(wq); |
| | | for (TjFlowingWater tjFlowingWater : list1) { |