This commit is contained in:
parent
0a5cef4f6f
commit
d25749424e
@ -15,10 +15,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import tech.riemann.ims.dto.request.ApplyInfo;
|
||||
import tech.riemann.ims.dto.request.AuditApplyInfo;
|
||||
import tech.riemann.ims.dto.request.ReviewDTO;
|
||||
import tech.riemann.ims.dto.response.ApplyDTO;
|
||||
import tech.riemann.ims.dto.response.ComparisonResDTO;
|
||||
import tech.riemann.ims.dto.response.StockDetailInfo;
|
||||
import tech.riemann.ims.dto.response.WaitScanInfo;
|
||||
import tech.riemann.ims.dto.response.*;
|
||||
import tech.riemann.ims.entity.material.*;
|
||||
import tech.riemann.ims.enums.*;
|
||||
import tech.riemann.ims.service.material.*;
|
||||
@ -45,6 +42,7 @@ public class ApplyFormController {
|
||||
private final IStocktakingScanDetailService stocktakingScanDetailService;
|
||||
private final IStocktakingScanExceptionalDataService stocktakingScanExceptionalDataService;
|
||||
private final ITypeService typeService;
|
||||
private final IManualStockDetailService manualStockDetailService;
|
||||
|
||||
@GetMapping("applies")
|
||||
@Operation(summary = "分页查询申请列表")
|
||||
@ -187,6 +185,24 @@ public class ApplyFormController {
|
||||
}
|
||||
|
||||
}
|
||||
@PostMapping("manual/audit-apply")
|
||||
@Operation(summary = "提交人工盘点数据")
|
||||
public void submitManualStock(@Validated @Parameter(description = "人工盘点数据") @RequestBody List<ManualStockDetail> details){
|
||||
if(details.isEmpty()){
|
||||
return;
|
||||
}
|
||||
manualStockDetailService.saveBatch(details);
|
||||
//修改状态
|
||||
applyFormService.update(Wrappers.<ApplyForm>lambdaUpdate()
|
||||
.eq(ApplyForm::getId, details.get(0).getApplyId())
|
||||
.set(ApplyForm::getReviewResult, ReviewResultEnum.WAIT_REVIEW));
|
||||
}
|
||||
@GetMapping("manual/data/{applyId}")
|
||||
@Operation(summary = "获取人工盘点数据")
|
||||
public List<ManualStockDTO> getManualStock(@Parameter(description = "申请单ID") @PathVariable(name = "applyId") Long applyId){
|
||||
return materialStockDetailService.getByApplyId(applyId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -84,12 +84,10 @@ public class MaterialController {
|
||||
@Parameter(description = "是否赋码") @RequestParam(required = false) Boolean assignRule) {
|
||||
String[] types = StringUtils.isNotBlank(type) ? type.split(",") : new String[0];
|
||||
List<Material> materials = materialService.queryLikeRight(List.of(types));
|
||||
if (Boolean.FALSE.equals(assignRule)) {
|
||||
materials.stream().filter(item -> Boolean.TRUE.equals(item.getAssignRule()))
|
||||
.forEach(item -> item.setTypeName(typeService.getTypeName(item.getType())));
|
||||
} else {
|
||||
materials.forEach(item -> item.setTypeName(typeService.getTypeName(item.getType())));
|
||||
if (assignRule != null) {
|
||||
materials.removeIf(item -> assignRule != item.getAssignRule());
|
||||
}
|
||||
materials.forEach(item -> item.setTypeName(typeService.getTypeName(item.getType())));
|
||||
return materials;
|
||||
}
|
||||
|
||||
@ -122,7 +120,7 @@ public class MaterialController {
|
||||
private String getCode() {
|
||||
String code;
|
||||
while (true) {
|
||||
code = String.valueOf(R.random(100000, 999999));
|
||||
code = String.valueOf(R.random(1000, 9999));
|
||||
try {
|
||||
// 如果代码已经存在,继续循环
|
||||
if (Strings.isBlank(cache.get(code))) {
|
||||
|
@ -0,0 +1,55 @@
|
||||
package tech.riemann.ims.dto.response;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2025/3/9 19:16
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ManualStockDTO {
|
||||
|
||||
@Schema(description = "编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称" )
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private String type;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String typeName;
|
||||
|
||||
@Schema(description = "价格")
|
||||
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "规格" )
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "申请id")
|
||||
private Long applyId;
|
||||
|
||||
@Schema(description = "物料id")
|
||||
private Long materialId;
|
||||
|
||||
@Schema(description = "库存数量")
|
||||
private Integer stock;
|
||||
|
||||
@Schema(description = "手动核实库存数量")
|
||||
private Integer manualStock;
|
||||
|
||||
@Schema(description = "异常原因")
|
||||
private String msg;
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package tech.riemann.ims.entity.material;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import tech.riemann.ims.entity.IdBaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2025/3/9 18:53
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@FieldNameConstants
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName("t_manual_stock_detail")
|
||||
@Table("t_manual_stock_detail")
|
||||
@Comment("物料")
|
||||
@Schema(name = "ManualStockDetail", description = "人工手动核实物料库存明细")
|
||||
public class ManualStockDetail extends IdBaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "申请id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("m_apply_id")
|
||||
@Column("m_apply_id")
|
||||
@Comment("申请id")
|
||||
@ColDefine(notNull = false, width = 19, precision = 0)
|
||||
private Long applyId;
|
||||
|
||||
@Schema(description = "物料id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("m_material_id")
|
||||
@Column("m_material_id")
|
||||
@Comment("物料id")
|
||||
@ColDefine(notNull = false, width = 19, precision = 0)
|
||||
private Long materialId;
|
||||
|
||||
@Schema(description = "库存数量", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("m_stock")
|
||||
@Column("m_stock")
|
||||
@Comment("库存数量")
|
||||
@ColDefine(notNull = false, type = ColType.INT)
|
||||
private Integer stock;
|
||||
|
||||
@Schema(description = "手动核实库存数量", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("m_manual_stock")
|
||||
@Column("m_manual_stock")
|
||||
@Comment("手动核实库存数量")
|
||||
@ColDefine(notNull = false, type = ColType.INT)
|
||||
private Integer manualStock;
|
||||
|
||||
@Schema(description = "异常原因", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("m_msg")
|
||||
@Column("m_msg")
|
||||
@Comment("异常原因")
|
||||
@ColDefine(notNull = false)
|
||||
private String msg;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package tech.riemann.ims.mapper.material;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import tech.riemann.ims.entity.material.ManualStockDetail;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/11/28 15:38
|
||||
*/
|
||||
public interface ManualStockDetailMapper extends BaseMapper<ManualStockDetail> {
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package tech.riemann.ims.service.material;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nutz.spring.boot.service.interfaces.IdNameEntityService;
|
||||
import tech.riemann.ims.entity.material.ManualStockDetail;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/11/28 15:41
|
||||
*/
|
||||
public interface IManualStockDetailService extends IService<ManualStockDetail>, IdNameEntityService<ManualStockDetail> {
|
||||
|
||||
}
|
@ -1,9 +1,12 @@
|
||||
package tech.riemann.ims.service.material;
|
||||
|
||||
import tech.riemann.ims.dto.response.ManualStockDTO;
|
||||
import tech.riemann.ims.entity.material.MaterialStockDetail;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nutz.spring.boot.service.interfaces.IdNameEntityService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料明细数据表 服务类
|
||||
@ -15,4 +18,5 @@ import org.nutz.spring.boot.service.interfaces.IdNameEntityService;
|
||||
*/
|
||||
public interface IMaterialStockDetailService extends IService<MaterialStockDetail>, IdNameEntityService<MaterialStockDetail> {
|
||||
|
||||
List<ManualStockDTO> getByApplyId(Long applyId);
|
||||
}
|
||||
|
@ -0,0 +1,26 @@
|
||||
package tech.riemann.ims.service.material.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.springframework.stereotype.Service;
|
||||
import tech.riemann.ims.entity.material.ManualStockDetail;
|
||||
import tech.riemann.ims.mapper.material.ManualStockDetailMapper;
|
||||
import tech.riemann.ims.service.material.IManualStockDetailService;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/11/28 15:36
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ManualStockDetailServiceImpl extends ServiceImpl<ManualStockDetailMapper, ManualStockDetail> implements IManualStockDetailService {
|
||||
|
||||
private final Dao dao;
|
||||
|
||||
@Override
|
||||
public Dao dao() {
|
||||
return dao;
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package tech.riemann.ims.service.material.impl;
|
||||
|
||||
import tech.riemann.ims.dto.response.ManualStockDTO;
|
||||
import tech.riemann.ims.entity.material.MaterialStockDetail;
|
||||
import tech.riemann.ims.mapper.material.MaterialStockDetailMapper;
|
||||
import tech.riemann.ims.service.material.IMaterialStockDetailService;
|
||||
@ -10,6 +11,8 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料明细数据表 服务实现类
|
||||
@ -42,4 +45,9 @@ public class MaterialStockDetailServiceImpl extends ServiceImpl<MaterialStockDet
|
||||
public Class<MaterialStockDetail> getEntityType() {
|
||||
return MaterialStockDetail.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ManualStockDTO> getByApplyId(Long applyId) {
|
||||
return List.of();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user