Browse Source

为耗材添加规格修改,把项目内涵和规格区分开。

lighter 4 years ago
parent
commit
8d72b0020f

+ 1 - 1
pom.xml

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

+ 2 - 2
src/main/java/thyyxxk/webserver/controller/nationalmatch/NationalMatchController.java

@@ -30,9 +30,9 @@ public class NationalMatchController {
         return service.selectLocalItems(param);
     }
 
-    @GetMapping("/asyncNewNameForServices")
+    @GetMapping("/asyncNewNameForServicesOrItems")
     public ResultVo<String> asyncNewNameForServices() {
-        return service.asyncNewNameForServices();
+        return service.asyncNewNameForServicesOrItems();
     }
 
     @PostMapping("/selectNationalItems")

+ 30 - 6
src/main/java/thyyxxk/webserver/dao/his/nationalmatch/NationalMatchDao.java

@@ -20,21 +20,38 @@ public interface NationalMatchDao {
     @Select("select a.code,a.serial,a.name,type=#{type},a.national_code,a.national_name, " +
             "unit=(select name from yp_zd_unit where yp_zd_unit.code=a.dosage_unit), " +
             "dosage=(select name from yp_zd_dosage where yp_zd_dosage.code=a.dosage), " +
-            "a.specification,rtrim(a.pzwh) as approvalNumber, " +
+            "ltrim(a.specification) as specification,rtrim(a.pzwh) as approvalNumber, " +
             "factory=(select name from yp_zd_manufactory where yp_zd_manufactory.code=a.manu_code) " +
             "from yp_zd_dict a, (select max(serial) as serial,code from yp_zd_dict where isnull(visible_flag,0)=#{delFlag} " +
             "and isnull(del_flag,0)=#{delFlag} group by code) b,yp_base c " +
             "where isnull(national_status,0)=#{status} and a.code=b.code and a.serial=b.serial " +
-            "and c.group_no=#{groupNo} and a.code=c.charge_code and a.code like #{code} and a.name like #{name}")
+            "and c.group_no=11 and a.code=c.charge_code and a.drug_kind in (select code from yp_zd_drug_kind where yp_type in (1,2)) " +
+            "and a.code like #{code} and a.name like #{name}")
     IPage<StandardLocalItem> selectLocalMedicines(IPage<StandardLocalItem> iPage,
                                                   @Param("code") String code,
                                                   @Param("name") String name,
                                                   @Param("type") int type,
                                                   @Param("delFlag") int delFlag,
-                                                  @Param("status") int status,
-                                                  @Param("groupNo") int groupNo);
+                                                  @Param("status") int status);
 
-    @Select("select code,name,charge_unit as unit,type=#{type}, discription as specification,national_code," +
+    @Select("select a.code,a.serial,a.name,type=#{type},a.national_code,a.national_name, " +
+            "unit=(select name from yp_zd_unit where yp_zd_unit.code=a.dosage_unit), " +
+            "dosage=(select name from yp_zd_dosage where yp_zd_dosage.code=a.dosage), " +
+            "ltrim(a.specification) as specification,rtrim(a.pzwh) as approvalNumber, " +
+            "factory=(select name from yp_zd_manufactory where yp_zd_manufactory.code=a.manu_code) " +
+            "from yp_zd_dict a, (select max(serial) as serial,code from yp_zd_dict where isnull(visible_flag,0)=#{delFlag} " +
+            "and isnull(del_flag,0)=#{delFlag} group by code) b,yp_base c " +
+            "where isnull(national_status,0)=#{status} and a.code=b.code and a.serial=b.serial " +
+            "and c.group_no=22 and a.code=c.charge_code and a.drug_kind in ('0007','0003') " +
+            "and a.code like #{code} and a.name like #{name} ")
+    IPage<StandardLocalItem> selectLocalHerbals(IPage<StandardLocalItem> iPage,
+                                                  @Param("code") String code,
+                                                  @Param("name") String name,
+                                                  @Param("type") int type,
+                                                  @Param("delFlag") int delFlag,
+                                                  @Param("status") int status);
+
+    @Select("select code,name,charge_unit as unit,type=#{type},discription,specification,national_code," +
             "national_name,yb_comment as factory from zd_charge_item where isnull(national_status,0)=#{status} " +
             "and isnull(del_flag,0)=#{delFlag} and class_code='J' and code like #{code} and name like #{name}")
     IPage<StandardLocalItem> selectLocalSupplies(IPage<StandardLocalItem> iPage,
@@ -44,7 +61,7 @@ public interface NationalMatchDao {
                                                  @Param("delFlag") int delFlag,
                                                  @Param("status") int status);
 
-    @Select("select code,new_name as name,charge_unit as unit,type=#{type}, discription as specification," +
+    @Select("select code,new_name as name,charge_unit as unit,type=#{type}, discription,specification," +
             "national_code,national_name,s_code as standardCode, charge_amount as price from zd_charge_item " +
             "where isnull(national_status,0)=#{status} and isnull(del_flag,0)=#{delFlag} and " +
             "class_code!='J' and code like #{code} and name like #{name}")
@@ -113,4 +130,11 @@ public interface NationalMatchDao {
                            @Param("standardCode") String standardCode,
                            @Param("discription") String discription,
                            @Param("code") String code);
+
+    @Update("update zd_charge_item set new_name=#{name},oper_id=#{staffId}," +
+            "specification=#{specification},oper_date=getdate() where code=#{code}")
+    void updateSupply(@Param("name") String name,
+                      @Param("staffId") String staffId,
+                      @Param("specification") String specification,
+                      @Param("code") String code);
 }

+ 1 - 0
src/main/java/thyyxxk/webserver/entity/nationalmatch/StandardLocalItem.java

@@ -18,6 +18,7 @@ public class StandardLocalItem {
     private String specification;
     private String approvalNumber;
     private String factory;
+    private String discription;
     private String standardCode;
     private String price;
     private String nationalCode;

+ 7 - 5
src/main/java/thyyxxk/webserver/service/nationalmatch/NationalMatchService.java

@@ -41,9 +41,9 @@ public class NationalMatchService {
         String name = param.getName();
         name = StringUtil.isBlank(name) ? "%%" : "%" + name.trim() + "%";
         if (param.getType() == NationalMatchType.MEDICINE) {
-            iPage = dao.selectLocalMedicines(iPage, code, name, param.getType(), param.getDelFlag(), param.getStatus(), 11);
+            iPage = dao.selectLocalMedicines(iPage, code, name, param.getType(), param.getDelFlag(), param.getStatus());
         } else if(param.getType() == NationalMatchType.HERBAL) {
-            iPage = dao.selectLocalMedicines(iPage, code, name, param.getType(), param.getDelFlag(), param.getStatus(), 22);
+            iPage = dao.selectLocalHerbals(iPage, code, name, param.getType(), param.getDelFlag(), param.getStatus());
         } else if (param.getType() == NationalMatchType.SERVICE) {
             iPage = dao.selectLocalServices(iPage, code, name, param.getType(), param.getDelFlag(), param.getStatus());
         } else {
@@ -58,7 +58,7 @@ public class NationalMatchService {
         return ResultVoUtil.success(map);
     }
 
-    public ResultVo<String> asyncNewNameForServices() {
+    public ResultVo<String> asyncNewNameForServicesOrItems() {
         dao.asyncNewNameForServices();
         return ResultVoUtil.success("同步成功。");
     }
@@ -132,9 +132,11 @@ public class NationalMatchService {
         String staffId = TokenUtil.getTokenUserId();
         if (param.getType() < NationalMatchType.SERVICE) {
             dao.updateMedicine(param.getName(), staffId, param.getCode());
-        } else {
+        } else if (param.getType() == NationalMatchType.SERVICE) {
             dao.updateServiceItem(param.getName(), param.getUnit(), param.getPrice(), staffId,
-                    param.getStandardCode(), param.getSpecification(), param.getCode());
+                    param.getStandardCode(), param.getDiscription(), param.getCode());
+        } else {
+            dao.updateSupply(param.getName(), staffId, param.getSpecification(), param.getCode());
         }
         log.info("【操作员:{}】修改项目:{}", staffId, param);
         return ResultVoUtil.success("修改成功。");