Sfoglia il codice sorgente

'药品接收入库修复'

yaodeguang 1 settimana fa
parent
commit
dbfd1177cc

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

@@ -61,28 +61,28 @@ public class YfWarehouseController {
             ypOutDetl.setConfirmFlag("1");
             int total = ypOutDetlService.countYpOutDetl(ypOutDetl);
             List<YpOutDetl> list = ypOutDetlService.queryYpOutDetlPage(ypOutDetl);
-            for (int i = 0; i < list.size(); i++) {
-                YpOutDetl y = list.get(i);
-                if (i > 0) {
-                    y.setDrawerName(list.get(i - 1).getDrawerName());
-                    y.setKeeperName(list.get(i - 1).getKeeperName());
-                    y.setGroupName(list.get(i - 1).getGroupName());
-                    y.setGroupNamePharmacy(list.get(i - 1).getGroupNamePharmacy());
-                } else {
-                    if (StringUtils.isNotBlank(y.getDrawer())) {
-                        y.setDrawerName(employeeService.queryByUserCode(y.getDrawer()).getEmployeeName());
-                    }
-                    if (StringUtils.isNotBlank(y.getKeeper())) {
-                        y.setKeeperName(employeeService.queryByUserCode(y.getKeeper()).getEmployeeName());
-                    }
-                    if (StringUtils.isNotBlank(y.getGroupNo())) {
-                        y.setGroupName(ypZdGroupNameService.queryByGroupNo(y.getGroupNo()).getGroupName());
-                    }
-                    if (StringUtils.isNotBlank(y.getGroupNoOut())) {
-                        y.setGroupNamePharmacy(ypZdGroupNameService.queryByGroupNo(y.getGroupNoOut()).getGroupName());
-                    }
-                }
-            }
+//            for (int i = 0; i < list.size(); i++) {
+//                YpOutDetl y = list.get(i);
+//                if (i > 0) {
+//                    y.setDrawerName(list.get(i - 1).getDrawerName());
+//                    y.setKeeperName(list.get(i - 1).getKeeperName());
+//                    y.setGroupName(list.get(i - 1).getGroupName());
+//                    y.setGroupNamePharmacy(list.get(i - 1).getGroupNamePharmacy());
+//                } else {
+//                    if (StringUtils.isNotBlank(y.getDrawer())) {
+//                        y.setDrawerName(employeeService.queryByUserCode(y.getDrawer()).getEmployeeName());
+//                    }
+//                    if (StringUtils.isNotBlank(y.getKeeper())) {
+//                        y.setKeeperName(employeeService.queryByUserCode(y.getKeeper()).getEmployeeName());
+//                    }
+//                    if (StringUtils.isNotBlank(y.getGroupNo())) {
+//                        y.setGroupName(ypZdGroupNameService.queryByGroupNo(y.getGroupNo()).getGroupName());
+//                    }
+//                    if (StringUtils.isNotBlank(y.getGroupNoOut())) {
+//                        y.setGroupNamePharmacy(ypZdGroupNameService.queryByGroupNo(y.getGroupNoOut()).getGroupName());
+//                    }
+//                }
+//            }
             resultMap.put("code", 0);
             resultMap.put("message", "查询入库单记录成功");
             resultMap.put("total", total);

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

@@ -25,7 +25,11 @@ public interface YpOutDetlMapper {
      */
     @Select("<script>" +
             "select top ${pageSize} * " +
-            "  from (select ROW_NUMBER() OVER (ORDER BY out_date DESC)AS RowNumber," +
+            "from (select ROW_NUMBER() OVER (ORDER BY out_date DESC)AS RowNumber," +
+            "(SELECT RTRIM(name) FROM a_employee_mi WITH(NOLOCK) WHERE code = MAX(a.drawer)) AS drawerName," +
+            "(SELECT RTRIM(name) FROM a_employee_mi WITH(NOLOCK) WHERE code = a.keeper) AS keeperName," +
+            "(SELECT RTRIM(group_name) FROM yp_zd_group_name WITH(NOLOCK) WHERE group_no = a.group_no) AS groupName," +
+            "(SELECT RTRIM(group_name) FROM yp_zd_group_name WITH(NOLOCK) WHERE group_no = a.group_no_out) AS groupNamePharmacy," +
             "  out_date=a.out_date," +
             "  draw_no=a.draw_no," +
             "  draw_yf=max(a.draw_yf)," +