From b5b1ad8b18b16520e0db04a87d57e6881198f1eb Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Wed, 30 Oct 2024 15:24:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=89=AF=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/ysk/cashier/cons/domain/SuppFlow.java | 2 + .../ysk/cashier/cons/domain/TbConsInfo.java | 7 + .../ysk/cashier/cons/domain/TbConsInfoV2.java | 10 +- .../cashier/cons/domain/ViewConsSuppFlow.java | 139 ------------------ .../cons/repository/TbConUnitRepository.java | 13 -- .../ViewConsSuppFlowRepository.java | 13 -- .../cons/rest/TbConUnitController.java | 82 ----------- .../cons/rest/ViewConsSuppFlowController.java | 64 -------- .../cons/service/TbConUnitService.java | 70 --------- .../cons/service/ViewConsSuppFlowService.java | 66 --------- .../cons/service/dto/TbConUnitDto.java | 52 ------- .../service/dto/TbConUnitQueryCriteria.java | 25 ---- .../cons/service/dto/TbConsInfoDto.java | 21 +-- .../cons/service/dto/ViewConsSuppFlowDto.java | 87 ----------- .../dto/ViewConsSuppFlowQueryCriteria.java | 43 ------ .../service/impl/TbConUnitServiceImpl.java | 138 ----------------- .../service/impl/TbConsInfoServiceImpl.java | 31 ++-- .../impl/ViewConsSuppFlowServiceImpl.java | 109 -------------- .../service/mapstruct/TbConUnitMapper.java | 16 -- .../mapstruct/ViewConsSuppFlowMapper.java | 16 -- 20 files changed, 40 insertions(+), 964 deletions(-) delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/ViewConsSuppFlow.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/cons/repository/TbConUnitRepository.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/cons/repository/ViewConsSuppFlowRepository.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConUnitController.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewConsSuppFlowController.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/cons/service/TbConUnitService.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/cons/service/ViewConsSuppFlowService.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/TbConUnitDto.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/TbConUnitQueryCriteria.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/ViewConsSuppFlowDto.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/ViewConsSuppFlowQueryCriteria.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConUnitServiceImpl.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/ViewConsSuppFlowServiceImpl.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/cons/service/mapstruct/TbConUnitMapper.java delete mode 100644 eladmin-system/src/main/java/cn/ysk/cashier/cons/service/mapstruct/ViewConsSuppFlowMapper.java diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/SuppFlow.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/SuppFlow.java index a41b2991..3baa92e7 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/SuppFlow.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/SuppFlow.java @@ -31,6 +31,8 @@ public class SuppFlow implements Serializable { public static class ConInfos{ private Integer conInfoId; + private String unit; + private BigDecimal price; private BigDecimal stockNumber; diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/TbConsInfo.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/TbConsInfo.java index f28ad88e..e2231b25 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/TbConsInfo.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/TbConsInfo.java @@ -53,6 +53,13 @@ public class TbConsInfo implements Serializable { @ApiModelProperty(value = "单位值") private String conUnit; + @Column(name = "`con_unit_two`") + @ApiModelProperty(value = "单位值") + private String conUnitTwo; + + @Column(name = "`con_unit_two_convert`") + @ApiModelProperty(value = "单位换算") + private BigDecimal conUnitTwoConvert; @Column(name = "`laster_in_stock`") @ApiModelProperty(value = "最近一次入库量") diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/TbConsInfoV2.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/TbConsInfoV2.java index 6696efb4..111aeb04 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/TbConsInfoV2.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/TbConsInfoV2.java @@ -47,7 +47,7 @@ public class TbConsInfoV2 implements Serializable { @ApiModelProperty(value = "库存值") private BigDecimal stockNumber; -// @Column(name = "`balance`") + // @Column(name = "`balance`") @ApiModelProperty(value = "实际库存值") private BigDecimal balance; @@ -55,6 +55,14 @@ public class TbConsInfoV2 implements Serializable { @ApiModelProperty(value = "单位值") private String conUnit; + @Column(name = "`con_unit_two`") + @ApiModelProperty(value = "单位值") + private String conUnitTwo; + + @Column(name = "`con_unit_two_convert`") + @ApiModelProperty(value = "单位换算") + private BigDecimal conUnitTwoConvert; + @Column(name = "`laster_in_stock`") @ApiModelProperty(value = "最近一次入库量") diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/ViewConsSuppFlow.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/ViewConsSuppFlow.java deleted file mode 100644 index 0aa98001..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/ViewConsSuppFlow.java +++ /dev/null @@ -1,139 +0,0 @@ -/* -* 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-07-03 -**/ -@Entity -@Data -@Table(name="view_cons_supp_flow") -public class ViewConsSuppFlow implements Serializable { - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "`id`") - @ApiModelProperty(value = "id") - private Integer id; - - @Column(name = "`con_info_id`",nullable = false) - @NotNull - @ApiModelProperty(value = "conInfoId") - private Integer conInfoId; - - @Column(name = "`shop_id`") - @ApiModelProperty(value = "店铺id") - private Integer shopId; - - @Column(name = "`sku_id`") - @ApiModelProperty(value = "skuId") - private Integer skuId; - - @Column(name = "`product_id`") - @ApiModelProperty(value = "productId") - private Integer productId; - - @Column(name = "`supplier_id`",nullable = false) - @NotNull - @ApiModelProperty(value = "supplierId") - private Integer supplierId; - - @Column(name = "`type`",nullable = false) - @NotBlank - @ApiModelProperty(value = "出入库类型: in 入库 out 出库") - private String type; - - @Column(name = "`stock_number`",nullable = false) - @NotNull - @ApiModelProperty(value = "数量") - private BigDecimal stockNumber; - - @Column(name = "`price`",nullable = false) - @NotNull - @ApiModelProperty(value = "进价") - private BigDecimal price; - - @Column(name = "`amount`",nullable = false) - @NotNull - @ApiModelProperty(value = "小计") - private BigDecimal amount; - - @Column(name = "`balance`",nullable = false) - @NotNull - @ApiModelProperty(value = "剩余库存") - private BigDecimal balance; - - @Column(name = "`accounts_payable`",nullable = false) - @NotNull - @ApiModelProperty(value = "应付款") - private BigDecimal accountsPayable; - - @Column(name = "`actual_payment`",nullable = false) - @NotNull - @ApiModelProperty(value = "实付款") - private BigDecimal actualPayment; - - @Column(name = "`payment_time`") - @ApiModelProperty(value = "paymentTime") - private Timestamp paymentTime; - - @Column(name = "`create_time`") - @ApiModelProperty(value = "createTime") - private Timestamp createTime; - - @Column(name = "`update_time`") - @ApiModelProperty(value = "updateTime") - private Timestamp updateTime; - - @Column(name = "`con_name`") - @ApiModelProperty(value = "耗材名称") - private String conName; - - @Column(name = "`con_code`") - @ApiModelProperty(value = "耗材代码") - private String conCode; - - @Column(name = "`con_type_name`") - @ApiModelProperty(value = "耗材类型名称") - private String conTypeName; - - @Column(name = "`purveyor_name`") - @ApiModelProperty(value = "联系人名字") - private String purveyorName; - - @Column(name = "`address`") - @ApiModelProperty(value = "供应商地址") - private String address; - - @Column(name = "`purveyor_telephone`") - @ApiModelProperty(value = "联系人电话") - private String purveyorTelephone; - - public void copy(ViewConsSuppFlow source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); - } -} diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/repository/TbConUnitRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/repository/TbConUnitRepository.java deleted file mode 100644 index c18295b6..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/repository/TbConUnitRepository.java +++ /dev/null @@ -1,13 +0,0 @@ -package cn.ysk.cashier.cons.repository; - -import cn.ysk.cashier.cons.domain.TbConUnit; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -/** -* @website https://eladmin.vip -* @author admin -* @date 2024-07-12 -**/ -public interface TbConUnitRepository extends JpaRepository, JpaSpecificationExecutor { -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/repository/ViewConsSuppFlowRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/repository/ViewConsSuppFlowRepository.java deleted file mode 100644 index ca6903b8..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/repository/ViewConsSuppFlowRepository.java +++ /dev/null @@ -1,13 +0,0 @@ -package cn.ysk.cashier.cons.repository; - -import cn.ysk.cashier.cons.domain.ViewConsSuppFlow; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -/** -* @website https://eladmin.vip -* @author admin -* @date 2024-07-03 -**/ -public interface ViewConsSuppFlowRepository extends JpaRepository, JpaSpecificationExecutor { -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConUnitController.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConUnitController.java deleted file mode 100644 index 1b572f8c..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConUnitController.java +++ /dev/null @@ -1,82 +0,0 @@ -package cn.ysk.cashier.cons.rest; - -import cn.hutool.core.util.ObjectUtil; -import cn.ysk.cashier.annotation.Log; -import cn.ysk.cashier.cons.domain.TbConUnit; -import cn.ysk.cashier.cons.service.TbConUnitService; -import cn.ysk.cashier.cons.service.dto.TbConUnitQueryCriteria; -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 java.util.Objects; -import javax.servlet.http.HttpServletResponse; - -/** -* @author admin -* @date 2024-07-12 -**/ -@RestController -@RequiredArgsConstructor -@Api(tags = "耗材单位添加管理") -@RequestMapping("/api/tbConUnit") -public class TbConUnitController { - - private final TbConUnitService tbConUnitService; - - @Log("导出数据") - @ApiOperation("导出数据") - @GetMapping(value = "/download") - public void exportTbConUnit(HttpServletResponse response, TbConUnitQueryCriteria criteria) throws IOException { - tbConUnitService.download(tbConUnitService.queryAll(criteria), response); - } - - @GetMapping - @ApiOperation("查询耗材单位添加") - public ResponseEntity queryTbConUnit(TbConUnitQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(tbConUnitService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @PostMapping - @Log("新增耗材单位添加") - @ApiOperation("新增耗材单位添加") - public ResponseEntity createTbConUnit(@Validated @RequestBody TbConUnit resources){ - - if(ObjectUtil.isEmpty(resources.getParentId())|| Objects.isNull(resources.getParentId())){ - resources.setParentId(0); - } - resources.setStatus("0"); - resources.setCreateTime(new Timestamp(System.currentTimeMillis())); - return new ResponseEntity<>(tbConUnitService.create(resources),HttpStatus.CREATED); - } - - @PutMapping - @Log("修改耗材单位添加") - @ApiOperation("修改耗材单位添加") - public ResponseEntity updateTbConUnit(@Validated @RequestBody TbConUnit resources){ - - resources.setUpdateTime(new Timestamp(System.currentTimeMillis())); - tbConUnitService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @DeleteMapping - @Log("删除耗材单位添加") - @ApiOperation("删除耗材单位添加") - public ResponseEntity deleteTbConUnit(@RequestBody Integer[] ids) { - tbConUnitService.deleteAll(ids); - return new ResponseEntity<>(HttpStatus.OK); - } - - - - @RequestMapping("queryTbConUnitInfo") - public ResponseEntity queryTbConUnitInfo(TbConUnitQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(tbConUnitService.queryAllInfo(criteria,pageable),HttpStatus.OK); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewConsSuppFlowController.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewConsSuppFlowController.java deleted file mode 100644 index 2c51372b..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewConsSuppFlowController.java +++ /dev/null @@ -1,64 +0,0 @@ -package cn.ysk.cashier.cons.rest; - -import cn.ysk.cashier.annotation.Log; -import cn.ysk.cashier.cons.domain.ViewConsSuppFlow; -import cn.ysk.cashier.cons.service.ViewConsSuppFlowService; -import cn.ysk.cashier.cons.service.dto.ViewConsSuppFlowQueryCriteria; -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-07-03 -**/ -@RestController -@RequiredArgsConstructor -@Api(tags = "出入库记录管理") -@RequestMapping("/api/viewConsSuppFlow") -public class ViewConsSuppFlowController { - - private final ViewConsSuppFlowService viewConsSuppFlowService; - - @Log("导出数据") - @ApiOperation("导出数据") - @GetMapping(value = "/download") - public void exportViewConsSuppFlow(HttpServletResponse response, ViewConsSuppFlowQueryCriteria criteria) throws IOException { - viewConsSuppFlowService.download(viewConsSuppFlowService.queryAll(criteria), response); - } - - @GetMapping - @ApiOperation("查询出入库记录") - public ResponseEntity queryViewConsSuppFlow(ViewConsSuppFlowQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(viewConsSuppFlowService.queryAll(criteria,pageable),HttpStatus.OK); - } - - @PostMapping - @Log("新增出入库记录") - @ApiOperation("新增出入库记录") - public ResponseEntity createViewConsSuppFlow(@Validated @RequestBody ViewConsSuppFlow resources){ - return new ResponseEntity<>(viewConsSuppFlowService.create(resources),HttpStatus.CREATED); - } - - @PutMapping - @Log("修改出入库记录") - @ApiOperation("修改出入库记录") - public ResponseEntity updateViewConsSuppFlow(@Validated @RequestBody ViewConsSuppFlow resources){ - viewConsSuppFlowService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @DeleteMapping - @Log("删除出入库记录") - @ApiOperation("删除出入库记录") - public ResponseEntity deleteViewConsSuppFlow(@RequestBody Integer[] ids) { - viewConsSuppFlowService.deleteAll(ids); - return new ResponseEntity<>(HttpStatus.OK); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/TbConUnitService.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/TbConUnitService.java deleted file mode 100644 index 57f11561..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/TbConUnitService.java +++ /dev/null @@ -1,70 +0,0 @@ -package cn.ysk.cashier.cons.service; - -import cn.ysk.cashier.cons.domain.TbConUnit; -import cn.ysk.cashier.cons.service.dto.TbConUnitDto; -import cn.ysk.cashier.cons.service.dto.TbConUnitQueryCriteria; -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-07-12 -**/ -public interface TbConUnitService { - - /** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(TbConUnitQueryCriteria criteria, Pageable pageable); - - /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(TbConUnitQueryCriteria criteria); - - /** - * 根据ID查询 - * @param id ID - * @return TbConUnitDto - */ - TbConUnitDto findById(Integer id); - - /** - * 创建 - * @param resources / - * @return TbConUnitDto - */ - TbConUnitDto create(TbConUnit resources); - - /** - * 编辑 - * @param resources / - */ - void update(TbConUnit resources); - - /** - * 多选删除 - * @param ids / - */ - void deleteAll(Integer[] ids); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; - - - - Map queryAllInfo(TbConUnitQueryCriteria criteria, Pageable pageable); -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/ViewConsSuppFlowService.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/ViewConsSuppFlowService.java deleted file mode 100644 index f3710e55..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/ViewConsSuppFlowService.java +++ /dev/null @@ -1,66 +0,0 @@ -package cn.ysk.cashier.cons.service; - -import cn.ysk.cashier.cons.domain.ViewConsSuppFlow; -import cn.ysk.cashier.cons.service.dto.ViewConsSuppFlowDto; -import cn.ysk.cashier.cons.service.dto.ViewConsSuppFlowQueryCriteria; -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-07-03 -**/ -public interface ViewConsSuppFlowService { - - /** - * 查询数据分页 - * @param criteria 条件 - * @param pageable 分页参数 - * @return Map - */ - Map queryAll(ViewConsSuppFlowQueryCriteria criteria, Pageable pageable); - - /** - * 查询所有数据不分页 - * @param criteria 条件参数 - * @return List - */ - List queryAll(ViewConsSuppFlowQueryCriteria criteria); - - /** - * 根据ID查询 - * @param id ID - * @return ViewConsSuppFlowDto - */ - ViewConsSuppFlowDto findById(Integer id); - - /** - * 创建 - * @param resources / - * @return ViewConsSuppFlowDto - */ - ViewConsSuppFlowDto create(ViewConsSuppFlow resources); - - /** - * 编辑 - * @param resources / - */ - void update(ViewConsSuppFlow resources); - - /** - * 多选删除 - * @param ids / - */ - void deleteAll(Integer[] ids); - - /** - * 导出数据 - * @param all 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List all, HttpServletResponse response) throws IOException; -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/TbConUnitDto.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/TbConUnitDto.java deleted file mode 100644 index 83f0b899..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/TbConUnitDto.java +++ /dev/null @@ -1,52 +0,0 @@ -/* -* 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 io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.persistence.Column; -import javax.validation.constraints.NotNull; -import java.sql.Timestamp; -import java.math.BigDecimal; -import java.io.Serializable; - -/** -* @author admin -* @date 2024-07-12 -**/ -@Data -public class TbConUnitDto implements Serializable { - - private Integer id; - - /** 主单位名称 */ - private String name; - - /** 主单位值 */ - private BigDecimal value; - - private Integer parentId; - - private String isConsume; - - /** 状态 1 启用 0 禁用 */ - private String status; - - private Timestamp createTime; - - private Timestamp updateTime; -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/TbConUnitQueryCriteria.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/TbConUnitQueryCriteria.java deleted file mode 100644 index 17259f4f..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/TbConUnitQueryCriteria.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.ysk.cashier.cons.service.dto; - -import lombok.Data; -import java.util.List; -import cn.ysk.cashier.annotation.Query; - -/** -* @author admin -* @date 2024-07-12 -**/ -@Data -public class TbConUnitQueryCriteria{ - - /** 模糊 */ - @Query(type = Query.Type.INNER_LIKE) - private String name; - - /** 精确 */ - @Query - private Integer parentId; - - /** 精确 */ - @Query - private String status; -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/TbConsInfoDto.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/TbConsInfoDto.java index d4773b5b..a4b0bf17 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/TbConsInfoDto.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/TbConsInfoDto.java @@ -1,24 +1,7 @@ -/* -* 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 io.swagger.annotations.ApiModelProperty; import lombok.Data; -import javax.persistence.Column; import java.sql.Timestamp; import java.math.BigDecimal; import java.io.Serializable; @@ -53,6 +36,10 @@ public class TbConsInfoDto implements Serializable { /** 单位值 */ private String conUnit; + private String conUnitTwo; + + private BigDecimal conUnitTwoConvert; + /** 最近一次入库量 */ private BigDecimal lasterInStock; diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/ViewConsSuppFlowDto.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/ViewConsSuppFlowDto.java deleted file mode 100644 index e71a6a13..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/ViewConsSuppFlowDto.java +++ /dev/null @@ -1,87 +0,0 @@ -/* -* 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-07-03 -**/ -@Data -public class ViewConsSuppFlowDto implements Serializable { - - private Integer id; - - private Integer conInfoId; - - /** 店铺id */ - private Integer shopId; - - private Integer skuId; - - private Integer productId; - - private Integer supplierId; - - /** 出入库类型: in 入库 out 出库 */ - private String type; - - /** 数量 */ - private BigDecimal stockNumber; - - /** 进价 */ - private BigDecimal price; - - /** 小计 */ - private BigDecimal amount; - - /** 剩余库存 */ - private BigDecimal balance; - - /** 应付款 */ - private BigDecimal accountsPayable; - - /** 实付款 */ - private BigDecimal actualPayment; - - private Timestamp paymentTime; - - private Timestamp createTime; - - private Timestamp updateTime; - - /** 耗材名称 */ - private String conName; - - /** 耗材代码 */ - private String conCode; - - /** 耗材类型名称 */ - private String conTypeName; - - /** 联系人名字 */ - private String purveyorName; - - /** 供应商地址 */ - private String address; - - /** 联系人电话 */ - private String purveyorTelephone; -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/ViewConsSuppFlowQueryCriteria.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/ViewConsSuppFlowQueryCriteria.java deleted file mode 100644 index b36dccdc..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/ViewConsSuppFlowQueryCriteria.java +++ /dev/null @@ -1,43 +0,0 @@ -package cn.ysk.cashier.cons.service.dto; - -import cn.ysk.cashier.utils.JSONUtil; -import lombok.Data; -import java.util.List; -import cn.ysk.cashier.annotation.Query; - -/** -* @author admin -* @date 2024-07-03 -**/ -@Data -public class ViewConsSuppFlowQueryCriteria{ - - /** 精确 */ - @Query - private Integer conInfoId; - - /** 精确 */ - @Query - private String type; - - /** 模糊 */ - @Query(type = Query.Type.INNER_LIKE) - private String conName; - - /** 精确 */ - @Query - private String conCode; - - /** 精确 */ - @Query - private String conTypeName; - - /** 模糊 */ - @Query(type = Query.Type.INNER_LIKE) - private String purveyorName; - - - public static void main(String[] args){ - System.out.println(JSONUtil.toJSONString(new ViewConsSuppFlowQueryCriteria())); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConUnitServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConUnitServiceImpl.java deleted file mode 100644 index ac7d4697..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConUnitServiceImpl.java +++ /dev/null @@ -1,138 +0,0 @@ -package cn.ysk.cashier.cons.service.impl; - -import cn.hutool.core.util.ObjectUtil; -import cn.ysk.cashier.cons.domain.TbConUnit; -import cn.ysk.cashier.cons.service.dto.ConUnitPO; -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.TbConUnitRepository; -import cn.ysk.cashier.cons.service.TbConUnitService; -import cn.ysk.cashier.cons.service.dto.TbConUnitDto; -import cn.ysk.cashier.cons.service.dto.TbConUnitQueryCriteria; -import cn.ysk.cashier.cons.service.mapstruct.TbConUnitMapper; -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.*; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - -/** -* @website https://eladmin.vip -* @description 服务实现 -* @author admin -* @date 2024-07-12 -**/ -@Service -@RequiredArgsConstructor -public class TbConUnitServiceImpl implements TbConUnitService { - - private final TbConUnitRepository tbConUnitRepository; - private final TbConUnitMapper tbConUnitMapper; - - @Override - public Map queryAll(TbConUnitQueryCriteria criteria, Pageable pageable){ - Page page = tbConUnitRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(tbConUnitMapper::toDto)); - } - - @Override - public List queryAll(TbConUnitQueryCriteria criteria){ - return tbConUnitMapper.toDto(tbConUnitRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); - } - - @Override - @Transactional - public TbConUnitDto findById(Integer id) { - TbConUnit tbConUnit = tbConUnitRepository.findById(id).orElseGet(TbConUnit::new); - ValidationUtil.isNull(tbConUnit.getId(),"TbConUnit","id",id); - return tbConUnitMapper.toDto(tbConUnit); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public TbConUnitDto create(TbConUnit resources) { - return tbConUnitMapper.toDto(tbConUnitRepository.save(resources)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(TbConUnit resources) { - TbConUnit tbConUnit = tbConUnitRepository.findById(resources.getId()).orElseGet(TbConUnit::new); - ValidationUtil.isNull( tbConUnit.getId(),"TbConUnit","id",resources.getId()); - tbConUnit.copy(resources); - tbConUnitRepository.save(tbConUnit); - } - - @Override - public void deleteAll(Integer[] ids) { - for (Integer id : ids) { - tbConUnitRepository.deleteById(id); - } - } - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (TbConUnitDto tbConUnit : all) { - Map map = new LinkedHashMap<>(); - map.put("主单位名称", tbConUnit.getName()); - map.put("主单位值", tbConUnit.getValue()); - map.put("状态 1 启用 0 禁用", tbConUnit.getStatus()); - map.put(" createTime", tbConUnit.getCreateTime()); - map.put(" updateTime", tbConUnit.getUpdateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } - - @Override - public Map queryAllInfo(TbConUnitQueryCriteria criteria, Pageable pageable) { - List list=new ArrayList<>(); - if(ObjectUtil.isEmpty(criteria.getParentId())){ - criteria.setParentId(0); - } - Page page = tbConUnitRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - if(Objects.nonNull(page)&&Objects.nonNull(page.getContent())){ - page.getContent().parallelStream().forEach(it->{ - ConUnitPO po=new ConUnitPO(); - po.setId(it.getId()); - po.setName(it.getName()); - po.setValue(it.getValue()); - po.setIsConsume(it.getIsConsume()); - po.setCreateTime(it.getCreateTime()); - po.setUpdateTime(it.getUpdateTime()); - - criteria.setParentId(it.getId()); - criteria.setName(null); - criteria.setStatus(null); - Page childPage = tbConUnitRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - if(Objects.nonNull(childPage)&&Objects.nonNull(childPage.getContent())){ - List list1=new ArrayList<>(); - for (TbConUnit tbConUnit : childPage.getContent()) { - ConUnitPO child=new ConUnitPO(); - child.setId(tbConUnit.getId()); - child.setName(tbConUnit.getName()); - child.setValue(tbConUnit.getValue()); - child.setIsConsume(tbConUnit.getIsConsume()); - child.setCreateTime(tbConUnit.getCreateTime()); - child.setUpdateTime(tbConUnit.getUpdateTime()); - list1.add(child); - } - po.setChildConUnit(list1); - } - list.add(po); - }); - } - Map map = new LinkedHashMap<>(2); - map.put("content",list); - map.put("totalElements",page.getTotalElements()); - return map; - - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConsInfoServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConsInfoServiceImpl.java index 2b6e42f3..3b7a1451 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConsInfoServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConsInfoServiceImpl.java @@ -229,6 +229,11 @@ public class TbConsInfoServiceImpl implements TbConsInfoService { log.info("耗材信息不存在"); continue; } + BigDecimal changeStock = conInfos.getStockNumber(); + //副单位的实际修改值 + if (StringUtils.isNotBlank(conInfos.getUnit()) && conInfos.getUnit().equals(info.getConUnitTwo())) { + changeStock = conInfos.getStockNumber().multiply(info.getConUnitTwoConvert()).setScale(2, BigDecimal.ROUND_HALF_UP); + } TbConsSuppFlow suppFlow = new TbConsSuppFlow(); @@ -246,17 +251,17 @@ public class TbConsInfoServiceImpl implements TbConsInfoService { suppFlow.setShopId(resources.getShopId()); suppFlow.setSupplierId(Objects.isNull(resources.getSupplierId()) ? 0 : resources.getSupplierId()); suppFlow.setType(resources.getType()); - suppFlow.setStockNumber(conInfos.getStockNumber()); - + suppFlow.setStockNumber(changeStock); + //实际库存 BigDecimal amount = info.getStockNumber().subtract(info.getStockConsume()); if ("in".equals(resources.getType())) { stockOperate.setSubType(1); - info.setStockNumber(info.getStockNumber().add(conInfos.getStockNumber())); - info.setLasterInStock(conInfos.getStockNumber()); + info.setStockNumber(info.getStockNumber().add(changeStock)); + info.setLasterInStock(changeStock); - suppFlow.setBalance(info.getStockNumber().subtract(info.getStockConsume()).add(conInfos.getStockNumber())); + suppFlow.setBalance(info.getStockNumber().subtract(info.getStockConsume()).add(changeStock)); flow.setBizCode("stockIn"); @@ -268,19 +273,19 @@ public class TbConsInfoServiceImpl implements TbConsInfoService { purveyorTransact.setWaitAmount((resources.getAccountsPayable().subtract(resources.getActualPayment()))); purveyorTransact.setType("cons_in"); - object.put("number", conInfos.getStockNumber()); + object.put("number", changeStock); } else if ("out".equals(resources.getType())) { stockOperate.setSubType(-1); - if (conInfos.getStockNumber().compareTo(info.getStockNumber().subtract(info.getStockConsume())) > 0) { + if (changeStock.compareTo(amount) > 0) { throw new BadRequestException("出库数量大于现有的库存数量"); } - info.setStockNumber(info.getStockNumber().subtract(conInfos.getStockNumber())); + info.setStockNumber(info.getStockNumber().subtract(changeStock)); - suppFlow.setBalance(info.getStockNumber().subtract(info.getStockConsume()).subtract(conInfos.getStockNumber())); + suppFlow.setBalance(info.getStockNumber().subtract(info.getStockConsume()).subtract(changeStock)); flow.setBizCode("stockout"); @@ -292,7 +297,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService { purveyorTransact.setWaitAmount((resources.getAccountsPayable().subtract(resources.getActualPayment())).negate()); purveyorTransact.setType("cons_out"); - object.put("number", conInfos.getStockNumber()); + object.put("number", changeStock); } else { throw new BadRequestException("错误操作类型"); @@ -302,7 +307,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService { object.put("stockNumber", amount); object.put("name", info.getConName()); - object.put("unitName", info.getConUnit()); + object.put("unitName", StringUtils.isBlank(conInfos.getUnit()) ? info.getConUnit() : conInfos.getUnit()); array.add(object); suppFlow.setPrice(conInfos.getPrice()); @@ -319,7 +324,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService { } purveyorTransact.setPaidAt(System.currentTimeMillis()); - + //供应商 purveyorTransactRepository.save(purveyorTransact); if (resources.getSupplierId() != null) { tbShopPurveyorRepository.upLastTransactAt(resources.getSupplierId().toString()); @@ -333,7 +338,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService { flow.setConsId(info.getId()); flow.setShopId(info.getShopId()); flow.setConName(info.getConName()); - flow.setAmount(conInfos.getStockNumber()); + flow.setAmount(changeStock); flow.setRemark(resources.getRemark()); flow.setBalance(info.getStockNumber().subtract(info.getStockConsume())); flow.setOperator(SecurityUtils.getCurrentUserNickName()); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/ViewConsSuppFlowServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/ViewConsSuppFlowServiceImpl.java deleted file mode 100644 index f65f68ad..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/ViewConsSuppFlowServiceImpl.java +++ /dev/null @@ -1,109 +0,0 @@ -package cn.ysk.cashier.cons.service.impl; - -import cn.ysk.cashier.cons.domain.ViewConsSuppFlow; -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.ViewConsSuppFlowRepository; -import cn.ysk.cashier.cons.service.ViewConsSuppFlowService; -import cn.ysk.cashier.cons.service.dto.ViewConsSuppFlowDto; -import cn.ysk.cashier.cons.service.dto.ViewConsSuppFlowQueryCriteria; -import cn.ysk.cashier.cons.service.mapstruct.ViewConsSuppFlowMapper; -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-07-03 -**/ -@Service -@RequiredArgsConstructor -public class ViewConsSuppFlowServiceImpl implements ViewConsSuppFlowService { - - private final ViewConsSuppFlowRepository viewConsSuppFlowRepository; - private final ViewConsSuppFlowMapper viewConsSuppFlowMapper; - - @Override - public Map queryAll(ViewConsSuppFlowQueryCriteria criteria, Pageable pageable){ - Page page = viewConsSuppFlowRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(viewConsSuppFlowMapper::toDto)); - } - - @Override - public List queryAll(ViewConsSuppFlowQueryCriteria criteria){ - return viewConsSuppFlowMapper.toDto(viewConsSuppFlowRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); - } - - @Override - @Transactional - public ViewConsSuppFlowDto findById(Integer id) { - ViewConsSuppFlow viewConsSuppFlow = viewConsSuppFlowRepository.findById(id).orElseGet(ViewConsSuppFlow::new); - ValidationUtil.isNull(viewConsSuppFlow.getId(),"ViewConsSuppFlow","id",id); - return viewConsSuppFlowMapper.toDto(viewConsSuppFlow); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public ViewConsSuppFlowDto create(ViewConsSuppFlow resources) { - return viewConsSuppFlowMapper.toDto(viewConsSuppFlowRepository.save(resources)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(ViewConsSuppFlow resources) { - ViewConsSuppFlow viewConsSuppFlow = viewConsSuppFlowRepository.findById(resources.getId()).orElseGet(ViewConsSuppFlow::new); - ValidationUtil.isNull( viewConsSuppFlow.getId(),"ViewConsSuppFlow","id",resources.getId()); - viewConsSuppFlow.copy(resources); - viewConsSuppFlowRepository.save(viewConsSuppFlow); - } - - @Override - public void deleteAll(Integer[] ids) { - for (Integer id : ids) { - viewConsSuppFlowRepository.deleteById(id); - } - } - - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (ViewConsSuppFlowDto viewConsSuppFlow : all) { - Map map = new LinkedHashMap<>(); - map.put(" conInfoId", viewConsSuppFlow.getConInfoId()); - map.put("店铺id", viewConsSuppFlow.getShopId()); - map.put(" skuId", viewConsSuppFlow.getSkuId()); - map.put(" productId", viewConsSuppFlow.getProductId()); - map.put(" supplierId", viewConsSuppFlow.getSupplierId()); - map.put("出入库类型: in 入库 out 出库", viewConsSuppFlow.getType()); - map.put("数量", viewConsSuppFlow.getStockNumber()); - map.put("进价", viewConsSuppFlow.getPrice()); - map.put("小计", viewConsSuppFlow.getAmount()); - map.put("剩余库存", viewConsSuppFlow.getBalance()); - map.put("应付款", viewConsSuppFlow.getAccountsPayable()); - map.put("实付款", viewConsSuppFlow.getActualPayment()); - map.put(" paymentTime", viewConsSuppFlow.getPaymentTime()); - map.put(" createTime", viewConsSuppFlow.getCreateTime()); - map.put(" updateTime", viewConsSuppFlow.getUpdateTime()); - map.put("耗材名称", viewConsSuppFlow.getConName()); - map.put("耗材代码", viewConsSuppFlow.getConCode()); - map.put("耗材类型名称", viewConsSuppFlow.getConTypeName()); - map.put("联系人名字", viewConsSuppFlow.getPurveyorName()); - map.put("供应商地址", viewConsSuppFlow.getAddress()); - map.put("联系人电话", viewConsSuppFlow.getPurveyorTelephone()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/mapstruct/TbConUnitMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/mapstruct/TbConUnitMapper.java deleted file mode 100644 index 915e25e3..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/mapstruct/TbConUnitMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package cn.ysk.cashier.cons.service.mapstruct; - -import cn.ysk.cashier.base.BaseMapper; -import cn.ysk.cashier.cons.domain.TbConUnit; -import cn.ysk.cashier.cons.service.dto.TbConUnitDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @author admin -* @date 2024-07-12 -**/ -@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface TbConUnitMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/mapstruct/ViewConsSuppFlowMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/mapstruct/ViewConsSuppFlowMapper.java deleted file mode 100644 index d8b4a83a..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/mapstruct/ViewConsSuppFlowMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package cn.ysk.cashier.cons.service.mapstruct; - -import cn.ysk.cashier.base.BaseMapper; -import cn.ysk.cashier.cons.domain.ViewConsSuppFlow; -import cn.ysk.cashier.cons.service.dto.ViewConsSuppFlowDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @author admin -* @date 2024-07-03 -**/ -@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface ViewConsSuppFlowMapper extends BaseMapper { - -} \ No newline at end of file From bd08205426d63f7f2b948947a8cb981a960d437a Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Wed, 30 Oct 2024 16:58:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E6=89=93=E5=8C=85=E8=B5=A0=E9=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/shopimpl/TbShopTableServiceImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java index bffc184e..c72dcd06 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java @@ -419,15 +419,17 @@ public class TbShopTableServiceImpl implements TbShopTableService { if (updateCartDTO.getIsPack() != null) { if (!updateCartDTO.getIsPack()) { tbCashierCart.setPackFee(BigDecimal.ZERO); + tbCashierCart.setTotalAmount(tbCashierCart.getSalePrice().multiply(BigDecimal.valueOf(tbCashierCart.getNumber()))); } else { tbCashierCart.setPackFee(new BigDecimal(updateCartDTO.getNum()).multiply(product.getPackFee())); - tbCashierCart.setTotalAmount(tbCashierCart.getTotalAmount().add(tbCashierCart.getPackFee())); + tbCashierCart.setTotalAmount(tbCashierCart.getSalePrice().multiply(BigDecimal.valueOf(tbCashierCart.getNumber())) + .add(tbCashierCart.getPackFee())); } tbCashierCart.setIsPack(updateCartDTO.getIsPack() ? "true" : "false"); } if (updateCartDTO.getIsGift() != null) { - tbCashierCart.setTotalAmount(updateCartDTO.getIsGift() ? tbCashierCart.getPackFee() : tbCashierCart.getTotalAmount()); + tbCashierCart.setTotalAmount(updateCartDTO.getIsGift() ? BigDecimal.ZERO : tbCashierCart.getTotalAmount()); tbCashierCart.setIsGift(updateCartDTO.getIsGift() ? "true" : "false"); }