Просмотр исходного кода

Merge remote-tracking branch 'origin/淮海科技'

yeguodong 2 месяцев назад
Родитель
Сommit
704850502b

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>13.3.2</version>
+    <version>13.3.4</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
     <properties>

+ 13 - 2
src/main/java/thyyxxk/webserver/controller/inpatient/TransferInOfExpensesController.java

@@ -6,6 +6,7 @@ import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
 import thyyxxk.webserver.entity.datamodify.MzChargeDetail;
 import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
 import thyyxxk.webserver.entity.inpatient.ZyActpatient;
+import thyyxxk.webserver.entity.transferInOfExpenses.data.CorrectInvoice;
 import thyyxxk.webserver.service.inpatient.TransferInOfExpensesService;
 
 import java.util.List;
@@ -35,8 +36,8 @@ public class TransferInOfExpensesController {
     }
 
     @GetMapping("/getSerialNo")
-    public ResultVo<List<MzChargeDetail>> getSerialNo(Integer serialNo, Integer liShiFlag) {
-        return service.getSerialNo(serialNo, liShiFlag);
+    public ResultVo<List<MzChargeDetail>> getSerialNo(Integer serialNo) {
+        return service.getSerialNo(serialNo);
     }
 
     @GetMapping("/getZyJiMenZhenZhuangRuFeiYong")
@@ -63,4 +64,14 @@ public class TransferInOfExpensesController {
         return service.queryEntryName(pyCode);
     }
 
+    @PostMapping("/correctInvoice")
+    public ResultVo<String> correctInvoice(@RequestBody CorrectInvoice.CorrectInvoiceReq param) {
+        return service.correctInvoice(param);
+    }
+
+    @GetMapping("/getDzfpQrcodeBySerialNo")
+    public ResultVo<CorrectInvoice.DzcfVo> getDzfpQrcodeBySerialNo(@RequestParam("serialNo") Integer serialNo) {
+        return service.getDzfpQrcodeBySerialNo(serialNo);
+    }
+
 }

+ 22 - 0
src/main/java/thyyxxk/webserver/dao/his/inpatient/TransferInOfExpensesDao.java

@@ -1,5 +1,6 @@
 package thyyxxk.webserver.dao.his.inpatient;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.ibatis.annotations.*;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
@@ -7,7 +8,9 @@ import thyyxxk.webserver.entity.datamodify.MzChargeDetail;
 import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
 import thyyxxk.webserver.entity.inpatient.ZyActpatient;
 import thyyxxk.webserver.entity.medicalinsurance.inpatient.ZyPatientInfo;
+import thyyxxk.webserver.entity.transferInOfExpenses.data.CorrectInvoice;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -129,6 +132,11 @@ public interface TransferInOfExpensesDao {
                                      @Param("tableName") String tableName,
                                      @Param("serialNo") Integer serialNo);
 
+    @Select("select rtrim(patient_id) as patient_id, times, receipt_no, serial_no,operator_id  as opId from mz_receipt_serial " +
+            " where receipt_sn = #{serialNo} " +
+            "group by patient_id, times, receipt_no, serial_no,operator_id")
+    CorrectInvoice getSerialNoByInvoiceNo(@Param("serialNo") Integer serialNo);
+
     /**
      * 分页获取这个病人是通过急门诊转入的费用   如果确实插入了数据但是没有看到 那就是他们没有维护好两个字典表
      *
@@ -242,4 +250,18 @@ public interface TransferInOfExpensesDao {
             "select code,rtrim(name)name from yp_zd_dict where py_code like #{pyCode} or code like #{pyCode} " +
             ") temp")
     List<GetDropdownBox> queryEntryName(@Param("pyCode") String pyCode);
+
+
+    @Select("select qrcode,charge_code,name = (select rtrim(name) from mz_patient_mi where mz_patient_mi.patient_id = mz_dzfp_upload.patient_id) " +
+            "from mz_dzfp_upload\n" +
+            "where patient_id = '${patientId}'\n" +
+            "  and times = ${times}\n" +
+            "  and receipt_no = ${receiptNo} and type_flag = 5 and del_flag = 0")
+    CorrectInvoice.DzcfVo getMzDzcfUpload(CorrectInvoice params);
+
+
+    @Select("select sum(cast((quantity * drug_win * unit_price) as decimal(14, 2))) as money " +
+            "from mz_charge_detail " +
+            "${ew.customSqlSegment}")
+    BigDecimal getDzfpChangeTotal(@Param("ew") QueryWrapper<?> qw);
 }

+ 16 - 22
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/YiZhuLuRuDao.java

@@ -2,6 +2,7 @@ package thyyxxk.webserver.dao.his.zhuyuanyisheng;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import org.apache.ibatis.annotations.*;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
@@ -19,6 +20,7 @@ import thyyxxk.webserver.entity.zhuyuanyisheng.ZyOrderZk;
 import thyyxxk.webserver.entity.zhuyuanyisheng.dto.doctorAuth.DoctorAuthParams;
 import thyyxxk.webserver.entity.zhuyuanyisheng.vo.doctorAuth.DoctorAuthRest;
 import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.*;
+import thyyxxk.webserver.utils.WrapperUtils;
 
 import java.math.BigDecimal;
 import java.util.ArrayList;
@@ -113,9 +115,10 @@ public interface YiZhuLuRuDao {
                                 @Param("admissTimes") Integer admissTimes,
                                 @Param("ledgerSn") Integer ledgerSn);
 
-    default List<XinZhenYzActOrder> selectOrderNo(@Param(Constants.WRAPPER) Wrapper<?> wq) {
-        List<XinZhenYzActOrder> xinZhenYzActOrders = this.selectOrderNoByOld(wq);
-        List<XinZhenYzActOrder> xinZhenYzActOrders1 = this.selectOrderNoByNew(wq);
+    default List<XinZhenYzActOrder> selectOrderNo(@Param(Constants.WRAPPER) QueryWrapper<?> wq) {
+        String fullSql = WrapperUtils.getFullSql(wq);
+        List<XinZhenYzActOrder> xinZhenYzActOrders = this.selectOrderNoByOld(fullSql);
+        List<XinZhenYzActOrder> xinZhenYzActOrders1 = this.selectOrderNoByNew(fullSql);
         List<XinZhenYzActOrder> result = new ArrayList<>();
         result.addAll(xinZhenYzActOrders1);
         result.addAll(xinZhenYzActOrders);
@@ -125,9 +128,6 @@ public interface YiZhuLuRuDao {
 
     @Select("select                     cast(a.act_order_no as decimal) as act_order_no, " +
             "                           cast(cast(a.act_order_no as decimal) as varchar) id, " +
-            "    newOrderFlag         = (select count(*) " +
-            "                            from new_act_order_recording " +
-            "                            where new_act_order_recording.act_order_no = a.act_order_no), " +
             "                           order_code, " +
             "                           order_name, " +
             "                           rtrim(frequ_code)                                frequ_code, " +
@@ -233,21 +233,18 @@ public interface YiZhuLuRuDao {
             "                           kss.yyfs, " +
             "                           kss.ssqk, " +
             "                           kss.yysj, " +
-            "    executer1            = (select name from a_employee_mi where code = executer1), " +
-            "    executer2=             (select name from a_employee_mi where code = executer2)," +
+            "    executer1            = (select name from a_employee_mi with (NOLOCK) where code = executer1), " +
+            "    executer2=             (select name from a_employee_mi with (NOLOCK) where code = executer2)," +
             "    superiorDoctor = (select rtrim(authorized_doctor) from new_act_order_recording na where na.act_order_no = a.act_order_no) " +
             "from view_xc_all_yz a  with (NOLOCK) left join " +
             "zy_order_zk b with (NOLOCK) on (a.act_order_no = b.act_order_no) left join " +
             "yz_act_record_kss kss on (a.act_order_no = kss.act_order_no) " +
-            "where 1=1  and status_flag = '1' and  ${ew.sqlSegment} ")
-    List<XinZhenYzActOrder> selectOrderNoByNew(@Param(Constants.WRAPPER) Wrapper<?> wq);
+            "where status_flag = '1' and  ${sql} ")
+    List<XinZhenYzActOrder> selectOrderNoByNew(String sql);
 
 
     @Select("select                     cast(a.act_order_no as decimal)               as act_order_no,\n" +
             "                           cast(cast(a.act_order_no as decimal) as varchar) id,\n" +
-            "    newOrderFlag         = (select count(*)\n" +
-            "                            from new_act_order_recording\n" +
-            "                            where new_act_order_recording.act_order_no = a.act_order_no),\n" +
             "                           order_code,\n" +
             "                           order_name,\n" +
             "                           rtrim(frequ_code)                                frequ_code,\n" +
@@ -351,17 +348,14 @@ public interface YiZhuLuRuDao {
             "                            where code = modifier) /*停止人*/,\n" +
             "                           end_time /*停止时间*/,\n" +
             "    executer1            = (select name\n" +
-            "                            from a_employee_mi\n" +
+            "                            from a_employee_mi with (NOLOCK) \n" +
             "                            where code = executer1),\n" +
             "    executer2=             (select name\n" +
-            "                            from a_employee_mi\n" +
-            "                            where code = executer2),\n" +
-            "    superiorDoctor       = (select rtrim(authorized_doctor)\n" +
-            "                            from new_act_order_recording na\n" +
-            "                            where na.act_order_no = a.act_order_no)\n" +
-            "from yz_act_order a with (NOLOCK)\n" +
-            "where 1=1  and status_flag <> '1' and ${ew.sqlSegment} ;")
-    List<XinZhenYzActOrder> selectOrderNoByOld(@Param(Constants.WRAPPER) Wrapper<?> wq);
+            "                            from a_employee_mi with (NOLOCK)\n" +
+            "                            where code = executer2)\n" +
+            "from view_xc_all_yz a with (NOLOCK)\n" +
+            "where status_flag <> '1' and ${sql} ;")
+    List<XinZhenYzActOrder> selectOrderNoByOld(String sql);
 
 
     @Select("select act_order_no, " +

+ 8 - 1
src/main/java/thyyxxk/webserver/entity/inpatient/ZyActpatient.java

@@ -8,6 +8,7 @@ import org.springframework.format.annotation.DateTimeFormat;
 import thyyxxk.webserver.entity.datamodify.MzChargeDetail;
 import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
 import thyyxxk.webserver.entity.inpatient.charge.ZyDepositFile;
+import thyyxxk.webserver.entity.transferInOfExpenses.data.CorrectInvoice;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
@@ -882,7 +883,6 @@ public class ZyActpatient implements Serializable {
     private BigDecimal ztYjjHj;
 
 
-
     //非数据库字段 控制发票打印标志,只是页面做显示,不更新
     private Integer printFlag;
     //住院缴费记录
@@ -898,6 +898,13 @@ public class ZyActpatient implements Serializable {
      */
     private List<WeiGuiFeiYongFenXi> weiPiPei;
 
+    /**
+     * 机制号
+     * 这个实体类只在急诊费用转入中有效,
+     * 用来冲正发票,是mz_receipt_serial表中的字段
+     */
+    private Integer serialNo;
+
 
     public String getSexName() {
         if (this.sex == null) {

+ 79 - 0
src/main/java/thyyxxk/webserver/entity/transferInOfExpenses/data/CorrectInvoice.java

@@ -0,0 +1,79 @@
+package thyyxxk.webserver.entity.transferInOfExpenses.data;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class CorrectInvoice {
+
+    @NotNull(message = "患者门诊号不能为空")
+    private String patientId;
+
+    @NotNull(message = "就诊次数不能为空")
+    private Integer times;
+
+    /**
+     * 在 mz_receipt_serial 里面的 receipt_no 这个字段
+     */
+    private Integer receiptNo;
+
+    /**
+     * 部分开票 = 5
+     * 部分冲红 = 6
+     * chargeItemCodes 空传 5
+     */
+    private Integer typeFlag = 5;
+
+    /**
+     * 操作人
+     */
+    private String opId;
+
+    /**
+     * 不需要冲正的项目编码,也就是需要录入的项目编码
+     * 如果传的是 6 的话,就是需要冲正的编码
+     */
+    private List<String> chargeItemCodes;
+
+    @Data
+    public static class CorrectInvoiceReq {
+
+        /**
+         * 机制号
+         */
+        private Integer serialNo;
+
+        /**
+         * 需要冲正的项目编码
+         */
+        private List<String> codes;
+    }
+
+    @Data
+    public static class DzcfVo {
+        private String qrCode;
+        private String name;
+        private String chargeCode;
+        private String patientId;
+
+        /**
+         * 打印日期
+         */
+        private String printDate;
+
+        /**
+         * 总金额
+         */
+        private String total;
+
+        private String opName;
+    }
+}

+ 0 - 2
src/main/java/thyyxxk/webserver/service/hutoolcache/UserCache.java

@@ -5,11 +5,9 @@ import cn.hutool.cache.CacheUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.RequiredArgsConstructor;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import thyyxxk.webserver.dao.his.hutoolcache.HutoolCacheDao;
 import thyyxxk.webserver.entity.login.UserInfo;
-import thyyxxk.webserver.service.PublicServer;
 import thyyxxk.webserver.utils.ListUtil;
 import thyyxxk.webserver.utils.TokenUtil;
 

+ 91 - 24
src/main/java/thyyxxk/webserver/service/inpatient/TransferInOfExpensesService.java

@@ -1,10 +1,14 @@
 package thyyxxk.webserver.service.inpatient;
 
+import cn.hutool.core.date.DatePattern;
+import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import thyyxxk.webserver.config.exception.ExceptionEnum;
 import thyyxxk.webserver.constants.Capacity;
@@ -16,15 +20,13 @@ import thyyxxk.webserver.entity.datamodify.MzChargeDetail;
 import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
 import thyyxxk.webserver.entity.inpatient.ZyActpatient;
 import thyyxxk.webserver.entity.medicalinsurance.inpatient.ZyPatientInfo;
+import thyyxxk.webserver.entity.transferInOfExpenses.data.CorrectInvoice;
 import thyyxxk.webserver.service.PublicServer;
-import thyyxxk.webserver.utils.DateUtil;
-import thyyxxk.webserver.utils.ResultVoUtil;
-import thyyxxk.webserver.utils.TokenUtil;
+import thyyxxk.webserver.service.hutoolcache.UserCache;
+import thyyxxk.webserver.utils.*;
 
 import java.math.BigDecimal;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * <p>
@@ -36,16 +38,17 @@ import java.util.Map;
  */
 @Service
 @Slf4j
+@RequiredArgsConstructor
 public class TransferInOfExpensesService {
 
     private final TransferInOfExpensesDao dao;
     private final PublicServer publicServer;
+    private final RestTemplateUtils template;
+    private final UserCache userCache;
+
+    @Value("${thmz-api-url}")
+    private String thmzApiUrl;
 
-    @Autowired
-    public TransferInOfExpensesService(TransferInOfExpensesDao dao, PublicServer publicServer) {
-        this.dao = dao;
-        this.publicServer = publicServer;
-    }
 
     /**
      * 查询再远患者信息
@@ -65,18 +68,12 @@ public class TransferInOfExpensesService {
     /**
      * 通过机制号来查找信息
      *
-     * @param serialNo  机制号
-     * @param liShiFlag 是否查看历史 0:不查看 1:查看
+     * @param serialNo 机制号
      * @return 返回信息
      */
-    public ResultVo<List<MzChargeDetail>> getSerialNo(Integer serialNo, Integer liShiFlag) {
-        List<MzChargeDetail> list;
-        if (liShiFlag == 0) {
-            list = dao.getSerialNo("mz_charge_detail", "mz_receipt_serial", serialNo);
-        } else {
-            list = dao.getSerialNo("mz_charge_detail_b", "mz_receipt_serial_b", serialNo);
-        }
-        if (list.size() > 0) {
+    public ResultVo<List<MzChargeDetail>> getSerialNo(Integer serialNo) {
+        List<MzChargeDetail> list = dao.getSerialNo("mz_charge_detail", "mz_receipt_serial", serialNo);
+        if (!list.isEmpty()) {
             return ResultVoUtil.success(list);
         } else {
             return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
@@ -98,7 +95,7 @@ public class TransferInOfExpensesService {
         List<ZyDetailCharge> list = dao.getZyJiMenZhenZhuangRuFeiYong(page, inpatientNo, chargeCodeMX, admissTimes, ledgerSn);
         List<ZyDetailCharge> sumList = dao.sumZyFee(inpatientNo, chargeCodeMX, admissTimes, ledgerSn);
         Map<String, Object> map = new HashMap<>(Capacity.TWO);
-        if (page.getTotal() > 0 || list.size() > 0) {
+        if (page.getTotal() > 0 || !list.isEmpty()) {
             BigDecimal sum = new BigDecimal(0);
             for (ZyDetailCharge zyDetailCharge : sumList) {
                 sum = sum.add(zyDetailCharge.getChargeFee().multiply(zyDetailCharge.getChargeAmount()));
@@ -130,6 +127,9 @@ public class TransferInOfExpensesService {
      * @return 返回通知
      */
     public ResultVo<String> baoCunHuanZheZhuYuanFeiYong(ZyActpatient param) {
+        if (param.getSerialNo() == null) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "刷新页面机制号为空");
+        }
         param.setStaffId(TokenUtil.getInstance().getTokenUserId());
         List<MzChargeDetail> list = param.getList();
         //查询流水号
@@ -147,7 +147,6 @@ public class TransferInOfExpensesService {
                 return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "费用发生时间不能大于出院时间,患者出院时间为:" + DateUtil.formatDatetime(param.getDisDate()));
             }
         }
-
         // 流水号取出这个患者流水值的最大值 在加 1
         // 同时计算 出患者的总金额 以及 费用的类型
         list.removeIf(item -> "BILL99".equals(item.getChargeCodeMx()));
@@ -162,6 +161,73 @@ public class TransferInOfExpensesService {
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "操作成功。");
     }
 
+
+    public ResultVo<String> correctInvoice(CorrectInvoice.CorrectInvoiceReq param) {
+        CorrectInvoice correctInvoice = dao.getSerialNoByInvoiceNo(param.getSerialNo());
+        if (correctInvoice == null) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到该发票号");
+        }
+
+        String url = thmzApiUrl + "/uploadPartMzInvoice";
+        correctInvoice.setOpId(TokenUtil.getInstance().getTokenUserId());
+        param.getCodes().replaceAll(String::trim);
+        correctInvoice.setChargeItemCodes(param.getCodes());
+
+        ResultVo<String> resultVo = template.post(url, correctInvoice, String.class, "门诊部分开票");
+        if (resultVo == null) {
+            return R.fail(ExceptionEnum.LOGICAL_ERROR, "调用接口错误,请联系管理员。");
+        }
+        if (resultVo.getCode().equals(0)) {
+            return R.ok(resultVo.getData());
+        }
+        return R.fail(ExceptionEnum.LOGICAL_ERROR, resultVo.getMessage());
+    }
+
+    /**
+     * 获取发票的二维码
+     *
+     * @param serialNo 机制号
+     * @return 数据
+     */
+    public ResultVo<CorrectInvoice.DzcfVo> getDzfpQrcodeBySerialNo(Integer serialNo) {
+        CorrectInvoice correctInvoice = dao.getSerialNoByInvoiceNo(serialNo);
+        return getDzfpQrcodeByCorrectInvoice(correctInvoice, serialNo);
+    }
+
+    public ResultVo<CorrectInvoice.DzcfVo> getDzfpQrcodeByCorrectInvoice(CorrectInvoice correctInvoice, Integer serialNo) {
+        if (correctInvoice == null) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到该发票号");
+        }
+        // 查询是否已经冲正了,如果冲正了就直接用冲正的东西
+        CorrectInvoice.DzcfVo uploadData = dao.getMzDzcfUpload(correctInvoice);
+
+        if (uploadData == null) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到电子发票");
+        }
+        List<String> changeCodes = StrUtil.isNotBlank(uploadData.getChargeCode()) ? Arrays.asList(uploadData.getChargeCode().split(",")) : null;
+
+        QueryWrapper<?> qw = new QueryWrapper<>();
+        qw.eq("patient_id", correctInvoice.getPatientId())
+                .eq("times", correctInvoice.getTimes())
+                .eq("receipt_no", correctInvoice.getReceiptNo())
+                .eq("serial_no", serialNo)
+                .in("charge_item_code", changeCodes);
+
+        BigDecimal dzfpChangeTotal = dao.getDzfpChangeTotal(qw);
+        uploadData.setPatientId(correctInvoice.getPatientId());
+
+        if (dzfpChangeTotal != null) {
+            uploadData.setTotal(dzfpChangeTotal.toPlainString());
+        } else {
+            uploadData.setTotal("0");
+        }
+        uploadData.setOpName(userCache.getEmployeeName(correctInvoice.getOpId()));
+        uploadData.setPrintDate(DateUtil.format(new Date(), DatePattern.CHINESE_DATE_FORMAT));
+        return R.ok(uploadData);
+
+    }
+
+
     /**
      * 远程搜索 项目名称
      *
@@ -171,4 +237,5 @@ public class TransferInOfExpensesService {
     public ResultVo<List<GetDropdownBox>> queryEntryName(String pyCode) {
         return ResultVoUtil.success(dao.queryEntryName("%" + pyCode.toUpperCase() + "%"));
     }
+
 }

+ 4 - 1
src/main/java/thyyxxk/webserver/service/inpatient/charge/CashierProcessService.java

@@ -388,7 +388,10 @@ public class CashierProcessService {
         zyReceipt.setSexName(zyActpatient.getSexName());
         zyReceipt.setZyTs(diff == 0 ? 1 : diff + 1);
         ZyLedgerFile zyLedgerFile = list.get(0);
-        if((NumberEnum.ONE.getCode().equals(fpVersion) && Convert.toInt(param.getTypeFlag(),0) == 3) || NumberEnum.ZERO.getCode().equals(fpVersion)){
+        if(NumberEnum.ONE.getCode().equals(fpVersion) && zyLedgerFile.getAccountDate() == null && Convert.toInt(param.getTypeFlag(),0) == 3){
+            throw new BizException(ExceptionEnum.LOGICAL_ERROR, "未结算处理,不能"+fpVersionStr+"发票");
+        }
+        if(NumberEnum.ZERO.getCode().equals(fpVersion)){
             if (zyLedgerFile.getCashDate() == null) {
                 throw new BizException(ExceptionEnum.LOGICAL_ERROR, "未出纳处理,不能"+fpVersionStr+"发票");
             }

+ 3 - 4
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiPsnRcdService.java

@@ -38,19 +38,19 @@ public class SiPsnRcdService {
     private final PsnAsgnmtRcdDao psnAsgRcdDao;
     private final PsnAccidentRcdDao psnAccdntDao;
     private final SiLogDao logDao;
-    private final SystemConfig sysCfg;
     private final UserCache userCache;
+    private final SystemConfig sysCfg;
 
     @Autowired
-    public SiPsnRcdService(ExecService exec, SlwSpcChrRcdDao dao, TransHospRcdDao trsHspRcdDao, PsnAsgnmtRcdDao psnAsgRcdDao, PsnAccidentRcdDao psnAccdntDao, SiLogDao logDao, SystemConfig sysCfg, UserCache userCache) {
+    public SiPsnRcdService(ExecService exec, SlwSpcChrRcdDao dao, TransHospRcdDao trsHspRcdDao, PsnAsgnmtRcdDao psnAsgRcdDao, PsnAccidentRcdDao psnAccdntDao, SiLogDao logDao, UserCache userCache, SystemConfig sysCfg) {
         this.exec = exec;
         this.slwSpcChrRcdDao = dao;
         this.trsHspRcdDao = trsHspRcdDao;
         this.psnAsgRcdDao = psnAsgRcdDao;
         this.psnAccdntDao = psnAccdntDao;
         this.logDao = logDao;
-        this.sysCfg = sysCfg;
         this.userCache = userCache;
+        this.sysCfg = sysCfg;
     }
 
     public ResultVo<String> transferHospitalRecord(TransHospRcd trsHspRcd) {
@@ -111,7 +111,6 @@ public class SiPsnRcdService {
         if (StrUtil.isBlank(userInfo.getYbCode())) {
             throw new BizException(ExceptionEnum.USER_NOT_EXIST, "诊断医生没有医保赋码!");
         }
-        slwSpcDiseRcd.setDiagDrCodg(userInfo.getYbCode());
         slwSpcDiseRcd.setIdeFixmedinsNo(sysCfg.getInstitutionId());
         slwSpcDiseRcd.setIdeFixmedinsName(sysCfg.getInstitutionName());
         JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.SPECIAL_CHRONIC_DISEASES_RECORD, slwSpcDiseRcd.getInsuOptins());

+ 4 - 1
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/YiZhuLuRuServer.java

@@ -49,6 +49,8 @@ import thyyxxk.webserver.service.zhuyuanyisheng.yizhuverify.YiZhuCheckData;
 import thyyxxk.webserver.utils.*;
 
 import java.math.BigDecimal;
+import java.time.Duration;
+import java.time.Instant;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -92,7 +94,8 @@ public class YiZhuLuRuServer {
      * @return 返回医嘱数据
      */
     public ResultVo<List<XinZhenYzActOrder>> huoQuYiZhuShuJu(YiZhuFeiYongChaXunTiaoJian param) {
-        return ResultVoUtil.success(getOrderList(dao.selectOrderNo(param.buildQw())));
+        List<XinZhenYzActOrder> xinZhenYzActOrders = dao.selectOrderNo(param.buildQw());
+        return ResultVoUtil.success(xinZhenYzActOrders);
     }
 
     /**

+ 30 - 0
src/main/java/thyyxxk/webserver/utils/RestTemplateUtils.java

@@ -0,0 +1,30 @@
+package thyyxxk.webserver.utils;
+
+import cn.hutool.json.JSONUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpMethod;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestTemplate;
+import thyyxxk.webserver.entity.ResultVo;
+
+@Slf4j
+@Component
+@RequiredArgsConstructor
+public class RestTemplateUtils {
+    private final RestTemplate template;
+
+    public <T> ResultVo<T> get(String url, Object req, Class<T> clazz) {
+        return template.exchange(url, HttpMethod.GET, new HttpEntity<>(req), new ParameterizedTypeReference<ResultVo<T>>() {
+        }).getBody();
+    }
+
+    public <T> ResultVo<T> post(String url, Object req, Class<T> clazz, String logName) {
+        ResultVo<T> body = template.exchange(url, HttpMethod.POST, new HttpEntity<>(req), new ParameterizedTypeReference<ResultVo<T>>() {
+        }).getBody();
+        log.info("{}--------------->\n参数:{}\n返回值:{}", logName, JSONUtil.toJsonStr(req), JSONUtil.toJsonStr(body));
+        return body;
+    }
+}