|
|
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);
|
|
|
}
|
|
|
} |
...
|
...
|
|