Kaynağa Gözat

工伤增加参保地选项

lighter 3 yıl önce
ebeveyn
işleme
d97e2510f1

+ 10 - 2
src/main/java/thyyxxk/webserver/controller/medicalinsurance/SiInjuryController.java

@@ -45,6 +45,9 @@ public class SiInjuryController {
 
     @PostMapping("/getPersonBaseinfo")
     public ResultVo<List<InjurySiPatInfo>> getPersonBaseinfo(@RequestBody Patient p) {
+        if (null == p.getInjuryArea()) {
+            return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "请选择工伤参保地!");
+        }
         p.setStaffId(TokenUtil.getTokenUserId());
         ResultVo<JSONObject> resultVo = injurySystem.getPersonBaseinfo(p);
         if (null == resultVo) {
@@ -57,8 +60,13 @@ public class SiInjuryController {
         if (dao.selectCount(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn()) == 0) {
             JSONArray personinfos = result.getJSONArray("personinfo");
             JSONObject item = personinfos.getJSONObject(0);
-            dao.insertNewInjurybase(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(),
-                    item.getString("indi_id"), item.getString("center_id"), item.getString("pers_type"));
+            dao.insertNewInjurybase(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), item.getString("indi_id"),
+                    item.getString("center_id"), item.getString("pers_type"), p.getInjuryArea());
+        } else {
+            JSONArray personinfos = result.getJSONArray("personinfo");
+            JSONObject item = personinfos.getJSONObject(0);
+            dao.updateInjurybase(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), item.getString("indi_id"),
+                    item.getString("center_id"), item.getString("pers_type"), p.getInjuryArea());
         }
         if (null == result.get("injuryorbirthinfo")) {
             return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "没有查询到工伤认定信息!");

+ 14 - 3
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiInjuryDao.java

@@ -12,14 +12,25 @@ public interface SiInjuryDao {
                     @Param("times") int times,
                     @Param("ledgerSn") int ledgerSn);
 
-    @Insert("insert into t_injury_si_pat_info (pat_no, times, ledger_sn, indi_id, center_id, pers_type) " +
-            "values (#{patNo}, #{times}, #{ledgerSn}, #{indiId}, #{centerId}, #{persType})")
+    @Insert("insert into t_injury_si_pat_info (pat_no, times, ledger_sn, indi_id, center_id, pers_type, injury_area) " +
+            "values (#{patNo}, #{times}, #{ledgerSn}, #{indiId}, #{centerId}, #{persType}, #{injuryArea})")
     void insertNewInjurybase(@Param("patNo") String patNo,
                              @Param("times") int times,
                              @Param("ledgerSn") int ledgerSn,
                              @Param("indiId") String indiId,
                              @Param("centerId") String centerId,
-                             @Param("persType") String persType);
+                             @Param("persType") String persType,
+                             @Param("injuryArea") int injuryArea);
+
+    @Update("update t_injury_si_pat_info set indi_id=#{indiId},center_id=#{centerId},pers_type=#{persType}," +
+            "injury_area=#{injuryArea} where pat_no=#{patNo} and times=#{times} and ledger_sn=#{ledgerSn}")
+    void updateInjurybase(@Param("patNo") String patNo,
+                          @Param("times") int times,
+                          @Param("ledgerSn") int ledgerSn,
+                          @Param("indiId") String indiId,
+                          @Param("centerId") String centerId,
+                          @Param("persType") String persType,
+                          @Param("injuryArea") int injuryArea);
     
     @Update("update t_injury_si_pat_info set serial_pers=#{serialPers},medic_flag=#{medicFlag}, " +
             "identify_code=#{identifyCode},injury_cert=#{injuryCert},identify_flag=#{identifyFlag}, " +

+ 2 - 0
src/main/java/thyyxxk/webserver/dao/his/yibao/PatientDao.java

@@ -79,6 +79,8 @@ public interface PatientDao {
             "and admiss_times=b.admiss_times and ledger_sn=a.ledger_sn), " +
             "balance=RTRIM((select balance+charge_yb from zy_ledger_file where inpatient_no=#{inpatientNo} and " +
             "admiss_times=a.admiss_times and ledger_sn=a.ledger_sn))," +
+            "injuryArea=(select injury_area from t_injury_si_pat_info where pat_no=#{inpatientNo} " +
+            "and times=a.admiss_times and ledger_sn=a.ledger_sn)," +
             "hic_no=rtrim((select hic_no_new from a_patient_mi where inpatient_no = #{inpatientNo})), " +
             "card_iden=rtrim(isnull((select card_iden from a_patient_mi where inpatient_no = #{inpatientNo}), '')), " +
             "indi_id=rtrim((select isnull(indi_id, '') from a_patient_mi where inpatient_no = #{inpatientNo})), " +

+ 1 - 0
src/main/java/thyyxxk/webserver/entity/yibao/patient/Patient.java

@@ -73,6 +73,7 @@ public class Patient {
     private String latechbFlag; // 是否晚育
     private String pretFlag; // 是否早产
     private String mdtrtId;
+    private Integer injuryArea; // 工伤归属地:1-长沙,2-望城,3-省直
 
     public Boolean getMidSetl() {
         return null != midSetl && midSetl;

+ 2 - 2
src/main/java/thyyxxk/webserver/service/externalhttp/SiInjurySystem.java

@@ -11,8 +11,8 @@ import thyyxxk.webserver.entity.yibao.patient.Patient;
 
 import java.util.Map;
 
-@BaseRequest(baseURL = "http://172.16.32.163:2000/siInjury")
-//@BaseRequest(baseURL = "http://localhost:2000/siInjury")
+//@BaseRequest(baseURL = "http://172.16.32.163:2000/siInjury")
+@BaseRequest(baseURL = "http://localhost:2000/siInjury")
 public interface SiInjurySystem {
 
     @Post("/getPersonBaseinfo")