Merge branch 'master' of http://gitea.zianxin.com/zianxin-tec/biz-api-cloud
This commit is contained in:
commit
f7919a08dd
32 files changed
+311
-225
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package com.bsd.pjcloud.canteen;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.AES;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
@SpringBootTest(classes = CanteenApp.class)
|
||||
public class test {
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void testEnc() {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDec() {
|
||||
|
||||
}
|
||||
}
|
||||
File renamed without changes.
@@ -1,8 +1,4 @@
|
||||
|
||||
项目描述 ....
|
||||
|
||||
|
||||
|
||||
# 综合服务模块
|
||||
|
||||
| 姓名 | 角色 | 时间 |
|
||||
| ---- | ---- |---------|
|
||||
+2
-2
@@ -6,11 +6,11 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-supermarket-erp</artifactId>
|
||||
<artifactId>pjcloud-integrated</artifactId>
|
||||
<version>5.7.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pjcloud-supermarket-erp-api</artifactId>
|
||||
<artifactId>pjcloud-integrated-api</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!-- 连表查询注解 -->
|
||||
+2
-2
@@ -6,11 +6,11 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-supermarket-erp</artifactId>
|
||||
<artifactId>pjcloud-integrated</artifactId>
|
||||
<version>5.7.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pjcloud-supermarket-erp-biz</artifactId>
|
||||
<artifactId>pjcloud-integrated-biz</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!--必备: undertow容器-->
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.supermarketerp;
|
||||
package com.bsd.pjcloud.integrated;
|
||||
|
||||
import com.bsd.pjcloud.common.feign.annotation.EnablePjcloudFeignClients;
|
||||
import com.bsd.pjcloud.common.security.annotation.EnablePjcloudResourceServer;
|
||||
@@ -17,8 +17,8 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
@EnableDiscoveryClient
|
||||
@EnablePjcloudResourceServer
|
||||
@SpringBootApplication
|
||||
public class SuperMarketErpApp {
|
||||
public class IntegratedApp {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SuperMarketErpApp.class, args);
|
||||
SpringApplication.run(IntegratedApp.class, args);
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
#com.bsd.pjcloud.supermarketerp.api.feign.RemoteSupermarketCategoryService
|
||||
#com.bsd.pjcloud.supermarketerp.api.feign.RemoteSupermarketSpuService
|
||||
#com.bsd.pjcloud.supermarketerp.api.feign.RemoteSupermarketUnitSkuService
|
||||
File renamed without changes.
File renamed without changes.
@@ -10,12 +10,12 @@
|
||||
<version>5.7.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>pjcloud-supermarket-erp</artifactId>
|
||||
<artifactId>pjcloud-integrated</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<!--项目子模块-->
|
||||
<modules>
|
||||
<module>pjcloud-supermarket-erp-api</module>
|
||||
<module>pjcloud-supermarket-erp-biz</module>
|
||||
<module>pjcloud-integrated-api</module>
|
||||
<module>pjcloud-integrated-biz</module>
|
||||
</modules>
|
||||
</project>
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
/*
|
||||
@author pigx archetype
|
||||
* <p>
|
||||
* feign client 存放目录,注意 @EnablePigxFeignClients 的扫描范围
|
||||
*/
|
||||
package com.bsd.pjcloud.erp.api.feign;
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
/*
|
||||
* @author pigx archetype
|
||||
* <p>
|
||||
* 常量和枚举定义
|
||||
*/
|
||||
package com.bsd.pjcloud.erp.constant;
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
/*
|
||||
* @author pigx archetype
|
||||
* <p>
|
||||
* 实体 存放目录
|
||||
*/
|
||||
package com.bsd.pjcloud.erp.entity;
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package com.bsd.pjcloud.supermarketerp.api.feign;
|
||||
|
||||
|
||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
/**
|
||||
* @author zjf
|
||||
* @date 2018/6/22
|
||||
*/
|
||||
@FeignClient(contextId = "remoteSupermarketCategoryServic", value = ServiceNameConstants.SUPERMARKET_SERVICE)
|
||||
public interface RemoteSupermarketCategoryService {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有的分类
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/supermarketCategory/simpleAll")
|
||||
R getSimpleAll();
|
||||
|
||||
}
|
||||
-89
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, pjcloud All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: pjcloud
|
||||
*
|
||||
*/
|
||||
|
||||
package com.bsd.pjcloud.supermarketerp.api.feign;
|
||||
|
||||
|
||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.supermarketerp.dto.SupermarketSpuQueryDTO;
|
||||
import com.bsd.pjcloud.supermarketerp.dto.SupermarketSpuUpdateStockReqDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* @author zjf
|
||||
* @date 2018/6/22
|
||||
*/
|
||||
@FeignClient(contextId = "remoteSupermarketSpuService", value = ServiceNameConstants.SUPERMARKET_SERVICE)
|
||||
public interface RemoteSupermarketSpuService {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有的超市spu列表信息,根据条件
|
||||
* @return R
|
||||
*/
|
||||
@PostMapping("/supermarketSpu/ad/selectListAll")
|
||||
R getSupermarketSpuScope(@RequestBody SupermarketSpuQueryDTO supermarketSpuQueryDTO);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据spu id 查询spu详情,详情包括辅助条码和包装单位基本信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/supermarketSpu/ad/SpuDetails")
|
||||
R getSupermarketSpuDetailById(@RequestParam("id")Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 更新库存
|
||||
* @param updateStockReqDTO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/supermarketSpu/ad/updateSpuStock")
|
||||
R updateSpuStock(@RequestBody SupermarketSpuUpdateStockReqDTO updateStockReqDTO);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有的超市spu列表信息,根据条件
|
||||
* @return R
|
||||
*/
|
||||
@PostMapping("/supermarketSpu/app/selectListAll")
|
||||
R getSupermarketSpu(@RequestBody SupermarketSpuQueryDTO supermarketSpuQueryDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 购物车效验库存
|
||||
* @param spuId
|
||||
* @param incrCount 扣减数量,正数负数都行
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/supermarketSpu/app/checkSpuStock")
|
||||
R checkSpuStock(@RequestParam(value ="spuId")Long spuId,@RequestParam("incrCount")Integer incrCount);
|
||||
|
||||
}
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, pjcloud All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: pjcloud
|
||||
*
|
||||
*/
|
||||
|
||||
package com.bsd.pjcloud.supermarketerp.api.feign;
|
||||
|
||||
|
||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.supermarketerp.vo.SupermarketUnitWithSpuVo;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zjf
|
||||
* @date 2018/6/22
|
||||
*/
|
||||
@FeignClient(contextId = "remoteSupermarketUnitSkuService", value = ServiceNameConstants.SUPERMARKET_SERVICE)
|
||||
public interface RemoteSupermarketUnitSkuService {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* sku 包装单位
|
||||
* 根据包装ids查询
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/supermarketUnit/ad/getSupermarketUnits")
|
||||
R<List<SupermarketUnitWithSpuVo>> getSupermarketUnits(@RequestBody List<Long> ids);
|
||||
}
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
com.bsd.pjcloud.supermarketerp.api.feign.RemoteSupermarketCategoryService
|
||||
com.bsd.pjcloud.supermarketerp.api.feign.RemoteSupermarketSpuService
|
||||
com.bsd.pjcloud.supermarketerp.api.feign.RemoteSupermarketUnitSkuService
|
||||
+2
-1
@@ -15,7 +15,8 @@ public enum InventoryTypeEnum {
|
||||
CKRK("3", "CGRK"),
|
||||
CKTH("4", "CGTH"),
|
||||
LSCK("5", "LSCK"),
|
||||
LSTH("6", "LSTH")
|
||||
LSTH("6", "LSTH"),
|
||||
KCPD("7", "KCPD")
|
||||
;
|
||||
private final String type;
|
||||
private final String value;
|
||||
|
||||
+1
@@ -51,4 +51,5 @@ public class InventoryRecordSaveItemDTO {
|
||||
@Schema(description="包装单位id")
|
||||
private Long unitId;
|
||||
|
||||
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
package com.bsd.pjcloud.supermarket.dto.inventoryrecords;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author zjf
|
||||
* @date 2025-02-11 17:11:41
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "盘点-item")
|
||||
public class PDItemSaveDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 库存商品id
|
||||
*/
|
||||
@Schema(description="库存商品id")
|
||||
private Long erpSpuId;
|
||||
|
||||
|
||||
@Schema(description="账面数量")
|
||||
private Double accountNumber;
|
||||
|
||||
@Schema(description="实际数量")
|
||||
private Double realNumber;
|
||||
|
||||
@Schema(description="账面单价")
|
||||
private Integer unitPrice;
|
||||
|
||||
|
||||
/**
|
||||
* 数据库意思就是实际单价,这里等价于盘点单价
|
||||
*/
|
||||
@Schema(description="盘点单价")
|
||||
private Integer realPrice;
|
||||
/**
|
||||
* 盘盈盘亏
|
||||
*/
|
||||
@Schema(description="盈")
|
||||
private Double profit;
|
||||
|
||||
/**
|
||||
* 盘盈盘亏
|
||||
*/
|
||||
@Schema(description="亏")
|
||||
private Double loss;
|
||||
|
||||
|
||||
/**
|
||||
* 包装单位id
|
||||
*/
|
||||
@Schema(description="包装单位id")
|
||||
private Long unitId;
|
||||
|
||||
|
||||
|
||||
|
||||
@Schema(description="盘后总数")
|
||||
private Integer totalNumber;
|
||||
|
||||
/**
|
||||
* 累计总金额
|
||||
*/
|
||||
@Schema(description="盘后总金额")
|
||||
private Integer totalAmount;
|
||||
|
||||
|
||||
/**
|
||||
* 1等于盘盈 2等于盘亏
|
||||
*/
|
||||
@Schema(description="订单类型,1入库,2出库")
|
||||
private String orderType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description="备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.bsd.pjcloud.supermarket.dto.inventoryrecords;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* 新增一个采购计划
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "盘点保存对象")
|
||||
public class PDSaveDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 采编号
|
||||
*/
|
||||
@Schema(description="编号")
|
||||
private String inventoryCode;
|
||||
|
||||
/**
|
||||
* 采购计划单据日期
|
||||
*/
|
||||
@Schema(description="单据日期")
|
||||
private LocalDate inventoryDate;
|
||||
|
||||
/**
|
||||
* 仓库id
|
||||
*/
|
||||
@Schema(description="仓库id")
|
||||
private String warehouseId;
|
||||
|
||||
/**
|
||||
* 经办人id
|
||||
*/
|
||||
@Schema(description="经办人id")
|
||||
private Long handlerUserId;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description="备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 单据类型(字典inventory_type)采购入库、采购退货、盘点入库等
|
||||
*/
|
||||
@Schema(description="单据类型(字典inventory_type)采购入库、采购退货、盘点入库等")
|
||||
private String inventoryType;
|
||||
|
||||
|
||||
/**
|
||||
* @Link SmCgPlanSaveItemDTO
|
||||
*/
|
||||
@Schema(description="采购计划-item")
|
||||
private List<PDItemSaveDTO> items;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.bsd.pjcloud.supermarket.dto.inventoryrecords;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PdUnitDto {
|
||||
|
||||
@Schema(description = "包装单位id")
|
||||
private Long unitId;
|
||||
|
||||
@Schema(description = "对应包装单位填的数量")
|
||||
private Integer unitNumber;
|
||||
}
|
||||
+4
@@ -175,4 +175,8 @@ public class SmErpInventoryRecordsEntity extends Model<SmErpInventoryRecordsEnti
|
||||
|
||||
@Schema(description="收货数量")
|
||||
private Integer receiveAmount;
|
||||
|
||||
@Schema(description="货商名称")
|
||||
@TableField(exist = false)
|
||||
private String supplierName;
|
||||
}
|
||||
+12
@@ -154,4 +154,16 @@ public class SmErpInventoryRecordsItemEntity extends Model<SmErpInventoryRecords
|
||||
*/
|
||||
@Schema(description="租户编号")
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description="盘后总数")
|
||||
private Integer totalNumber;
|
||||
|
||||
@Schema(description="账面数量")
|
||||
private Integer accountNumber;
|
||||
|
||||
@Schema(description="实际数量")
|
||||
private Integer realNumber;
|
||||
|
||||
@Schema(description="实际单价")
|
||||
private Integer realPrice;
|
||||
}
|
||||
+11
-6
@@ -45,23 +45,28 @@ public class ErpUnitVo {
|
||||
* 进价(分为单位)
|
||||
*/
|
||||
@Schema(description="进价(分为单位)")
|
||||
@JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||
@JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||
// @JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||
// @JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||
private Integer purchasePrice;
|
||||
|
||||
/**
|
||||
* 零售价(分为单位)
|
||||
*/
|
||||
@Schema(description="零售价(分为单位)")
|
||||
@JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||
@JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||
// @JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||
// @JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||
private Integer retailPrice;
|
||||
|
||||
/**
|
||||
* 成本单价,单位: 分
|
||||
*/
|
||||
@Schema(description="成本单价,单位: 分")
|
||||
@JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||
@JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||
// @JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||
// @JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||
private Integer costPrice;
|
||||
|
||||
|
||||
@Schema(description="是否基础单位")
|
||||
private Boolean isBase;
|
||||
|
||||
}
|
||||
+3
-2
@@ -78,12 +78,13 @@ public class SmErpCgPlanController {
|
||||
|
||||
|
||||
/**
|
||||
* 采购计划选择商品分页数据
|
||||
* 通用的,迁移到公共接口
|
||||
* 选择商品分页数据
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "采购计划选择商品分页数据" , description = "采购计划选择商品分页数据" )
|
||||
@Operation(summary = "选择商品分页数据" , description = "选择商品分页数据" )
|
||||
@GetMapping("/erpSpuPage" )
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_smErpInventoryRecords_view')" )
|
||||
public R getErpSpuPage(@ParameterObject Page page, @ParameterObject ErpCgPlanDTO erpCgPlanDTO) {
|
||||
|
||||
+12
@@ -245,4 +245,16 @@ public class SmErpInventoryRecordsController {
|
||||
public R getInventoryTypeSumPage(@ParameterObject Page page, @ParameterObject InventoryDetailQueryDTO inventoryDetailQueryDTO) {
|
||||
return R.ok(smErpInventoryRecordsService.getInventoryTypeSumPage(page, inventoryDetailQueryDTO));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Operation(summary = "库存盘点新增" , description = "库存盘点新增" )
|
||||
@SysLog("库存盘点新增" )
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_smErpInventoryRecords_add')" )
|
||||
public R save(@RequestBody PDSaveDTO pdSaveDTO) {
|
||||
return R.ok(smErpInventoryRecordsService.savePD(pdSaveDTO));
|
||||
}
|
||||
|
||||
}
|
||||
+8
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.supermarket.dto.inventoryrecords.InventoryDetailQueryDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.inventoryrecords.InventoryRecordEditDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.inventoryrecords.InventoryRecordSaveDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.inventoryrecords.PDSaveDTO;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpInventoryRecordsEntity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -81,4 +82,11 @@ public interface SmErpInventoryRecordsService extends IService<SmErpInventoryRec
|
||||
|
||||
|
||||
Object removeBatch(ArrayList<Long> list);
|
||||
|
||||
/**
|
||||
* 库存盘点新增
|
||||
* @param pdSaveDTO
|
||||
* @return
|
||||
*/
|
||||
Object savePD(PDSaveDTO pdSaveDTO);
|
||||
}
|
||||
+43
-13
@@ -54,6 +54,8 @@ public class SmErpInventoryRecordsServiceImpl extends ServiceImpl<SmErpInventory
|
||||
private final SmErpUnitMapper smErpUnitMapper;
|
||||
|
||||
private final RemoteUserService remoteUserService;
|
||||
|
||||
private final SmErpSupplierMapper smErpSupplierMapper;
|
||||
@Override
|
||||
@Transactional
|
||||
public Object saveInventoryRecord(InventoryRecordSaveDTO inventoryRecordSaveDTO) {
|
||||
@@ -77,17 +79,20 @@ public class SmErpInventoryRecordsServiceImpl extends ServiceImpl<SmErpInventory
|
||||
for (SmErpInventoryRecordsItemEntity cgPlanItemEntity : cgPlanItemEntities) {
|
||||
cgPlanItemEntity.setInventoryId(smErpCgDdEntity.getId());
|
||||
cgPlanItemEntity.setDeptId(deptId);
|
||||
String orderType = smErpCgDdEntity.getOrderType();
|
||||
cgPlanItemEntity.setOrderType(orderType);
|
||||
UpdateStockDTO updateStockDTO = new UpdateStockDTO();
|
||||
updateStockDTO.setId(cgPlanItemEntity.getErpSpuId());
|
||||
if (orderType.equals(OrderTypeEnum.RK.getType())){
|
||||
updateStockDTO.setIncrCount(cgPlanItemEntity.getQuantity());
|
||||
}else if (orderType.equals(OrderTypeEnum.CK.getType())){
|
||||
updateStockDTO.setIncrCount(-cgPlanItemEntity.getQuantity());
|
||||
}else {
|
||||
throw new RuntimeException("订单类型错误");
|
||||
}
|
||||
Double quantity = cgPlanItemEntity.getQuantity();
|
||||
String orderType = smErpCgDdEntity.getOrderType();
|
||||
cgPlanItemEntity.setOrderType(orderType);
|
||||
if (orderType.equals(OrderTypeEnum.RK.getType())){
|
||||
updateStockDTO.setIncrCount(quantity);
|
||||
}else if (orderType.equals(OrderTypeEnum.CK.getType())){
|
||||
updateStockDTO.setIncrCount(-quantity);
|
||||
}else {
|
||||
throw new RuntimeException("订单类型错误");
|
||||
}
|
||||
|
||||
|
||||
updateStockDTOS.add(updateStockDTO);
|
||||
}
|
||||
smErpInventoryRecordsItemMapper.insert(cgPlanItemEntities);
|
||||
@@ -120,6 +125,10 @@ public class SmErpInventoryRecordsServiceImpl extends ServiceImpl<SmErpInventory
|
||||
Set<Long> userIds = records.stream()
|
||||
.map(SmErpInventoryRecordsEntity::getHandlerUserId)
|
||||
.collect(Collectors.toSet());
|
||||
//收集supplierIds
|
||||
Set<Long> supplierIds = records.stream()
|
||||
.map(SmErpInventoryRecordsEntity::getSupplierId)
|
||||
.collect(Collectors.toSet());
|
||||
//请求得到所有的userIds
|
||||
Map<Long, SysUser> userMap = remoteUserService.getUserMap(userIds).getData();
|
||||
|
||||
@@ -133,6 +142,9 @@ public class SmErpInventoryRecordsServiceImpl extends ServiceImpl<SmErpInventory
|
||||
Map<Long,SmErpSpuEntity> spuMap = smErpSpuEntities.stream().collect(Collectors.toMap(SmErpSpuEntity::getId, spu -> spu));
|
||||
|
||||
|
||||
List<SmErpSupplierEntity> smErpSupplierEntities = smErpSupplierMapper.selectList(new LambdaQueryWrapper<SmErpSupplierEntity>().in(SmErpSupplierEntity::getSupplierId, supplierIds));
|
||||
Map<Long,SmErpSupplierEntity> supplierMap = smErpSupplierEntities.stream().collect(Collectors.toMap(SmErpSupplierEntity::getSupplierId, supplier -> supplier));
|
||||
|
||||
// 按采购计划分组商品名称
|
||||
Map<Long, List<String>> planGoodsMap = cgPlanItemEntities.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
@@ -142,15 +154,18 @@ public class SmErpInventoryRecordsServiceImpl extends ServiceImpl<SmErpInventory
|
||||
Collectors.toList()
|
||||
)
|
||||
));
|
||||
|
||||
// 设置商品名称到主表实体
|
||||
records.forEach(plan -> {
|
||||
//移动端自动扣款入库,无需经办人
|
||||
if (null!=plan.getHandlerUserId()){
|
||||
SysUser sysUser = userMap.getOrDefault(plan.getHandlerUserId(), new SysUser());
|
||||
plan.setHandlerUserName(sysUser.getUsername());
|
||||
List<String> names = planGoodsMap.getOrDefault(plan.getId(), Collections.emptyList());
|
||||
plan.setProductName(String.join(", ", names));
|
||||
}
|
||||
List<String> names = planGoodsMap.getOrDefault(plan.getId(), Collections.emptyList());
|
||||
plan.setProductName(String.join(", ", names));
|
||||
String supplierName = supplierMap.getOrDefault(plan.getSupplierId(), new SmErpSupplierEntity()).getSupplierName();
|
||||
plan.setSupplierName(supplierName);
|
||||
|
||||
});
|
||||
return pageData;
|
||||
@@ -331,9 +346,9 @@ public class SmErpInventoryRecordsServiceImpl extends ServiceImpl<SmErpInventory
|
||||
List<InventoryRecordEditItemDTO> items = inventoryRecordEditDTO.getItems();
|
||||
List<SmErpInventoryRecordsItemEntity> smErpInventoryRecordsItemEntityList = BeanUtils.toBean(items, SmErpInventoryRecordsItemEntity.class);
|
||||
|
||||
List<SmErpInventoryRecordsItemEntity> updateItems = smErpInventoryRecordsItemEntityList.stream().
|
||||
filter(smErpInventoryRecordsItemEntity -> smErpInventoryRecordsItemEntity.getId() == null).collect(Collectors.toList());
|
||||
List<SmErpInventoryRecordsItemEntity> insertItems = smErpInventoryRecordsItemEntityList.stream().
|
||||
filter(smErpInventoryRecordsItemEntity -> smErpInventoryRecordsItemEntity.getId() == null).collect(Collectors.toList());
|
||||
List<SmErpInventoryRecordsItemEntity> updateItems = smErpInventoryRecordsItemEntityList.stream().
|
||||
filter(smErpInventoryRecordsItemEntity -> smErpInventoryRecordsItemEntity.getId() != null).collect(Collectors.toList());
|
||||
smErpInventoryRecordsItemMapper.updateById(updateItems);
|
||||
smErpInventoryRecordsItemMapper.insert(insertItems);
|
||||
@@ -382,5 +397,20 @@ public class SmErpInventoryRecordsServiceImpl extends ServiceImpl<SmErpInventory
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object savePD(PDSaveDTO pdSaveDTO) {
|
||||
Long deptId = SecurityUtils.getUser().getDeptId();
|
||||
SmErpInventoryRecordsEntity smErpCgDdEntity = BeanUtils.toBean(pdSaveDTO, SmErpInventoryRecordsEntity.class);
|
||||
smErpCgDdEntity.setDeptId(deptId);
|
||||
smErpCgDdEntity.setCheckStatus("0");
|
||||
smErpCgDdEntity.setDeptId(deptId);
|
||||
List<PDItemSaveDTO> items = pdSaveDTO.getItems();
|
||||
|
||||
int insert = baseMapper.insert(smErpCgDdEntity);
|
||||
List<SmErpInventoryRecordsItemEntity> cgPlanItemEntities = BeanUtils.toBean(items, SmErpInventoryRecordsItemEntity.class);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+1
@@ -468,6 +468,7 @@ public class SmErpSpuServiceImpl extends ServiceImpl<SmErpSpuMapper, SmErpSpuEnt
|
||||
voList.stream().forEach(vo -> {
|
||||
List<SmErpUnitEntity> unitEntities = unitList.stream().filter(unit -> unit.getSpuId().equals(vo.getId())).collect(Collectors.toList());
|
||||
List<ErpUnitVo> bean = BeanUtils.toBean(unitEntities, ErpUnitVo.class);
|
||||
bean.sort(Comparator.comparing(ErpUnitVo::getPackageNum));
|
||||
vo.setErpUnitVos(bean);
|
||||
//库存
|
||||
SmErpStockEntity smErpStockEntity = stockMap.get(vo.getId());
|
||||
|
||||
+4
@@ -25,6 +25,10 @@
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
<result property="totalNumber" column="total_number"/>
|
||||
<result property="accountNumber" column="account_number"/>
|
||||
<result property="realNumber" column="real_number"/>
|
||||
<result property="realPrice" column="real_price"/>
|
||||
</resultMap>
|
||||
<select id="selectInventoryTypeSumPageByScope"
|
||||
resultType="com.bsd.pjcloud.supermarket.vo.inventoryrecord.InventoryRecordSumVo">
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
<module>pjcloud-app-server</module>
|
||||
<module>pjcloud-thirdparty</module>
|
||||
<module>pjcloud-canteen</module>
|
||||
<!-- <module>pjcloud-supermarket-erp</module>-->
|
||||
<module>pjcloud-integrated</module>
|
||||
<module>pjcloud-wallet</module>
|
||||
<module>pjcloud-supermarket</module>
|
||||
<module>pjcloud-hardware</module>
|
||||
|
||||
Reference in new issue
Block a user