Просмотр исходного кода

Merge branch 'master' of http://49.4.53.36:3000/hotel/hotel-saas-backend

WIN-B904R0U0NNS\Administrator лет назад: 2
Родитель
Сommit
2d6e128b39

+ 178 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/fw/controller/FwRoomExamineController.java

@@ -0,0 +1,178 @@
+package org.jeecg.modules.fw.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.fw.entity.FwRoomExamine;
+import org.jeecg.modules.fw.service.IFwRoomExamineService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+
+ /**
+ * @Description: fw_room_examine
+ * @Author: jeecg-boot
+ * @Date:   2023-05-23
+ * @Version: V1.0
+ */
+@Api(tags="fw_room_examine")
+@RestController
+@RequestMapping("/fw/fwRoomExamine")
+@Slf4j
+public class FwRoomExamineController extends JeecgController<FwRoomExamine, IFwRoomExamineService> {
+	@Autowired
+	private IFwRoomExamineService fwRoomExamineService;
+
+	/**
+	 * 分页列表查询
+	 *
+	 * @param fwRoomExamine
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "fw_room_examine-分页列表查询")
+	@ApiOperation(value="fw_room_examine-分页列表查询", notes="fw_room_examine-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<FwRoomExamine>> queryPageList(FwRoomExamine fwRoomExamine,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<FwRoomExamine> queryWrapper = QueryGenerator.initQueryWrapper(fwRoomExamine, req.getParameterMap());
+		Page<FwRoomExamine> page = new Page<FwRoomExamine>(pageNo, pageSize);
+		IPage<FwRoomExamine> pageList = fwRoomExamineService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+
+	/**
+	 *   添加
+	 *
+	 * @param fwRoomExamine
+	 * @return
+	 */
+	@AutoLog(value = "fw_room_examine-添加")
+	@ApiOperation(value="fw_room_examine-添加", notes="fw_room_examine-添加")
+	//@RequiresPermissions("fw:fw_room_examine:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody FwRoomExamine fwRoomExamine) {
+		fwRoomExamineService.save(fwRoomExamine);
+		return Result.OK("添加成功!");
+	}
+
+	/**
+	 *  编辑
+	 *
+	 * @param fwRoomExamine
+	 * @return
+	 */
+	@AutoLog(value = "fw_room_examine-编辑")
+	@ApiOperation(value="fw_room_examine-编辑", notes="fw_room_examine-编辑")
+	//@RequiresPermissions("fw:fw_room_examine:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody FwRoomExamine fwRoomExamine) {
+		fwRoomExamineService.updateById(fwRoomExamine);
+		return Result.OK("编辑成功!");
+	}
+
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "fw_room_examine-通过id删除")
+	@ApiOperation(value="fw_room_examine-通过id删除", notes="fw_room_examine-通过id删除")
+	//@RequiresPermissions("fw:fw_room_examine:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		fwRoomExamineService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "fw_room_examine-批量删除")
+	@ApiOperation(value="fw_room_examine-批量删除", notes="fw_room_examine-批量删除")
+	//@RequiresPermissions("fw:fw_room_examine:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.fwRoomExamineService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "fw_room_examine-通过id查询")
+	@ApiOperation(value="fw_room_examine-通过id查询", notes="fw_room_examine-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<FwRoomExamine> queryById(@RequestParam(name="id",required=true) String id) {
+		FwRoomExamine fwRoomExamine = fwRoomExamineService.getById(id);
+		if(fwRoomExamine==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(fwRoomExamine);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param fwRoomExamine
+    */
+    //@RequiresPermissions("fw:fw_room_examine:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, FwRoomExamine fwRoomExamine) {
+        return super.exportXls(request, fwRoomExamine, FwRoomExamine.class, "fw_room_examine");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("fw:fw_room_examine:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, FwRoomExamine.class);
+    }
+
+}

+ 96 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/fw/entity/FwRoomExamine.java

@@ -0,0 +1,96 @@
+package org.jeecg.modules.fw.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: fw_room_examine
+ * @Author: jeecg-boot
+ * @Date:   2023-05-23
+ * @Version: V1.0
+ */
+@Data
+@TableName("fw_room_examine")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="fw_room_examine对象", description="fw_room_examine")
+public class FwRoomExamine implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**id*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "id")
+    private String id;
+	/**关联租户*/
+	@Excel(name = "关联租户", width = 15)
+    @ApiModelProperty(value = "关联租户")
+    private String tenantId;
+	/**关联酒店*/
+	@Excel(name = "关联酒店", width = 15)
+    @ApiModelProperty(value = "关联酒店")
+    private String hotelId;
+	/**房号id*/
+	@Excel(name = "房号id", width = 15)
+    @ApiModelProperty(value = "房号id")
+    private String roomId;
+	/**查房备注*/
+	@Excel(name = "查房备注", width = 15)
+    @ApiModelProperty(value = "查房备注")
+    private String remark;
+	/**查房服务员id*/
+	@Excel(name = "查房服务员id", width = 15)
+    @ApiModelProperty(value = "查房服务员id")
+    private String waiterId;
+	/**状态 0待查房 1等待查房 2正在查房 3查房完毕 4取消查房*/
+	@Excel(name = "状态 0待查房 1等待查房 2正在查房 3查房完毕 4取消查房", width = 15)
+    @ApiModelProperty(value = "状态 0待查房 1等待查房 2正在查房 3查房完毕 4取消查房")
+    private Integer state;
+	/**创建时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+	/**入住订单id*/
+	@Excel(name = "入住订单id", width = 15)
+    @ApiModelProperty(value = "入住订单id")
+    private String livingOrderId;
+	/**查房反馈*/
+	@Excel(name = "查房反馈", width = 15)
+    @ApiModelProperty(value = "查房反馈")
+    private String feedback;
+	/**查房发起时间*/
+	@Excel(name = "查房发起时间", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "查房发起时间")
+    private Date promoterTime;
+	/**查房完成时间*/
+	@Excel(name = "查房完成时间", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "查房完成时间")
+    private Date completedTime;
+	/**查房完成人*/
+	@Excel(name = "查房完成人", width = 15)
+    @ApiModelProperty(value = "查房完成人")
+    private String completedBy;
+	/**查房发起人*/
+	@Excel(name = "查房发起人", width = 15)
+    @ApiModelProperty(value = "查房发起人")
+    private String promoterBy;
+}

+ 17 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/fw/mapper/FwRoomExamineMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.fw.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.fw.entity.FwRoomExamine;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: fw_room_examine
+ * @Author: jeecg-boot
+ * @Date:   2023-05-23
+ * @Version: V1.0
+ */
+public interface FwRoomExamineMapper extends BaseMapper<FwRoomExamine> {
+
+}

+ 5 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/fw/mapper/xml/FwRoomExamineMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.fw.mapper.FwRoomExamineMapper">
+
+</mapper>

+ 14 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/fw/service/IFwRoomExamineService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.fw.service;
+
+import org.jeecg.modules.fw.entity.FwRoomExamine;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: fw_room_examine
+ * @Author: jeecg-boot
+ * @Date:   2023-05-23
+ * @Version: V1.0
+ */
+public interface IFwRoomExamineService extends IService<FwRoomExamine> {
+
+}

+ 19 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/fw/service/impl/FwRoomExamineServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.fw.service.impl;
+
+import org.jeecg.modules.fw.entity.FwRoomExamine;
+import org.jeecg.modules.fw.mapper.FwRoomExamineMapper;
+import org.jeecg.modules.fw.service.IFwRoomExamineService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: fw_room_examine
+ * @Author: jeecg-boot
+ * @Date:   2023-05-23
+ * @Version: V1.0
+ */
+@Service
+public class FwRoomExamineServiceImpl extends ServiceImpl<FwRoomExamineMapper, FwRoomExamine> implements IFwRoomExamineService {
+
+}

+ 110 - 29
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/pos/controller/PosTableController.java

@@ -230,35 +230,35 @@ public class PosTableController extends JeecgController<PosTable, IPosTableServi
 				 }
 			 }
 
-			 posTable.setId(UUIDGenerator.generate());
-			 LambdaQueryWrapper<WxAppConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-			 lambdaQueryWrapper.eq(WxAppConfig::getTenantId, posTable.getTenantId());
-			 WxAppConfig wxApp = wxAppConfigService.getOne(lambdaQueryWrapper);
-			 if (wxApp == null) {
-				 throw new JeecgBootException("没有找到此appid");
-			 }
-			 //获取小程序二维码
-			 try {
-				 WxMaInRedisConfigStorage configStorage = new WxMaInRedisConfigStorage(redisTemplate);
-				 configStorage.setAppid(wxApp.getAppId());
-				 configStorage.setSecret(wxApp.getAppSecret());
-				 WxMaService wxMaService = new WxMaServiceImpl();
-				 wxMaService.setWxMaConfig(configStorage);
-
-				 File file = wxMaService.getQrcodeService().createQrcode("page/dc/index?id=" + posTable.getId(), 430);
-				 try {
-					 MultipartFile cMultiFile = new MockMultipartFile("file", file.getName(), null, new FileInputStream(file));
-					 String path = CommonUtils.upload(cMultiFile, "temp", CommonConstant.UPLOAD_TYPE_OSS);
-					 posTable.setQrCode(path);
-				 } catch (IOException e) {
-					 e.printStackTrace();
-				 }
-
-			 } catch (WxErrorException e) {
-				 e.printStackTrace();
-
-				 throw new JeecgBootException("获取小程序二维码失败:" + e.getMessage());
-			 }
+//			 posTable.setId(UUIDGenerator.generate());
+//			 LambdaQueryWrapper<WxAppConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+//			 lambdaQueryWrapper.eq(WxAppConfig::getTenantId, posTable.getTenantId());
+//			 WxAppConfig wxApp = wxAppConfigService.getOne(lambdaQueryWrapper);
+//			 if (wxApp == null) {
+//				 throw new JeecgBootException("没有找到此appid");
+//			 }
+//			 //获取小程序二维码
+//			 try {
+//				 WxMaInRedisConfigStorage configStorage = new WxMaInRedisConfigStorage(redisTemplate);
+//				 configStorage.setAppid(wxApp.getAppId());
+//				 configStorage.setSecret(wxApp.getAppSecret());
+//				 WxMaService wxMaService = new WxMaServiceImpl();
+//				 wxMaService.setWxMaConfig(configStorage);
+//
+//				 File file = wxMaService.getQrcodeService().createQrcode("page/dc/index?id=" + posTable.getId(), 430);
+//				 try {
+//					 MultipartFile cMultiFile = new MockMultipartFile("file", file.getName(), null, new FileInputStream(file));
+//					 String path = CommonUtils.upload(cMultiFile, "temp", CommonConstant.UPLOAD_TYPE_OSS);
+//					 posTable.setQrCode(path);
+//				 } catch (IOException e) {
+//					 e.printStackTrace();
+//				 }
+//
+//			 } catch (WxErrorException e) {
+//				 e.printStackTrace();
+//
+//				 throw new JeecgBootException("获取小程序二维码失败:" + e.getMessage());
+//			 }
 		 });
 		 posTableService.saveBatch(posTables);
 		 return Result.OK("添加成功!");
@@ -358,6 +358,55 @@ public class PosTableController extends JeecgController<PosTable, IPosTableServi
 		 return Result.OK(posTable);
 	 }
 
+
+	 /**
+	  * 生成二维码
+	  *
+	  * @param id
+	  * @return
+	  */
+	 //@AutoLog(value = "pos_table-通过id查询")
+	 @ApiOperation(value = "生成二维码", notes = "生成二维码")
+	 @GetMapping(value = "/generateQRCode")
+	 public Result<PosTable> generateQRCode (@RequestParam(name = "id", required = true) String id) {
+		 PosTable posTable = posTableService.getById(id);
+		 if (posTable == null) {
+			 return Result.error("未找到对应数据");
+		 }
+		 if (StringUtils.isBlank(posTable.getQrCode())) {
+			 LambdaQueryWrapper<WxAppConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+			 lambdaQueryWrapper.eq(WxAppConfig::getTenantId, posTable.getTenantId());
+			 WxAppConfig wxApp = wxAppConfigService.getOne(lambdaQueryWrapper);
+			 if (wxApp == null) {
+				 throw new JeecgBootException("没有找到此appid");
+			 }
+			 //获取小程序二维码
+			 try {
+				 WxMaInRedisConfigStorage configStorage = new WxMaInRedisConfigStorage(redisTemplate);
+				 configStorage.setAppid(wxApp.getAppId());
+				 configStorage.setSecret(wxApp.getAppSecret());
+				 WxMaService wxMaService = new WxMaServiceImpl();
+				 wxMaService.setWxMaConfig(configStorage);
+
+				 File file = wxMaService.getQrcodeService().createQrcode("page/dc/index?id=" + posTable.getId(), 430);
+				 try {
+					 MultipartFile cMultiFile = new MockMultipartFile("file", file.getName(), null, new FileInputStream(file));
+					 String path = CommonUtils.upload(cMultiFile, "temp", CommonConstant.UPLOAD_TYPE_OSS);
+					 posTable.setQrCode(path);
+					 posTableService.updateById(posTable);
+				 } catch (IOException e) {
+					 e.printStackTrace();
+				 }
+
+			 } catch (WxErrorException e) {
+				 e.printStackTrace();
+
+				 throw new JeecgBootException("获取小程序二维码失败:" + e.getMessage());
+			 }
+		 }
+		 return Result.OK(posTable);
+	 }
+
 	 /**
 	  * 导出excel
 	  *
@@ -390,6 +439,38 @@ public class PosTableController extends JeecgController<PosTable, IPosTableServi
 		 ZipOutputStream zip = new ZipOutputStream(outputStream);
 		 List<PosTable> posTables = this.posTableService.listByIds(Arrays.asList(ids.split(",")));
 		 for (PosTable posTable : posTables) {
+			 if (StringUtils.isBlank(posTable.getQrCode())) {
+				 LambdaQueryWrapper<WxAppConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+				 lambdaQueryWrapper.eq(WxAppConfig::getTenantId, posTable.getTenantId());
+				 WxAppConfig wxApp = wxAppConfigService.getOne(lambdaQueryWrapper);
+				 if (wxApp == null) {
+					 throw new JeecgBootException("没有找到此appid");
+				 }
+				 //获取小程序二维码
+				 try {
+					 WxMaInRedisConfigStorage configStorage = new WxMaInRedisConfigStorage(redisTemplate);
+					 configStorage.setAppid(wxApp.getAppId());
+					 configStorage.setSecret(wxApp.getAppSecret());
+					 WxMaService wxMaService = new WxMaServiceImpl();
+					 wxMaService.setWxMaConfig(configStorage);
+
+					 File file = wxMaService.getQrcodeService().createQrcode("page/dc/index?id=" + posTable.getId(), 430);
+					 try {
+						 MultipartFile cMultiFile = new MockMultipartFile("file", file.getName(), null, new FileInputStream(file));
+						 String path = CommonUtils.upload(cMultiFile, "temp", CommonConstant.UPLOAD_TYPE_OSS);
+						 posTable.setQrCode(path);
+						 posTableService.updateById(posTable);
+					 } catch (IOException e) {
+						 e.printStackTrace();
+					 }
+
+				 } catch (WxErrorException e) {
+					 e.printStackTrace();
+
+					 throw new JeecgBootException("获取小程序二维码失败:" + e.getMessage());
+				 }
+			 }
+
 			 if (StringUtils.isNotBlank(posTable.getQrCode())) {
 				 URL url3 = null;
 				 try {