瀏覽代碼

优化代码

DESKTOP-0GD05B0\Administrator 2 年之前
父節點
當前提交
e00c304b5d

+ 8 - 3
src/main/java/thyyxxk/webserver/aop/aspect/NoDeedRule.java

@@ -5,7 +5,7 @@ import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.annotation.Before;
 import org.aspectj.lang.annotation.Pointcut;
 import org.springframework.stereotype.Component;
-import thyyxxk.webserver.aop.interfaces.NoNeedRule;
+import thyyxxk.webserver.aop.interfaces.NeedRule;
 import thyyxxk.webserver.config.exception.BizException;
 import thyyxxk.webserver.config.exception.ExceptionEnum;
 import thyyxxk.webserver.service.PublicServer;
@@ -25,12 +25,17 @@ public class NoDeedRule {
         this.publicServer = publicServer;
     }
 
-    @Pointcut("@annotation(thyyxxk.webserver.aop.interfaces.NoNeedRule)")
+    @Pointcut("@annotation(thyyxxk.webserver.aop.interfaces.NeedRule)")
     public void noDeedRule() {
     }
 
+    /**
+     * 如果这里不这样写就无法获取 注解里面的值
+     *
+     * @param noNeedRule
+     */
     @Before("noDeedRule() && @annotation(noNeedRule)")
-    public void before(NoNeedRule noNeedRule) {
+    public void before(NeedRule noNeedRule) {
         if (publicServer.needRule(noNeedRule.value())) {
             return;
         }

+ 1 - 1
src/main/java/thyyxxk/webserver/aop/interfaces/NoNeedRule.java → src/main/java/thyyxxk/webserver/aop/interfaces/NeedRule.java

@@ -11,6 +11,6 @@ import java.lang.annotation.Target;
  */
 @Target({ElementType.METHOD, ElementType.TYPE})
 @Retention(RetentionPolicy.RUNTIME)
-public @interface NoNeedRule {
+public @interface NeedRule {
     int[] value() default {};
 }

+ 0 - 8
src/main/java/thyyxxk/webserver/controller/inpatient/XiangMuLuRuController.java

@@ -118,14 +118,6 @@ public class XiangMuLuRuController {
         return service.getBingQuDuiYingKeShi(ward);
     }
 
-    @GetMapping("/cheXiaoTuiFei")
-    public ResultVo<String> cheXiaoTuiFei(@RequestParam("inpatientNo") String inpatientNo,
-                                          @RequestParam("admissTimes") Integer admissTimes,
-                                          @RequestParam("ledger") Integer ledger,
-                                          @RequestParam("detailSn") Integer detailSn) {
-        return service.cheXiaoTuiFei(inpatientNo, admissTimes, ledger, detailSn);
-    }
-
     @PassToken
     @GetMapping("/weiGuiFeiYongFenXi")
     public ResultVo<ZyActpatient> weiGuiFeiYongFenXi(@RequestParam("inpatientNo") String inpatientNo,

+ 11 - 13
src/main/java/thyyxxk/webserver/dao/his/PublicDao.java

@@ -46,30 +46,18 @@ public interface PublicDao {
     @Select("select pattern_code from yz_sequence WITH (TABLOCKX) ")
     Integer getPatternCode();
 
-    /**
-     * @param patternCode 返回新的模板编码
-     */
     @Update("update yz_sequence set pattern_code = #{newId} where pattern_code = #{oldId} ")
     int updatePatternCode(Integer newId, Integer oldId);
 
     @Select("select cast(p_act_order_no as decimal(9)) from yz_sequence WITH (TABLOCKX)")
     BigDecimal getPatternOrderCode();
 
-    /**
-     * @param pActOrderNo 返回新的模板编码
-     */
     @Update("update yz_sequence set p_act_order_no = #{newId} where p_act_order_no = #{oldId} ")
     int updatePatternOrderCode(BigDecimal newId, BigDecimal oldId);
 
-    /**
-     * 插入新的医嘱
-     *
-     * @param actOrderNo 医嘱号
-     */
     @Update("update yz_sequence set act_order_no = #{newOrderNo} where act_order_no = #{oldOrderNo} ")
     int updateActOrderNo(BigDecimal newOrderNo, BigDecimal oldOrderNo);
 
-
     @Select("select req_no from ysh_config WITH (TABLOCKX) ")
     Integer getReqNo();
 
@@ -91,7 +79,17 @@ public interface PublicDao {
     @Select("select code,case when parent_code = code then null else parent_code end as parent_code from zd_unit_code where (parent_code = #{deptCode} or code = #{deptCode}) and isnull(del_flag,0) = 0")
     List<GetDropdownBox> getKeShiLieBiao(String deptCode);
 
-    @Select("<script>" + "select code from zd_unit_code where (parent_code in " + "<foreach collection='deptCodeList' item='item' index='index' open='(' close=')' separator=','>" + " #{item,jdbcType = CHAR}" + "</foreach> " + "or code in " + "<foreach collection='deptCodeList' item='item' index='index' open='(' close=')' separator=','>" + "#{item,jdbcType = CHAR}" + "</foreach>" + ") and isnull(del_flag,0) = 0" + "</script>")
+    @Select("<script>" +
+            "select code from zd_unit_code where (parent_code in " +
+            "<foreach collection='deptCodeList' item='item' index='index' open='(' close=')' separator=','>" +
+            " #{item,jdbcType = CHAR}" +
+            "</foreach> " +
+            "or code in " +
+            "<foreach collection='deptCodeList' item='item' index='index' open='(' close=')' separator=','>" +
+            "#{item,jdbcType = CHAR}" +
+            "</foreach>" +
+            ") and isnull(del_flag,0) = 0" +
+            "</script>")
     List<String> getKeShiLieBiaoList(@Param("deptCodeList") List<String> deptCodeList);
 
     /**

+ 0 - 27
src/main/java/thyyxxk/webserver/dao/his/inpatient/XiangMuLuRuDao.java

@@ -851,31 +851,6 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
             "</script>")
     List<String> chaXunFeiYongShiFouTingYong(List<String> bianMa);
 
-
-    @Select("<script>" +
-            "select charge_code from yp_base_yf where stock_amount &lt;= 0 and serial = '01' and charge_code in " +
-            "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
-            " #{item}" +
-            "</foreach> " +
-            "</script>")
-    List<String> kuCun(List<String> bianMa);
-
-
-    @Delete("delete zy_detail_charge where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledger} " +
-            "and detail_sn = #{detailSn} and order_no <> 6 and trans_flag_yb <> 2")
-    void cheXiaoFeiYong(@Param("inpatientNo") String inpatientNo,
-                        @Param("admissTimes") Integer admissTimes,
-                        @Param("ledger") Integer ledger,
-                        @Param("detailSn") Integer detailSn);
-
-    @Update("update zy_detail_charge set ori_detail_sn = null where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledger} " +
-            "and detail_sn = #{detailSn} and order_no <> 6 and trans_flag_yb <> 2")
-    void cheXiaoHouHuanYuanZhenShuJu(@Param("inpatientNo") String inpatientNo,
-                                     @Param("admissTimes") Integer admissTimes,
-                                     @Param("ledger") Integer ledger,
-                                     @Param("detailSn") Integer detailSn);
-
-
     @Select("select act_order_no as order_no,exec_unit from yz_erase_order where act_order_no in  " +
             "(select order_no from zy_detail_charge where  inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledger}   " +
             "and exec_unit is null AND charge_fee < 0 and ori_detail_sn is null)")
@@ -894,7 +869,6 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
                                         @Param("ledger") Integer ledger,
                                         @Param("list") List<ZyDetailCharge> genXingDeZhiXinKeShi);
 
-
     @Select("select b.code from zy_detail_charge a, yp_zd_dict b " +
             "where order_no <> 6 and trans_flag_yb not in (1,2)  and charge_code like 'BILL%' " +
             "  and  isnull(b.national_code,'') = '' and inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledger} " +
@@ -1140,7 +1114,6 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
     void xiuGaiZiFeiZhiYiBaoBiaoZhi(@Param(Constants.WRAPPER) Wrapper<?> wq);
 
 
-
     @Update("update yz_yp_zy_order set status_flag = '2' " +
             "where inpatient_no = #{patNo} " +
             "and admiss_times = #{times} " +

+ 2 - 1
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/EmrPatientDao.java

@@ -266,6 +266,7 @@ public interface EmrPatientDao {
             "       table_name, " +
             "       count " +
             "from medical_history_prompts a " +
-            "         left join hot_search_sorting b on (a.query_key = b.code and b.table_name = 'medical_history_prompts') ${ew.customSqlSegment} ")
+            "         left join hot_search_sorting b on (a.query_key = b.code and b.table_name = 'medical_history_prompts' and a.creator_id = b.user_code) " +
+            " ${ew.customSqlSegment} ")
     List<MedicalHistoryPrompts> getEmrTipsData(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
 }

+ 1 - 1
src/main/java/thyyxxk/webserver/service/PublicServer.java

@@ -125,7 +125,7 @@ public class PublicServer {
 
     /**
      * @param jueSeBianMa 不需要限制的角色id
-     * @return Boolean
+     * @return Boolean 如果有就返回true
      */
     public Boolean needRule(int... jueSeBianMa) {
         return !getaBoolean(jueSeBianMa, getRoleCode().getData());

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

@@ -681,28 +681,6 @@ public class XiangMuLuRuService {
         return ResultVoUtil.success(dao.getBingQuDuiYingKeShi(ward));
     }
 
-    @Transactional(rollbackFor = Exception.class)
-    public ResultVo<String> cheXiaoTuiFei(String inpatientNo, Integer admissTimes, Integer ledger, Integer detailSn) {
-        if (StringUtil.isBlank(inpatientNo) || admissTimes == null || ledger == null || detailSn == null) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "患者信息不全。");
-        }
-        inpatientNo = publicServer.getInpatientNo(inpatientNo);
-        ZyDetailCharge zyDetailCharge = dao.beiTuiFeiYongXinXi(inpatientNo, admissTimes, ledger, detailSn);
-        if (zyDetailCharge == null) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "未查询到对应信息,可能该费用可能已经被撤销了或被正负相抵了。");
-        }
-        if (!"0".equals(zyDetailCharge.getTransFlagYb())) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "费用已经被上传了,无法撤销。");
-        }
-        if (zyDetailCharge.getOriDetailSn() != null && zyDetailCharge.getOriDetailSn() == -1) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "被退数据无法删除。");
-        }
-        dao.cheXiaoFeiYong(inpatientNo, admissTimes, ledger, detailSn);
-        dao.cheXiaoHouHuanYuanZhenShuJu(inpatientNo, admissTimes, ledger, zyDetailCharge.getOriDetailSn());
-        log.info("撤销退费 ==> 操作人:{},住院号:{},住院次数:{},账页号:{},流水号:{},原流水号:{}", TokenUtil.getTokenUserId(), inpatientNo, admissTimes, ledger, detailSn, zyDetailCharge.getOriDetailSn());
-        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "撤销成功,请刷新数据。");
-    }
-
     @Transactional(rollbackFor = Exception.class)
     public ResultVo<ZyActpatient> weiGuiFeiYongFenXi(String inpatientNo, String execUnit) {
         ZyActpatient patient = publicServer.huoQuHuanZheXinXi(inpatientNo);
@@ -919,17 +897,39 @@ public class XiangMuLuRuService {
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "药单生成成功。", pageNo);
     }
 
+    /**
+     * 生成药品单
+     *
+     * @param startDate 开始时间
+     * @param endDate   结束
+     * @param groupNo   药房
+     * @param pageNo    药单号
+     * @param dept      科室
+     */
     @Transactional(rollbackFor = Exception.class)
     public void generateMedicationListFunc(String startDate, String endDate, String groupNo, Integer pageNo, String dept) {
         dao.drugReturnForm(pageNo, dept, TokenUtil.getTokenUserId(), groupNo);
         dao.generateMedicationList(startDate, endDate, dept, groupNo, pageNo);
     }
 
+    /**
+     * 获取指定的药单号
+     *
+     * @param startDate 时间
+     * @param endDate   时间
+     * @return 药单
+     */
     public ResultVo<List<DrugReturnForm>> getPrescription(String startDate, String endDate) {
         UserInfo us = redisLikeService.getUserInfoByToken();
         return ResultVoUtil.success(dao.getPrescription(startDate, endDate, us.getDeptCode()));
     }
 
+    /**
+     * 根据药单号获取明细
+     *
+     * @param pageNo
+     * @return
+     */
     public ResultVo<List<DrugReturnForm>> getAPrescriptionByPageNo(Integer pageNo) {
         return ResultVoUtil.success(groupingValues(dao.getAPrescriptionByPageNo(pageNo)));
     }

+ 0 - 4
src/main/java/thyyxxk/webserver/utils/PingYinUtils.java

@@ -206,10 +206,6 @@ public class PingYinUtils {
         return py.length() > maxLength ? py.substring(0, maxLength) : py;
     }
 
-    public static void main(String[] args) {
-        System.out.println(pyShouZiMuDaXie("测试用的暗示的话就爱上", 4));
-    }
-
     public static String getWBCode(String str) {
         StringBuilder result = new StringBuilder();
         //用char循环取得每一个String的 字符