Jelajahi Sumber

1.完成本地药房和标准代码映射

zjh 2 tahun lalu
induk
melakukan
de9dc112e1
21 mengubah file dengan 95 tambahan dan 13 penghapusan
  1. TEMPAT SAMPAH
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/drug/StandTMAutoMappingVO.java
  2. TEMPAT SAMPAH
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/drug/TMaterial.java
  3. TEMPAT SAMPAH
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/drug/TMaterialMapping.java
  4. TEMPAT SAMPAH
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/drug/TMaterialStandVO.java
  5. TEMPAT SAMPAH
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/drug/TStandardMaterialMappingVo.java
  6. TEMPAT SAMPAH
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/sysBeans/AdminInfo.java
  7. TEMPAT SAMPAH
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/drug/BMaterialController.java
  8. TEMPAT SAMPAH
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/drug/BStandardMatController.java
  9. TEMPAT SAMPAH
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/drug/TAppMaterialMappingController.java
  10. TEMPAT SAMPAH
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/drug/TCenterHisMappingController.java
  11. TEMPAT SAMPAH
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/drug/TDrugListController.java
  12. TEMPAT SAMPAH
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/drug/TStandardMaterialMappingController.java
  13. TEMPAT SAMPAH
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/sysController/LoginController.java
  14. TEMPAT SAMPAH
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/mapper/drug/TStandardMaterialMappingMapper.java
  15. TEMPAT SAMPAH
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/drug/TDrugListService.java
  16. TEMPAT SAMPAH
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/drug/TStandardMaterialMappingService.java
  17. 2 2
      cbkj_web_parameter/src/main/resources/mappers/drug/BMaterialMapper.xml
  18. 7 1
      cbkj_web_parameter/src/main/resources/mappers/drug/BStandardMatMapper.xml
  19. 8 5
      cbkj_web_parameter/src/main/resources/mappers/drug/TDrugListMapper.xml
  20. 66 4
      cbkj_web_parameter/src/main/resources/mappers/drug/TStandardMaterialMappingMapper.xml
  21. 12 1
      cbkj_web_parameter/src/main/resources/mappers/sysMappers/AdminInfoMapper.xml

TEMPAT SAMPAH
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/drug/StandTMAutoMappingVO.java


TEMPAT SAMPAH
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/drug/TMaterial.java


TEMPAT SAMPAH
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/drug/TMaterialMapping.java


TEMPAT SAMPAH
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/drug/TMaterialStandVO.java


TEMPAT SAMPAH
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/drug/TStandardMaterialMappingVo.java


TEMPAT SAMPAH
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/sysBeans/AdminInfo.java


TEMPAT SAMPAH
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/drug/BMaterialController.java


TEMPAT SAMPAH
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/drug/BStandardMatController.java


TEMPAT SAMPAH
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/drug/TAppMaterialMappingController.java


TEMPAT SAMPAH
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/drug/TCenterHisMappingController.java


TEMPAT SAMPAH
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/drug/TDrugListController.java


TEMPAT SAMPAH
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/drug/TStandardMaterialMappingController.java


TEMPAT SAMPAH
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/sysController/LoginController.java


TEMPAT SAMPAH
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/mapper/drug/TStandardMaterialMappingMapper.java


TEMPAT SAMPAH
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/drug/TDrugListService.java


TEMPAT SAMPAH
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/drug/TStandardMaterialMappingService.java


+ 2 - 2
cbkj_web_parameter/src/main/resources/mappers/drug/BMaterialMapper.xml

@@ -66,8 +66,8 @@
         SELECT k_mat_id,k_mat_name,k_mat_py,k_mat_wb,k_mat_yf
         from b_material
         <where>
-            <if test=" name != null and name!='' ">
-                and name like CONCAT('%',trim(#{name}),'%')
+            <if test=" kMatName != null and kMatName!='' ">
+                and k_mat_name like CONCAT('%',trim(#{kMatName}),'%')
             </if>
         </where>
     </select>

+ 7 - 1
cbkj_web_parameter/src/main/resources/mappers/drug/BStandardMatMapper.xml

@@ -66,9 +66,15 @@
         SELECT s_id,s_mat_code,s_mat_name,s_mat_class,s_mat_type
         from b_standard_mat
         <where>
-            <if test=" sMatName != null and sMatName!='' ">
+            <if test=" sMatName != null and sMatName!='' and sMatCode != null and sMatCode!='' ">
+                and s_mat_name like CONCAT('%',trim(#{sMatName}),'%') or s_mat_code like CONCAT('%',trim(#{sMatCode}),'%')
+            </if>
+            <if test=" (sMatName != null and sMatName!='') and (sMatCode == null or sMatCode=='') ">
                 and s_mat_name like CONCAT('%',trim(#{sMatName}),'%')
             </if>
+            <if test=" (sMatName == null or sMatName=='') and (sMatCode != null and sMatCode!='') ">
+                and s_mat_code like CONCAT('%',trim(#{sMatCode}),'%')
+            </if>
         </where>
     </select>
 

+ 8 - 5
cbkj_web_parameter/src/main/resources/mappers/drug/TDrugListMapper.xml

@@ -25,12 +25,12 @@
         delete from t_drug_list where drug_id = #{ drugId }
     </delete>
 
-    <delete id="deleteBylist" parameterType="ArrayList">
-        delete from t_drug_list where drug_id in
+    <update id="deleteBylist" parameterType="ArrayList">
+        update t_drug_list set status = "0" where drug_id in
         <foreach collection="array" item="item" open="(" separator="," close=")">
         #{item}
         </foreach>
-    </delete>
+    </>
 
     <insert id="insert"  parameterType="TDrugList">
         insert into t_drug_list (<include refid="Base_Column_List" />) values
@@ -90,8 +90,11 @@
         SELECT drug_id,drug_name,drug_desc,drug_type,drug_version,drug_syntime,create_date,create_user,create_user_name,status,sync_source
         from t_drug_list
         <where>
-            <if test=" name != null and name!='' ">
-                and name like CONCAT('%',trim(#{name}),'%')
+            <if test=" drugName != null and drugName!='' ">
+                and drug_name like CONCAT('%',trim(#{drugName}),'%')
+            </if>
+            <if test=" drugType != null and drugType!='' ">
+                and drug_type = #{drugType}
             </if>
         </where>
     </select>

+ 66 - 4
cbkj_web_parameter/src/main/resources/mappers/drug/TStandardMaterialMappingMapper.xml

@@ -82,14 +82,76 @@
         from t_standard_material_mapping where id = #{id}
     </select>
 
-    <select id="getPageListByObj" parameterType="TStandardMaterialMapping" resultMap="BaseResultMap">
-        SELECT id,s_id,s_mat_name,s_mat_code,s_mat_type,drug_id,mat_id,create_date,create_user,create_user_name
+    <select id="getPageListByObj" parameterType="TMaterialStandVO" resultType="TMaterialStandVO">
+        SELECT
+        tm2.mat_id matId,
+        tm2.mat_name matName,
+        tm2.mat_standard matStandard,
+        bsm.s_mat_code sMatCode,
+        bsm.s_mat_name sMatName,
+        bsm.s_id sId,
+        bsm.s_mat_type as sMatType,
+        tsmm.id as mapId,
+        tsmm.drug_id as drugId
+        FROM
+        t_pharmacy AS tp
+        JOIN t_drug_list AS tdl ON(tdl.drug_id = tp.drug_id)
+        JOIN t_material AS tm2 ON (tm2.drug_id = tdl.drug_id AND tm2.status = '1' )
+        LEFT JOIN t_standard_material_mapping AS tsmm ON(tsmm.drug_id = tm2.drug_id AND tsmm.mat_id = tm2.mat_id AND tsmm.s_mat_type='2')
+        LEFT JOIN b_standard_mat AS bsm ON(bsm.s_id=tsmm.s_id AND bsm.s_mat_type='2')
+        <where>
+            tp.status = '1'
+            <if test=" isMapping == 1">
+                 and bsm.s_id is not null
+            </if>
+            <if test=" isMapping == 2">
+                 and bsm.s_id is null
+            </if>
+            <if test=" phaType != null and phaType !=''">
+                and tp.pha_type =#{phaType}
+            </if>
+            <if test=" keyWord != null and keyWord !=''">
+                and (tm2.mat_name like CONCAT('%',trim(#{keyWord}),'%') or tm2.mat_standard like CONCAT('%',trim(#{keyWord}),'%') )
+            </if>
+        </where>
+    </select>
+
+    <select id="getCountByObj" resultType="java.lang.Long">
+        select count(*)
         from t_standard_material_mapping
         <where>
-            <if test=" name != null and name!='' ">
-                and name like CONCAT('%',trim(#{name}),'%')
+            <if test=" sId != null and sId !=''">
+                s_id = #{sId}
+            </if>
+            <if test=" sMatCode != null and sMatCode !=''">
+                s_mat_code = #{sMatCode}
+            </if>
+            <if test=" drugId != null and drugId !=''">
+                drug_id = #{drugId}
+            </if>
+            <if test=" matId != null and matId !=''">
+                mat_id = #{matId}
             </if>
         </where>
     </select>
+    <insert id="insertautoMapping" parameterType="StandTMAutoMappingVO">
+
+        INSERT INTO t_standard_material_mapping
+        SELECT rand_string(32),
+               m.s_id,
+               m.s_mat_name,
+               m.s_mat_code,
+               m.s_mat_type,
+               mx.drug_id,
+               mx.mat_id,
+               NOW(),
+               #{createUser},
+               #{createUserName}
+        FROM t_material mx
+                 LEFT JOIN b_standard_mat m ON m.s_mat_name = substring_index(substring_index(substring_index(substring_index(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(REPLACE(mx.mat_name,'【配送】',''),'5',''),'1',''),'*',''),'d',''),'K',''),'G',''),'P',''),'Z',''),'配方颗粒',''),'颗粒',''),'(',1),'(',1),'[',1),'&lt;',1)
+                 LEFT JOIN t_standard_material_mapping p ON p.mat_id = mx.mat_id
+        WHERE mx.is_del = '0' and mx.drug_id = #{drugId} AND p.mat_id IS NULL AND m.s_id IS NOT NULL
+
+    </insert>
 
 </mapper>

+ 12 - 1
cbkj_web_parameter/src/main/resources/mappers/sysMappers/AdminInfoMapper.xml

@@ -31,6 +31,7 @@
         <result column="qualifier_pic_path" jdbcType="VARCHAR" property="qualifierPicPath"/>
         <result column="update_user" jdbcType="VARCHAR" property="updateUser"/>
         <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+        <result column="professional_pic_path" jdbcType="TIMESTAMP" property="professionalPicPath"/>
     </resultMap>
 
     <resultMap id="lazyLoadRoles" type="com.jiuzhekan.cbkj.beans.sysBeans.AdminInfo" extends="BaseResultMap">
@@ -46,7 +47,7 @@
 
     <sql id="Base_Column_List">
         user_id,user_name,password,sex,status,create_date,CREATE_USER,last_ip,phone,address,name_zh,user_heand,email,APP_ID,INS_CODE,dept_id,dept_name,EXPIRE_DATE,create_user_name,is_qualifier,dept_id_his,dept_name_his,qualifier_pic_path,personal_share,
-update_user,update_time,professional
+update_user,update_time,professional,professional_pic_path
     </sql>
 
     <select id="selectAdminRoleById" parameterType="java.lang.String" resultMap="lazyLoadRoles">
@@ -138,6 +139,9 @@ update_user,update_time,professional
         <if test="qualifierPicPath != null">
             ,qualifier_pic_path
         </if>
+        <if test="professionalPicPath != null">
+            ,professional_pic_path
+        </if>
         )
         select #{userId,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
         #{sex,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},now(),
@@ -171,6 +175,9 @@ update_user,update_time,professional
         <if test="qualifierPicPath != null">
             ,#{qualifierPicPath}
         </if>
+        <if test="professionalPicPath != null">
+            ,#{professionalPicPath}
+        </if>
         FROM DUAL ;
     </insert>
     <!--上述sql删除了 WHERE NOT EXISTS(SELECT name FROM sys_admin_info WHERE name = #{name,jdbcType=VARCHAR} ) -->
@@ -361,6 +368,9 @@ update_user,update_time,professional
             <if test="professional != null">
                 professional = #{professional,jdbcType=VARCHAR},
             </if>
+            <if test="professionalPicPath != null">
+                professional_pic_path = #{professionalPicPath,jdbcType=VARCHAR},
+            </if>
 
 
 
@@ -433,6 +443,7 @@ update_user,update_time,professional
         a.password,
         a.sex,
         a.status,
+        a.professional_pic_path,
         DATE_FORMAT(
         a.create_date,
         '%Y-%m-%d %H:%i:%s'