修复
This commit is contained in:
1 parent
558ba6229b
commit
a563cc4d57
11 files changed
+89
-50
No files matched your search
+1
-1
@@ -21,7 +21,7 @@ public class InventoryDetailQueryDTO {
|
||||
* 单据日期
|
||||
*/
|
||||
@Schema(description="单据日期")
|
||||
private LocalDate ddDate;
|
||||
private LocalDate inventoryDate;
|
||||
|
||||
@Schema(description="1入库 2出库")
|
||||
private Integer orderType;
|
||||
|
||||
+3
@@ -120,4 +120,7 @@ public class SmSpuEntity extends Model<SmSpuEntity> {
|
||||
*/
|
||||
@Schema(description="租户编号")
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description="商户id")
|
||||
private Long merchantId;
|
||||
}
|
||||
+3
-33
@@ -39,19 +39,13 @@ public class InventoryRecordPageVo {
|
||||
|
||||
|
||||
@Schema(description="供应商id")
|
||||
private Long supplierId;
|
||||
private Long supplierName;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description="备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
@@ -60,33 +54,16 @@ public class InventoryRecordPageVo {
|
||||
@Schema(description="创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 审批状态
|
||||
*/
|
||||
@Schema(description="审批状态")
|
||||
private String checkStatus;
|
||||
|
||||
|
||||
@Schema(description="关联码")
|
||||
private String linkCode;
|
||||
|
||||
|
||||
/**
|
||||
* 库存商品id
|
||||
*/
|
||||
@Schema(description="库存商品id")
|
||||
private Long erpSpuId;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@Schema(description="数量")
|
||||
@Schema(description="入库数量")
|
||||
private Integer quantity;
|
||||
|
||||
/**
|
||||
* 进价
|
||||
*/
|
||||
@Schema(description="进价")
|
||||
@Schema(description="入库单价")
|
||||
@JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||
@JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||
private Integer unitPrice;
|
||||
@@ -125,11 +102,4 @@ public class InventoryRecordPageVo {
|
||||
@Schema(description="装数")
|
||||
private Integer packageNum;
|
||||
|
||||
/**
|
||||
* 进价(分为单位)
|
||||
*/
|
||||
@Schema(description="进价(分为单位)")
|
||||
@JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||
@JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||
private Integer purchasePrice;
|
||||
}
|
||||
@@ -64,6 +64,11 @@
|
||||
<artifactId>pjcloud-supermarket-api</artifactId>
|
||||
<version>5.7.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-wallet-api</artifactId>
|
||||
<version>5.7.0</version>
|
||||
</dependency>
|
||||
<!--必备: log 依赖-->
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
|
||||
+23
-11
@@ -257,17 +257,29 @@ public class SmErpInventoryRecordsController {
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页获取出入库明细" , description = "出库明细,入库明细" )
|
||||
@GetMapping("/inventoryDetail/page" )
|
||||
public R getInventoryDetailPage(@ParameterObject Page page, @ParameterObject InventoryDetailQueryDTO inventoryDetailQueryDTO) {
|
||||
|
||||
LambdaQueryWrapper<SmErpInventoryRecordsEntity> wrapper = Wrappers.lambdaQuery();
|
||||
if (StringUtils.isNotBlank(inventoryDetailQueryDTO.getKey())){
|
||||
wrapper.like(SmErpInventoryRecordsEntity::getProductName,inventoryDetailQueryDTO.getKey());
|
||||
}
|
||||
wrapper.eq(Objects.nonNull(inventoryDetailQueryDTO.getDdDate()),SmErpInventoryRecordsEntity::getInventoryDate,inventoryDetailQueryDTO.getDdDate());
|
||||
wrapper.eq(SmErpInventoryRecordsEntity::getOrderType,inventoryDetailQueryDTO.getOrderType());
|
||||
//todo 审核成功条件
|
||||
// wrapper.eq(SmErpCgPlanEntity::getCheckStatus,);
|
||||
@GetMapping("/inventoryType/page" )
|
||||
public R getinventoryTypePage(@ParameterObject Page page, @ParameterObject InventoryDetailQueryDTO inventoryDetailQueryDTO) {
|
||||
return R.ok(smErpInventoryRecordsService.getInventoryDetailPage(page, inventoryDetailQueryDTO));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*根据单号获取明细
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页获取出入库明细" , description = "出库明细,入库明细" )
|
||||
@GetMapping("/inventoryDetail" )
|
||||
public R getInventoryDetailByInventoryCode(@RequestParam("id")String inventoryCode) {
|
||||
return R.ok(smErpInventoryRecordsService.getInventoryDetailByInventoryCode(inventoryCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页获取出入库汇总" , description = "出库汇总,入库汇总" )
|
||||
@GetMapping("/inventoryTypeSum/page" )
|
||||
public R getInventoryTypeSumPage(@ParameterObject Page page, @ParameterObject InventoryDetailQueryDTO inventoryDetailQueryDTO) {
|
||||
return R.ok(smErpInventoryRecordsService.getInventoryTypeSumPage(page, inventoryDetailQueryDTO));
|
||||
}
|
||||
}
|
||||
+10
@@ -9,12 +9,15 @@ 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.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpSpuEntity;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmSpuEntity;
|
||||
import com.bsd.pjcloud.supermarket.mapper.SmErpSpuMapper;
|
||||
import com.bsd.pjcloud.supermarket.service.SmErpSpuService;
|
||||
import com.bsd.pjcloud.supermarket.service.SmSpuService;
|
||||
import com.bsd.pjcloud.supermarket.vo.sm.smspu.SmSpuEditVo;
|
||||
import com.bsd.pjcloud.wallet.api.feign.RemoteMchService;
|
||||
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
@@ -45,6 +48,7 @@ public class SmSpuController {
|
||||
|
||||
private final SmErpSpuService smErpSpuService;
|
||||
|
||||
private final RemoteMchService remoteMchService;
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
@@ -86,6 +90,12 @@ public class SmSpuController {
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_smSpu_add')" )
|
||||
public R save(@RequestBody SmSpuEntity smSpu) {
|
||||
Long deptId = SecurityUtils.getUser().getDeptId();
|
||||
//查询商户,设置商户id
|
||||
R<MchManageVo> byDeptId = remoteMchService.getByDeptId(deptId);
|
||||
Long mearchantId= byDeptId.getData().getId();
|
||||
smSpu.setDeptId(deptId);
|
||||
smSpu.setMerchantId(mearchantId);
|
||||
return R.ok(smSpuService.save(smSpu));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -20,5 +20,5 @@ public interface SmErpInventoryRecordsMapper extends PjcloudBaseMapper<SmErpInve
|
||||
* @param of
|
||||
* @return
|
||||
*/
|
||||
Page<InventoryRecordPageVo> getInventoryDetailPageByScope(@Param("inventoryDetailQueryDTO") InventoryDetailQueryDTO inventoryDetailQueryDTO, DataScope of);
|
||||
Page<InventoryRecordPageVo> getInventoryDetailPageByScope(Page page,@Param("inventoryDetailQueryDTO") InventoryDetailQueryDTO inventoryDetailQueryDTO, DataScope of);
|
||||
}
|
||||
+16
@@ -42,4 +42,20 @@ public interface SmErpInventoryRecordsService extends IService<SmErpInventoryRec
|
||||
* @return
|
||||
*/
|
||||
Object getInventoryDetailPage(Page page, InventoryDetailQueryDTO inventoryDetailQueryDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 出库入库明细详情查询
|
||||
* @param inventoryCode
|
||||
* @return
|
||||
*/
|
||||
Object getInventoryDetailByInventoryCode(String inventoryCode);
|
||||
|
||||
/**
|
||||
* 出库入库汇总查询
|
||||
* @param page
|
||||
* @param inventoryDetailQueryDTO
|
||||
* @return
|
||||
*/
|
||||
Object getInventoryTypeSumPage(Page page, InventoryDetailQueryDTO inventoryDetailQueryDTO);
|
||||
}
|
||||
+13
-1
@@ -70,6 +70,8 @@ public class SmErpInventoryRecordsServiceImpl extends ServiceImpl<SmErpInventory
|
||||
int insert = baseMapper.insert(smErpCgDdEntity);
|
||||
|
||||
List<SmErpInventoryRecordsItemEntity> cgPlanItemEntities = BeanUtils.toBean(items, SmErpInventoryRecordsItemEntity.class);
|
||||
// int sum1 = cgPlanItemEntities.stream().mapToInt(SmErpInventoryRecordsItemEntity::getTotalAmount).sum();
|
||||
|
||||
List<UpdateStockDTO> updateStockDTOS = new ArrayList<>();
|
||||
for (SmErpInventoryRecordsItemEntity cgPlanItemEntity : cgPlanItemEntities) {
|
||||
cgPlanItemEntity.setInventoryId(smErpCgDdEntity.getId());
|
||||
@@ -234,10 +236,20 @@ public class SmErpInventoryRecordsServiceImpl extends ServiceImpl<SmErpInventory
|
||||
|
||||
@Override
|
||||
public Object getInventoryDetailPage(Page page, InventoryDetailQueryDTO inventoryDetailQueryDTO) {
|
||||
Page<InventoryRecordPageVo> pagedata=baseMapper.getInventoryDetailPageByScope(inventoryDetailQueryDTO, DataScope.of());
|
||||
Page<InventoryRecordPageVo> pagedata=baseMapper.getInventoryDetailPageByScope(page,inventoryDetailQueryDTO, DataScope.of());
|
||||
|
||||
return pagedata;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getInventoryDetailByInventoryCode(String inventoryCode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getInventoryTypeSumPage(Page page, InventoryDetailQueryDTO inventoryDetailQueryDTO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+5
@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuAppQueryDTO;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmSpuEntity;
|
||||
import com.bsd.pjcloud.supermarket.mapper.SmErpSpuMapper;
|
||||
@@ -13,6 +15,8 @@ import com.bsd.pjcloud.supermarket.mapper.SmSpuMapper;
|
||||
import com.bsd.pjcloud.supermarket.service.SmSpuService;
|
||||
import com.bsd.pjcloud.supermarket.vo.app.SupermarketAppSpuVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.sm.smspu.SmErpPageScopeVo;
|
||||
import com.bsd.pjcloud.wallet.api.feign.RemoteMchService;
|
||||
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -32,6 +36,7 @@ public class SmSpuServiceImpl extends ServiceImpl<SmSpuMapper, SmSpuEntity> impl
|
||||
private final SmErpSpuMapper smErpSpuMapper;
|
||||
|
||||
private final SmErpUnitMapper smErpUnitMapper;
|
||||
|
||||
@Override
|
||||
public Object pageScope(Page page, SmSpuEntity smSpu) {
|
||||
IPage<SmErpPageScopeVo> pageData = baseMapper.selectSmErpPageScopeVo(page,smSpu, DataScope.of());
|
||||
|
||||
+9
-3
@@ -29,8 +29,14 @@
|
||||
<result property="deviceType" column="device_type"/>
|
||||
</resultMap>
|
||||
<select id="getInventoryDetailPageByScope"
|
||||
resultType="com.bsd.pjcloud.supermarket.vo.inventoryrecord.InventoryRecordPageVo">
|
||||
SELECT r.inventory_code,
|
||||
resultType="com.bsd.pjcloud.supermarket.vo.inventoryrecord.InventoryRecordPageVo" parameterType="com.bsd.pjcloud.supermarket.dto.inventoryrecords.InventoryDetailQueryDTO">
|
||||
SELECT
|
||||
i.id,
|
||||
i.quantity,
|
||||
i.remark,
|
||||
i.unit_price,
|
||||
i.total_amount,
|
||||
r.inventory_code,
|
||||
u.bar_code,
|
||||
sp.product_name,
|
||||
u.spec,
|
||||
@@ -55,7 +61,7 @@
|
||||
<if test="inventoryDetailQueryDTO.orderType != null and inventoryDetailQueryDTO.orderType != ''">
|
||||
and r.order_type = #{inventoryDetailQueryDTO.orderType}
|
||||
</if>
|
||||
<if test="inventoryDetailQueryDTO.inventoryDate != null and inventoryDetailQueryDTO.inventoryDate != ''">
|
||||
<if test="inventoryDetailQueryDTO.inventoryDate != null">
|
||||
and r.inventory_date = #{inventoryDetailQueryDTO.inventoryDate}
|
||||
</if>
|
||||
<if test="inventoryDetailQueryDTO.key != null and inventoryDetailQueryDTO.key != ''">
|
||||
|
||||
Reference in new issue
Block a user