Authored by zww

病案复印申请

Showing 47 changed files with 2693 additions and 20 deletions
... ... @@ -153,6 +153,8 @@ public class ShiroConfig {
//测试模块排除
filterChainDefinitionMap.put("/test/seata/**", "anon");
filterChainDefinitionMap.put("/app/api/**", "anon"); // 公众号、微信小程序
// 添加自己的过滤器并且取名为jwt
Map<String, Filter> filterMap = new HashMap<String, Filter>(1);
//如果cloudServer为空 则说明是单体 需要加载跨域配置【微服务跨域切换】
... ...
... ... @@ -120,7 +120,7 @@ public class BaseCommonServiceImpl implements BaseCommonService {
String formatTime = formatterLong.format(createTime);
String mergeField = logContent + "-" + userid + "-" + username + "-" + ip + "-" + formatTime;
if (StringUtils.isNotBlank(mergeField)){
if (encrypFlag && StringUtils.isNotBlank(mergeField)){
//添加完整性
try {
String hmac = EncryptionUtils.hmac(mergeField);
... ...
... ... @@ -63,6 +63,18 @@
<!-- <systemPath>${project.basedir}/lib/HbcaSdk.jar</systemPath>-->
<!-- </dependency>-->
<!-- 小程序微信登录,微信支付-->
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-mp</artifactId>
<version>4.5.0</version>
</dependency>
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-pay</artifactId>
<version>4.5.0</version>
</dependency>
</dependencies>
</project>
... ...
package org.jeecg.modules.claims.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.claims.entity.InstitutionMedicalPrice;
import org.jeecg.modules.claims.service.IInstitutionMedicalPriceService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: institution_medical_price
* @Author: jeecg-boot
* @Date: 2025-01-24
* @Version: V1.0
*/
@Api(tags="institution_medical_price")
@RestController
@RequestMapping("/claims/institutionMedicalPrice")
@Slf4j
public class InstitutionMedicalPriceController extends JeecgController<InstitutionMedicalPrice, IInstitutionMedicalPriceService> {
@Autowired
private IInstitutionMedicalPriceService institutionMedicalPriceService;
/**
* 分页列表查询
*
* @param institutionMedicalPrice
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "institution_medical_price-分页列表查询")
@ApiOperation(value="institution_medical_price-分页列表查询", notes="institution_medical_price-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<InstitutionMedicalPrice>> queryPageList(InstitutionMedicalPrice institutionMedicalPrice,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<InstitutionMedicalPrice> queryWrapper = QueryGenerator.initQueryWrapper(institutionMedicalPrice, req.getParameterMap());
Page<InstitutionMedicalPrice> page = new Page<InstitutionMedicalPrice>(pageNo, pageSize);
IPage<InstitutionMedicalPrice> pageList = institutionMedicalPriceService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param institutionMedicalPrice
* @return
*/
@AutoLog(value = "institution_medical_price-添加")
@ApiOperation(value="institution_medical_price-添加", notes="institution_medical_price-添加")
// @RequiresPermissions("claims:institution_medical_price:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody InstitutionMedicalPrice institutionMedicalPrice) {
institutionMedicalPriceService.save(institutionMedicalPrice);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param institutionMedicalPrice
* @return
*/
@AutoLog(value = "institution_medical_price-编辑")
@ApiOperation(value="institution_medical_price-编辑", notes="institution_medical_price-编辑")
// @RequiresPermissions("claims:institution_medical_price:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody InstitutionMedicalPrice institutionMedicalPrice) {
institutionMedicalPriceService.updateById(institutionMedicalPrice);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "institution_medical_price-通过id删除")
@ApiOperation(value="institution_medical_price-通过id删除", notes="institution_medical_price-通过id删除")
// @RequiresPermissions("claims:institution_medical_price:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
institutionMedicalPriceService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "institution_medical_price-批量删除")
@ApiOperation(value="institution_medical_price-批量删除", notes="institution_medical_price-批量删除")
// @RequiresPermissions("claims:institution_medical_price:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.institutionMedicalPriceService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "institution_medical_price-通过id查询")
@ApiOperation(value="institution_medical_price-通过id查询", notes="institution_medical_price-通过id查询")
@GetMapping(value = "/queryById")
public Result<InstitutionMedicalPrice> queryById(@RequestParam(name="id",required=true) String id) {
InstitutionMedicalPrice institutionMedicalPrice = institutionMedicalPriceService.getById(id);
if(institutionMedicalPrice==null) {
return Result.error("未找到对应数据");
}
return Result.OK(institutionMedicalPrice);
}
/**
* 导出excel
*
* @param request
* @param institutionMedicalPrice
*/
// @RequiresPermissions("claims:institution_medical_price:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, InstitutionMedicalPrice institutionMedicalPrice) {
return super.exportXls(request, institutionMedicalPrice, InstitutionMedicalPrice.class, "institution_medical_price");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
// @RequiresPermissions("claims:institution_medical_price:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, InstitutionMedicalPrice.class);
}
}
... ...
package org.jeecg.modules.claims.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.claims.entity.MedicalRecordsCopy;
import org.jeecg.modules.claims.service.IMedicalRecordsCopyPayService;
import org.jeecg.modules.claims.service.IMedicalRecordsCopyService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.weixin.service.IWeixinUserService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: medical_records_copy
* @Author: jeecg-boot
* @Date: 2025-01-24
* @Version: V1.0
*/
@Api(tags="medical_records_copy")
@RestController
@RequestMapping("/claims/medicalRecordsCopy")
@Slf4j
public class MedicalRecordsCopyController extends JeecgController<MedicalRecordsCopy, IMedicalRecordsCopyService> {
@Autowired
private IMedicalRecordsCopyService medicalRecordsCopyService;
@Autowired
private IWeixinUserService weixinUserService;
@Autowired
private IMedicalRecordsCopyPayService medicalRecordsCopyPayService;
/**
* 分页列表查询
*
* @param medicalRecordsCopy
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "medical_records_copy-分页列表查询")
@ApiOperation(value="medical_records_copy-分页列表查询", notes="medical_records_copy-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<MedicalRecordsCopy>> queryPageList(MedicalRecordsCopy medicalRecordsCopy,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<MedicalRecordsCopy> queryWrapper = QueryGenerator.initQueryWrapper(medicalRecordsCopy, req.getParameterMap());
Page<MedicalRecordsCopy> page = new Page<MedicalRecordsCopy>(pageNo, pageSize);
IPage<MedicalRecordsCopy> pageList = medicalRecordsCopyService.page(page, queryWrapper);
if (pageList.getRecords() != null && !pageList.getRecords().isEmpty()) {
for (MedicalRecordsCopy record : pageList.getRecords()) {
if (StringUtils.isNotBlank(record.getRegion())) {
String[] split = record.getRegion().split(",");
if (split.length > 2) {
List<Map<String, String>> region = weixinUserService.getRegion(split[2]);
record.setRegion(region.get(0).get("provinceName") + region.get(0).get("cityName") + region.get(0).get("areaName"));
}
}
}
}
return Result.OK(pageList);
}
/**
* 添加
*
* @param medicalRecordsCopy
* @return
*/
@AutoLog(value = "medical_records_copy-添加")
@ApiOperation(value="medical_records_copy-添加", notes="medical_records_copy-添加")
// @RequiresPermissions("claims:medical_records_copy:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody MedicalRecordsCopy medicalRecordsCopy) {
medicalRecordsCopy.setStatus("1");
medicalRecordsCopyService.save(medicalRecordsCopy);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param medicalRecordsCopy
* @return
*/
@AutoLog(value = "medical_records_copy-编辑")
@ApiOperation(value="medical_records_copy-编辑", notes="medical_records_copy-编辑")
// @RequiresPermissions("claims:medical_records_copy:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody MedicalRecordsCopy medicalRecordsCopy) {
medicalRecordsCopyService.updateById(medicalRecordsCopy);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "medical_records_copy-通过id删除")
@ApiOperation(value="medical_records_copy-通过id删除", notes="medical_records_copy-通过id删除")
// @RequiresPermissions("claims:medical_records_copy:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
medicalRecordsCopyService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "medical_records_copy-批量删除")
@ApiOperation(value="medical_records_copy-批量删除", notes="medical_records_copy-批量删除")
// @RequiresPermissions("claims:medical_records_copy:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.medicalRecordsCopyService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "medical_records_copy-通过id查询")
@ApiOperation(value="medical_records_copy-通过id查询", notes="medical_records_copy-通过id查询")
@GetMapping(value = "/queryById")
public Result<MedicalRecordsCopy> queryById(@RequestParam(name="id",required=true) String id) {
MedicalRecordsCopy medicalRecordsCopy = medicalRecordsCopyService.getById(id);
if(medicalRecordsCopy==null) {
return Result.error("未找到对应数据");
}
return Result.OK(medicalRecordsCopy);
}
/**
* 导出excel
*
* @param request
* @param medicalRecordsCopy
*/
// @RequiresPermissions("claims:medical_records_copy:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, MedicalRecordsCopy medicalRecordsCopy) {
return super.exportXls(request, medicalRecordsCopy, MedicalRecordsCopy.class, "medical_records_copy");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
// @RequiresPermissions("claims:medical_records_copy:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, MedicalRecordsCopy.class);
}
/**
* 通过id分页查询
* 有字典翻译
*
* @param id
* @return
*/
//@AutoLog(value = "medical_records_copy-通过id分页查询")
@ApiOperation(value="medical_records_copy-通过id分页查询", notes="medical_records_copy-通过id分页查询")
@GetMapping(value = "/queryOne")
public Result<?> queryOne(@RequestParam(name="id",required=true) String id) {
QueryWrapper<MedicalRecordsCopy> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id", id);
Page<MedicalRecordsCopy> page = new Page<MedicalRecordsCopy>(1, 10);
IPage<MedicalRecordsCopy> pageList = medicalRecordsCopyService.page(page, queryWrapper);
if (pageList.getRecords() != null && !pageList.getRecords().isEmpty()) {
for (MedicalRecordsCopy record : pageList.getRecords()) {
if (StringUtils.isNotBlank(record.getRegion())) {
String[] split = record.getRegion().split(",");
if (split.length > 2) {
List<Map<String, String>> region = weixinUserService.getRegion(split[2]);
record.setRegion(region.get(0).get("provinceName") + region.get(0).get("cityName") + region.get(0).get("areaName"));
}
}
}
}
return Result.OK(pageList);
}
/**
* 审批
*
* @param medicalRecordsCopy
* @return
*/
@AutoLog(value = "medical_records_copy-审批")
@ApiOperation(value="medical_records_copy-审批", notes="medical_records_copy-审批")
// @RequiresPermissions("claims:medical_records_copy:approve")
@RequestMapping(value = "/approve", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> approve(@RequestBody MedicalRecordsCopy medicalRecordsCopy) {
MedicalRecordsCopy update = new MedicalRecordsCopy();
update.setId(medicalRecordsCopy.getId());
update.setStatus("2");
medicalRecordsCopyService.updateById(update);
return Result.OK("审批成功!");
}
/**
* 确认
*
* @param medicalRecordsCopy
* @return
*/
@AutoLog(value = "medical_records_copy-确认")
@Transactional
@ApiOperation(value="medical_records_copy-确认", notes="medical_records_copy-确认")
// @RequiresPermissions("claims:medical_records_copy:confirm")
@RequestMapping(value = "/confirm", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> confirm(@RequestBody MedicalRecordsCopy medicalRecordsCopy) throws Exception {
MedicalRecordsCopy update = new MedicalRecordsCopy();
update.setId(medicalRecordsCopy.getId());
update.setStatus("3");
update.setCopyingNumber(medicalRecordsCopy.getCopyingNumber());
medicalRecordsCopyService.updateById(update);
// 生成账单
Boolean initPay = medicalRecordsCopyPayService.confirmUpdatePay(medicalRecordsCopy);
if (initPay) {
return Result.OK("确认成功!");
} else {
throw new RuntimeException("确认失败!");
}
}
}
... ...
package org.jeecg.modules.claims.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.claims.entity.MedicalRecordsCopyPay;
import org.jeecg.modules.claims.service.IMedicalRecordsCopyPayService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: medical_records_copy_pay
* @Author: jeecg-boot
* @Date: 2025-01-24
* @Version: V1.0
*/
@Api(tags="medical_records_copy_pay")
@RestController
@RequestMapping("/claims/medicalRecordsCopyPay")
@Slf4j
public class MedicalRecordsCopyPayController extends JeecgController<MedicalRecordsCopyPay, IMedicalRecordsCopyPayService> {
@Autowired
private IMedicalRecordsCopyPayService medicalRecordsCopyPayService;
/**
* 分页列表查询
*
* @param medicalRecordsCopyPay
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "medical_records_copy_pay-分页列表查询")
@ApiOperation(value="medical_records_copy_pay-分页列表查询", notes="medical_records_copy_pay-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<MedicalRecordsCopyPay>> queryPageList(MedicalRecordsCopyPay medicalRecordsCopyPay,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<MedicalRecordsCopyPay> queryWrapper = QueryGenerator.initQueryWrapper(medicalRecordsCopyPay, req.getParameterMap());
Page<MedicalRecordsCopyPay> page = new Page<MedicalRecordsCopyPay>(pageNo, pageSize);
IPage<MedicalRecordsCopyPay> pageList = medicalRecordsCopyPayService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param medicalRecordsCopyPay
* @return
*/
@AutoLog(value = "medical_records_copy_pay-添加")
@ApiOperation(value="medical_records_copy_pay-添加", notes="medical_records_copy_pay-添加")
// @RequiresPermissions("claims:medical_records_copy_pay:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody MedicalRecordsCopyPay medicalRecordsCopyPay) {
medicalRecordsCopyPayService.save(medicalRecordsCopyPay);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param medicalRecordsCopyPay
* @return
*/
@AutoLog(value = "medical_records_copy_pay-编辑")
@ApiOperation(value="medical_records_copy_pay-编辑", notes="medical_records_copy_pay-编辑")
// @RequiresPermissions("claims:medical_records_copy_pay:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody MedicalRecordsCopyPay medicalRecordsCopyPay) {
medicalRecordsCopyPayService.updateById(medicalRecordsCopyPay);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "medical_records_copy_pay-通过id删除")
@ApiOperation(value="medical_records_copy_pay-通过id删除", notes="medical_records_copy_pay-通过id删除")
// @RequiresPermissions("claims:medical_records_copy_pay:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
medicalRecordsCopyPayService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "medical_records_copy_pay-批量删除")
@ApiOperation(value="medical_records_copy_pay-批量删除", notes="medical_records_copy_pay-批量删除")
// @RequiresPermissions("claims:medical_records_copy_pay:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.medicalRecordsCopyPayService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "medical_records_copy_pay-通过id查询")
@ApiOperation(value="medical_records_copy_pay-通过id查询", notes="medical_records_copy_pay-通过id查询")
@GetMapping(value = "/queryById")
public Result<MedicalRecordsCopyPay> queryById(@RequestParam(name="id",required=true) String id) {
MedicalRecordsCopyPay medicalRecordsCopyPay = medicalRecordsCopyPayService.getById(id);
if(medicalRecordsCopyPay==null) {
return Result.error("未找到对应数据");
}
return Result.OK(medicalRecordsCopyPay);
}
/**
* 导出excel
*
* @param request
* @param medicalRecordsCopyPay
*/
// @RequiresPermissions("claims:medical_records_copy_pay:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, MedicalRecordsCopyPay medicalRecordsCopyPay) {
return super.exportXls(request, medicalRecordsCopyPay, MedicalRecordsCopyPay.class, "medical_records_copy_pay");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
// @RequiresPermissions("claims:medical_records_copy_pay:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, MedicalRecordsCopyPay.class);
}
}
... ...
... ... @@ -86,6 +86,19 @@ public class InstitutionMedical implements Serializable {
@ApiModelProperty(value = "状态")
@Dict(dicCode = "ins_status")
private java.lang.String status;
/**描述*/
@Excel(name = "描述", width = 15)
@ApiModelProperty(value = "描述")
private java.lang.String description;
/**照片*/
@Excel(name = "照片", width = 15)
@ApiModelProperty(value = "照片")
private java.lang.String photo;
/**等级*/
@Excel(name = "等级", width = 15, dicCode = "institution_medical_level")
@Dict(dicCode = "institution_medical_level")
@ApiModelProperty(value = "等级")
private java.lang.String level;
/**手机号码完整性*/
private String phoneValid;
... ...
package org.jeecg.modules.claims.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: institution_medical_price
* @Author: jeecg-boot
* @Date: 2025-01-24
* @Version: V1.0
*/
@Data
@TableName("institution_medical_price")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="institution_medical_price对象", description="institution_medical_price")
public class InstitutionMedicalPrice implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.String id;
/**医疗机构*/
@Excel(name = "医疗机构", width = 15, dictTable = "institution_medical", dicText = "institution_name", dicCode = "id")
@Dict(dictTable = "institution_medical", dicText = "institution_name", dicCode = "id")
@ApiModelProperty(value = "医疗机构")
private java.lang.String institutionId;
/**复印单价(分/份)*/
@Excel(name = "复印单价(分/份)", width = 15)
@ApiModelProperty(value = "复印单价(分/份)")
private java.lang.Integer copyPrice;
/**快递价格(分)*/
@Excel(name = "快递价格(分)", width = 15)
@ApiModelProperty(value = "快递价格(分)")
private java.lang.Integer postPrice;
/**复印张数单价(分/张)*/
@Excel(name = "复印张数单价(分/张)", width = 15)
@ApiModelProperty(value = "复印张数单价(分/张)")
private java.lang.Integer paperPrice;
/**状态*/
@Excel(name = "状态", width = 15)
@ApiModelProperty(value = "状态")
private java.lang.String status;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**删除标记*/
@Excel(name = "删除标记", width = 15)
@ApiModelProperty(value = "删除标记")
@TableLogic
private java.lang.String delFlag;
}
... ...
package org.jeecg.modules.claims.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: medical_records_copy
* @Author: jeecg-boot
* @Date: 2025-01-24
* @Version: V1.0
*/
@Data
@TableName("medical_records_copy")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="medical_records_copy对象", description="medical_records_copy")
public class MedicalRecordsCopy implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.String id;
/**医疗机构*/
@Excel(name = "医疗机构", width = 15, dictTable = "institution_medical", dicText = "institution_name", dicCode = "id")
@Dict(dictTable = "institution_medical", dicText = "institution_name", dicCode = "id")
@ApiModelProperty(value = "医疗机构")
private java.lang.String institutionId;
/**与患者关系*/
@Excel(name = "与患者关系", width = 15, dicCode = "medical_relationship_patients")
@Dict(dicCode = "medical_relationship_patients")
@ApiModelProperty(value = "与患者关系")
private java.lang.String relationshipPatients;
/**患者姓名*/
@Excel(name = "患者姓名", width = 15)
@ApiModelProperty(value = "患者姓名")
private java.lang.String patientName;
/**证件类型*/
@Excel(name = "证件类型", width = 15, dicCode = "medical_card_type")
@Dict(dicCode = "medical_card_type")
@ApiModelProperty(value = "证件类型")
private java.lang.String cardType;
/**身份证号*/
@Excel(name = "身份证号", width = 15)
@ApiModelProperty(value = "身份证号")
private java.lang.String cardNo;
/**患者身份证人像照*/
@Excel(name = "患者身份证人像照", width = 15)
@ApiModelProperty(value = "患者身份证人像照")
private java.lang.String cardPicture;
/**患者身份证国徽照*/
@Excel(name = "患者身份证国徽照", width = 15)
@ApiModelProperty(value = "患者身份证国徽照")
private java.lang.String cardFront;
/**患者身份证手持照*/
@Excel(name = "患者身份证手持照", width = 15)
@ApiModelProperty(value = "患者身份证手持照")
private java.lang.String cardHolding;
/**代办身份证人像照*/
@Excel(name = "代办身份证人像照", width = 15)
@ApiModelProperty(value = "代办身份证人像照")
private java.lang.String agentCardPicture;
/**代办身份证国徽照*/
@Excel(name = "代办身份证国徽照", width = 15)
@ApiModelProperty(value = "代办身份证国徽照")
private java.lang.String agentCardFront;
/**代办身份证手持照*/
@Excel(name = "代办身份证手持照", width = 15)
@ApiModelProperty(value = "代办身份证手持照")
private java.lang.String agentCardHolding;
/**代办人联系方式*/
@Excel(name = "代办人联系方式", width = 15)
@ApiModelProperty(value = "代办人联系方式")
private java.lang.String agentPhone;
/**住院号*/
@Excel(name = "住院号", width = 15)
@ApiModelProperty(value = "住院号")
private java.lang.String hospitalNo;
/**科室*/
@Excel(name = "科室", width = 15)
@ApiModelProperty(value = "科室")
private java.lang.String department;
/**复印用途*/
@Excel(name = "复印用途", width = 15, dicCode = "medical_copying_purposes")
@Dict(dicCode = "medical_copying_purposes")
@ApiModelProperty(value = "复印用途")
private java.lang.String copyingPurposes;
/**份数*/
@Excel(name = "份数", width = 15)
@ApiModelProperty(value = "份数")
private java.lang.String copyingNumber;
/**总张数*/
@Excel(name = "总张数", width = 15)
@ApiModelProperty(value = "总张数")
private java.lang.String sheetsNumber;
/**订单状态*/
@Excel(name = "订单状态", width = 15, dicCode = "medical_order_status")
@Dict(dicCode = "medical_order_status")
@ApiModelProperty(value = "订单状态")
private java.lang.String status;
/**收件人*/
@Excel(name = "收件人", width = 15)
@ApiModelProperty(value = "收件人")
private java.lang.String addressee;
/**联系电话*/
@Excel(name = "联系电话", width = 15)
@ApiModelProperty(value = "联系电话")
private java.lang.String contactNumber;
/**地区*/
@Excel(name = "地区", width = 15)
@ApiModelProperty(value = "地区")
private java.lang.String region;
/**详细地址*/
@Excel(name = "详细地址", width = 15)
@ApiModelProperty(value = "详细地址")
private java.lang.String fullAddress;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**删除标记*/
@Excel(name = "删除标记", width = 15)
@ApiModelProperty(value = "删除标记")
@TableLogic
private java.lang.String delFlag;
/**医疗机构*/
@TableField(exist = false)
@ApiModelProperty(value = "医疗机构")
private java.lang.String institutionName;
/**总复印费(分)*/
@TableField(exist = false)
@ApiModelProperty(value = "总复印费(分)")
private BigDecimal copyPrice;
/**总快递费(分)*/
@TableField(exist = false)
@ApiModelProperty(value = "总快递费(分)")
private BigDecimal postPrice;
/**总费用(分)*/
@TableField(exist = false)
@ApiModelProperty(value = "总费用(分)")
private BigDecimal totalPrice;
/**预付费用(分)*/
@TableField(exist = false)
@ApiModelProperty(value = "预付费用(分)")
private BigDecimal prepaidPrice;
/**补缴费用(分)*/
@TableField(exist = false)
@ApiModelProperty(value = "补缴费用(分)")
private BigDecimal additionalPayPrice;
}
... ...
package org.jeecg.modules.claims.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: medical_records_copy_pay
* @Author: jeecg-boot
* @Date: 2025-01-24
* @Version: V1.0
*/
@Data
@TableName("medical_records_copy_pay")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="medical_records_copy_pay对象", description="medical_records_copy_pay")
public class MedicalRecordsCopyPay implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.String id;
/**订单id*/
@Excel(name = "订单id", width = 15, dictTable = "medical_records_copy", dicText = "id", dicCode = "id")
@Dict(dictTable = "medical_records_copy", dicText = "id", dicCode = "id")
@ApiModelProperty(value = "订单id")
private java.lang.String orderId;
/**预付复印费(分)*/
@Excel(name = "预付复印费(分)", width = 15)
@ApiModelProperty(value = "预付复印费(分)")
private java.lang.Integer copyPayPrice;
/**预付快递费(分)*/
@Excel(name = "预付快递费(分)", width = 15)
@ApiModelProperty(value = "预付快递费(分)")
private java.lang.Integer postPayPrice;
/**预付费用(分)*/
@Excel(name = "预付费用(分)", width = 15)
@ApiModelProperty(value = "预付费用(分)")
private java.lang.Integer prepaidPrice;
/**总复印费(分)*/
@Excel(name = "总复印费(分)", width = 15)
@ApiModelProperty(value = "总复印费(分)")
private java.lang.Integer copyPrice;
/**总快递费(分)*/
@Excel(name = "总快递费(分)", width = 15)
@ApiModelProperty(value = "总快递费(分)")
private java.lang.Integer postPrice;
/**总费用(分)*/
@Excel(name = "总费用(分)", width = 15)
@ApiModelProperty(value = "总费用(分)")
private java.lang.Integer totalPrice;
/**补缴费用(分)*/
@Excel(name = "补缴费用(分)", width = 15)
@ApiModelProperty(value = "补缴费用(分)")
private java.lang.Integer additionalPayPrice;
/**订单状态*/
@Excel(name = "订单状态", width = 15)
@ApiModelProperty(value = "订单状态")
private java.lang.String status;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**删除标记*/
@Excel(name = "删除标记", width = 15)
@ApiModelProperty(value = "删除标记")
@TableLogic
private java.lang.String delFlag;
}
... ...
package org.jeecg.modules.claims.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.claims.entity.InstitutionMedicalPrice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: institution_medical_price
* @Author: jeecg-boot
* @Date: 2025-01-24
* @Version: V1.0
*/
public interface InstitutionMedicalPriceMapper extends BaseMapper<InstitutionMedicalPrice> {
}
... ...
package org.jeecg.modules.claims.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.claims.entity.MedicalRecordsCopy;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: medical_records_copy
* @Author: jeecg-boot
* @Date: 2025-01-24
* @Version: V1.0
*/
public interface MedicalRecordsCopyMapper extends BaseMapper<MedicalRecordsCopy> {
}
... ...
package org.jeecg.modules.claims.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.claims.entity.MedicalRecordsCopyPay;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: medical_records_copy_pay
* @Author: jeecg-boot
* @Date: 2025-01-24
* @Version: V1.0
*/
public interface MedicalRecordsCopyPayMapper extends BaseMapper<MedicalRecordsCopyPay> {
}
... ...
<?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="org.jeecg.modules.claims.mapper.InstitutionMedicalPriceMapper">
</mapper>
\ No newline at end of file
... ...
<?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="org.jeecg.modules.claims.mapper.MedicalRecordsCopyMapper">
</mapper>
\ No newline at end of file
... ...
<?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="org.jeecg.modules.claims.mapper.MedicalRecordsCopyPayMapper">
</mapper>
\ No newline at end of file
... ...
package org.jeecg.modules.claims.service;
import com.alibaba.fastjson.JSONObject;
import org.jeecg.modules.claims.entity.InstitutionMedicalPrice;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: institution_medical_price
* @Author: jeecg-boot
* @Date: 2025-01-24
* @Version: V1.0
*/
public interface IInstitutionMedicalPriceService extends IService<InstitutionMedicalPrice> {
InstitutionMedicalPrice getPrice(String institutionId);
}
... ...
package org.jeecg.modules.claims.service;
import org.jeecg.modules.claims.entity.MedicalRecordsCopy;
import org.jeecg.modules.claims.entity.MedicalRecordsCopyPay;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: medical_records_copy_pay
* @Author: jeecg-boot
* @Date: 2025-01-24
* @Version: V1.0
*/
public interface IMedicalRecordsCopyPayService extends IService<MedicalRecordsCopyPay> {
Boolean submitInitPay(MedicalRecordsCopy medicalRecordsCopy);
Boolean confirmUpdatePay(MedicalRecordsCopy medicalRecordsCopy);
void getPayInfo(MedicalRecordsCopy medicalRecordsCopy);
}
... ...
package org.jeecg.modules.claims.service;
import org.jeecg.modules.claims.entity.MedicalRecordsCopy;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: medical_records_copy
* @Author: jeecg-boot
* @Date: 2025-01-24
* @Version: V1.0
*/
public interface IMedicalRecordsCopyService extends IService<MedicalRecordsCopy> {
}
... ...
... ... @@ -5,6 +5,7 @@ import org.jeecg.common.util.custom.EncryptionUtils;
import org.jeecg.modules.claims.entity.HisVisinfoList;
import org.jeecg.modules.claims.mapper.HisVisinfoListMapper;
import org.jeecg.modules.claims.service.IHisVisinfoListService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
... ... @@ -20,6 +21,9 @@ import java.util.*;
*/
@Service
public class HisVisinfoListServiceImpl extends ServiceImpl<HisVisinfoListMapper, HisVisinfoList> implements IHisVisinfoListService {
@Value("${jeecg.encrypFlag}")
private Boolean encrypFlag;
//理赔金额求和
@Override
public Double sumCalAmnt() {
... ... @@ -85,7 +89,7 @@ public class HisVisinfoListServiceImpl extends ServiceImpl<HisVisinfoListMapper,
public void changeFieldQuery(HisVisinfoList hisVisinfoList) {
//解密证件号,验证完成性
String userCodeCipher = hisVisinfoList.getUserCode();
if (StringUtils.isNotEmpty(userCodeCipher)) {
if (encrypFlag && StringUtils.isNotEmpty(userCodeCipher)) {
try {
//解密
String userCode = EncryptionUtils.symmetricDecryptData(userCodeCipher);
... ... @@ -108,7 +112,7 @@ public class HisVisinfoListServiceImpl extends ServiceImpl<HisVisinfoListMapper,
public void changeFieldEncryp(HisVisinfoList hisVisinfoList) {
//加密证件号
String userCode = hisVisinfoList.getUserCode();
if (StringUtils.isNotEmpty(userCode)){
if (encrypFlag && StringUtils.isNotEmpty(userCode)){
//加密(一次加密)
try {
String s = EncryptionUtils.encryptionData(userCode);
... ...
... ... @@ -5,6 +5,7 @@ import org.jeecg.common.util.custom.EncryptionUtils;
import org.jeecg.modules.claims.entity.InsApiLog;
import org.jeecg.modules.claims.mapper.InsApiLogMapper;
import org.jeecg.modules.claims.service.IInsApiLogService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
... ... @@ -18,6 +19,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
public class InsApiLogServiceImpl extends ServiceImpl<InsApiLogMapper, InsApiLog> implements IInsApiLogService {
@Value("${jeecg.encrypFlag}")
private Boolean encrypFlag;
//日志没有修改的,都是新建的,故只需覆写保存方法
//覆写保存方法
@Override
... ... @@ -34,7 +39,7 @@ public class InsApiLogServiceImpl extends ServiceImpl<InsApiLogMapper, InsApiLog
public void changeFieldQuery(InsApiLog insApiLog) {
//解密返回参数,验证完成性
String returnParams = insApiLog.getReturnParams();
if (StringUtils.isNotEmpty(returnParams)) {
if (encrypFlag && StringUtils.isNotEmpty(returnParams)) {
try {
// //解密
// String userCode = EncryptionUtils.symmetricDecryptData(returnParams);
... ... @@ -57,7 +62,7 @@ public class InsApiLogServiceImpl extends ServiceImpl<InsApiLogMapper, InsApiLog
public void changeFieldEncryp(InsApiLog insApiLog) {
//加密证件号
String returnParams = insApiLog.getReturnParams();
if (StringUtils.isNotEmpty(returnParams)){
if (encrypFlag && StringUtils.isNotEmpty(returnParams)){
// //加密(一次加密)
// try {
// String s = EncryptionUtils.encryptionData(returnParams);
... ...
... ... @@ -5,6 +5,7 @@ import org.jeecg.common.util.custom.EncryptionUtils;
import org.jeecg.modules.claims.entity.InsInsurePerson;
import org.jeecg.modules.claims.mapper.InsInsurePersonMapper;
import org.jeecg.modules.claims.service.IInsInsurePersonService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
... ... @@ -18,12 +19,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
public class InsInsurePersonServiceImpl extends ServiceImpl<InsInsurePersonMapper, InsInsurePerson> implements IInsInsurePersonService {
@Value("${jeecg.encrypFlag}")
private Boolean encrypFlag;
//字段解密
@Override
public void changeFieldQuery(InsInsurePerson insInsurePerson) {
//解密证件号,验证完成性
String userCodeCipher = insInsurePerson.getUserCode();
if (StringUtils.isNotEmpty(userCodeCipher)) {
if (encrypFlag && StringUtils.isNotEmpty(userCodeCipher)) {
try {
//解密
String userCode = EncryptionUtils.symmetricDecryptData(userCodeCipher);
... ... @@ -45,7 +49,7 @@ public class InsInsurePersonServiceImpl extends ServiceImpl<InsInsurePersonMappe
public void changeFieldEncryp(InsInsurePerson insInsurePerson) {
//加密证件号
String userCode = insInsurePerson.getUserCode();
if (StringUtils.isNotEmpty(userCode)){
if (encrypFlag && StringUtils.isNotEmpty(userCode)){
//加密(一次加密)
try {
String s = EncryptionUtils.encryptionData(userCode);
... ...
... ... @@ -16,6 +16,7 @@ import org.jeecg.modules.system.entity.SysUserRole;
import org.jeecg.modules.system.mapper.SysUserRoleMapper;
import org.jeecg.modules.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
... ... @@ -33,6 +34,9 @@ import java.util.List;
@Service
public class InstitutionInsurancePersonServiceImpl extends ServiceImpl<InstitutionInsurancePersonMapper, InstitutionInsurancePerson> implements IInstitutionInsurancePersonService {
@Value("${jeecg.encrypFlag}")
private Boolean encrypFlag;
@Autowired
private ISysUserService sysUserService;
... ... @@ -197,7 +201,7 @@ public class InstitutionInsurancePersonServiceImpl extends ServiceImpl<Instituti
public void changeFieldQuery(InstitutionInsurancePerson institutionInsurancePerson) {
//解密手机号,验证完成性
String phoneCipher = institutionInsurancePerson.getPhone();
if (StringUtils.isNotEmpty(phoneCipher)) {
if (encrypFlag && StringUtils.isNotEmpty(phoneCipher)) {
try {
//解密
String phone = EncryptionUtils.symmetricDecryptData(phoneCipher);
... ...
... ... @@ -18,6 +18,7 @@ import org.jeecg.modules.system.entity.SysUserRole;
import org.jeecg.modules.system.mapper.SysUserRoleMapper;
import org.jeecg.modules.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
... ... @@ -36,6 +37,9 @@ import java.util.List;
public class InstitutionInsuranceServiceImpl extends ServiceImpl<InstitutionInsuranceMapper, InstitutionInsurance> implements IInstitutionInsuranceService {
@Value("${jeecg.encrypFlag}")
private Boolean encrypFlag;
@Autowired
private ISysUserService sysUserService;
... ... @@ -216,7 +220,7 @@ public class InstitutionInsuranceServiceImpl extends ServiceImpl<InstitutionInsu
public void changeFieldQuery(InstitutionInsurance institutionInsurance) {
//解密手机号,验证完成性
String phoneCipher = institutionInsurance.getPhone();
if (StringUtils.isNotEmpty(phoneCipher)) {
if (encrypFlag && StringUtils.isNotEmpty(phoneCipher)) {
try {
//解密
String phone = EncryptionUtils.symmetricDecryptData(phoneCipher);
... ...
... ... @@ -16,6 +16,7 @@ import org.jeecg.modules.system.entity.SysUserRole;
import org.jeecg.modules.system.mapper.SysUserRoleMapper;
import org.jeecg.modules.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
... ... @@ -33,6 +34,9 @@ import java.util.List;
@Service
public class InstitutionMedicalPersonServiceImpl extends ServiceImpl<InstitutionMedicalPersonMapper, InstitutionMedicalPerson> implements IInstitutionMedicalPersonService {
@Value("${jeecg.encrypFlag}")
private Boolean encrypFlag;
@Autowired
private ISysUserService sysUserService;
... ... @@ -202,7 +206,7 @@ public class InstitutionMedicalPersonServiceImpl extends ServiceImpl<Institution
public void changeFieldQuery(InstitutionMedicalPerson institutionMedicalPerson) {
//解密手机号,验证完成性
String phoneCipher = institutionMedicalPerson.getPhone();
if (StringUtils.isNotEmpty(phoneCipher)) {
if (encrypFlag && StringUtils.isNotEmpty(phoneCipher)) {
try {
//解密
String phone = EncryptionUtils.symmetricDecryptData(phoneCipher);
... ...
package org.jeecg.modules.claims.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.modules.claims.entity.InstitutionMedicalPrice;
import org.jeecg.modules.claims.mapper.InstitutionMedicalPriceMapper;
import org.jeecg.modules.claims.service.IInstitutionMedicalPriceService;
import org.jeecg.modules.system.service.ISysDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.math.BigDecimal;
import java.util.List;
/**
* @Description: institution_medical_price
* @Author: jeecg-boot
* @Date: 2025-01-24
* @Version: V1.0
*/
@Service
public class InstitutionMedicalPriceServiceImpl extends ServiceImpl<InstitutionMedicalPriceMapper, InstitutionMedicalPrice> implements IInstitutionMedicalPriceService {
@Autowired
private ISysDictService sysDictService;
@Override
public InstitutionMedicalPrice getPrice(String institutionId) { QueryWrapper<InstitutionMedicalPrice> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("institution_id", institutionId);
List<InstitutionMedicalPrice> list = list(queryWrapper);
Integer medicalCopy;
Integer medicalPost;
Integer medicalPaper;
if (list.isEmpty()) {
List<DictModel> medicalPostFee = sysDictService.getDictItems("medical_post_fee");
List<DictModel> medicalCopyFee = sysDictService.getDictItems("medical_copy_fee");
medicalCopy = Integer.parseInt(medicalCopyFee.get(0).getValue());
medicalPost = Integer.parseInt(medicalPostFee.get(0).getValue());
medicalPaper = null;
} else {
InstitutionMedicalPrice institutionMedicalPrice = list.get(0);
medicalCopy = institutionMedicalPrice.getCopyPrice();
medicalPost = institutionMedicalPrice.getPostPrice();
medicalPaper = institutionMedicalPrice.getPaperPrice();
}
InstitutionMedicalPrice result = new InstitutionMedicalPrice();
result.setCopyPrice(medicalCopy);
result.setPostPrice(medicalPost);
result.setPaperPrice(medicalPaper);
return result;
}
}
... ...
... ... @@ -18,6 +18,7 @@ import org.jeecg.modules.system.entity.SysUserRole;
import org.jeecg.modules.system.mapper.SysUserRoleMapper;
import org.jeecg.modules.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
... ... @@ -36,6 +37,9 @@ import java.util.List;
public class InstitutionMedicalServiceImpl extends ServiceImpl<InstitutionMedicalMapper, InstitutionMedical> implements IInstitutionMedicalService {
@Value("${jeecg.encrypFlag}")
private Boolean encrypFlag;
@Autowired
private ISysUserService sysUserService;
... ... @@ -209,7 +213,7 @@ public class InstitutionMedicalServiceImpl extends ServiceImpl<InstitutionMedica
public void changeFieldQuery(InstitutionMedical institutionMedical) {
//解密手机号,验证完成性
String phoneCipher = institutionMedical.getPhone();
if (StringUtils.isNotEmpty(phoneCipher)) {
if (encrypFlag && StringUtils.isNotEmpty(phoneCipher)) {
try {
//解密
String phone = EncryptionUtils.symmetricDecryptData(phoneCipher);
... ... @@ -231,7 +235,7 @@ public class InstitutionMedicalServiceImpl extends ServiceImpl<InstitutionMedica
public void changeFieldEncryp(InstitutionMedical institutionMedical) {
//加密手机号
String phone = institutionMedical.getPhone();
if (StringUtils.isNotEmpty(phone)){
if (encrypFlag && StringUtils.isNotEmpty(phone)){
//加密(一次加密)
try {
String s = EncryptionUtils.encryptionData(phone);
... ...
package org.jeecg.modules.claims.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.jeecg.modules.claims.entity.InstitutionMedicalPrice;
import org.jeecg.modules.claims.entity.MedicalRecordsCopy;
import org.jeecg.modules.claims.entity.MedicalRecordsCopyPay;
import org.jeecg.modules.claims.mapper.MedicalRecordsCopyPayMapper;
import org.jeecg.modules.claims.service.IInstitutionMedicalPriceService;
import org.jeecg.modules.claims.service.IMedicalRecordsCopyPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.math.BigDecimal;
import java.math.RoundingMode;
/**
* @Description: medical_records_copy_pay
* @Author: jeecg-boot
* @Date: 2025-01-24
* @Version: V1.0
*/
@Service
public class MedicalRecordsCopyPayServiceImpl extends ServiceImpl<MedicalRecordsCopyPayMapper, MedicalRecordsCopyPay> implements IMedicalRecordsCopyPayService {
@Autowired
private IInstitutionMedicalPriceService institutionMedicalPriceService;
// app提交申请时确认预支付金额,生成账单
@Override
public Boolean submitInitPay(MedicalRecordsCopy medicalRecordsCopy) {
String orderId = medicalRecordsCopy.getId();
QueryWrapper<MedicalRecordsCopyPay> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("order_id", orderId);
MedicalRecordsCopyPay recordsCopyPay = getOne(queryWrapper);
if (recordsCopyPay == null) {
// 获取复印张数单价及快递价格
InstitutionMedicalPrice price = institutionMedicalPriceService.getPrice(medicalRecordsCopy.getInstitutionId());
Integer copyPricePre = price.getCopyPrice();
Integer copyPrice = copyPricePre * Integer.parseInt(medicalRecordsCopy.getCopyingNumber());
Integer postPrice = price.getPostPrice();
MedicalRecordsCopyPay save = new MedicalRecordsCopyPay();
save.setOrderId(orderId);
save.setCopyPayPrice(copyPrice);
save.setPostPayPrice(postPrice);
save.setPrepaidPrice(copyPrice + postPrice);
// todo 已支付、待支付
save.setStatus("2");
return save(save);
}
return false;
}
// web 确认申请时计算应付总金额,更新账单应补金额
@Override
public Boolean confirmUpdatePay(MedicalRecordsCopy medicalRecordsCopy) {
String orderId = medicalRecordsCopy.getId();
QueryWrapper<MedicalRecordsCopyPay> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("order_id", orderId);
MedicalRecordsCopyPay recordsCopyPay = getOne(queryWrapper);
if (recordsCopyPay != null) {
// 获取复印张数单价及快递价格
InstitutionMedicalPrice price = institutionMedicalPriceService.getPrice(medicalRecordsCopy.getInstitutionId());
Integer paperPrice = price.getPaperPrice();
if (paperPrice == null) {
return false;
}
Integer copyPrice = paperPrice * Integer.parseInt(medicalRecordsCopy.getSheetsNumber());
Integer postPrice = price.getPostPrice();
Integer prepaidPrice = recordsCopyPay.getPrepaidPrice();
MedicalRecordsCopyPay update = new MedicalRecordsCopyPay();
update.setId(recordsCopyPay.getId());
update.setCopyPrice(copyPrice);
update.setPostPrice(postPrice);
update.setTotalPrice(copyPrice + postPrice);
update.setAdditionalPayPrice(copyPrice + postPrice - prepaidPrice);
if (copyPrice + postPrice - prepaidPrice == 0) {
// 已补缴
update.setStatus("4");
} else {
// 待补缴
update.setStatus("3");
}
return updateById(update);
}
return false;
}
@Override
public void getPayInfo(MedicalRecordsCopy medicalRecordsCopy) {
QueryWrapper<MedicalRecordsCopyPay> payQueryWrapper = new QueryWrapper<>();
payQueryWrapper.eq("order_id", medicalRecordsCopy.getId());
MedicalRecordsCopyPay payInfo = getOne(payQueryWrapper);
Integer copyPrice = payInfo.getCopyPrice();
Integer postPrice = payInfo.getPostPrice();
Integer totalPrice = payInfo.getTotalPrice();
Integer prepaidPrice = payInfo.getPrepaidPrice();
Integer additionalPayPrice = payInfo.getAdditionalPayPrice();
medicalRecordsCopy.setCopyPrice(new BigDecimal(copyPrice).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP));
medicalRecordsCopy.setPostPrice(new BigDecimal(postPrice).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP));
medicalRecordsCopy.setTotalPrice(new BigDecimal(totalPrice).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP));
medicalRecordsCopy.setPrepaidPrice(new BigDecimal(prepaidPrice).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP));
if (additionalPayPrice <= 0) {
medicalRecordsCopy.setAdditionalPayPrice(new BigDecimal(0));
} else {
medicalRecordsCopy.setAdditionalPayPrice(new BigDecimal(additionalPayPrice).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP));
}
}
}
... ...
package org.jeecg.modules.claims.service.impl;
import org.jeecg.modules.claims.entity.MedicalRecordsCopy;
import org.jeecg.modules.claims.mapper.MedicalRecordsCopyMapper;
import org.jeecg.modules.claims.service.IMedicalRecordsCopyService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: medical_records_copy
* @Author: jeecg-boot
* @Date: 2025-01-24
* @Version: V1.0
*/
@Service
public class MedicalRecordsCopyServiceImpl extends ServiceImpl<MedicalRecordsCopyMapper, MedicalRecordsCopy> implements IMedicalRecordsCopyService {
}
... ...
... ... @@ -5,6 +5,7 @@ import org.jeecg.common.util.custom.EncryptionUtils;
import org.jeecg.modules.gov.entity.HisMedicalInsuranceList;
import org.jeecg.modules.gov.mapper.HisMedicalInsuranceListMapper;
import org.jeecg.modules.gov.service.IHisMedicalInsuranceListService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
... ... @@ -21,6 +22,8 @@ import java.util.*;
@Service
public class HisMedicalInsuranceListServiceImpl extends ServiceImpl<HisMedicalInsuranceListMapper, HisMedicalInsuranceList> implements IHisMedicalInsuranceListService {
@Value("${jeecg.encrypFlag}")
private Boolean encrypFlag;
//用于首页计算医保统筹基金支出总额
@Override
public double sumPoolFundAmount() {
... ... @@ -94,7 +97,7 @@ public class HisMedicalInsuranceListServiceImpl extends ServiceImpl<HisMedicalIn
//患者姓名
String name = hisMedicalInsuranceList.getName();
if (StringUtils.isNotEmpty(name)) {
if (encrypFlag && StringUtils.isNotEmpty(name)) {
try {
//解密
String nameCode = EncryptionUtils.symmetricDecryptData(name);
... ... @@ -113,7 +116,7 @@ public class HisMedicalInsuranceListServiceImpl extends ServiceImpl<HisMedicalIn
//出院诊断
String dischargeDisease = hisMedicalInsuranceList.getDischargeDisease();
if (StringUtils.isNotEmpty(dischargeDisease)) {
if (encrypFlag && StringUtils.isNotEmpty(dischargeDisease)) {
try {
//解密
String dischargeDiseaseCode = EncryptionUtils.symmetricDecryptData(dischargeDisease);
... ...
package org.jeecg.modules.h5Api.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.bean.oauth2.WxOAuth2AccessToken;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.result.WxMpUser;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.claims.entity.*;
import org.jeecg.modules.claims.service.*;
import org.jeecg.modules.system.entity.SysDict;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysDictService;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.weixin.entity.WeixinUser;
import org.jeecg.modules.weixin.service.IWeixinUserService;
import org.jeecg.modules.weixin.util.WXUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
/**
* @Description: app
* @Author: jeecg-boot
* @Date: 2025-01-23
* @Version: V1.0
*/
@Api(tags="weixin_user")
@RestController
@RequestMapping("/app/api")
@Slf4j
public class AppController {
@Autowired
protected WxMpService wxMpService;
@Autowired
private IWeixinUserService weixinUserService;
@Autowired
private IInstitutionMedicalService institutionMedicalService;
@Autowired
private IInstitutionMedicalPriceService institutionMedicalPriceService;
@Autowired
private IMedicalRecordsCopyService medicalRecordsCopyService;
@Autowired
private IMedicalRecordsCopyPayService medicalRecordsCopyPayService;
@Autowired
private IHisVisinfoListService hisVisinfoListService;
@Autowired
private IInstitutionInsuranceService institutionInsuranceService;
@Autowired
private IInstitutionMedicalPersonService institutionMedicalPersonService;
@Autowired
private ISysUserService sysUserService;
@Value("${wx.pay.appId}")
private String appId;
@Value("${wx.pay.notifyUrl}")
private String notifyUrl;
@Value("${wx.configs.appSecret}")
private String appSecret;
@RequestMapping(value = "/getWxCode", method = RequestMethod.POST)
public String getWxCode(HttpServletResponse response, HttpServletRequest request) {
String diningId = request.getParameter("diningId");
// 第一步:用户同意授权,获取code
StringBuilder path = new StringBuilder();
//微信公众号appid
path.append("https://open.weixin.qq.com/connect/oauth2/authorize?appid=").append(appId);
//重定向的地址
path.append("&redirect_uri=").append(notifyUrl).append("/api/login").append("/getWxgzhUser");
if(diningId != null){
path.append("?diningId=").append(diningId);
}
path.append("&response_type=code");
/*
*以snsapi_base为scope发起的网页授权,是用来获取进入页面的用户的openid的,并且是静默授权并自动跳转到回调页的。用户感知的就是直接进入了回调页(往往是业务页面)
*以snsapi_userinfo为scope发起的网页授权,是用来获取用户的基本信息的。但这种授权需要用户手动同意,并且由于用户同意过,所以无须关注,就可在授权后获取该用户的基本信息。
*/
path.append("&scope=").append("snsapi_userinfo");
path.append("&state=STATE");
path.append("&connect_redirect=1#wechat_redirect");
log.info("*****************"+path);
try {
response.sendRedirect(path.toString());
} catch (IOException e) {
log.error("获取微信code失败: " + e.getMessage());
}
//必须重定向,否则不能成功
return "redirect:" + path.toString();
}
private String getOpenId(String code){
System.err.println("****************67"+code);
WxOAuth2AccessToken accessToken;
try {
accessToken = wxMpService.getOAuth2Service().getAccessToken(code);
WXUtils.putCache("OPENID",accessToken.getOpenId());
WxMpUser wxMpUser = wxMpService.getUserService().userInfo(accessToken.getOpenId());
WeixinUser weixinUser = new WeixinUser();
weixinUser.setOpenId(accessToken.getOpenId());
System.err.println(accessToken.getOpenId());
QueryWrapper<WeixinUser> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("open_id",accessToken.getOpenId());
List<WeixinUser> weixinUserList = weixinUserService.list(queryWrapper);
if(weixinUserList == null || weixinUserList.size() == 0){
if(wxMpUser != null){
weixinUser.setWeixinName(wxMpUser.getNickname());
weixinUser.setWeixinLogo(wxMpUser.getHeadImgUrl());
weixinUser.setDelFlag("0");
}
weixinUserService.save(weixinUser);
}
System.err.println(weixinUser);
return accessToken.getOpenId();
} catch (WxErrorException e) {
e.printStackTrace();
log.error(e.getError().toString());
}
return "";
}
@RequestMapping("/getWxgzhUser")
public ModelAndView getWxgzhApi(HttpServletRequest request) {
String code = request.getParameter("code");
String openId = getOpenId(code);
System.err.println("*************103***************"+openId);
// String diningId = request.getParameter("diningId");
// if(diningId != null){
// return new ModelAndView("redirect:"+"https://canteenh5.yunalot.com/#/advice?diningId="+diningId+"&openId="+openId);
// }
return new ModelAndView("redirect:"+"https://canteenh5.yunalot.com/#/?openId="+openId);
}
/**
* 医院列表分页列表查询
*
* @param institutionMedical
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "institution_medical-分页列表查询")
@ApiOperation(value="institution_medical-分页列表查询", notes="institution_medical-分页列表查询")
@GetMapping(value = "/institutionMedical/list")
public Result<IPage<InstitutionMedical>> institutionMedicalList(InstitutionMedical institutionMedical,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<InstitutionMedical> queryWrapper = QueryGenerator.initQueryWrapper(institutionMedical, req.getParameterMap());
// //获取当前用户
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//
// //判断登录人员是否为医疗机构人员(前端通过权限配置,屏蔽保险机构人员访问该页面,故无需判断是否为保险公司人员)
// String institutionId = sysUserService.getById(sysUser.getId()).getInstitutionId();
// //若institutionId为空,则为其他人员
// if (StringUtils.isNotEmpty(institutionId)){
// InstitutionMedical insurance = institutionMedicalService.getById(institutionId);
// //若机构表中有该id,则为保险机构人员
// if (insurance != null){
// queryWrapper.eq("id",institutionId);
// }
// }
Page<InstitutionMedical> page = new Page<>(pageNo, pageSize);
IPage<InstitutionMedical> pageList = institutionMedicalService.page(page, queryWrapper);
if(pageList == null) {
return Result.error("未找到对应数据");
}
List<InstitutionMedical> records = pageList.getRecords();
//解密显示
for (InstitutionMedical medical:records){
institutionMedicalService.changeFieldQuery(medical);
}
return Result.OK(pageList);
}
/**
* 获取province
*
* @return
*/
@RequestMapping(value = "/getProvince", method = RequestMethod.GET)
public Result<?> getProvince() {
List<Map<String, String>> province = weixinUserService.getProvince();
List<Map<String, String>> city = weixinUserService.getCity("110000");
List<Map<String, String>> area = weixinUserService.getArea("110100");
return Result.OK(Arrays.asList(province, city, area));
}
/**
* 获取city
*
* @param
* @return
*/
@RequestMapping(value = "/getCity", method = RequestMethod.GET)
public Result<?> getCity(@RequestParam(name="provinceCode",required=false) String provinceCode) {
List<Map<String, String>> city = weixinUserService.getCity(provinceCode);
return Result.OK(city);
}
/**
* 获取area
*
* @return
*/
@RequestMapping(value = "/getArea", method = RequestMethod.GET)
public Result<?> getArea(@RequestParam(name="cityCode",required=false) String cityCode) {
List<Map<String, String>> area = weixinUserService.getArea(cityCode);
return Result.OK(area);
}
/**
* 获取price
*
* @return
*/
@RequestMapping(value = "/getPrice", method = RequestMethod.GET)
public Result<?> getPrice(@RequestParam(name="institutionId",required=false) String institutionId) {
InstitutionMedicalPrice institutionMedicalPrice = institutionMedicalPriceService.getPrice(institutionId);
JSONObject result = new JSONObject();
result.put("copyPrice", new BigDecimal(institutionMedicalPrice.getCopyPrice()).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP));
result.put("postPrice", new BigDecimal(institutionMedicalPrice.getPostPrice()).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP));
result.put("paperPrice", new BigDecimal(institutionMedicalPrice.getPaperPrice()).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP));
return Result.OK(result);
}
/**
* 预支付
*
* @param medicalRecordsCopy
* @return
*/
@AutoLog(value = "weixin_user-支付")
@Transactional
@ApiOperation(value="weixin_user-支付", notes="weixin_user-支付")
// @RequiresPermissions("claims:medical_records_copy:add")
@PostMapping(value = "/weixin/prepay")
public Result<String> prepay(@RequestBody MedicalRecordsCopy medicalRecordsCopy) {
Boolean prepay = weixinUserService.prepay(medicalRecordsCopy);
medicalRecordsCopy.setStatus("0");
if (prepay) {
medicalRecordsCopyPayService.submitInitPay(medicalRecordsCopy);
medicalRecordsCopy.setStatus("1");
medicalRecordsCopyService.save(medicalRecordsCopy);
return Result.OK("支付成功!");
} else {
medicalRecordsCopyService.save(medicalRecordsCopy);
return Result.error("支付失败!");
}
}
/**
* 我的申请分页列表查询
*
* @param medicalRecordsCopy
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "medical_records_copy-分页列表查询")
@ApiOperation(value="medical_records_copy-分页列表查询", notes="medical_records_copy-分页列表查询")
@GetMapping(value = "/recordsCopy/list")
public Result<IPage<MedicalRecordsCopy>> recordsCopyList(MedicalRecordsCopy medicalRecordsCopy,
@RequestParam(name="openid", required = false) String openid,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<MedicalRecordsCopy> queryWrapper = QueryGenerator.initQueryWrapper(medicalRecordsCopy, req.getParameterMap());
try {
SysUser user = weixinUserService.getUserByOpenid(openid);
queryWrapper.eq("create_by", user.getUsername());
} catch (Exception e) {
return Result.error("身份信息有误!");
}
Page<MedicalRecordsCopy> page = new Page<MedicalRecordsCopy>(pageNo, pageSize);
IPage<MedicalRecordsCopy> pageList = medicalRecordsCopyService.page(page, queryWrapper);
if (pageList.getRecords() != null && !pageList.getRecords().isEmpty()) {
for (MedicalRecordsCopy record : pageList.getRecords()) {
if (StringUtils.isNotBlank(record.getRegion())) {
String[] split = record.getRegion().split(",");
if (split.length > 2) {
List<Map<String, String>> region = weixinUserService.getRegion(split[2]);
record.setRegion(region.get(0).get("provinceName") + region.get(0).get("cityName") + region.get(0).get("areaName"));
}
}
try {
medicalRecordsCopyPayService.getPayInfo(record);
} catch (Exception e) {
System.err.println(e.getMessage());
}
}
}
return Result.OK(pageList);
}
/**
* 我的申请详情
*
* @param id
* @return
*/
//@AutoLog(value = "medical_records_copy-详情")
@ApiOperation(value="medical_records_copy-详情", notes="medical_records_copy-详情")
@GetMapping(value = "/recordsCopy/queryById")
public Result<MedicalRecordsCopy> recordsCopyQueryById(@RequestParam(name="id",required=true) String id) {
MedicalRecordsCopy medicalRecordsCopy = medicalRecordsCopyService.getById(id);
if(medicalRecordsCopy==null) {
return Result.error("未找到对应数据");
}
if (StringUtils.isNotBlank(medicalRecordsCopy.getRegion())) {
String[] split = medicalRecordsCopy.getRegion().split(",");
if (split.length > 2) {
List<Map<String, String>> region = weixinUserService.getRegion(split[2]);
medicalRecordsCopy.setRegion(region.get(0).get("provinceName") + region.get(0).get("cityName") + region.get(0).get("areaName"));
}
}
if (StringUtils.isNotBlank(medicalRecordsCopy.getInstitutionId())) {
InstitutionMedical institutionMedical = institutionMedicalService.getById(medicalRecordsCopy.getInstitutionId());
if (institutionMedical != null) {
medicalRecordsCopy.setInstitutionName(institutionMedical.getInstitutionName());
}
}
try {
medicalRecordsCopyPayService.getPayInfo(medicalRecordsCopy);
} catch (Exception e) {
System.err.println(e.getMessage());
}
return Result.OK(medicalRecordsCopy);
}
/**
* 验证就诊流水号
*
* @param medicalNum
* @return
*/
//@AutoLog(value = "ins_claims_settle-验证就诊流水号")
@ApiOperation(value="ins_claims_settle-验证就诊流水号", notes="ins_claims_settle-验证就诊流水号")
@GetMapping(value = "/claimsSettle/validMedicalNum")
public Result<?> validMedicalNum(@RequestParam(name="medicalNum",required=true) String medicalNum) {
QueryWrapper<HisVisinfoList> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("medical_num", medicalNum);
List<HisVisinfoList> hisVisinfoList = hisVisinfoListService.list(queryWrapper);
if (hisVisinfoList == null || hisVisinfoList.isEmpty()) {
return Result.error("未找到就诊记录!");
}
return Result.OK(hisVisinfoList.get(0));
}
/**
* 查询保险机构
*
* @return
*/
//@AutoLog(value = "ins_claims_settle-查询保险机构")
@ApiOperation(value="ins_claims_settle-查询保险机构", notes="ins_claims_settle-查询保险机构")
@GetMapping(value = "/claimsSettle/getInsurance")
public Result<?> getInsurance() {
List<InstitutionInsurance> institutionInsuranceList = institutionInsuranceService.list(new QueryWrapper<>());
if (institutionInsuranceList == null || institutionInsuranceList.isEmpty()) {
return Result.error("未找到就诊记录!");
}
List<JSONObject> result = new ArrayList<>();
for (InstitutionInsurance i : institutionInsuranceList) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", i.getId());
jsonObject.put("name", i.getInstitutionName());
result.add(jsonObject);
}
return Result.OK(Collections.singletonList(result));
}
/**
* 查询理赔结算申请
*
* @param hisVisinfoList
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "ins_claims_settle-查询理赔结算申请")
@ApiOperation(value="ins_claims_settle-查询理赔结算申请", notes="ins_claims_settle-查询理赔结算申请")
@GetMapping(value = "/claimsSettle/list")
public Result<IPage<HisVisinfoList>> claimsSettleList(HisVisinfoList hisVisinfoList,
@RequestParam(name="openid", required = false) String openid,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<HisVisinfoList> queryWrapper = QueryGenerator.initQueryWrapper(hisVisinfoList, req.getParameterMap());
//获取当前用户
try {
SysUser user = weixinUserService.getUserByOpenid(openid);
//判断登录人员是否为医院人员(前端通过权限配置,屏蔽保险机构人员访问该页面,故无需判断是否为保险公司人员)
QueryWrapper<InstitutionMedicalPerson> mpQuery = new QueryWrapper<>();
mpQuery.eq("user_id",user.getId());
List<InstitutionMedicalPerson> mpList = institutionMedicalPersonService.list(mpQuery);
//筛选登录用户所属医院的信息
if (!mpList.isEmpty()) {
queryWrapper.eq("hospital_id",mpList.get(0).getInstitutionId());
}
} catch (Exception e) {
return Result.error("身份信息有误!");
}
//排序
queryWrapper.orderByDesc("life_insure")
.orderByDesc("leave_date")
.orderByDesc("medical_type")
.orderByDesc("treat_dept_name");
Page<HisVisinfoList> page = new Page<HisVisinfoList>(pageNo, pageSize);
IPage<HisVisinfoList> pageList = hisVisinfoListService.page(page, queryWrapper);
if(pageList == null) {
return Result.error("未找到对应数据");
}
List<HisVisinfoList> records = pageList.getRecords();
//解密显示
for (HisVisinfoList hisVisinfo:records){
hisVisinfoListService.changeFieldQuery(hisVisinfo);
}
return Result.OK(pageList);
}
/**
* 查询理赔结算申请详情
*
* @param id
* @return
*/
//@AutoLog(value = "ins_claims_settle-查询理赔结算申请详情")
@ApiOperation(value="ins_claims_settle-查询理赔结算申请详情", notes="ins_claims_settle-查询理赔结算申请详情")
@GetMapping(value = "/claimsSettle/queryById")
public Result<HisVisinfoList> claimsSettleQueryById(@RequestParam(name="id",required=true) String id) {
HisVisinfoList hisVisinfoList = hisVisinfoListService.getById(id);
if(hisVisinfoList==null) {
return Result.error("未找到对应数据");
}
//解密
hisVisinfoListService.changeFieldQuery(hisVisinfoList);
return Result.OK(hisVisinfoList);
}
/**
* 提交理赔结算申请
*
* @return
*/
//@AutoLog(value = "ins_claims_settle-提交理赔结算申请")
@ApiOperation(value="ins_claims_settle-提交理赔结算申请", notes="ins_claims_settle-提交理赔结算申请")
@GetMapping(value = "/claimsSettle/submit")
public Result<?> submitClaimsSettle(HisVisinfoList hisVisinfoList,
@RequestParam(name="openid", required = false) String openid) {
QueryWrapper<HisVisinfoList> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("medical_num", hisVisinfoList.getMedicalNum());
List<HisVisinfoList> dbDatas = hisVisinfoListService.list(queryWrapper);
HisVisinfoList dbData = dbDatas.get(0);
HisVisinfoList update = new HisVisinfoList();
BeanUtils.copyProperties(dbData, update);
update.setNameCode(hisVisinfoList.getNameCode());
update.setCredentialType(hisVisinfoList.getCredentialType());
update.setUserCode(hisVisinfoList.getUserCode());
update.setInsuranceId(hisVisinfoList.getInsuranceId());
update.setHospitalId(hisVisinfoList.getHospitalId());
update.setHospitalCode(hisVisinfoList.getHospitalCode());
update.setHospitalName(hisVisinfoList.getHospitalName());
// todo 初始状态
update.setInsSettleStatus("1");
hisVisinfoListService.updateById(update);
return Result.OK(update);
}
}
... ...
package org.jeecg.modules.h5Api.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Authorization;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.util.CommonUtils;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.h5Api.entity.H5Result;
import org.jeecg.modules.h5Api.entity.ReturnCode;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.AntPathMatcher;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.HandlerMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
@Slf4j
@Api(tags = "upload" ,description = "上传图片")
@RestController
@RequestMapping(value = "/app/api/img")
public class UploadImgController {
@Value(value = "${jeecg.path.upload}")
private String uploadPath;
/**
* 本地:local minio:minio 阿里:alioss
*/
@Value(value="${jeecg.uploadType}")
private String uploadType;
@ApiOperation(value = "上传图片", notes = "上传图片", httpMethod = "POST")
@ApiImplicitParam(paramType="header", name="authorization", value = "authorization", required = true,dataType = "string")
@Authorization("authorization")
@RequestMapping(value = "/upload",method = RequestMethod.POST)
public String upload(HttpServletRequest request, HttpServletResponse response){
String savePath = "";
String bizPath = request.getParameter("biz");
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
MultipartFile file = multipartRequest.getFile("file");// 获取上传文件对象
assert file != null;
if (oConvertUtils.isEmpty(bizPath)) {
if (CommonConstant.UPLOAD_TYPE_OSS.equals(uploadType)) {
//未指定目录,则用阿里云默认目录 upload
bizPath = "upload";
} else {
bizPath = "";
}
}
if (CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) {
savePath = this.uploadLocal(file,bizPath);
} else {
savePath = CommonUtils.upload(file, bizPath, uploadType);
}
return savePath;
}
private String uploadLocal(MultipartFile mf,String bizPath){
try {
String ctxPath = uploadPath;
String fileName = null;
File file = new File(ctxPath + File.separator + bizPath + File.separator );
if (!file.exists()) {
file.mkdirs();// 创建文件根目录
}
String orgName = mf.getOriginalFilename();// 获取文件名
orgName = CommonUtils.getFileName(orgName);
if(orgName.indexOf(".")!=-1){
fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.indexOf("."));
}else{
fileName = orgName+ "_" + System.currentTimeMillis();
}
String savePath = file.getPath() + File.separator + fileName;
File savefile = new File(savePath);
FileCopyUtils.copy(mf.getBytes(), savefile);
String dbpath = null;
if(oConvertUtils.isNotEmpty(bizPath)){
dbpath = bizPath + File.separator + fileName;
}else{
dbpath = fileName;
}
if (dbpath.contains("\\")) {
dbpath = dbpath.replace("\\", "/");
}
return dbpath;
} catch (IOException e) {
log.error(e.getMessage(), e);
}
return "";
}
@ApiOperation(value = "预览图片", notes = "预览图片", httpMethod = "POST")
@ApiImplicitParam(paramType="header", name="authorization", value = "authorization", required = true,dataType = "string")
@Authorization("authorization")
@RequestMapping(value = "/static/**",method = RequestMethod.GET)
public void view(HttpServletRequest request, HttpServletResponse response) {
// ISO-8859-1 ==> UTF-8 进行编码转换
String imgPath = extractPathFromPattern(request);
if(oConvertUtils.isEmpty(imgPath) || imgPath=="null"){
return;
}
// 其余处理略
InputStream inputStream = null;
OutputStream outputStream = null;
try {
imgPath = imgPath.replace("..", "");
if (imgPath.endsWith(",")) {
imgPath = imgPath.substring(0, imgPath.length() - 1);
}
String filePath = uploadPath + File.separator + imgPath;
File file = new File(filePath);
if(!file.exists()){
response.setStatus(404);
throw new RuntimeException("文件不存在..");
}
response.setContentType("application/force-download");// 设置强制下载不打开
response.addHeader("Content-Disposition", "attachment;fileName=" + new String(file.getName().getBytes("UTF-8"),"iso-8859-1"));
inputStream = new BufferedInputStream(new FileInputStream(filePath));
outputStream = response.getOutputStream();
byte[] buf = new byte[1024];
int len;
while ((len = inputStream.read(buf)) > 0) {
outputStream.write(buf, 0, len);
}
response.flushBuffer();
} catch (IOException e) {
log.error("预览文件失败" + e.getMessage());
response.setStatus(404);
e.printStackTrace();
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
if (outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
}
}
/**
* 把指定URL后的字符串全部截断当成参数
* 这么做是为了防止URL中包含中文或者特殊字符(/等)时,匹配不了的问题
* @param request
* @return
*/
private static String extractPathFromPattern(final HttpServletRequest request) {
String path = (String) request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);
String bestMatchPattern = (String) request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE);
return new AntPathMatcher().extractPathWithinPattern(bestMatchPattern, path);
}
}
... ...
package org.jeecg.modules.h5Api.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecg.common.constant.CommonConstant;
import org.springframework.stereotype.Controller;
import java.io.Serializable;
@Data
@ApiModel(value="h5接口返回对象", description="h5接口返回对象")
@Controller
public class H5Result<T> implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty("返回码(returnCode)")
private ReturnCode returnCode;
// 返回数据
@ApiModelProperty("返回的具体数据")
private T resultData;
public H5Result() {
}
public H5Result(T resultData) {
this.resultData = resultData;
}
public static<T> H5Result<T> OK() {
H5Result<T> h5 = new H5Result<T>();
ReturnCode<T> r = new ReturnCode<T>();
r.setType("S");
r.setCode(CommonConstant.SC_OK_200.toString());
r.setMessage("成功");
h5.setReturnCode(r);
return h5;
}
public static<T> H5Result<T> OK(T data) {
H5Result<T> h5 = new H5Result<T>();
ReturnCode<T> r = new ReturnCode<T>();
r.setType("S");
r.setCode(CommonConstant.SC_OK_200.toString());
h5.setResultData(data);
h5.setReturnCode(r);
return h5;
}
public static<T> H5Result<T> OK(String msg, T data) {
H5Result<T> h5 = new H5Result<T>();
ReturnCode<T> r = new ReturnCode<T>();
r.setType("S");
r.setCode(CommonConstant.SC_OK_200.toString());
r.setMessage(msg);
h5.setResultData(data);
h5.setReturnCode(r);
return h5;
}
public static H5Result<Object> error(String msg) {
return error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, msg);
}
public static H5Result<Object> error(int code, String msg) {
H5Result<Object> h5 = new H5Result<Object>();
ReturnCode<Object> r = new ReturnCode<Object>();
r.setCode(String.valueOf(code));
r.setMessage(msg);
r.setType("E");
h5.setReturnCode(r);
return h5;
}
public H5Result<T> error500(String message) {
H5Result<T> h5 = new H5Result<T>();
ReturnCode<T> r = new ReturnCode<T>();
r.setType("E");
r.setCode(CommonConstant.SC_INTERNAL_SERVER_ERROR_500.toString());
r.setMessage(message);
h5.setReturnCode(r);
return h5;
}
}
... ...
package org.jeecg.modules.h5Api.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel(value="h5接口返回ReturnCode", description="h5接口返回ReturnCode")
public class ReturnCode<T> implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty("状态码")
private String code;
// 返回码,S:成功,E:失败
@ApiModelProperty("返回码,S:成功,E:失败")
private String type;
// 返回消息,成功为“success”,失败为具体失败信息
@ApiModelProperty("错误信息")
private String message;
public ReturnCode() {
}
public ReturnCode(String code, String type, String message) {
this.code = code;
this.type = type;
this.message = message;
}
}
... ...
... ... @@ -26,6 +26,7 @@ import org.jeecg.modules.system.model.TreeModel;
import org.jeecg.modules.system.service.*;
import org.jeecg.modules.system.util.PermissionDataUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
... ... @@ -44,7 +45,8 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("/sys/permission")
public class SysPermissionController {
@Value("${jeecg.encrypFlag}")
private Boolean encrypFlag;
@Autowired
private ISysPermissionService sysPermissionService;
... ... @@ -564,7 +566,7 @@ public class SysPermissionController {
this.sysRolePermissionService.saveRolePermission(roleId, permissionIds, lastPermissionIds);
//权限加密
if (StringUtils.isNotEmpty(roleId) && StringUtils.isNotEmpty(permissionIds)){
if (encrypFlag && StringUtils.isNotEmpty(roleId) && StringUtils.isNotEmpty(permissionIds)){
//将本次的字符串重新加密存起来
SysRole sysRole = sysRoleService.getById(roleId);
String hmac = EncryptionUtils.hmac(permissionIds);
... ...
... ... @@ -20,6 +20,7 @@ import org.jeecg.modules.system.service.ISysRoleService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
... ... @@ -39,6 +40,8 @@ import java.util.List;
*/
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService {
@Value("${jeecg.encrypFlag}")
private Boolean encrypFlag;
@Autowired
SysRoleMapper sysRoleMapper;
@Autowired
... ... @@ -106,7 +109,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
QueryWrapper<SysRolePermission> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("role_id",sysRole.getId());
List<SysRolePermission> list = sysRolePermissionService.list(queryWrapper);
if (!list.isEmpty()){
if (encrypFlag && !list.isEmpty()){
String ids = "";
//将所有的权限id拼接成字符串
for (SysRolePermission srp:list){
... ...
... ... @@ -1273,7 +1273,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
public void changeFieldQuery(SysUser sysUser) {
//解密证件号,验证完整性
String phoneCipher = sysUser.getPhone();
if (StringUtils.isNotEmpty(phoneCipher)) {
if (encrypFlag && StringUtils.isNotEmpty(phoneCipher)) {
try {
//绑定用户登录名,不适合加密
//解密
... ... @@ -1297,7 +1297,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
public void changeFieldEncryp(SysUser sysUser) {
//加密手机号
String phone = sysUser.getPhone();
if (StringUtils.isNotEmpty(phone)){
if (encrypFlag && StringUtils.isNotEmpty(phone)){
//绑定用户登录名,不适合加密
// //加密(一次加密)
// try {
... ... @@ -1321,7 +1321,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Override
public String roleIdeHmac(String roleIds) {
String roleIdsValid = null;
if (StringUtils.isNotEmpty(roleIds)){
if (encrypFlag && StringUtils.isNotEmpty(roleIds)){
try {
roleIdsValid = EncryptionUtils.hmac(roleIds);
return roleIdsValid;
... ...
package org.jeecg.modules.weixin.controller;
import me.chanjar.weixin.mp.config.WxMpConfigStorage;
import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
import org.jeecg.modules.weixin.entity.WxMpProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Handler;
import java.util.stream.Collectors;
@Configuration
public class WeChatConfig {
@Value("${wx.configs.appId}")
private String appId;
@Value("${wx.configs.appSecret}")
private String appSecret;
@Value("${wx.configs.token}")
private String token;
@Value("${wx.configs.aesKey}")
private String aesKey;
@Bean
public WxMpService wxMpService() {
WxMpService wxService = new WxMpServiceImpl();
WxMpDefaultConfigImpl configStorage = new WxMpDefaultConfigImpl();
configStorage.setAppId(appId);
configStorage.setSecret(appSecret);
configStorage.setToken(token);
configStorage.setAesKey(aesKey);
Map<String, WxMpConfigStorage> map = new HashMap<>();
map.put(appId, configStorage);
wxService.setMultiConfigStorages(map);
return wxService;
}
}
... ...
package org.jeecg.modules.weixin.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.weixin.entity.WeixinUser;
import org.jeecg.modules.weixin.service.IWeixinUserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import me.chanjar.weixin.mp.api.WxMpService;
/**
* @Description: weixin_user
* @Author: jeecg-boot
* @Date: 2025-01-23
* @Version: V1.0
*/
@Api(tags="weixin_user")
@RestController
@RequestMapping("/weixin/weixinUser")
@Slf4j
public class WeixinUserController extends JeecgController<WeixinUser, IWeixinUserService> {
@Autowired
protected WxMpService wxMpService;
@Autowired
private IWeixinUserService weixinUserService;
/**
* 分页列表查询
*
* @param weixinUser
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "weixin_user-分页列表查询")
@ApiOperation(value="weixin_user-分页列表查询", notes="weixin_user-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WeixinUser>> queryPageList(WeixinUser weixinUser,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WeixinUser> queryWrapper = QueryGenerator.initQueryWrapper(weixinUser, req.getParameterMap());
Page<WeixinUser> page = new Page<WeixinUser>(pageNo, pageSize);
IPage<WeixinUser> pageList = weixinUserService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param weixinUser
* @return
*/
@AutoLog(value = "weixin_user-添加")
@ApiOperation(value="weixin_user-添加", notes="weixin_user-添加")
// @RequiresPermissions("weixin:weixin_user:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody WeixinUser weixinUser) {
weixinUserService.save(weixinUser);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param weixinUser
* @return
*/
@AutoLog(value = "weixin_user-编辑")
@ApiOperation(value="weixin_user-编辑", notes="weixin_user-编辑")
// @RequiresPermissions("weixin:weixin_user:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody WeixinUser weixinUser) {
weixinUserService.updateById(weixinUser);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "weixin_user-通过id删除")
@ApiOperation(value="weixin_user-通过id删除", notes="weixin_user-通过id删除")
// @RequiresPermissions("weixin:weixin_user:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
weixinUserService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "weixin_user-批量删除")
@ApiOperation(value="weixin_user-批量删除", notes="weixin_user-批量删除")
// @RequiresPermissions("weixin:weixin_user:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.weixinUserService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "weixin_user-通过id查询")
@ApiOperation(value="weixin_user-通过id查询", notes="weixin_user-通过id查询")
@GetMapping(value = "/queryById")
public Result<WeixinUser> queryById(@RequestParam(name="id",required=true) String id) {
WeixinUser weixinUser = weixinUserService.getById(id);
if(weixinUser==null) {
return Result.error("未找到对应数据");
}
return Result.OK(weixinUser);
}
/**
* 导出excel
*
* @param request
* @param weixinUser
*/
// @RequiresPermissions("weixin:weixin_user:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WeixinUser weixinUser) {
return super.exportXls(request, weixinUser, WeixinUser.class, "weixin_user");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
// @RequiresPermissions("weixin:weixin_user:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.GET)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WeixinUser.class);
}
}
... ...
package org.jeecg.modules.weixin.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: weixin_user
* @Author: jeecg-boot
* @Date: 2025-01-23
* @Version: V1.0
*/
@Data
@TableName("weixin_user")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="weixin_user对象", description="weixin_user")
public class WeixinUser implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**微信ID*/
@Excel(name = "微信ID", width = 15)
@ApiModelProperty(value = "微信ID")
private java.lang.String openId;
/**微信昵称*/
@Excel(name = "微信昵称", width = 15)
@ApiModelProperty(value = "微信昵称")
private java.lang.String weixinName;
/**微信号*/
@Excel(name = "微信号", width = 15)
@ApiModelProperty(value = "微信号")
private java.lang.String weixinNum;
/**微信头像*/
@Excel(name = "微信头像", width = 15)
@ApiModelProperty(value = "微信头像")
private java.lang.String weixinLogo;
/**创建者*/
@ApiModelProperty(value = "创建者")
private java.lang.String createBy;
/**创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "创建时间")
private java.util.Date createTime;
/**更新者*/
@ApiModelProperty(value = "更新者")
private java.lang.String updateBy;
/**更新时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "更新时间")
private java.util.Date updateTime;
/**删除标记*/
@Excel(name = "删除标记", width = 15)
@ApiModelProperty(value = "删除标记")
@TableLogic
private java.lang.String delFlag;
/**系统用户ID*/
@Excel(name = "系统用户ID", width = 15, dictTable = "sys_user", dicText = "username", dicCode = "id")
@Dict(dictTable = "sys_user", dicText = "username", dicCode = "id")
@ApiModelProperty(value = "系统用户ID")
private java.lang.String sysUserId;
}
... ...
package org.jeecg.modules.weixin.entity;
import lombok.Data;
@Data
public class WxMpProperties {
private String appId;
private String secret;
private String token;
private String aesKey;
}
... ...
package org.jeecg.modules.weixin.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.weixin.entity.WeixinUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: weixin_user
* @Author: jeecg-boot
* @Date: 2025-01-23
* @Version: V1.0
*/
public interface WeixinUserMapper extends BaseMapper<WeixinUser> {
List<Map<String, String>> getProvince();
List<Map<String, String>> getCity(@Param("provinceCode") String provinceCode);
List<Map<String, String>> getArea(@Param("cityCode") String cityCode);
List<Map<String, String>> getRegion(@Param("areaCode") String areaCode);
}
... ...
<?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="org.jeecg.modules.weixin.mapper.WeixinUserMapper">
<select id="getProvince" resultType="java.util.Map">
select distinct province_code id, province_name name
from area
</select>
<select id="getCity" parameterType="java.lang.String" resultType="java.util.Map">
select distinct city_code id, city_name name
from area
where province_code = #{provinceCode}
</select>
<select id="getArea" parameterType="java.lang.String" resultType="java.util.Map">
select area_code id, area_name name
from area
where city_code = #{cityCode}
</select>
<select id="getRegion" parameterType="java.lang.String" resultType="java.util.Map">
select province_code provinceCode, province_name provinceName, city_code cityCode, city_name cityName, area_code areaCode, area_name areaName
from area
where area_code = #{areaCode}
</select>
</mapper>
\ No newline at end of file
... ...
package org.jeecg.modules.weixin.service;
import org.jeecg.modules.claims.entity.MedicalRecordsCopy;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.weixin.entity.WeixinUser;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Map;
/**
* @Description: weixin_user
* @Author: jeecg-boot
* @Date: 2025-01-23
* @Version: V1.0
*/
public interface IWeixinUserService extends IService<WeixinUser> {
List<Map<String, String>> getProvince();
List<Map<String, String>> getCity(String provinceCode);
List<Map<String, String>> getArea(String cityCode);
List<Map<String, String>> getRegion(String areaCode);
SysUser getUserByOpenid(String openid);
Boolean prepay(MedicalRecordsCopy medicalRecordsCopy);
}
... ...
package org.jeecg.modules.weixin.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.jeecg.modules.claims.entity.MedicalRecordsCopy;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.weixin.entity.WeixinUser;
import org.jeecg.modules.weixin.mapper.WeixinUserMapper;
import org.jeecg.modules.weixin.service.IWeixinUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import java.util.Map;
/**
* @Description: weixin_user
* @Author: jeecg-boot
* @Date: 2025-01-23
* @Version: V1.0
*/
@Service
public class WeixinUserServiceImpl extends ServiceImpl<WeixinUserMapper, WeixinUser> implements IWeixinUserService {
@Autowired
private ISysUserService sysUserService;
@Override
public List<Map<String, String>> getProvince() {
return baseMapper.getProvince();
}
@Override
public List<Map<String, String>> getCity(String provinceCode) {
return baseMapper.getCity(provinceCode);
}
@Override
public List<Map<String, String>> getArea(String cityCode) {
return baseMapper.getArea(cityCode);
}
@Override
public List<Map<String, String>> getRegion(String areaCode) {
return baseMapper.getRegion(areaCode);
}
@Override
public SysUser getUserByOpenid(String openid) {
QueryWrapper<WeixinUser> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("open_id", openid);
WeixinUser one = getOne(queryWrapper);
SysUser sysUser = sysUserService.getById(one.getSysUserId());
return sysUser;
}
@Override
public Boolean prepay(MedicalRecordsCopy medicalRecordsCopy) {
// todo 微信支付
return true;
}
}
... ...
package org.jeecg.modules.weixin.util;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.InvalidSessionException;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
public class WXUtils {
public static Session getSession(){
try{
Subject subject = SecurityUtils.getSubject();
Session session = subject.getSession(false);
if (session == null){
session = subject.getSession();
}
if (session != null){
return session;
}
// subject.logout();
}catch (InvalidSessionException e){
}
return null;
}
public static Object getCache(String key) {
return getCache(key, null);
}
public static Object getCache(String key, Object defaultValue) {
Object obj = getSession().getAttribute(key);
return obj==null?defaultValue:obj;
}
public static void putCache(String key, Object value) {
getSession().setAttribute(key, value);
}
public static void removeCache(String key) {
getSession().removeAttribute(key);
}
public static String getOpenId () {
Object obj = getCache("OPENID");
String openId = obj != null ? String.valueOf(obj) : null;
return openId;
}
}
... ...
... ... @@ -294,3 +294,22 @@ third-app:
# appSecret
client-secret: ??
agent-id: ??
#微信
wx:
configs:
#公众号 APP_ID
appId: wx
#公众号 APP_SECRET
appSecret: ''
#公众号 TOKEN
token: ''
#公众号 AES_KEY
aesKey: ''
pay:
appId: wx #微信公众号或者小程序的appid
mchId: '' #微信支付商户号
mchKey: '' #微信支付商户密钥
# subAppId: #服务商模式下的子商户公众账号ID
# subMchId: #服务商模式下的子商户号
keyPath: /root/apiclient_cert.p12 # p12证书的位置,可以指定绝对路径,也可以指定类路径(以classpath:开头)
notifyUrl: http://localhost:8080/insurance
\ No newline at end of file
... ...