feat(biz): 添加成品库存迁移功能并优化资金输入组件
- 添加 Promigration API 自动导入类型定义 - 添加 ProStorageInventoryForm 组件类型定义 - 在 MoneyInput 组件中添加 input 事件实时触发输入值 - 移除 MoneyInput 中不必要的 watch 监听器优化性能 - 修复 MoneyInput 小数位数处理逻辑不补齐问题 - 在成品出入库控制器中关联查询物料库存明细数据 - 添加库存迁移功能支持库区间物料转移 - 更新单据编号生成规则支持迁移类型单据 - 添加成品出入库子表关联主表创建人信息查询 - 优化成品出入库子表导出Excel功能 - 扩展成品出入库子表数据对象支持原库区字段 - 添加成品出入库响应VO包含子表明细列表
This commit is contained in:
parent
d0732df41e
commit
32b9457cc8
@ -10,8 +10,13 @@ import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo.ProSt
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo.ProStoragePageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo.ProStorageRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo.ProStorageSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostoragemat.vo.ProStorageMatRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.prostorage.ProStorageDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.prostorageinventory.ProStorageInventoryDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.prostoragemat.ProStorageMatDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.prostorage.ProStorageService;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.prostorageinventory.ProStorageInventoryService;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.prostoragemat.ProStorageMatService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -37,6 +42,10 @@ public class ProStorageController {
|
||||
|
||||
@Resource
|
||||
private ProStorageService proStorageService;
|
||||
@Resource
|
||||
private ProStorageMatService proStorageMatService;
|
||||
@Resource
|
||||
private ProStorageInventoryService proStorageInventoryService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建成品入/出库")
|
||||
@ -76,7 +85,24 @@ public class ProStorageController {
|
||||
@PreAuthorize("@ss.hasPermission('twm:pro-storage:query')")
|
||||
public CommonResult<ProStorageRespVO> getProStorage(@RequestParam("id") Integer id) {
|
||||
ProStorageDO proStorage = proStorageService.getProStorage(id);
|
||||
return success(BeanUtils.toBean(proStorage, ProStorageRespVO.class));
|
||||
ProStorageRespVO respVO = BeanUtils.toBean(proStorage, ProStorageRespVO.class);
|
||||
// 关联查询子表mat数据
|
||||
List<ProStorageMatDO> matList = proStorageMatService.getProStorageMatByStockId(id);
|
||||
respVO.setDetails(BeanUtils.toBean(matList, ProStorageMatRespVO.class));
|
||||
for (ProStorageMatRespVO detail : respVO.getDetails()) {
|
||||
ProStorageInventoryDO proStorageInventory = proStorageInventoryService.getProStorageInventory(detail.getSourceId().longValue());
|
||||
if (proStorageInventory != null) {
|
||||
detail.setPackQty(proStorageInventory.getPackQty());
|
||||
detail.setYardQty(proStorageInventory.getYardQty());
|
||||
} else {
|
||||
proStorageInventory = proStorageInventoryService.selectByMat(detail.getOldStoreHouseCd(), detail.getOldStoreAreCd(), detail.getLotNo(), detail.getMatCode());
|
||||
if (proStorageInventory != null) {
|
||||
detail.setPackQty(proStorageInventory.getPackQty());
|
||||
detail.setYardQty(proStorageInventory.getYardQty());
|
||||
}
|
||||
}
|
||||
}
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
|
||||
@ -3,11 +3,13 @@ package com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostoragemat.vo.ProStorageMatRespVO;
|
||||
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 = "管理后台 - 成品入/出库 Response VO")
|
||||
@Data
|
||||
@ -75,4 +77,7 @@ public class ProStorageRespVO {
|
||||
@ExcelProperty("来源单号id")
|
||||
private Integer sourceId;
|
||||
|
||||
@Schema(description = "子表明细")
|
||||
private List<ProStorageMatRespVO> details;
|
||||
|
||||
}
|
||||
|
||||
@ -17,12 +17,11 @@ public class ProStorageSaveReqVO {
|
||||
// @NotEmpty(message = "单据编号不能为空")
|
||||
// private String billNo;
|
||||
//
|
||||
// @Schema(description = "操作类型 1为入库,2为出库", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
// @NotNull(message = "操作类型 1为入库,2为出库不能为空")
|
||||
// private Boolean operatorType;
|
||||
@Schema(description = "操作类型 1为入库,2为出库", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer operatorType;
|
||||
//
|
||||
// @Schema(description = "业务类型 (10 生产入库,11 盘盈入库,12 其它入库 21 成品出库 22 盘亏出库 23生产退库)", example = "1")
|
||||
// private Integer businessType;
|
||||
@Schema(description = "业务类型 (10 生产入库,11 盘盈入库,12 其它入库 21 成品出库 22 盘亏出库 23生产退库)", example = "1")
|
||||
private Integer businessType;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
@ -54,5 +53,13 @@ public class ProStorageSaveReqVO {
|
||||
// @Schema(description = "来源单号id", example = "27114")
|
||||
// private Integer sourceId;
|
||||
|
||||
// 迁移目标库区信息
|
||||
private Integer storeHouseId;
|
||||
private String storeHouseName;
|
||||
private String storeHouseCd;
|
||||
private Integer storeAreaId;
|
||||
private String storeAreaName;
|
||||
private String storeAreCd;
|
||||
|
||||
List<ProStorageInsertReqVO> details;
|
||||
}
|
||||
|
||||
@ -9,8 +9,10 @@ import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLo
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostoragemat.vo.ProStorageMatPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostoragemat.vo.ProStorageMatRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostoragemat.vo.ProStorageMatSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.prostorage.ProStorageDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.prostorageinventory.ProStorageInventoryDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.prostoragemat.ProStorageMatDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.prostorage.ProStorageMapper;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.prostorageinventory.ProStorageInventoryService;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.prostoragemat.ProStorageMatService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@ -40,6 +42,8 @@ public class ProStorageMatController {
|
||||
private ProStorageMatService proStorageMatService;
|
||||
@Resource
|
||||
private ProStorageInventoryService proStorageInventoryService;
|
||||
@Resource
|
||||
private ProStorageMapper proStorageMapper;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建成品入/出库子")
|
||||
@ -83,8 +87,10 @@ public class ProStorageMatController {
|
||||
List<ProStorageMatRespVO> bean = BeanUtils.toBean(proStorageMatByStockId, ProStorageMatRespVO.class);
|
||||
for (ProStorageMatRespVO matRespVO : bean) {
|
||||
ProStorageInventoryDO storageInventoryDO = proStorageInventoryService.selectByMat(matRespVO.getStoreHouseCd(), matRespVO.getStoreAreCd(), matRespVO.getLotNo(), matRespVO.getMatCode());
|
||||
matRespVO.setYardQty(storageInventoryDO.getYardQty());
|
||||
matRespVO.setPackQty(storageInventoryDO.getPackQty());
|
||||
if (storageInventoryDO != null) {
|
||||
matRespVO.setPackQty(storageInventoryDO.getPackQty());
|
||||
matRespVO.setYardQty(storageInventoryDO.getYardQty());
|
||||
}
|
||||
}
|
||||
return success(bean);
|
||||
}
|
||||
@ -94,7 +100,17 @@ public class ProStorageMatController {
|
||||
@PreAuthorize("@ss.hasPermission('twm:pro-storage-mat:query')")
|
||||
public CommonResult<PageResult<ProStorageMatRespVO>> getProStorageMatPage(@Valid ProStorageMatPageReqVO pageReqVO) {
|
||||
PageResult<ProStorageMatDO> pageResult = proStorageMatService.getProStorageMatPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ProStorageMatRespVO.class));
|
||||
PageResult<ProStorageMatRespVO> voPageResult = BeanUtils.toBean(pageResult, ProStorageMatRespVO.class);
|
||||
// 关联主表填充创建人
|
||||
for (ProStorageMatRespVO vo : voPageResult.getList()) {
|
||||
if (vo.getStockId() != null) {
|
||||
ProStorageDO proStorageDO = proStorageMapper.selectById(vo.getStockId());
|
||||
if (proStorageDO != null) {
|
||||
vo.setOperatorName(proStorageDO.getOperatorName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return success(voPageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ -102,12 +118,21 @@ public class ProStorageMatController {
|
||||
@PreAuthorize("@ss.hasPermission('twm:pro-storage-mat:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportProStorageMatExcel(@Valid ProStorageMatPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ProStorageMatDO> list = proStorageMatService.getProStorageMatPage(pageReqVO).getList();
|
||||
List<ProStorageMatRespVO> voList = BeanUtils.toBean(list, ProStorageMatRespVO.class);
|
||||
// 关联主表填充创建人
|
||||
for (ProStorageMatRespVO vo : voList) {
|
||||
if (vo.getStockId() != null) {
|
||||
ProStorageDO proStorageDO = proStorageMapper.selectById(vo.getStockId());
|
||||
if (proStorageDO != null) {
|
||||
vo.setOperatorName(proStorageDO.getOperatorName());
|
||||
}
|
||||
}
|
||||
}
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "成品入/出库子.xls", "数据", ProStorageMatRespVO.class,
|
||||
BeanUtils.toBean(list, ProStorageMatRespVO.class));
|
||||
ExcelUtils.write(response, "成品入/出库子.xls", "数据", ProStorageMatRespVO.class, voList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -109,4 +109,25 @@ public class ProStorageMatRespVO {
|
||||
private BigDecimal yardQty;
|
||||
private Integer packQty;
|
||||
|
||||
@Schema(description = "创建人")
|
||||
private String operatorName;
|
||||
|
||||
@Schema(description = "原仓储id")
|
||||
private Integer oldStoreHouseId;
|
||||
|
||||
@Schema(description = "原仓储名称")
|
||||
private String oldStoreHouseName;
|
||||
|
||||
@Schema(description = "原仓储编码")
|
||||
private String oldStoreHouseCd;
|
||||
|
||||
@Schema(description = "原库区id")
|
||||
private Integer oldStoreAreaId;
|
||||
|
||||
@Schema(description = "原库区名称")
|
||||
private String oldStoreAreaName;
|
||||
|
||||
@Schema(description = "原库区编码")
|
||||
private String oldStoreAreCd;
|
||||
|
||||
}
|
||||
|
||||
@ -115,4 +115,10 @@ public class ProStorageMatDO extends BaseDOWithoutLogic {
|
||||
|
||||
private String inventBillNo;
|
||||
|
||||
private Integer oldStoreHouseId;
|
||||
private String oldStoreHouseName;
|
||||
private String oldStoreHouseCd;
|
||||
private Integer oldStoreAreaId;
|
||||
private String oldStoreAreaName;
|
||||
private String oldStoreAreCd;
|
||||
}
|
||||
|
||||
@ -35,8 +35,9 @@ public interface ProStorageMapper extends BaseMapperX<ProStorageDO> {
|
||||
.orderByDesc(ProStorageDO::getId));
|
||||
}
|
||||
|
||||
default String selectMaxBillNo() {
|
||||
default String selectMaxBillNo(Integer operatorType) {
|
||||
ProStorageDO proStorage = selectOne(new LambdaQueryWrapper<ProStorageDO>()
|
||||
.eq(ProStorageDO::getOperatorType, operatorType)
|
||||
.orderByDesc(ProStorageDO::getBillNo)
|
||||
.last("LIMIT 1"));
|
||||
return proStorage != null ? proStorage.getBillNo() : null;
|
||||
|
||||
@ -17,13 +17,15 @@ import java.util.List;
|
||||
public interface ProStorageService {
|
||||
|
||||
/**
|
||||
* 创建成品入/出库
|
||||
* 迁移库存
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createProStorage(@Valid ProStorageSaveReqVO createReqVO);
|
||||
|
||||
|
||||
// 入库
|
||||
void saveProStorage(@Valid List<ProStorageInsertReqVO> createReqVO);
|
||||
|
||||
/**
|
||||
@ -56,6 +58,6 @@ public interface ProStorageService {
|
||||
*/
|
||||
PageResult<ProStorageDO> getProStoragePage(ProStoragePageReqVO pageReqVO);
|
||||
|
||||
String generateBillNo(String operatorType);
|
||||
String generateBillNo(Integer operatorType);
|
||||
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ public class ProStorageServiceImpl implements ProStorageService {
|
||||
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
||||
AdminUserDO user = adminUserService.getUser(loginUserId);
|
||||
String nickname = user.getNickname();
|
||||
ProStorageDO proStorage = saveProStorage(23, createReqVO.getStatus(), loginUserId, nickname, "", null, createReqVO.getRemark());
|
||||
ProStorageDO proStorage = saveProStorage(31, createReqVO.getStatus(), loginUserId, nickname, "", null, createReqVO.getRemark());
|
||||
|
||||
saveMat(createReqVO, proStorage);
|
||||
|
||||
@ -68,18 +68,57 @@ public class ProStorageServiceImpl implements ProStorageService {
|
||||
|
||||
private void process(ProStorageDO proStorage, Long loginUserId, String nickname) {
|
||||
List<ProStorageMatDO> proStorageMatDOS = proStorageMatMapper.selectByStockId(proStorage.getId());
|
||||
boolean isMigration = proStorage.getBusinessType() != null && proStorage.getBusinessType() == 31;
|
||||
for (ProStorageMatDO proStorageMatDO : proStorageMatDOS) {
|
||||
ProStorageInventoryDO storageInventoryDO = proStorageInventoryService.getProStorageInventory(proStorageMatDO.getSourceId());
|
||||
if (proStorageMatDO.getOperatorQty().compareTo(storageInventoryDO.getYardQty()) > 0) { //盘库数量小于出库数量
|
||||
throw exception("退库数量大于库存数量!");
|
||||
throw exception("退库/移库数量大于库存数量!");
|
||||
}
|
||||
if (proStorageMatDO.getBagQty() > storageInventoryDO.getPackQty()) { //退库箱数大于库存箱数
|
||||
throw exception("退库袋数大于库存袋数!");
|
||||
throw exception("退库/移库袋数大于库存袋数!");
|
||||
}
|
||||
|
||||
// 从旧库区扣减库存
|
||||
storageInventoryDO.setYardQty(storageInventoryDO.getYardQty().subtract(proStorageMatDO.getOperatorQty()));
|
||||
storageInventoryDO.setPackQty(storageInventoryDO.getPackQty() - proStorageMatDO.getBagQty());
|
||||
proStorageInventoryMapper.updateById(storageInventoryDO);
|
||||
|
||||
// 迁移场景:在新库区增加库存
|
||||
if (isMigration && proStorageMatDO.getOldStoreHouseId() != null) {
|
||||
ProStorageInventoryDO newInventoryDO = proStorageInventoryService.selectByMat(
|
||||
proStorageMatDO.getStoreHouseCd(), proStorageMatDO.getStoreAreCd(),
|
||||
proStorageMatDO.getLotNo(), proStorageMatDO.getMatCode());
|
||||
if (newInventoryDO != null) {
|
||||
newInventoryDO.setYardQty(newInventoryDO.getYardQty().add(proStorageMatDO.getOperatorQty()));
|
||||
newInventoryDO.setPackQty(newInventoryDO.getPackQty() + proStorageMatDO.getBagQty());
|
||||
proStorageInventoryMapper.updateById(newInventoryDO);
|
||||
} else {
|
||||
newInventoryDO = new ProStorageInventoryDO();
|
||||
newInventoryDO.setId(null);
|
||||
newInventoryDO.setStoreHouseId(proStorageMatDO.getStoreHouseId());
|
||||
newInventoryDO.setStoreAreaId(proStorageMatDO.getStoreAreaId());
|
||||
newInventoryDO.setStoreHouseCd(proStorageMatDO.getStoreHouseCd());
|
||||
newInventoryDO.setStoreHouseName(proStorageMatDO.getStoreHouseName());
|
||||
newInventoryDO.setStoreAreCd(proStorageMatDO.getStoreAreCd());
|
||||
newInventoryDO.setStoreAreaName(proStorageMatDO.getStoreAreaName());
|
||||
newInventoryDO.setMaterialId(proStorageMatDO.getMaterialId());
|
||||
newInventoryDO.setMatName(proStorageMatDO.getMatName());
|
||||
newInventoryDO.setMatCode(proStorageMatDO.getMatCode());
|
||||
newInventoryDO.setSpec(proStorageMatDO.getSpec());
|
||||
newInventoryDO.setUnit(proStorageMatDO.getUnit());
|
||||
newInventoryDO.setLotNo(proStorageMatDO.getLotNo());
|
||||
newInventoryDO.setDescription("");
|
||||
newInventoryDO.setYardQty(proStorageMatDO.getOperatorQty());
|
||||
newInventoryDO.setPackQty(proStorageMatDO.getBagQty());
|
||||
newInventoryDO.setBagSpec(proStorageMatDO.getBagSpec());
|
||||
newInventoryDO.setEarStoreDate(LocalDate.now());
|
||||
newInventoryDO.setPlanId(proStorageMatDO.getPlanId());
|
||||
newInventoryDO.setProNo(proStorageMatDO.getProNo());
|
||||
newInventoryDO.setInventBillNo(proStorageInventoryService.generateBillNo());
|
||||
proStorageInventoryMapper.insert(newInventoryDO);
|
||||
}
|
||||
}
|
||||
|
||||
ProStorageLogDO proStorageLog = new ProStorageLogDO();
|
||||
// proStorageLog.setStockId(0);
|
||||
// proStorageLog.setDescription("");
|
||||
@ -98,7 +137,7 @@ public class ProStorageServiceImpl implements ProStorageService {
|
||||
proStorageLog.setLotNo(storageInventoryDO.getLotNo());
|
||||
proStorageLog.setOperatorQty(proStorageMatDO.getOperatorQty());
|
||||
proStorageLog.setOperatorType("2");
|
||||
proStorageLog.setBusinessType("23");
|
||||
proStorageLog.setBusinessType(isMigration ? "31" : "23");
|
||||
// proStorageLog.setStorageAft(new BigDecimal("0"));
|
||||
// proStorageLog.setStorageBef(new BigDecimal("0"));
|
||||
// proStorageLog.setStockItemId(0);
|
||||
@ -173,9 +212,15 @@ public class ProStorageServiceImpl implements ProStorageService {
|
||||
private ProStorageDO saveProStorage(Integer businessType, String status, Long loginUserId, String nickname,
|
||||
String relationNo, Integer relationId, String remark) {
|
||||
ProStorageDO proStorage = new ProStorageDO();
|
||||
proStorage.setBillNo(generateBillNo("2"));
|
||||
proStorage.setOperatorType(2);
|
||||
proStorage.setBusinessType(businessType);
|
||||
if (businessType == 31) {
|
||||
// 迁移场景
|
||||
proStorage.setBillNo(generateBillNo(3));
|
||||
proStorage.setOperatorType(3);
|
||||
} else {
|
||||
proStorage.setBillNo(generateBillNo(2));
|
||||
proStorage.setOperatorType(2);
|
||||
}
|
||||
proStorage.setRemark(remark);
|
||||
proStorage.setStatus(Integer.valueOf(status));
|
||||
proStorage.setBillDate(LocalDate.now());
|
||||
@ -273,12 +318,32 @@ public class ProStorageServiceImpl implements ProStorageService {
|
||||
ProStorageMatDO proStorageMat = new ProStorageMatDO();
|
||||
proStorageMat.setStockId(proStorage.getId());
|
||||
proStorageMat.setDescription("");
|
||||
proStorageMat.setStoreHouseId(storageInventoryDO.getStoreHouseId());
|
||||
proStorageMat.setStoreAreaId(storageInventoryDO.getStoreAreaId());
|
||||
proStorageMat.setStoreHouseCd(storageInventoryDO.getStoreHouseCd());
|
||||
proStorageMat.setStoreHouseName(storageInventoryDO.getStoreHouseName());
|
||||
proStorageMat.setStoreAreCd(storageInventoryDO.getStoreAreCd());
|
||||
proStorageMat.setStoreAreaName(storageInventoryDO.getStoreAreaName());
|
||||
|
||||
// 记录旧库区信息(当前库存所在位置)
|
||||
proStorageMat.setOldStoreHouseId(storageInventoryDO.getStoreHouseId());
|
||||
proStorageMat.setOldStoreHouseName(storageInventoryDO.getStoreHouseName());
|
||||
proStorageMat.setOldStoreHouseCd(storageInventoryDO.getStoreHouseCd());
|
||||
proStorageMat.setOldStoreAreaId(storageInventoryDO.getStoreAreaId());
|
||||
proStorageMat.setOldStoreAreaName(storageInventoryDO.getStoreAreaName());
|
||||
proStorageMat.setOldStoreAreCd(storageInventoryDO.getStoreAreCd());
|
||||
|
||||
// 如果有目标库区信息(迁移场景),使用目标位置;否则使用当前库存位置
|
||||
if (updateReqVO.getStoreHouseId() != null) {
|
||||
proStorageMat.setStoreHouseId(updateReqVO.getStoreHouseId());
|
||||
proStorageMat.setStoreAreaId(updateReqVO.getStoreAreaId());
|
||||
proStorageMat.setStoreHouseCd(updateReqVO.getStoreHouseCd());
|
||||
proStorageMat.setStoreHouseName(updateReqVO.getStoreHouseName());
|
||||
proStorageMat.setStoreAreCd(updateReqVO.getStoreAreCd());
|
||||
proStorageMat.setStoreAreaName(updateReqVO.getStoreAreaName());
|
||||
} else {
|
||||
proStorageMat.setStoreHouseId(storageInventoryDO.getStoreHouseId());
|
||||
proStorageMat.setStoreAreaId(storageInventoryDO.getStoreAreaId());
|
||||
proStorageMat.setStoreHouseCd(storageInventoryDO.getStoreHouseCd());
|
||||
proStorageMat.setStoreHouseName(storageInventoryDO.getStoreHouseName());
|
||||
proStorageMat.setStoreAreCd(storageInventoryDO.getStoreAreCd());
|
||||
proStorageMat.setStoreAreaName(storageInventoryDO.getStoreAreaName());
|
||||
}
|
||||
|
||||
proStorageMat.setMaterialId(storageInventoryDO.getMaterialId());
|
||||
proStorageMat.setMatName(storageInventoryDO.getMatName());
|
||||
proStorageMat.setMatCode(storageInventoryDO.getMatCode());
|
||||
@ -324,12 +389,18 @@ public class ProStorageServiceImpl implements ProStorageService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateBillNo(String operatorType) {
|
||||
String prefix = "RKD";
|
||||
if ("2".equals(operatorType)) {
|
||||
public String generateBillNo(Integer operatorType) {
|
||||
String prefix = "";
|
||||
if (operatorType == 1) {
|
||||
prefix = "RKD";
|
||||
}
|
||||
if (operatorType==2) {
|
||||
prefix = "CKD";
|
||||
}
|
||||
String maxBillNo = proStorageMapper.selectMaxBillNo();
|
||||
if (operatorType == 3) {
|
||||
prefix = "YKD";
|
||||
}
|
||||
String maxBillNo = proStorageMapper.selectMaxBillNo(operatorType);
|
||||
return CodeGenerateUtils.generateBillNo(prefix, maxBillNo);
|
||||
}
|
||||
|
||||
|
||||
@ -97,6 +97,7 @@ declare module 'vue' {
|
||||
ProcessDesigner: typeof import('./../components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue')['default']
|
||||
ProcessPalette: typeof import('./../components/bpmnProcessDesigner/package/palette/ProcessPalette.vue')['default']
|
||||
ProcessViewer: typeof import('./../components/bpmnProcessDesigner/package/designer/ProcessViewer.vue')['default']
|
||||
Promigration: typeof import('./../api/biz/promigration/index.ts')['default']
|
||||
Propack: typeof import('./../api/biz/propack/index.ts')['default']
|
||||
ProPackForm: typeof import('./../views/biz/prostorage/ProPackForm.vue')['default']
|
||||
PropertiesPanel: typeof import('./../components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue')['default']
|
||||
@ -104,6 +105,7 @@ declare module 'vue' {
|
||||
ProReturnForm: typeof import('./../views/biz/proreturn/ProReturnForm.vue')['default']
|
||||
Prostorage: typeof import('./../views/biz/prostorage/index.vue')['default']
|
||||
ProStorageForm: typeof import('./../views/biz/prostorage/ProStorageForm.vue')['default']
|
||||
ProStorageInventoryForm: typeof import('./../views/biz/promigration/ProStorageInventoryForm.vue')['default']
|
||||
Qrcode: typeof import('./../components/Qrcode/src/Qrcode.vue')['default']
|
||||
ReceiveTask: typeof import('./../components/bpmnProcessDesigner/package/penal/task/task-components/ReceiveTask.vue')['default']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
|
||||
@ -61,7 +61,7 @@
|
||||
* />
|
||||
* ```
|
||||
*/
|
||||
import { ref, watch } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
|
||||
/**
|
||||
* Props 定义
|
||||
@ -165,6 +165,12 @@ const emit = defineEmits<{
|
||||
* @param value - 新的值(number | string | undefined)
|
||||
*/
|
||||
'change': [value: number | string | undefined]
|
||||
|
||||
/**
|
||||
* 输入事件(实时触发)
|
||||
* @param value - 当前输入的值(string)
|
||||
*/
|
||||
'input': [value: string]
|
||||
}>()
|
||||
|
||||
/**
|
||||
@ -189,16 +195,9 @@ const initDisplayValue = () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化显示值
|
||||
// 仅在组件初始化时调用一次
|
||||
initDisplayValue()
|
||||
|
||||
/**
|
||||
* 监听 modelValue 变化,同步更新显示值
|
||||
*/
|
||||
watch(() => props.modelValue, () => {
|
||||
initDisplayValue()
|
||||
}, { immediate: true })
|
||||
|
||||
/**
|
||||
* 处理输入事件
|
||||
* 过滤非法字符,限制小数位数
|
||||
@ -233,6 +232,7 @@ const handleInput = (value: string) => {
|
||||
const num = Number(inputValue)
|
||||
emit('update:modelValue', isNaN(num) ? undefined : num)
|
||||
}
|
||||
emit('input', inputValue)
|
||||
return
|
||||
}
|
||||
|
||||
@ -246,13 +246,14 @@ const handleInput = (value: string) => {
|
||||
inputValue = '-0' + inputValue.slice(1)
|
||||
}
|
||||
|
||||
// 限制小数位数
|
||||
// 限制小数位数(只保留指定位数的小数)
|
||||
const dotIndex = inputValue.indexOf('.')
|
||||
if (dotIndex !== -1) {
|
||||
const integerPart = inputValue.slice(0, dotIndex)
|
||||
const decimalPart = inputValue.slice(dotIndex + 1)
|
||||
// 只截取指定小数位数,不补齐
|
||||
const limitedDecimal = decimalPart.slice(0, props.decimalPlaces)
|
||||
inputValue = integerPart + '.' + limitedDecimal
|
||||
inputValue = integerPart + (limitedDecimal ? '.' + limitedDecimal : '')
|
||||
}
|
||||
|
||||
// 只允许一个小数点
|
||||
@ -265,6 +266,7 @@ const handleInput = (value: string) => {
|
||||
// 特殊情况处理:单独的负号或小数点
|
||||
if (inputValue === '-' || inputValue === '.') {
|
||||
displayValue.value = inputValue
|
||||
emit('input', inputValue)
|
||||
return
|
||||
}
|
||||
|
||||
@ -273,12 +275,21 @@ const handleInput = (value: string) => {
|
||||
const num = Number(inputValue)
|
||||
if (!isNaN(num)) {
|
||||
if (!props.allowNegative && num < 0) {
|
||||
inputValue = Math.abs(num).toFixed(props.decimalPlaces)
|
||||
inputValue = Math.abs(num).toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
displayValue.value = inputValue
|
||||
|
||||
// 实时更新 modelValue(输入时不格式化小数位)
|
||||
if (inputValue !== '') {
|
||||
const num = Number(inputValue)
|
||||
emit('update:modelValue', isNaN(num) ? undefined : num)
|
||||
} else {
|
||||
emit('update:modelValue', undefined)
|
||||
}
|
||||
emit('input', inputValue)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user