update:医保对账页面新增手动添加备注页面

This commit is contained in:
Elliott
2025-12-26 09:22:34 +08:00
parent 3efa3c15ea
commit 90fe6dada5
7 changed files with 143 additions and 9 deletions

View File

@@ -145,6 +145,40 @@ public class MedicalInsuranceReconciliationController {
return responseMap;
}
@ApiOperation(value = "更新医保对账备注", notes = "")
@PostMapping("/updateMedicalInsuranceReconciliationRemark")
@ResponseBody
public HashMap<Object, Object> updateMedicalInsuranceReconciliationRemark(
@ApiParam(value = "记录ID") @RequestParam String id,
@ApiParam(value = "备注") @RequestParam(required = false) String remark) {
HashMap<Object, Object> responseMap = new HashMap<>();
try {
if (id == null || "".equals(id.trim())) {
responseMap.put("code", 1);
responseMap.put("msg", "id不能为空");
return responseMap;
}
HashMap<Object, Object> updateMap = new HashMap<>();
updateMap.put("id", id.trim());
updateMap.put("remark", remark == null ? "" : remark.trim());
medicalInsuranceReconciliationService.updateMedicalInsuranceReconciliationRemark(updateMap);
responseMap.put("code", 0);
responseMap.put("msg", "OK");
} catch (Exception e) {
e.printStackTrace();
LogUtil.error(this.getClass(), "更新医保对账备注失败:" + e.getMessage());
responseMap.put("code", 1);
responseMap.put("msg", "更新失败:" + e.getMessage());
}
return responseMap;
}
}

View File

@@ -33,6 +33,11 @@ public interface MedicalInsuranceReconciliationMapper {
* 删除医保对账结果
*/
void deleteMedicalInsuranceReconciliationResult(HashMap<Object, Object> map) throws Exception;
/**
* 更新医保对账备注
*/
void updateMedicalInsuranceReconciliationRemark(HashMap<Object, Object> map) throws Exception;
}

View File

@@ -102,10 +102,12 @@ public class MedicalInsuranceReconciliationMethod {
prevQueryMap.put("trade_date", trade_date);
List<HashMap<Object, Object>> prevResults = reconciliationService.findMedicalInsuranceReconciliationResult(prevQueryMap);
HashMap<String, String> prevStatusMap = new HashMap<>();
HashMap<String, String> prevRemarkMap = new HashMap<>();
if (prevResults != null) {
for (HashMap<Object, Object> prev : prevResults) {
String key = StringDUtil.changeNullToEmpty(prev.get("insutype")) + "|" + StringDUtil.changeNullToEmpty(prev.get("clr_type"));
prevStatusMap.put(key, StringDUtil.changeNullToEmpty(prev.get("stmt_rslt")));
prevRemarkMap.put(key, StringDUtil.changeNullToEmpty(prev.get("recheck_user")));
}
}
@@ -165,7 +167,7 @@ public class MedicalInsuranceReconciliationMethod {
resultMap.put("recheck_flag", recheckFlag);
resultMap.put("prev_stmt_rslt", prevStmt);
resultMap.put("recheck_time", "1".equals(recheckFlag) ? DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss) : null);
resultMap.put("recheck_user", "");
resultMap.put("recheck_user", prevRemarkMap.getOrDefault(key, ""));
resultMap.put("infcode", callResult.get("infcode"));
resultMap.put("err_msg", callResult.get("err_msg"));
resultMap.put("warn_msg", callResult.get("warn_msg"));
@@ -199,7 +201,7 @@ public class MedicalInsuranceReconciliationMethod {
resultMap.put("recheck_flag", "0");
resultMap.put("prev_stmt_rslt", "");
resultMap.put("recheck_time", null);
resultMap.put("recheck_user", "");
resultMap.put("recheck_user", prevRemarkMap.getOrDefault(insutype + "|" + clrType, ""));
resultMap.put("api_result", "ERROR");
resultMap.put("create_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss));
resultMap.put("modify_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss));

View File

@@ -30,6 +30,11 @@ public interface MedicalInsuranceReconciliationService {
* 删除医保对账结果
*/
void deleteMedicalInsuranceReconciliationResult(HashMap<Object, Object> map) throws Exception;
/**
* 更新医保对账备注
*/
void updateMedicalInsuranceReconciliationRemark(HashMap<Object, Object> map) throws Exception;
}

View File

@@ -41,6 +41,11 @@ public class MedicalInsuranceReconciliationServiceImpl implements MedicalInsuran
public void deleteMedicalInsuranceReconciliationResult(HashMap<Object, Object> map) throws Exception {
medicalInsuranceReconciliationMapper.deleteMedicalInsuranceReconciliationResult(map);
}
@Override
public void updateMedicalInsuranceReconciliationRemark(HashMap<Object, Object> map) throws Exception {
medicalInsuranceReconciliationMapper.updateMedicalInsuranceReconciliationRemark(map);
}
}

View File

@@ -114,6 +114,13 @@
order by create_time desc, trade_date desc, insutype, clr_type
</select>
<update id="updateMedicalInsuranceReconciliationRemark" parameterType="HashMap">
update medical_insurance_reconciliation_result
set recheck_user = #{remark},
modify_time = now()
where id = #{id}
</update>
<!-- 删除医保对账结果 -->
<delete id="deleteMedicalInsuranceReconciliationResult" parameterType="HashMap">
delete from medical_insurance_reconciliation_result

View File

@@ -74,7 +74,7 @@
<option value="340">新农合</option>
<option value="390">城乡居民基本医疗保险</option>
<option value="510">公务员医疗补助</option>
<option value="99410">保险</option>
<option value="99410">保险</option>
</select>
</div>
</div>
@@ -176,7 +176,13 @@
</tr>
<tr>
<td style="font-weight: bold;">备注</td>
<td id="detail_remark"></td>
<td>
<div id="detail_remark_flag" style="margin-bottom: 6px;"></div>
<textarea id="detail_remark_input" class="layui-textarea" style="min-height: 80px;"></textarea>
<div style="margin-top: 6px;">
<button type="button" class="layui-btn layui-btn-sm" onclick="saveDetailRemark()">保存备注</button>
</div>
</td>
</tr>
<tr>
<td style="font-weight: bold;">创建时间</td>
@@ -188,10 +194,55 @@
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-xs" lay-event="getInfo">详细信息</a>
<a class="layui-btn layui-btn-xs layui-btn-primary" lay-event="editRemark">编辑备注</a>
</script>
</body>
<script th:inline="javascript">
let layer, laydate, table, form;
let currentDetailId = null;
function escapeHtml(value) {
if (value === null || value === undefined) return '';
return String(value)
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;');
}
function buildRemarkDisplay(data) {
let parts = [];
if (data.recheck_flag === '1') {
parts.push('<span style="color:#409EFF;">二次核对</span>');
}
if (data.recheck_user) {
parts.push('<span>' + escapeHtml(data.recheck_user) + '</span>');
}
return parts.join(' / ');
}
function updateRemark(id, remark, onSuccess) {
let load = layer.load(1, {shade: [0.3, '#000']});
$.ajax({
url: '/medicalInsuranceReconciliation/updateMedicalInsuranceReconciliationRemark',
type: 'POST',
data: {id: id, remark: remark},
success: function (data) {
layer.close(load);
if (data.code === 0) {
layer.msg('保存成功!', {icon: 1, time: 1500});
if (onSuccess) onSuccess();
} else {
layer.alert('保存失败:' + (data.msg || ''), {icon: 2});
}
},
error: function () {
layer.close(load);
layer.alert('保存失败,请检查网络连接!', {icon: 2});
}
});
}
layui.use(['element', 'table', 'laydate', 'layer', 'form'], function () {
layer = layui.layer;
@@ -220,7 +271,7 @@
if(d.insutype === '340') return '新农合';
if(d.insutype === '390') return '居民医保';
if(d.insutype === '510') return '公务员补助';
if(d.insutype === '99410') return '工保险';
if(d.insutype === '99410') return '工保险';
return d.insutype;
}},
{field: 'clr_type', title: '清算类别', align: 'center', width: 100, templet: function(d){
@@ -238,8 +289,8 @@
{field: 'fund_pay_sumamt', title: '基金支付总额', align: 'center', width: 130},
{field: 'acct_pay', title: '账户支付金额', align: 'center', width: 130},
{field: 'fixmedins_setl_cnt', title: '结算笔数', align: 'center', width: 100},
{field: 'remark', title: '备注', align: 'center', width: 120, templet: function(d){
return d.recheck_flag === '1' ? '<span style="color:#409EFF;">二次核对</span>' : '';
{field: 'recheck_user', title: '备注', align: 'center', width: 220, templet: function(d){
return buildRemarkDisplay(d);
}},
{field: 'stmt_rslt', title: '对账结果', align: 'center', width: 100, templet: function(d){
if(d.stmt_rslt === '0') {
@@ -276,6 +327,19 @@
if (obj.event === 'getInfo') {
showDetail(data);
}
if (obj.event === 'editRemark') {
layer.prompt({
title: '请输入备注',
formType: 2,
value: data.recheck_user || '',
btn: ['保存', '取消']
}, function (value, index, elem) {
layer.close(index);
updateRemark(data.id, value, function () {
table.reload('test');
});
});
}
});
// 初始化:设置默认日期为前一天
@@ -407,6 +471,7 @@
// 显示详情
function showDetail(data) {
currentDetailId = data.id || null;
$("#detail_trade_date").text(data.trade_date || '-');
let insutypeText = data.insutype;
@@ -414,7 +479,7 @@
if(data.insutype === '340') insutypeText = '340-新农合';
if(data.insutype === '390') insutypeText = '390-城乡居民基本医疗保险';
if(data.insutype === '510') insutypeText = '510-公务员医疗补助';
if(data.insutype === '99410') insutypeText = '99410-工保险';
if(data.insutype === '99410') insutypeText = '99410-工保险';
$("#detail_insutype").text(insutypeText || '-');
let clrTypeText = data.clr_type;
@@ -438,7 +503,8 @@
$("#detail_stmt_rslt_dscr").text(data.stmt_rslt_dscr || '-');
$("#detail_api_result").text(data.api_result || '-');
$("#detail_remark").text(data.recheck_flag === '1' ? '二次核对' : '');
$("#detail_remark_flag").html(data.recheck_flag === '1' ? '<span style="color:#409EFF;">二次核对</span>' : '');
$("#detail_remark_input").val(data.recheck_user || '');
$("#detail_create_time").text(data.create_time || '-');
layer.open({
@@ -450,6 +516,16 @@
});
}
function saveDetailRemark() {
if (!currentDetailId) {
layer.alert('缺少记录ID无法保存备注', {icon: 2});
return;
}
updateRemark(currentDetailId, $("#detail_remark_input").val() || '', function () {
table.reload('test');
});
}
// 导出
function exportExcel() {
let url = "/medicalInsuranceReconciliation/exportMedicalInsuranceReconciliationResult";