添加耗材功能
This commit is contained in:
parent
1675e5d45b
commit
7b74033bea
|
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.cons.domain;
|
||||
|
||||
import cn.ysk.cashier.utils.JSONUtil;
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="tb_cons_info")
|
||||
public class TbConsInfo implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`con_type_id`")
|
||||
@ApiModelProperty(value = "耗材类型id")
|
||||
private Integer conTypeId;
|
||||
|
||||
@Column(name = "`con_type_name`")
|
||||
@ApiModelProperty(value = "耗材类型名称")
|
||||
private String conTypeName;
|
||||
|
||||
@Column(name = "`con_code`")
|
||||
@ApiModelProperty(value = "耗材代码")
|
||||
private String conCode;
|
||||
|
||||
@Column(name = "`con_name`")
|
||||
@ApiModelProperty(value = "耗材名称")
|
||||
private String conName;
|
||||
|
||||
@Column(name = "`stock_number`")
|
||||
@ApiModelProperty(value = "库存值")
|
||||
private BigDecimal stockNumber;
|
||||
|
||||
@Column(name = "`con_unit`")
|
||||
@ApiModelProperty(value = "单位值")
|
||||
private String conUnit;
|
||||
|
||||
@Column(name = "`surplus_stock`")
|
||||
@ApiModelProperty(value = "每份消耗值")
|
||||
private BigDecimal surplusStock;
|
||||
|
||||
@Column(name = "`laster_in_stock`")
|
||||
@ApiModelProperty(value = "最近一次入库量")
|
||||
private BigDecimal lasterInStock;
|
||||
|
||||
@Column(name = "`create_time`")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Timestamp createTime;
|
||||
|
||||
@Column(name = "`update_time`")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Timestamp updateTime;
|
||||
|
||||
@Column(name = "`shop_id`")
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Integer shopId;
|
||||
|
||||
public void copy(TbConsInfo source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
|
||||
public static void main(String[] args){
|
||||
System.out.println(JSONUtil.toJSONString(new TbConsInfo()));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.cons.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="tb_cons_info_flow")
|
||||
public class TbConsInfoFlow implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`cons_id`")
|
||||
@ApiModelProperty(value = "耗材id")
|
||||
private Integer consId;
|
||||
|
||||
@Column(name = "`con_name`")
|
||||
@ApiModelProperty(value = "耗材名称")
|
||||
private String conName;
|
||||
|
||||
@Column(name = "`amount`")
|
||||
@ApiModelProperty(value = "变化值")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Column(name = "`balance`")
|
||||
@ApiModelProperty(value = "变化后的值")
|
||||
private BigDecimal balance;
|
||||
|
||||
@Column(name = "`biz_code`")
|
||||
@ApiModelProperty(value = "操作代码")
|
||||
private String bizCode;
|
||||
|
||||
@Column(name = "`biz_name`")
|
||||
@ApiModelProperty(value = "操作说明")
|
||||
private String bizName;
|
||||
|
||||
@Column(name = "`biz_type`")
|
||||
@ApiModelProperty(value = "加减标识+/-")
|
||||
private String bizType;
|
||||
|
||||
@Column(name = "`create_time`")
|
||||
@ApiModelProperty(value = "createTime")
|
||||
private Timestamp createTime;
|
||||
|
||||
@Column(name = "`update_time`")
|
||||
@ApiModelProperty(value = "updateTime")
|
||||
private Timestamp updateTime;
|
||||
|
||||
@Column(name = "`shop_id`")
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Integer shopId;
|
||||
|
||||
public void copy(TbConsInfoFlow source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.cons.domain;
|
||||
|
||||
import cn.ysk.cashier.utils.JSONUtil;
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="tb_cons_type")
|
||||
public class TbConsType implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`con_type_code`")
|
||||
@ApiModelProperty(value = "耗材类型代码")
|
||||
private String conTypeCode;
|
||||
|
||||
@Column(name = "`con_type_name`")
|
||||
@ApiModelProperty(value = "耗材名称")
|
||||
private String conTypeName;
|
||||
|
||||
@Column(name = "`status`")
|
||||
@ApiModelProperty(value = "状态 1 正常 0 禁用")
|
||||
private String status;
|
||||
|
||||
@Column(name = "`create_time`")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Timestamp createTime;
|
||||
|
||||
@Column(name = "`update_time`")
|
||||
@ApiModelProperty(value = "更新")
|
||||
private Timestamp updateTime;
|
||||
|
||||
@Column(name = "`shop_id`")
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Integer shopId;
|
||||
|
||||
public void copy(TbConsType source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args){
|
||||
System.out.println(JSONUtil.toJSONString(new TbConsType()));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.cons.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="tb_prosku_con")
|
||||
public class TbProskuCon implements Serializable {
|
||||
|
||||
@Column(name = "`product_sku_id`",nullable = false)
|
||||
@NotNull
|
||||
@ApiModelProperty(value = "商品规格id")
|
||||
private Integer productSkuId;
|
||||
|
||||
@Column(name = "`con_info_id`",nullable = false)
|
||||
@NotNull
|
||||
@ApiModelProperty(value = "耗材id")
|
||||
private Integer conInfoId;
|
||||
|
||||
@Column(name = "`status`",nullable = false)
|
||||
@NotBlank
|
||||
@ApiModelProperty(value = "状态 1 启用 0 禁用")
|
||||
private String status;
|
||||
|
||||
@Column(name = "`create_time`")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Timestamp createTime;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`shop_id`")
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Integer shopId;
|
||||
|
||||
public void copy(TbProskuCon source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.cons.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-24
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="view_con_sku")
|
||||
public class ViewConSku implements Serializable {
|
||||
|
||||
@Id
|
||||
@Column(name = "`id`",nullable = false)
|
||||
@NotNull
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`con_info_id`",nullable = false)
|
||||
@NotNull
|
||||
@ApiModelProperty(value = "耗材id")
|
||||
private Integer conInfoId;
|
||||
|
||||
@Column(name = "`product_sku_id`",nullable = false)
|
||||
@NotNull
|
||||
@ApiModelProperty(value = "商品规格id")
|
||||
private Integer productSkuId;
|
||||
|
||||
@Column(name = "`con_name`")
|
||||
@ApiModelProperty(value = "耗材名称")
|
||||
private String conName;
|
||||
|
||||
@Column(name = "`spec_snap`")
|
||||
@ApiModelProperty(value = "规格")
|
||||
private String specSnap;
|
||||
|
||||
@Column(name = "`name`")
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
private String name;
|
||||
|
||||
public void copy(ViewConSku source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package cn.ysk.cashier.cons.repository;
|
||||
|
||||
import cn.ysk.cashier.cons.domain.TbConsInfoFlow;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
public interface TbConsInfoFlowRepository extends JpaRepository<TbConsInfoFlow, Integer>, JpaSpecificationExecutor<TbConsInfoFlow> {
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package cn.ysk.cashier.cons.repository;
|
||||
|
||||
import cn.ysk.cashier.cons.domain.TbConsInfo;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
public interface TbConsInfoRepository extends JpaRepository<TbConsInfo, Integer>, JpaSpecificationExecutor<TbConsInfo> {
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package cn.ysk.cashier.cons.repository;
|
||||
|
||||
import cn.ysk.cashier.cons.domain.TbConsType;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
public interface TbConsTypeRepository extends JpaRepository<TbConsType, Integer>, JpaSpecificationExecutor<TbConsType> {
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package cn.ysk.cashier.cons.repository;
|
||||
|
||||
import cn.ysk.cashier.cons.domain.TbProskuCon;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
public interface TbProskuConRepository extends JpaRepository<TbProskuCon, Integer>, JpaSpecificationExecutor<TbProskuCon> {
|
||||
|
||||
|
||||
@Query(value = "select count(0) from tb_prosku_con where con_info_id=?1 and product_sku_id=?2 and shop_id=?3",nativeQuery = true)
|
||||
int countByConInfoIdAndProductSkuIdAndShopId(Integer conInfoId,Integer productSkuId,Integer shopId);
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package cn.ysk.cashier.cons.repository;
|
||||
|
||||
import cn.ysk.cashier.cons.domain.ViewConSku;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2024-06-24
|
||||
**/
|
||||
public interface ViewConSkuRepository extends JpaRepository<ViewConSku, Integer>, JpaSpecificationExecutor<ViewConSku> {
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package cn.ysk.cashier.cons.rest;
|
||||
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.cons.domain.TbConsInfo;
|
||||
import cn.ysk.cashier.cons.service.TbConsInfoService;
|
||||
import cn.ysk.cashier.cons.service.dto.TbConsInfoQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "耗材信息管理")
|
||||
@RequestMapping("/api/tbConsInfo")
|
||||
public class TbConsInfoController {
|
||||
|
||||
private final TbConsInfoService tbConsInfoService;
|
||||
|
||||
@Log("导出数据")
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
public void exportTbConsInfo(HttpServletResponse response, TbConsInfoQueryCriteria criteria) throws IOException {
|
||||
tbConsInfoService.download(tbConsInfoService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Log("查询耗材信息")
|
||||
@ApiOperation("查询耗材信息")
|
||||
public ResponseEntity<Object> queryTbConsInfo(TbConsInfoQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(tbConsInfoService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增耗材信息")
|
||||
@ApiOperation("新增耗材信息")
|
||||
public ResponseEntity<Object> createTbConsInfo(@Validated @RequestBody TbConsInfo resources) throws Exception {
|
||||
return new ResponseEntity<>(tbConsInfoService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改耗材信息")
|
||||
@ApiOperation("修改耗材信息")
|
||||
public ResponseEntity<Object> updateTbConsInfo(@Validated @RequestBody TbConsInfo resources){
|
||||
tbConsInfoService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除耗材信息")
|
||||
@ApiOperation("删除耗材信息")
|
||||
public ResponseEntity<Object> deleteTbConsInfo(@RequestBody Integer[] ids) {
|
||||
tbConsInfoService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping(value = "stockIn")
|
||||
@Log("耗材入库")
|
||||
@ApiOperation("耗材入库")
|
||||
public ResponseEntity<Object> stockIn(@Validated @RequestBody TbConsInfo resources) throws Exception {
|
||||
tbConsInfoService.stockIn(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package cn.ysk.cashier.cons.rest;
|
||||
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.cons.domain.TbConsInfoFlow;
|
||||
import cn.ysk.cashier.cons.service.TbConsInfoFlowService;
|
||||
import cn.ysk.cashier.cons.service.dto.TbConsInfoFlowQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "耗材流水管理")
|
||||
@RequestMapping("/api/tbConsInfoFlow")
|
||||
public class TbConsInfoFlowController {
|
||||
|
||||
private final TbConsInfoFlowService tbConsInfoFlowService;
|
||||
|
||||
@Log("导出数据")
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
public void exportTbConsInfoFlow(HttpServletResponse response, TbConsInfoFlowQueryCriteria criteria) throws IOException {
|
||||
tbConsInfoFlowService.download(tbConsInfoFlowService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Log("查询耗材流水")
|
||||
@ApiOperation("查询耗材流水")
|
||||
public ResponseEntity<Object> queryTbConsInfoFlow(TbConsInfoFlowQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(tbConsInfoFlowService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增耗材流水")
|
||||
@ApiOperation("新增耗材流水")
|
||||
public ResponseEntity<Object> createTbConsInfoFlow(@Validated @RequestBody TbConsInfoFlow resources){
|
||||
return new ResponseEntity<>(tbConsInfoFlowService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改耗材流水")
|
||||
@ApiOperation("修改耗材流水")
|
||||
public ResponseEntity<Object> updateTbConsInfoFlow(@Validated @RequestBody TbConsInfoFlow resources){
|
||||
tbConsInfoFlowService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除耗材流水")
|
||||
@ApiOperation("删除耗材流水")
|
||||
public ResponseEntity<Object> deleteTbConsInfoFlow(@RequestBody Integer[] ids) {
|
||||
tbConsInfoFlowService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package cn.ysk.cashier.cons.rest;
|
||||
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.cons.domain.TbConsType;
|
||||
import cn.ysk.cashier.cons.service.TbConsTypeService;
|
||||
import cn.ysk.cashier.cons.service.dto.TbConsTypeQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import java.io.IOException;
|
||||
import java.sql.Timestamp;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "耗材类型管理")
|
||||
@RequestMapping("/api/tbConsType")
|
||||
public class TbConsTypeController {
|
||||
|
||||
private final TbConsTypeService tbConsTypeService;
|
||||
|
||||
@Log("导出数据")
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
public void exportTbConsType(HttpServletResponse response, TbConsTypeQueryCriteria criteria) throws IOException {
|
||||
tbConsTypeService.download(tbConsTypeService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Log("查询耗材类型")
|
||||
@ApiOperation("查询耗材类型")
|
||||
public ResponseEntity<Object> queryTbConsType(TbConsTypeQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(tbConsTypeService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增耗材类型")
|
||||
@ApiOperation("新增耗材类型")
|
||||
public ResponseEntity<Object> createTbConsType(@Validated @RequestBody TbConsType resources){
|
||||
resources.setCreateTime(new Timestamp(System.currentTimeMillis()));
|
||||
return new ResponseEntity<>(tbConsTypeService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改耗材类型")
|
||||
@ApiOperation("修改耗材类型")
|
||||
public ResponseEntity<Object> updateTbConsType(@Validated @RequestBody TbConsType resources){
|
||||
resources.setUpdateTime(new Timestamp(System.currentTimeMillis()));
|
||||
tbConsTypeService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除耗材类型")
|
||||
@ApiOperation("删除耗材类型")
|
||||
public ResponseEntity<Object> deleteTbConsType(@RequestBody Integer[] ids) {
|
||||
tbConsTypeService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package cn.ysk.cashier.cons.rest;
|
||||
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.cons.domain.TbProskuCon;
|
||||
import cn.ysk.cashier.cons.service.TbProskuConService;
|
||||
import cn.ysk.cashier.cons.service.dto.TbProskuConQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "商品规格耗材信息管理")
|
||||
@RequestMapping("/api/tbProskuCon")
|
||||
public class TbProskuConController {
|
||||
|
||||
private final TbProskuConService tbProskuConService;
|
||||
|
||||
@Log("导出数据")
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
public void exportTbProskuCon(HttpServletResponse response, TbProskuConQueryCriteria criteria) throws IOException {
|
||||
tbProskuConService.download(tbProskuConService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Log("查询商品规格耗材信息")
|
||||
@ApiOperation("查询商品规格耗材信息")
|
||||
public ResponseEntity<Object> queryTbProskuCon(TbProskuConQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(tbProskuConService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增商品规格耗材信息")
|
||||
@ApiOperation("新增商品规格耗材信息")
|
||||
public ResponseEntity<Object> createTbProskuCon(@Validated @RequestBody TbProskuCon resources) throws Exception {
|
||||
return new ResponseEntity<>(tbProskuConService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改商品规格耗材信息")
|
||||
@ApiOperation("修改商品规格耗材信息")
|
||||
public ResponseEntity<Object> updateTbProskuCon(@Validated @RequestBody TbProskuCon resources){
|
||||
tbProskuConService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除商品规格耗材信息")
|
||||
@ApiOperation("删除商品规格耗材信息")
|
||||
public ResponseEntity<Object> deleteTbProskuCon(@RequestBody Integer[] ids) {
|
||||
tbProskuConService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package cn.ysk.cashier.cons.rest;
|
||||
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.cons.domain.ViewConSku;
|
||||
import cn.ysk.cashier.cons.service.ViewConSkuService;
|
||||
import cn.ysk.cashier.cons.service.dto.ViewConSkuQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-24
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "查询耗材规格信息管理")
|
||||
@RequestMapping("/api/viewConSku")
|
||||
public class ViewConSkuController {
|
||||
|
||||
private final ViewConSkuService viewConSkuService;
|
||||
|
||||
@Log("导出数据")
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
public void exportViewConSku(HttpServletResponse response, ViewConSkuQueryCriteria criteria) throws IOException {
|
||||
viewConSkuService.download(viewConSkuService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Log("查询查询耗材规格信息")
|
||||
@ApiOperation("查询查询耗材规格信息")
|
||||
public ResponseEntity<Object> queryViewConSku(ViewConSkuQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(viewConSkuService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增查询耗材规格信息")
|
||||
@ApiOperation("新增查询耗材规格信息")
|
||||
public ResponseEntity<Object> createViewConSku(@Validated @RequestBody ViewConSku resources){
|
||||
return new ResponseEntity<>(viewConSkuService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改查询耗材规格信息")
|
||||
@ApiOperation("修改查询耗材规格信息")
|
||||
public ResponseEntity<Object> updateViewConSku(@Validated @RequestBody ViewConSku resources){
|
||||
viewConSkuService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除查询耗材规格信息")
|
||||
@ApiOperation("删除查询耗材规格信息")
|
||||
public ResponseEntity<Object> deleteViewConSku(@RequestBody Integer[] ids) {
|
||||
viewConSkuService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package cn.ysk.cashier.cons.service;
|
||||
|
||||
import cn.ysk.cashier.cons.domain.TbConsInfoFlow;
|
||||
import cn.ysk.cashier.cons.service.dto.TbConsInfoFlowDto;
|
||||
import cn.ysk.cashier.cons.service.dto.TbConsInfoFlowQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
public interface TbConsInfoFlowService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(TbConsInfoFlowQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<TbConsInfoFlowDto>
|
||||
*/
|
||||
List<TbConsInfoFlowDto> queryAll(TbConsInfoFlowQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return TbConsInfoFlowDto
|
||||
*/
|
||||
TbConsInfoFlowDto findById(Integer id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return TbConsInfoFlowDto
|
||||
*/
|
||||
TbConsInfoFlowDto create(TbConsInfoFlow resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(TbConsInfoFlow resources);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<TbConsInfoFlowDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package cn.ysk.cashier.cons.service;
|
||||
|
||||
import cn.ysk.cashier.cons.domain.TbConsInfo;
|
||||
import cn.ysk.cashier.cons.service.dto.TbConsInfoDto;
|
||||
import cn.ysk.cashier.cons.service.dto.TbConsInfoQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
public interface TbConsInfoService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(TbConsInfoQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<TbConsInfoDto>
|
||||
*/
|
||||
List<TbConsInfoDto> queryAll(TbConsInfoQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return TbConsInfoDto
|
||||
*/
|
||||
TbConsInfoDto findById(Integer id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return TbConsInfoDto
|
||||
*/
|
||||
TbConsInfoDto create(TbConsInfo resources) throws Exception;
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(TbConsInfo resources);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<TbConsInfoDto> all, HttpServletResponse response) throws IOException;
|
||||
|
||||
|
||||
void stockIn(TbConsInfo resources) throws Exception;
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package cn.ysk.cashier.cons.service;
|
||||
|
||||
import cn.ysk.cashier.cons.domain.TbConsType;
|
||||
import cn.ysk.cashier.cons.service.dto.TbConsTypeDto;
|
||||
import cn.ysk.cashier.cons.service.dto.TbConsTypeQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
public interface TbConsTypeService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(TbConsTypeQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<TbConsTypeDto>
|
||||
*/
|
||||
List<TbConsTypeDto> queryAll(TbConsTypeQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return TbConsTypeDto
|
||||
*/
|
||||
TbConsTypeDto findById(Integer id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return TbConsTypeDto
|
||||
*/
|
||||
TbConsTypeDto create(TbConsType resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(TbConsType resources);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<TbConsTypeDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package cn.ysk.cashier.cons.service;
|
||||
|
||||
import cn.ysk.cashier.cons.domain.TbProskuCon;
|
||||
import cn.ysk.cashier.cons.service.dto.TbProskuConDto;
|
||||
import cn.ysk.cashier.cons.service.dto.TbProskuConQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
public interface TbProskuConService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(TbProskuConQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<TbProskuConDto>
|
||||
*/
|
||||
List<TbProskuConDto> queryAll(TbProskuConQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return TbProskuConDto
|
||||
*/
|
||||
TbProskuConDto findById(Integer id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return TbProskuConDto
|
||||
*/
|
||||
TbProskuConDto create(TbProskuCon resources) throws Exception;
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(TbProskuCon resources);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<TbProskuConDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package cn.ysk.cashier.cons.service;
|
||||
|
||||
import cn.ysk.cashier.cons.domain.ViewConSku;
|
||||
import cn.ysk.cashier.cons.service.dto.ViewConSkuDto;
|
||||
import cn.ysk.cashier.cons.service.dto.ViewConSkuQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-24
|
||||
**/
|
||||
public interface ViewConSkuService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(ViewConSkuQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<ViewConSkuDto>
|
||||
*/
|
||||
List<ViewConSkuDto> queryAll(ViewConSkuQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return ViewConSkuDto
|
||||
*/
|
||||
ViewConSkuDto findById(Integer id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return ViewConSkuDto
|
||||
*/
|
||||
ViewConSkuDto create(ViewConSku resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(ViewConSku resources);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<ViewConSkuDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.cons.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Data
|
||||
public class TbConsInfoDto implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/** 耗材类型id */
|
||||
private Integer conTypeId;
|
||||
|
||||
/** 耗材类型名称 */
|
||||
private String conTypeName;
|
||||
|
||||
/** 耗材代码 */
|
||||
private String conCode;
|
||||
|
||||
/** 耗材名称 */
|
||||
private String conName;
|
||||
|
||||
/** 库存值 */
|
||||
private BigDecimal stockNumber;
|
||||
|
||||
/** 单位值 */
|
||||
private String conUnit;
|
||||
|
||||
/** 剩余库存 */
|
||||
private BigDecimal surplusStock;
|
||||
|
||||
/** 最近一次入库量 */
|
||||
private BigDecimal lasterInStock;
|
||||
|
||||
/** 创建时间 */
|
||||
private Timestamp createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
private Timestamp updateTime;
|
||||
|
||||
/** 店铺id */
|
||||
private Integer shopId;
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.cons.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Data
|
||||
public class TbConsInfoFlowDto implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/** 耗材id */
|
||||
private Integer consId;
|
||||
|
||||
/** 耗材名称 */
|
||||
private String conName;
|
||||
|
||||
/** 变化值 */
|
||||
private BigDecimal amount;
|
||||
|
||||
/** 变化后的值 */
|
||||
private BigDecimal balance;
|
||||
|
||||
/** 操作代码 */
|
||||
private String bizCode;
|
||||
|
||||
/** 操作说明 */
|
||||
private String bizName;
|
||||
|
||||
/** 加减标识+/- */
|
||||
private String bizType;
|
||||
|
||||
private Timestamp createTime;
|
||||
|
||||
private Timestamp updateTime;
|
||||
|
||||
/** 店铺id */
|
||||
private Integer shopId;
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package cn.ysk.cashier.cons.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
import cn.ysk.cashier.annotation.Query;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Data
|
||||
public class TbConsInfoFlowQueryCriteria{
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private Integer consId;
|
||||
|
||||
/** 模糊 */
|
||||
@Query(type = Query.Type.INNER_LIKE)
|
||||
private String conName;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private Integer shopId;
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package cn.ysk.cashier.cons.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
import cn.ysk.cashier.annotation.Query;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Data
|
||||
public class TbConsInfoQueryCriteria{
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private Integer conTypeId;
|
||||
|
||||
/** 模糊 */
|
||||
@Query(type = Query.Type.INNER_LIKE)
|
||||
private String conTypeName;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String conCode;
|
||||
|
||||
/** 模糊 */
|
||||
@Query(type = Query.Type.INNER_LIKE)
|
||||
private String conName;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private Integer shopId;
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.cons.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Data
|
||||
public class TbConsTypeDto implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/** 耗材类型代码 */
|
||||
private String conTypeCode;
|
||||
|
||||
/** 耗材名称 */
|
||||
private String conTypeName;
|
||||
|
||||
/** 状态 1 正常 0 禁用 */
|
||||
private String status;
|
||||
|
||||
/** 创建时间 */
|
||||
private Timestamp createTime;
|
||||
|
||||
/** 更新 */
|
||||
private Timestamp updateTime;
|
||||
|
||||
/** 店铺id */
|
||||
private Integer shopId;
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package cn.ysk.cashier.cons.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
import cn.ysk.cashier.annotation.Query;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Data
|
||||
public class TbConsTypeQueryCriteria{
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String conTypeCode;
|
||||
|
||||
/** 模糊 */
|
||||
@Query(type = Query.Type.INNER_LIKE)
|
||||
private String conTypeName;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String status;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private Integer shopId;
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.cons.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Data
|
||||
public class TbProskuConDto implements Serializable {
|
||||
|
||||
/** 商品规格id */
|
||||
private Integer productSkuId;
|
||||
|
||||
/** 耗材id */
|
||||
private Integer conInfoId;
|
||||
|
||||
/** 状态 1 启用 0 禁用 */
|
||||
private String status;
|
||||
|
||||
/** 创建时间 */
|
||||
private Timestamp createTime;
|
||||
|
||||
private Integer id;
|
||||
|
||||
/** 店铺id */
|
||||
private Integer shopId;
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package cn.ysk.cashier.cons.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
import cn.ysk.cashier.annotation.Query;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Data
|
||||
public class TbProskuConQueryCriteria{
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private Integer productSkuId;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private Integer conInfoId;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String status;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private Integer shopId;
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.cons.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-24
|
||||
**/
|
||||
@Data
|
||||
public class ViewConSkuDto implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/** 耗材id */
|
||||
private Integer conInfoId;
|
||||
|
||||
/** 商品规格id */
|
||||
private Integer productSkuId;
|
||||
|
||||
/** 耗材名称 */
|
||||
private String conName;
|
||||
|
||||
/** 规格 */
|
||||
private String specSnap;
|
||||
|
||||
/** 商品名称 */
|
||||
private String name;
|
||||
|
||||
/** 店铺id */
|
||||
private Integer shopId;
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package cn.ysk.cashier.cons.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
import cn.ysk.cashier.annotation.Query;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-24
|
||||
**/
|
||||
@Data
|
||||
public class ViewConSkuQueryCriteria{
|
||||
|
||||
/** 模糊 */
|
||||
@Query(type = Query.Type.INNER_LIKE)
|
||||
private String conName;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String specSnap;
|
||||
|
||||
/** 模糊 */
|
||||
@Query(type = Query.Type.INNER_LIKE)
|
||||
private String name;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private Integer shopId;
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
package cn.ysk.cashier.cons.service.impl;
|
||||
|
||||
import cn.ysk.cashier.cons.domain.TbConsInfoFlow;
|
||||
import cn.ysk.cashier.utils.FileUtil;
|
||||
import cn.ysk.cashier.utils.PageUtil;
|
||||
import cn.ysk.cashier.utils.QueryHelp;
|
||||
import cn.ysk.cashier.utils.ValidationUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import cn.ysk.cashier.cons.repository.TbConsInfoFlowRepository;
|
||||
import cn.ysk.cashier.cons.service.TbConsInfoFlowService;
|
||||
import cn.ysk.cashier.cons.service.dto.TbConsInfoFlowDto;
|
||||
import cn.ysk.cashier.cons.service.dto.TbConsInfoFlowQueryCriteria;
|
||||
import cn.ysk.cashier.cons.service.mapstruct.TbConsInfoFlowMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TbConsInfoFlowServiceImpl implements TbConsInfoFlowService {
|
||||
|
||||
private final TbConsInfoFlowRepository tbConsInfoFlowRepository;
|
||||
private final TbConsInfoFlowMapper tbConsInfoFlowMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(TbConsInfoFlowQueryCriteria criteria, Pageable pageable){
|
||||
Page<TbConsInfoFlow> page = tbConsInfoFlowRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(tbConsInfoFlowMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbConsInfoFlowDto> queryAll(TbConsInfoFlowQueryCriteria criteria){
|
||||
return tbConsInfoFlowMapper.toDto(tbConsInfoFlowRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public TbConsInfoFlowDto findById(Integer id) {
|
||||
TbConsInfoFlow tbConsInfoFlow = tbConsInfoFlowRepository.findById(id).orElseGet(TbConsInfoFlow::new);
|
||||
ValidationUtil.isNull(tbConsInfoFlow.getId(),"TbConsInfoFlow","id",id);
|
||||
return tbConsInfoFlowMapper.toDto(tbConsInfoFlow);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TbConsInfoFlowDto create(TbConsInfoFlow resources) {
|
||||
return tbConsInfoFlowMapper.toDto(tbConsInfoFlowRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(TbConsInfoFlow resources) {
|
||||
TbConsInfoFlow tbConsInfoFlow = tbConsInfoFlowRepository.findById(resources.getId()).orElseGet(TbConsInfoFlow::new);
|
||||
ValidationUtil.isNull( tbConsInfoFlow.getId(),"TbConsInfoFlow","id",resources.getId());
|
||||
tbConsInfoFlow.copy(resources);
|
||||
tbConsInfoFlowRepository.save(tbConsInfoFlow);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
tbConsInfoFlowRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<TbConsInfoFlowDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (TbConsInfoFlowDto tbConsInfoFlow : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("耗材id", tbConsInfoFlow.getConsId());
|
||||
map.put("耗材名称", tbConsInfoFlow.getConName());
|
||||
map.put("变化值", tbConsInfoFlow.getAmount());
|
||||
map.put("变化后的值", tbConsInfoFlow.getBalance());
|
||||
map.put("操作代码", tbConsInfoFlow.getBizCode());
|
||||
map.put("操作说明", tbConsInfoFlow.getBizName());
|
||||
map.put("加减标识+/-", tbConsInfoFlow.getBizType());
|
||||
map.put(" createTime", tbConsInfoFlow.getCreateTime());
|
||||
map.put(" updateTime", tbConsInfoFlow.getUpdateTime());
|
||||
map.put("店铺id", tbConsInfoFlow.getShopId());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,146 @@
|
|||
package cn.ysk.cashier.cons.service.impl;
|
||||
|
||||
import cn.ysk.cashier.cons.domain.TbConsInfo;
|
||||
import cn.ysk.cashier.cons.domain.TbConsInfoFlow;
|
||||
import cn.ysk.cashier.cons.domain.TbConsType;
|
||||
import cn.ysk.cashier.cons.repository.TbConsInfoFlowRepository;
|
||||
import cn.ysk.cashier.cons.repository.TbConsTypeRepository;
|
||||
import cn.ysk.cashier.utils.FileUtil;
|
||||
import cn.ysk.cashier.utils.PageUtil;
|
||||
import cn.ysk.cashier.utils.QueryHelp;
|
||||
import cn.ysk.cashier.utils.ValidationUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import cn.ysk.cashier.cons.repository.TbConsInfoRepository;
|
||||
import cn.ysk.cashier.cons.service.TbConsInfoService;
|
||||
import cn.ysk.cashier.cons.service.dto.TbConsInfoDto;
|
||||
import cn.ysk.cashier.cons.service.dto.TbConsInfoQueryCriteria;
|
||||
import cn.ysk.cashier.cons.service.mapstruct.TbConsInfoMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TbConsInfoServiceImpl implements TbConsInfoService {
|
||||
|
||||
private final TbConsInfoRepository tbConsInfoRepository;
|
||||
private final TbConsInfoMapper tbConsInfoMapper;
|
||||
|
||||
public final TbConsTypeRepository tbConsTypeRepository;
|
||||
|
||||
public final TbConsInfoFlowRepository tbConsInfoFlowRepository;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(TbConsInfoQueryCriteria criteria, Pageable pageable){
|
||||
Page<TbConsInfo> page = tbConsInfoRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(tbConsInfoMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbConsInfoDto> queryAll(TbConsInfoQueryCriteria criteria){
|
||||
return tbConsInfoMapper.toDto(tbConsInfoRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public TbConsInfoDto findById(Integer id) {
|
||||
TbConsInfo tbConsInfo = tbConsInfoRepository.findById(id).orElseGet(TbConsInfo::new);
|
||||
ValidationUtil.isNull(tbConsInfo.getId(),"TbConsInfo","id",id);
|
||||
return tbConsInfoMapper.toDto(tbConsInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TbConsInfoDto create(TbConsInfo resources) throws Exception {
|
||||
|
||||
|
||||
TbConsType tbConsType= tbConsTypeRepository.getById(resources.getConTypeId());
|
||||
if(Objects.isNull(tbConsType)){
|
||||
throw new Exception("不存在的耗材类型");
|
||||
}
|
||||
|
||||
resources.setConTypeName(tbConsType.getConTypeName());
|
||||
resources.setLasterInStock(BigDecimal.ZERO);
|
||||
resources.setSurplusStock(BigDecimal.ZERO);
|
||||
resources.setStockNumber(BigDecimal.ZERO);
|
||||
resources.setCreateTime(new Timestamp(System.currentTimeMillis()));
|
||||
return tbConsInfoMapper.toDto(tbConsInfoRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(TbConsInfo resources) {
|
||||
TbConsInfo tbConsInfo = tbConsInfoRepository.findById(resources.getId()).orElseGet(TbConsInfo::new);
|
||||
ValidationUtil.isNull( tbConsInfo.getId(),"TbConsInfo","id",resources.getId());
|
||||
tbConsInfo.copy(resources);
|
||||
tbConsInfoRepository.save(tbConsInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
tbConsInfoRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<TbConsInfoDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (TbConsInfoDto tbConsInfo : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("耗材类型id", tbConsInfo.getConTypeId());
|
||||
map.put("耗材类型名称", tbConsInfo.getConTypeName());
|
||||
map.put("耗材代码", tbConsInfo.getConCode());
|
||||
map.put("耗材名称", tbConsInfo.getConName());
|
||||
map.put("库存值", tbConsInfo.getStockNumber());
|
||||
map.put("单位值", tbConsInfo.getConUnit());
|
||||
map.put("剩余库存", tbConsInfo.getSurplusStock());
|
||||
map.put("最近一次入库量", tbConsInfo.getLasterInStock());
|
||||
map.put("创建时间", tbConsInfo.getCreateTime());
|
||||
map.put("更新时间", tbConsInfo.getUpdateTime());
|
||||
map.put("店铺id", tbConsInfo.getShopId());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void stockIn(TbConsInfo resources) throws Exception {
|
||||
TbConsInfo info= tbConsInfoRepository.getById(resources.getId());
|
||||
if(Objects.isNull(info)){
|
||||
throw new Exception("不存在的耗材信息");
|
||||
}
|
||||
|
||||
info.setStockNumber(info.getStockNumber().add(resources.getStockNumber()));
|
||||
info.setLasterInStock(resources.getStockNumber());
|
||||
tbConsInfoRepository.save(info);
|
||||
|
||||
|
||||
TbConsInfoFlow flow=new TbConsInfoFlow();
|
||||
flow.setConsId(info.getId());
|
||||
flow.setShopId(info.getShopId());
|
||||
flow.setConName(info.getConName());
|
||||
flow.setAmount(resources.getStockNumber());
|
||||
flow.setBalance(info.getStockNumber());
|
||||
flow.setBizCode("stockIn");
|
||||
flow.setBizName("耗材入库");
|
||||
flow.setBizType("+");
|
||||
flow.setCreateTime(new Timestamp(System.currentTimeMillis()));
|
||||
tbConsInfoFlowRepository.save(flow);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
package cn.ysk.cashier.cons.service.impl;
|
||||
|
||||
import cn.ysk.cashier.cons.domain.TbConsType;
|
||||
import cn.ysk.cashier.utils.FileUtil;
|
||||
import cn.ysk.cashier.utils.PageUtil;
|
||||
import cn.ysk.cashier.utils.QueryHelp;
|
||||
import cn.ysk.cashier.utils.ValidationUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import cn.ysk.cashier.cons.repository.TbConsTypeRepository;
|
||||
import cn.ysk.cashier.cons.service.TbConsTypeService;
|
||||
import cn.ysk.cashier.cons.service.dto.TbConsTypeDto;
|
||||
import cn.ysk.cashier.cons.service.dto.TbConsTypeQueryCriteria;
|
||||
import cn.ysk.cashier.cons.service.mapstruct.TbConsTypeMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TbConsTypeServiceImpl implements TbConsTypeService {
|
||||
|
||||
private final TbConsTypeRepository tbConsTypeRepository;
|
||||
private final TbConsTypeMapper tbConsTypeMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(TbConsTypeQueryCriteria criteria, Pageable pageable){
|
||||
Page<TbConsType> page = tbConsTypeRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(tbConsTypeMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbConsTypeDto> queryAll(TbConsTypeQueryCriteria criteria){
|
||||
return tbConsTypeMapper.toDto(tbConsTypeRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public TbConsTypeDto findById(Integer id) {
|
||||
TbConsType tbConsType = tbConsTypeRepository.findById(id).orElseGet(TbConsType::new);
|
||||
ValidationUtil.isNull(tbConsType.getId(),"TbConsType","id",id);
|
||||
return tbConsTypeMapper.toDto(tbConsType);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TbConsTypeDto create(TbConsType resources) {
|
||||
return tbConsTypeMapper.toDto(tbConsTypeRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(TbConsType resources) {
|
||||
TbConsType tbConsType = tbConsTypeRepository.findById(resources.getId()).orElseGet(TbConsType::new);
|
||||
ValidationUtil.isNull( tbConsType.getId(),"TbConsType","id",resources.getId());
|
||||
tbConsType.copy(resources);
|
||||
tbConsTypeRepository.save(tbConsType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
tbConsTypeRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<TbConsTypeDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (TbConsTypeDto tbConsType : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("耗材类型代码", tbConsType.getConTypeCode());
|
||||
map.put("耗材名称", tbConsType.getConTypeName());
|
||||
map.put("状态 1 正常 0 禁用", tbConsType.getStatus());
|
||||
map.put("创建时间", tbConsType.getCreateTime());
|
||||
map.put("更新", tbConsType.getUpdateTime());
|
||||
map.put("店铺id", tbConsType.getShopId());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
package cn.ysk.cashier.cons.service.impl;
|
||||
|
||||
import cn.ysk.cashier.cons.domain.TbProskuCon;
|
||||
import cn.ysk.cashier.utils.FileUtil;
|
||||
import cn.ysk.cashier.utils.PageUtil;
|
||||
import cn.ysk.cashier.utils.QueryHelp;
|
||||
import cn.ysk.cashier.utils.ValidationUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import cn.ysk.cashier.cons.repository.TbProskuConRepository;
|
||||
import cn.ysk.cashier.cons.service.TbProskuConService;
|
||||
import cn.ysk.cashier.cons.service.dto.TbProskuConDto;
|
||||
import cn.ysk.cashier.cons.service.dto.TbProskuConQueryCriteria;
|
||||
import cn.ysk.cashier.cons.service.mapstruct.TbProskuConMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TbProskuConServiceImpl implements TbProskuConService {
|
||||
|
||||
private final TbProskuConRepository tbProskuConRepository;
|
||||
private final TbProskuConMapper tbProskuConMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(TbProskuConQueryCriteria criteria, Pageable pageable){
|
||||
Page<TbProskuCon> page = tbProskuConRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(tbProskuConMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbProskuConDto> queryAll(TbProskuConQueryCriteria criteria){
|
||||
return tbProskuConMapper.toDto(tbProskuConRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public TbProskuConDto findById(Integer id) {
|
||||
TbProskuCon tbProskuCon = tbProskuConRepository.findById(id).orElseGet(TbProskuCon::new);
|
||||
ValidationUtil.isNull(tbProskuCon.getId(),"TbProskuCon","id",id);
|
||||
return tbProskuConMapper.toDto(tbProskuCon);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TbProskuConDto create(TbProskuCon resources) throws Exception {
|
||||
int count=tbProskuConRepository.countByConInfoIdAndProductSkuIdAndShopId(resources.getConInfoId(), resources.getProductSkuId(), resources.getShopId());
|
||||
if(count>0){
|
||||
throw new Exception("对应的商品耗材信息已存在");
|
||||
}
|
||||
resources.setStatus("0");
|
||||
resources.setCreateTime(new Timestamp(System.currentTimeMillis()));
|
||||
return tbProskuConMapper.toDto(tbProskuConRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(TbProskuCon resources) {
|
||||
TbProskuCon tbProskuCon = tbProskuConRepository.findById(resources.getId()).orElseGet(TbProskuCon::new);
|
||||
ValidationUtil.isNull( tbProskuCon.getId(),"TbProskuCon","id",resources.getId());
|
||||
tbProskuCon.copy(resources);
|
||||
tbProskuConRepository.save(tbProskuCon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
tbProskuConRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<TbProskuConDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (TbProskuConDto tbProskuCon : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("商品规格id", tbProskuCon.getProductSkuId());
|
||||
map.put("耗材id", tbProskuCon.getConInfoId());
|
||||
map.put("状态 1 启用 0 禁用", tbProskuCon.getStatus());
|
||||
map.put("创建时间", tbProskuCon.getCreateTime());
|
||||
map.put("店铺id", tbProskuCon.getShopId());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
package cn.ysk.cashier.cons.service.impl;
|
||||
|
||||
import cn.ysk.cashier.cons.domain.ViewConSku;
|
||||
import cn.ysk.cashier.utils.FileUtil;
|
||||
import cn.ysk.cashier.utils.PageUtil;
|
||||
import cn.ysk.cashier.utils.QueryHelp;
|
||||
import cn.ysk.cashier.utils.ValidationUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import cn.ysk.cashier.cons.repository.ViewConSkuRepository;
|
||||
import cn.ysk.cashier.cons.service.ViewConSkuService;
|
||||
import cn.ysk.cashier.cons.service.dto.ViewConSkuDto;
|
||||
import cn.ysk.cashier.cons.service.dto.ViewConSkuQueryCriteria;
|
||||
import cn.ysk.cashier.cons.service.mapstruct.ViewConSkuMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author admin
|
||||
* @date 2024-06-24
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ViewConSkuServiceImpl implements ViewConSkuService {
|
||||
|
||||
private final ViewConSkuRepository viewConSkuRepository;
|
||||
private final ViewConSkuMapper viewConSkuMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(ViewConSkuQueryCriteria criteria, Pageable pageable){
|
||||
Page<ViewConSku> page = viewConSkuRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(viewConSkuMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ViewConSkuDto> queryAll(ViewConSkuQueryCriteria criteria){
|
||||
return viewConSkuMapper.toDto(viewConSkuRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public ViewConSkuDto findById(Integer id) {
|
||||
ViewConSku viewConSku = viewConSkuRepository.findById(id).orElseGet(ViewConSku::new);
|
||||
ValidationUtil.isNull(viewConSku.getId(),"ViewConSku","id",id);
|
||||
return viewConSkuMapper.toDto(viewConSku);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ViewConSkuDto create(ViewConSku resources) {
|
||||
return viewConSkuMapper.toDto(viewConSkuRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(ViewConSku resources) {
|
||||
ViewConSku viewConSku = viewConSkuRepository.findById(resources.getId()).orElseGet(ViewConSku::new);
|
||||
ValidationUtil.isNull( viewConSku.getId(),"ViewConSku","id",resources.getId());
|
||||
viewConSku.copy(resources);
|
||||
viewConSkuRepository.save(viewConSku);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
viewConSkuRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<ViewConSkuDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (ViewConSkuDto viewConSku : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("耗材id", viewConSku.getConInfoId());
|
||||
map.put("商品规格id", viewConSku.getProductSkuId());
|
||||
map.put("耗材名称", viewConSku.getConName());
|
||||
map.put("规格", viewConSku.getSpecSnap());
|
||||
map.put("商品名称", viewConSku.getName());
|
||||
map.put("店铺id", viewConSku.getShopId());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package cn.ysk.cashier.cons.service.mapstruct;
|
||||
|
||||
import cn.ysk.cashier.base.BaseMapper;
|
||||
import cn.ysk.cashier.cons.domain.TbConsInfoFlow;
|
||||
import cn.ysk.cashier.cons.service.dto.TbConsInfoFlowDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface TbConsInfoFlowMapper extends BaseMapper<TbConsInfoFlowDto, TbConsInfoFlow> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package cn.ysk.cashier.cons.service.mapstruct;
|
||||
|
||||
import cn.ysk.cashier.base.BaseMapper;
|
||||
import cn.ysk.cashier.cons.domain.TbConsInfo;
|
||||
import cn.ysk.cashier.cons.service.dto.TbConsInfoDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface TbConsInfoMapper extends BaseMapper<TbConsInfoDto, TbConsInfo> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package cn.ysk.cashier.cons.service.mapstruct;
|
||||
|
||||
import cn.ysk.cashier.base.BaseMapper;
|
||||
import cn.ysk.cashier.cons.domain.TbConsType;
|
||||
import cn.ysk.cashier.cons.service.dto.TbConsTypeDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface TbConsTypeMapper extends BaseMapper<TbConsTypeDto, TbConsType> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package cn.ysk.cashier.cons.service.mapstruct;
|
||||
|
||||
import cn.ysk.cashier.base.BaseMapper;
|
||||
import cn.ysk.cashier.cons.domain.TbProskuCon;
|
||||
import cn.ysk.cashier.cons.service.dto.TbProskuConDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-22
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface TbProskuConMapper extends BaseMapper<TbProskuConDto, TbProskuCon> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package cn.ysk.cashier.cons.service.mapstruct;
|
||||
|
||||
import cn.ysk.cashier.base.BaseMapper;
|
||||
import cn.ysk.cashier.cons.domain.ViewConSku;
|
||||
import cn.ysk.cashier.cons.service.dto.ViewConSkuDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @date 2024-06-24
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface ViewConSkuMapper extends BaseMapper<ViewConSkuDto, ViewConSku> {
|
||||
|
||||
}
|
||||
|
|
@ -3,8 +3,7 @@ spring:
|
|||
datasource:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
#driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:mysql://101.37.12.135:3306/fycashier?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true
|
||||
url: jdbc:mysql://101.37.12.135:3306/fycashier?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false
|
||||
username: fycashier
|
||||
password: Twc6MrzzjBiWSsjh
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
|
@ -49,11 +48,6 @@ spring:
|
|||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
rabbitmq:
|
||||
host: 121.40.128.145
|
||||
port: 5672
|
||||
username: admin
|
||||
password: Czg666888
|
||||
|
||||
# 登录相关配置
|
||||
login:
|
||||
|
|
@ -87,16 +81,16 @@ jwt:
|
|||
token-start-with: Bearer
|
||||
# 必须使用最少88位的Base64对该令牌进行编码
|
||||
base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI=
|
||||
# 令牌过期时间 此处单位/毫秒 ,默认7天,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
|
||||
token-validity-in-seconds: 604800000
|
||||
# 令牌过期时间 此处单位/毫秒 ,默认4小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
|
||||
token-validity-in-seconds: 14400000
|
||||
# 在线用户key
|
||||
online-key: online-token-
|
||||
# 验证码
|
||||
code-key: code-key-
|
||||
# token 续期检查时间范围(默认一天,单位默认毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
|
||||
detect: 86400000
|
||||
# 续期时间范围,默认 7天,这里单位毫秒
|
||||
renew: 604800000
|
||||
# token 续期检查时间范围(默认30分钟,单位毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
|
||||
detect: 1800000
|
||||
# 续期时间范围,默认1小时,单位毫秒
|
||||
renew: 3600000
|
||||
|
||||
#是否允许生成代码,生产环境设置为false
|
||||
generator:
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ spring:
|
|||
redis:
|
||||
#数据库索引
|
||||
database: ${REDIS_DB:0}
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
host: ${REDIS_HOST:101.37.12.135}
|
||||
port: ${REDIS_PORT:6379}
|
||||
password: ${REDIS_PWD:111111}
|
||||
#连接超时时间
|
||||
|
|
|
|||
Loading…
Reference in New Issue