From 4d1cc2fd7553f3c648da150971cd4a87c282f5ad Mon Sep 17 00:00:00 2001 From: zjh <1084500556@qq.com> Date: 星期二, 17 十月 2023 09:06:44 +0800 Subject: [PATCH] zjh 2023/10/17--1 --- ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjSummaryController.java | 159 +++++++++++++++++ ltkj-admin/src/main/java/com/ltkj/web/jmreport/JimuReportTokenService.java | 11 ltkj-framework/src/main/java/com/ltkj/framework/web/service/SysLoginService.java | 2 ltkj-hosp/src/main/java/com/ltkj/hosp/domain/DictHosp.java | 2 ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java | 62 ++++++ ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java | 92 ++++++---- ltkj-admin/src/main/resources/application.yml | 7 ltkj-hosp/src/main/java/com/ltkj/hosp/service/ITjSummaryService.java | 12 + ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjTollCollectorController.java | 12 + ltkj-framework/src/main/java/com/ltkj/framework/config/SecurityConfig.java | 2 ltkj-admin/src/test/java/zjhTest.java | 7 ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjTollCollector.java | 3 ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjSummaryMapper.java | 14 + ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjSummary.java | 47 +++++ ltkj-admin/src/main/java/com/ltkj/web/jmreport/JimuController.java | 2 ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjSummaryServiceImpl.java | 16 + ltkj-admin/src/main/java/com/ltkj/web/controller/system/DictHospController.java | 35 ++- ltkj-admin/src/main/resources/application-druid.yml | 6 ltkj-hosp/src/main/java/com/ltkj/hosp/service/TjAsyncService.java | 4 ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysLoginController.java | 2 ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjNewFlowingWaterController.java | 16 + 21 files changed, 431 insertions(+), 82 deletions(-) diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java index 78e004d..8bf3764 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java @@ -7,6 +7,7 @@ import com.ltkj.common.core.domain.entity.SysUser; import com.ltkj.common.core.redis.RedisCache; import com.ltkj.common.utils.StringUtils; +import com.ltkj.framework.config.MatchUtils; import com.ltkj.hosp.domain.*; import com.ltkj.hosp.service.*; import com.ltkj.hosp.vodomain.AddNewReservationConfirm; @@ -81,6 +82,12 @@ private ITjAdviceService tjAdviceService; @Resource private ISysUserService userService; + @Resource + private IJimuOnlineReportService reportService; + @Resource + private ITjDwDeptService dwDeptService; + @Resource + private ITjPrintOrderService printOrderService; @Override @@ -903,13 +910,54 @@ redisCache.setCacheMapValue("updateCheckType"+tjNum,tjNum,getAjaxResult(tjNum)); } -// @Override -// @Async("async") -// public void addRedis(List<TjCustomer> customers) { -// for (TjCustomer customer : customers) { -// redisCache.setCacheMapValue("updateCheckType"+customer.getTjNumber(),customer.getTjNumber(),getAjaxResult(customer.getTjNumber())); -// } -// } + @Override + @Async("async") + public void getPrintOrderList(List<TjOrder> list) { + + redisCache.setCacheMapValue("getPrintOrderList","0",extracted(0, list)); + redisCache.setCacheMapValue("getPrintOrderList","1",extracted(1, list)); + + } + + private List<TjOrder> extracted(Integer type, List<TjOrder> list) { + List<TjOrder> list1=new ArrayList<>(); + for (TjOrder order : list) { + TjCustomer tjCustomer = tjCustomerService.selectTjCustomerByCusId(order.getUserId()); + if (null != tjCustomer) { + order.setTjCustomerSex(tjCustomer.getCusSex()); + order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); + order.setGrMoBanId(reportService.getGrMoBanIds()); + order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); + if(null!=tjCustomer.getCusPhone())order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); + if(null!=tjCustomer.getCusIdcard())order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); + } + String firmId = order.getFirmId(); + if (firmId != null && null != compService.selectDictCompByDrugManufacturerId(String.valueOf(order.getFirmId()))) { + order.setDictCompName(compService.selectDictCompByDrugManufacturerId(String.valueOf(order.getFirmId())).getCnName()); + } + if (null != order.getPacId()) { + if (null != tjPackageService.getById(order.getPacId())) { + order.setPacName(tjPackageService.getById(order.getPacId()).getPacName()); + } + if (null != dwDeptService.getById(order.getPacId())) { + order.setPacName(dwDeptService.getById(order.getPacId()).getDwDeptName()); + } + } + //浠庢墦鍗拌褰曟煡鍑烘渶鏂版墦鍗版椂闂� + TjPrintOrder one = printOrderService.getTjPrintOrderByTjNum(order.getTjNumber()); + if (null != type && type == 1 && one != null) { + order.setPrintTime(one.getCreateTime()); + order.setPrintName(one.getCreateBy()); + order.setType(1); + list1.add(order); + } + if (null != type && type == 0 && one == null) { + order.setType(0); + list1.add(order); + } + } + return list1; + } private void getTjPackageListsByMan(List<TjPackage> tjPackageList) { if (null != tjPackageList && tjPackageList.size() > 0) { diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/DictHospController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/DictHospController.java index 3ccee78..2c078de 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/DictHospController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/DictHospController.java @@ -4,19 +4,18 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; +import cn.hutool.extra.pinyin.PinyinUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ltkj.common.core.domain.entity.SysDept; +import com.ltkj.framework.config.MatchUtils; +import com.ltkj.framework.web.domain.server.Sys; import com.ltkj.hosp.service.IDictOrgService; +import com.ltkj.system.service.ISysDeptService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.ltkj.common.annotation.Log; import com.ltkj.common.core.controller.BaseController; import com.ltkj.common.core.domain.AjaxResult; @@ -34,12 +33,24 @@ */ @RestController @RequestMapping("/hosp/hosp") -@Api(tags = "鍒嗛櫌绠$悊妯″潡鎺ュ彛") +@Api(tags = "PC绔� 鎵�灞炲尰闄㈢鐞嗘ā鍧楁帴鍙�") public class DictHospController extends BaseController { @Resource private IDictHospService dictHospService; @Resource private IDictOrgService orgService; + @Resource + private ISysDeptService deptService; + + @GetMapping("/getDeptListByDictHospId") + @ApiOperation(value = "璺熷尰闄㈡煡璇㈠搴旂殑閮ㄩ棬绉戝") + public AjaxResult getDeptListByDictHospId(@RequestParam String id ) { + List<SysDept> list = deptService.list(new LambdaQueryWrapper<SysDept>().eq(SysDept::getHospId,id)); + return AjaxResult.success(list); + } + + + /** * 鏌ヨ闄㈠尯淇℃伅鍒楄〃 @@ -84,7 +95,11 @@ @PostMapping @ApiOperation(value = "鏂板闄㈠尯淇℃伅") public AjaxResult add(@RequestBody DictHosp dictHosp) { - dictHosp.setHospName(orgService.getById(dictHosp.getHospid()).getOrgCnName()); + if(null !=dictHosp.getHospid() ){ + dictHosp.setHospName(orgService.getById(dictHosp.getHospid()).getOrgCnName()); + } + dictHosp.setWbm(MatchUtils.toWubi(dictHosp.getHospAreaName())); + dictHosp.setSpell(PinyinUtil.getFirstLetter(dictHosp.getHospAreaName(),"")); return toAjax(dictHospService.save(dictHosp)); } diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysLoginController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysLoginController.java index 240ee35..3982474 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysLoginController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysLoginController.java @@ -121,7 +121,7 @@ if (null != sysDept) { DictHosp dictHosp = hospService.getById(sysDept.getHospId()); if(null !=dictHosp && dictHosp.getSecretKey() !=null && dictHosp.getExpirationTime() !=null){ - if (!SecurityUtils.matchesMallMerchantSecretKey(secret,dictHosp.getHospAreaId(),dictHosp.getAreaid(), + if (!SecurityUtils.matchesMallMerchantSecretKey(secret,dictHosp.getHospAreaId(),dictHosp.getHospAreaName(), dictHosp.getExpirationTime(),dictHosp.getSecretKey())) { String userIdKey = Constants.LOGIN_USERID_KEY + user.getUserId(); diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjNewFlowingWaterController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjNewFlowingWaterController.java index b5995f1..8288bcc 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjNewFlowingWaterController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjNewFlowingWaterController.java @@ -71,6 +71,7 @@ List<Long> collect =null; TjCustomer one =null; + Date date=new Date(); LambdaQueryWrapper<TjFlowingWater> wq1 = new LambdaQueryWrapper<>(); if(null !=phone || null !=name){ LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>(); @@ -89,7 +90,7 @@ if(null !=collect){ wq1.in(TjFlowingWater::getOrderId, collect); } - wq1.between(TjFlowingWater::getCreateTime,DateUtil.beginOfDay(new Date()),DateUtil.endOfDay(new Date())); + wq1.between(TjFlowingWater::getCreateTime,DateUtil.beginOfDay(date),DateUtil.endOfDay(date)); wq1.eq(TjFlowingWater::getPayStasus,type); waterList = flowingWaterService.list(wq1); @@ -112,7 +113,7 @@ @GetMapping("/getTjPrice") @ApiOperation(value = "鑾峰彇浣撴璐圭敤") public AjaxResult getTjPrice() { - TjProject project = projectService.getOne(new LambdaQueryWrapper<TjProject>().eq(TjProject::getProName, "浣撴璐�") + TjProject project = projectService.getOne(new LambdaQueryWrapper<TjProject>().eq(TjProject::getProName, "浣撴椤圭洰") .eq(TjProject::getProId, 1712272744924446722L)); if (null != project) { return AjaxResult.success(project.getProPrice()); @@ -148,14 +149,17 @@ // } else { // cusId = one.getCusId(); // } + Date date=new Date(); TjOrder tjOrder = new TjOrder(); tjOrder.setUserId(customer.getCusId()); tjOrder.setTjType("2"); //鐢熸垚浣撴鍙� - String tjNumber = (SecurityUtils.getUsername() + new SimpleDateFormat("yyMMddHHmmss").format(new Date())); + String tjNumber = (SecurityUtils.getUsername() + new SimpleDateFormat("yyMMddHHmmss").format(date)); tjOrder.setTjNumber(tjNumber); tjOrder.setFirmId("0"); tjOrder.setStatus(TjConstants.TJ_BEGIN); + tjOrder.setFinishTime(date); + tjOrder.setReportTime(date); if (orderService.save(tjOrder)) { LambdaQueryWrapper<TjFlowingWater> wq = new LambdaQueryWrapper<>(); @@ -178,10 +182,10 @@ tjFlowingWater.setPaidIn(vo.getSs()); tjFlowingWater.setDiscount(vo.getZk()); tjFlowingWater.setPayStasus(1L); - Date date1 = new Date(System.currentTimeMillis()); - String s1 = SecurityUtils.getUsername() + new SimpleDateFormat("yyMMddHHmmssSSS").format(date1); + String s1 = SecurityUtils.getUsername() + new SimpleDateFormat("yyMMddHHmmssSSS").format(date); tjFlowingWater.setWaterId(s1); tjFlowingWater.setRemarks("宸叉敹璐�"); + tjFlowingWater.setTollCollectorId(String.valueOf(SecurityUtils.getLoginUser().getUserId())); if (flowingWaterService.save(tjFlowingWater)) { tjOrder.setTjSerialNumber(String.valueOf(tjFlowingWater.getTjSerialNumber())); orderService.updateById(tjOrder); @@ -195,7 +199,7 @@ tjChargingStandard.setCount(Long.valueOf(vo.getNumber())); chargingStandardService.save(tjChargingStandard); } - return AjaxResult.success(); + return AjaxResult.success(tjNumber); } return AjaxResult.error(); } diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java index 34c95d8..0c9cd0b 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java @@ -562,8 +562,8 @@ order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); order.setGrMoBanId(reportService.getGrMoBanIds()); order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); - order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); - order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); + if(null!=tjCustomer.getCusPhone())order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); + if(null!=tjCustomer.getCusIdcard())order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); } String firmId = order.getFirmId(); if (firmId != null && null != iDictCompService.getById(String.valueOf(order.getFirmId()))) { @@ -613,8 +613,8 @@ order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); order.setGrMoBanId(reportService.getGrMoBanIds()); order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); - order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); - order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); + if(null!=tjCustomer.getCusPhone())order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); + if(null!=tjCustomer.getCusIdcard())order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); } String firmId = order.getFirmId(); if (firmId != null && null != iDictCompService.getById(String.valueOf(order.getFirmId()))) { @@ -656,43 +656,21 @@ List<TjOrder> list = Optional.ofNullable(tjOrderService.list(wq)).get(); if (list.size() > 0) { - List<TjOrder> list1 = new ArrayList<>(); - for (TjOrder order : list) { - TjCustomer tjCustomer = tjCustomerService.selectTjCustomerByCusId(order.getUserId()); - if (null != tjCustomer) { - order.setTjCustomerSex(tjCustomer.getCusSex()); - order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); - order.setGrMoBanId(reportService.getGrMoBanIds()); - order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); - order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); - order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); + asyncService.getPrintOrderList(list); + if(redisCache.hasKey("getPrintOrderList")){ + if(null !=type && type==0){ + List<TjOrder> list1 = redisCache.getCacheMapValue("getPrintOrderList", "0"); + collect = list1.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); } - String firmId = order.getFirmId(); - if (firmId != null && null != iDictCompService.selectDictCompByDrugManufacturerId(String.valueOf(order.getFirmId()))) { - order.setDictCompName(iDictCompService.selectDictCompByDrugManufacturerId(String.valueOf(order.getFirmId())).getCnName()); + if(null !=type && type==1){ + List<TjOrder> list1 = redisCache.getCacheMapValue("getPrintOrderList","1"); + collect = list1.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); } - if (null != order.getPacId()) { - if (null != tjPackageService.getById(order.getPacId())) { - order.setPacName(tjPackageService.getById(order.getPacId()).getPacName()); - } - if (null != dwDeptService.getById(order.getPacId())) { - order.setPacName(dwDeptService.getById(order.getPacId()).getDwDeptName()); - } - } - //浠庢墦鍗拌褰曟煡鍑烘渶鏂版墦鍗版椂闂� - TjPrintOrder one = printOrderService.getTjPrintOrderByTjNum(order.getTjNumber()); - if (null != type && type == 1 && one != null) { - order.setPrintTime(one.getCreateTime()); - order.setPrintName(one.getCreateBy()); - order.setType(1); - list1.add(order); - } - if (null != type && type == 0 && one == null) { - order.setType(0); - list1.add(order); - } + }else { + List<TjOrder> list1 = new ArrayList<>(); + extracted(type, list, list1); + collect = list1.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); } - collect = list1.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); } if (null != collect) { map.put("total", collect.size()); @@ -703,6 +681,44 @@ return AjaxResult.success(map); } + private void extracted(Integer type, List<TjOrder> list, List<TjOrder> list1) { + for (TjOrder order : list) { + TjCustomer tjCustomer = tjCustomerService.selectTjCustomerByCusId(order.getUserId()); + if (null != tjCustomer) { + order.setTjCustomerSex(tjCustomer.getCusSex()); + order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); + order.setGrMoBanId(reportService.getGrMoBanIds()); + order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); + if(null!=tjCustomer.getCusPhone())order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); + if(null!=tjCustomer.getCusIdcard())order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); + } + String firmId = order.getFirmId(); + if (firmId != null && null != iDictCompService.selectDictCompByDrugManufacturerId(String.valueOf(order.getFirmId()))) { + order.setDictCompName(iDictCompService.selectDictCompByDrugManufacturerId(String.valueOf(order.getFirmId())).getCnName()); + } + if (null != order.getPacId()) { + if (null != tjPackageService.getById(order.getPacId())) { + order.setPacName(tjPackageService.getById(order.getPacId()).getPacName()); + } + if (null != dwDeptService.getById(order.getPacId())) { + order.setPacName(dwDeptService.getById(order.getPacId()).getDwDeptName()); + } + } + //浠庢墦鍗拌褰曟煡鍑烘渶鏂版墦鍗版椂闂� + TjPrintOrder one = printOrderService.getTjPrintOrderByTjNum(order.getTjNumber()); + if (null != type && type == 1 && one != null) { + order.setPrintTime(one.getCreateTime()); + order.setPrintName(one.getCreateBy()); + order.setType(1); + list1.add(order); + } + if (null != type && type == 0 && one == null) { + order.setType(0); + list1.add(order); + } + } + } + /** * 瀵煎嚭浣撴璁板綍鍒楄〃 diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjSummaryController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjSummaryController.java new file mode 100644 index 0000000..7ecc9f8 --- /dev/null +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjSummaryController.java @@ -0,0 +1,159 @@ +package com.ltkj.web.controller.system; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.google.common.base.Joiner; +import com.ltkj.common.core.domain.AjaxResult; +import com.ltkj.common.utils.SecurityUtils; +import com.ltkj.framework.config.UserHoder; +import com.ltkj.hosp.domain.TjSummary; +import com.ltkj.hosp.domain.TjTollCollector; +import com.ltkj.hosp.service.ITjSummaryService; +import com.ltkj.hosp.service.ITjTollCollectorService; +import com.ltkj.system.service.ISysConfigService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * @Company: 瑗垮畨璺嘲绉戞妧鏈夐檺鍏徃 + * @Author: zjh + * @Date: 2023/10/16 09:02 + */ +@RestController +@RequestMapping("/hosp/summary") +@Api(tags = "PC绔� 姹囨�荤粨璐︽帴鍙�") +public class TjSummaryController { + @Resource + private ITjTollCollectorService collectorService; + + @Resource + private ITjSummaryService summaryService; + @Resource + private ISysConfigService configService; + + + @GetMapping("/getTjSummaryList") + @ApiOperation(value = "鏌ヨ姹囨�诲崟鎹俊鎭帴鍙�") + public AjaxResult getTjSummaryList(@RequestParam(required = false) @ApiParam(value = "鏀惰垂鍛榠d") String tollCollectorId, + @RequestParam(required = false) @ApiParam(value = "璧峰鏃堕棿") String accountBeginTime, + @RequestParam(required = false) @ApiParam(value = "璧峰鏃堕棿") String accountEndTime) { + + LambdaQueryWrapper<TjSummary> wqq = new LambdaQueryWrapper<>(); + if (null != tollCollectorId) { + wqq.eq(TjSummary::getHzUserId, tollCollectorId); + } + if (null != accountBeginTime && null != accountEndTime) { + wqq.between(TjSummary::getCreateTime, accountBeginTime, accountEndTime); + } + wqq.orderByDesc(TjSummary::getCreateTime); + List<TjSummary> list= summaryService.list(wqq); + if(null !=list && list.size()>0){ + for (TjSummary summary : list) { + String accountId = summary.getAccountId(); + String[] split = accountId.split(";"); + LambdaQueryWrapper<TjTollCollector> wq = new LambdaQueryWrapper<>(); + wq.in(TjTollCollector::getId, (Object[]) split); + summary.setCollectorList(collectorService.list(wq)); + } + } + return AjaxResult.success(list); + } + + + @GetMapping("/list") + @ApiOperation(value = "鏌ヨ鏀惰垂鍛樻棩缁撴湭姹囨�诲崟鎹俊鎭�") + public AjaxResult list(@RequestParam(required = false) @ApiParam(value = "鏀惰垂鍛榠d") String tollCollectorId, + @RequestParam(required = false) @ApiParam(value = "璧峰鏃堕棿") String accountBeginTime, + @RequestParam(required = false) @ApiParam(value = "璧峰鏃堕棿") String accountEndTime) { + + LambdaQueryWrapper<TjTollCollector> wqq = new LambdaQueryWrapper<>(); + if (null != tollCollectorId) { + wqq.eq(TjTollCollector::getTollCollectorId, tollCollectorId); + } + if (null != accountBeginTime && null != accountEndTime) { + wqq.between(TjTollCollector::getCreateTime, accountBeginTime, accountEndTime); + } + wqq.orderByDesc(TjTollCollector::getCreateTime); + wqq.eq(TjTollCollector::getIsHz,"N"); + List<TjTollCollector> list= collectorService.list(wqq); + return AjaxResult.success(list); + } + + + + @PostMapping("/addTjSummary") + @ApiOperation(value = "鐐瑰嚮姹囨�� 鏂板姹囨�讳俊鎭帴鍙�") + public AjaxResult addTjSummary(@RequestBody List<String> ids) { + + if(null !=ids && ids.size()>0){ + String accountId = "HZ" + SecurityUtils.getUsername() + (new SimpleDateFormat("yyMMddHHmmssSSS").format(new Date())); + BigDecimal zshoukuan = new BigDecimal("0.00"); + BigDecimal ztuikuan = new BigDecimal("0.00"); + BigDecimal zyingjiao = new BigDecimal("0.00"); + for (String id : ids) { + TjTollCollector collector = collectorService.getById(id); + if(null !=collector){ + zshoukuan=zshoukuan.add(collector.getAmountReceived()); + ztuikuan=ztuikuan.add(collector.getRefundAmount()); + zyingjiao=zyingjiao.add(collector.getPayable()); + collector.setIsHz("Y"); + collectorService.updateById(collector); + } + } + String join = Joiner.on(";").join(ids); + TjSummary summary=new TjSummary(); + summary.setHzName(UserHoder.getLoginUser().getUser().getNickName()); + summary.setHzUserId(Long.valueOf(UserHoder.getLoginUser().getUserId())); + summary.setHzCard(accountId); + summary.setHzSj("姹囨�荤粨璐�"); + summary.setAmountReceived(zshoukuan); + summary.setRefundAmount(ztuikuan); + summary.setPayable(zyingjiao); + summary.setAccountId(join); + summaryService.save(summary); + return AjaxResult.success(accountId); + } + return AjaxResult.error("璇烽�夋嫨姹囨�诲崟鎹�"); + } + + + @DeleteMapping("/removeTjSummaryById") + @ApiOperation(value = "姹囨�诲憳鎾ら攢 姹囨�昏处鍗� 鎺ュ彛") + public AjaxResult removeTjSummaryById(@RequestParam @ApiParam(value = "缁撹处id") String id, + @RequestParam @ApiParam(value = "缁撹处鍛榠d") String tollCollectorId) { + String userId = SecurityUtils.getLoginUser().getUserId(); + if (!userId.equals(tollCollectorId)) { + return AjaxResult.error("闈炲綋鍓嶇敤鎴风姝㈡搷浣�"); + } + TjSummary summary = summaryService.getById(id); + if (summaryService.removeById(id)) { + if (null != summary) { + String accountId = summary.getAccountId(); + String[] split = accountId.split(";"); + for (String s : split) { + TjTollCollector tollCollector = collectorService.getTjTollCollectorById(s); + tollCollector.setIsHz("N"); + collectorService.updateById(tollCollector); + } + return AjaxResult.success("璇ヨ处鍗曞凡鎴愬姛鎾ら攢"); + } + return AjaxResult.success("璇ヨ处鍗曞凡鎾ら攢"); + } + return AjaxResult.error("鎾ら攢澶辫触"); + } + + + @GetMapping("/getPrintSetUp") + @ApiOperation(value = "鏌ヨ鎵撳嵃璁剧疆 0灏忕エ 1 鍙戠エ") + public AjaxResult getPrintSetUp() { + String printSetUp = configService.selectConfigByKey("print_set_up"); + return AjaxResult.success(printSetUp); + } + +} diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjTollCollectorController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjTollCollectorController.java index 0468706..352c776 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjTollCollectorController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjTollCollectorController.java @@ -14,7 +14,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ltkj.common.core.domain.entity.SysDictData; 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; @@ -80,7 +82,6 @@ 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); @@ -175,6 +176,9 @@ // TjTollCollector collector = tjTollCollectorService.getById(id); TjTollCollector collector = tjTollCollectorService.getTjTollCollectorById(id); if (null != collector) { + if("Y".equals(collector.getIsHz())){ + return AjaxResult.error("璇ヨ处鍗曞凡姹囨�讳笉鍙挙閿�"); + } LambdaQueryWrapper<TjTollCollectorDetail> wq = new LambdaQueryWrapper<>(); wq.eq(TjTollCollectorDetail::getAccountId, collector.getAccountId()); collectorDetailService.remove(wq); @@ -207,7 +211,9 @@ 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 = "1970-01-01 00:00:00"; + Date date = DateUtil.parse(dateStr, "yyyy-MM-dd HH:mm:ss"); + return AjaxResult.success(date); } @@ -243,7 +249,7 @@ 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"); diff --git a/ltkj-admin/src/main/java/com/ltkj/web/jmreport/JimuController.java b/ltkj-admin/src/main/java/com/ltkj/web/jmreport/JimuController.java index 4aefafa..a2f6f5d 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/jmreport/JimuController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/jmreport/JimuController.java @@ -20,7 +20,7 @@ private String value; @GetMapping("/index") - @PreAuthorize("@ss.hasPermi('report:jmreport:index')") +// @PreAuthorize("@ss.hasPermi('report:jmreport:index')") public String index(){ return value+"/jmreport/list"; } diff --git a/ltkj-admin/src/main/java/com/ltkj/web/jmreport/JimuReportTokenService.java b/ltkj-admin/src/main/java/com/ltkj/web/jmreport/JimuReportTokenService.java index ece349d..7420f9a 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/jmreport/JimuReportTokenService.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/jmreport/JimuReportTokenService.java @@ -18,7 +18,7 @@ * 鑷畾涔夌Н鏈ㄦ姤琛ㄩ壌鏉�(濡傛灉涓嶈繘琛岃嚜瀹氫箟锛屽垯鎵�鏈夎姹備笉鍋氭潈闄愭帶鍒�) */ @Component -public class JimuReportTokenService implements JmReportTokenServiceI { +public class JimuReportTokenService implements JmReportTokenServiceI{ @Autowired private TokenService tokenService; @@ -60,10 +60,11 @@ return true; }else{ //鏍¢獙鑿滃崟鏉冮檺 - Set<String> permissions = loginUser.getPermissions(); - if(permissions != null && permissions.contains("report:jmreport:list")){ - return true; - } +// Set<String> permissions = loginUser.getPermissions(); + return true; +// if(permissions != null && permissions.contains("report:jmreport:list")){ +// return true; +// } } } return false; diff --git a/ltkj-admin/src/main/resources/application-druid.yml b/ltkj-admin/src/main/resources/application-druid.yml index aa987b5..3c3a655 100644 --- a/ltkj-admin/src/main/resources/application-druid.yml +++ b/ltkj-admin/src/main/resources/application-druid.yml @@ -6,10 +6,8 @@ druid: # 涓诲簱鏁版嵁婧� master: - #url: jdbc:mysql://192.168.0.101:3306/mydb?serverTimezone=UTC - #url: jdbc:mysql://47.109.86.30:3306/ltkj_tj1.0?serverTimezone=GMT%2B8 - url: jdbc:mysql://101.42.27.146:3306/ltkj_tj1.0?serverTimezone=GMT%2B8 - #url: jdbc:mysql://192.168.0.101:3306/mydb?serverTimezone=GMT%2B8 +# url: jdbc:mysql://101.42.27.146:3306/ltkj_tj1.0?serverTimezone=GMT%2B8 + url: jdbc:mysql://localhost:3306/ltkj_tj1.0?serverTimezone=GMT%2B8 username: root #password: Root_ltkj123 password: Root_ltkj123 diff --git a/ltkj-admin/src/main/resources/application.yml b/ltkj-admin/src/main/resources/application.yml index 977bc19..341a09b 100644 --- a/ltkj-admin/src/main/resources/application.yml +++ b/ltkj-admin/src/main/resources/application.yml @@ -73,7 +73,7 @@ redis: # 鍦板潃 host: 101.42.27.146 -# host: 192.168.0.101 +# host: localhost # 绔彛锛岄粯璁や负6379 port: 6379 # 鏁版嵁搴撶储寮� @@ -206,8 +206,9 @@ #绉湪鎶ヨ〃璁块棶鍦板潃 jimu: - path: https://ltpeis.xaltjdkj.cn:5011/ltkj-admin -# path: http://192.168.0.100:5011 +# path: https://ltpeis.xaltjdkj.cn:5011/ltkj-admin +# path: http://192.168.0.99:8080/ltkj-admin/jmreport/view + path: http://192.168.0.101:5011 jeecg : jmreport: diff --git a/ltkj-admin/src/test/java/zjhTest.java b/ltkj-admin/src/test/java/zjhTest.java index dd3150e..2834fd1 100644 --- a/ltkj-admin/src/test/java/zjhTest.java +++ b/ltkj-admin/src/test/java/zjhTest.java @@ -1,4 +1,5 @@ +import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import com.ltkj.LtkjApplication; import com.ltkj.common.core.redis.RedisCache; @@ -59,10 +60,14 @@ public void test() { // List<DictHosp> list = dictHospService.list(); // for (DictHosp dictHosp : list) { -// String mallMerchantSecretKey = SecurityUtils.getMallMerchantSecretKey(secret,dictHosp.getHospAreaId(),dictHosp.getAreaid(), dictHosp.getExpirationTime()); +// DateTime dateTime1 = DateUtil.offsetMonth(new Date(),6); +// String mallMerchantSecretKey = SecurityUtils.getMallMerchantSecretKey(secret,dictHosp.getHospAreaId(),dictHosp.getHospAreaName(),dictHosp.getExpirationTime()); // dictHosp.setSecretKey(mallMerchantSecretKey); // dictHosp.setExpirationTime(DateUtil.offsetDay(new Date(),30)); // dictHospService.updateById(dictHosp); +// System.out.println(dateTime1); +// System.out.println("================================================="); +// System.out.println(mallMerchantSecretKey); // } } diff --git a/ltkj-framework/src/main/java/com/ltkj/framework/config/SecurityConfig.java b/ltkj-framework/src/main/java/com/ltkj/framework/config/SecurityConfig.java index 3273422..c673e97 100644 --- a/ltkj-framework/src/main/java/com/ltkj/framework/config/SecurityConfig.java +++ b/ltkj-framework/src/main/java/com/ltkj/framework/config/SecurityConfig.java @@ -108,7 +108,7 @@ // 杩囨护璇锋眰 .authorizeRequests() // 瀵逛簬鐧诲綍login 娉ㄥ唽register 楠岃瘉鐮乧aptchaImage 鍏佽鍖垮悕璁块棶 - .antMatchers("/login", "/register", "/captchaImage","/cus/**","/getCaptchaConfigKey").permitAll() + .antMatchers("/login", "/register", "/captchaImage","/cus/**","/getCaptchaConfigKey","/report/jmreport/**").permitAll() // 闈欐�佽祫婧愶紝鍙尶鍚嶈闂� .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() diff --git a/ltkj-framework/src/main/java/com/ltkj/framework/web/service/SysLoginService.java b/ltkj-framework/src/main/java/com/ltkj/framework/web/service/SysLoginService.java index 355c5b8..1cd8b13 100644 --- a/ltkj-framework/src/main/java/com/ltkj/framework/web/service/SysLoginService.java +++ b/ltkj-framework/src/main/java/com/ltkj/framework/web/service/SysLoginService.java @@ -147,7 +147,7 @@ loginUser.setHospName(dictHosp.getHospAreaName()); if(!SecurityUtils.isAdmin(user.getUserId())){ if(dictHosp.getSecretKey() != null && dictHosp.getExpirationTime() != null){ - if (!SecurityUtils.matchesMallMerchantSecretKey(secret,dictHosp.getHospAreaId(),dictHosp.getAreaid(), + if (!SecurityUtils.matchesMallMerchantSecretKey(secret,dictHosp.getHospAreaId(),dictHosp.getHospAreaName(), dictHosp.getExpirationTime(),dictHosp.getSecretKey())) { throw new SecretKeyException("鍟嗗宸茶繃鏈熻缁垂浣跨敤"); } diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/DictHosp.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/DictHosp.java index e56879b..d8de12f 100644 --- a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/DictHosp.java +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/DictHosp.java @@ -29,7 +29,7 @@ /** * 闄㈠尯ID */ - @TableId(type = IdType.AUTO) + @TableId(type = IdType.ASSIGN_ID) @ApiModelProperty(value = "闄㈠尯ID") private String hospAreaId; diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjSummary.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjSummary.java new file mode 100644 index 0000000..eb2bd4f --- /dev/null +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjSummary.java @@ -0,0 +1,47 @@ +package com.ltkj.hosp.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.ltkj.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.math.BigDecimal; +import java.util.List; + +/** + * @Company: 瑗垮畨璺嘲绉戞妧鏈夐檺鍏徃 + * @Author: zjh + * @Date: 2023/10/16 08:52 + */ +@Data +public class TjSummary extends BaseEntity { + @TableId(type = IdType.AUTO) + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + @ApiModelProperty(value = "姹囨�昏处鍗曞彿") + private String hzCard; + @ApiModelProperty(value = "姹囨�讳汉濮撳悕") + private String hzName; + + @ApiModelProperty(value = "姹囨�讳汉id") + @JsonSerialize(using = ToStringSerializer.class) + private Long hzUserId; + + @ApiModelProperty(value = "姹囨�讳簨浠�") + private String hzSj; + @ApiModelProperty(value = "鏀舵") + private BigDecimal amountReceived; + @ApiModelProperty(value = "閫�娆�") + private BigDecimal refundAmount; + @ApiModelProperty(value = "搴斾氦娆�") + private BigDecimal payable; + @ApiModelProperty(value = "缁撹处鍙�") + private String accountId; + + @TableField(exist = false) + private List<TjTollCollector> collectorList; + +} diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjTollCollector.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjTollCollector.java index 4f0d16d..d059c06 100644 --- a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjTollCollector.java +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjTollCollector.java @@ -92,6 +92,9 @@ @ApiModelProperty(value = "搴斾氦娆�") private BigDecimal payable; + @ApiModelProperty(value = "鏄惁姹囨��") + private String isHz; + /** * 缁撹处璇︽儏淇℃伅 */ diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjSummaryMapper.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjSummaryMapper.java new file mode 100644 index 0000000..3723d6d --- /dev/null +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjSummaryMapper.java @@ -0,0 +1,14 @@ +package com.ltkj.hosp.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ltkj.hosp.domain.TjSummary; +import org.apache.ibatis.annotations.Mapper; + +/** + * @Company: 瑗垮畨璺嘲绉戞妧鏈夐檺鍏徃 + * @Author: zjh + * @Date: 2023/10/16 08:59 + */ +@Mapper +public interface TjSummaryMapper extends BaseMapper<TjSummary> { +} diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/service/ITjSummaryService.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/service/ITjSummaryService.java new file mode 100644 index 0000000..5e04785 --- /dev/null +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/service/ITjSummaryService.java @@ -0,0 +1,12 @@ +package com.ltkj.hosp.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ltkj.hosp.domain.TjSummary; + +/** + * @Company: 瑗垮畨璺嘲绉戞妧鏈夐檺鍏徃 + * @Author: zjh + * @Date: 2023/10/16 09:00 + */ +public interface ITjSummaryService extends IService<TjSummary> { +} diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/service/TjAsyncService.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/service/TjAsyncService.java index c1d2729..4da1f26 100644 --- a/ltkj-hosp/src/main/java/com/ltkj/hosp/service/TjAsyncService.java +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/service/TjAsyncService.java @@ -1,11 +1,13 @@ package com.ltkj.hosp.service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ltkj.common.core.domain.entity.SysUser; import com.ltkj.hosp.domain.*; import com.ltkj.hosp.vodomain.QjDomainVo; import java.math.BigDecimal; import java.util.List; +import java.util.Map; import java.util.Set; /** @@ -76,4 +78,6 @@ void updateCheckType(String tjNum); // void addRedis(List<TjCustomer> customers); + + void getPrintOrderList(List<TjOrder> list); } diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjSummaryServiceImpl.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjSummaryServiceImpl.java new file mode 100644 index 0000000..810c2b7 --- /dev/null +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjSummaryServiceImpl.java @@ -0,0 +1,16 @@ +package com.ltkj.hosp.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ltkj.hosp.domain.TjSummary; +import com.ltkj.hosp.mapper.TjSummaryMapper; +import com.ltkj.hosp.service.ITjSummaryService; +import org.springframework.stereotype.Service; + +/** + * @Company: 瑗垮畨璺嘲绉戞妧鏈夐檺鍏徃 + * @Author: zjh + * @Date: 2023/10/16 09:00 + */ +@Service +public class TjSummaryServiceImpl extends ServiceImpl<TjSummaryMapper, TjSummary> implements ITjSummaryService { +} -- Gitblit v1.8.0