feat(biz): 添加成品入库出库功能并优化组件自动导入
- 移除不必要的 Element Plus 组件自动导入配置 - 添加成品入库出库相关 API 接口定义 - 新增 ProPackVO 数据传输对象 - 实现成品入库出库保存功能接口 - 重构 ProStorageService 业务逻辑 - 添加库存查询和单据号生成功能 - 优化操作人ID数据类型从字符串到长整型 - 完善入库出库日志记录机制 - 实现出库入库单据号自动生成规则
This commit is contained in:
parent
dafe863f85
commit
8ae537466d
@ -1,13 +1,14 @@
|
|||||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.propack.vo;
|
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.propack.vo;
|
||||||
|
|
||||||
import lombok.*;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.*;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||||
import java.math.BigDecimal;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
import static com.ningxia.yunxi.chemmes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
import static com.ningxia.yunxi.chemmes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||||
@ -68,7 +69,7 @@ public class ProPackPageReqVO extends PageParam {
|
|||||||
private LocalDateTime[] outEndDtime;
|
private LocalDateTime[] outEndDtime;
|
||||||
|
|
||||||
@Schema(description = "包装日期")
|
@Schema(description = "包装日期")
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||||
private LocalDate[] proDate;
|
private LocalDate[] proDate;
|
||||||
|
|
||||||
@Schema(description = "包装班组")
|
@Schema(description = "包装班组")
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
|||||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||||
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||||
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo.ProStorageInsertReqVO;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo.ProStoragePageReqVO;
|
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.ProStorageRespVO;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo.ProStorageSaveReqVO;
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo.ProStorageSaveReqVO;
|
||||||
@ -44,6 +45,14 @@ public class ProStorageController {
|
|||||||
return success(proStorageService.createProStorage(createReqVO));
|
return success(proStorageService.createProStorage(createReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/save")
|
||||||
|
@Operation(summary = "成品入/出库")
|
||||||
|
@PreAuthorize("@ss.hasPermission('twm:pro-storage:create')")
|
||||||
|
public CommonResult<Boolean> saveProStorage(@Valid @RequestBody List<ProStorageInsertReqVO> createReqVO) {
|
||||||
|
proStorageService.saveProStorage(createReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新成品入/出库")
|
@Operation(summary = "更新成品入/出库")
|
||||||
@PreAuthorize("@ss.hasPermission('twm:pro-storage:update')")
|
@PreAuthorize("@ss.hasPermission('twm:pro-storage:update')")
|
||||||
@ -83,12 +92,12 @@ public class ProStorageController {
|
|||||||
@PreAuthorize("@ss.hasPermission('twm:pro-storage:export')")
|
@PreAuthorize("@ss.hasPermission('twm:pro-storage:export')")
|
||||||
@OperateLog(type = EXPORT)
|
@OperateLog(type = EXPORT)
|
||||||
public void exportProStorageExcel(@Valid ProStoragePageReqVO pageReqVO,
|
public void exportProStorageExcel(@Valid ProStoragePageReqVO pageReqVO,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
List<ProStorageDO> list = proStorageService.getProStoragePage(pageReqVO).getList();
|
List<ProStorageDO> list = proStorageService.getProStoragePage(pageReqVO).getList();
|
||||||
// 导出 Excel
|
// 导出 Excel
|
||||||
ExcelUtils.write(response, "成品入/出库.xls", "数据", ProStorageRespVO.class,
|
ExcelUtils.write(response, "成品入/出库.xls", "数据", ProStorageRespVO.class,
|
||||||
BeanUtils.toBean(list, ProStorageRespVO.class));
|
BeanUtils.toBean(list, ProStorageRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,21 @@
|
|||||||
|
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 成品入/出库新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ProStorageInsertReqVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源id
|
||||||
|
*/
|
||||||
|
private Integer id;
|
||||||
|
private Integer storeHouseId;
|
||||||
|
private String storeHouseName;
|
||||||
|
private String storeHouseCd;
|
||||||
|
private Integer storeAreaId;
|
||||||
|
private String storeAreCd;
|
||||||
|
private String storeAreaName;
|
||||||
|
|
||||||
|
}
|
||||||
@ -55,7 +55,7 @@ public class ProStorageDO extends BaseDO {
|
|||||||
/**
|
/**
|
||||||
* 操作人id
|
* 操作人id
|
||||||
*/
|
*/
|
||||||
private String operatorId;
|
private Long operatorId;
|
||||||
/**
|
/**
|
||||||
* 操作人
|
* 操作人
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -3,7 +3,6 @@ package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.prostoragemat;
|
|||||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
|
|
||||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDOWithoutLogic;
|
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDOWithoutLogic;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
@ -32,7 +31,7 @@ public class ProStorageMatDO extends BaseDOWithoutLogic {
|
|||||||
/**
|
/**
|
||||||
* 入/出库Id
|
* 入/出库Id
|
||||||
*/
|
*/
|
||||||
private Long stockId;
|
private Integer stockId;
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
@ -96,7 +95,7 @@ public class ProStorageMatDO extends BaseDOWithoutLogic {
|
|||||||
/**
|
/**
|
||||||
* 关联单号id
|
* 关联单号id
|
||||||
*/
|
*/
|
||||||
private Long relarionId;
|
private Integer relarionId;
|
||||||
/**
|
/**
|
||||||
* 单袋规格
|
* 单袋规格
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -50,4 +50,12 @@ public interface ProStorageInventoryMapper extends BaseMapperX<ProStorageInvento
|
|||||||
return record != null ? record.getInventBillNo() : null;
|
return record != null ? record.getInventBillNo() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default ProStorageInventoryDO selectByMat(String storeHouseCd, String storeAreCd, String lotNo, String matCode) {
|
||||||
|
return selectOne(new LambdaQueryWrapperX<ProStorageInventoryDO>()
|
||||||
|
.eq(ProStorageInventoryDO::getStoreHouseCd, storeHouseCd)
|
||||||
|
.eq(ProStorageInventoryDO::getStoreAreCd, storeAreCd)
|
||||||
|
.eq(ProStorageInventoryDO::getLotNo, lotNo)
|
||||||
|
.eq(ProStorageInventoryDO::getMatCode, matCode)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
package com.ningxia.yunxi.chemmes.module.biz.service.prostorage;
|
package com.ningxia.yunxi.chemmes.module.biz.service.prostorage;
|
||||||
|
|
||||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo.ProStorageInsertReqVO;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo.ProStoragePageReqVO;
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo.ProStoragePageReqVO;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo.ProStorageSaveReqVO;
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo.ProStorageSaveReqVO;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.prostorage.ProStorageDO;
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.prostorage.ProStorageDO;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 成品入/出库 Service 接口
|
* 成品入/出库 Service 接口
|
||||||
@ -22,6 +24,8 @@ public interface ProStorageService {
|
|||||||
*/
|
*/
|
||||||
Integer createProStorage(@Valid ProStorageSaveReqVO createReqVO);
|
Integer createProStorage(@Valid ProStorageSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
void saveProStorage(@Valid List<ProStorageInsertReqVO> createReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新成品入/出库
|
* 更新成品入/出库
|
||||||
*
|
*
|
||||||
@ -52,6 +56,6 @@ public interface ProStorageService {
|
|||||||
*/
|
*/
|
||||||
PageResult<ProStorageDO> getProStoragePage(ProStoragePageReqVO pageReqVO);
|
PageResult<ProStorageDO> getProStoragePage(ProStoragePageReqVO pageReqVO);
|
||||||
|
|
||||||
String generateSaleDeliveryNo();
|
String generateBillNo(String operatorType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,17 +1,33 @@
|
|||||||
package com.ningxia.yunxi.chemmes.module.biz.service.prostorage;
|
package com.ningxia.yunxi.chemmes.module.biz.service.prostorage;
|
||||||
|
|
||||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.util.CodeGenerateUtils;
|
||||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo.ProStorageInsertReqVO;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo.ProStoragePageReqVO;
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo.ProStoragePageReqVO;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo.ProStorageSaveReqVO;
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorage.vo.ProStorageSaveReqVO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.propack.ProPackDO;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.prostorage.ProStorageDO;
|
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.prostoragelog.ProStorageLogDO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.prostoragemat.ProStorageMatDO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.propack.ProPackMapper;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.prostorage.ProStorageMapper;
|
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.prostorage.ProStorageMapper;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.prostorageinventory.ProStorageInventoryMapper;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.prostoragemat.ProStorageMatMapper;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.service.prostorageinventory.ProStorageInventoryService;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.service.prostoragelog.ProStorageLogService;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.system.service.user.AdminUserService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.util.List;
|
||||||
|
|
||||||
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
|
||||||
@ -22,10 +38,16 @@ import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceE
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Validated
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class ProStorageServiceImpl implements ProStorageService {
|
public class ProStorageServiceImpl implements ProStorageService {
|
||||||
|
|
||||||
@Resource
|
private final ProStorageMapper proStorageMapper;
|
||||||
private ProStorageMapper proStorageMapper;
|
private final ProStorageMatMapper proStorageMatMapper;
|
||||||
|
private final ProStorageLogService proStorageLogService;
|
||||||
|
private final ProPackMapper proPackMapper;
|
||||||
|
private final ProStorageInventoryService proStorageInventoryService;
|
||||||
|
private final ProStorageInventoryMapper proStorageInventoryMapper;
|
||||||
|
private final AdminUserService adminUserService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer createProStorage(ProStorageSaveReqVO createReqVO) {
|
public Integer createProStorage(ProStorageSaveReqVO createReqVO) {
|
||||||
@ -36,6 +58,140 @@ public class ProStorageServiceImpl implements ProStorageService {
|
|||||||
return proStorage.getId();
|
return proStorage.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void saveProStorage(List<ProStorageInsertReqVO> reqVOS) {
|
||||||
|
|
||||||
|
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
||||||
|
AdminUserDO user = adminUserService.getUser(loginUserId);
|
||||||
|
String nickname = user.getNickname();
|
||||||
|
for (ProStorageInsertReqVO createReqVO : reqVOS) {
|
||||||
|
ProPackDO proPackDO = proPackMapper.selectById(createReqVO.getId());
|
||||||
|
ProStorageDO proStorage = saveProStorage(loginUserId, nickname, proPackDO);
|
||||||
|
ProStorageInventoryDO storageInventoryDO = svaeStorageInventory(createReqVO, proPackDO);
|
||||||
|
saveLog(createReqVO, proStorage, proPackDO, storageInventoryDO, loginUserId, nickname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private ProStorageInventoryDO svaeStorageInventory(ProStorageInsertReqVO createReqVO, ProPackDO proPackDO) {
|
||||||
|
ProStorageInventoryDO storageInventoryDO = proStorageInventoryService.selectByMat(createReqVO.getStoreHouseCd(), createReqVO.getStoreAreCd(), proPackDO.getLotNo(), proPackDO.getMaterialCode());
|
||||||
|
if (storageInventoryDO != null) {
|
||||||
|
storageInventoryDO.setYardQty(storageInventoryDO.getYardQty().add(proPackDO.getPackQtyAct()));
|
||||||
|
storageInventoryDO.setPackQty(storageInventoryDO.getPackQty() + proPackDO.getPackBagQty());
|
||||||
|
proStorageInventoryMapper.updateById(storageInventoryDO);
|
||||||
|
} else {
|
||||||
|
storageInventoryDO = new ProStorageInventoryDO();
|
||||||
|
storageInventoryDO.setId(null);
|
||||||
|
storageInventoryDO.setStoreHouseId(createReqVO.getStoreHouseId());
|
||||||
|
storageInventoryDO.setStoreAreaId(createReqVO.getStoreAreaId());
|
||||||
|
storageInventoryDO.setStoreHouseCd(createReqVO.getStoreHouseCd());
|
||||||
|
storageInventoryDO.setStoreHouseName(createReqVO.getStoreHouseName());
|
||||||
|
storageInventoryDO.setStoreAreCd(createReqVO.getStoreAreCd());
|
||||||
|
storageInventoryDO.setStoreAreaName(createReqVO.getStoreAreaName());
|
||||||
|
storageInventoryDO.setMaterialId(proPackDO.getMaterialId());
|
||||||
|
storageInventoryDO.setMatName(proPackDO.getMaterialName());
|
||||||
|
storageInventoryDO.setMatCode(proPackDO.getMaterialCode());
|
||||||
|
storageInventoryDO.setSpec(proPackDO.getSpec());
|
||||||
|
storageInventoryDO.setUnit(proPackDO.getUnit());
|
||||||
|
storageInventoryDO.setLotNo(proPackDO.getLotNo());
|
||||||
|
storageInventoryDO.setDescription("");
|
||||||
|
storageInventoryDO.setYardQty(proPackDO.getPackQtyAct());
|
||||||
|
// storageInventoryDO.setUseQty();
|
||||||
|
// storageInventoryDO.setPreQty();
|
||||||
|
// storageInventoryDO.setPrice();
|
||||||
|
storageInventoryDO.setPackQty(proPackDO.getPackBagQty());
|
||||||
|
storageInventoryDO.setBagSpec(proPackDO.getBagSpec());
|
||||||
|
storageInventoryDO.setEarStoreDate(LocalDate.now());
|
||||||
|
storageInventoryDO.setPlanId(proPackDO.getPlanId());
|
||||||
|
storageInventoryDO.setProNo(proPackDO.getPlanNo());
|
||||||
|
String s = proStorageInventoryService.generateBillNo();
|
||||||
|
storageInventoryDO.setInventBillNo(s);
|
||||||
|
proStorageInventoryMapper.insert(storageInventoryDO);
|
||||||
|
}
|
||||||
|
return storageInventoryDO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private ProStorageDO saveProStorage(Long loginUserId, String nickname, ProPackDO proPackDO) {
|
||||||
|
ProStorageDO proStorage = new ProStorageDO();
|
||||||
|
proStorage.setBillNo(generateBillNo("2"));
|
||||||
|
proStorage.setOperatorType(1);
|
||||||
|
proStorage.setBusinessType(10);
|
||||||
|
proStorage.setRemark("");
|
||||||
|
proStorage.setStatus(2);
|
||||||
|
proStorage.setBillDate(LocalDate.now());
|
||||||
|
proStorage.setOperatorId(loginUserId);
|
||||||
|
proStorage.setOperatorName(nickname);
|
||||||
|
proStorage.setRelarionNo(proPackDO.getPackNo());
|
||||||
|
proStorage.setRelarionId(proPackDO.getId());
|
||||||
|
// proStorage.setBillType("0");
|
||||||
|
// proStorage.setSourceNo();
|
||||||
|
// proStorage.setSourceId();
|
||||||
|
proStorageMapper.insert(proStorage);
|
||||||
|
return proStorage;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void saveLog(ProStorageInsertReqVO createReqVO, ProStorageDO proStorage, ProPackDO proPackDO, ProStorageInventoryDO storageInventoryDO, Long loginUserId, String nickname) {
|
||||||
|
ProStorageMatDO proStorageMat = new ProStorageMatDO();
|
||||||
|
proStorageMat.setStockId(proStorage.getId());
|
||||||
|
proStorageMat.setDescription("");
|
||||||
|
proStorageMat.setStoreHouseId(createReqVO.getStoreHouseId());
|
||||||
|
proStorageMat.setStoreAreaId(createReqVO.getStoreAreaId());
|
||||||
|
proStorageMat.setStoreHouseCd(createReqVO.getStoreHouseCd());
|
||||||
|
proStorageMat.setStoreHouseName(createReqVO.getStoreHouseName());
|
||||||
|
proStorageMat.setStoreAreCd(createReqVO.getStoreAreCd());
|
||||||
|
proStorageMat.setStoreAreaName(createReqVO.getStoreAreaName());
|
||||||
|
proStorageMat.setMaterialId(proPackDO.getMaterialId());
|
||||||
|
proStorageMat.setMatName(proPackDO.getMaterialName());
|
||||||
|
proStorageMat.setMatCode(proPackDO.getMaterialCode());
|
||||||
|
proStorageMat.setSpec(proPackDO.getSpec());
|
||||||
|
proStorageMat.setUnit(proPackDO.getUnit());
|
||||||
|
proStorageMat.setLotNo(proPackDO.getLotNo());
|
||||||
|
proStorageMat.setOperatorQty(proPackDO.getPackQtyAct());
|
||||||
|
// proStorageMat.setSourceId();
|
||||||
|
proStorageMat.setRelarionId(proPackDO.getId());
|
||||||
|
proStorageMat.setBagSpec(proPackDO.getBagSpec());
|
||||||
|
proStorageMat.setBagQty(proPackDO.getPackBagQty());
|
||||||
|
proStorageMat.setPlanId(proPackDO.getPlanId());
|
||||||
|
proStorageMat.setProNo(proPackDO.getPlanNo());
|
||||||
|
proStorageMat.setInventBillNo(storageInventoryDO.getInventBillNo());
|
||||||
|
proStorageMatMapper.insert(proStorageMat);
|
||||||
|
|
||||||
|
ProStorageLogDO proStorageLog = new ProStorageLogDO();
|
||||||
|
proStorageLog.setId(null);
|
||||||
|
// proStorageLog.setStockId();
|
||||||
|
proStorageLog.setDescription("");
|
||||||
|
proStorageLog.setStatus("2");
|
||||||
|
proStorageLog.setStoreHouseId(createReqVO.getStoreHouseId());
|
||||||
|
proStorageLog.setStoreAreaId(createReqVO.getStoreAreaId());
|
||||||
|
proStorageLog.setStoreHouseCd(createReqVO.getStoreHouseCd());
|
||||||
|
proStorageLog.setStoreHouseName(createReqVO.getStoreHouseName());
|
||||||
|
proStorageLog.setStoreAreCd(createReqVO.getStoreAreCd());
|
||||||
|
proStorageLog.setStoreAreaName(createReqVO.getStoreAreaName());
|
||||||
|
proStorageLog.setMaterialId(proPackDO.getMaterialId());
|
||||||
|
proStorageLog.setMatName(proPackDO.getMaterialName());
|
||||||
|
proStorageLog.setMatCode(proPackDO.getMaterialCode());
|
||||||
|
proStorageLog.setSpec(proPackDO.getSpec());
|
||||||
|
proStorageLog.setUnit(proPackDO.getUnit());
|
||||||
|
proStorageLog.setLotNo(proPackDO.getLotNo());
|
||||||
|
proStorageLog.setOperatorQty(proPackDO.getPackQtyAct());
|
||||||
|
proStorageLog.setOperatorType("1");
|
||||||
|
proStorageLog.setBusinessType("10");
|
||||||
|
// proStorageLog.setStorageAft();
|
||||||
|
// proStorageLog.setStorageBef();
|
||||||
|
// proStorageLog.setStockItemId();
|
||||||
|
proStorageLog.setBillDate(LocalDate.now());
|
||||||
|
proStorageLog.setOperatorId(String.valueOf(loginUserId));
|
||||||
|
proStorageLog.setOperatorName(nickname);
|
||||||
|
proStorageLog.setRelarionNo(proStorage.getBillNo());
|
||||||
|
proStorageLog.setRelarionId(proStorage.getId());
|
||||||
|
proStorageLog.setRelarionDetailId(proStorageMat.getId());
|
||||||
|
// proStorageLog.setDpstNo();
|
||||||
|
proStorageLog.setInventBillNo(storageInventoryDO.getInventBillNo());
|
||||||
|
proStorageLogService.saveProStorageLog(proStorageLog);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateProStorage(ProStorageSaveReqVO updateReqVO) {
|
public void updateProStorage(ProStorageSaveReqVO updateReqVO) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
@ -70,20 +226,13 @@ public class ProStorageServiceImpl implements ProStorageService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String generateSaleDeliveryNo() {
|
public String generateBillNo(String operatorType) {
|
||||||
String ym = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMM"));
|
String prefix = "CK";
|
||||||
|
if ("2".equals(operatorType)) {
|
||||||
String maxBillNo = proStorageMapper.selectMaxBillNo();
|
prefix = "RKD";
|
||||||
|
|
||||||
if (maxBillNo == null || maxBillNo.length() < 9
|
|
||||||
|| !maxBillNo.substring(2, 8).equals(ym)) {
|
|
||||||
return "CK" + ym + "001";
|
|
||||||
} else {
|
|
||||||
String prefix = maxBillNo.substring(0, 8);
|
|
||||||
int sequence = Integer.parseInt(maxBillNo.substring(8));
|
|
||||||
sequence++;
|
|
||||||
return prefix + String.format("%03d", sequence);
|
|
||||||
}
|
}
|
||||||
|
String maxBillNo = proStorageMapper.selectMaxBillNo();
|
||||||
|
return CodeGenerateUtils.generateBillNo(prefix, maxBillNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,4 +52,10 @@ public interface ProStorageInventoryService {
|
|||||||
*/
|
*/
|
||||||
PageResult<ProStorageInventoryDO> getProStorageInventoryPage(ProStorageInventoryPageReqVO pageReqVO);
|
PageResult<ProStorageInventoryDO> getProStorageInventoryPage(ProStorageInventoryPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
|
||||||
|
ProStorageInventoryDO selectByMat(String storeHouseCd, String storeAreCd, String lotNo, String matCode);
|
||||||
|
|
||||||
|
String generateBillNo( );
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.ningxia.yunxi.chemmes.module.biz.service.prostorageinventory;
|
package com.ningxia.yunxi.chemmes.module.biz.service.prostorageinventory;
|
||||||
|
|
||||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.util.CodeGenerateUtils;
|
||||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorageinventory.vo.ProStorageInventoryPageReqVO;
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorageinventory.vo.ProStorageInventoryPageReqVO;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorageinventory.vo.ProStorageInventorySaveReqVO;
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.prostorageinventory.vo.ProStorageInventorySaveReqVO;
|
||||||
@ -67,4 +68,15 @@ public class ProStorageInventoryServiceImpl implements ProStorageInventoryServic
|
|||||||
return proStorageInventoryMapper.selectPage(pageReqVO);
|
return proStorageInventoryMapper.selectPage(pageReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProStorageInventoryDO selectByMat(String storeHouseCd, String storeAreCd, String lotNo, String matCode) {
|
||||||
|
return proStorageInventoryMapper.selectByMat(storeHouseCd, storeAreCd, lotNo, matCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String generateBillNo( ) {
|
||||||
|
String prefix = "CH";
|
||||||
|
String maxBillNo = proStorageInventoryMapper.selectMaxInventBillNo();
|
||||||
|
return CodeGenerateUtils.generateBillNo(prefix, maxBillNo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,8 +77,12 @@ public class ProStorageLogServiceImpl implements ProStorageLogService {
|
|||||||
|
|
||||||
|
|
||||||
private String generatePurReceiptNo(String operatorType) {
|
private String generatePurReceiptNo(String operatorType) {
|
||||||
|
String prifix = "CK";
|
||||||
|
if ("2".equals(operatorType)) {
|
||||||
|
prifix = "RK";
|
||||||
|
}
|
||||||
String maxPurReceiptNo = proStorageLogMapper.selectMaxPurReceiptNo(operatorType);
|
String maxPurReceiptNo = proStorageLogMapper.selectMaxPurReceiptNo(operatorType);
|
||||||
return CodeGenerateUtils.generateBillNo("CK", maxPurReceiptNo);
|
return CodeGenerateUtils.generateBillNo(prifix, maxPurReceiptNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,16 @@ export interface ProStorageVO {
|
|||||||
sourceId: number
|
sourceId: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ProPackVO {
|
||||||
|
id: number
|
||||||
|
storeHouseId: number
|
||||||
|
storeAreaId: number
|
||||||
|
storeHouseCd: string
|
||||||
|
storeHouseName: string
|
||||||
|
storeAreaCd: string
|
||||||
|
storeAreaName: string
|
||||||
|
}
|
||||||
|
|
||||||
// 查询成品入/出库分页
|
// 查询成品入/出库分页
|
||||||
export const getProStoragePage = async (params) => {
|
export const getProStoragePage = async (params) => {
|
||||||
return await request.get({ url: `/twm/pro-storage/page`, params })
|
return await request.get({ url: `/twm/pro-storage/page`, params })
|
||||||
@ -32,6 +42,11 @@ export const createProStorage = async (data: ProStorageVO) => {
|
|||||||
return await request.post({ url: `/twm/pro-storage/create`, data })
|
return await request.post({ url: `/twm/pro-storage/create`, data })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 新增成品入/出库
|
||||||
|
export const saveProStorage = async (data: ProPackVO) => {
|
||||||
|
return await request.post({ url: `/twm/pro-storage/save`, data })
|
||||||
|
}
|
||||||
|
|
||||||
// 修改成品入/出库
|
// 修改成品入/出库
|
||||||
export const updateProStorage = async (data: ProStorageVO) => {
|
export const updateProStorage = async (data: ProStorageVO) => {
|
||||||
return await request.put({ url: `/twm/pro-storage/update`, data })
|
return await request.put({ url: `/twm/pro-storage/update`, data })
|
||||||
|
|||||||
@ -32,27 +32,13 @@ declare module 'vue' {
|
|||||||
Echart: typeof import('./../components/Echart/src/Echart.vue')['default']
|
Echart: typeof import('./../components/Echart/src/Echart.vue')['default']
|
||||||
Editor: typeof import('./../components/Editor/src/Editor.vue')['default']
|
Editor: typeof import('./../components/Editor/src/Editor.vue')['default']
|
||||||
ElAlert: typeof import('element-plus/es')['ElAlert']
|
ElAlert: typeof import('element-plus/es')['ElAlert']
|
||||||
ElAside: typeof import('element-plus/es')['ElAside']
|
|
||||||
ElAutoResizer: typeof import('element-plus/es')['ElAutoResizer']
|
|
||||||
ElAvatar: typeof import('element-plus/es')['ElAvatar']
|
ElAvatar: typeof import('element-plus/es')['ElAvatar']
|
||||||
ElBadge: typeof import('element-plus/es')['ElBadge']
|
|
||||||
ElButton: typeof import('element-plus/es')['ElButton']
|
ElButton: typeof import('element-plus/es')['ElButton']
|
||||||
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
|
|
||||||
ElCard: typeof import('element-plus/es')['ElCard']
|
ElCard: typeof import('element-plus/es')['ElCard']
|
||||||
ElCarousel: typeof import('element-plus/es')['ElCarousel']
|
|
||||||
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
|
|
||||||
ElCascader: typeof import('element-plus/es')['ElCascader']
|
|
||||||
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
|
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
|
||||||
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
|
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
|
||||||
ElCol: typeof import('element-plus/es')['ElCol']
|
ElCol: typeof import('element-plus/es')['ElCol']
|
||||||
ElCollapse: typeof import('element-plus/es')['ElCollapse']
|
|
||||||
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
|
|
||||||
ElCollapseTransition: typeof import('element-plus/es')['ElCollapseTransition']
|
|
||||||
ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
|
|
||||||
ElContainer: typeof import('element-plus/es')['ElContainer']
|
|
||||||
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
||||||
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
|
|
||||||
ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
|
|
||||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||||
ElDivider: typeof import('element-plus/es')['ElDivider']
|
ElDivider: typeof import('element-plus/es')['ElDivider']
|
||||||
ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
||||||
@ -68,41 +54,27 @@ declare module 'vue' {
|
|||||||
ElementTask: typeof import('./../components/bpmnProcessDesigner/package/penal/task/ElementTask.vue')['default']
|
ElementTask: typeof import('./../components/bpmnProcessDesigner/package/penal/task/ElementTask.vue')['default']
|
||||||
ElForm: typeof import('element-plus/es')['ElForm']
|
ElForm: typeof import('element-plus/es')['ElForm']
|
||||||
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
||||||
ElHeader: typeof import('element-plus/es')['ElHeader']
|
|
||||||
ElIcon: typeof import('element-plus/es')['ElIcon']
|
ElIcon: typeof import('element-plus/es')['ElIcon']
|
||||||
ElImage: typeof import('element-plus/es')['ElImage']
|
|
||||||
ElImageViewer: typeof import('element-plus/es')['ElImageViewer']
|
ElImageViewer: typeof import('element-plus/es')['ElImageViewer']
|
||||||
ElInput: typeof import('element-plus/es')['ElInput']
|
ElInput: typeof import('element-plus/es')['ElInput']
|
||||||
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
|
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
|
||||||
ElLink: typeof import('element-plus/es')['ElLink']
|
|
||||||
ElMain: typeof import('element-plus/es')['ElMain']
|
|
||||||
ElOption: typeof import('element-plus/es')['ElOption']
|
ElOption: typeof import('element-plus/es')['ElOption']
|
||||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||||
ElPopover: typeof import('element-plus/es')['ElPopover']
|
ElPopover: typeof import('element-plus/es')['ElPopover']
|
||||||
ElRadio: typeof import('element-plus/es')['ElRadio']
|
ElRadio: typeof import('element-plus/es')['ElRadio']
|
||||||
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
|
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
|
||||||
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
||||||
ElRate: typeof import('element-plus/es')['ElRate']
|
|
||||||
ElRow: typeof import('element-plus/es')['ElRow']
|
ElRow: typeof import('element-plus/es')['ElRow']
|
||||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||||
ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
|
ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
|
||||||
ElSlider: typeof import('element-plus/es')['ElSlider']
|
|
||||||
ElSpace: typeof import('element-plus/es')['ElSpace']
|
|
||||||
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
||||||
ElTable: typeof import('element-plus/es')['ElTable']
|
ElTable: typeof import('element-plus/es')['ElTable']
|
||||||
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
||||||
ElTableV2: typeof import('element-plus/es')['ElTableV2']
|
|
||||||
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
||||||
ElTabs: typeof import('element-plus/es')['ElTabs']
|
ElTabs: typeof import('element-plus/es')['ElTabs']
|
||||||
ElTag: typeof import('element-plus/es')['ElTag']
|
ElTag: typeof import('element-plus/es')['ElTag']
|
||||||
ElText: typeof import('element-plus/es')['ElText']
|
|
||||||
ElTimeline: typeof import('element-plus/es')['ElTimeline']
|
|
||||||
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
|
|
||||||
ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
|
|
||||||
ElTimeSelect: typeof import('element-plus/es')['ElTimeSelect']
|
|
||||||
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
||||||
ElTransfer: typeof import('element-plus/es')['ElTransfer']
|
|
||||||
ElTree: typeof import('element-plus/es')['ElTree']
|
ElTree: typeof import('element-plus/es')['ElTree']
|
||||||
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
|
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
|
||||||
ElUpload: typeof import('element-plus/es')['ElUpload']
|
ElUpload: typeof import('element-plus/es')['ElUpload']
|
||||||
@ -122,7 +94,11 @@ declare module 'vue' {
|
|||||||
ProcessDesigner: typeof import('./../components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue')['default']
|
ProcessDesigner: typeof import('./../components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue')['default']
|
||||||
ProcessPalette: typeof import('./../components/bpmnProcessDesigner/package/palette/ProcessPalette.vue')['default']
|
ProcessPalette: typeof import('./../components/bpmnProcessDesigner/package/palette/ProcessPalette.vue')['default']
|
||||||
ProcessViewer: typeof import('./../components/bpmnProcessDesigner/package/designer/ProcessViewer.vue')['default']
|
ProcessViewer: typeof import('./../components/bpmnProcessDesigner/package/designer/ProcessViewer.vue')['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']
|
PropertiesPanel: typeof import('./../components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue')['default']
|
||||||
|
Prostorage: typeof import('./../views/biz/prostorage/index.vue')['default']
|
||||||
|
ProStorageForm: typeof import('./../views/biz/prostorage/ProStorageForm.vue')['default']
|
||||||
Qrcode: typeof import('./../components/Qrcode/src/Qrcode.vue')['default']
|
Qrcode: typeof import('./../components/Qrcode/src/Qrcode.vue')['default']
|
||||||
ReceiveTask: typeof import('./../components/bpmnProcessDesigner/package/penal/task/task-components/ReceiveTask.vue')['default']
|
ReceiveTask: typeof import('./../components/bpmnProcessDesigner/package/penal/task/task-components/ReceiveTask.vue')['default']
|
||||||
RouterLink: typeof import('vue-router')['RouterLink']
|
RouterLink: typeof import('vue-router')['RouterLink']
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user