Selaa lähdekoodia

Merge branch 'dev-1.1.4' into 'dev-1.1.4'

药品接收入库问题修复

See merge request hurugang/thmz_system!14
huangshuhua 2 vuotta sitten
vanhempi
commit
04b4e9684b

+ 3 - 1
src/main/java/cn/hnthyy/thmz/controller/yf/YfWarehouseController.java

@@ -103,7 +103,7 @@ public class YfWarehouseController {
      */
     @UserLoginToken
     @RequestMapping(value = "/getYpOutDetlDetail",method = {RequestMethod.GET})
-    public Map<String,Object> getYpOutDetlDetail(@RequestParam("drawNo") String drawNo){
+    public Map<String,Object> getYpOutDetlDetail(@RequestParam("drawNo") String drawNo, @RequestParam("groupNo") String groupNo){
         Map<String, Object> resultMap = new HashMap<>();
         try {
             if (StringUtils.isBlank(drawNo)) {
@@ -113,6 +113,8 @@ public class YfWarehouseController {
             }
             YpOutDetl ypOutDetl = new YpOutDetl();
             ypOutDetl.setDrawNo(drawNo);
+            // 药品接收入库(菜单)时入库房的药品来自是哪个药房
+            ypOutDetl.setGroupNoOut(groupNo);
             List<YpOutDetlVo> list = ypOutDetlService.queryYpOutDetlDetail(ypOutDetl);
             list.forEach(y ->{
                 YpZdDict ypZdDict = ypZdDictService.queryYpZdDictByCodeAndSerial(y.getChargeCode(), y.getSerial());

+ 5 - 2
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpOutDetlMapper.java

@@ -128,6 +128,9 @@ public interface YpOutDetlMapper {
             "   <if test=\"drawYf != null and drawYf != ''\">" +
             "        AND draw_yf = #{drawYf}" +
             "   </if>" +
+            "   <if test=\"groupNoOut != null and groupNoOut != ''\">" +
+            "        AND group_no_out = #{groupNoOut}" +
+            "   </if>" +
             "   <if test=\"outSeri != null and outSeri != ''\">" +
             "        AND out_seri = #{outSeri}" +
             "   </if>" +
@@ -299,8 +302,8 @@ public interface YpOutDetlMapper {
      * @param drawNo 出库单
      * @return
      */
-    @Select("select top 1 accept_sign from yp_out_detl WITH(NOLOCK) where draw_no =#{drawNo}")
-    int selectAcceptSign(@Param("drawNo") String drawNo);
+    @Select("select count(1) as acceptSign from yp_out_detl WITH(NOLOCK) where draw_no = #{drawNo} and group_no_out = #{groupNoOut} and accept_sign = '1' ")
+    int selectAcceptSign(@Param("drawNo") String drawNo, @Param("groupNoOut") String groupNoOut);
 
     /**
      * 查询出库单对应的请领单

+ 2 - 2
src/main/java/cn/hnthyy/thmz/service/impl/his/yp/YpBaseYfServiceImpl.java

@@ -78,8 +78,8 @@ public class YpBaseYfServiceImpl implements YpBaseYfService {
     @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
     @Override
     public int saveYpBaseYf(List<YpOutDetlVo> ypOutDetlVos, User user) throws MzException {
-        int acceptSign = ypOutDetlMapper.selectAcceptSign(ypOutDetlVos.get(0).getDrawNo());
-        if(acceptSign == 1){
+        int acceptSign = ypOutDetlMapper.selectAcceptSign(ypOutDetlVos.get(0).getDrawNo(), ypOutDetlVos.get(0).getGroupNoOut());
+        if(acceptSign >= 1){
             throw new MzException("重复入库!");
         }
         int num = 0;

+ 1 - 1
src/main/resources/static/js/yf/pharmacy_warehouse.js

@@ -250,7 +250,7 @@ function resetSearch() {
     $("#outTypeSearch").val(null);
     $("#outTypeSearch").selectpicker('refresh');
     $("#drawNoSearch").val(null);
-    $('#reportrange span').html(new Date.format('YYYY-MM-DD') + ' - ' + new Date.format('YYYY-MM-DD'));
+    $('#reportrange span').html(format(new Date(), 'yyyy-MM-dd') + ' - ' + format(new Date(), 'yyyy-MM-dd'));
 }