ltkj-admin/src/main/java/com/ltkj/web/controller/app/CustomerController.java
@@ -2,18 +2,15 @@ import cn.hutool.core.date.DateUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.ltkj.common.core.controller.BaseController; import com.ltkj.common.core.domain.AjaxResult; import com.ltkj.common.core.domain.entity.SysDictData; import com.ltkj.common.utils.StringUtils; import com.ltkj.common.utils.bean.BeanUtils; import com.ltkj.framework.config.MatchUtils; import com.ltkj.hosp.domain.TjCustomer; import com.ltkj.hosp.domain.TjOrder; import com.ltkj.hosp.service.ITjCustomerService; import com.ltkj.hosp.service.ITjOrderService; import com.ltkj.system.service.ISysDictDataService; import com.ltkj.system.service.ISysDictTypeService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; ltkj-admin/src/main/java/com/ltkj/web/controller/mall/WxTeamRecordController.java
New file @@ -0,0 +1,84 @@ package com.ltkj.web.controller.mall; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse; import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult; import com.github.binarywang.wxpay.bean.request.WxPayRefundRequest; import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest; import com.github.binarywang.wxpay.bean.result.BaseWxPayResult; import com.github.binarywang.wxpay.bean.result.WxPayRefundResult; import com.github.binarywang.wxpay.constant.WxPayConstants; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.WxPayService; import com.ltkj.common.core.domain.AjaxResult; import com.ltkj.common.utils.IpUtil; import com.ltkj.common.utils.JacksonUtil; import com.ltkj.framework.config.UserHoder; import com.ltkj.hosp.domain.*; import com.ltkj.hosp.service.*; import com.ltkj.mall.domain.*; import com.ltkj.mall.mallOrderUtils.OrderConstants; import com.ltkj.mall.mallOrderUtils.OrderHandleOption; import com.ltkj.mall.mallOrderUtils.OrderUtil; import com.ltkj.mall.service.*; import com.ltkj.system.service.ISysConfigService; import com.ltkj.web.config.redis.OrderDelayService; import com.ltkj.web.wxUtils.WxUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.IOUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @Company: 西安路泰科技有限公司 * @Author: lige * @Date: 2023/7/13 15:16 */ @RestController @RequestMapping("/cus/teamRecord") @Validated @Api(tags = "小程序团队预约接口") @Slf4j public class WxTeamRecordController { @Resource private ISysConfigService configService; @Autowired private ITjTeamAppLogService tjTeamAppLogService; @Value("${wx.pay.pay-score-notify-url}") private String notifyUrl; @PostMapping("/addTeam") @ApiOperation(value = "小程序团队预约接口") public AjaxResult addTeam(@RequestBody TjTeamAppLog tjTeamAppLog) { final boolean save = tjTeamAppLogService.save(tjTeamAppLog); if (save){ return AjaxResult.success("预约成功"); } return AjaxResult.error("预约失败"); } } ltkj-admin/src/main/java/com/ltkj/web/controller/system/StjSchedulingTimeController.java
@@ -48,10 +48,6 @@ private ISysDeptService deptService; @Autowired private ISysDictDataService dictDataService; @Autowired private ISysRoleService roleService; @Autowired private SysUserRoleService userRoleService; ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysDeptController.java
@@ -283,6 +283,201 @@ } } /** * 化验检查页面列表 */ @GetMapping("/huaYangetProList") @ApiOperation("影像/化验检查页面列表") public AjaxResult huaYangetProList(@ApiParam(value = "体检单号") @RequestParam(required = false) String tjNumber, @ApiParam(value = "0未检,1已检") @RequestParam(defaultValue = "0") Integer type, @ApiParam(value = "姓名)") @RequestParam(required = false) String name, @ApiParam(value = "页码数(默认1)") @RequestParam(defaultValue = "1") Integer page, @ApiParam(value = "显示条数(默认10)") @RequestParam(defaultValue = "10") Integer pageSize) { String userId = SecurityUtils.getLoginUser().getUserId(); Integer ksId = null; SysUser sysUser = null; if (null != userId) { sysUser = userService.getById(Long.valueOf(userId)); if (null != sysUser) { ksId = Math.toIntExact(sysUser.getDeptId()); } } if (ksId == null) { return AjaxResult.error("请输入科室id"); } //根据当前登陆的人的科室id,获取该科室下的所有项目 // TODO: 2023/3/24 给超级管理员赋医生检查权限 List<Long> postIds = sysUser.getPostIds(); List<Long> ksproList = null; if (postIds != null) { for (Long postId : postIds) { LambdaQueryWrapper<SysUserPost> wq111 = new LambdaQueryWrapper<>(); wq111.eq(SysUserPost::getPostId, postId); SysUserPost one = userPostService.getOne(wq111); if (one != null) { SysPost byId = postService.getById(one.getPostId()); if (byId.getPostName().equals("录入员")) { ksproList = projectService.getKsTjProjectIdListBydeptId(String.valueOf(ksId)); } } } } else { ksproList = projectService.getKsTjProjectIdList(); } if (ksproList == null || ksproList.size() == 0) { return AjaxResult.error("请完善科室项目信息"); } List<TjCustomer> customerLis = new ArrayList<>(); //根据体检号查 if (null != tjNumber) { List<TjOrder> orderList = orderService.getOrderListByLikeTjNum(tjNumber); if (null == orderList) { return AjaxResult.success("暂时没有数据"); } for (TjOrder order : orderList) { List<TjOrderDetail> list = Optional.ofNullable(detailService.getTjOrderDetailListByOrderId(String.valueOf(order.getOrderId()))).get(); if (list.size() == 0) { continue; } LambdaQueryWrapper<TjOrderRemark> wqs = new LambdaQueryWrapper<>(); wqs.eq(TjOrderRemark::getTjNumber, order.getTjNumber()); wqs.in(TjOrderRemark::getType, 0,3); List<TjOrderRemark> lists = remarkService.list(wqs); TjCustomer customer = customerService.getById(order.getUserId()); customer.setCusName(MatchUtils.hideCusName(customer.getCusName())); customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard())); if (null != lists && lists.size() > 0) { StringBuilder stringBuilder = new StringBuilder(); for (TjOrderRemark remark : lists) { TjProject byId = projectService.selectTjProjectByProId(remark.getProId()); TjOrderDetail one = detailService.getTjOrderDetailByOrderId(String.valueOf(order.getOrderId()), String.valueOf(byId.getProId())); if (one.getFlowingWaterId() != null) { stringBuilder.append(byId.getProName()).append(";"); } } customer.setNotCheckeds(String.valueOf(stringBuilder)); customer.setTjStatus(0L); } else { customer.setTjStatus(1L); customer.setNotCheckeds("无"); } if (order.getTjType().equals("1")) { customer.setTjType("团体"); } if (order.getTjType().equals("2")) { customer.setTjType("个人"); } customer.setTjTime(order.getCreateTime()); customer.setTjNumber(order.getTjNumber()); customer.setOrderId(order.getOrderId()); customer.setIsHz(order.getIsHz()); customerLis.add(customer); } if (customerLis.size() > 0) { List<TjCustomer> customerList = customerLis.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); Collections.reverse(customerList); Map<String, Object> map = new HashMap<>(); map.put("date", customerList); map.put("total", customerLis.size()); return AjaxResult.success(map); } else { return AjaxResult.success("暂无数据"); } } //根据姓名查询 if (null != name && !"".equals(name)) { LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>(); wq.like(TjCustomer::getCusName, name); List<TjCustomer> list = customerService.list(wq); List<TjCustomer> list11111 = new ArrayList<>(); if (null != list && list.size() > 0) { for (TjCustomer customer : list) { customer.setCusName(MatchUtils.hideCusName(customer.getCusName())); customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard())); List<TjOrder> orderList = orderService.getOrderListByCusId(String.valueOf(customer.getCusId())); if (null != orderList && orderList.size() > 0) { for (TjOrder order : orderList) { List<TjOrderDetail> list111 = Optional.ofNullable(detailService.getTjOrderDetailListByOrderId(String.valueOf(order.getOrderId()))).get(); if (list111.size() == 0) { continue; } List<TjOrderRemark> lists = remarkService.getTjOrderRemarkListByYjNum(order.getTjNumber()); if (null != lists && lists.size() > 0) { StringBuilder stringBuilder = new StringBuilder(); for (TjOrderRemark remark : lists) { TjProject byId = projectService.selectTjProjectByProId(remark.getProId()); TjOrderDetail one = detailService.getTjOrderDetailByOrderId(String.valueOf(order.getOrderId()), String.valueOf(byId.getProId())); if (one.getFlowingWaterId() != null) { stringBuilder.append(byId.getProName()).append(";"); } } customer.setNotCheckeds(String.valueOf(stringBuilder)); if (null == customer.getNotCheckeds()) customer.setNotCheckeds("全部已检"); customer.setTjStatus(0L); } else { customer.setNotCheckeds("无"); customer.setTjStatus(1L); } if (order.getTjType().equals("1")) { customer.setTjType("团体"); } if (order.getTjType().equals("2")) { customer.setTjType("个人"); } customer.setTjTime(order.getCreateTime()); customer.setTjNumber(order.getTjNumber()); customer.setOrderId(order.getOrderId()); customer.setIsHz(order.getIsHz()); list11111.add(customer); } } } if (list11111.size() == 0) { return AjaxResult.success("暂无数据"); } Map<String, Object> map = new HashMap<>(); List<TjCustomer> customers = list11111.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); Collections.reverse(customers); map.put("customers", customers); map.put("total", list11111.size()); return AjaxResult.success(map); } else { return AjaxResult.success("暂无数据"); } } List<TjCustomer> customerLists = new ArrayList<>(); if (type == 0) { customerLists = redisCache.getCacheMapValue(ksId + "ks", "wj"); } if (type == 1) { customerLists = redisCache.getCacheMapValue(ksId + "ks", "yj"); } asyncService.dockerSetCustomerLisByRedis(ksproList, String.valueOf(ksId)); if (customerLists != null && customerLists.size() > 0) { Collections.reverse(customerLists); List<TjCustomer> customerList = customerLists.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); Map<String, Object> map = new HashMap<>(); map.put("date", customerList); map.put("total", customerLists.size()); return AjaxResult.success(map); } else { AjaxResult map = getAjaxResult(type, page, pageSize, ksproList, customerLis); if (map != null) return map; return AjaxResult.success("暂时没有数据"); } } private AjaxResult getAjaxResult(Integer type, Integer page, Integer pageSize, List<Long> ksproList, List<TjCustomer> customerLis) { LambdaQueryWrapper<TjOrderDetail> wq1 = new LambdaQueryWrapper<>(); wq1.eq(TjOrderDetail::getTjStatus, type); ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java
@@ -94,8 +94,6 @@ @Resource private ITjOrderRemarkService remarkService; @Resource private ITjTeamSelectRecordService selectRecordService; @Resource private TjAsyncService asyncService; @Resource private ISysUserService userService; @@ -132,6 +130,9 @@ @Autowired private ITjAskMedicalHistoryService tjAskMedicalHistoryService; @Autowired private ITjReportGetAddressService tjReportGetAddressService; /** @@ -844,11 +845,18 @@ if (null == tjOrder.getPacId() && null != transitionService.getTbTransitionPacIdByCusIdAndPac(String.valueOf(tjOrder.getUserId()))) { tjOrder.setPacId(transitionService.getTbTransitionPacIdByCusIdAndPac(String.valueOf(tjOrder.getUserId()))); } //判断小程序上预约是否付钱 if (null != mallOrder) tjOrder.setMallOrderId(String.valueOf(mallOrder.getId())); tjOrder.setStatus(TjConstants.TJ_BEGIN); if (tjOrderService.save(tjOrder)) { //保存收货地址 if ("2".equals(tjOrder.getGetType())){ final TjReportGetAddress address = tjOrder.getAddAddress(); if (address!=null){ address.setTjNumber(tjNumber); tjReportGetAddressService.save(address); } } Long cusNumber = tjCustomer.getCusNumber(); cusNumber += 1; tjCustomer.setCusNumber(cusNumber); ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjReportController.java
@@ -10,6 +10,7 @@ import java.util.stream.Collectors; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import cn.hutool.core.date.DateUtil; import cn.hutool.core.io.FileUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -18,6 +19,7 @@ import com.itextpdf.text.*; import com.itextpdf.text.pdf.*; import com.itextpdf.text.pdf.draw.LineSeparator; import com.ltkj.common.core.domain.entity.SysDictData; import com.ltkj.common.utils.DateUtils; import com.ltkj.common.utils.SecurityUtils; import com.ltkj.common.utils.StringUtils; @@ -26,6 +28,7 @@ import com.ltkj.hosp.service.*; import com.ltkj.mall.mallOrderUtils.TjConstants; import com.ltkj.system.service.ISysConfigService; import com.ltkj.system.service.ISysDictDataService; import com.ltkj.system.service.ISysUserService; import com.ltkj.web.config.pdfutils.MergePdf; import com.ltkj.web.config.pdfutils.MyHeaderFooter; @@ -85,9 +88,11 @@ @Autowired private ISysConfigService configService; @Autowired private ISysDictDataService dictDataService; // /* *//** // /* *//** // * 查询体检报告存储列表 // *//* // @PreAuthorize("@ss.hasPermi('system:report:list')") @@ -256,32 +261,56 @@ int num = tjOrderRemarkService.getTjYqOrderRemarkByTjNum(tjNumber); if(num >0) return AjaxResult.error("有延期项目暂不能生成报告!!!"); LambdaQueryWrapper<TjReportTemplate> tjReportTemplateLambdaQueryWrapper = new LambdaQueryWrapper<>(); tjReportTemplateLambdaQueryWrapper.eq(TjReportTemplate::getFlag, 1); tjReportTemplateLambdaQueryWrapper.eq(TjReportTemplate::getOpen, 0); TjReportTemplate one1 = reportTemplateService.getOne(tjReportTemplateLambdaQueryWrapper); String template = one1.getTemplate(); String userId = SecurityUtils.getLoginUser().getUsername(); PDFBinaryUtil.base64StringToPDF(template, FileUtil.mkdir(value).getPath() + "\\" + userId + "体检报告封面模板.pdf"); // --------以上------- 根据数据库中的模板二进制文件 转pdf 创建文件夹 将pdf放进本地文件夹 //判断表中有没有该体检报告 不能重复生成 LambdaQueryWrapper<TjReport> wqa = new LambdaQueryWrapper<>(); wqa.eq(TjReport::getTjNumber, tjNumber); wqa.eq(TjReport::getType,"体检报告"); List<TjReport> list2 = tjReportService.list(wqa); if (list2.size() != 0) { return AjaxResult.error("该客户报告已生成!不能重复生成!可直接预览或打印!"); } if (num > 0) return AjaxResult.error("有延期项目暂不能生成报告!!!"); LambdaQueryWrapper<TjOrder> wq = new LambdaQueryWrapper<>(); wq.eq(TjOrder::getTjNumber, tjNumber); TjOrder tjOrder = tjOrderService.getOne(wq); if (null != tjOrder) { LambdaQueryWrapper<TjReportTemplate> tjReportTemplateLambdaQueryWrapper = new LambdaQueryWrapper<>(); if (tjOrder.getTjCategory()!=null){ //查询字典 LambdaQueryWrapper<SysDictData> wqq = new LambdaQueryWrapper<>(); wqq.eq(SysDictData::getDictType, "dict_tjtype"); wqq.eq(SysDictData::getDictValue, tjOrder.getTjCategory()); SysDictData one = dictDataService.getOne(wqq); if (one!=null){ //查询字典 LambdaQueryWrapper<SysDictData> wqq1 = new LambdaQueryWrapper<>(); wqq1.eq(SysDictData::getDictType, "report_template_type"); wqq1.eq(SysDictData::getDictLabel, one.getDictLabel()); SysDictData one1 = dictDataService.getOne(wqq1); if (one1!=null){ tjReportTemplateLambdaQueryWrapper.eq(TjReportTemplate::getFlag, one1.getDictValue()); }else { tjReportTemplateLambdaQueryWrapper.eq(TjReportTemplate::getFlag, 1); } }else { tjReportTemplateLambdaQueryWrapper.eq(TjReportTemplate::getFlag, 1); } } tjReportTemplateLambdaQueryWrapper.eq(TjReportTemplate::getOpen, 0); TjReportTemplate one1 = reportTemplateService.getOne(tjReportTemplateLambdaQueryWrapper); String template = one1.getTemplate(); String userId = SecurityUtils.getLoginUser().getUsername(); PDFBinaryUtil.base64StringToPDF(template, FileUtil.mkdir(value).getPath() + "\\" + userId + "体检报告封面模板.pdf"); // --------以上------- 根据数据库中的模板二进制文件 转pdf 创建文件夹 将pdf放进本地文件夹 //判断表中有没有该体检报告 不能重复生成 LambdaQueryWrapper<TjReport> wqa = new LambdaQueryWrapper<>(); wqa.eq(TjReport::getTjNumber, tjNumber); wqa.eq(TjReport::getType, "体检报告"); List<TjReport> list2 = tjReportService.list(wqa); if (list2.size() != 0) { return AjaxResult.error("该客户报告已生成!不能重复生成!可直接预览或打印!"); } Integer checkStatus = tjOrder.getCheckStatus(); if (checkStatus == 1) { LambdaQueryWrapper<TjCustomer> wq1 = new LambdaQueryWrapper<>(); @@ -331,31 +360,31 @@ String tjtype; if (cusSex == 0) { sex = "男"; name1=tjCustomer.getCusName()+"先生"; name1 = tjCustomer.getCusName() + "先生"; } else { sex = "女"; name1=tjCustomer.getCusName()+"女士"; name1 = tjCustomer.getCusName() + "女士"; } data.put("name",tjCustomer.getCusName()); data.put("cusId",tjCustomer.getCusId()); data.put("name1",name1); data.put("name", tjCustomer.getCusName()); data.put("cusId", tjCustomer.getCusId()); data.put("name1", name1); if ("1".equals(tjOrder.getTjType())) { tjtype = "团队"; data.put("tjtype",tjtype); data.put("tjtype", tjtype); } else { tjtype = "个人"; data.put("tjtype",tjtype); data.put("tjtype", tjtype); } data.put("dstype","统一"); data.put("dstype", "统一"); data.put("sex", sex); data.put("age", DateUtil.ageOfNow(tjCustomer.getCusBrithday())); data.put("tjnumber", tjNumber); data.put("tjdate", DateUtils.parseDateToStr("yyyy/MM/dd", tjOrder.getCreateTime())); data.put("phone", tjCustomer.getCusPhone()); data.put("idcard", MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); data.put("num1",list.size()); data.put("num2",0); data.put("num3",4); data.put("num1", list.size()); data.put("num2", 0); data.put("num3", 4); if (dictComp == null) { data.put("work", "无"); } else { @@ -406,7 +435,7 @@ document.open(); document.add(new Header("健康体检结果","健康体检结果")); document.add(new Header("健康体检结果", "健康体检结果")); Map<TjOrderRemark, List<TjPdfVO>> tjOrderRemarkObjectMap = addTable(tjNumber); @@ -415,7 +444,7 @@ LambdaQueryWrapper<TjProject> wqqq = new LambdaQueryWrapper<>(); wqqq.eq(TjProject::getProId, entry.getKey().getProId()); TjProject one11 = projectService.getOne(wqqq); if("1".equals(one11.getProCheckMethod())){ if ("1".equals(one11.getProCheckMethod())) { String titleName = one11.getProName(); // 设置标题字体样式 Font titleFonts = PdfUtils.setFont(9); @@ -438,36 +467,36 @@ } String remark = "备注:" + entry.getKey().getRemark(); if (entry.getKey().getRemark().length()>50){ int j=0; for (int i = 0; i < remark.length()/50; i++) { String substring = remark.substring(j, j+50); if (entry.getKey().getRemark().length() > 50) { int j = 0; for (int i = 0; i < remark.length() / 50; i++) { String substring = remark.substring(j, j + 50); Font remarkFonts = PdfUtils.setFont(9); Paragraph pp = PdfUtils.setParagraph(remarkFonts, substring); document.add(pp); j=j+50; j = j + 50; } if (remark.length()%50!=0){ String substring = remark.substring((remark.length()/50)*50, remark.length()-1); if (remark.length() % 50 != 0) { String substring = remark.substring((remark.length() / 50) * 50, remark.length() - 1); Font remarkFonts = PdfUtils.setFont(9); Paragraph pp = PdfUtils.setParagraph(remarkFonts, substring); document.add(pp); } }else { } else { Font remarkFonts = PdfUtils.setFont(9); Paragraph pp = PdfUtils.setParagraph(remarkFonts, remark); document.add(pp); } //判断主检医师是否为空 空不能显示null if (null !=entry.getKey().getDoctorName() && null !=userService.getById(entry.getKey().getDoctorName())) { if (null != entry.getKey().getDoctorName() && null != userService.getById(entry.getKey().getDoctorName())) { //主检医师 String doctorName = "主检医师:" + userService.getById(entry.getKey().getDoctorName()).getNickName(); Font doctorFonts = PdfUtils.setFont(9); Paragraph df = PdfUtils.setParagraph(doctorFonts, doctorName); df.setAlignment(Element.ALIGN_RIGHT); document.add(df); }else { } else { String doctorName = "主检医师:" + "无"; Font doctorFonts = PdfUtils.setFont(9); Paragraph df = PdfUtils.setParagraph(doctorFonts, doctorName); @@ -479,7 +508,7 @@ //分割线 LineSeparator objectName = new LineSeparator(); document.add(objectName); }else { } else { String titleName = one11.getProName(); // 设置标题字体样式 Font titleFonts = PdfUtils.setFont(9); @@ -502,36 +531,36 @@ } String remark = "备注:" + entry.getKey().getRemark(); if (entry.getKey().getRemark().length()>50){ int j=0; for (int i = 0; i < remark.length()/50; i++) { String substring = remark.substring(j, j+50); if (entry.getKey().getRemark().length() > 50) { int j = 0; for (int i = 0; i < remark.length() / 50; i++) { String substring = remark.substring(j, j + 50); Font remarkFonts = PdfUtils.setFont(9); Paragraph pp = PdfUtils.setParagraph(remarkFonts, substring); document.add(pp); j=j+50; j = j + 50; } if (remark.length()%50!=0){ String substring = remark.substring((remark.length()/50)*50, remark.length()-1); if (remark.length() % 50 != 0) { String substring = remark.substring((remark.length() / 50) * 50, remark.length() - 1); Font remarkFonts = PdfUtils.setFont(9); Paragraph pp = PdfUtils.setParagraph(remarkFonts, substring); document.add(pp); } }else { } else { Font remarkFonts = PdfUtils.setFont(9); Paragraph pp = PdfUtils.setParagraph(remarkFonts, remark); document.add(pp); } //判断主检医师是否为空 空不能显示null if (null !=entry.getKey().getDoctorName() && null !=userService.getById(entry.getKey().getDoctorName())) { if (null != entry.getKey().getDoctorName() && null != userService.getById(entry.getKey().getDoctorName())) { //主检医师 String doctorName = "主检医师:" + userService.getById(entry.getKey().getDoctorName()).getNickName(); Font doctorFonts = PdfUtils.setFont(9); Paragraph df = PdfUtils.setParagraph(doctorFonts, doctorName); df.setAlignment(Element.ALIGN_RIGHT); document.add(df); }else { } else { String doctorName = "主检医师:" + "无"; Font doctorFonts = PdfUtils.setFont(9); Paragraph df = PdfUtils.setParagraph(doctorFonts, doctorName); @@ -571,9 +600,9 @@ //合并 String[] files1 = {value + "\\" + userId + "体检报告封面页.pdf", value + "\\" + userId + "体检报告项目详情页.pdf",value + "\\" + userId + "医学名词.pdf",value + "\\" + userId + "附件.pdf",value + "\\" + userId + "心电图.pdf"}; String[] files1 = {value + "\\" + userId + "体检报告封面页.pdf", value + "\\" + userId + "体检报告项目详情页.pdf", value + "\\" + userId + "医学名词.pdf", value + "\\" + userId + "附件.pdf", value + "\\" + userId + "心电图.pdf"}; String outputPath1 = value + "\\"; String outputFileName1 = userId+tjNumber +tjCustomer.getCusName()+ "_体检报告.pdf"; String outputFileName1 = userId + tjNumber + tjCustomer.getCusName() + "_体检报告.pdf"; File file1 = new File(outputPath1 + outputFileName1); List<File> f = new ArrayList<>(); @@ -631,14 +660,14 @@ LambdaQueryWrapper<TjOrderDetail> wq = new LambdaQueryWrapper<>(); wq.eq(TjOrderDetail::getOrderId, one.getOrderId()); //20230323判断项目已检 wq.ne(TjOrderDetail::getTjStatus,0); wq.ne(TjOrderDetail::getTjStatus, 0); List<TjOrderDetail> tjOrderDetails = tjOrderDetailService.list(wq); //遍历体检记录 将项目的具体信息 //遍历客户所选的项目(包含子项父项) for (TjOrderDetail tjOrderDetail : tjOrderDetails) { TjProject tjProject = projectService.getById(tjOrderDetail.getProId()); if(null !=tjProject){ if (null != tjProject) { tjOrderDetail.setProject(tjProject); } } @@ -657,8 +686,8 @@ for (Map.Entry<TjOrderRemark, List<TjPdfVO>> entry : printReport.entrySet()) { List<TjPdfVO> tjPdfVOS = new ArrayList<>(); for (TjOrderDetail tjOrderDetail : tjOrderDetails) { if(null==tjOrderDetail.getProject()){ System.out.println("'''''''''''''''''''''''''''''''''''"+tjOrderDetail.getOrderDetailId()); if (null == tjOrderDetail.getProject()) { System.out.println("'''''''''''''''''''''''''''''''''''" + tjOrderDetail.getOrderDetailId()); } if (tjOrderDetail.getProject().getProParentId().equals(entry.getKey().getProId())) { @@ -667,7 +696,7 @@ wq6.eq(TjStandard::getProId, tjOrderDetail.getProId()); List<TjStandard> list2 = tjStandardService.list(wq6); if (list2.size() == 0) { TjStandard s=new TjStandard(); TjStandard s = new TjStandard(); s.setCompany(" "); s.setTjStandardLtValue(" "); s.setTjStandardGtValue(" "); @@ -696,19 +725,19 @@ tjPdfVO.setExc(tjOrderDetail.getExceptionDesc()); if (tjOrderDetail.getStandard() != null) { //单位 if (tjOrderDetail.getStandard().getCompany()==null){ if (tjOrderDetail.getStandard().getCompany() == null) { tjPdfVO.setCompany(" "); }else { } else { tjPdfVO.setCompany(tjOrderDetail.getStandard().getCompany()); } //最大值和最小值 String tjStandardGtValue = tjOrderDetail.getStandard().getTjStandardGtValue(); String tjStandardLtValue = tjOrderDetail.getStandard().getTjStandardLtValue(); if (tjStandardGtValue==null){ tjStandardGtValue=" "; if (tjStandardGtValue == null) { tjStandardGtValue = " "; } if (tjStandardLtValue==null){ tjStandardLtValue=" "; if (tjStandardLtValue == null) { tjStandardLtValue = " "; } tjPdfVO.setStandardValue(tjStandardLtValue + "-" + tjStandardGtValue); } @@ -734,7 +763,7 @@ LambdaQueryWrapper<TjOrder> wq1 = new LambdaQueryWrapper<>(); wq1.eq(TjOrder::getTjNumber,tjNumber); wq1.eq(TjOrder::getTjNumber, tjNumber); TjOrder tjOrder = tjOrderService.getOne(wq1); @@ -745,17 +774,17 @@ LambdaQueryWrapper<TjReport> we = new LambdaQueryWrapper<>(); we.eq(TjReport::getTjNumber, tjNumber); we.eq(TjReport::getType,"体检报告"); we.eq(TjReport::getType, "体检报告"); TjReport one = tjReportService.getOne(we); if (one == null) { return; } String userId = SecurityUtils.getLoginUser().getUsername(); PDFBinaryUtil.base64StringToPDF(one.getReport(), FileUtil.mkdir(value).getPath() + "\\" + userId+tjNumber +tjCustomer.getCusName()+ "_体检报告.pdf"); PDFBinaryUtil.base64StringToPDF(one.getReport(), FileUtil.mkdir(value).getPath() + "\\" + userId + tjNumber + tjCustomer.getCusName() + "_体检报告.pdf"); //String filePath = one.getPath(); String filePath = value+ "\\" + userId+tjNumber +tjCustomer.getCusName()+ "_体检报告.pdf"; String filePath = value + "\\" + userId + tjNumber + tjCustomer.getCusName() + "_体检报告.pdf"; File f = new File(filePath); if (filePath.isEmpty()){ if (filePath.isEmpty()) { System.out.println("文件不存在!"); return; } @@ -775,13 +804,13 @@ String contentType = u.openConnection().getContentType(); response.setContentType(contentType); response.setHeader("Content-Disposition", "inline;filename=" + userId+tjNumber + ".pdf"); + userId + tjNumber + ".pdf"); } else { // 纯下载方式 response.setContentType("application/x-msdownload"); response.setContentType("application/pdf;charset=utf-8"); response.setHeader("Content-Disposition", "attachment;filename=" + userId+tjNumber + ".pdf"); + userId + tjNumber + ".pdf"); } out = response.getOutputStream(); while ((len = br.read(bs)) > 0) { @@ -816,7 +845,7 @@ QueryWrapper<TjReport> wq1 = new QueryWrapper<>(); wq1.eq("tj_number", tjNumber); wq1.eq("type", "体检报告"); if (null!=tjReportService.getOne(wq1)){ if (null != tjReportService.getOne(wq1)) { if (!tjReportService.remove(wq1)) { return AjaxResult.error("撤回失败!"); } @@ -828,7 +857,7 @@ String config = configService.selectConfigByKey("tj_confirm"); if ("Y".equals(config)) { one.setStatus(TjConstants.TJ_CHECK); }else { } else { one.setStatus(TjConstants.TJ_CONFIRM); } //将状态改为未审核 @@ -847,330 +876,330 @@ @GetMapping("/tuanDuiReport") @ApiOperation(value = "生成团队体检报告——年龄统计") public Map<String,List<Map<String, Object>>> tuanDuiReport(@ApiParam(value = "单位") @RequestParam String firmId, @ApiParam(value = "部门") @RequestParam String firmDeptId){ Map<String,List<Map<String, Object>>> all=new HashMap<>(); List<Map<String, Object>> res1=new ArrayList<>(); public Map<String, List<Map<String, Object>>> tuanDuiReport(@ApiParam(value = "单位") @RequestParam String firmId, @ApiParam(value = "部门") @RequestParam String firmDeptId) { Map<String, List<Map<String, Object>>> all = new HashMap<>(); List<Map<String, Object>> res1 = new ArrayList<>(); int a=0; Map<String, Object> resMap1=new HashMap<>(); resMap1.put("name","0-19岁"); resMap1.put("value",a); int a = 0; Map<String, Object> resMap1 = new HashMap<>(); resMap1.put("name", "0-19岁"); resMap1.put("value", a); res1.add(resMap1); Map<String, Object> resMap2=new HashMap<>(); resMap2.put("name","20-29岁"); resMap2.put("value",a); Map<String, Object> resMap2 = new HashMap<>(); resMap2.put("name", "20-29岁"); resMap2.put("value", a); res1.add(resMap2); Map<String, Object> resMap3=new HashMap<>(); resMap3.put("name","30-39岁"); resMap3.put("value",a); Map<String, Object> resMap3 = new HashMap<>(); resMap3.put("name", "30-39岁"); resMap3.put("value", a); res1.add(resMap3); Map<String, Object> resMap4=new HashMap<>(); resMap4.put("name","40-49岁"); resMap4.put("value",a); Map<String, Object> resMap4 = new HashMap<>(); resMap4.put("name", "40-49岁"); resMap4.put("value", a); res1.add(resMap4); Map<String, Object> resMap5=new HashMap<>(); resMap5.put("name","50-59岁"); resMap5.put("value",a); Map<String, Object> resMap5 = new HashMap<>(); resMap5.put("name", "50-59岁"); resMap5.put("value", a); res1.add(resMap5); Map<String, Object> resMap6=new HashMap<>(); resMap6.put("name","60-69岁"); resMap6.put("value",a); Map<String, Object> resMap6 = new HashMap<>(); resMap6.put("name", "60-69岁"); resMap6.put("value", a); res1.add(resMap6); Map<String, Object> resMap7=new HashMap<>(); resMap7.put("name","70-79岁"); resMap7.put("value",a); Map<String, Object> resMap7 = new HashMap<>(); resMap7.put("name", "70-79岁"); resMap7.put("value", a); res1.add(resMap7); Map<String, Object> resMap8=new HashMap<>(); resMap8.put("name","80岁+"); resMap8.put("value",a); Map<String, Object> resMap8 = new HashMap<>(); resMap8.put("name", "80岁+"); resMap8.put("value", a); res1.add(resMap8); LambdaQueryWrapper<TjOrder> wq2=new LambdaQueryWrapper<>(); wq2.eq(TjOrder::getFirmId,firmId); wq2.eq(TjOrder::getFirmDeptId,firmDeptId); wq2.eq(TjOrder::getTjType,"1"); wq2.in(TjOrder::getStatus,401,402); LambdaQueryWrapper<TjOrder> wq2 = new LambdaQueryWrapper<>(); wq2.eq(TjOrder::getFirmId, firmId); wq2.eq(TjOrder::getFirmDeptId, firmDeptId); wq2.eq(TjOrder::getTjType, "1"); wq2.in(TjOrder::getStatus, 401, 402); final List<TjOrder> list = tjOrderService.list(wq2); for (TjOrder tjOrder : list) { a=0; a = 0; final TjCustomer byId = tjCustomerService.getById(tjOrder.getUserId()); final int ageByIdCard = MatchUtils.getAgeByIdCard(byId.getCusIdcard()); if (0<=ageByIdCard && ageByIdCard<=19){ if (0 <= ageByIdCard && ageByIdCard <= 19) { for (int i = 0; i < res1.size(); i++) { if ("0-19岁".equals(res1.get(i).get("name"))){ a+=1; res1.get(i).put("value",a); if ("0-19岁".equals(res1.get(i).get("name"))) { a += 1; res1.get(i).put("value", a); } } }else if (20<=ageByIdCard && ageByIdCard<=29){ } else if (20 <= ageByIdCard && ageByIdCard <= 29) { for (int i = 0; i < res1.size(); i++) { if ("20-29岁".equals(res1.get(i).get("name"))){ a+=1; res1.get(i).put("value",a); if ("20-29岁".equals(res1.get(i).get("name"))) { a += 1; res1.get(i).put("value", a); } } }else if (30<=ageByIdCard && ageByIdCard<=39){ } else if (30 <= ageByIdCard && ageByIdCard <= 39) { for (int i = 0; i < res1.size(); i++) { if ("30-39岁".equals(res1.get(i).get("name"))){ a+=1; res1.get(i).put("value",a); if ("30-39岁".equals(res1.get(i).get("name"))) { a += 1; res1.get(i).put("value", a); } } }else if (40<=ageByIdCard && ageByIdCard<=49){ } else if (40 <= ageByIdCard && ageByIdCard <= 49) { for (int i = 0; i < res1.size(); i++) { if ("40-49岁".equals(res1.get(i).get("name"))){ a+=1; res1.get(i).put("value",a); if ("40-49岁".equals(res1.get(i).get("name"))) { a += 1; res1.get(i).put("value", a); } } }else if (50<=ageByIdCard && ageByIdCard<=59){ } else if (50 <= ageByIdCard && ageByIdCard <= 59) { for (int i = 0; i < res1.size(); i++) { if ("50-59岁".equals(res1.get(i).get("name"))){ a+=1; res1.get(i).put("value",a); if ("50-59岁".equals(res1.get(i).get("name"))) { a += 1; res1.get(i).put("value", a); } } }else if (60<=ageByIdCard && ageByIdCard<=69){ } else if (60 <= ageByIdCard && ageByIdCard <= 69) { for (int i = 0; i < res1.size(); i++) { if ("60-69岁".equals(res1.get(i).get("name"))){ a+=1; res1.get(i).put("value",a); if ("60-69岁".equals(res1.get(i).get("name"))) { a += 1; res1.get(i).put("value", a); } } }else if (70<=ageByIdCard && ageByIdCard<=79){ } else if (70 <= ageByIdCard && ageByIdCard <= 79) { for (int i = 0; i < res1.size(); i++) { if ("70-79岁".equals(res1.get(i).get("name"))){ a+=1; res1.get(i).put("value",a); if ("70-79岁".equals(res1.get(i).get("name"))) { a += 1; res1.get(i).put("value", a); } } }else { } else { for (int i = 0; i < res1.size(); i++) { if ("80岁+".equals(res1.get(i).get("name"))){ a+=1; res1.get(i).put("value",a); if ("80岁+".equals(res1.get(i).get("name"))) { a += 1; res1.get(i).put("value", a); } } } } all.put("data",res1); all.put("data", res1); return all; } @GetMapping("/tuanDuiReportBySex") @ApiOperation(value = "生成团队体检报告——年龄性别统计") public Map<String,List<Map<String, Object>>> tuanDuiReportBySex(@ApiParam(value = "单位") @RequestParam String firmIds, @ApiParam(value = "部门") @RequestParam String firmDeptIds){ Map<String,List<Map<String, Object>>> all=new HashMap<>(); List<Map<String, Object>> res1=new ArrayList<>(); public Map<String, List<Map<String, Object>>> tuanDuiReportBySex(@ApiParam(value = "单位") @RequestParam String firmIds, @ApiParam(value = "部门") @RequestParam String firmDeptIds) { Map<String, List<Map<String, Object>>> all = new HashMap<>(); List<Map<String, Object>> res1 = new ArrayList<>(); int a=0; int b=0; int c=0; Map<String, Object> resMap1=new HashMap<>(); resMap1.put("name","0-19岁"); resMap1.put("value",a); resMap1.put("boy",b); resMap1.put("girl",c); resMap1.put("value1",0); resMap1.put("boy1",0); resMap1.put("girl1",0); int a = 0; int b = 0; int c = 0; Map<String, Object> resMap1 = new HashMap<>(); resMap1.put("name", "0-19岁"); resMap1.put("value", a); resMap1.put("boy", b); resMap1.put("girl", c); resMap1.put("value1", 0); resMap1.put("boy1", 0); resMap1.put("girl1", 0); res1.add(resMap1); Map<String, Object> resMap2=new HashMap<>(); resMap2.put("name","20-29岁"); resMap2.put("value",a); resMap2.put("boy",b); resMap2.put("girl",c); resMap2.put("value1",0); resMap2.put("boy1",0); resMap2.put("girl1",0); Map<String, Object> resMap2 = new HashMap<>(); resMap2.put("name", "20-29岁"); resMap2.put("value", a); resMap2.put("boy", b); resMap2.put("girl", c); resMap2.put("value1", 0); resMap2.put("boy1", 0); resMap2.put("girl1", 0); res1.add(resMap2); Map<String, Object> resMap3=new HashMap<>(); resMap3.put("name","30-39岁"); resMap3.put("value",a); resMap3.put("boy",b); resMap3.put("girl",c); resMap3.put("value1",0); resMap3.put("boy1",0); resMap3.put("girl1",0); Map<String, Object> resMap3 = new HashMap<>(); resMap3.put("name", "30-39岁"); resMap3.put("value", a); resMap3.put("boy", b); resMap3.put("girl", c); resMap3.put("value1", 0); resMap3.put("boy1", 0); resMap3.put("girl1", 0); res1.add(resMap3); Map<String, Object> resMap4=new HashMap<>(); resMap4.put("name","40-49岁"); resMap4.put("value",a); resMap4.put("boy",b); resMap4.put("girl",c); resMap4.put("value1",0); resMap4.put("boy1",0); resMap4.put("girl1",0); Map<String, Object> resMap4 = new HashMap<>(); resMap4.put("name", "40-49岁"); resMap4.put("value", a); resMap4.put("boy", b); resMap4.put("girl", c); resMap4.put("value1", 0); resMap4.put("boy1", 0); resMap4.put("girl1", 0); res1.add(resMap4); Map<String, Object> resMap5=new HashMap<>(); resMap5.put("name","50-59岁"); resMap5.put("value",a); resMap5.put("boy",b); resMap5.put("girl",c); resMap5.put("value1",0); resMap5.put("boy1",0); resMap5.put("girl1",0); Map<String, Object> resMap5 = new HashMap<>(); resMap5.put("name", "50-59岁"); resMap5.put("value", a); resMap5.put("boy", b); resMap5.put("girl", c); resMap5.put("value1", 0); resMap5.put("boy1", 0); resMap5.put("girl1", 0); res1.add(resMap5); Map<String, Object> resMap6=new HashMap<>(); resMap6.put("name","60-69岁"); resMap6.put("value",a); resMap6.put("boy",b); resMap6.put("girl",c); resMap6.put("value1",0); resMap6.put("boy1",0); resMap6.put("girl1",0); Map<String, Object> resMap6 = new HashMap<>(); resMap6.put("name", "60-69岁"); resMap6.put("value", a); resMap6.put("boy", b); resMap6.put("girl", c); resMap6.put("value1", 0); resMap6.put("boy1", 0); resMap6.put("girl1", 0); res1.add(resMap6); Map<String, Object> resMap7=new HashMap<>(); resMap7.put("name","70-79岁"); resMap7.put("value",a); resMap7.put("boy",b); resMap7.put("girl",c); resMap7.put("value1",0); resMap7.put("boy1",0); resMap7.put("girl1",0); Map<String, Object> resMap7 = new HashMap<>(); resMap7.put("name", "70-79岁"); resMap7.put("value", a); resMap7.put("boy", b); resMap7.put("girl", c); resMap7.put("value1", 0); resMap7.put("boy1", 0); resMap7.put("girl1", 0); res1.add(resMap7); Map<String, Object> resMap8=new HashMap<>(); resMap8.put("name","80岁+"); resMap8.put("value",a); resMap8.put("boy",b); resMap8.put("girl",c); resMap8.put("value1",0); resMap8.put("boy1",0); resMap8.put("girl1",0); Map<String, Object> resMap8 = new HashMap<>(); resMap8.put("name", "80岁+"); resMap8.put("value", a); resMap8.put("boy", b); resMap8.put("girl", c); resMap8.put("value1", 0); resMap8.put("boy1", 0); resMap8.put("girl1", 0); res1.add(resMap8); LambdaQueryWrapper<TjOrder> wq2=new LambdaQueryWrapper<>(); wq2.eq(TjOrder::getFirmId,firmIds); wq2.eq(TjOrder::getFirmDeptId,firmDeptIds); wq2.eq(TjOrder::getTjType,"1"); wq2.in(TjOrder::getStatus,401,402); LambdaQueryWrapper<TjOrder> wq2 = new LambdaQueryWrapper<>(); wq2.eq(TjOrder::getFirmId, firmIds); wq2.eq(TjOrder::getFirmDeptId, firmDeptIds); wq2.eq(TjOrder::getTjType, "1"); wq2.in(TjOrder::getStatus, 401, 402); final List<TjOrder> list = tjOrderService.list(wq2); for (TjOrder tjOrder : list) { a=0; b=0; c=0; a = 0; b = 0; c = 0; final TjCustomer byId = tjCustomerService.getById(tjOrder.getUserId()); final int ageByIdCard = MatchUtils.getAgeByIdCard(byId.getCusIdcard()); if (0<=ageByIdCard && ageByIdCard<=19){ if (0 <= ageByIdCard && ageByIdCard <= 19) { for (int i = 0; i < res1.size(); i++) { if ("0-19岁".equals(res1.get(i).get("name"))){ a+=1; res1.get(i).put("value",a); if (byId.getCusSex()==0){ b+=1; }else if (byId.getCusSex()==1){ c+=1; if ("0-19岁".equals(res1.get(i).get("name"))) { a += 1; res1.get(i).put("value", a); if (byId.getCusSex() == 0) { b += 1; } else if (byId.getCusSex() == 1) { c += 1; } res1.get(i).put("boy",b); res1.get(i).put("girl",c); res1.get(i).put("boy", b); res1.get(i).put("girl", c); } } }else if (20<=ageByIdCard && ageByIdCard<=29){ } else if (20 <= ageByIdCard && ageByIdCard <= 29) { for (int i = 0; i < res1.size(); i++) { if ("20-29岁".equals(res1.get(i).get("name"))){ a+=1; res1.get(i).put("value",a); if (byId.getCusSex()==0){ b+=1; }else if (byId.getCusSex()==1){ c+=1; if ("20-29岁".equals(res1.get(i).get("name"))) { a += 1; res1.get(i).put("value", a); if (byId.getCusSex() == 0) { b += 1; } else if (byId.getCusSex() == 1) { c += 1; } res1.get(i).put("boy",b); res1.get(i).put("girl",c); res1.get(i).put("boy", b); res1.get(i).put("girl", c); } } }else if (30<=ageByIdCard && ageByIdCard<=39){ } else if (30 <= ageByIdCard && ageByIdCard <= 39) { for (int i = 0; i < res1.size(); i++) { if ("30-39岁".equals(res1.get(i).get("name"))){ a+=1; res1.get(i).put("value",a); if (byId.getCusSex()==0){ b+=1; }else if (byId.getCusSex()==1){ c+=1; if ("30-39岁".equals(res1.get(i).get("name"))) { a += 1; res1.get(i).put("value", a); if (byId.getCusSex() == 0) { b += 1; } else if (byId.getCusSex() == 1) { c += 1; } res1.get(i).put("boy",b); res1.get(i).put("girl",c); res1.get(i).put("boy", b); res1.get(i).put("girl", c); } } }else if (40<=ageByIdCard && ageByIdCard<=49){ } else if (40 <= ageByIdCard && ageByIdCard <= 49) { for (int i = 0; i < res1.size(); i++) { if ("40-49岁".equals(res1.get(i).get("name"))){ a+=1; res1.get(i).put("value",a); if (byId.getCusSex()==0){ b+=1; }else if (byId.getCusSex()==1){ c+=1; if ("40-49岁".equals(res1.get(i).get("name"))) { a += 1; res1.get(i).put("value", a); if (byId.getCusSex() == 0) { b += 1; } else if (byId.getCusSex() == 1) { c += 1; } res1.get(i).put("boy",b); res1.get(i).put("girl",c); res1.get(i).put("boy", b); res1.get(i).put("girl", c); } } }else if (50<=ageByIdCard && ageByIdCard<=59){ } else if (50 <= ageByIdCard && ageByIdCard <= 59) { for (int i = 0; i < res1.size(); i++) { if ("50-59岁".equals(res1.get(i).get("name"))){ a+=1; res1.get(i).put("value",a); if (byId.getCusSex()==0){ b+=1; }else if (byId.getCusSex()==1){ c+=1; if ("50-59岁".equals(res1.get(i).get("name"))) { a += 1; res1.get(i).put("value", a); if (byId.getCusSex() == 0) { b += 1; } else if (byId.getCusSex() == 1) { c += 1; } res1.get(i).put("boy",b); res1.get(i).put("girl",c); res1.get(i).put("boy", b); res1.get(i).put("girl", c); } } }else if (60<=ageByIdCard && ageByIdCard<=69){ } else if (60 <= ageByIdCard && ageByIdCard <= 69) { for (int i = 0; i < res1.size(); i++) { if ("60-69岁".equals(res1.get(i).get("name"))){ a+=1; res1.get(i).put("value",a); if (byId.getCusSex()==0){ b+=1; }else if (byId.getCusSex()==1){ c+=1; if ("60-69岁".equals(res1.get(i).get("name"))) { a += 1; res1.get(i).put("value", a); if (byId.getCusSex() == 0) { b += 1; } else if (byId.getCusSex() == 1) { c += 1; } res1.get(i).put("boy",b); res1.get(i).put("girl",c); res1.get(i).put("boy", b); res1.get(i).put("girl", c); } } }else if (70<=ageByIdCard && ageByIdCard<=79){ } else if (70 <= ageByIdCard && ageByIdCard <= 79) { for (int i = 0; i < res1.size(); i++) { if ("70-79岁".equals(res1.get(i).get("name"))){ a+=1; res1.get(i).put("value",a); if (byId.getCusSex()==0){ b+=1; }else if (byId.getCusSex()==1){ c+=1; if ("70-79岁".equals(res1.get(i).get("name"))) { a += 1; res1.get(i).put("value", a); if (byId.getCusSex() == 0) { b += 1; } else if (byId.getCusSex() == 1) { c += 1; } res1.get(i).put("boy",b); res1.get(i).put("girl",c); res1.get(i).put("boy", b); res1.get(i).put("girl", c); } } }else { } else { for (int i = 0; i < res1.size(); i++) { if ("80岁+".equals(res1.get(i).get("name"))){ a+=1; res1.get(i).put("value",a); if (byId.getCusSex()==0){ b+=1; }else if (byId.getCusSex()==1){ c+=1; if ("80岁+".equals(res1.get(i).get("name"))) { a += 1; res1.get(i).put("value", a); if (byId.getCusSex() == 0) { b += 1; } else if (byId.getCusSex() == 1) { c += 1; } res1.get(i).put("boy",b); res1.get(i).put("girl",c); res1.get(i).put("boy", b); res1.get(i).put("girl", c); } } } @@ -1180,7 +1209,7 @@ final int value1 = (int) res1.get(i).get("boy"); final int value2 = (int) res1.get(i).get("girl"); final int value = (int) res1.get(i).get("value"); if (value!=0){ if (value != 0) { double percentage = (value1 * 1.0 / value) * 100; NumberFormat nf = NumberFormat.getPercentInstance(); nf.setMinimumFractionDigits(2); @@ -1194,14 +1223,14 @@ NumberFormat numberFormat = NumberFormat.getInstance(); numberFormat.setMaximumFractionDigits(2); String result = numberFormat.format((float) value1 / (float) value2 * 100); res1.get(i).put("boy1",percent1); res1.get(i).put("girl1",percent2); res1.get(i).put("value1",result); res1.get(i).put("boy1", percent1); res1.get(i).put("girl1", percent2); res1.get(i).put("value1", result); } } all.put("data",res1); all.put("data", res1); return all; } @@ -1209,65 +1238,65 @@ @GetMapping("/tuanDuiYiChang") @ApiOperation(value = "生成团队体检报告——异常结果统计") public Map<String,List<Map<String, Object>>> tuanDuiYiChang(@ApiParam(value = "单位") @RequestParam String firmId, @ApiParam(value = "部门") @RequestParam String firmDeptId){ public Map<String, List<Map<String, Object>>> tuanDuiYiChang(@ApiParam(value = "单位") @RequestParam String firmId, @ApiParam(value = "部门") @RequestParam String firmDeptId) { Map<String,List<Map<String, Object>>> all=new HashMap<>(); Map<String, List<Map<String, Object>>> all = new HashMap<>(); LambdaQueryWrapper<TjOrder> wq2=new LambdaQueryWrapper<>(); wq2.eq(TjOrder::getFirmId,firmId); wq2.eq(TjOrder::getFirmDeptId,firmDeptId); wq2.eq(TjOrder::getTjType,"1"); wq2.in(TjOrder::getStatus,401,402); LambdaQueryWrapper<TjOrder> wq2 = new LambdaQueryWrapper<>(); wq2.eq(TjOrder::getFirmId, firmId); wq2.eq(TjOrder::getFirmDeptId, firmDeptId); wq2.eq(TjOrder::getTjType, "1"); wq2.in(TjOrder::getStatus, 401, 402); final List<TjOrder> list = tjOrderService.list(wq2); List<TjOrderDetailRules> res11=new ArrayList<>(); List<TjOrderDetailRules> res11 = new ArrayList<>(); for (TjOrder tjOrder : list) { LambdaQueryWrapper<TjOrderDetailRules> wq1=new LambdaQueryWrapper<>(); wq1.eq(TjOrderDetailRules::getTjNumber,tjOrder.getTjNumber()); LambdaQueryWrapper<TjOrderDetailRules> wq1 = new LambdaQueryWrapper<>(); wq1.eq(TjOrderDetailRules::getTjNumber, tjOrder.getTjNumber()); final List<TjOrderDetailRules> list1 = detailRulesService.list(wq1); //放进集合 res11.addAll(list1); } //去重收集 Map<String, Long> columnCountMap = res11.stream().collect(Collectors.groupingBy(TjOrderDetailRules::getAid, Collectors.counting())); List<Map<String, Object>> aaa=new ArrayList<>(); if (columnCountMap!=null){ for(Map.Entry<String, Long> entry:columnCountMap.entrySet()){ Map<String, Object> resMap=new HashMap<>(); List<Map<String, Object>> aaa = new ArrayList<>(); if (columnCountMap != null) { for (Map.Entry<String, Long> entry : columnCountMap.entrySet()) { Map<String, Object> resMap = new HashMap<>(); final TjRules byId = rulesService.getById(entry.getKey()); if (byId!=null){ if (byId != null) { resMap.put("name", byId.getBingzhong()); resMap.put("value", String.valueOf(entry.getValue())); aaa.add(resMap); } } } all.put("data",aaa); all.put("data", aaa); return all; } @GetMapping("/tuanDuiYiChangBySex") @ApiOperation(value = "生成团队体检报告——男女异常结果统计") public Map<String,List<Map<String, Object>>> tuanDuiYiChangBySex(@ApiParam(value = "单位") @RequestParam String firmId, @ApiParam(value = "部门") @RequestParam String firmDeptId){ public Map<String, List<Map<String, Object>>> tuanDuiYiChangBySex(@ApiParam(value = "单位") @RequestParam String firmId, @ApiParam(value = "部门") @RequestParam String firmDeptId) { Map<String,List<Map<String, Object>>> all=new HashMap<>(); Map<String, List<Map<String, Object>>> all = new HashMap<>(); LambdaQueryWrapper<TjOrder> wq2=new LambdaQueryWrapper<>(); wq2.eq(TjOrder::getFirmId,firmId); wq2.eq(TjOrder::getFirmDeptId,firmDeptId); wq2.eq(TjOrder::getTjType,"1"); wq2.in(TjOrder::getStatus,401,402); LambdaQueryWrapper<TjOrder> wq2 = new LambdaQueryWrapper<>(); wq2.eq(TjOrder::getFirmId, firmId); wq2.eq(TjOrder::getFirmDeptId, firmDeptId); wq2.eq(TjOrder::getTjType, "1"); wq2.in(TjOrder::getStatus, 401, 402); final List<TjOrder> list = tjOrderService.list(wq2); List<String> tjNumberList=list.stream().map(TjOrder::getTjNumber).collect(Collectors.toList()); List<String> tjNumberList = list.stream().map(TjOrder::getTjNumber).collect(Collectors.toList()); List<TjOrderDetailRules> res11=new ArrayList<>(); List<TjOrderDetailRules> res11 = new ArrayList<>(); for (TjOrder tjOrder : list) { LambdaQueryWrapper<TjOrderDetailRules> wq1=new LambdaQueryWrapper<>(); wq1.eq(TjOrderDetailRules::getTjNumber,tjOrder.getTjNumber()); LambdaQueryWrapper<TjOrderDetailRules> wq1 = new LambdaQueryWrapper<>(); wq1.eq(TjOrderDetailRules::getTjNumber, tjOrder.getTjNumber()); final List<TjOrderDetailRules> list1 = detailRulesService.list(wq1); //放进集合 res11.addAll(list1); @@ -1275,36 +1304,36 @@ //去重收集 Map<String, Long> columnCountMap = res11.stream().collect(Collectors.groupingBy(TjOrderDetailRules::getAid, Collectors.counting())); List<Map<String, Object>> aaa=new ArrayList<>(); if (columnCountMap!=null){ List<Map<String, Object>> aaa = new ArrayList<>(); if (columnCountMap != null) { for(Map.Entry<String, Long> entry:columnCountMap.entrySet()){ int a=0; int b=0; Map<String, Object> resMap=new HashMap<>(); for (Map.Entry<String, Long> entry : columnCountMap.entrySet()) { int a = 0; int b = 0; Map<String, Object> resMap = new HashMap<>(); final TjRules byId = rulesService.getById(entry.getKey()); if (byId!=null){ if (byId != null) { resMap.put("name", byId.getBingzhong()); resMap.put("value", entry.getValue().intValue()); resMap.put("boy",a); resMap.put("girl",b); resMap.put("value1",0); resMap.put("boy1",0); resMap.put("girl1",0); resMap.put("boy", a); resMap.put("girl", b); resMap.put("value1", 0); resMap.put("boy1", 0); resMap.put("girl1", 0); // LambdaQueryWrapper<TjOrderDetailRules> wq11=new LambdaQueryWrapper<>(); wq11.eq(TjOrderDetailRules::getAid,entry.getKey()); wq11.in(TjOrderDetailRules::getTjNumber,tjNumberList); LambdaQueryWrapper<TjOrderDetailRules> wq11 = new LambdaQueryWrapper<>(); wq11.eq(TjOrderDetailRules::getAid, entry.getKey()); wq11.in(TjOrderDetailRules::getTjNumber, tjNumberList); final List<TjOrderDetailRules> list1 = detailRulesService.list(wq11); for (TjOrderDetailRules orderDetailRules : list1) { resMap.put("name", orderDetailRules.getBingzhong()); if ("0".equals(orderDetailRules.getCusSex())){ a+=1; resMap.put("boy",a); }else if ("1".equals(orderDetailRules.getCusSex())){ b+=1; resMap.put("girl",b); if ("0".equals(orderDetailRules.getCusSex())) { a += 1; resMap.put("boy", a); } else if ("1".equals(orderDetailRules.getCusSex())) { b += 1; resMap.put("girl", b); } } aaa.add(resMap); @@ -1317,7 +1346,7 @@ final Integer value1 = (Integer) aaa.get(i).get("boy"); final Integer value2 = (Integer) aaa.get(i).get("girl"); final Integer value = (Integer) aaa.get(i).get("value"); if (value!=0){ if (value != 0) { double percentage = (value1 * 1.0 / value) * 100; NumberFormat nf = NumberFormat.getPercentInstance(); nf.setMinimumFractionDigits(2); @@ -1331,13 +1360,13 @@ NumberFormat numberFormat = NumberFormat.getInstance(); numberFormat.setMaximumFractionDigits(2); String result = numberFormat.format((float) value1 / (float) value2 * 100); aaa.get(i).put("boy1",percent1); aaa.get(i).put("girl1",percent2); aaa.get(i).put("value1",result); aaa.get(i).put("boy1", percent1); aaa.get(i).put("girl1", percent2); aaa.get(i).put("value1", result); } } all.put("data",aaa); all.put("data", aaa); return all; } ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjTeamAppLogController.java
New file @@ -0,0 +1,103 @@ package com.ltkj.web.controller.system; import java.util.List; import javax.servlet.http.HttpServletResponse; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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 com.ltkj.common.annotation.Log; import com.ltkj.common.core.controller.BaseController; import com.ltkj.common.core.domain.AjaxResult; import com.ltkj.common.enums.BusinessType; import com.ltkj.hosp.domain.TjTeamAppLog; import com.ltkj.hosp.service.ITjTeamAppLogService; import com.ltkj.common.utils.poi.ExcelUtil; import com.ltkj.common.core.page.TableDataInfo; /** * 小程序团队预约记录Controller * * @author ltkj_赵佳豪&李格 * @date 2023-12-01 */ @RestController @RequestMapping("/hosp/teamAppLog") public class TjTeamAppLogController extends BaseController { @Autowired private ITjTeamAppLogService tjTeamAppLogService; /** * 查询小程序团队预约记录列表 */ @GetMapping("/list") public TableDataInfo list(TjTeamAppLog tjTeamAppLog) { startPage(); LambdaQueryWrapper<TjTeamAppLog> wq=new LambdaQueryWrapper<>(); if (tjTeamAppLog.getCnName()!=null){ wq.like(TjTeamAppLog::getCnName,tjTeamAppLog.getCnName()); } if (tjTeamAppLog.getContactPerson()!=null){ wq.like(TjTeamAppLog::getContactPerson,tjTeamAppLog.getContactPerson()); } if (tjTeamAppLog.getContactPhone()!=null){ wq.like(TjTeamAppLog::getContactPhone,tjTeamAppLog.getContactPhone()); } if (tjTeamAppLog.getTjPacType()!=null){ wq.eq(TjTeamAppLog::getTjPacType,tjTeamAppLog.getTjPacType()); } if (tjTeamAppLog.getTjTime()!=null){ wq.between(TjTeamAppLog::getTjTime,tjTeamAppLog.getBeginTjTime(),tjTeamAppLog.getEndTjTime()); } List<TjTeamAppLog> list = tjTeamAppLogService.list(wq); return getDataTable(list); } /** * 导出小程序团队预约记录列表 */ @Log(title = "小程序团队预约记录", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, TjTeamAppLog tjTeamAppLog) { // List<TjTeamAppLog> list = tjTeamAppLogService.selectTjTeamAppLogList(tjTeamAppLog); LambdaQueryWrapper<TjTeamAppLog> wq=new LambdaQueryWrapper<>(); if (tjTeamAppLog.getCnName()!=null){ wq.like(TjTeamAppLog::getCnName,tjTeamAppLog.getCnName()); } if (tjTeamAppLog.getContactPerson()!=null){ wq.like(TjTeamAppLog::getContactPerson,tjTeamAppLog.getContactPerson()); } if (tjTeamAppLog.getContactPhone()!=null){ wq.like(TjTeamAppLog::getContactPhone,tjTeamAppLog.getContactPhone()); } if (tjTeamAppLog.getTjPacType()!=null){ wq.eq(TjTeamAppLog::getTjPacType,tjTeamAppLog.getTjPacType()); } if (tjTeamAppLog.getTjTime()!=null){ wq.between(TjTeamAppLog::getTjTime,tjTeamAppLog.getBeginTjTime(),tjTeamAppLog.getEndTjTime()); } List<TjTeamAppLog> list = tjTeamAppLogService.list(wq); ExcelUtil<TjTeamAppLog> util = new ExcelUtil<TjTeamAppLog>(TjTeamAppLog. class); util.exportExcel(response, list, "小程序团队预约记录数据"); } /** * 获取小程序团队预约记录详细信息 */ @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(tjTeamAppLogService.getById(id)); } } ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjTeamContactLogController.java
New file @@ -0,0 +1,98 @@ package com.ltkj.web.controller.system; import java.util.List; import javax.servlet.http.HttpServletResponse; 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 com.ltkj.common.annotation.Log; import com.ltkj.common.core.controller.BaseController; import com.ltkj.common.core.domain.AjaxResult; import com.ltkj.common.enums.BusinessType; import com.ltkj.hosp.domain.TjTeamContactLog; import com.ltkj.hosp.service.ITjTeamContactLogService; import com.ltkj.common.utils.poi.ExcelUtil; import com.ltkj.common.core.page.TableDataInfo; /** * 团队预约沟通记录Controller * * @author ltkj_赵佳豪&李格 * @date 2023-12-01 */ @RestController @RequestMapping("/hosp/TjTeamContactLog") public class TjTeamContactLogController extends BaseController { @Autowired private ITjTeamContactLogService tjTeamContactLogService; /** * 查询团队预约沟通记录列表 */ @PreAuthorize("@ss.hasPermi('hosp:TjTeamContactLog:list')") @GetMapping("/list") public TableDataInfo list(TjTeamContactLog tjTeamContactLog) { startPage(); List<TjTeamContactLog> list = tjTeamContactLogService.selectTjTeamContactLogList(tjTeamContactLog); return getDataTable(list); } /** * 导出团队预约沟通记录列表 */ @PreAuthorize("@ss.hasPermi('hosp:TjTeamContactLog:export')") @Log(title = "团队预约沟通记录", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, TjTeamContactLog tjTeamContactLog) { List<TjTeamContactLog> list = tjTeamContactLogService.selectTjTeamContactLogList(tjTeamContactLog); ExcelUtil<TjTeamContactLog> util = new ExcelUtil<TjTeamContactLog>(TjTeamContactLog.class); util.exportExcel(response, list, "团队预约沟通记录数据"); } /** * 获取团队预约沟通记录详细信息 */ @PreAuthorize("@ss.hasPermi('hosp:TjTeamContactLog:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(tjTeamContactLogService.selectTjTeamContactLogById(id)); } /** * 新增团队预约沟通记录 */ @PreAuthorize("@ss.hasPermi('hosp:TjTeamContactLog:add')") @Log(title = "团队预约沟通记录", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody TjTeamContactLog tjTeamContactLog) { return toAjax(tjTeamContactLogService.insertTjTeamContactLog(tjTeamContactLog)); } /** * 修改团队预约沟通记录 */ @PreAuthorize("@ss.hasPermi('hosp:TjTeamContactLog:edit')") @Log(title = "团队预约沟通记录", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody TjTeamContactLog tjTeamContactLog) { return toAjax(tjTeamContactLogService.updateTjTeamContactLog(tjTeamContactLog)); } /** * 删除团队预约沟通记录 */ @PreAuthorize("@ss.hasPermi('hosp:TjTeamContactLog:remove')") @Log(title = "团队预约沟通记录", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(tjTeamContactLogService.deleteTjTeamContactLogByIds(ids)); } } ltkj-hosp/src/main/java/com/ltkj/hosp/domain/DictComp.java
@@ -3,11 +3,13 @@ import java.util.Date; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import com.ltkj.common.annotation.Excel; import com.ltkj.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -224,6 +226,26 @@ @Excel(name = "五笔简码") private String wbm; @TableField(exist = false) @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date startTime; @TableField(exist = false) @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date endTime; @TableField(exist = false) private String pacId; @TableField(exist = false) private String tjPacType; @TableField(exist = false) private String pacName; @TableField(exist = false) private Integer userNum; @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjOrder.java
@@ -419,6 +419,18 @@ @ApiModelProperty(value = "报告领取方式") private String getType; /** * 报告领取地址 */ @TableField(exist = false) private TjReportGetAddress addAddress; /** * 体检类别 */ @ApiModelProperty("体检类别") private String tjCategory; @Override public String toString() { ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjReportGetAddress.java
@@ -2,7 +2,10 @@ import java.util.Date; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.ltkj.common.annotation.Excel; import com.ltkj.common.core.domain.BaseEntity; import lombok.Data; @@ -22,13 +25,15 @@ /** * 主键 */ @TableId @JsonSerialize(using = ToStringSerializer.class) private Long id; /** * 体检号 */ @Excel(name = "体检号") private Long tjNumber; private String tjNumber; /** * 收货人 ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjTeamAppLog.java
New file @@ -0,0 +1,144 @@ package com.ltkj.hosp.domain; import java.util.Date; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.ltkj.common.annotation.Excel; import com.ltkj.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** * 小程序团队预约记录对象 tj_team_app_log * * @author ltkj_赵佳豪&李格 * @date 2023-12-01 */ @Data @AllArgsConstructor @NoArgsConstructor @ApiModel(value = "小程序团队预约记录对象") public class TjTeamAppLog extends BaseEntity { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "主键id") @TableId @JsonSerialize(using = ToStringSerializer.class) private Long id; /** * 单位名称 */ @Excel(name = "单位名称") private String cnName; /** * 税号 */ @Excel(name = "税号") private String taxNumber; /** * 联系人 */ @Excel(name = "联系人") private String contactPerson; /** * 联系电话 */ @Excel(name = "联系电话") private String contactPhone; /** * 通讯地址 */ @Excel(name = "通讯地址") private String mailingAddress; /** * 邮箱 */ @Excel(name = "邮箱") private String email; /** * 体检人数 */ @Excel(name = "体检人数") private Long count; /** * 体检类别(字典) */ @Excel(name = "体检类别(字典)") private String tjPacType; /** * 预约时间 */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "预约时间", width = 30, dateFormat = "yyyy-MM-dd") private Date tjTime; /** * 所选套餐 */ @Excel(name = "所选套餐") private String pacId; /** * 套餐名称 */ @Excel(name = "套餐名称") private String pacName; /** * 来源 */ @Excel(name = "来源") private String fromBy; @TableField(exist = false) private Date beginTjTime; @TableField(exist = false) private Date endTjTime; @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) .append("cnName", getCnName()) .append("taxNumber", getTaxNumber()) .append("contactPerson", getContactPerson()) .append("contactPhone", getContactPhone()) .append("mailingAddress", getMailingAddress()) .append("email", getEmail()) .append("count", getCount()) .append("tjPacType", getTjPacType()) .append("tjTime", getTjTime()) .append("pacId", getPacId()) .append("pacName", getPacName()) .append("fromBy", getFromBy()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .append("deleted", getDeleted()) .append("createId", getCreateId()) .append("updateId", getUpdateId()) .toString(); } } ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjTeamContactLog.java
New file @@ -0,0 +1,88 @@ package com.ltkj.hosp.domain; import java.util.Date; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.ltkj.common.annotation.Excel; import com.ltkj.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; /** * 团队预约沟通记录对象 tj_team_contact_log * * @author ltkj_赵佳豪&李格 * @date 2023-12-01 */ @Data @AllArgsConstructor @NoArgsConstructor @ApiModel(value = "团队预约沟通记录对象") public class TjTeamContactLog extends BaseEntity { private static final long serialVersionUID = 1L; /** * id */ @ApiModelProperty(value = "主键id") @TableId @JsonSerialize(using = ToStringSerializer.class) private Long id; /** * 团队预约id */ @Excel(name = "团队预约id") private Long logId; /** * 沟通人id */ @Excel(name = "沟通人id") private String contactUserId; /** * 沟通人 */ @Excel(name = "沟通人") private String contactUserName; /** * 沟通时间 */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "沟通时间", width = 30, dateFormat = "yyyy-MM-dd") private Date contactTime; /** * 沟通详情 */ @Excel(name = "沟通详情") private String contactDetail; /** * 沟通状态 */ @Excel(name = "沟通状态") private String status; /** * 联系人 */ @Excel(name = "联系人") private String contactPerson; /** * 联系电话 */ @Excel(name = "联系电话") private String contactPhone; } ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjTeamSelectRecord.java
@@ -83,6 +83,13 @@ @Excel(name = "已付金额") @ApiModelProperty(value = "已付金额") private BigDecimal transactionAmount; /** * 体检类别 */ @ApiModelProperty(value = "体检类别") private String tjPacType; /** * 团队编号 */ ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjTeamAppLogMapper.java
New file @@ -0,0 +1,65 @@ package com.ltkj.hosp.mapper; import java.util.List; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ltkj.hosp.domain.TjTeamAppLog; import com.ltkj.hosp.domain.TjTeamSelectRecord; import org.apache.ibatis.annotations.Mapper; /** * 小程序团队预约记录Mapper接口 * * @author ltkj_赵佳豪&李格 * @date 2023-12-01 */ @Mapper public interface TjTeamAppLogMapper extends BaseMapper<TjTeamAppLog> { /** * 查询小程序团队预约记录 * * @param id 小程序团队预约记录主键 * @return 小程序团队预约记录 */ public TjTeamAppLog selectTjTeamAppLogById(Long id); /** * 查询小程序团队预约记录列表 * * @param tjTeamAppLog 小程序团队预约记录 * @return 小程序团队预约记录集合 */ public List<TjTeamAppLog> selectTjTeamAppLogList(TjTeamAppLog tjTeamAppLog); /** * 新增小程序团队预约记录 * * @param tjTeamAppLog 小程序团队预约记录 * @return 结果 */ public int insertTjTeamAppLog(TjTeamAppLog tjTeamAppLog); /** * 修改小程序团队预约记录 * * @param tjTeamAppLog 小程序团队预约记录 * @return 结果 */ public int updateTjTeamAppLog(TjTeamAppLog tjTeamAppLog); /** * 删除小程序团队预约记录 * * @param id 小程序团队预约记录主键 * @return 结果 */ public int deleteTjTeamAppLogById(Long id); /** * 批量删除小程序团队预约记录 * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteTjTeamAppLogByIds(Long[] ids); } ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjTeamContactLogMapper.java
New file @@ -0,0 +1,65 @@ package com.ltkj.hosp.mapper; import java.util.List; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ltkj.hosp.domain.TjTeamAppLog; import com.ltkj.hosp.domain.TjTeamContactLog; import org.apache.ibatis.annotations.Mapper; /** * 团队预约沟通记录Mapper接口 * * @author ltkj_赵佳豪&李格 * @date 2023-12-01 */ @Mapper public interface TjTeamContactLogMapper extends BaseMapper<TjTeamContactLog> { /** * 查询团队预约沟通记录 * * @param id 团队预约沟通记录主键 * @return 团队预约沟通记录 */ public TjTeamContactLog selectTjTeamContactLogById(Long id); /** * 查询团队预约沟通记录列表 * * @param tjTeamContactLog 团队预约沟通记录 * @return 团队预约沟通记录集合 */ public List<TjTeamContactLog> selectTjTeamContactLogList(TjTeamContactLog tjTeamContactLog); /** * 新增团队预约沟通记录 * * @param tjTeamContactLog 团队预约沟通记录 * @return 结果 */ public int insertTjTeamContactLog(TjTeamContactLog tjTeamContactLog); /** * 修改团队预约沟通记录 * * @param tjTeamContactLog 团队预约沟通记录 * @return 结果 */ public int updateTjTeamContactLog(TjTeamContactLog tjTeamContactLog); /** * 删除团队预约沟通记录 * * @param id 团队预约沟通记录主键 * @return 结果 */ public int deleteTjTeamContactLogById(Long id); /** * 批量删除团队预约沟通记录 * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteTjTeamContactLogByIds(Long[] ids); } ltkj-hosp/src/main/java/com/ltkj/hosp/service/ITjTeamAppLogService.java
New file @@ -0,0 +1,63 @@ package com.ltkj.hosp.service; import java.util.List; import com.baomidou.mybatisplus.extension.service.IService; import com.ltkj.hosp.domain.TjSurveyTemplate; import com.ltkj.hosp.domain.TjTeamAppLog; /** * 小程序团队预约记录Service接口 * * @author ltkj_赵佳豪&李格 * @date 2023-12-01 */ public interface ITjTeamAppLogService extends IService<TjTeamAppLog> { /** * 查询小程序团队预约记录 * * @param id 小程序团队预约记录主键 * @return 小程序团队预约记录 */ public TjTeamAppLog selectTjTeamAppLogById(Long id); /** * 查询小程序团队预约记录列表 * * @param tjTeamAppLog 小程序团队预约记录 * @return 小程序团队预约记录集合 */ public List<TjTeamAppLog> selectTjTeamAppLogList(TjTeamAppLog tjTeamAppLog); /** * 新增小程序团队预约记录 * * @param tjTeamAppLog 小程序团队预约记录 * @return 结果 */ public int insertTjTeamAppLog(TjTeamAppLog tjTeamAppLog); /** * 修改小程序团队预约记录 * * @param tjTeamAppLog 小程序团队预约记录 * @return 结果 */ public int updateTjTeamAppLog(TjTeamAppLog tjTeamAppLog); /** * 批量删除小程序团队预约记录 * * @param ids 需要删除的小程序团队预约记录主键集合 * @return 结果 */ public int deleteTjTeamAppLogByIds(Long[] ids); /** * 删除小程序团队预约记录信息 * * @param id 小程序团队预约记录主键 * @return 结果 */ public int deleteTjTeamAppLogById(Long id); } ltkj-hosp/src/main/java/com/ltkj/hosp/service/ITjTeamContactLogService.java
New file @@ -0,0 +1,63 @@ package com.ltkj.hosp.service; import java.util.List; import com.baomidou.mybatisplus.extension.service.IService; import com.ltkj.hosp.domain.TjTeamAppLog; import com.ltkj.hosp.domain.TjTeamContactLog; /** * 团队预约沟通记录Service接口 * * @author ltkj_赵佳豪&李格 * @date 2023-12-01 */ public interface ITjTeamContactLogService extends IService<TjTeamContactLog> { /** * 查询团队预约沟通记录 * * @param id 团队预约沟通记录主键 * @return 团队预约沟通记录 */ public TjTeamContactLog selectTjTeamContactLogById(Long id); /** * 查询团队预约沟通记录列表 * * @param tjTeamContactLog 团队预约沟通记录 * @return 团队预约沟通记录集合 */ public List<TjTeamContactLog> selectTjTeamContactLogList(TjTeamContactLog tjTeamContactLog); /** * 新增团队预约沟通记录 * * @param tjTeamContactLog 团队预约沟通记录 * @return 结果 */ public int insertTjTeamContactLog(TjTeamContactLog tjTeamContactLog); /** * 修改团队预约沟通记录 * * @param tjTeamContactLog 团队预约沟通记录 * @return 结果 */ public int updateTjTeamContactLog(TjTeamContactLog tjTeamContactLog); /** * 批量删除团队预约沟通记录 * * @param ids 需要删除的团队预约沟通记录主键集合 * @return 结果 */ public int deleteTjTeamContactLogByIds(Long[] ids); /** * 删除团队预约沟通记录信息 * * @param id 团队预约沟通记录主键 * @return 结果 */ public int deleteTjTeamContactLogById(Long id); } ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjTeamAppLogServiceImpl.java
New file @@ -0,0 +1,93 @@ package com.ltkj.hosp.service.impl; import java.util.List; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ltkj.common.utils.DateUtils; import com.ltkj.hosp.domain.TjSurveyTemplate; import com.ltkj.hosp.mapper.TjSurveyTemplateMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ltkj.hosp.mapper.TjTeamAppLogMapper; import com.ltkj.hosp.domain.TjTeamAppLog; import com.ltkj.hosp.service.ITjTeamAppLogService; /** * 小程序团队预约记录Service业务层处理 * * @author ltkj_赵佳豪&李格 * @date 2023-12-01 */ @Service public class TjTeamAppLogServiceImpl extends ServiceImpl<TjTeamAppLogMapper, TjTeamAppLog> implements ITjTeamAppLogService { @Autowired private TjTeamAppLogMapper tjTeamAppLogMapper; /** * 查询小程序团队预约记录 * * @param id 小程序团队预约记录主键 * @return 小程序团队预约记录 */ @Override public TjTeamAppLog selectTjTeamAppLogById(Long id) { return tjTeamAppLogMapper.selectTjTeamAppLogById(id); } /** * 查询小程序团队预约记录列表 * * @param tjTeamAppLog 小程序团队预约记录 * @return 小程序团队预约记录 */ @Override public List<TjTeamAppLog> selectTjTeamAppLogList(TjTeamAppLog tjTeamAppLog) { return tjTeamAppLogMapper.selectTjTeamAppLogList(tjTeamAppLog); } /** * 新增小程序团队预约记录 * * @param tjTeamAppLog 小程序团队预约记录 * @return 结果 */ @Override public int insertTjTeamAppLog(TjTeamAppLog tjTeamAppLog) { tjTeamAppLog.setCreateTime(DateUtils.getNowDate()); return tjTeamAppLogMapper.insertTjTeamAppLog(tjTeamAppLog); } /** * 修改小程序团队预约记录 * * @param tjTeamAppLog 小程序团队预约记录 * @return 结果 */ @Override public int updateTjTeamAppLog(TjTeamAppLog tjTeamAppLog) { tjTeamAppLog.setUpdateTime(DateUtils.getNowDate()); return tjTeamAppLogMapper.updateTjTeamAppLog(tjTeamAppLog); } /** * 批量删除小程序团队预约记录 * * @param ids 需要删除的小程序团队预约记录主键 * @return 结果 */ @Override public int deleteTjTeamAppLogByIds(Long[] ids) { return tjTeamAppLogMapper.deleteTjTeamAppLogByIds(ids); } /** * 删除小程序团队预约记录信息 * * @param id 小程序团队预约记录主键 * @return 结果 */ @Override public int deleteTjTeamAppLogById(Long id) { return tjTeamAppLogMapper.deleteTjTeamAppLogById(id); } } ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjTeamContactLogServiceImpl.java
New file @@ -0,0 +1,93 @@ package com.ltkj.hosp.service.impl; import java.util.List; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ltkj.common.utils.DateUtils; import com.ltkj.hosp.domain.TjTeamAppLog; import com.ltkj.hosp.mapper.TjTeamAppLogMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ltkj.hosp.mapper.TjTeamContactLogMapper; import com.ltkj.hosp.domain.TjTeamContactLog; import com.ltkj.hosp.service.ITjTeamContactLogService; /** * 团队预约沟通记录Service业务层处理 * * @author ltkj_赵佳豪&李格 * @date 2023-12-01 */ @Service public class TjTeamContactLogServiceImpl extends ServiceImpl<TjTeamContactLogMapper, TjTeamContactLog> implements ITjTeamContactLogService { @Autowired private TjTeamContactLogMapper tjTeamContactLogMapper; /** * 查询团队预约沟通记录 * * @param id 团队预约沟通记录主键 * @return 团队预约沟通记录 */ @Override public TjTeamContactLog selectTjTeamContactLogById(Long id) { return tjTeamContactLogMapper.selectTjTeamContactLogById(id); } /** * 查询团队预约沟通记录列表 * * @param tjTeamContactLog 团队预约沟通记录 * @return 团队预约沟通记录 */ @Override public List<TjTeamContactLog> selectTjTeamContactLogList(TjTeamContactLog tjTeamContactLog) { return tjTeamContactLogMapper.selectTjTeamContactLogList(tjTeamContactLog); } /** * 新增团队预约沟通记录 * * @param tjTeamContactLog 团队预约沟通记录 * @return 结果 */ @Override public int insertTjTeamContactLog(TjTeamContactLog tjTeamContactLog) { tjTeamContactLog.setCreateTime(DateUtils.getNowDate()); return tjTeamContactLogMapper.insertTjTeamContactLog(tjTeamContactLog); } /** * 修改团队预约沟通记录 * * @param tjTeamContactLog 团队预约沟通记录 * @return 结果 */ @Override public int updateTjTeamContactLog(TjTeamContactLog tjTeamContactLog) { tjTeamContactLog.setUpdateTime(DateUtils.getNowDate()); return tjTeamContactLogMapper.updateTjTeamContactLog(tjTeamContactLog); } /** * 批量删除团队预约沟通记录 * * @param ids 需要删除的团队预约沟通记录主键 * @return 结果 */ @Override public int deleteTjTeamContactLogByIds(Long[] ids) { return tjTeamContactLogMapper.deleteTjTeamContactLogByIds(ids); } /** * 删除团队预约沟通记录信息 * * @param id 团队预约沟通记录主键 * @return 结果 */ @Override public int deleteTjTeamContactLogById(Long id) { return tjTeamContactLogMapper.deleteTjTeamContactLogById(id); } } ltkj-hosp/src/main/resources/mapper/hosp/TjTeamAppLogMapper.xml
New file @@ -0,0 +1,222 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ltkj.hosp.mapper.TjTeamAppLogMapper"> <resultMap type="TjTeamAppLog" id="TjTeamAppLogResult"> <result property="id" column="id"/> <result property="cnName" column="cn_name"/> <result property="taxNumber" column="tax_number"/> <result property="contactPerson" column="contact_person"/> <result property="contactPhone" column="contact_phone"/> <result property="mailingAddress" column="mailing_address"/> <result property="email" column="email"/> <result property="count" column="count"/> <result property="tjPacType" column="tj_pac_type"/> <result property="tjTime" column="tj_time"/> <result property="pacId" column="pac_id"/> <result property="pacName" column="pac_name"/> <result property="fromBy" column="from_by"/> <result property="createBy" column="create_by"/> <result property="createTime" column="create_time"/> <result property="updateBy" column="update_by"/> <result property="updateTime" column="update_time"/> <result property="deleted" column="deleted"/> <result property="createId" column="create_id"/> <result property="updateId" column="update_id"/> </resultMap> <sql id="selectTjTeamAppLogVo"> select id, cn_name, tax_number, contact_person, contact_phone, mailing_address, email, count, tj_pac_type, tj_time, pac_id, pac_name, from_by, create_by, create_time, update_by, update_time, deleted, create_id, update_id from tj_team_app_log </sql> <select id="selectTjTeamAppLogList" parameterType="TjTeamAppLog" resultMap="TjTeamAppLogResult"> <include refid="selectTjTeamAppLogVo"/> <where> <if test="cnName != null and cnName != ''"> and cn_name like concat('%', #{cnName}, '%') </if> <if test="contactPerson != null and contactPerson != ''"> and contact_person = #{contactPerson} </if> <if test="contactPhone != null and contactPhone != ''"> and contact_phone = #{contactPhone} </if> <if test="tjPacType != null and tjPacType != ''"> and tj_pac_type = #{tjPacType} </if> <if test="params.beginTjTime != null and params.beginTjTime != '' and params.endTjTime != null and params.endTjTime != ''"> and tj_time between #{params.beginTjTime} and #{params.endTjTime} </if> </where> </select> <select id="selectTjTeamAppLogById" parameterType="Long" resultMap="TjTeamAppLogResult"> <include refid="selectTjTeamAppLogVo"/> where id = #{id} </select> <insert id="insertTjTeamAppLog" parameterType="TjTeamAppLog" useGeneratedKeys="true" keyProperty="id"> insert into tj_team_app_log <trim prefix="(" suffix=")" suffixOverrides=","> <if test="cnName != null and cnName != ''">cn_name, </if> <if test="taxNumber != null">tax_number, </if> <if test="contactPerson != null">contact_person, </if> <if test="contactPhone != null and contactPhone != ''">contact_phone, </if> <if test="mailingAddress != null">mailing_address, </if> <if test="email != null">email, </if> <if test="count != null">count, </if> <if test="tjPacType != null">tj_pac_type, </if> <if test="tjTime != null">tj_time, </if> <if test="pacId != null">pac_id, </if> <if test="pacName != null">pac_name, </if> <if test="fromBy != null">from_by, </if> <if test="createBy != null">create_by, </if> <if test="createTime != null">create_time, </if> <if test="updateBy != null">update_by, </if> <if test="updateTime != null">update_time, </if> <if test="deleted != null">deleted, </if> <if test="createId != null">create_id, </if> <if test="updateId != null">update_id, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="cnName != null and cnName != ''">#{cnName}, </if> <if test="taxNumber != null">#{taxNumber}, </if> <if test="contactPerson != null">#{contactPerson}, </if> <if test="contactPhone != null and contactPhone != ''">#{contactPhone}, </if> <if test="mailingAddress != null">#{mailingAddress}, </if> <if test="email != null">#{email}, </if> <if test="count != null">#{count}, </if> <if test="tjPacType != null">#{tjPacType}, </if> <if test="tjTime != null">#{tjTime}, </if> <if test="pacId != null">#{pacId}, </if> <if test="pacName != null">#{pacName}, </if> <if test="fromBy != null">#{fromBy}, </if> <if test="createBy != null">#{createBy}, </if> <if test="createTime != null">#{createTime}, </if> <if test="updateBy != null">#{updateBy}, </if> <if test="updateTime != null">#{updateTime}, </if> <if test="deleted != null">#{deleted}, </if> <if test="createId != null">#{createId}, </if> <if test="updateId != null">#{updateId}, </if> </trim> </insert> <update id="updateTjTeamAppLog" parameterType="TjTeamAppLog"> update tj_team_app_log <trim prefix="SET" suffixOverrides=","> <if test="cnName != null and cnName != ''">cn_name = #{cnName}, </if> <if test="taxNumber != null">tax_number = #{taxNumber}, </if> <if test="contactPerson != null">contact_person = #{contactPerson}, </if> <if test="contactPhone != null and contactPhone != ''">contact_phone = #{contactPhone}, </if> <if test="mailingAddress != null">mailing_address = #{mailingAddress}, </if> <if test="email != null">email = #{email}, </if> <if test="count != null">count = #{count}, </if> <if test="tjPacType != null">tj_pac_type = #{tjPacType}, </if> <if test="tjTime != null">tj_time = #{tjTime}, </if> <if test="pacId != null">pac_id = #{pacId}, </if> <if test="pacName != null">pac_name = #{pacName}, </if> <if test="fromBy != null">from_by = #{fromBy}, </if> <if test="createBy != null">create_by = #{createBy}, </if> <if test="createTime != null">create_time = #{createTime}, </if> <if test="updateBy != null">update_by = #{updateBy}, </if> <if test="updateTime != null">update_time = #{updateTime}, </if> <if test="deleted != null">deleted = #{deleted}, </if> <if test="createId != null">create_id = #{createId}, </if> <if test="updateId != null">update_id = #{updateId}, </if> </trim> where id = #{id} </update> <delete id="deleteTjTeamAppLogById" parameterType="Long"> delete from tj_team_app_log where id = #{id} </delete> <delete id="deleteTjTeamAppLogByIds" parameterType="String"> delete from tj_team_app_log where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </delete> </mapper> ltkj-hosp/src/main/resources/mapper/hosp/TjTeamContactLogMapper.xml
New file @@ -0,0 +1,208 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ltkj.hosp.mapper.TjTeamContactLogMapper"> <resultMap type="TjTeamContactLog" id="TjTeamContactLogResult"> <result property="id" column="id"/> <result property="logId" column="log_id"/> <result property="contactUserId" column="contact_user_id"/> <result property="contactUserName" column="contact_user_name"/> <result property="contactTime" column="contact_time"/> <result property="contactDetail" column="contact_detail"/> <result property="status" column="status"/> <result property="contactPerson" column="contact_person"/> <result property="contactPhone" column="contact_phone"/> <result property="createBy" column="create_by"/> <result property="createTime" column="create_time"/> <result property="updateBy" column="update_by"/> <result property="updateTime" column="update_time"/> <result property="deleted" column="deleted"/> <result property="createId" column="create_id"/> <result property="updateId" column="update_id"/> </resultMap> <sql id="selectTjTeamContactLogVo"> select id, log_id, contact_user_id, contact_user_name, contact_time, contact_detail, status, contact_person, contact_phone, create_by, create_time, update_by, update_time, deleted, create_id, update_id from tj_team_contact_log </sql> <select id="selectTjTeamContactLogList" parameterType="TjTeamContactLog" resultMap="TjTeamContactLogResult"> <include refid="selectTjTeamContactLogVo"/> <where> <if test="logId != null "> and log_id = #{logId} </if> <if test="contactUserId != null and contactUserId != ''"> and contact_user_id = #{contactUserId} </if> <if test="contactUserName != null and contactUserName != ''"> and contact_user_name like concat('%', #{contactUserName}, '%') </if> <if test="contactTime != null "> and contact_time = #{contactTime} </if> <if test="contactDetail != null and contactDetail != ''"> and contact_detail = #{contactDetail} </if> <if test="status != null and status != ''"> and status = #{status} </if> <if test="contactPerson != null and contactPerson != ''"> and contact_person = #{contactPerson} </if> <if test="contactPhone != null and contactPhone != ''"> and contact_phone = #{contactPhone} </if> <if test="deleted != null "> and deleted = #{deleted} </if> <if test="createId != null and createId != ''"> and create_id = #{createId} </if> <if test="updateId != null and updateId != ''"> and update_id = #{updateId} </if> </where> </select> <select id="selectTjTeamContactLogById" parameterType="Long" resultMap="TjTeamContactLogResult"> <include refid="selectTjTeamContactLogVo"/> where id = #{id} </select> <insert id="insertTjTeamContactLog" parameterType="TjTeamContactLog" useGeneratedKeys="true" keyProperty="id"> insert into tj_team_contact_log <trim prefix="(" suffix=")" suffixOverrides=","> <if test="logId != null">log_id, </if> <if test="contactUserId != null">contact_user_id, </if> <if test="contactUserName != null">contact_user_name, </if> <if test="contactTime != null">contact_time, </if> <if test="contactDetail != null">contact_detail, </if> <if test="status != null">status, </if> <if test="contactPerson != null">contact_person, </if> <if test="contactPhone != null and contactPhone != ''">contact_phone, </if> <if test="createBy != null">create_by, </if> <if test="createTime != null">create_time, </if> <if test="updateBy != null">update_by, </if> <if test="updateTime != null">update_time, </if> <if test="deleted != null">deleted, </if> <if test="createId != null">create_id, </if> <if test="updateId != null">update_id, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="logId != null">#{logId}, </if> <if test="contactUserId != null">#{contactUserId}, </if> <if test="contactUserName != null">#{contactUserName}, </if> <if test="contactTime != null">#{contactTime}, </if> <if test="contactDetail != null">#{contactDetail}, </if> <if test="status != null">#{status}, </if> <if test="contactPerson != null">#{contactPerson}, </if> <if test="contactPhone != null and contactPhone != ''">#{contactPhone}, </if> <if test="createBy != null">#{createBy}, </if> <if test="createTime != null">#{createTime}, </if> <if test="updateBy != null">#{updateBy}, </if> <if test="updateTime != null">#{updateTime}, </if> <if test="deleted != null">#{deleted}, </if> <if test="createId != null">#{createId}, </if> <if test="updateId != null">#{updateId}, </if> </trim> </insert> <update id="updateTjTeamContactLog" parameterType="TjTeamContactLog"> update tj_team_contact_log <trim prefix="SET" suffixOverrides=","> <if test="logId != null">log_id = #{logId}, </if> <if test="contactUserId != null">contact_user_id = #{contactUserId}, </if> <if test="contactUserName != null">contact_user_name = #{contactUserName}, </if> <if test="contactTime != null">contact_time = #{contactTime}, </if> <if test="contactDetail != null">contact_detail = #{contactDetail}, </if> <if test="status != null">status = #{status}, </if> <if test="contactPerson != null">contact_person = #{contactPerson}, </if> <if test="contactPhone != null and contactPhone != ''">contact_phone = #{contactPhone}, </if> <if test="createBy != null">create_by = #{createBy}, </if> <if test="createTime != null">create_time = #{createTime}, </if> <if test="updateBy != null">update_by = #{updateBy}, </if> <if test="updateTime != null">update_time = #{updateTime}, </if> <if test="deleted != null">deleted = #{deleted}, </if> <if test="createId != null">create_id = #{createId}, </if> <if test="updateId != null">update_id = #{updateId}, </if> </trim> where id = #{id} </update> <delete id="deleteTjTeamContactLogById" parameterType="Long"> delete from tj_team_contact_log where id = #{id} </delete> <delete id="deleteTjTeamContactLogByIds" parameterType="String"> delete from tj_team_contact_log where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </delete> </mapper>