Commit c8a9db82 by 汪鑫

图片压缩代码修正

parent 7cc61755
...@@ -2,9 +2,13 @@ package com.ihooyah.model.controller; ...@@ -2,9 +2,13 @@ package com.ihooyah.model.controller;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ihooyah.base.BaseController; import com.ihooyah.base.BaseController;
import com.ihooyah.model.mapper.RequestBodyMapper; import com.ihooyah.model.mapper.RequestBodyMapper;
import com.ihooyah.model.pojo.dto.RequestBodyEntityDTO;
import com.ihooyah.model.pojo.entity.RequestBodyEntity; import com.ihooyah.model.pojo.entity.RequestBodyEntity;
import com.ihooyah.model.pojo.vo.HotelMaterialListingVO; import com.ihooyah.model.pojo.vo.HotelMaterialListingVO;
import com.ihooyah.model.pojo.vo.OrgCodeVO; import com.ihooyah.model.pojo.vo.OrgCodeVO;
...@@ -104,9 +108,33 @@ public class CommonController extends BaseController { ...@@ -104,9 +108,33 @@ public class CommonController extends BaseController {
@ApiOperation("保存参数") @ApiOperation("保存参数")
@PostMapping("saveRequestBody") @PostMapping("saveRequestBody")
public RespInfo<Boolean> saveRequestBody(@RequestBody RequestBodyEntity params){ public RespInfo<Boolean> saveRequestBody(@RequestBody RequestBodyEntity params){
params.setStatus(1);
params.setUpdateTime(DateUtil.date());
if (ObjectUtil.isEmpty(params.getId())){
params.setId(IdUtil.fastSimpleUUID()); params.setId(IdUtil.fastSimpleUUID());
params.setCreateTime(DateUtil.date()); params.setCreateTime(DateUtil.date());
requestBodyMapper.insert(params); requestBodyMapper.insert(params);
}else {
params.setUpdateTime(DateUtil.date());
requestBodyMapper.updateById(params);
}
return RespInfo.mobiSuccess(true);
}
@ApiOperation("暂存列表")
@PostMapping("getList")
public RespInfo<RequestBodyEntity> getList(@RequestBody RequestBodyEntityDTO params){
Page<RequestBodyEntity> requestBodyEntityPage = requestBodyMapper.selectPage(new Page<>(params.getPageNum(), params.getPageSize()),
new QueryWrapper<RequestBodyEntity>().eq("create_no", params.getCreateNo()).eq("status", 1).eq("whether_draft",1).orderByDesc("create_time"));
return RespInfo.mobiSuccess(requestBodyEntityPage);
}
@ApiOperation("删除暂存记录")
@PostMapping("deleteParamsById")
public RespInfo<RequestBodyEntity> deleteParamsById(@RequestBody RequestBodyEntityDTO params){
RequestBodyEntity requestBodyEntity = requestBodyMapper.selectById(params.getId());
requestBodyEntity.setStatus(2);
requestBodyMapper.updateById(requestBodyEntity);
return RespInfo.mobiSuccess(true); return RespInfo.mobiSuccess(true);
} }
} }
package com.ihooyah.model.pojo.dto;
import com.ihooyah.base.PageForm;
import lombok.Data;
/**
* @author ***
* @version V1.0
* @Description
* @Package com.ihooyah.model.pojo.dto
* @date 2023-12-14 10:32
*/
@Data
public class RequestBodyEntityDTO extends PageForm {
private String id;
private String createNo;
}
...@@ -24,6 +24,30 @@ public class RequestBodyEntity { ...@@ -24,6 +24,30 @@ public class RequestBodyEntity {
@TableField("params") @TableField("params")
private String params; private String params;
@TableField("business_license")
private String businessLicense;
@TableField("business_register_name")
private String businessRegisterName;
@TableField("create_no")
private String createNo;
@TableField("whether_draft")
private Integer whetherDraft;
@TableField("selected_options")
private String selectedOptions;
@TableField("row_guid")
private String rowGuid;
@TableField("status")
private Integer status;
@TableField("create_time") @TableField("create_time")
private Date createTime; private Date createTime;
@TableField("update_time")
private Date updateTime;
} }
package com.ihooyah.model.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import java.util.Date;
/**
* @author ***
* @version V1.0
* @Description
* @Package com.ihooyah.model.pojo.vo
* @date 2023-12-14 10:30
*/
@Data
public class RequestBodyEntityVO {
@TableId
private String id;
@TableField("params")
private String params;
@TableField("business_license")
private String businessLicense;
@TableField("business_register_name")
private String businessRegisterName;
@TableField("create_time")
private Date createTime;
}
...@@ -2,7 +2,7 @@ spring: ...@@ -2,7 +2,7 @@ spring:
datasource: datasource:
# 主数据源,默认的 # 主数据源,默认的
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://172.16.0.3:3306/hotel_server_data?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false url: jdbc:mysql://172.16.1.234:3306/hotel_server_data?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false
username: root username: root
password: pv7CFp1oDpMM!@ password: pv7CFp1oDpMM!@
#配置初始化大小/最小/最大 #配置初始化大小/最小/最大
......
spring: spring:
# 开发/测试/生产环境分别对应dev/test/prod # 开发/测试/生产环境分别对应dev/test/prod
profiles: profiles:
active: prod active: dev
#==============配置本地资源路径 #==============配置本地资源路径
resources: resources:
static-locations: file:${upload.path} static-locations: file:${upload.path}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment