Browse Source

Accept Merge Request #25: (develop-wxl -> master)

Merge Request: 合并

Created By: @万新亮
Accepted By: @万新亮
URL: https://chuanghaikeji.coding.net/p/smarCampus/d/iHotel_student_houtai/git/merge/25
万新亮 1 year ago
parent
commit
6cab09005a

+ 2 - 2
src/main/java/com/template/api/HouseOrderAPI.java

@@ -34,7 +34,7 @@ public interface HouseOrderAPI {
 
 
     @GetMapping("/pageList")
     @GetMapping("/pageList")
     @ApiOperation(value = "订单管理-订单页面展示", notes = "订单管理-订单页面展示", httpMethod = "GET")
     @ApiOperation(value = "订单管理-订单页面展示", notes = "订单管理-订单页面展示", httpMethod = "GET")
-    CommonResult pageList(int adminId, int page, int size, String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime,String houseId,Integer keyType,Integer giveBack,Integer buildingId);
+    CommonResult pageList(int adminId, int page, int size, String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime,String houseId,Integer keyType,Integer giveBack,Integer buildingId,Integer orgId);
 
 
     @PostMapping("/cancel")
     @PostMapping("/cancel")
     @ApiOperation(value = "订单管理-订单取消", notes = "订单管理-订单取消", httpMethod = "POST")
     @ApiOperation(value = "订单管理-订单取消", notes = "订单管理-订单取消", httpMethod = "POST")
@@ -58,7 +58,7 @@ public interface HouseOrderAPI {
 
 
     @GetMapping("/queryExport")
     @GetMapping("/queryExport")
     @ApiOperation(value = "订单管理-订单导出", notes = "订单管理-订单导出", httpMethod = "GET")
     @ApiOperation(value = "订单管理-订单导出", notes = "订单管理-订单导出", httpMethod = "GET")
-    void queryExport(HttpServletResponse response, int adminId, String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime,String houseId,Integer keyType,Integer giveBack,Integer buildingId);
+    void queryExport(HttpServletResponse response, int adminId, String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime,String houseId,Integer keyType,Integer giveBack,Integer buildingId,Integer orgId);
 
 
     @GetMapping("/reportStatistics")
     @GetMapping("/reportStatistics")
     @ApiOperation(value = "统计报表", notes = "统计报表", httpMethod = "GET")
     @ApiOperation(value = "统计报表", notes = "统计报表", httpMethod = "GET")

+ 19 - 11
src/main/java/com/template/common/utils/TimeExchange.java

@@ -398,8 +398,9 @@ public class TimeExchange {
      *
      *
      * @return 返回的数据中第一个是开始时间 第二个是结束时间
      * @return 返回的数据中第一个是开始时间 第二个是结束时间
      */
      */
-    public static String[] getCurrentWeekTimeFrame() {
+    public static String[] getCurrentWeekTimeFrame(String strDate) {
         Calendar calendar = Calendar.getInstance();
         Calendar calendar = Calendar.getInstance();
+        calendar.setTime(TimeExchange.StringToDate(strDate,"yyyy-MM-dd"));
         calendar.setTimeZone(TimeZone.getTimeZone("GMT+8"));
         calendar.setTimeZone(TimeZone.getTimeZone("GMT+8"));
         //start of the week
         //start of the week
         if (calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
         if (calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
@@ -544,6 +545,7 @@ public class TimeExchange {
         calendar.set(year, month, day, 23, 59, 59);
         calendar.set(year, month, day, 23, 59, 59);
         return calendar.getTime();
         return calendar.getTime();
     }
     }
+
     //endregion
     //endregion
 
 
 //    public static List<UnitTimeHelpModel> MonthArrayTime(Date StartDate, Date EndDate) {
 //    public static List<UnitTimeHelpModel> MonthArrayTime(Date StartDate, Date EndDate) {
@@ -665,17 +667,23 @@ public class TimeExchange {
     }
     }
 
 
     public static void main(String[] args) throws ParseException {
     public static void main(String[] args) throws ParseException {
-        Date date = new Date();
-        // 注意format的格式要与日期String的格式相匹配
-        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");
-        try {
-            date = dateFormat.parse("2024-08-08T10:09:48+08:00");
-        } catch (Exception e) {
-            e.printStackTrace();
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(StringToDate("2024-07-29","yyyy-MM-dd"));
+        int year = calendar.get(Calendar.YEAR);
+        int week = calendar.get(Calendar.WEEK_OF_YEAR);
+        int day = calendar.get(Calendar.DAY_OF_WEEK)-1;
+        if (day==0){
+            week=week-1;
         }
         }
-        DateFormat dateFormat2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        String dateStr = dateFormat2.format(date);
-        System.out.println(dateStr);
+        Calendar calendar1 = Calendar.getInstance();
+        calendar1.setTime(StringToDate("2024-08-04","yyyy-MM-dd"));
+        int year1 = calendar1.get(Calendar.YEAR);
+        int week1 = calendar1.get(Calendar.WEEK_OF_YEAR);
+        int day1 = calendar1.get(Calendar.DAY_OF_WEEK)-1;
+        if (day1==0){
+            week1=week1-1;
+        }
+        System.out.println(day1);
 
 
     }
     }
 }
 }

+ 13 - 6
src/main/java/com/template/controller/AdminController.java

@@ -19,15 +19,14 @@ import com.template.model.pojo.Users;
 import com.template.model.result.CommonResult;
 import com.template.model.result.CommonResult;
 import com.template.model.vo.AdminVo;
 import com.template.model.vo.AdminVo;
 import com.template.model.vo.UsersVo;
 import com.template.model.vo.UsersVo;
-import com.template.services.AdminMenuService;
-import com.template.services.AdminService;
-import com.template.services.PermissionSettingService;
-import com.template.services.UsersService;
+import com.template.services.*;
+import com.template.model.pojo.Organization;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -56,6 +55,9 @@ public class AdminController implements AdminAPI {
     @Autowired
     @Autowired
     MySecurity mySecurity;
     MySecurity mySecurity;
 
 
+    @Autowired
+    OrganizationService organizationService;
+
     @Override
     @Override
     public CommonResult getListPage(int permissionSettingId, int page, int size, String keyWord, String startTime, String endTime, String status) {
     public CommonResult getListPage(int permissionSettingId, int page, int size, String keyWord, String startTime, String endTime, String status) {
         PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
         PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
@@ -99,9 +101,14 @@ public class AdminController implements AdminAPI {
             if (ObjectUtils.isNotEmpty(byId)) {
             if (ObjectUtils.isNotEmpty(byId)) {
                 adminVo.setCardNumber(byId.getCardNumber());
                 adminVo.setCardNumber(byId.getCardNumber());
             }
             }
+            List<Organization> checkOrgList= new ArrayList<>();
             if (ObjectUtils.isNotEmpty(record.getCheckOrg())) {
             if (ObjectUtils.isNotEmpty(record.getCheckOrg())) {
-                List<String> checkOrg= JSONArray.parseArray(record.getCheckOrg(),String.class);
-                adminVo.setCheckOrg(checkOrg);
+                List<String> checkOrg= Arrays.asList(record.getCheckOrg().split(","));
+                for(int i=0;i<checkOrg.size();i++){
+                    Organization organization=organizationService.getById(checkOrg.get(i));
+                    checkOrgList.add(organization);
+                }
+                adminVo.setCheckOrg(checkOrgList);
             }
             }
 
 
 //            解密
 //            解密

+ 75 - 13
src/main/java/com/template/controller/ApplicationProcedureTemporaryController.java

@@ -9,25 +9,22 @@ import com.template.common.utils.TimeExchange;
 import com.template.model.dto.AppletApprovalProcessDto;
 import com.template.model.dto.AppletApprovalProcessDto;
 import com.template.model.dto.ApplicationProcedureTemporaryDto;
 import com.template.model.dto.ApplicationProcedureTemporaryDto;
 import com.template.model.dto.ApprovalProcessDto;
 import com.template.model.dto.ApprovalProcessDto;
-import com.template.model.pojo.AdminMenu;
-import com.template.model.pojo.ApplicationProcedureSetting;
-import com.template.model.pojo.ApplicationProcedureTemporary;
-import com.template.model.pojo.PermissionSetting;
+import com.template.model.pojo.*;
 import com.template.model.result.CommonResult;
 import com.template.model.result.CommonResult;
 import com.template.model.result.PageUtils;
 import com.template.model.result.PageUtils;
 import com.template.model.vo.ApplicationProcedureTemporaryVo;
 import com.template.model.vo.ApplicationProcedureTemporaryVo;
-import com.template.services.AdminMenuService;
-import com.template.services.ApplicationProcedureSettingService;
-import com.template.services.ApplicationProcedureTemporaryService;
-import com.template.services.PermissionSettingService;
+import com.template.services.*;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
 import java.text.ParseException;
 import java.text.ParseException;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeFormatter;
+import java.util.Calendar;
 import java.util.List;
 import java.util.List;
+import java.util.stream.Collectors;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -52,25 +49,52 @@ public class ApplicationProcedureTemporaryController implements ApplicationProce
     @Autowired
     @Autowired
     AdminMenuService adminMenuService;
     AdminMenuService adminMenuService;
 
 
+    @Autowired
+    AdminService adminService;
+
+    @Autowired
+    UsersService usersService;
+
     @Override
     @Override
     public CommonResult save(ApplicationProcedureTemporaryDto applicationProcedureDto) {
     public CommonResult save(ApplicationProcedureTemporaryDto applicationProcedureDto) {
         if (ObjectUtils.isEmpty(applicationProcedureDto)) {
         if (ObjectUtils.isEmpty(applicationProcedureDto)) {
             return CommonResult.fail();
             return CommonResult.fail();
         }
         }
+        //一周可定天数可优化为前台配置
+        int countConfig=2;
         Integer usersId = applicationProcedureDto.getUsersId();
         Integer usersId = applicationProcedureDto.getUsersId();
 //        一个人只能有一个待审批的
 //        一个人只能有一个待审批的
         List<ApplicationProcedureTemporary> list = applicationProcedureTemporaryService.list(new QueryWrapper<ApplicationProcedureTemporary>()
         List<ApplicationProcedureTemporary> list = applicationProcedureTemporaryService.list(new QueryWrapper<ApplicationProcedureTemporary>()
                 .eq("users_id", usersId)
                 .eq("users_id", usersId)
                 .ne("status", "0"));
                 .ne("status", "0"));
+        String startDto=applicationProcedureDto.getStartTime();
+        String endDto=applicationProcedureDto.getEndTime();
+        int dtoCount=this.checkWeek(startDto,endDto);
+        if(dtoCount==-1||dtoCount>countConfig){
+            return CommonResult.fail("申请日期不能跨周,一周不能超过"+countConfig+"天,请重新申请");
+        }
+        //筛选同一周数据
+        if (!list.isEmpty()){
+            String[] arr =TimeExchange.getCurrentWeekTimeFrame(startDto);
+            list=list.stream().filter(a -> a.getStartTime().compareTo(arr[0])>=0&&a.getEndTime().compareTo(arr[1])<=0)
+                    .collect(Collectors.toList());
+        }
         if (!list.isEmpty()) {
         if (!list.isEmpty()) {
+            int aa =0;
             for (ApplicationProcedureTemporary apt : list) {
             for (ApplicationProcedureTemporary apt : list) {
-                if (apt.getEndTime().equals(applicationProcedureDto.getEndTime())
-                        || apt.getStartTime().equals(applicationProcedureDto.getStartTime())) {
-                    return CommonResult.fail("相同日期已有待审批申请");
+                if (apt.getEndTime().equals(endDto)
+                        || apt.getStartTime().equals(startDto)) {
+                    return CommonResult.fail("相同日期已有待审批申请,请勿重复申请");
                 }
                 }
+                 aa=this.checkWeek(apt.getStartTime(),apt.getEndTime())+aa;
+
+               if(countConfig-dtoCount<=aa){
+                   return CommonResult.fail("总申请天数超过本周限额");
+               }
+
                 try {
                 try {
-                    boolean a = TimeExchange.CompareDate(apt.getEndTime(), applicationProcedureDto.getStartTime(), "yyyy-MM-dd");
-                    boolean b = TimeExchange.CompareDate(applicationProcedureDto.getEndTime(), apt.getStartTime(), "yyyy-MM-dd");
+                    boolean a = TimeExchange.CompareDate(apt.getEndTime(), startDto, "yyyy-MM-dd");
+                    boolean b = TimeExchange.CompareDate(endDto, apt.getStartTime(), "yyyy-MM-dd");
                     if (!(a || b)) {
                     if (!(a || b)) {
                         return CommonResult.fail("日期范围内已有待审批申请");
                         return CommonResult.fail("日期范围内已有待审批申请");
                     }
                     }
@@ -79,6 +103,18 @@ public class ApplicationProcedureTemporaryController implements ApplicationProce
                 }
                 }
             }
             }
         }
         }
+        List<Admin> admins=adminService.list(new QueryWrapper<>());
+        String orgId=usersService.getById(usersId).getOrganId();
+        boolean flag =true;
+        for(Admin admin:admins){
+            if (StringUtils.hasText(admin.getCheckOrg())&&admin.getCheckOrg().indexOf(orgId) > 0) {
+                flag =false;
+                break;
+            }
+        }
+        if(flag){
+            return CommonResult.fail("您暂无审批人,请联系管理员添加");
+        }
         ApplicationProcedureTemporary applicationProcedure = new ApplicationProcedureTemporary();
         ApplicationProcedureTemporary applicationProcedure = new ApplicationProcedureTemporary();
 
 
         BeanUtils.copyProperties(applicationProcedureDto, applicationProcedure);
         BeanUtils.copyProperties(applicationProcedureDto, applicationProcedure);
@@ -416,6 +452,32 @@ public class ApplicationProcedureTemporaryController implements ApplicationProce
 
 
     }
     }
 
 
+    //region 获取是否跨周 且不超过两天
+    public static int checkWeek(String strDate1,String strDate2) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(TimeExchange.StringToDate(strDate1,"yyyy-MM-dd"));
+        int year = calendar.get(Calendar.YEAR);
+        int week = calendar.get(Calendar.WEEK_OF_YEAR);
+        int day = calendar.get(Calendar.DAY_OF_WEEK)-1;
+        if (day==0){
+            day=7;
+            week=week-1;
+        }
+        Calendar calendar1 = Calendar.getInstance();
+        calendar1.setTime(TimeExchange.StringToDate(strDate2,"yyyy-MM-dd"));
+        int year1 = calendar1.get(Calendar.YEAR);
+        int week1 = calendar1.get(Calendar.WEEK_OF_YEAR);
+        int day1 = calendar1.get(Calendar.DAY_OF_WEEK)-1;
+        if (day1==0){
+            day=7;
+            week1=week1-1;
+        }
+        if(year==year1&&week==week1){
+            return day1-day;
+        }else{
+            return -1;
+        }
+    }
 
 
 }
 }
 
 

+ 37 - 29
src/main/java/com/template/controller/HouseOrderController.java

@@ -614,7 +614,7 @@ public class HouseOrderController implements HouseOrderAPI {
     }
     }
 
 
     @Override
     @Override
-    public CommonResult pageList(int adminId, int page, int size, String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime, String houseId, Integer keyType, Integer giveBack, Integer buildingId) {
+    public CommonResult pageList(int adminId, int page, int size, String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime,String houseId,Integer keyType,Integer giveBack,Integer buildingId,Integer orgId) {
 //        PermissionSetting permissionSetting = permissionSettingService.getById(adminId);
 //        PermissionSetting permissionSetting = permissionSettingService.getById(adminId);
 //        if (ObjectUtils.isEmpty(permissionSetting)) {
 //        if (ObjectUtils.isEmpty(permissionSetting)) {
 //            return CommonResult.fail("非法进入");
 //            return CommonResult.fail("非法进入");
@@ -633,7 +633,7 @@ public class HouseOrderController implements HouseOrderAPI {
             size = 10;
             size = 10;
         }
         }
 
 
-        PageUtils<HouseOrderPageListVo> pageList = houseOrderService.pageList(page, size, keyWord, houseType, orderStatus, payPriceStartTime, payPriceEndTime, refundStartTime, refundEndTime, cancelStartTime, cancelEndTime, liveStartTime, liveEndTime, leaveStartTime, leaveEndTime, houseId, keyType, giveBack, buildingId);
+        PageUtils<HouseOrderPageListVo> pageList = houseOrderService.pageList(page, size, keyWord, houseType, orderStatus, payPriceStartTime, payPriceEndTime, refundStartTime, refundEndTime, cancelStartTime, cancelEndTime, liveStartTime, liveEndTime, leaveStartTime, leaveEndTime,houseId,keyType,giveBack,buildingId,orgId);
         List<HouseOrderPageListVo> list = pageList.getList();
         List<HouseOrderPageListVo> list = pageList.getList();
         for (int i = 0; i < list.size(); i++) {
         for (int i = 0; i < list.size(); i++) {
             HouseOrderPageListVo houseOrderPageListVo = list.get(i);
             HouseOrderPageListVo houseOrderPageListVo = list.get(i);
@@ -1475,7 +1475,7 @@ public class HouseOrderController implements HouseOrderAPI {
     }
     }
 
 
     @Override
     @Override
-    public void queryExport(HttpServletResponse response, int adminId, String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime, String houseId, Integer keyType, Integer giveBack, Integer buildingId) {
+    public void queryExport(HttpServletResponse response, int adminId, String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime,String houseId,Integer keyType,Integer giveBack,Integer buildingId,Integer orgId) {
 //        PermissionSetting permissionSetting = permissionSettingService.getById(adminId);
 //        PermissionSetting permissionSetting = permissionSettingService.getById(adminId);
 //        if (ObjectUtils.isEmpty(permissionSetting)) {
 //        if (ObjectUtils.isEmpty(permissionSetting)) {
 //            return CommonResult.fail("非法进入");
 //            return CommonResult.fail("非法进入");
@@ -1486,7 +1486,7 @@ public class HouseOrderController implements HouseOrderAPI {
 //            return CommonResult.fail("此账号暂无该权限");
 //            return CommonResult.fail("此账号暂无该权限");
 //        }
 //        }
 
 
-        List<QueryExportVo> vos = houseOrderService.queryExport(keyWord, houseType, orderStatus, payPriceStartTime, payPriceEndTime, refundStartTime, refundEndTime, cancelStartTime, cancelEndTime, liveStartTime, liveEndTime, leaveStartTime, leaveEndTime, houseId, keyType, giveBack, buildingId);
+        List<QueryExportVo> vos = houseOrderService.queryExport(keyWord, houseType, orderStatus, payPriceStartTime, payPriceEndTime, refundStartTime, refundEndTime, cancelStartTime, cancelEndTime, liveStartTime, liveEndTime, leaveStartTime, leaveEndTime,houseId,keyType,giveBack,buildingId,orgId);
 
 
         //        导出
         //        导出
         Workbook workbook = new XSSFWorkbook();
         Workbook workbook = new XSSFWorkbook();
@@ -1499,6 +1499,8 @@ public class HouseOrderController implements HouseOrderAPI {
         headerRow.createCell(4).setCellValue("是否归还");
         headerRow.createCell(4).setCellValue("是否归还");
         headerRow.createCell(5).setCellValue("预定人");
         headerRow.createCell(5).setCellValue("预定人");
         headerRow.createCell(6).setCellValue("手机号码");
         headerRow.createCell(6).setCellValue("手机号码");
+        headerRow.createCell(7).setCellValue("预定人部门");
+        headerRow.createCell(8).setCellValue("职工卡号");
         headerRow.createCell(7).setCellValue("入住人");
         headerRow.createCell(7).setCellValue("入住人");
         headerRow.createCell(8).setCellValue("身份证");
         headerRow.createCell(8).setCellValue("身份证");
         headerRow.createCell(9).setCellValue("订单号");
         headerRow.createCell(9).setCellValue("订单号");
@@ -1560,17 +1562,17 @@ public class HouseOrderController implements HouseOrderAPI {
                 dataRow1.createCell(4).setCellValue(back);
                 dataRow1.createCell(4).setCellValue(back);
                 dataRow1.createCell(5).setCellValue(vo.getReserveName());
                 dataRow1.createCell(5).setCellValue(vo.getReserveName());
                 dataRow1.createCell(6).setCellValue(vo.getPhone());
                 dataRow1.createCell(6).setCellValue(vo.getPhone());
-                dataRow1.createCell(7).setCellValue(vo.getLiveName());
-                dataRow1.createCell(8).setCellValue(vo.getIdCard());
-                dataRow1.createCell(9).setCellValue(vo.getOrderNumber());
-                dataRow1.createCell(10).setCellValue(vo.getLiveTime());
-                dataRow1.createCell(11).setCellValue(vo.getLeaveTime());
+                dataRow1.createCell(9).setCellValue(vo.getLiveName());
+                dataRow1.createCell(10).setCellValue(vo.getIdCard());
+                dataRow1.createCell(11).setCellValue(vo.getOrderNumber());
+                dataRow1.createCell(12).setCellValue(vo.getLiveTime());
+                dataRow1.createCell(13).setCellValue(vo.getLeaveTime());
                 BigDecimal orderPrice = vo.getOrderPrice();
                 BigDecimal orderPrice = vo.getOrderPrice();
                 String price = "";
                 String price = "";
                 if (ObjectUtils.isNotEmpty(orderPrice)) {
                 if (ObjectUtils.isNotEmpty(orderPrice)) {
                     price = orderPrice.toString();
                     price = orderPrice.toString();
                 }
                 }
-                dataRow1.createCell(12).setCellValue(price);
+                dataRow1.createCell(14).setCellValue(price);
 
 
                 //                订单 订单状态 1.待支付,2.已支付,3.待入住,4.已入住,5.待结账,6.退款中,7.已退款,8.已退房,9.已取消,超时
                 //                订单 订单状态 1.待支付,2.已支付,3.待入住,4.已入住,5.待结账,6.退款中,7.已退款,8.已退房,9.已取消,超时
                 String orderStart = vo.getOrderStart();
                 String orderStart = vo.getOrderStart();
@@ -1596,8 +1598,8 @@ public class HouseOrderController implements HouseOrderAPI {
                 } else if ("10".equals(orderStart)) {
                 } else if ("10".equals(orderStart)) {
                     orderName = "已支付未入住";
                     orderName = "已支付未入住";
                 }
                 }
-                dataRow1.createCell(13).setCellValue(orderName);
-                dataRow1.createCell(14).setCellValue(vo.getRemark());
+                dataRow1.createCell(15).setCellValue(orderName);
+                dataRow1.createCell(16).setCellValue(vo.getRemark());
 
 
                 //                pay_type 支付方式(微信支付,现金)
                 //                pay_type 支付方式(微信支付,现金)
                 String payType = vo.getPayType();
                 String payType = vo.getPayType();
@@ -1607,7 +1609,7 @@ public class HouseOrderController implements HouseOrderAPI {
                 } else if ("2".equals(payType)) {
                 } else if ("2".equals(payType)) {
                     payName = "现金";
                     payName = "现金";
                 }
                 }
-                dataRow1.createCell(15).setCellValue(payName);
+                dataRow1.createCell(17).setCellValue(payName);
                 //                order_channel 订单渠道(1:线上,2:线下)
                 //                order_channel 订单渠道(1:线上,2:线下)
                 String orderChannelType = vo.getOrderChannelType();
                 String orderChannelType = vo.getOrderChannelType();
                 String orderChannelName = "";
                 String orderChannelName = "";
@@ -1616,11 +1618,13 @@ public class HouseOrderController implements HouseOrderAPI {
                 } else if ("2".equals(orderChannelType)) {
                 } else if ("2".equals(orderChannelType)) {
                     orderChannelName = "线下";
                     orderChannelName = "线下";
                 }
                 }
-                dataRow1.createCell(16).setCellValue(orderChannelName);
+                dataRow1.createCell(18).setCellValue(orderChannelName);
 
 
-                dataRow1.createCell(17).setCellValue(vo.getPayTime());
-                dataRow1.createCell(18).setCellValue(vo.getRefundTime());
-                dataRow1.createCell(19).setCellValue(vo.getCancelTime());
+                dataRow1.createCell(19).setCellValue(vo.getPayTime());
+                dataRow1.createCell(20).setCellValue(vo.getRefundTime());
+                dataRow1.createCell(21).setCellValue(vo.getCancelTime());
+                dataRow1.createCell(7).setCellValue(vo.getOrgName());
+                dataRow1.createCell(8).setCellValue(vo.getCardNumber());
             }
             }
         }
         }
         // 将工作簿写入文件
         // 将工作簿写入文件
@@ -1693,12 +1697,14 @@ public class HouseOrderController implements HouseOrderAPI {
         headerRow.createCell(0).setCellValue("序号");
         headerRow.createCell(0).setCellValue("序号");
         headerRow.createCell(1).setCellValue("订单编号");
         headerRow.createCell(1).setCellValue("订单编号");
         headerRow.createCell(2).setCellValue("入住人");
         headerRow.createCell(2).setCellValue("入住人");
-        headerRow.createCell(3).setCellValue("房型");
-        headerRow.createCell(4).setCellValue("房号");
-        headerRow.createCell(5).setCellValue("订单金额/元");
-        headerRow.createCell(6).setCellValue("支付时间");
-        headerRow.createCell(7).setCellValue("订单状态");
-        headerRow.createCell(8).setCellValue("创建时间");
+        headerRow.createCell(3).setCellValue("部门");
+        headerRow.createCell(4).setCellValue("职工卡号");
+        headerRow.createCell(5).setCellValue("房型");
+        headerRow.createCell(6).setCellValue("房号");
+        headerRow.createCell(7).setCellValue("订单金额/元");
+        headerRow.createCell(8).setCellValue("支付时间");
+        headerRow.createCell(9).setCellValue("订单状态");
+        headerRow.createCell(10).setCellValue("创建时间");
 
 
         if (ObjectUtils.isNotEmpty(vos) && vos.size() > 0) {
         if (ObjectUtils.isNotEmpty(vos) && vos.size() > 0) {
             for (int i = 0; i < vos.size(); i++) {
             for (int i = 0; i < vos.size(); i++) {
@@ -1717,10 +1723,12 @@ public class HouseOrderController implements HouseOrderAPI {
                 } else {
                 } else {
                     type = "钟";
                     type = "钟";
                 }
                 }
-                dataRow1.createCell(3).setCellValue(roomName + "(" + type + ")");
-                dataRow1.createCell(4).setCellValue(vo.getRoomNumber());
-                dataRow1.createCell(5).setCellValue(vo.getPayPrice().doubleValue());
-                dataRow1.createCell(6).setCellValue(vo.getPayTime());
+                dataRow1.createCell(3).setCellValue(vo.getOrgName());
+                dataRow1.createCell(4).setCellValue(vo.getCardNumber());
+                dataRow1.createCell(5).setCellValue(roomName + "(" + type + ")");
+                dataRow1.createCell(6).setCellValue(vo.getRoomNumber());
+                dataRow1.createCell(7).setCellValue(vo.getPayPrice().doubleValue());
+                dataRow1.createCell(8).setCellValue(vo.getPayTime());
 //                订单状态
 //                订单状态
                 String orderStatus = vo.getOrderStatus();
                 String orderStatus = vo.getOrderStatus();
                 String orderName = "";
                 String orderName = "";
@@ -1746,8 +1754,8 @@ public class HouseOrderController implements HouseOrderAPI {
                     orderName = "已支付未入住";
                     orderName = "已支付未入住";
                 }
                 }
 
 
-                dataRow1.createCell(7).setCellValue(orderName);
-                dataRow1.createCell(8).setCellValue(vo.getCreateTime());
+                dataRow1.createCell(9).setCellValue(orderName);
+                dataRow1.createCell(10).setCellValue(vo.getCreateTime());
 
 
             }
             }
         }
         }

File diff suppressed because it is too large
+ 9 - 2
src/main/java/com/template/mapper/HouseOrderMapper.java


+ 3 - 0
src/main/java/com/template/model/dto/ApplicationProcedureTemporaryDto.java

@@ -19,4 +19,7 @@ public class ApplicationProcedureTemporaryDto {
 
 
     @ApiModelProperty(value = "申请原因")
     @ApiModelProperty(value = "申请原因")
     private String reasonApplication;
     private String reasonApplication;
+
+    @ApiModelProperty(value = "房间数量")
+    private String houseCount;
 }
 }

+ 3 - 0
src/main/java/com/template/model/pojo/ApplicationProcedureTemporary.java

@@ -43,6 +43,9 @@ public class ApplicationProcedureTemporary implements Serializable {
     @ApiModelProperty(value = "部门")
     @ApiModelProperty(value = "部门")
     private String department;
     private String department;
 
 
+    @ApiModelProperty(value = "房间数量")
+    private String houseCount;
+
     @ApiModelProperty(value = "申请原因")
     @ApiModelProperty(value = "申请原因")
     private String reasonApplication;
     private String reasonApplication;
 
 

+ 3 - 1
src/main/java/com/template/model/vo/AdminVo.java

@@ -2,10 +2,12 @@ package com.template.model.vo;
 
 
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.annotation.*;
 import com.template.model.pojo.AdminMenu;
 import com.template.model.pojo.AdminMenu;
+import com.template.model.pojo.Organization;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 
 
 @Data
 @Data
 public class AdminVo {
 public class AdminVo {
@@ -37,7 +39,7 @@ public class AdminVo {
     private String department;
     private String department;
 
 
     @ApiModelProperty(value = "审批组织部门")
     @ApiModelProperty(value = "审批组织部门")
-    private List<String> checkOrg;
+    private List<Organization> checkOrg;
 
 
     @ApiModelProperty(value = "状态 1:正常,2:冻结")
     @ApiModelProperty(value = "状态 1:正常,2:冻结")
     private String status;
     private String status;

+ 4 - 0
src/main/java/com/template/model/vo/HouseOrderPageListVo.java

@@ -24,6 +24,10 @@ public class HouseOrderPageListVo {
     private String reserveName;
     private String reserveName;
 //  预定人手机号
 //  预定人手机号
     private String phone;
     private String phone;
+    //  预定人部门
+    private String orgName;
+    //  预定人卡号
+    private String cardNumber;
 //    入住人名称
 //    入住人名称
     private String liveName;
     private String liveName;
 //   入住人身份证
 //   入住人身份证

+ 4 - 0
src/main/java/com/template/model/vo/QueryExportVo.java

@@ -25,6 +25,10 @@ public class QueryExportVo {
     private String reserveName;
     private String reserveName;
     //  预定人手机号
     //  预定人手机号
     private String phone;
     private String phone;
+    //  预定人部门
+    private String orgName;
+    //  预定人卡号
+    private String cardNumber;
     //    入住人名称
     //    入住人名称
     private String liveName;
     private String liveName;
     //   入住人身份证
     //   入住人身份证

+ 6 - 0
src/main/java/com/template/model/vo/ReportStatisticsExportVo.java

@@ -15,6 +15,12 @@ public class ReportStatisticsExportVo {
 
 
     @ApiModelProperty(value = "房间名称")
     @ApiModelProperty(value = "房间名称")
     private String roomName;
     private String roomName;
+    //  预定人部门
+    @ApiModelProperty(value = "预定人部门")
+    private String orgName;
+    //  预定人卡号
+    @ApiModelProperty(value = "预定人卡号")
+    private String cardNumber;
 
 
     @ApiModelProperty(value = "房间类型(1:全日房,2:钟点房)")
     @ApiModelProperty(value = "房间类型(1:全日房,2:钟点房)")
     private String roomType;
     private String roomType;

+ 6 - 0
src/main/java/com/template/model/vo/ReportStatisticsVo.java

@@ -33,6 +33,12 @@ public class ReportStatisticsVo {
 
 
     @ApiModelProperty(value = "预定人id")
     @ApiModelProperty(value = "预定人id")
     private String reserveUserId;
     private String reserveUserId;
+    //  预定人部门
+    @ApiModelProperty(value = "预定人部门")
+    private String orgName;
+    //  预定人卡号
+    @ApiModelProperty(value = "预定人卡号")
+    private String cardNumber;
 
 
     @ApiModelProperty(value = "入住人id")
     @ApiModelProperty(value = "入住人id")
     private String liveUsersId;
     private String liveUsersId;

+ 2 - 2
src/main/java/com/template/services/HouseOrderService.java

@@ -39,9 +39,9 @@ public interface HouseOrderService extends IService<HouseOrder> {
      */
      */
     PriceVo reservePrice(String houseId, String cardNumber, String liveTime, String leaveTime);
     PriceVo reservePrice(String houseId, String cardNumber, String liveTime, String leaveTime);
 
 
-    PageUtils<HouseOrderPageListVo> pageList(int page, int size, String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime,String houseId,Integer keyType,Integer giveBack,Integer buildingId);
+    PageUtils<HouseOrderPageListVo> pageList(int page, int size, String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime,String houseId,Integer keyType,Integer giveBack,Integer buildingId,Integer orgId);
 
 
-    List<QueryExportVo> queryExport(String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime,String houseId,Integer keyType,Integer giveBack,Integer buildingId);
+    List<QueryExportVo> queryExport(String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime,String houseId,Integer keyType,Integer giveBack,Integer buildingId,Integer orgId);
 
 
 
 
     HouseOrderCheckInShowVo getOrderNumbre(String orderNumber);
     HouseOrderCheckInShowVo getOrderNumbre(String orderNumber);

+ 4 - 4
src/main/java/com/template/services/impl/HouseOrderServiceImpl.java

@@ -369,15 +369,15 @@ public class HouseOrderServiceImpl extends ServiceImpl<HouseOrderMapper, HouseOr
     }
     }
 
 
     @Override
     @Override
-    public PageUtils<HouseOrderPageListVo> pageList(int page, int size, String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime, String houseId, Integer keyType, Integer giveBack, Integer buildingId) {
+    public PageUtils<HouseOrderPageListVo> pageList(int page, int size, String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime, String houseId, Integer keyType, Integer giveBack, Integer buildingId,Integer orgId) {
         Page<HouseOrderPageListVo> pageVo = new Page<>(page, size);
         Page<HouseOrderPageListVo> pageVo = new Page<>(page, size);
-        IPage<HouseOrderPageListVo> result = houseOrderMapper.pageList(pageVo, keyWord, houseType, orderStatus, payPriceStartTime, payPriceEndTime, refundStartTime, refundEndTime, cancelStartTime, cancelEndTime, liveStartTime, liveEndTime, leaveStartTime, leaveEndTime, houseId, keyType, giveBack, buildingId);
+        IPage<HouseOrderPageListVo> result = houseOrderMapper.pageList(pageVo, keyWord, houseType, orderStatus, payPriceStartTime, payPriceEndTime, refundStartTime, refundEndTime, cancelStartTime, cancelEndTime, liveStartTime, liveEndTime, leaveStartTime, leaveEndTime, houseId, keyType, giveBack, buildingId,orgId);
         return new PageUtils(result);
         return new PageUtils(result);
     }
     }
 
 
     @Override
     @Override
-    public List<QueryExportVo> queryExport(String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime, String houseId, Integer keyType, Integer giveBack, Integer buildingId) {
-        return houseOrderMapper.queryExport(keyWord, houseType, orderStatus, payPriceStartTime, payPriceEndTime, refundStartTime, refundEndTime, cancelStartTime, cancelEndTime, liveStartTime, liveEndTime, leaveStartTime, leaveEndTime, houseId, keyType, giveBack, buildingId);
+    public List<QueryExportVo> queryExport(String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime, String houseId, Integer keyType, Integer giveBack, Integer buildingId,Integer orgId) {
+        return houseOrderMapper.queryExport(keyWord, houseType, orderStatus, payPriceStartTime, payPriceEndTime, refundStartTime, refundEndTime, cancelStartTime, cancelEndTime, liveStartTime, liveEndTime, leaveStartTime, leaveEndTime, houseId, keyType, giveBack, buildingId,orgId);
 
 
     }
     }
 
 

+ 28 - 0
src/main/resources/mapper/template/HouseOrderMapper.xml

@@ -12,6 +12,8 @@
         ho.leave_time as LeaveTime,
         ho.leave_time as LeaveTime,
         ho.reserve_name as reserveName,
         ho.reserve_name as reserveName,
         ho.reserve_phone as phone,
         ho.reserve_phone as phone,
+        u1.card_number  as cardNumber,
+        org.name  as orgName,
         ho.live_name as liveName,
         ho.live_name as liveName,
         u.id_card as idCard,
         u.id_card as idCard,
         h.room_name as houseName,
         h.room_name as houseName,
@@ -41,6 +43,9 @@
         AND u.deleted = 0
         AND u.deleted = 0
         LEFT JOIN building b ON b.id = hn.building_id
         LEFT JOIN building b ON b.id = hn.building_id
         AND b.deleted = 0
         AND b.deleted = 0
+        LEFT JOIN users u1 ON u1.id = ho.reserve_user_id
+        AND u1.deleted = 0
+        LEFT JOIN organization org  ON org.id = u1.organ_id
         where
         where
             ho.deleted=0
             ho.deleted=0
             <if test="orderStatus != null and orderStatus != ''">
             <if test="orderStatus != null and orderStatus != ''">
@@ -84,6 +89,10 @@
                 AND h.id = #{houseId}
                 AND h.id = #{houseId}
             </if>
             </if>
 
 
+            <if test="orgId != null and orgId != ''">
+                AND org.id = #{orgId}
+            </if>
+
             <if test="keyType != null and keyType != ''">
             <if test="keyType != null and keyType != ''">
                 AND ho.key_type = #{keyType}
                 AND ho.key_type = #{keyType}
             </if>
             </if>
@@ -110,6 +119,8 @@
         ho.give_back as giveBack,
         ho.give_back as giveBack,
         ho.reserve_name as reserveName,
         ho.reserve_name as reserveName,
         ho.reserve_phone as phone,
         ho.reserve_phone as phone,
+        u1.card_number  as cardNumber,
+        org.name  as orgName,
         ho.live_name as liveName,
         ho.live_name as liveName,
         u.id_card as idCard,
         u.id_card as idCard,
         ho.order_number as orderNumber,
         ho.order_number as orderNumber,
@@ -133,6 +144,9 @@
         AND u.deleted = 0
         AND u.deleted = 0
         LEFT JOIN building b ON b.id = hn.building_id
         LEFT JOIN building b ON b.id = hn.building_id
         AND b.deleted = 0
         AND b.deleted = 0
+        LEFT JOIN users u1 ON u1.id = ho.reserve_user_id
+        AND u1.deleted = 0
+        LEFT JOIN organization org  ON org.id = u1.organ_id
         where
         where
             ho.deleted=0
             ho.deleted=0
             <if test="orderStatus != null and orderStatus != ''">
             <if test="orderStatus != null and orderStatus != ''">
@@ -143,6 +157,10 @@
                 AND h.room_type = #{houseType}
                 AND h.room_type = #{houseType}
             </if>
             </if>
 
 
+            <if test="orgId != null and orgId != ''">
+                AND org.id = #{orgId}
+            </if>
+
             <if test="keyWord != null and keyWord != ''">
             <if test="keyWord != null and keyWord != ''">
                 AND (ho.reserve_name LIKE '%' #{keyWord} '%' or ho.live_name LIKE '%' #{keyWord} '%' or  hn.room_number = #{keyWord}  )
                 AND (ho.reserve_name LIKE '%' #{keyWord} '%' or ho.live_name LIKE '%' #{keyWord} '%' or  hn.room_number = #{keyWord}  )
             </if>
             </if>
@@ -224,6 +242,8 @@
         ho.reserve_name as reserveName,
         ho.reserve_name as reserveName,
         ho.reserve_phone as reservePhone,
         ho.reserve_phone as reservePhone,
         ho.reserve_user_id as reserveUserId,
         ho.reserve_user_id as reserveUserId,
+        u1.card_number  as cardNumber,
+        org.name  as orgName,
         ho.live_users_id as liveUsersId,
         ho.live_users_id as liveUsersId,
         ho.reserve_live_time as reserveLiveTime,
         ho.reserve_live_time as reserveLiveTime,
         ho.reserve_leave_time as reserveLeaveTime,
         ho.reserve_leave_time as reserveLeaveTime,
@@ -252,6 +272,9 @@
         `house_order` ho
         `house_order` ho
         LEFT JOIN house_number hn on ho.house_number_id=hn.id
         LEFT JOIN house_number hn on ho.house_number_id=hn.id
         LEFT JOIN house h on ho.house_id=h.id
         LEFT JOIN house h on ho.house_id=h.id
+        LEFT JOIN users u1 ON u1.id = ho.reserve_user_id
+        AND u1.deleted = 0
+        LEFT JOIN organization org  ON org.id = u1.organ_id
         WHERE ho.deleted=0
         WHERE ho.deleted=0
         and FIND_IN_SET(ho.order_status,#{s})
         and FIND_IN_SET(ho.order_status,#{s})
         <if test="startTime != null and startTime != '' and endTime != null and endTime != ''  ">
         <if test="startTime != null and startTime != '' and endTime != null and endTime != ''  ">
@@ -268,6 +291,8 @@
         SELECT
         SELECT
         ho.order_number as orderNumber,
         ho.order_number as orderNumber,
         ho.reserve_name as liveName,
         ho.reserve_name as liveName,
+        u1.card_number  as cardNumber,
+        org.name  as orgName,
         h.room_name as roomName,
         h.room_name as roomName,
         h.room_type AS roomType,
         h.room_type AS roomType,
         hn.room_number AS roomNumber,
         hn.room_number AS roomNumber,
@@ -279,6 +304,9 @@
         `house_order` ho
         `house_order` ho
         LEFT JOIN house_number hn on ho.house_number_id=hn.id
         LEFT JOIN house_number hn on ho.house_number_id=hn.id
         LEFT JOIN house h on ho.house_id=h.id
         LEFT JOIN house h on ho.house_id=h.id
+        LEFT JOIN users u1 ON u1.id = ho.reserve_user_id
+        AND u1.deleted = 0
+        LEFT JOIN organization org  ON org.id = u1.organ_id
         WHERE ho.deleted=0
         WHERE ho.deleted=0
         and FIND_IN_SET(ho.order_status,#{s})
         and FIND_IN_SET(ho.order_status,#{s})
         <if test="startTime != null and startTime != '' and endTime != null and endTime != ''  ">
         <if test="startTime != null and startTime != '' and endTime != null and endTime != ''  ">