1
This commit is contained in:
1 parent
81fee6d63c
commit
68a8572c67
20 files changed
+1311
-2
No files matched your search
+4
-2
@@ -10,8 +10,10 @@ import lombok.Getter;
|
||||
@Getter
|
||||
public enum InventoryTypeEnum {
|
||||
|
||||
CGRK(1, "CGRK"),
|
||||
// CK("2", "出库"),
|
||||
CGRK(1, "CGSQ"),
|
||||
CKDD(2, "CGDD"),
|
||||
CKRK(3, "CGRK"),
|
||||
CKTH(4, "CGTH")
|
||||
;
|
||||
private final Integer type;
|
||||
private final String value;
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.bsd.pjcloud.supermarket.dto.cgdd;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "采购计划选择商品分页查询dto")
|
||||
public class ErpCgDDDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@Schema(description="商品名称")
|
||||
private String productName;
|
||||
|
||||
|
||||
/**
|
||||
* 货号
|
||||
*/
|
||||
@Schema(description="货号")
|
||||
private String productCode;
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
package com.bsd.pjcloud.supermarket.dto.cgdd;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* 新增一个采购计划
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "采购计划保存对象")
|
||||
public class ErpCgDDEditDTO {
|
||||
|
||||
|
||||
@Schema(description ="id")
|
||||
private Long id;
|
||||
/**
|
||||
* 采购计划编号
|
||||
*/
|
||||
@Schema(description="采购计划编号")
|
||||
private String planCode;
|
||||
|
||||
/**
|
||||
* 采购计划单据日期
|
||||
*/
|
||||
@Schema(description="采购计划单据日期")
|
||||
private LocalDate planDate;
|
||||
|
||||
/**
|
||||
* 仓库id
|
||||
*/
|
||||
@Schema(description="仓库id")
|
||||
private String warehouseId;
|
||||
|
||||
/**
|
||||
* 经办人id
|
||||
*/
|
||||
@Schema(description="经办人id")
|
||||
private Long handlerUserId;
|
||||
|
||||
|
||||
/**
|
||||
* 累计进货数量
|
||||
*/
|
||||
@Schema(description="累计进货数量")
|
||||
private Integer totalNumber;
|
||||
|
||||
/**
|
||||
* 累计总金额
|
||||
*/
|
||||
@Schema(description="累计总金额")
|
||||
private Integer totalAmount;
|
||||
|
||||
/**
|
||||
* 货商
|
||||
*/
|
||||
@Schema(description="货商")
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description="备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@Schema(description="订单编号")
|
||||
private String orderNumber;
|
||||
|
||||
|
||||
/**
|
||||
* @Link SmCgPlanEditItemDTO
|
||||
*/
|
||||
@Schema(description="采购计划-item")
|
||||
private List<SmCgDDEditItemDTO> items;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package com.bsd.pjcloud.supermarket.dto.cgdd;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* 新增一个采购计划
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "采购计划保存对象")
|
||||
public class ErpCgDDSaveDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 采购计划编号
|
||||
*/
|
||||
@Schema(description="采购计划编号")
|
||||
private String planCode;
|
||||
|
||||
/**
|
||||
* 采购计划单据日期
|
||||
*/
|
||||
@Schema(description="采购计划单据日期")
|
||||
private LocalDate planDate;
|
||||
|
||||
/**
|
||||
* 仓库id
|
||||
*/
|
||||
@Schema(description="仓库id")
|
||||
private String warehouseId;
|
||||
|
||||
/**
|
||||
* 经办人id
|
||||
*/
|
||||
@Schema(description="经办人id")
|
||||
private Long handlerUserId;
|
||||
|
||||
|
||||
/**
|
||||
* 累计进货数量
|
||||
*/
|
||||
@Schema(description="累计进货数量")
|
||||
private Integer totalNumber;
|
||||
|
||||
/**
|
||||
* 累计总金额
|
||||
*/
|
||||
@Schema(description="累计总金额")
|
||||
private Integer totalAmount;
|
||||
|
||||
/**
|
||||
* 货商
|
||||
*/
|
||||
@Schema(description="货商")
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description="备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@Schema(description="订单编号")
|
||||
private String orderNumber;
|
||||
|
||||
|
||||
/**
|
||||
* @Link SmCgPlanSaveItemDTO
|
||||
*/
|
||||
@Schema(description="采购计划-item")
|
||||
private List<SmCgDDSaveItemDTO> items;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
package com.bsd.pjcloud.supermarket.dto.cgdd;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 采购计划-item
|
||||
*
|
||||
* @author zjf
|
||||
* @date 2025-02-11 17:11:41
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "采购计划-item")
|
||||
public class SmCgDDEditItemDTO {
|
||||
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 库存商品id
|
||||
*/
|
||||
@Schema(description="库存商品id")
|
||||
private Long erpSpuId;
|
||||
|
||||
/**
|
||||
* 采购id
|
||||
*/
|
||||
@Schema(description="采购id")
|
||||
private Long planId;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@Schema(description="数量")
|
||||
private Integer quantity;
|
||||
|
||||
/**
|
||||
* 进价
|
||||
*/
|
||||
@Schema(description="进价")
|
||||
private Integer unitPrice;
|
||||
|
||||
/**
|
||||
* 累计总金额
|
||||
*/
|
||||
@Schema(description="累计总金额")
|
||||
private Integer totalAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description="备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 包装单位id
|
||||
*/
|
||||
@Schema(description="包装单位id")
|
||||
private Long unitId;
|
||||
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package com.bsd.pjcloud.supermarket.dto.cgdd;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 采购计划-item
|
||||
*
|
||||
* @author zjf
|
||||
* @date 2025-02-11 17:11:41
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "采购计划-item")
|
||||
public class SmCgDDSaveItemDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 库存商品id
|
||||
*/
|
||||
@Schema(description="库存商品id")
|
||||
private Long erpSpuId;
|
||||
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@Schema(description="数量")
|
||||
private Integer quantity;
|
||||
|
||||
/**
|
||||
* 进价
|
||||
*/
|
||||
@Schema(description="进价")
|
||||
private Integer unitPrice;
|
||||
|
||||
/**
|
||||
* 累计总金额
|
||||
*/
|
||||
@Schema(description="累计总金额")
|
||||
private Integer totalAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description="备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 包装单位id
|
||||
*/
|
||||
@Schema(description="包装单位id")
|
||||
private Long unitId;
|
||||
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
package com.bsd.pjcloud.supermarket.vo.cgdd;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.bsd.pjcloud.supermarket.vo.cgplan.SmeErpCgPlanItemVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "采购根据id查询-编辑回显 vo")
|
||||
@Data
|
||||
public class SmErpCgDdVo {
|
||||
|
||||
@Schema(description ="id")
|
||||
private Long id;
|
||||
/**
|
||||
* 采购计划编号
|
||||
*/
|
||||
@Schema(description="采购计划编号")
|
||||
private String planCode;
|
||||
|
||||
/**
|
||||
* 采购计划单据日期
|
||||
*/
|
||||
@Schema(description="采购计划单据日期")
|
||||
private LocalDate planDate;
|
||||
|
||||
/**
|
||||
* 仓库id
|
||||
*/
|
||||
@Schema(description="仓库id")
|
||||
private String warehouseId;
|
||||
|
||||
/**
|
||||
* 经办人id
|
||||
*/
|
||||
@Schema(description="经办人id")
|
||||
private Long handlerUserId;
|
||||
|
||||
|
||||
/**
|
||||
* 累计进货数量
|
||||
*/
|
||||
@Schema(description="累计进货数量")
|
||||
private Integer totalNumber;
|
||||
|
||||
/**
|
||||
* 累计总金额
|
||||
*/
|
||||
@Schema(description="累计总金额")
|
||||
private Integer totalAmount;
|
||||
|
||||
/**
|
||||
* 货商
|
||||
*/
|
||||
@Schema(description="货商")
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description="备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@Schema(description="订单编号")
|
||||
private String orderNumber;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 审批状态
|
||||
*/
|
||||
@Schema(description="审批状态")
|
||||
private String checkStatus;
|
||||
|
||||
|
||||
/**
|
||||
* @Link SmErpCgPlanVo
|
||||
*/
|
||||
@Schema(description="采购计划-item")
|
||||
private List<SmeErpCgDdItemVo> items;
|
||||
|
||||
}
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
package com.bsd.pjcloud.supermarket.vo.cgdd;
|
||||
|
||||
import com.bsd.pjcloud.common.core.util.MoneyDeserializer;
|
||||
import com.bsd.pjcloud.common.core.util.MoneySerializer;
|
||||
import com.bsd.pjcloud.supermarket.vo.cgplan.ErpUnitVo;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 采购计划-item
|
||||
*
|
||||
* @author zjf
|
||||
* @date 2025-02-11 17:11:41
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "采购计划-item")
|
||||
public class SmeErpCgDdItemVo {
|
||||
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 库存商品id
|
||||
*/
|
||||
@Schema(description="库存商品id")
|
||||
private Long erpSpuId;
|
||||
|
||||
/**
|
||||
* 采购id
|
||||
*/
|
||||
@Schema(description="采购id")
|
||||
private Long planId;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@Schema(description="数量")
|
||||
private Integer quantity;
|
||||
|
||||
/**
|
||||
* 进价
|
||||
*/
|
||||
@Schema(description="进价")
|
||||
private Integer unitPrice;
|
||||
|
||||
/**
|
||||
* 累计总金额
|
||||
*/
|
||||
@Schema(description="累计总金额")
|
||||
private Integer totalAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description="备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 包装单位id
|
||||
*/
|
||||
@Schema(description="包装单位id")
|
||||
private Long unitId;
|
||||
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@Schema(description="规格")
|
||||
private String spec;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@Schema(description="单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 装数
|
||||
*/
|
||||
@Schema(description="装数")
|
||||
private Integer packageNum;
|
||||
|
||||
/**
|
||||
* 进价(分为单位)
|
||||
*/
|
||||
@Schema(description="进价(分为单位)")
|
||||
@JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||
@JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||
private Integer purchasePrice;
|
||||
|
||||
@Schema(description = "包装对象集合对象")
|
||||
private List<ErpUnitVo> erpUnitVos;
|
||||
|
||||
|
||||
}
|
||||
+160
@@ -0,0 +1,160 @@
|
||||
package com.bsd.pjcloud.supermarket.controller;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgdd.ErpCgDDEditDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgdd.ErpCgDDSaveDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgplan.ErpCgPlanEditDTO;
|
||||
import com.bsd.pjcloud.supermarket.entity.*;
|
||||
import com.bsd.pjcloud.supermarket.service.SmErpCgDdItemService;
|
||||
import com.bsd.pjcloud.supermarket.service.SmErpCgDdService;
|
||||
import com.bsd.pjcloud.supermarket.service.SmErpUnitService;
|
||||
import com.bsd.pjcloud.supermarket.vo.cgdd.SmErpCgDdVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.cgdd.SmeErpCgDdItemVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.cgplan.ErpUnitVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.cgplan.SmeErpCgPlanItemVo;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 采购订单
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-02-18 13:23:21
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/smErpCgDd" )
|
||||
@Tag(description = "smErpCgDd" , name = "采购订单管理" )
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SmErpCgDdController {
|
||||
|
||||
private final SmErpCgDdService smErpCgDdService;
|
||||
|
||||
private final SmErpCgDdItemService smErpCgDdItemService;
|
||||
|
||||
private final SmErpUnitService smErpUnitService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param smErpCgDd 采购订单
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询" , description = "分页查询" )
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_smErpCgDd_view')" )
|
||||
public R getSmErpCgDdPage(@ParameterObject Page page, @ParameterObject SmErpCgDdEntity smErpCgDd) {
|
||||
LambdaQueryWrapper<SmErpCgDdEntity> wrapper = Wrappers.lambdaQuery();
|
||||
return R.ok(smErpCgDdService.page(page, wrapper));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询采购订单
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询" , description = "通过id查询" )
|
||||
@GetMapping("/{id}" )
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_smErpCgDd_view')" )
|
||||
public R getById(@PathVariable("id" ) Long id) {
|
||||
SmErpCgDdEntity smErpCgDdEntity = smErpCgDdService.getById(id);
|
||||
List<SmErpCgDdItemEntity> list = smErpCgDdItemService.list(new LambdaQueryWrapper<SmErpCgDdItemEntity>()
|
||||
.eq(SmErpCgDdItemEntity::getHId, id));
|
||||
|
||||
//获取采购item下已选择的item的所有包装单位
|
||||
List<Long> spuIds =list.stream().map(vo -> vo.getErpSpuId()).collect(Collectors.toList());
|
||||
List<SmErpUnitEntity> unitList = smErpUnitService.list(new LambdaQueryWrapper<SmErpUnitEntity>().in(SmErpUnitEntity::getSpuId, spuIds));
|
||||
|
||||
|
||||
|
||||
SmErpCgDdVo bean = BeanUtils.toBean(smErpCgDdEntity, SmErpCgDdVo.class, (source) -> {
|
||||
List<SmeErpCgDdItemVo> smeErpCgDdItemVos = BeanUtils.toBean(list, SmeErpCgDdItemVo.class);
|
||||
smeErpCgDdItemVos.stream().forEach(item -> {
|
||||
List<SmErpUnitEntity> unitEntities = unitList.stream().filter(unit -> unit.getSpuId().equals(item.getErpSpuId())).collect(Collectors.toList());
|
||||
|
||||
// unitList.stream().forEach(unit -> {
|
||||
// if(unit.getId().equals(item.getUnitId())){
|
||||
// item.setSpec(unit.getSpec());
|
||||
// item.setUnit(unit.getUnit());
|
||||
// item.setPackageNum(unit.getPackageNum());
|
||||
// item.setPurchasePrice(unit.getPurchasePrice());
|
||||
// }
|
||||
// });
|
||||
item.setErpUnitVos(BeanUtils.toBean(unitEntities, ErpUnitVo.class));
|
||||
});
|
||||
source.setItems(smeErpCgDdItemVos);
|
||||
});
|
||||
return R.ok(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增采购订单
|
||||
* @param erpCgDDSaveDTO 采购订单
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增采购订单" , description = "新增采购订单" )
|
||||
@SysLog("新增采购订单" )
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_smErpCgDd_add')" )
|
||||
public R save(@RequestBody ErpCgDDSaveDTO erpCgDDSaveDTO) {
|
||||
return R.ok(smErpCgDdService.saveCGDD(erpCgDDSaveDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改采购订单
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改采购订单" , description = "修改采购订单" )
|
||||
@SysLog("修改采购订单" )
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_smErpCgDd_edit')" )
|
||||
public R updateById(@RequestBody ErpCgDDEditDTO erpCgDDEditDTO) {
|
||||
|
||||
return R.ok(smErpCgDdService.updateByErpCgDdEditDTO(erpCgDDEditDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除采购订单
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除采购订单" , description = "通过id删除采购订单" )
|
||||
@SysLog("通过id删除采购订单" )
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_smErpCgDd_del')" )
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(smErpCgDdService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param smErpCgDd 查询条件
|
||||
* @param ids 导出指定ID
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_smErpCgDd_export')" )
|
||||
public List<SmErpCgDdEntity> export(SmErpCgDdEntity smErpCgDd,Long[] ids) {
|
||||
return smErpCgDdService.list(Wrappers.lambdaQuery(smErpCgDd).in(ArrayUtil.isNotEmpty(ids), SmErpCgDdEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
package com.bsd.pjcloud.supermarket.controller;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpCgDdItemEntity;
|
||||
import com.bsd.pjcloud.supermarket.service.SmErpCgDdItemService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 采购订单明细表-item
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-02-18 13:28:17
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/smErpCgDdItem" )
|
||||
@Tag(description = "smErpCgDdItem" , name = "采购订单明细表-item管理" )
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SmErpCgDdItemController {
|
||||
|
||||
private final SmErpCgDdItemService smErpCgDdItemService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param smErpCgDdItem 采购订单明细表-item
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询" , description = "分页查询" )
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_smErpCgDdItem_view')" )
|
||||
public R getSmErpCgDdItemPage(@ParameterObject Page page, @ParameterObject SmErpCgDdItemEntity smErpCgDdItem) {
|
||||
LambdaQueryWrapper<SmErpCgDdItemEntity> wrapper = Wrappers.lambdaQuery();
|
||||
return R.ok(smErpCgDdItemService.page(page, wrapper));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询采购订单明细表-item
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询" , description = "通过id查询" )
|
||||
@GetMapping("/{id}" )
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_smErpCgDdItem_view')" )
|
||||
public R getById(@PathVariable("id" ) Long id) {
|
||||
return R.ok(smErpCgDdItemService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增采购订单明细表-item
|
||||
* @param smErpCgDdItem 采购订单明细表-item
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增采购订单明细表-item" , description = "新增采购订单明细表-item" )
|
||||
@SysLog("新增采购订单明细表-item" )
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_smErpCgDdItem_add')" )
|
||||
public R save(@RequestBody SmErpCgDdItemEntity smErpCgDdItem) {
|
||||
return R.ok(smErpCgDdItemService.save(smErpCgDdItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改采购订单明细表-item
|
||||
* @param smErpCgDdItem 采购订单明细表-item
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改采购订单明细表-item" , description = "修改采购订单明细表-item" )
|
||||
@SysLog("修改采购订单明细表-item" )
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_smErpCgDdItem_edit')" )
|
||||
public R updateById(@RequestBody SmErpCgDdItemEntity smErpCgDdItem) {
|
||||
return R.ok(smErpCgDdItemService.updateById(smErpCgDdItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除采购订单明细表-item
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除采购订单明细表-item" , description = "通过id删除采购订单明细表-item" )
|
||||
@SysLog("通过id删除采购订单明细表-item" )
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_smErpCgDdItem_del')" )
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(smErpCgDdItemService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param smErpCgDdItem 查询条件
|
||||
* @param ids 导出指定ID
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_smErpCgDdItem_export')" )
|
||||
public List<SmErpCgDdItemEntity> export(SmErpCgDdItemEntity smErpCgDdItem,Long[] ids) {
|
||||
return smErpCgDdItemService.list(Wrappers.lambdaQuery(smErpCgDdItem).in(ArrayUtil.isNotEmpty(ids), SmErpCgDdItemEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+164
@@ -0,0 +1,164 @@
|
||||
package com.bsd.pjcloud.supermarket.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 采购订单
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-02-18 13:23:21
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("sm_erp_cg_dd")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "采购订单")
|
||||
public class SmErpCgDdEntity extends Model<SmErpCgDdEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Schema(description="编号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 单据日期
|
||||
*/
|
||||
@Schema(description="单据日期")
|
||||
private LocalDate dDate;
|
||||
|
||||
/**
|
||||
* 仓库id
|
||||
*/
|
||||
@Schema(description="仓库id")
|
||||
private String warehouseId;
|
||||
|
||||
/**
|
||||
* 经办人id
|
||||
*/
|
||||
@Schema(description="经办人id")
|
||||
private Long handlerUserId;
|
||||
|
||||
/**
|
||||
* 审批状态
|
||||
*/
|
||||
@Schema(description="审批状态")
|
||||
private String checkStatus;
|
||||
|
||||
/**
|
||||
* 审批人id
|
||||
*/
|
||||
@Schema(description="审批人id")
|
||||
private String checkUserId;
|
||||
|
||||
/**
|
||||
* 审核日期
|
||||
*/
|
||||
@Schema(description="审核日期")
|
||||
private LocalDateTime checkTime;
|
||||
|
||||
/**
|
||||
* 商户编号
|
||||
*/
|
||||
@Schema(description="商户编号")
|
||||
private Long merchantId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description="部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 出入库数量
|
||||
*/
|
||||
@Schema(description="出入库数量")
|
||||
private Integer quantity;
|
||||
|
||||
/**
|
||||
* 累计进货数量
|
||||
*/
|
||||
@Schema(description="累计进货数量")
|
||||
private Integer totalNumber;
|
||||
|
||||
/**
|
||||
* 累计总金额
|
||||
*/
|
||||
@Schema(description="累计总金额")
|
||||
private Integer totalAmount;
|
||||
|
||||
/**
|
||||
* 货商
|
||||
*/
|
||||
@Schema(description="货商")
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description="备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@Schema(description="订单编号")
|
||||
private String orderNumber;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="是否删除")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
@Schema(description="租户编号")
|
||||
private Long tenantId;
|
||||
}
|
||||
+151
@@ -0,0 +1,151 @@
|
||||
package com.bsd.pjcloud.supermarket.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 采购订单明细表-item
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-02-18 13:28:17
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("sm_erp_cg_dd_item")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "采购订单明细表-item")
|
||||
public class SmErpCgDdItemEntity extends Model<SmErpCgDdItemEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 主表id
|
||||
*/
|
||||
@Schema(description="主表id")
|
||||
private Long hId;
|
||||
|
||||
/**
|
||||
* 库存商品id
|
||||
*/
|
||||
@Schema(description="库存商品id")
|
||||
private Long erpSpuId;
|
||||
|
||||
/**
|
||||
* 商户编号
|
||||
*/
|
||||
@Schema(description="商户编号")
|
||||
private Long merchantId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description="部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@Schema(description="数量")
|
||||
private Integer quantity;
|
||||
|
||||
/**
|
||||
* 进价
|
||||
*/
|
||||
@Schema(description="进价")
|
||||
private Integer unitPrice;
|
||||
|
||||
/**
|
||||
* 累计总金额
|
||||
*/
|
||||
@Schema(description="累计总金额")
|
||||
private Integer totalAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description="备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 包装单位id
|
||||
*/
|
||||
@Schema(description="包装单位id")
|
||||
private Long unitId;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@Schema(description="规格")
|
||||
private String spec;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@Schema(description="单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 装数
|
||||
*/
|
||||
@Schema(description="装数")
|
||||
private Integer packageNum;
|
||||
|
||||
/**
|
||||
* 进价
|
||||
*/
|
||||
@Schema(description="进价")
|
||||
private Integer purchasePrice;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="是否删除")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
@Schema(description="租户编号")
|
||||
private Long tenantId;
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.bsd.pjcloud.supermarket.mapper;
|
||||
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpCgDdItemEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface SmErpCgDdItemMapper extends PjcloudBaseMapper<SmErpCgDdItemEntity> {
|
||||
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.bsd.pjcloud.supermarket.mapper;
|
||||
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpCgDdEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface SmErpCgDdMapper extends PjcloudBaseMapper<SmErpCgDdEntity> {
|
||||
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.supermarket.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpCgDdItemEntity;
|
||||
|
||||
public interface SmErpCgDdItemService extends IService<SmErpCgDdItemEntity> {
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.bsd.pjcloud.supermarket.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgdd.ErpCgDDEditDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgdd.ErpCgDDSaveDTO;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpCgDdEntity;
|
||||
|
||||
public interface SmErpCgDdService extends IService<SmErpCgDdEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 新增采购订单
|
||||
* @param erpCgDDSaveDTO
|
||||
* @return
|
||||
*/
|
||||
Object saveCGDD(ErpCgDDSaveDTO erpCgDDSaveDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param erpCgDDEditDTO
|
||||
* @return
|
||||
*/
|
||||
Object updateByErpCgDdEditDTO(ErpCgDDEditDTO erpCgDDEditDTO);
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.bsd.pjcloud.supermarket.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpCgDdItemEntity;
|
||||
import com.bsd.pjcloud.supermarket.mapper.SmErpCgDdItemMapper;
|
||||
import com.bsd.pjcloud.supermarket.service.SmErpCgDdItemService;
|
||||
import org.springframework.stereotype.Service;
|
||||
/**
|
||||
* 采购订单明细表-item
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-02-18 13:28:17
|
||||
*/
|
||||
@Service
|
||||
public class SmErpCgDdItemServiceImpl extends ServiceImpl<SmErpCgDdItemMapper, SmErpCgDdItemEntity> implements SmErpCgDdItemService {
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
package com.bsd.pjcloud.supermarket.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgdd.ErpCgDDEditDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgdd.ErpCgDDSaveDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgdd.SmCgDDEditItemDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgdd.SmCgDDSaveItemDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgplan.SmCgPlanEditItemDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgplan.SmCgPlanSaveItemDTO;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpCgDdEntity;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpCgDdItemEntity;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpCgPlanEntity;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpCgPlanItemEntity;
|
||||
import com.bsd.pjcloud.supermarket.mapper.SmErpCgDdItemMapper;
|
||||
import com.bsd.pjcloud.supermarket.mapper.SmErpCgDdMapper;
|
||||
import com.bsd.pjcloud.supermarket.service.SmErpCgDdService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 采购订单
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-02-18 13:23:21
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class SmErpCgDdServiceImpl extends ServiceImpl<SmErpCgDdMapper, SmErpCgDdEntity> implements SmErpCgDdService {
|
||||
|
||||
private final SmErpCgDdItemMapper smErpCgDDItemMapper;
|
||||
@Override
|
||||
public Object saveCGDD(ErpCgDDSaveDTO erpCgDDSaveDTO) {
|
||||
Long deptId = SecurityUtils.getUser().getDeptId();
|
||||
SmErpCgDdEntity smErpCgDdEntity = BeanUtils.toBean(erpCgDDSaveDTO, SmErpCgDdEntity.class);
|
||||
smErpCgDdEntity.setDeptId(deptId);
|
||||
smErpCgDdEntity.setCheckStatus("0");
|
||||
smErpCgDdEntity.setDeptId(deptId);
|
||||
int insert = baseMapper.insert(smErpCgDdEntity);
|
||||
|
||||
List<SmCgDDSaveItemDTO> items = erpCgDDSaveDTO.getItems();
|
||||
List<SmErpCgDdItemEntity> cgPlanItemEntities = BeanUtils.toBean(items, SmErpCgDdItemEntity.class);
|
||||
for (SmErpCgDdItemEntity cgPlanItemEntity : cgPlanItemEntities) {
|
||||
cgPlanItemEntity.setHId(smErpCgDdEntity.getId());
|
||||
cgPlanItemEntity.setDeptId(deptId);
|
||||
}
|
||||
smErpCgDDItemMapper.insert(cgPlanItemEntities);
|
||||
return insert;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object updateByErpCgDdEditDTO(ErpCgDDEditDTO erpCgDDEditDTO) {
|
||||
|
||||
SmErpCgDdEntity smErpCgDdEntity = BeanUtils.toBean(erpCgDDEditDTO, SmErpCgDdEntity.class);
|
||||
int i = baseMapper.updateById(smErpCgDdEntity);
|
||||
|
||||
//更新采购计划-item
|
||||
List<SmCgDDEditItemDTO> items = erpCgDDEditDTO.getItems();
|
||||
List<SmErpCgDdItemEntity> cgPlanItemEntities = BeanUtils.toBean(items, SmErpCgDdItemEntity.class);
|
||||
|
||||
List<SmErpCgDdItemEntity> insertCollect = cgPlanItemEntities.stream()
|
||||
.filter(supermarketUnitEntity -> supermarketUnitEntity.getId() == null).collect(Collectors.toList());
|
||||
insertCollect.forEach(c -> c.setHId(smErpCgDdEntity.getId()));
|
||||
//
|
||||
// List<SmErpCgPlanItemEntity> updateCollect = cgPlanItemEntities.stream()
|
||||
// .filter(supermarketUnitEntity -> supermarketUnitEntity.getId() != null).collect(Collectors.toList());
|
||||
// smErpCgPlanItemMapper.updateById(updateCollect);
|
||||
smErpCgDDItemMapper.insertOrUpdate(cgPlanItemEntities);
|
||||
return R.ok(i);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.bsd.pjcloud.supermarket.mapper.SmErpCgDdItemMapper">
|
||||
|
||||
<resultMap id="smErpCgDdItemMap" type="com.bsd.pjcloud.supermarket.entity.SmErpCgDdItemEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="hId" column="h_id"/>
|
||||
<result property="erpSpuId" column="erp_spu_id"/>
|
||||
<result property="merchantId" column="merchant_id"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="quantity" column="quantity"/>
|
||||
<result property="unitPrice" column="unit_price"/>
|
||||
<result property="totalAmount" column="total_amount"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="unitId" column="unit_id"/>
|
||||
<result property="spec" column="spec"/>
|
||||
<result property="unit" column="unit"/>
|
||||
<result property="packageNum" column="package_num"/>
|
||||
<result property="purchasePrice" column="purchase_price"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.bsd.pjcloud.supermarket.mapper.SmErpCgDdMapper">
|
||||
|
||||
<resultMap id="smErpCgDdMap" type="com.bsd.pjcloud.supermarket.entity.SmErpCgDdEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="code" column="code"/>
|
||||
<result property="dDate" column="d_date"/>
|
||||
<result property="warehouseId" column="warehouse_id"/>
|
||||
<result property="handlerUserId" column="handler_user_id"/>
|
||||
<result property="checkStatus" column="check_status"/>
|
||||
<result property="checkUserId" column="check_user_id"/>
|
||||
<result property="checkTime" column="check_time"/>
|
||||
<result property="merchantId" column="merchant_id"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="quantity" column="quantity"/>
|
||||
<result property="totalNumber" column="total_number"/>
|
||||
<result property="totalAmount" column="total_amount"/>
|
||||
<result property="supplierId" column="supplier_id"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="orderNumber" column="order_number"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
Reference in new issue
Block a user