update:对账消息推送,军保账单统计,退款数据统计

This commit is contained in:
Yuan
2025-10-20 14:39:29 +08:00
parent 9fb2ea9cb4
commit ff5bad9967
35 changed files with 3649 additions and 100 deletions

View File

@@ -0,0 +1,240 @@
package com.saye.hospitalgd.controller.FinancialReconciliation;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.saye.hospitalgd.commons.date.DateDUtil;
import com.saye.hospitalgd.commons.log.ExceptionDUtil;
import com.saye.hospitalgd.commons.log.LogUtil;
import com.saye.hospitalgd.model.Dicinfo;
import com.saye.hospitalgd.service.FinancialReconciliation.RefundStatisticsService;
import com.saye.hospitalgd.service.system.DicinfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/**
* @author thuang
* @version 1.0
* @description: 退款数据统计报表
* @date 2024/12/19 10:00
*/
@Api(tags = "退款数据统计报表")
@Controller
@RequestMapping("/refundStatistics")
public class RefundStatisticsController {
@Autowired
private RefundStatisticsService refundStatisticsService;
@Autowired
private DicinfoService dicinfoService;
/**
* @description: 到退款统计报表页面
* @author thuang
* @date 2024/12/19 10:00
* @version 1.0
*/
@RequestMapping("/toRefundStatistics")
public String toRefundStatistics(ModelMap modelMap) {
try {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
// 默认查询最近365天的数据一年
calendar.add(Calendar.DATE, -365);
Date startDate = calendar.getTime();
String startTime = DateDUtil.DateToStr(DateDUtil.yyyy_MM_dd, startDate);
String endTime = DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd);
modelMap.addAttribute("startTime", startTime);
modelMap.addAttribute("endTime", endTime);
//支付方式
List<Dicinfo> payType = dicinfoService.findDicinfoTreeNodeList("PAY_TYPE");
modelMap.addAttribute("payTypeList", payType);
//退款类型
List<Dicinfo> refundType = dicinfoService.findDicinfoTreeNodeList("REFUND_TYPE");
modelMap.addAttribute("refundTypeList", refundType);
} catch (Exception e) {
e.printStackTrace();
}
return "financialReconciliation/refundStatistics";
}
/**
* @description: 查询退款统计报表数据
* @author thuang
* @date 2024/12/19 10:00
* @version 1.0
*/
@RequestMapping("/findRefundStatistics")
@ResponseBody
@ApiOperation("查询退款统计报表数据")
public HashMap<Object, Object> findRefundStatistics(
@ApiParam("开始时间") String startTime,
@ApiParam("结束时间") String endTime,
@ApiParam("支付方式") String payType,
@ApiParam("退款类型") String refundType,
@ApiParam("统计维度") String dimension,
@ApiParam("页码") int page,
@ApiParam("每页数量") int limit) {
HashMap<Object, Object> responseMap = new HashMap<Object, Object>();
try {
HashMap<Object, Object> map = new HashMap<Object, Object>();
map.put("startTime", startTime);
map.put("endTime", endTime);
map.put("payType", payType);
map.put("refundType", refundType);
map.put("dimension", dimension);
PageHelper.startPage(page, limit);
PageInfo<HashMap<Object, Object>> pageInfo = new PageInfo<HashMap<Object, Object>>(refundStatisticsService.findRefundStatistics(map));
responseMap.put("code", 0);
responseMap.put("msg", "OK");
responseMap.put("count", pageInfo.getTotal());
responseMap.put("data", pageInfo.getList());
} catch (Exception e) {
e.printStackTrace();
String msg = e.getMessage();
responseMap.put("code", 1);
responseMap.put("msg", "查询失败,原因:" + msg);
}
return responseMap;
}
/**
* @description: 获取退款统计汇总数据
* @author thuang
* @date 2024/12/19 10:00
* @version 1.0
*/
@RequestMapping("/getRefundSummary")
@ResponseBody
@ApiOperation("获取退款统计汇总数据")
public HashMap<Object, Object> getRefundSummary(
@ApiParam("开始时间") String startTime,
@ApiParam("结束时间") String endTime,
@ApiParam("支付方式") String payType,
@ApiParam("退款类型") String refundType) {
HashMap<Object, Object> responseMap = new HashMap<Object, Object>();
try {
HashMap<Object, Object> map = new HashMap<Object, Object>();
map.put("startTime", startTime);
map.put("endTime", endTime);
map.put("payType", payType);
map.put("refundType", refundType);
HashMap<Object, Object> summaryData = refundStatisticsService.getRefundSummary(map);
responseMap.put("code", 0);
responseMap.put("msg", "OK");
responseMap.put("data", summaryData);
} catch (Exception e) {
e.printStackTrace();
String msg = e.getMessage();
responseMap.put("code", 1);
responseMap.put("msg", "查询失败,原因:" + msg);
}
return responseMap;
}
/**
* @description: 获取退款趋势数据
* @author thuang
* @date 2024/12/19 10:00
* @version 1.0
*/
@RequestMapping("/getRefundTrend")
@ResponseBody
@ApiOperation("获取退款趋势数据")
public HashMap<Object, Object> getRefundTrend(
@ApiParam("开始时间") String startTime,
@ApiParam("结束时间") String endTime,
@ApiParam("支付方式") String payType,
@ApiParam("退款类型") String refundType) {
HashMap<Object, Object> responseMap = new HashMap<Object, Object>();
try {
HashMap<Object, Object> map = new HashMap<Object, Object>();
map.put("startTime", startTime);
map.put("endTime", endTime);
map.put("payType", payType);
map.put("refundType", refundType);
List<HashMap<Object, Object>> trendData = refundStatisticsService.getRefundTrend(map);
responseMap.put("code", 0);
responseMap.put("msg", "OK");
responseMap.put("data", trendData);
} catch (Exception e) {
e.printStackTrace();
String msg = e.getMessage();
responseMap.put("code", 1);
responseMap.put("msg", "查询失败,原因:" + msg);
}
return responseMap;
}
/**
* @description: 导出退款统计报表
* @author thuang
* @date 2024/12/19 10:00
* @version 1.0
*/
@RequestMapping("/exportRefundStatistics")
@ResponseBody
@ApiOperation("导出退款统计报表")
public HashMap<Object, Object> exportRefundStatistics(
@ApiParam("开始时间") String startTime,
@ApiParam("结束时间") String endTime,
@ApiParam("支付方式") String payType,
@ApiParam("退款类型") String refundType,
@ApiParam("统计维度") String dimension) {
HashMap<Object, Object> responseMap = new HashMap<Object, Object>();
try {
HashMap<Object, Object> map = new HashMap<Object, Object>();
map.put("startTime", startTime);
map.put("endTime", endTime);
map.put("payType", payType);
map.put("refundType", refundType);
map.put("dimension", dimension);
String fileName = refundStatisticsService.exportRefundStatistics(map);
responseMap.put("code", 0);
responseMap.put("msg", "导出成功");
responseMap.put("fileName", fileName);
} catch (Exception e) {
e.printStackTrace();
String msg = e.getMessage();
responseMap.put("code", 1);
responseMap.put("msg", "导出失败,原因:" + msg);
}
return responseMap;
}
}

View File

@@ -160,12 +160,12 @@ public class HisDetailController {
List<HashMap<Object, Object>> list = hisDetailService.findHisDetail(map);
// 支付方式 - 不再使用字典转换,直接显示原始值
// List<Dicinfo> pay_type = dicinfoService.findDicinfoTreeNodeList("PAY_TYPE");
// HashMap<String, String> peyTypeMap = new HashMap<>();
// for (Dicinfo dicinfo : pay_type) {
// peyTypeMap.put(dicinfo.getDicvalue(), dicinfo.getDicname());
// }
// 支付方式
List<Dicinfo> pay_type = dicinfoService.findDicinfoTreeNodeList("PAY_TYPE");
HashMap<String, String> payTypeMap = new HashMap<>();
for (Dicinfo dicinfo : pay_type) {
payTypeMap.put(dicinfo.getDicvalue(), dicinfo.getDicname());
}
// 业务类型
List<Dicinfo> biz_type = dicinfoService.findDicinfoTreeNodeList("BIZ_TYPE");
@@ -196,9 +196,9 @@ public class HisDetailController {
String biztype = StringDUtil.changeNullToEmpty(hashMap.get("BIZTYPE"));
hashMap.put("BIZTYPE", bizTypeMap.get(biztype));
// 支付方式 - 直接使用原始值,不进行字典转换
// String paytype = StringDUtil.changeNullToEmpty(hashMap.get("PAYTYPE"));
// hashMap.put("PAYTYPE", peyTypeMap.get(paytype));
// 支付方式字典转换
String paytype = StringDUtil.changeNullToEmpty(hashMap.get("PAYTYPE"));
hashMap.put("PAYTYPE", payTypeMap.get(paytype));
}

View File

@@ -0,0 +1,277 @@
package com.saye.hospitalgd.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.saye.hospitalgd.commons.date.DateDUtil;
import com.saye.hospitalgd.commons.excel.ExportXLSX;
import com.saye.hospitalgd.commons.excel.HashMapConversionImpl;
import com.saye.hospitalgd.commons.excel.IConversionByExport;
import com.saye.hospitalgd.commons.log.ExceptionDUtil;
import com.saye.hospitalgd.commons.log.LogUtil;
import com.saye.hospitalgd.commons.string.StringDUtil;
import com.saye.hospitalgd.model.Dicinfo;
import com.saye.hospitalgd.model.StatusDefine;
import com.saye.hospitalgd.service.HisDetailService;
import com.saye.hospitalgd.service.system.DicinfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.io.File;
import java.math.BigDecimal;
import java.util.*;
/**
* @author thuang
* @version 1.0
* @description: 军保对账统计
* @date 2024/10/16 15:00
*/
@Api(value = "军保对账统计相关接口")
@Controller
@RequestMapping("/militaryInsurance")
public class MilitaryInsuranceController {
@Autowired
private HisDetailService hisDetailService;
@Autowired
private DicinfoService dicinfoService;
@RequestMapping("/toMilitaryInsurance")
public String toMilitaryInsurance(ModelMap modelMap) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.add(Calendar.DATE, -1);
Date startDate = calendar.getTime();
String startTime = DateDUtil.DateToStr(DateDUtil.yyyy_MM_dd, startDate);
String endTime = DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd);
modelMap.addAttribute("startTime", startTime);
modelMap.addAttribute("endTime", endTime);
// 业务类型
List<Dicinfo> biz_type = dicinfoService.findDicinfoTreeNodeList("BIZ_TYPE");
modelMap.addAttribute("bizTypeList", biz_type);
return "financialReconciliation/militaryInsurance";
}
/**
* @description: 查询军保明细记录 (paytype=3)
* @author thuang
* @date 2024/10/16 15:00
* @version 1.0
*/
@ApiOperation(value = "查询军保明细记录", notes = "")
@GetMapping("/findMilitaryInsuranceDetail")
@ResponseBody
public HashMap<Object, Object> findMilitaryInsuranceDetail(@ApiParam(value = "开始时间") String startTime,
@ApiParam(value = "结束时间") String endTime,
@ApiParam(value = "模糊查询字段") String likeFiled,
@ApiParam(value = "页码") int page,
@ApiParam(value = "每页数量") int limit) {
HashMap<Object, Object> responseMap = new HashMap<>();
try {
HashMap<Object, Object> map = new HashMap<Object, Object>();
map.put("payType", "3"); // 固定查询paytype=3的数据
map.put("startTime", startTime);
map.put("endTime", endTime);
map.put("likeFiled", likeFiled);
PageHelper.startPage(page, limit);
PageInfo<HashMap<Object, Object>> pageInfo = new PageInfo<HashMap<Object, Object>>(hisDetailService.findHisDetail(map));
responseMap.put("code", 0);
responseMap.put("msg", "OK");
responseMap.put("count", pageInfo.getTotal());
responseMap.put("data", pageInfo.getList());
} catch (Exception e) {
e.printStackTrace();
String msg = e.getMessage();
responseMap.put("code", 1);
responseMap.put("msg", "查询失败,原因:" + msg);
}
return responseMap;
}
/**
* @description: 查询军保记录统计数据
* @author thuang
* @date 2024/10/16 15:00
* @version 1.0
*/
@RequestMapping("/findMilitaryInsuranceCountData")
@ResponseBody
@ApiOperation(value = "查询军保记录统计数据", notes = "")
public HashMap<Object, Object> findMilitaryInsuranceCountData(@RequestBody HashMap<Object, Object> map) {
HashMap<Object, Object> responseMap = new HashMap<Object, Object>();
String errCode = "0";
String errMsg = "";
try {
// 固定查询paytype=3的数据
map.put("payType", "3");
// 如果没有传递时间参数,设置默认查询今日数据
if (map.get("startTime") == null || "".equals(map.get("startTime"))) {
map.put("startTime", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd) + " 00:00:00");
}
if (map.get("endTime") == null || "".equals(map.get("endTime"))) {
map.put("endTime", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd) + " 23:59:59");
}
List<HashMap<Object, Object>> hisDetailCount = hisDetailService.findHisDetailCountData(map);
if (hisDetailCount != null && hisDetailCount.size() > 0) {
responseMap.put("money", hisDetailCount.get(0).get("MONEY"));
responseMap.put("num", hisDetailCount.get(0).get("NUM"));
} else {
responseMap.put("money", "0");
responseMap.put("num", "0");
}
} catch (Exception e) {
e.printStackTrace();
errCode = "999";
errMsg = "查询军保记录统计数据失败,原因:" + e.getMessage();
responseMap.put("money", "0");
responseMap.put("num", "0");
}
responseMap.put("errCode", errCode);
responseMap.put("errMsg", errMsg);
return responseMap;
}
/**
* @description: 导出军保明细
* @author thuang
* @date 2024/10/16 15:00
* @version 1.0
*/
@RequestMapping("/exportMilitaryInsuranceDetail")
@ResponseBody
@ApiOperation(value = "导出军保明细", notes = "")
public HashMap<Object, Object> exportMilitaryInsuranceDetail(@RequestBody HashMap<Object, Object> map) {
HashMap<Object, Object> responseMap = new HashMap<Object, Object>();
String errCode = "0";
String errMsg = "";
String dlName = "";
String fileName = "";
String dowloadName = StringDUtil.changeNullToEmpty(map.get("dowloadName"));
try {
// 固定查询paytype=3的数据
map.put("payType", "3");
List<HashMap<Object, Object>> list = hisDetailService.findHisDetail(map);
// 支付方式字典
List<Dicinfo> pay_type = dicinfoService.findDicinfoTreeNodeList("PAY_TYPE");
HashMap<String, String> payTypeMap = new HashMap<>();
for (Dicinfo dicinfo : pay_type) {
payTypeMap.put(dicinfo.getDicvalue(), dicinfo.getDicname());
}
// 业务类型
List<Dicinfo> biz_type = dicinfoService.findDicinfoTreeNodeList("BIZ_TYPE");
HashMap<String, String> bizTypeMap = new HashMap<>();
for (Dicinfo dicinfo : biz_type) {
bizTypeMap.put(dicinfo.getDicvalue(), dicinfo.getDicname());
}
for (HashMap<Object, Object> hashMap : list) {
String paymethod = StringDUtil.changeNullToEmpty(hashMap.get("PAYMETHOD"));
if ("1".equals(paymethod)) {
hashMap.put("PAYMETHOD", "门诊");
} else if ("2".equals(paymethod)) {
hashMap.put("PAYMETHOD", "住院");
} else {
hashMap.put("PAYMETHOD", "");
}
String tradingStatus = StringDUtil.changeNullToEmpty(hashMap.get("TRADINGSTATUS"));
if ("1".equals(tradingStatus)) {
hashMap.put("TRADINGSTATUS", "收款记录");
} else if ("2".equals(tradingStatus)) {
hashMap.put("TRADINGSTATUS", "退款记录");
} else {
hashMap.put("TRADINGSTATUS", "");
}
String biztype = StringDUtil.changeNullToEmpty(hashMap.get("BIZTYPE"));
hashMap.put("BIZTYPE", bizTypeMap.get(biztype));
// 支付方式字典转换
String paytype = StringDUtil.changeNullToEmpty(hashMap.get("PAYTYPE"));
hashMap.put("PAYTYPE", payTypeMap.get(paytype));
}
if (list.size() > 0) {
// 定义标题头和文件名
String[] DISTANCE_HEADERNAME = {"交易状态", "业务类型", "支付方式", "交易时间", "交易日期", "操作员", "总金额", "平台交易号", "his订单号", "HIS交易ID", "患者id", "患者姓名", "来源"};
String[] sqlKey = {"TRADINGSTATUS", "BIZTYPE", "PAYTYPE", "TRADETIME", "TRADE_DATE", "HISOPERCODE", "AMOUNT", "PLATFORMTRANSID", "HISTRANSID", "HISTRANSID", "PATIENTID", "PATIENTNAME", "SOURCE"};
List<Object> rulList = new ArrayList<Object>(list);
// 创建工作表
ExportXLSX exportXLS = new ExportXLSX(DISTANCE_HEADERNAME, sqlKey, ExportXLSX.A3, false);
exportXLS.setTitleName(dowloadName);
IConversionByExport conversion = new HashMapConversionImpl();
exportXLS.setConversion(conversion);
exportXLS.setData(rulList);
exportXLS.modifyWidthOfHeader("5000", 0);
exportXLS.modifyWidthOfHeader("5000", 1);
exportXLS.modifyWidthOfHeader("5000", 2);
exportXLS.modifyWidthOfHeader("5000", 3);
exportXLS.modifyWidthOfHeader("5000", 4);
exportXLS.modifyWidthOfHeader("5000", 5);
exportXLS.modifyWidthOfHeader("8000", 6);
exportXLS.modifyWidthOfHeader("5000", 7);
exportXLS.modifyWidthOfHeader("5000", 8);
exportXLS.modifyWidthOfHeader("5000", 9);
exportXLS.modifyWidthOfHeader("5000", 10);
exportXLS.modifyWidthOfHeader("10000", 11);
// 文件名称
// 产生4位长度的随机码由字母和数字组成
String randomStr = StringDUtil.generateRandomCodeForLength(4);
dlName = DateDUtil.DateToStr(DateDUtil.yyyyMMddHHmmss, new Date()) + randomStr;
fileName = dlName + ".xlsx";
String uploadPath = StatusDefine.filePath + "/MilitaryInsurance/";
File uploadPathFile = new File(uploadPath);
if (!uploadPathFile.exists()) uploadPathFile.mkdirs();
String savePath = uploadPath + fileName;
exportXLS.execGenerateExcel(savePath);
}
} catch (Exception e) {
errCode = "999";
errMsg = "未知异常:" + ExceptionDUtil.getDetailExceptionMsg(e);
LogUtil.error(this.getClass(), "@@@系统出错!【" + errMsg + "");
}
responseMap.put("errCode", errCode);
responseMap.put("errMsg", errMsg);
responseMap.put("dlName", "MilitaryInsurance/" + fileName);
return responseMap;
}
}

View File

@@ -0,0 +1,270 @@
package com.saye.hospitalgd.controller.system;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.saye.hospitalgd.commons.date.DateDUtil;
import com.saye.hospitalgd.commons.string.StringDUtil;
import com.saye.hospitalgd.commons.uuid.UUIDGenerator;
import com.saye.hospitalgd.model.FinanceUser;
import com.saye.hospitalgd.service.NotifyService;
import com.saye.hospitalgd.service.system.FinanceUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
/**
* @author thuang
* @version 1.0
* @description: 财务人员管理控制器
* @date 2024/12/19 18:00
*/
@Api(tags = "财务人员管理")
@Controller
@RequestMapping("/financeUser")
public class FinanceUserController {
@Autowired
private FinanceUserService financeUserService;
@Autowired
private NotifyService notifyService;
/**
* @description: 到财务人员管理页面
* @author thuang
* @date 2024/12/19 18:00
* @version 1.0
*/
@RequestMapping("/toFinanceUser")
public String toFinanceUser(ModelMap modelMap) {
return "system/financeUser";
}
/**
* @description: 到财务人员管理测试页面
* @author thuang
* @date 2024/12/19 18:30
* @version 1.0
*/
@RequestMapping("/toFinanceUserTest")
public String toFinanceUserTest(ModelMap modelMap) {
return "system/financeUser_test";
}
/**
* @description: 查询财务人员列表
* @author thuang
* @date 2024/12/19 18:00
* @version 1.0
*/
@RequestMapping("/findFinanceUserPageList")
@ResponseBody
@ApiOperation("查询财务人员列表")
public HashMap<Object, Object> findFinanceUserPageList(
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "wechatName", required = false) String wechatName,
@RequestParam(value = "phone", required = false) String phone,
@RequestParam(value = "isActive", required = false) String isActive,
@RequestParam(value = "page", defaultValue = "1") int page,
@RequestParam(value = "limit", defaultValue = "20") int limit) {
HashMap<Object, Object> responseMap = new HashMap<Object, Object>();
try {
HashMap<Object, Object> map = new HashMap<Object, Object>();
map.put("name", name);
map.put("wechatName", wechatName);
map.put("phone", phone);
map.put("isActive", isActive);
PageHelper.startPage(page, limit);
PageInfo<FinanceUser> pageInfo = new PageInfo<FinanceUser>(financeUserService.findFinanceUserPageList(map));
responseMap.put("code", 0);
responseMap.put("msg", "OK");
responseMap.put("count", pageInfo.getTotal());
responseMap.put("data", pageInfo.getList());
} catch (Exception e) {
e.printStackTrace();
String msg = e.getMessage();
responseMap.put("code", 1);
responseMap.put("msg", "查询失败,原因:" + msg);
}
return responseMap;
}
/**
* @description: 添加财务人员
* @author thuang
* @date 2024/12/19 18:00
* @version 1.0
*/
@RequestMapping("/addFinanceUser")
@ResponseBody
@ApiOperation("添加财务人员")
public HashMap<Object, Object> addFinanceUser(@RequestBody FinanceUser financeUser) {
HashMap<Object, Object> responseMap = new HashMap<Object, Object>();
try {
financeUser.setId(UUIDGenerator.getUUID());
financeUser.setCreateTime(DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss));
financeUser.setModifyTime(DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss));
if (StringDUtil.changeNullToEmpty(financeUser.getIsActive()).equals("")) {
financeUser.setIsActive("1");
}
// 如果有手机号尝试通过手机号获取OpenID
if (financeUser.getPhone() != null && !financeUser.getPhone().trim().isEmpty()) {
try {
String openId = notifyService.getUserOpenIdByPhone(financeUser.getPhone());
financeUser.setOpenId(openId);
} catch (Exception e) {
// 获取OpenID失败不影响添加财务人员只记录日志
System.err.println("根据手机号获取OpenID失败: " + e.getMessage());
}
}
financeUserService.addFinanceUser(financeUser);
responseMap.put("code", 0);
responseMap.put("msg", "添加成功");
} catch (Exception e) {
e.printStackTrace();
String msg = e.getMessage();
responseMap.put("code", 1);
responseMap.put("msg", "添加失败,原因:" + msg);
}
return responseMap;
}
/**
* @description: 修改财务人员
* @author thuang
* @date 2024/12/19 18:00
* @version 1.0
*/
@RequestMapping("/updateFinanceUser")
@ResponseBody
@ApiOperation("修改财务人员")
public HashMap<Object, Object> updateFinanceUser(@RequestBody FinanceUser financeUser) {
HashMap<Object, Object> responseMap = new HashMap<Object, Object>();
try {
financeUser.setModifyTime(DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss));
// 如果有手机号尝试通过手机号获取OpenID
if (financeUser.getPhone() != null && !financeUser.getPhone().trim().isEmpty()) {
try {
String openId = notifyService.getUserOpenIdByPhone(financeUser.getPhone());
financeUser.setOpenId(openId);
} catch (Exception e) {
// 获取OpenID失败不影响修改财务人员只记录日志
System.err.println("根据手机号获取OpenID失败: " + e.getMessage());
}
}
financeUserService.updateFinanceUser(financeUser);
responseMap.put("code", 0);
responseMap.put("msg", "修改成功");
} catch (Exception e) {
e.printStackTrace();
String msg = e.getMessage();
responseMap.put("code", 1);
responseMap.put("msg", "修改失败,原因:" + msg);
}
return responseMap;
}
/**
* @description: 删除财务人员
* @author thuang
* @date 2024/12/19 18:00
* @version 1.0
*/
@RequestMapping("/deleteFinanceUser")
@ResponseBody
@ApiOperation("删除财务人员")
public HashMap<Object, Object> deleteFinanceUser(@RequestParam("id") @ApiParam("财务人员ID") String id) {
HashMap<Object, Object> responseMap = new HashMap<Object, Object>();
try {
financeUserService.deleteFinanceUser(id);
responseMap.put("code", 0);
responseMap.put("msg", "删除成功");
} catch (Exception e) {
e.printStackTrace();
String msg = e.getMessage();
responseMap.put("code", 1);
responseMap.put("msg", "删除失败,原因:" + msg);
}
return responseMap;
}
/**
* @description: 根据ID查询财务人员
* @author thuang
* @date 2024/12/19 18:00
* @version 1.0
*/
@RequestMapping("/findFinanceUserById")
@ResponseBody
@ApiOperation("根据ID查询财务人员")
public HashMap<Object, Object> findFinanceUserById(@RequestParam("id") @ApiParam("财务人员ID") String id) {
HashMap<Object, Object> responseMap = new HashMap<Object, Object>();
try {
FinanceUser financeUser = financeUserService.findFinanceUserById(id);
responseMap.put("code", 0);
responseMap.put("msg", "查询成功");
responseMap.put("data", financeUser);
} catch (Exception e) {
e.printStackTrace();
String msg = e.getMessage();
responseMap.put("code", 1);
responseMap.put("msg", "查询失败,原因:" + msg);
}
return responseMap;
}
/**
* @description: 获取所有启用的财务人员
* @author thuang
* @date 2024/12/19 18:00
* @version 1.0
*/
@RequestMapping("/findActiveFinanceUsers")
@ResponseBody
@ApiOperation("获取所有启用的财务人员")
public HashMap<Object, Object> findActiveFinanceUsers() {
HashMap<Object, Object> responseMap = new HashMap<Object, Object>();
try {
List<FinanceUser> financeUsers = financeUserService.findActiveFinanceUsers();
responseMap.put("code", 0);
responseMap.put("msg", "查询成功");
responseMap.put("data", financeUsers);
} catch (Exception e) {
e.printStackTrace();
String msg = e.getMessage();
responseMap.put("code", 1);
responseMap.put("msg", "查询失败,原因:" + msg);
}
return responseMap;
}
}

View File

@@ -1,36 +0,0 @@
-- 更新HIS支付方式字典表适配你的四种支付方式
-- 1. 更新现有的PAY_TYPE字典值确保与汇总统计逻辑匹配
-- 现金支付保持为5
UPDATE `dicinfo` SET `dicvalue` = '4' WHERE `diccode` = 'f0230cea94134322982d45544255ee8f' AND `parent_code` = 'PAY_TYPE';
-- 微信支付改为1扫码支付
UPDATE `dicinfo` SET `dicname` = '微信支付', `dicvalue` = '1' WHERE `diccode` = '48c8044ee33649bcaf64181b570c1c75' AND `parent_code` = 'PAY_TYPE';
-- 银行卡支付保持为1但改名为扫码支付
UPDATE `dicinfo` SET `dicname` = '扫码支付', `dicvalue` = '1' WHERE `diccode` = 'a6ef5f470ae744a4ae1571825ddb8ca5' AND `parent_code` = 'PAY_TYPE';
-- 2. 新增聚合支付和军保支付
INSERT INTO `dicinfo` VALUES ('juhezf001', '聚合支付', '1', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 6);
INSERT INTO `dicinfo` VALUES ('junbao001', '军保支付', '3', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 7);
-- 3. 确保字典表结构正确
-- 最终PAY_TYPE字典应该是
-- 扫码支付(包含微信、聚合) -> 1
-- 银行卡支付 -> 2
-- 军保支付 -> 3
-- 现金支付 -> 4
-- 其他 -> 5
-- 如果需要重新整理,可以删除旧数据重新插入:
/*
DELETE FROM `dicinfo` WHERE `parent_code` = 'PAY_TYPE' AND `diccode` != 'PAY_TYPE';
INSERT INTO `dicinfo` VALUES ('pay_type_001', '扫码支付', '1', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 1);
INSERT INTO `dicinfo` VALUES ('pay_type_002', '银行卡支付', '2', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 2);
INSERT INTO `dicinfo` VALUES ('pay_type_003', '军保支付', '3', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 3);
INSERT INTO `dicinfo` VALUES ('pay_type_004', '现金支付', '4', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 4);
INSERT INTO `dicinfo` VALUES ('pay_type_005', '其他', '5', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 5);
*/

View File

@@ -1,24 +0,0 @@
-- 严格按照四种HIS支付方式配置字典表用户自定义编码
-- HIS支付方式现金、微信、聚合支付、军保支付
-- 1. 清理现有PAY_TYPE数据保留父节点
DELETE FROM `dicinfo` WHERE `parent_code` = 'PAY_TYPE' AND `diccode` != 'PAY_TYPE';
-- 2. 添加严格匹配的四种支付方式字典用户自定义PayType编码
-- 现金 -> PayType: 5
INSERT INTO `dicinfo` VALUES ('his_pay_001', '现金', '5', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 1);
-- 微信 -> PayType: 1
INSERT INTO `dicinfo` VALUES ('his_pay_002', '微信', '1', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 2);
-- 聚合支付 -> PayType: 2
INSERT INTO `dicinfo` VALUES ('his_pay_003', '聚合支付', '2', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 3);
-- 军保支付 -> PayType: 3
INSERT INTO `dicinfo` VALUES ('his_pay_004', '军保支付', '3', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 4);
-- 其他未知支付方式 -> PayType: 4
INSERT INTO `dicinfo` VALUES ('his_pay_005', '其他', '4', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 5);
-- 验证插入结果
SELECT * FROM `dicinfo` WHERE `parent_code` = 'PAY_TYPE' ORDER BY `sort_no`;