| | |
| | | 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; |
| | | import com.ltkj.framework.config.UserHoder; |
| | | import com.ltkj.hosp.domain.*; |
| | | import com.ltkj.hosp.service.*; |
| | | import com.ltkj.hosp.vodomain.ChargeStatisticsVo; |
| | |
| | | private ITjCustomerService tjCustomerService; |
| | | @Resource |
| | | private ISysDictDataService dictDataService; |
| | | |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | /** |
| | | * 查询收费员日结列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('hosp:collector:list')") |
| | | //@PreAuthorize("@ss.hasPermi('hosp:collector:list')") |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "查询收费员日结列表") |
| | | public AjaxResult list(@RequestParam(required = false) @ApiParam(value = "收费员id") String tollCollectorId, |
| | |
| | | if (null != accountBeginTime && null != accountEndTime) { |
| | | wqq.between(TjTollCollector::getCreateTime, accountBeginTime, accountEndTime); |
| | | } else { |
| | | DateTime dateTime = DateUtil.lastWeek(); |
| | | wqq.between(TjTollCollector::getCreateTime, DateUtil.lastWeek(),DateUtil.date()); |
| | | } |
| | | wqq.orderByDesc(TjTollCollector::getCreateTime); |
| | |
| | | /** |
| | | * 导出收费员日结列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('hosp:collector:export')") |
| | | //@PreAuthorize("@ss.hasPermi('hosp:collector:export')") |
| | | @Log(title = "收费员日结", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | @ApiOperation(value = "导出收费员日结列表") |
| | |
| | | /** |
| | | * 获取收费员日结详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('hosp:collector:query')") |
| | | // @PreAuthorize("@ss.hasPermi('hosp:collector:query')") |
| | | @GetMapping(value = "/{id}") |
| | | @ApiOperation(value = "获取收费员日结详细信息") |
| | | public AjaxResult getInfo(@PathVariable("id") String id) { |
| | |
| | | /** |
| | | * 点击结算 新增收费员日结 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('hosp:collector:add')") |
| | | //@PreAuthorize("@ss.hasPermi('hosp:collector:add')") |
| | | @Log(title = "收费员日结", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | @ApiOperation(value = "点击结算 新增收费员日结") |
| | |
| | | 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); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("@ss.hasPermi('hosp:collector:remove')") |
| | | //@PreAuthorize("@ss.hasPermi('hosp:collector:remove')") |
| | | @DeleteMapping("/removeTjTollCollectorById") |
| | | @ApiOperation(value = "收费员撤销账单操作接口") |
| | | public AjaxResult removeTjTollCollectorById(@RequestParam @ApiParam(value = "结账id") String id, |
| | |
| | | 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(null !=collector.getIsHz()){ |
| | | return AjaxResult.error("该账单已汇总不可撤销"); |
| | | } |
| | | LambdaQueryWrapper<TjTollCollectorDetail> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjTollCollectorDetail::getAccountId, collector.getAccountId()); |
| | | 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()); |
| | | return AjaxResult.success("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) { |
| | |
| | | List<Map<String, Object>> cc = new ArrayList<>(); |
| | | //统计总集合 |
| | | //付款方式 |
| | | Map<Long, List<TjFlowingWater>> m = list.stream().collect(Collectors.groupingBy(TjFlowingWater::getPayType)); |
| | | Map<Long, List<TjFlowingWater>> m = list.stream().filter(item-> StringUtils.isNotNull(item.getPayType())).collect(Collectors.groupingBy(TjFlowingWater::getPayType)); |
| | | BigDecimal zshoukuan = new BigDecimal("0.00"); |
| | | BigDecimal ztuikuan = new BigDecimal("0.00"); |
| | | BigDecimal zyingjiao = new BigDecimal("0.00"); |