yeguodong 1 月之前
父节点
当前提交
568a97c707

+ 18 - 0
src/main/java/thyyxxk/webserver/controller/medicalinsurance/SiPsnRcdController.java

@@ -79,6 +79,24 @@ public class SiPsnRcdController {
         return service.personnelAccidentRecord(psnAccdntRcd);
     }
 
+    @PassToken
+    @PostMapping("/revokePersonnelAccidentRecord")
+    public ResultVo<String> revokePersonnelAccidentRecord(@RequestBody RvkPsnRcd rvkPsnRcd) {
+        return service.revokePersonnelAccidentRecord(rvkPsnRcd);
+    }
+
+    @PassToken
+    @PostMapping("/birthRecord")
+    public ResultVo<String> birthRecord(@RequestBody BirthRcd birthRcd) {
+        return service.birthRecord(birthRcd);
+    }
+
+    @PassToken
+    @PostMapping("/revokeBirthRecord")
+    public ResultVo<String> revokeBirthRecord(@RequestBody RvkPsnRcd rvkPsnRcd) {
+        return service.revokeBirthRecord(rvkPsnRcd);
+    }
+
     @GetMapping("/selectAllSpcSlwRcds")
     public ResultVo<List<SlwSpcDiseRcd>> selectAllSpcSlwRcds(@RequestParam("begntime") String begntime,
                                                              @RequestParam("endtime") String endtime) {

+ 3 - 4
src/main/java/thyyxxk/webserver/controller/medicine/YpTaoBaoController.java

@@ -174,15 +174,14 @@ public class YpTaoBaoController {
     }
 
     /**
-     * 通过大包装(箱)追溯码和发货厂商id查询大包装里的小追溯码
+     * 通过大包装(箱)追溯码查询大包装里的小追溯码
      * @param parentCode
-     * @param entName
      * @return
      */
     @PassToken
     @PostMapping("/getCodeByParent")
-    public ResultVo<Map<String,Object>> getCodeByParent(@RequestParam String parentCode, @RequestParam String entName){
-        return ypTaoBaoService.getCodeByParent(parentCode, entName);
+    public ResultVo<Map<String,Object>> getCodeByParent(@RequestParam String parentCode){
+        return ypTaoBaoService.getCodeByParent(parentCode);
     }
 
 }

+ 9 - 0
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/BirthRcdDao.java

@@ -0,0 +1,9 @@
+package thyyxxk.webserver.dao.his.medicalinsurance;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import thyyxxk.webserver.entity.medicalinsurance.psnrcd.BirthRcd;
+
+@Mapper
+public interface BirthRcdDao extends BaseMapper<BirthRcd> {
+}

+ 4 - 0
src/main/java/thyyxxk/webserver/dao/his/settings/SettingsDao.java

@@ -185,6 +185,10 @@ public interface SettingsDao {
     void modifyPersonnelInformation(@Param("sql") String sql,
                                     @Param("code") String code);
 
+    @Update("update a_employee_mi " +
+            "set doctor_yp_zl = null where code = #{code}")
+    void setDoctorYpZlNull(@Param("code") String code);
+
     @Select("select count(1) from a_employee_mi where code_rs = #{codeRs}")
     int doesThePersonnelNumberExist(String codeRs);
 

+ 186 - 0
src/main/java/thyyxxk/webserver/entity/medicalinsurance/psnrcd/BirthRcd.java

@@ -0,0 +1,186 @@
+package thyyxxk.webserver.entity.medicalinsurance.psnrcd;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@TableName(value = "birth_record")
+public class BirthRcd {
+    /**
+     * id
+     */
+    private String id;
+
+    /**
+     * 人员编号
+     */
+    private String psnNo;
+
+    /**
+     * 险种类型
+     */
+    private String insutype;
+
+    /**
+     * 人员证件类型
+     */
+    private String psnCertType;
+
+    /**
+     * 证件号码
+     */
+    private String certno;
+
+    /**
+     * 人员姓名
+     */
+    private String psnName;
+
+    /**
+     * 出生日期
+     */
+    private Date brdy;
+
+    /**
+     * 联系电话
+     */
+    private String tel;
+
+    /**
+     * 联系地址
+     */
+    private String addr;
+
+    /**
+     * 参保所属医保区划
+     */
+    private String insuAdmdvs;
+
+    /**
+     * 单位编号
+     */
+    private String empNo;
+
+    /**
+     * 单位名称
+     */
+    private String empName;
+
+    /**
+     * 孕周数
+     */
+    private Integer gesoVal;
+
+    /**
+     * 生育待遇申报人类别
+     */
+    private String matnTrtDclaerType;
+
+    /**
+     * 计划生育服务证号(生育类别登记时必填)
+     */
+    private String fpscNo;
+
+    /**
+     * 末次月经日期
+     */
+    private Date lastMenaDate;
+
+    /**
+     * 预计生育日期
+     */
+    private Date planMatnDate;
+
+    /**
+     * 申报日期
+     */
+    private Date dclaDate;
+
+    /**
+     * 配偶姓名(生育类别登记时必填)
+     */
+    private String spusName;
+
+    /**
+     * 配偶证件类型(生育类别登记时必填)
+     */
+    private String spusCertType;
+
+    /**
+     * 配偶证件号码(生育类别登记时必填)
+     */
+    private String spusCertno;
+
+    /**
+     * 生育资格登记状态(1-未计算,2-已计算)
+     */
+    private String matnQuaRegStas;
+
+    /**
+     * 开始日期
+     */
+    private Date begndate;
+
+    /**
+     * 结束日期
+     */
+    private Date enddate;
+
+    /**
+     * 代办人姓名
+     */
+    private String agnterName;
+
+    /**
+     * 代办人证件类型
+     */
+    private String agnterCertType;
+
+    /**
+     * 代办人证件号码
+     */
+    private String agnterCertno;
+
+    /**
+     * 代办人联系方式
+     */
+    private String agnterTel;
+
+    /**
+     * 代办人联系地址
+     */
+    private String agnterAddr;
+
+    /**
+     * 代办人关系
+     */
+    private String agnterRlts;
+
+    /**
+     * 备注
+     */
+    private String memo;
+
+    /**
+     * 胎次
+     */
+    private Integer fetts;
+
+    /**
+     * 生育类别/计划生育类别(1-正常产,2-助娩产,3-剖宫产,4-难产,5-流产,6-引产,7-产前检查)
+     */
+    private String matnType;
+
+    /**
+     * 门诊检查报销标准
+     */
+    private BigDecimal otpExamReimStd;
+
+    /**
+     * 备案明细流水号
+     * */
+    private String trtDclaDetlSn;
+}

+ 70 - 1
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiPsnRcdService.java

@@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import thyyxxk.webserver.config.envionment.SystemConfig;
@@ -37,17 +38,19 @@ public class SiPsnRcdService {
     private final TransHospRcdDao trsHspRcdDao;
     private final PsnAsgnmtRcdDao psnAsgRcdDao;
     private final PsnAccidentRcdDao psnAccdntDao;
+    private final BirthRcdDao birthRcdDao;
     private final SiLogDao logDao;
     private final UserCache userCache;
     private final SystemConfig sysCfg;
 
     @Autowired
-    public SiPsnRcdService(ExecService exec, SlwSpcChrRcdDao dao, TransHospRcdDao trsHspRcdDao, PsnAsgnmtRcdDao psnAsgRcdDao, PsnAccidentRcdDao psnAccdntDao, SiLogDao logDao, UserCache userCache, SystemConfig sysCfg) {
+    public SiPsnRcdService(ExecService exec, SlwSpcChrRcdDao dao, TransHospRcdDao trsHspRcdDao, PsnAsgnmtRcdDao psnAsgRcdDao, PsnAccidentRcdDao psnAccdntDao, BirthRcdDao birthRcdDao, SiLogDao logDao, UserCache userCache, SystemConfig sysCfg) {
         this.exec = exec;
         this.slwSpcChrRcdDao = dao;
         this.trsHspRcdDao = trsHspRcdDao;
         this.psnAsgRcdDao = psnAsgRcdDao;
         this.psnAccdntDao = psnAccdntDao;
+        this.birthRcdDao = birthRcdDao;
         this.logDao = logDao;
         this.userCache = userCache;
         this.sysCfg = sysCfg;
@@ -245,6 +248,72 @@ public class SiPsnRcdService {
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
     }
 
+    public ResultVo<String> revokePersonnelAccidentRecord(RvkPsnRcd rvkPsnRcd) {
+        JSONObject input = exec.makeTradeHeader(SiFunction.REVOKE_PERSONNEL_ACCIDENT_RECORD);
+        String ref = JSONObject.toJSONString(rvkPsnRcd);
+        input.getJSONObject("input").put("data", JSONObject.parseObject(ref));
+        JSONObject result = exec.executeTrade(input, SiFunction.REVOKE_PERSONNEL_ACCIDENT_RECORD);
+        if (null == result) {
+            return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
+        }
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, null, null, null, infcode, rvkPsnRcd.getPsnNo()));
+        if (null == infcode) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
+        }
+        if (infcode == 0) {
+            psnAsgRcdDao.deleteById(rvkPsnRcd.getId());
+            return ResultVoUtil.success("人员意外伤害备案撤销成功。");
+        }
+        return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
+    }
+
+    public ResultVo<String> birthRecord(BirthRcd birthRcd) {
+        JSONObject input = exec.makeTradeHeader(SiFunction.BIRTH_RECORD);
+        String ref = JSONObject.toJSONStringWithDateFormat(birthRcd, "yyyy-MM-dd");
+        input.getJSONObject("input").put("data", JSONObject.parseObject(ref));
+        JSONObject result = exec.executeTrade(input, SiFunction.BIRTH_RECORD);
+        if (null == result) {
+            return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
+        }
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, null, null, null, infcode, birthRcd.getPsnNo()));
+        if (null == infcode) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
+        }
+        if (infcode == 0) {
+            JSONObject output = result.getJSONObject(OUTPUT);
+            String trtDclaDetlSn = output.getJSONObject("result").getString("trt_dcla_detl_sn");
+            if(StringUtils.isBlank(trtDclaDetlSn)) {
+                trtDclaDetlSn = output.getJSONObject("result").getString("trtDclaDetlSn");
+            }
+            birthRcd.setTrtDclaDetlSn(trtDclaDetlSn);
+            birthRcdDao.insert(birthRcd);
+            return ResultVoUtil.success("生育待遇备案登记成功,备案明细流水号为:" + trtDclaDetlSn);
+        }
+        return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
+    }
+
+    public ResultVo<String> revokeBirthRecord(RvkPsnRcd rvkPsnRcd) {
+        JSONObject input = exec.makeTradeHeader(SiFunction.REVOKE_BIRTH_RECORD);
+        String ref = JSONObject.toJSONString(rvkPsnRcd);
+        input.getJSONObject("input").put("data", JSONObject.parseObject(ref));
+        JSONObject result = exec.executeTrade(input, SiFunction.REVOKE_BIRTH_RECORD);
+        if (null == result) {
+            return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
+        }
+        Integer infcode = result.getInteger(RESULT_CODE);
+        logDao.insert(new SiLog(input, result, null, null, null, infcode, rvkPsnRcd.getPsnNo()));
+        if (null == infcode) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
+        }
+        if (infcode == 0) {
+            psnAsgRcdDao.deleteById(rvkPsnRcd.getId());
+            return ResultVoUtil.success("生育待遇备案登记撤销成功。");
+        }
+        return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
+    }
+
     public ResultVo<List<SlwSpcDiseRcd>> selectAllSpcSlwRcds(String begntime, String endtime) {
         begntime = begntime + " 00:00:00.000";
         endtime = endtime + " 23:59:59.999";

+ 33 - 25
src/main/java/thyyxxk/webserver/service/medicine/YpTaoBaoService.java

@@ -18,10 +18,7 @@ import thyyxxk.webserver.entity.medicine.YpTableYljg;
 import thyyxxk.webserver.entity.medicine.YpTopYljg;
 import thyyxxk.webserver.utils.ResultVoUtil;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
+import java.util.*;
 
 /**
  * @ClassName YpTaoBaoService
@@ -70,10 +67,7 @@ public class YpTaoBaoService {
         }
         Map<String, Object> resultMap = new HashMap<>();
         try{
-            AlibabaAlihealthDrugtraceTopYljgQueryCodedetailRequest req = new AlibabaAlihealthDrugtraceTopYljgQueryCodedetailRequest();
-            req.setRefEntId(refEntId);
-            req.setCodes(codes);
-            AlibabaAlihealthDrugtraceTopYljgQueryCodedetailResponse rsp = client.execute(req);
+            AlibabaAlihealthDrugtraceTopYljgQueryCodedetailResponse rsp = queryCodeDetailItem(codes);
             if(rsp.getResult().getResponseSuccess()){
                 resultMap.put("code", 0);
                 resultMap.put("message", "根据追溯码查询码信息成功");
@@ -90,6 +84,19 @@ public class YpTaoBaoService {
         }
     }
 
+    private AlibabaAlihealthDrugtraceTopYljgQueryCodedetailResponse queryCodeDetailItem(String codes) {
+        AlibabaAlihealthDrugtraceTopYljgQueryCodedetailResponse rsp = null;
+        try{
+            AlibabaAlihealthDrugtraceTopYljgQueryCodedetailRequest req = new AlibabaAlihealthDrugtraceTopYljgQueryCodedetailRequest();
+            req.setRefEntId(refEntId);
+            req.setCodes(codes);
+            rsp = client.execute(req);
+        } catch(Exception e){
+            log.error("根据追溯码查询码信息,错误信息{}", e.getMessage());
+        }
+        return rsp;
+    }
+
     public ResultVo<Map<String, Object>> queryYljgListUpOut(YpTopYljg yljg) {
         Map<String, Object> resultMap = new HashMap<>();
         try{
@@ -370,29 +377,30 @@ public class YpTaoBaoService {
     /**
      * 通过大包装追溯码和发货厂商id查询大包装里的小追溯码
      * @param parentCode
-     * @param entName
      * @return
      */
-    public ResultVo<Map<String, Object>> getCodeByParent(String parentCode, String entName) {
+    public ResultVo<Map<String, Object>> getCodeByParent(String parentCode) {
         Map<String, Object> resultMap = new HashMap<>();
-        // 1、通过企业名称查询企业id
-        AlibabaAlihealthDrugtraceTopYljgQueryGetentinfoResponse entRsp = queryGetEntInfoItem(entName);
+        // 1、通过追溯码查询厂商企业id
+        AlibabaAlihealthDrugtraceTopYljgQueryCodedetailResponse entRsp = queryCodeDetailItem(parentCode);
         if(entRsp.getResult().getResponseSuccess()){
-            String entId = entRsp.getResult().getModel().getEntId();
-            // 2、通过大包装追溯码和发货厂商企业id进行出入库单据上传
-            uploadinoutbillItem(entId, parentCode);
-            // 3、查询大包装码对应的子码信息;注意:入参的大包装码必须在本企业的码上放心平台上传入库单后再调用接口,才会返回子码信息。
-            AlibabaAlihealthDrugtraceTopYljgQueryRelationResponse relationRsp = queryRelationItem(parentCode, refEntId);
-            if(relationRsp.getResult().getResponseSuccess()){
-                resultMap.put("code", 0);
-                resultMap.put("message", "查询单码关联关系成功");
-                resultMap.put("msgCode", relationRsp.getResult().getMsgCode());
-                resultMap.put("data", relationRsp.getResult().getModelList());
-            } else {
-                return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "查询单码关联关系信息,淘宝开放平台错误信息: " + relationRsp.getResult().getMsgInfo());
+            List<AlibabaAlihealthDrugtraceTopYljgQueryCodedetailResponse.CodeFullInfoDto> models = entRsp.getResult().getModels();
+            if(models != null && models.size() > 0){
+                String entId = models.get(0).getpUserEntDTO().getRefEntId();
+                // 2、通过大包装追溯码和发货厂商企业id进行出入库单据上传
+                uploadinoutbillItem(entId, parentCode);
+                // 3、查询大包装码对应的子码信息;注意:入参的大包装码必须在本企业的码上放心平台上传入库单后再调用接口,才会返回子码信息。
+                AlibabaAlihealthDrugtraceTopYljgQueryRelationResponse relationRsp = queryRelationItem(parentCode, refEntId);
+                if(relationRsp.getResult().getResponseSuccess()){
+                    resultMap.put("code", 0);
+                    resultMap.put("message", "查询单码关联关系成功");
+                    resultMap.put("msgCode", relationRsp.getResult().getMsgCode());
+                    resultMap.put("data", relationRsp.getResult().getModelList());
+                } else {
+                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "查询单码关联关系信息,淘宝开放平台错误信息: " + relationRsp.getResult().getMsgInfo());
+                }
             }
 
-
         }
         return ResultVoUtil.success(resultMap);
     }

+ 3 - 0
src/main/java/thyyxxk/webserver/service/settings/SettingsService.java

@@ -256,6 +256,9 @@ public class SettingsService {
             }
             dao.modifyPersonnelInformation(changedField, userInfo.getCode());
         }
+        if(userInfo.getDoctorYpZl() == null) {
+            dao.setDoctorYpZlNull(userInfo.getCode());
+        }
         dao.delPartTimeDeptByCode(userInfo.getCode());
         if (ListUtil.notBlank(userInfo.getPartTimeDept())) {
             dao.insertPartTimeDept(userInfo.getCode(), userInfo.getPartTimeDept());