From 42f852823e744a81525558b7523edde601c0b057 Mon Sep 17 00:00:00 2001 From: zjh <1084500556@qq.com> Date: 星期二, 15 七月 2025 16:03:27 +0800 Subject: [PATCH] zjh20250715 --- ltkj-hosp/src/main/java/com/ltkj/hosp/vodomain/TeamTjPeopleVo.java | 20 ++ ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjCompPayMapper.java | 13 + ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjCompPayServiceImpl.java | 17 ++ ltkj-hosp/src/main/java/com/ltkj/hosp/service/ITjCompPayService.java | 7 ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjFlowingWater.java | 8 + ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjTeamSelectRecord.java | 15 - ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjCompPay.java | 34 ++++ ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCompPayController.java | 336 +++++++++++++++++++++++++++++------------ ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjCompPayInfo.java | 15 + 9 files changed, 351 insertions(+), 114 deletions(-) diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCompPayController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCompPayController.java index a53098f..aac5f97 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCompPayController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCompPayController.java @@ -1,6 +1,7 @@ package com.ltkj.web.controller.system; +import cn.hutool.core.date.DateUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ltkj.common.core.domain.AjaxResult; import com.ltkj.common.utils.SecurityUtils; @@ -8,10 +9,13 @@ import com.ltkj.hosp.domain.*; import com.ltkj.hosp.service.*; import com.ltkj.hosp.vodomain.TeamTjPeopleVo; +import com.mysql.cj.util.StringUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; +import jodd.util.StringUtil; import org.aspectj.weaver.AjAttribute; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import com.ltkj.common.core.controller.BaseController; import oshi.hardware.platform.mac.MacUsbDevice; @@ -19,8 +23,10 @@ import javax.annotation.Resource; import java.lang.annotation.ElementType; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; + +import static com.ltkj.framework.datasource.DynamicDataSourceContextHolder.log; /** * 浣撴鍗曚綅缂磋垂涓籆ontroller @@ -39,8 +45,6 @@ @Resource private ITjTeamSelectRecordService selectRecordService; @Resource - private ITjPackageService packageService; - @Resource private IDictCompService compService; @Resource private ITjReservationService reservationService; @@ -49,25 +53,62 @@ @Resource private ITjCustomerService customerService; @Resource - private ITjDwDeptService dwDeptService; + private ITjDwGroupingService dwGroupingService; + @Resource + private ITjOrderRemarkService remarkService; + @Resource + private ITjFlowingWaterService tjFlowingWaterService; + @Resource + private ITbTransitionService transitionService; /** * 鍥綋浣撴鏀惰垂鎺ュ彛 */ @PostMapping @ApiOperation(value = "鍥綋浣撴鏀惰垂鎺ュ彛") - public AjaxResult add(@RequestBody TjCompPayInfo compPayInfo) { - if (null==compPayInfo) { - return AjaxResult.error(); + @Transactional + public AjaxResult add(@RequestBody TjCompPay compPay) { + try { + if (null==compPay.getTjhs() || compPay.getTjhs().isEmpty()) { + return AjaxResult.error("璇烽�夋嫨缁撹处浜哄憳!"); + } + Date date = DateUtil.date(); + String s = String.valueOf(SecurityUtils.getLoginUser().getUser().getNickName()); + compPay.setPayee(s); + compPay.setSerialNumber("TT"+SecurityUtils.getUsername() + DateUtil.format(date, "yyMMddHHmmssSSS")); + compPay.setInvoiceNo("FP" + DateUtil.format(date, "yyMMddHHmmssSSS")); + if(compPayService.save(compPay)){ + for (String tjh : compPay.getTjhs()) { + TjOrder tjOrder = orderService.getOrderByTjNum(tjh); + if(null != tjOrder){ + TjFlowingWater water = tjFlowingWaterService.getOne(new LambdaQueryWrapper<TjFlowingWater>() + .eq(TjFlowingWater::getOrderId, tjOrder.getOrderId()).eq(TjFlowingWater::getIsAddition, "N")); + if(null != water){ + TjCompPayInfo payInfo = new TjCompPayInfo(); + payInfo.setTjh(tjh); + payInfo.setTjCompPayId(compPay.getId()); + payInfo.setTransactionAmount(water.getPaidIn()); + payInfo.setPaymentMethod(compPay.getPaymentMethod()); + payInfo.setCardNo(compPay.getCardNo()); + payInfo.setPayer(compPay.getPayer()); + payInfo.setPayee(compPay.getPayee()); + payInfoService.save(payInfo); + water.setSfjs("1"); + water.setJsdh(compPay.getSerialNumber()); + water.setJsrq(DateUtil.date()); + water.setJsrxm(s); + water.setJsrdm(SecurityUtils.getLoginUser().getUser().getUserId().toString()); + tjFlowingWaterService.updateById(water); + } + } + + } + return AjaxResult.success("鏀惰垂鎴愬姛"); + } + return AjaxResult.error("鎿嶄綔澶辫触"); + } catch (Exception e) { + log.error("鏀惰垂寮傚父", e); + throw new RuntimeException(e); } - compPayInfo.setPayee(String.valueOf(SecurityUtils.getLoginUser().getUser().getNickName())); - TjCompPay tjCompPay =compPayService.getById(compPayInfo.getTjCompPayId()); - BigDecimal paidIn = tjCompPay.getPaidIn(); - paidIn =paidIn.add(compPayInfo.getTransactionAmount()); - if(paidIn.compareTo(tjCompPay.getCopeWith())>0 || tjCompPay.getDifference().compareTo(BigDecimal.valueOf(0))==0){ - return AjaxResult.error("鏆傛棤鏀惰垂闇�姹�"); - } - if (getAjaxResult(compPayInfo, tjCompPay)) return AjaxResult.success("鏀惰垂鎴愬姛"); - return AjaxResult.error("鎿嶄綔澶辫触"); } /** @@ -75,52 +116,35 @@ */ @PostMapping("/refund") @ApiOperation(value = "鍥綋浣撴閫�璐规帴鍙�") - public AjaxResult refund(@RequestBody TjCompPayInfo compPayInfo) { - if (null==compPayInfo) { - return AjaxResult.error(); - } - compPayInfo.setPayee(String.valueOf(SecurityUtils.getLoginUser().getUser().getNickName())); - TjCompPay tjCompPay =compPayService.getById(compPayInfo.getTjCompPayId()); - BigDecimal paidIn = tjCompPay.getPaidIn(); - paidIn =paidIn.add(compPayInfo.getTransactionAmount()); - //鍒ゆ柇瀹炰粯閲戦鍜屼氦鏄撻噾棰濈殑鏁板�� - if(paidIn.compareTo(BigDecimal.valueOf(0.00))==0 || compPayInfo.getTransactionAmount().compareTo(tjCompPay.getPaidIn())>0 ){ - return AjaxResult.error("鏆傛棤閫�璐归渶姹�"); - } - compPayInfo.setTransactionAmount(BigDecimal.valueOf(0.00).subtract(compPayInfo.getTransactionAmount())); - compPayInfo.setPaymentMethod(3L); - if (getAjaxResult(compPayInfo, tjCompPay)) return AjaxResult.success("閫�璐规垚鍔�"); - return AjaxResult.error("鎿嶄綔澶辫触"); - } - - private boolean getAjaxResult(@RequestBody TjCompPayInfo compPayInfo, TjCompPay tjCompPay) { - if(payInfoService.saveOrUpdate(compPayInfo)){ - LambdaQueryWrapper<TjCompPayInfo> wq=new LambdaQueryWrapper<>(); - wq.eq(TjCompPayInfo::getTjCompPayId,tjCompPay.getId()); - List<TjCompPayInfo> list = payInfoService.list(wq); - BigDecimal bigDecimal=new BigDecimal("0.00"); - if(null !=list && list.size()>0){ - for (TjCompPayInfo payInfo : list) { - bigDecimal=bigDecimal.add(payInfo.getTransactionAmount()); + @Transactional + public AjaxResult refund(@RequestBody TjCompPay compPay) { + try { + if(null !=compPay){ + if (compPayService.removeById(compPay)) { + LambdaQueryWrapper<TjCompPayInfo>wq=new LambdaQueryWrapper<>(); + wq.eq(TjCompPayInfo::getTjCompPayId,compPay.getId()); + payInfoService.remove(wq); + LambdaQueryWrapper<TjFlowingWater> waterLambdaQueryWrappe=new LambdaQueryWrapper<>(); + waterLambdaQueryWrappe.eq(TjFlowingWater::getJsdh,compPay.getSerialNumber()); + List<TjFlowingWater> waterList = tjFlowingWaterService.list(waterLambdaQueryWrappe); + if(null != waterList && !waterList.isEmpty()){ + for (TjFlowingWater water : waterList) { + water.setSfjs("0"); + water.setJsdh(null); + water.setJsrq(null); + water.setJsrxm(null); + water.setJsrdm(null); + tjFlowingWaterService.updateById(water); + } + } + return AjaxResult.success("鎿嶄綔鎴愬姛"); } } - tjCompPay.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserId())); - if(bigDecimal.compareTo(BigDecimal.valueOf(0.00))>= 0){ - tjCompPay.setPaidIn(bigDecimal); - }else { - tjCompPay.setPaidIn(BigDecimal.valueOf(0.00)); - } - tjCompPay.setDifference(tjCompPay.getCopeWith().subtract(bigDecimal)); - compPayService.updateById(tjCompPay); - LambdaQueryWrapper<TjTeamSelectRecord>wq0=new LambdaQueryWrapper<>(); - wq0.eq(TjTeamSelectRecord::getTeamNo,tjCompPay.getTeamNo()); - wq0.eq(TjTeamSelectRecord::getCompId,tjCompPay.getCompId()); - TjTeamSelectRecord record = selectRecordService.getOne(wq0); - record.setTransactionAmount(tjCompPay.getPaidIn()); - selectRecordService.updateById(record); - return true; + return AjaxResult.error("鎿嶄綔澶辫触"); + } catch (Exception e) { + log.error("鎿嶄綔澶辫触", e); + throw new RuntimeException(e); } - return false; } /** @@ -129,34 +153,66 @@ @GetMapping @ApiOperation(value = "鎵�鏈夊叕鍙镐綋妫�鏀惰垂鏁版嵁鏌ヨ鎺ュ彛") public AjaxResult list(@RequestParam(required = false) @ApiParam(value = "鍗曚綅id") String compId) { + + List<TjReservation> rightList = reservationService.list(new LambdaQueryWrapper<TjReservation>().eq(TjReservation::getCompanyId, compId)); + + Map<String, List<TjReservation>> collect = rightList.stream().collect(Collectors.groupingBy(TjReservation::getPacId)); + + if (!collect.isEmpty()) { + for (Map.Entry<String, List<TjReservation>> entry : collect.entrySet()) { + BigDecimal compPay = new BigDecimal("0.00"); + for (TjReservation reservation : entry.getValue()) { + TjDwGrouping dwGrouping = dwGroupingService.getById(reservation.getGroupingId()); + compPay = compPay.add(dwGrouping.getYsPrice()); + } + LambdaQueryWrapper<TjTeamSelectRecord> wq = new LambdaQueryWrapper<>(); + wq.eq(TjTeamSelectRecord::getTeamNo, entry.getValue().get(0).getTeamNo()); + wq.eq(TjTeamSelectRecord::getPacId, entry.getKey()); + wq.eq(TjTeamSelectRecord::getCompId,compId); + TjTeamSelectRecord recordServiceOne = selectRecordService.getOne(wq); + if (null == recordServiceOne) { + TjTeamSelectRecord selectRecord = new TjTeamSelectRecord(); + selectRecord.setCompId(compId); + selectRecord.setPacId(entry.getKey()); + selectRecord.setTeamNo(entry.getValue().get(0).getTeamNo()); + selectRecord.setTransactionAmount(new BigDecimal("0.00")); + selectRecord.setCopeWith(compPay); + selectRecord.setCount(entry.getValue().size()); + selectRecord.setDifference(compPay); + selectRecordService.save(selectRecord); + } + } + } + LambdaQueryWrapper<TjTeamSelectRecord>wq0=new LambdaQueryWrapper<>(); if(null !=compId){ wq0.eq(TjTeamSelectRecord::getCompId,compId); } - wq0.ne(TjTeamSelectRecord::getDifference,0); List<TjTeamSelectRecord> selectRecordList = selectRecordService.list(wq0); - if(null !=selectRecordList && selectRecordList.size()>0){ + if(null !=selectRecordList && !selectRecordList.isEmpty()){ for(TjTeamSelectRecord selectRecord : selectRecordList){ - TjDwDept dwDept = dwDeptService.getById(selectRecord.getPacId()); - if(null !=dwDept){ - selectRecord.setPacName(dwDept.getDwDeptName()); - selectRecord.setSigningPrice(dwDept.getSigningPrice()); + selectRecord.setSjCount(orderService.count(new LambdaQueryWrapper<TjOrder>() + .eq(TjOrder::getTeamNo,selectRecord.getTeamNo()).eq(TjOrder::getPacId,selectRecord.getPacId()))); + + TjDwGrouping dwGrouping = dwGroupingService.getById(selectRecord.getPacId()); + if(null !=dwGrouping){ + selectRecord.setPacName(dwGrouping.getGroupingName()); + selectRecord.setSigningPrice(dwGrouping.getSigningPrice()); } LambdaQueryWrapper<TjCompPay>wq1=new LambdaQueryWrapper<>(); wq1.eq(TjCompPay::getCompId,compId); wq1.eq(TjCompPay::getTeamNo,selectRecord.getTeamNo()); - TjCompPay compPay = compPayService.getOne(wq1); - if (null !=compPay) { - LambdaQueryWrapper<TjCompPayInfo>wq=new LambdaQueryWrapper<>(); - wq.eq(TjCompPayInfo::getTjCompPayId,compPay.getId()); - selectRecord.setPayInfoList(payInfoService.list(wq)); - selectRecord.setCopeWith(compPay.getCopeWith()); - selectRecord.setDifference(compPay.getDifference()); - selectRecord.setPayer(compService.getById(compPay.getCompId()).getContactPerson()); - selectRecord.setSjCount(orderService.count(new LambdaQueryWrapper<TjOrder>().eq(TjOrder::getTeamNo,compPay.getTeamNo()))); - TjCompPayInfo payInfo = new TjCompPayInfo(); - payInfo.setTjCompPayId(compPay.getId()); - selectRecord.setPayInfo(payInfo); + wq1.eq(TjCompPay::getPacId,selectRecord.getPacId()); + List<TjCompPay> compPay = compPayService.list(wq1); + BigDecimal sumZje = compPayService.sumZje(compId,selectRecord.getTeamNo(),selectRecord.getPacId()); + List<String> SerialNumbers = compPayService.serialNumbers(compId,selectRecord.getTeamNo(),selectRecord.getPacId()); + if (null !=compPay && !compPay.isEmpty()) { + selectRecord.setTransactionAmount(sumZje); + selectRecord.setDifference(selectRecord.getCopeWith().subtract(sumZje)); + selectRecord.setYjsrs(tjFlowingWaterService.count(new LambdaQueryWrapper<TjFlowingWater>() + .in(TjFlowingWater::getJsdh,SerialNumbers))); + }else { + selectRecord.setYjsrs(0); } } } @@ -170,34 +226,110 @@ */ @GetMapping("/getTeamTjPeopleList") @ApiOperation(value = "鏍规嵁鍥㈤槦浣撴缂栧彿鍥㈤槦浜哄憳浣撴鎯呭喌鏌ヨ") - public AjaxResult getTeamTjPeopleList(@RequestParam @ApiParam(value = "鍥㈤槦缂栧彿") String teamNo) { + public AjaxResult getTeamTjPeopleList(@RequestParam @ApiParam(value = "鍥㈤槦缂栧彿") String teamNo, + @RequestParam(required = false) @ApiParam(value = "鍗曚綅id") String pacId) { - List<TjReservation> reservationList = reservationService.list(new LambdaQueryWrapper<TjReservation>().eq(TjReservation::getTeamNo,teamNo)); - if (null != reservationList && reservationList.size() > 0) { - List<TeamTjPeopleVo> voList = new ArrayList<>(); - for (TjReservation reservation : reservationList) { - TeamTjPeopleVo vo = new TeamTjPeopleVo(); - vo.setName(reservation.getName()); - TjCustomer customer = customerService.getOne(new LambdaQueryWrapper<TjCustomer>().eq(TjCustomer::getCusIdcard, reservation.getIdCard())); - if (null != customer) { - TjOrder tjOrder = orderService.getOne(new LambdaQueryWrapper<TjOrder>().eq(TjOrder::getUserId, customer.getCusId()).eq(TjOrder::getTeamNo, teamNo)); - if (null != tjOrder) { - if (null != tjOrder.getFinishTime()) { - vo.setTjStatus("宸插畬鎴�"); - vo.setTjTime(tjOrder.getFinishTime()); - } else { - vo.setTjStatus("鏈畬鎴�"); - } - } else { - vo.setTjStatus("鏈� 妫�"); + try { + Map<String,Object> map=new HashMap<>(); + LambdaQueryWrapper<TjReservation> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TjReservation::getTeamNo, teamNo); + if(StringUtil.isNotBlank(pacId))wrapper.eq(TjReservation::getPacId, pacId); + List<TjReservation> reservationList = reservationService.list(wrapper); + if (null != reservationList && !reservationList.isEmpty()) { + List<TeamTjPeopleVo> syList = new ArrayList<>(); + List<TeamTjPeopleVo> yjwjzList = new ArrayList<>(); + List<TeamTjPeopleVo> wjList = new ArrayList<>(); + for (TjReservation reservation : reservationList) { + TeamTjPeopleVo vo = new TeamTjPeopleVo(); + vo.setName(reservation.getName()); + vo.setXb(reservation.getSex().toString()); + vo.setDh(reservation.getPhoe()); + TjCustomer customer = null; + try { + customer = customerService.getTjCustomerByCusIdCard( reservation.getIdCard()); + } catch (Exception e) { + log.error("鏍规嵁鍥㈤槦缂栧彿鏌ヨ鍥㈤槦棰勭害淇℃伅寮傚父"+reservation.getIdCard()); + throw new RuntimeException(e); } - } else { - vo.setTjStatus("鏈� 妫�"); + if (null != customer) { + TjOrder tjOrder = orderService.getOne(new LambdaQueryWrapper<TjOrder>().eq(TjOrder::getUserId, customer.getCusId()).eq(TjOrder::getTeamNo, teamNo)); + if (null != tjOrder) { + TjFlowingWater water = tjFlowingWaterService.getOne(new LambdaQueryWrapper<TjFlowingWater>() + .eq(TjFlowingWater::getOrderId, tjOrder.getOrderId()).eq(TjFlowingWater::getIsAddition, "N")); + if(null != water && water.getSfjs().equals("0") && water.getJsrq() ==null){ + vo.setTjh(tjOrder.getTjNumber()); + int sfwc = remarkService.panduaniswancheng(tjOrder.getTjNumber()); + if (sfwc==0) { + vo.setTjStatus("宸插畬鎴�"); + vo.setTjTime(DateUtil.format(tjOrder.getCreateTime(),"yyyy-MM-dd")); + vo.setTjf(water.getPaidIn()); + } else { + vo.setTjTime(DateUtil.format(tjOrder.getCreateTime(),"yyyy-MM-dd")); + vo.setTjf(water.getPaidIn()); + vo.setTjStatus("鍦� 妫�"); + } + yjwjzList.add(vo); + } + } else { + vo.setTjStatus("鏈� 妫�"); + vo.setTjf(transitionService.sumNowPrice(reservation.getIdCard())); + wjList.add(vo); + } + }else { + vo.setTjStatus("鏈� 妫�"); + vo.setTjf(transitionService.sumNowPrice(reservation.getIdCard())); + wjList.add(vo); + } + syList.add(vo); + } - voList.add(vo); + map.put("syList",syList); + map.put("yjwjzList",yjwjzList); + map.put("wjList",wjList); + return AjaxResult.success(map); } - return AjaxResult.success(voList); + return AjaxResult.success(null); + } catch (Exception e) { + log.error("鏌ヨ鍥㈤槦浣撴浜哄憳淇℃伅寮傚父"); + throw new RuntimeException(e); } - return AjaxResult.success(null); + } + + + + @GetMapping("/getTjCompPay") + @ApiOperation(value = "鏍规嵁鍥㈤槦浣撴缂栧彿鍜屽椁恑d鑾峰彇缁撹处淇℃伅") + public AjaxResult getTjCompPay(@RequestParam @ApiParam(value = "鍥㈤槦缂栧彿") String teamNo, + @RequestParam @ApiParam(value = "濂楅id") String pacId) { + + try { + LambdaQueryWrapper<TjCompPay> wq = new LambdaQueryWrapper<>(); + wq.eq(TjCompPay::getTeamNo, teamNo); + wq.eq(TjCompPay::getPacId, pacId); + List<TjCompPay> tjCompPays = compPayService.list(wq); + if(null !=tjCompPays && !tjCompPays.isEmpty()){ + for (TjCompPay pay : tjCompPays) { + LambdaQueryWrapper<TjCompPayInfo> wqInfo = new LambdaQueryWrapper<>(); + wqInfo.eq(TjCompPayInfo::getTjCompPayId, pay.getId()); + List<TjCompPayInfo> payInfos = payInfoService.list(wqInfo); + if(null !=payInfos && !payInfos.isEmpty()){ + for (TjCompPayInfo info : payInfos) { + TjOrder order = orderService.getOrderByTjNum(info.getTjh()); + if(null != order){ + TjCustomer tjCustomer = customerService.getById(order.getUserId()); + if (null != tjCustomer) { + info.setName(tjCustomer.getCusName()); + } + } + } + } + pay.setPayInfo(payInfos); + } + } + return AjaxResult.success(tjCompPays); + } catch (Exception e) { + log.error("鏌ヨ鍥㈤槦浣撴浜哄憳淇℃伅寮傚父"); + throw new RuntimeException(e); + } } } diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjCompPay.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjCompPay.java index 1064924..e4476ef 100644 --- a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjCompPay.java +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjCompPay.java @@ -44,6 +44,13 @@ private String compId; /** + * 濂楅id + */ + @Excel(name = "濂楅id") + @ApiModelProperty(value = "濂楅id") + private String pacId; + + /** * 鍗曚綅缂磋垂娴佹按 */ @Excel(name = "鍗曚綅缂磋垂娴佹按") @@ -104,10 +111,35 @@ @ApiModelProperty(value = "鏄惁缁撹处") private String isCheckout; + /** + * 浜ゆ浜� + */ + @Excel(name = "浜ゆ浜�") + @ApiModelProperty(value = "浜ゆ浜�") + private String payer; + + /** + * 鏀舵浜� + */ + @Excel(name = "鏀舵浜�") + @ApiModelProperty(value = "鏀舵浜�") + private String payee; + + /** + * 鏀粯鏂瑰紡 + */ + @Excel(name = "鏀粯鏂瑰紡",dictType="dict_pay_method") + @ApiModelProperty(value = "鏀粯鏂瑰紡") + private Long paymentMethod; + @ApiModelProperty(value = "缁撹处鏄庣粏琛�") @TableField(exist = false) - private TjCompPayInfo payInfo; + private List<TjCompPayInfo> payInfo; + + @ApiModelProperty(value = "浣撴鍙烽泦鍚�") + @TableField(exist = false) + private List<String> tjhs; @Override diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjCompPayInfo.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjCompPayInfo.java index b92e467..8417998 100644 --- a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjCompPayInfo.java +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjCompPayInfo.java @@ -1,6 +1,7 @@ package com.ltkj.hosp.domain; import java.math.BigDecimal; +import java.util.List; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; @@ -33,6 +34,16 @@ */ @TableId private String id; + + /** + * 浣撴鍙� + */ + @ApiModelProperty(value = "浣撴鍙�") + private String tjh; + + @ApiModelProperty(value = "濮撳悕") + @TableField(exist = false) + private String name; /** * 涓昏〃id @@ -75,6 +86,10 @@ @ApiModelProperty(value = "鏀舵浜�") private String payee; + @ApiModelProperty(value = "濂楅id") + @TableField(exist = false) + private String pacId; + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjFlowingWater.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjFlowingWater.java index 3fbc5fe..e38a569 100644 --- a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjFlowingWater.java +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjFlowingWater.java @@ -1,5 +1,6 @@ package com.ltkj.hosp.domain; +import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.FieldStrategy; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; @@ -189,14 +190,21 @@ @ApiModelProperty(value = "缁撶畻鏃ユ湡") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField(fill = FieldFill.UPDATE) private Date jsrq; @ApiModelProperty(value = "缁撶畻浜轰唬鐮�") + @TableField(fill = FieldFill.UPDATE) private String jsrdm; @ApiModelProperty(value = "缁撶畻浜哄鍚�") + @TableField(fill = FieldFill.UPDATE) private String jsrxm; + @ApiModelProperty(value = "缁撶畻鍗曞彿") + @TableField(fill = FieldFill.UPDATE) + private String jsdh; + /** * 鏀惰垂id */ diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjTeamSelectRecord.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjTeamSelectRecord.java index 4c6f6d1..8b1cc8d 100644 --- a/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjTeamSelectRecord.java +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjTeamSelectRecord.java @@ -77,6 +77,10 @@ @TableField(exist = false) private Integer sjCount; + @ApiModelProperty(value = "宸茬粨绠椾汉鏁�") + @TableField(exist = false) + private Integer yjsrs; + /** * 浜ゆ槗閲戦 */ @@ -97,17 +101,11 @@ @ApiModelProperty(value = "鍥㈤槦缂栧彿") private String teamNo; - @ApiModelProperty(value = "缁撹处鏄庣粏琛�") - @TableField(exist = false) - private List<TjCompPayInfo> payInfoList; - @ApiModelProperty(value = "缁撹处鏄庣粏琛�") - @TableField(exist = false) - private TjCompPayInfo payInfo; + /** * 绛剧害閲戦 */ @ApiModelProperty(value = "搴旀敹閲戦") - @TableField(exist = false) private BigDecimal copeWith; @ApiModelProperty(value = "绛剧害閲戦") @@ -125,9 +123,6 @@ @ApiModelProperty(value = "绛剧害浜�") private String payer; - @ApiModelProperty(value = "鍗曢」(鐖堕」)") - @TableField(exist = false) - private List<TjProject> tjProjectList; /** diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjCompPayMapper.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjCompPayMapper.java index 2409eb1..8ca85b8 100644 --- a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjCompPayMapper.java +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjCompPayMapper.java @@ -4,6 +4,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ltkj.hosp.domain.TjCompPay; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.math.BigDecimal; +import java.util.List; /** * 浣撴鍗曚綅缂磋垂涓籑apper鎺ュ彛 @@ -13,4 +18,12 @@ */ @Mapper public interface TjCompPayMapper extends BaseMapper<TjCompPay> { + + @Select("SELECT IFNULL(SUM(a.paid_in),0) yf FROM tj_comp_pay a WHERE a.deleted=0 " + + "AND a.comp_id=#{compId} AND a.team_no=#{teamNo} AND a.pac_id=#{pacId}") + BigDecimal sumZje(@Param("compId")String compId, @Param("teamNo") String teamNo, @Param("pacId") String pacId); + + @Select("SELECT a.serial_number FROM tj_comp_pay a WHERE a.deleted=0 " + + "AND a.comp_id=#{compId} AND a.team_no=#{teamNo} AND a.pac_id=#{pacId}") + List<String> serialNumbers(@Param("compId")String compId, @Param("teamNo") String teamNo, @Param("pacId") String pacId); } diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/service/ITjCompPayService.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/service/ITjCompPayService.java index e3846d2..d06d805 100644 --- a/ltkj-hosp/src/main/java/com/ltkj/hosp/service/ITjCompPayService.java +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/service/ITjCompPayService.java @@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.ltkj.hosp.domain.TjCompPay; +import java.math.BigDecimal; +import java.util.List; + /** * 浣撴鍗曚綅缂磋垂涓籗ervice鎺ュ彛 * @@ -11,4 +14,8 @@ * @date 2023-03-14 */ public interface ITjCompPayService extends IService<TjCompPay> { + + BigDecimal sumZje(String compId, String teamNo, String pacId); + + List<String> serialNumbers(String compId, String teamNo, String pacId); } diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjCompPayServiceImpl.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjCompPayServiceImpl.java index 494079f..2fbacd7 100644 --- a/ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjCompPayServiceImpl.java +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjCompPayServiceImpl.java @@ -5,7 +5,11 @@ import com.ltkj.hosp.domain.TjCompPay; import com.ltkj.hosp.mapper.TjCompPayMapper; import com.ltkj.hosp.service.ITjCompPayService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.List; /** * 浣撴鍗曚綅缂磋垂涓籗ervice涓氬姟灞傚鐞� @@ -15,4 +19,17 @@ */ @Service public class TjCompPayServiceImpl extends ServiceImpl<TjCompPayMapper, TjCompPay> implements ITjCompPayService { + + @Autowired + private TjCompPayMapper mapper; + + @Override + public BigDecimal sumZje(String compId, String teamNo, String pacId) { + return mapper.sumZje(compId, teamNo, pacId); + } + + @Override + public List<String> serialNumbers(String compId, String teamNo, String pacId) { + return mapper.serialNumbers(compId, teamNo, pacId); + } } diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/vodomain/TeamTjPeopleVo.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/vodomain/TeamTjPeopleVo.java index 3bcd6ca..a317157 100644 --- a/ltkj-hosp/src/main/java/com/ltkj/hosp/vodomain/TeamTjPeopleVo.java +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/vodomain/TeamTjPeopleVo.java @@ -6,6 +6,7 @@ import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; +import java.math.BigDecimal; import java.util.Date; /** @@ -25,6 +26,23 @@ private String name; /** + * 浣撴鍙� + */ + @ApiModelProperty("浣撴鍙�") + private String tjh; + + + @ApiModelProperty("鎬у埆") + private String xb; + + + @ApiModelProperty("鐢佃瘽") + private String dh; + + @ApiModelProperty("浣撴璐�") + private BigDecimal tjf; + + /** * 濮撳悕 */ @ApiModelProperty("浣撴鐘舵��") @@ -37,6 +55,6 @@ @ApiModelProperty("浣撴鏃堕棿") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date tjTime; + private String tjTime; } -- Gitblit v1.8.0