浏览代码

添加规格和厂家

DESKTOP-0GD05B0\Administrator 2 年之前
父节点
当前提交
f7880a5ee4

+ 2 - 1
src/main/java/thyyxxk/webserver/controller/inpatient/XiangMuLuRuController.java

@@ -11,6 +11,7 @@ import thyyxxk.webserver.config.auth.PassToken;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
 import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
+import thyyxxk.webserver.entity.inpatient.FeeSelect;
 import thyyxxk.webserver.entity.inpatient.ZyActpatient;
 import thyyxxk.webserver.entity.projectEntry.DrugReturnForm;
 import thyyxxk.webserver.service.inpatient.XiangMuLuRuService;
@@ -43,7 +44,7 @@ public class XiangMuLuRuController {
     }
 
     @GetMapping("/getChargeCode")
-    public ResultVo<List<GetDropdownBox>> getChargeCode(@RequestParam("pyCode") String pyCode) {
+    public ResultVo<List<FeeSelect>> getChargeCode(@RequestParam("pyCode") String pyCode) {
         return service.getChargeCode(pyCode);
     }
 

+ 37 - 30
src/main/java/thyyxxk/webserver/dao/his/inpatient/XiangMuLuRuDao.java

@@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.*;
 import thyyxxk.webserver.entity.datamodify.FeiYongLeiXin;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
 import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
+import thyyxxk.webserver.entity.inpatient.FeeSelect;
 import thyyxxk.webserver.entity.inpatient.WeiGuiFeiYongFenXi;
 import thyyxxk.webserver.entity.projectEntry.DrugReturnForm;
 
@@ -271,10 +272,16 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
      * @param pyCode 拼音编码
      * @return 获取项目的名称和code
      */
-    @Select("select distinct code,name from  zd_charge_item where (py_code like #{pyCode} or code like #{pyCode} or name like #{pyCode})" +
+    @Select("select distinct code, " +
+            "                name, " +
+            "                specification=N'诊疗项目', " +
+            "                manufactor   = (select name from yp_zd_manufactory where manu_code = yp_zd_manufactory.code) from  zd_charge_item where (py_code like #{pyCode} or code like #{pyCode} or name like #{pyCode})" +
             "union all " +
-            "select distinct code,name from  yp_zd_dict where (py_code like #{pyCode} or code like #{pyCode} or name like #{pyCode})")
-    List<GetDropdownBox> getChargeCode(String pyCode);
+            "select distinct code, " +
+            "                name, " +
+            "                specification, " +
+            "                manufactor = (select name from yp_zd_manufactory where manu_code = yp_zd_manufactory.code) from  yp_zd_dict where (py_code like #{pyCode} or code like #{pyCode} or name like #{pyCode})")
+    List<FeeSelect> getChargeCode(String pyCode);
 
     /**
      * @param inpatientNo 住院次数
@@ -440,8 +447,8 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
     /**
      * 退药汇总单
      */
-    @Insert("insert into yz_yp_page_no (page_no, dept_code, ward_code, submit_time, submit_name,\n" +
-            "                           submit_flag, page_class, page_name, group_no)\n" +
+    @Insert("insert into yz_yp_page_no (page_no, dept_code, ward_code, submit_time, submit_name, " +
+            "                           submit_flag, page_class, page_name, group_no) " +
             "values (#{pageNo}, #{wardCode}, #{wardCode}, getdate(), #{userCode}, 1, 'HT', '护士退药单', #{groupNo})")
     void drugReturnForm(@Param("pageNo") Integer pageNo,
                         @Param("wardCode") String wardCode,
@@ -449,14 +456,14 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
                         @Param("groupNo") String groupNo);
 
     @Insert("<script>" +
-            "insert into yz_yp_zy_order (inpatient_no, admiss_times, name, bed_no, dept_code, ward_code, charge_code, amount,\n" +
-            "                            retprice, charge_date, infant_flag, drawer, always_flag, status_flag, drug_class, \n" +
-            "                            occ_time, act_order_no, serial, group_no, doctor_name, page_no_ty,ledger_sn,detail_sn,serail,page_class)\n" +
+            "insert into yz_yp_zy_order (inpatient_no, admiss_times, name, bed_no, dept_code, ward_code, charge_code, amount, " +
+            "                            retprice, charge_date, infant_flag, drawer, always_flag, status_flag, drug_class,  " +
+            "                            occ_time, act_order_no, serial, group_no, doctor_name, page_no_ty,ledger_sn,detail_sn,serail,page_class) " +
             "values " +
             "<foreach collection='list' item='item' index='index' separator=','>" +
-            "(#{patNo}, #{times}, #{name}, #{bedNo}, #{wardCode},  #{wardCode}, #{item.chargeCodeMx}, #{item.chargeAmount,jdbcType=REAL},\n" +
-            "        #{item.chargeFee,jdbcType=REAL}, getdate(), #{infantFlag}, #{userCode}, 'a', '1',\n" +
-            "       #{item.drugClass},  getdate(), ${index}, #{item.serial}, #{groupNo},\n" +
+            "(#{patNo}, #{times}, #{name}, #{bedNo}, #{wardCode},  #{wardCode}, #{item.chargeCodeMx}, #{item.chargeAmount,jdbcType=REAL}, " +
+            "        #{item.chargeFee,jdbcType=REAL}, getdate(), #{infantFlag}, #{userCode}, 'a', '1', " +
+            "       #{item.drugClass},  getdate(), ${index}, #{item.serial}, #{groupNo}, " +
             "       #{item.doctorCode}, #{pageNo},#{ledgerSn},#{item.detailSn},0,'HT')" +
             "</foreach>" +
             "</script>")
@@ -654,11 +661,11 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
 
 
     @Select("<script>" +
-            "select code                                                                              as charge_code_mx,\n" +
-            "       CASE infusion_flag\n" +
-            "           when '1' then 'i'\n" +
-            "           else (case when code &gt;= '30000' and code &lt; '50000' then 'd' else 'j' end) end as drug_class\n" +
-            "from yp_zd_dict\n" +
+            "select code                                                                              as charge_code_mx, " +
+            "       CASE infusion_flag " +
+            "           when '1' then 'i' " +
+            "           else (case when code &gt;= '30000' and code &lt; '50000' then 'd' else 'j' end) end as drug_class " +
+            "from yp_zd_dict " +
             "where rtrim(code) + rtrim(serial) in " +
             "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
             " '${item.chargeCodeMx}${item.serial}' " +
@@ -1134,19 +1141,19 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
 
 
     @Select("<script>" +
-            "select a.charge_code,\n" +
-            "       b.name         as drug_name,\n" +
-            "       b.specification,\n" +
-            "       a.amount,\n" +
-            "       a.retprice,\n" +
-            "       b.pack_retprice,\n" +
-            "       a.inpatient_no as pat_no,\n" +
-            "       a.name,\n" +
-            "       page_class,\n" +
-            "       page_no_ty\n" +
-            "from yz_yp_zy_order a,\n" +
-            "     yp_zd_dict b\n" +
-            "where a.inpatient_no = #{patNo}\n" +
+            "select a.charge_code, " +
+            "       b.name         as drug_name, " +
+            "       b.specification, " +
+            "       a.amount, " +
+            "       a.retprice, " +
+            "       b.pack_retprice, " +
+            "       a.inpatient_no as pat_no, " +
+            "       a.name, " +
+            "       page_class, " +
+            "       page_no_ty " +
+            "from yz_yp_zy_order a, " +
+            "     yp_zd_dict b " +
+            "where a.inpatient_no = #{patNo} " +
             "  and a.admiss_times = #{times}" +
             "  and group_no = #{groupNo} " +
             "  and a.status_flag = 1 " +
@@ -1154,7 +1161,7 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
             "<if test=\"refundTime != null and refundTime != '' \">" +
             " and CONVERT(varchar(100), occ_time, 23)  = #{refundTime} " +
             "</if>" +
-            "  and a.charge_code = b.code\n" +
+            "  and a.charge_code = b.code " +
             "  and a.serial = b.serial " +
             "</script>")
     List<DrugReturnForm> queryTheDrugReturnForm(@Param("groupNo") String groupNo,

+ 12 - 0
src/main/java/thyyxxk/webserver/entity/inpatient/FeeSelect.java

@@ -0,0 +1,12 @@
+package thyyxxk.webserver.entity.inpatient;
+
+import lombok.Data;
+
+@Data
+public class FeeSelect {
+
+    private String code;
+    private String name;
+    private String specification;
+    private String manufactor;
+}

+ 2 - 1
src/main/java/thyyxxk/webserver/service/inpatient/XiangMuLuRuService.java

@@ -18,6 +18,7 @@ import thyyxxk.webserver.dao.his.medicalinsurance.SiSettleApplyDao;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
 import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
+import thyyxxk.webserver.entity.inpatient.FeeSelect;
 import thyyxxk.webserver.entity.inpatient.ZyActpatient;
 import thyyxxk.webserver.entity.login.UserInfo;
 import thyyxxk.webserver.entity.medicalinsurance.inpatient.ZyPatientInfo;
@@ -105,7 +106,7 @@ public class XiangMuLuRuService {
      * @param pyCode 拼音码
      * @return 返回项目信息
      */
-    public ResultVo<List<GetDropdownBox>> getChargeCode(String pyCode) {
+    public ResultVo<List<FeeSelect>> getChargeCode(String pyCode) {
         return ResultVoUtil.success(dao.getChargeCode(StringUtil.isContainChinese(pyCode)));
     }
 

+ 1 - 0
src/main/java/thyyxxk/webserver/utils/StringUtil.java

@@ -90,6 +90,7 @@ public class StringUtil {
         if (isBlank(str)) {
             return "%";
         }
+        str = str.trim();
         Matcher m = CHINESE_CHARACTERS.matcher(str);
         if (m.find()) {
             return "%" + str + "%";