gqx 2 years ago
parent
commit
5465fc2c5d

+ 178 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/fw/controller/FwLivingJxController.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.FwLivingJx;
+import org.jeecg.modules.fw.service.IFwLivingJxService;
+
+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_living_jx
+ * @Author: jeecg-boot
+ * @Date:   2023-06-01
+ * @Version: V1.0
+ */
+@Api(tags="fw_living_jx")
+@RestController
+@RequestMapping("/fw/fwLivingJx")
+@Slf4j
+public class FwLivingJxController extends JeecgController<FwLivingJx, IFwLivingJxService> {
+	@Autowired
+	private IFwLivingJxService fwLivingJxService;
+
+	/**
+	 * 分页列表查询
+	 *
+	 * @param fwLivingJx
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "fw_living_jx-分页列表查询")
+	@ApiOperation(value="fw_living_jx-分页列表查询", notes="fw_living_jx-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<FwLivingJx>> queryPageList(FwLivingJx fwLivingJx,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<FwLivingJx> queryWrapper = QueryGenerator.initQueryWrapper(fwLivingJx, req.getParameterMap());
+		Page<FwLivingJx> page = new Page<FwLivingJx>(pageNo, pageSize);
+		IPage<FwLivingJx> pageList = fwLivingJxService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+
+	/**
+	 *   添加
+	 *
+	 * @param fwLivingJx
+	 * @return
+	 */
+	@AutoLog(value = "fw_living_jx-添加")
+	@ApiOperation(value="fw_living_jx-添加", notes="fw_living_jx-添加")
+	//@RequiresPermissions("fw:fw_living_jx:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody FwLivingJx fwLivingJx) {
+		fwLivingJxService.save(fwLivingJx);
+		return Result.OK("添加成功!");
+	}
+
+	/**
+	 *  编辑
+	 *
+	 * @param fwLivingJx
+	 * @return
+	 */
+	@AutoLog(value = "fw_living_jx-编辑")
+	@ApiOperation(value="fw_living_jx-编辑", notes="fw_living_jx-编辑")
+	//@RequiresPermissions("fw:fw_living_jx:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody FwLivingJx fwLivingJx) {
+		fwLivingJxService.updateById(fwLivingJx);
+		return Result.OK("编辑成功!");
+	}
+
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "fw_living_jx-通过id删除")
+	@ApiOperation(value="fw_living_jx-通过id删除", notes="fw_living_jx-通过id删除")
+	//@RequiresPermissions("fw:fw_living_jx:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		fwLivingJxService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "fw_living_jx-批量删除")
+	@ApiOperation(value="fw_living_jx-批量删除", notes="fw_living_jx-批量删除")
+	//@RequiresPermissions("fw:fw_living_jx:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.fwLivingJxService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "fw_living_jx-通过id查询")
+	@ApiOperation(value="fw_living_jx-通过id查询", notes="fw_living_jx-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<FwLivingJx> queryById(@RequestParam(name="id",required=true) String id) {
+		FwLivingJx fwLivingJx = fwLivingJxService.getById(id);
+		if(fwLivingJx==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(fwLivingJx);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param fwLivingJx
+    */
+    //@RequiresPermissions("fw:fw_living_jx:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, FwLivingJx fwLivingJx) {
+        return super.exportXls(request, fwLivingJx, FwLivingJx.class, "fw_living_jx");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("fw:fw_living_jx:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, FwLivingJx.class);
+    }
+
+}

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

@@ -0,0 +1,53 @@
+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_living_jx
+ * @Author: jeecg-boot
+ * @Date:   2023-06-01
+ * @Version: V1.0
+ */
+@Data
+@TableName("fw_living_jx")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="fw_living_jx对象", description="fw_living_jx")
+public class FwLivingJx implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**id*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "id")
+    private String id;
+	/**入住订单id*/
+	@Excel(name = "入住订单id", width = 15)
+    @ApiModelProperty(value = "入住订单id")
+    private String livingOrderId;
+	/**叫醒日期*/
+	@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 jxDate;
+	/**叫醒时间*/
+	@Excel(name = "叫醒时间", width = 15)
+    @ApiModelProperty(value = "叫醒时间")
+    private String jxTime;
+}

+ 17 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/fw/mapper/FwLivingJxMapper.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.FwLivingJx;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: fw_living_jx
+ * @Author: jeecg-boot
+ * @Date:   2023-06-01
+ * @Version: V1.0
+ */
+public interface FwLivingJxMapper extends BaseMapper<FwLivingJx> {
+
+}

+ 5 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/fw/mapper/xml/FwLivingJxMapper.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.FwLivingJxMapper">
+
+</mapper>

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

@@ -0,0 +1,14 @@
+package org.jeecg.modules.fw.service;
+
+import org.jeecg.modules.fw.entity.FwLivingJx;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: fw_living_jx
+ * @Author: jeecg-boot
+ * @Date:   2023-06-01
+ * @Version: V1.0
+ */
+public interface IFwLivingJxService extends IService<FwLivingJx> {
+
+}

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

@@ -0,0 +1,19 @@
+package org.jeecg.modules.fw.service.impl;
+
+import org.jeecg.modules.fw.entity.FwLivingJx;
+import org.jeecg.modules.fw.mapper.FwLivingJxMapper;
+import org.jeecg.modules.fw.service.IFwLivingJxService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: fw_living_jx
+ * @Author: jeecg-boot
+ * @Date:   2023-06-01
+ * @Version: V1.0
+ */
+@Service
+public class FwLivingJxServiceImpl extends ServiceImpl<FwLivingJxMapper, FwLivingJx> implements IFwLivingJxService {
+
+}