新购配件入库
This commit is contained in:
parent
8dc5fc562c
commit
a3dcf55260
|
|
@ -0,0 +1,47 @@
|
|||
package com.bonus.sgzb.material.controller;
|
||||
|
||||
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
|
||||
import com.bonus.sgzb.material.domain.PurchaseInput;
|
||||
import com.bonus.sgzb.material.domain.PurchasePartInfo;
|
||||
import com.bonus.sgzb.material.service.IPurchaseAccessoryService;
|
||||
import com.bonus.sgzb.material.service.IPurchaseCheckInfoService;
|
||||
import com.bonus.sgzb.material.vo.NoticeInfoVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 新购配件任务
|
||||
* @author hay
|
||||
* @date 2024/1/16 11:28
|
||||
*/
|
||||
@RestController
|
||||
@Api(value = "新购配件任务")
|
||||
@RequestMapping("/purchaseAccessory")
|
||||
public class PurchaseAccessoryController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IPurchaseAccessoryService purchaseAccessoryService;
|
||||
|
||||
/**
|
||||
* 新增新购配件任务
|
||||
*/
|
||||
@ApiOperation("新增新购配件任务")
|
||||
@Log(title = "新购配件任务", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody PurchasePartInfo purchasePartInfo)
|
||||
{
|
||||
return toAjax(purchaseAccessoryService.insertPurchaseAccessory(purchasePartInfo));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,342 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @description 新购配件任务详细 purchase_part_details对象
|
||||
* @author hay
|
||||
* @date 2024/1/16 13:54
|
||||
*/
|
||||
public class PurchasePartDetails extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 任务ID */
|
||||
@ApiModelProperty(value = "任务ID")
|
||||
private Long taskId;
|
||||
|
||||
/** 规格id */
|
||||
@ApiModelProperty(value = "规格id")
|
||||
private Long partId;
|
||||
|
||||
/** 采购单价 */
|
||||
@ApiModelProperty(value = "采购单价")
|
||||
private String purchasePrice;
|
||||
|
||||
/** 采购数量 */
|
||||
@ApiModelProperty(value = "采购数量")
|
||||
private Long purchaseNum;
|
||||
|
||||
/** 验收数量 */
|
||||
@ApiModelProperty(value = "验收数量")
|
||||
private BigDecimal checkNum;
|
||||
|
||||
/** 绑定数量 */
|
||||
@ApiModelProperty(value = "绑定数量")
|
||||
private Integer bindNum;
|
||||
|
||||
/** 验收结论 */
|
||||
@ApiModelProperty(value = "验收结论")
|
||||
private String checkResult;
|
||||
|
||||
/** 供应商id */
|
||||
@ApiModelProperty(value = "供应商id")
|
||||
private Long supplierId;
|
||||
|
||||
/** 供应商id */
|
||||
@ApiModelProperty(value = "供应商名称")
|
||||
private String supplier;
|
||||
|
||||
/** 验收状态0,未验收 1,已验收 2,待通知 */
|
||||
@ApiModelProperty(value = "验收状态0,未验收 1,已验收 2,待通知")
|
||||
private Integer status;
|
||||
|
||||
/** 出厂日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "出厂日期")
|
||||
private Date productionTime;
|
||||
|
||||
/** 入库数量 */
|
||||
@ApiModelProperty(value = "入库数量")
|
||||
private BigDecimal inputNum;
|
||||
|
||||
/** 验收图片 */
|
||||
@ApiModelProperty(value = "验收图片")
|
||||
private String checkUrlName;
|
||||
|
||||
/** 验收图片名称 */
|
||||
@ApiModelProperty(value = "验收图片名称")
|
||||
private String checkUrl;
|
||||
|
||||
/** 验收附件名称 */
|
||||
@ApiModelProperty(value = "验收附件名称")
|
||||
private String fileName;
|
||||
|
||||
/** 验收附件 */
|
||||
@ApiModelProperty(value = "验收附件")
|
||||
private String fileUrl;
|
||||
|
||||
/** 数据所属组织 */
|
||||
@ApiModelProperty(value = "数据所属组织")
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String specificationType;
|
||||
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty(value = "机具类型名称")
|
||||
private String machineTypeName;
|
||||
|
||||
@ApiModelProperty(value = "管理方式(0编号 1计数)")
|
||||
private String manageType;
|
||||
|
||||
@ApiModelProperty(value = "采购单号")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "关键字筛选")
|
||||
private String keyWord;
|
||||
|
||||
public void setTaskId(Long taskId)
|
||||
{
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public Long getTaskId()
|
||||
{
|
||||
return taskId;
|
||||
}
|
||||
|
||||
public Long getPartId() {
|
||||
return partId;
|
||||
}
|
||||
|
||||
public void setPartId(Long partId) {
|
||||
this.partId = partId;
|
||||
}
|
||||
|
||||
public void setPurchasePrice(String purchasePrice)
|
||||
{
|
||||
this.purchasePrice = purchasePrice;
|
||||
}
|
||||
|
||||
public String getPurchasePrice()
|
||||
{
|
||||
return purchasePrice;
|
||||
}
|
||||
public void setPurchaseNum(Long purchaseNum)
|
||||
{
|
||||
this.purchaseNum = purchaseNum;
|
||||
}
|
||||
|
||||
public Long getPurchaseNum()
|
||||
{
|
||||
return purchaseNum;
|
||||
}
|
||||
public void setSupplierId(Long supplierId)
|
||||
{
|
||||
this.supplierId = supplierId;
|
||||
}
|
||||
|
||||
public Long getSupplierId()
|
||||
{
|
||||
return supplierId;
|
||||
}
|
||||
public void setProductionTime(Date productionTime)
|
||||
{
|
||||
this.productionTime = productionTime;
|
||||
}
|
||||
|
||||
public Date getProductionTime()
|
||||
{
|
||||
return productionTime;
|
||||
}
|
||||
public void setCompanyId(Long companyId)
|
||||
{
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public Long getCompanyId()
|
||||
{
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSpecificationType() {
|
||||
return specificationType;
|
||||
}
|
||||
|
||||
public void setSpecificationType(String specificationType) {
|
||||
this.specificationType = specificationType;
|
||||
}
|
||||
|
||||
public String getSupplier() {
|
||||
return supplier;
|
||||
}
|
||||
|
||||
public void setSupplier(String supplier) {
|
||||
this.supplier = supplier;
|
||||
}
|
||||
|
||||
public BigDecimal getCheckNum() {
|
||||
return checkNum;
|
||||
}
|
||||
|
||||
public void setCheckNum(BigDecimal checkNum) {
|
||||
this.checkNum = checkNum;
|
||||
}
|
||||
|
||||
public String getCheckResult() {
|
||||
return checkResult;
|
||||
}
|
||||
|
||||
public void setCheckResult(String checkResult) {
|
||||
this.checkResult = checkResult;
|
||||
}
|
||||
|
||||
public String getCheckUrlName() {
|
||||
return checkUrlName;
|
||||
}
|
||||
|
||||
public void setCheckUrlName(String checkUrlName) {
|
||||
this.checkUrlName = checkUrlName;
|
||||
}
|
||||
|
||||
public String getCheckUrl() {
|
||||
return checkUrl;
|
||||
}
|
||||
|
||||
public void setCheckUrl(String checkUrl) {
|
||||
this.checkUrl = checkUrl;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getFileUrl() {
|
||||
return fileUrl;
|
||||
}
|
||||
|
||||
public void setFileUrl(String fileUrl) {
|
||||
this.fileUrl = fileUrl;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getMachineTypeName() {
|
||||
return machineTypeName;
|
||||
}
|
||||
|
||||
public void setMachineTypeName(String machineTypeName) {
|
||||
this.machineTypeName = machineTypeName;
|
||||
}
|
||||
|
||||
public BigDecimal getInputNum() {
|
||||
return inputNum;
|
||||
}
|
||||
|
||||
public void setInputNum(BigDecimal inputNum) {
|
||||
this.inputNum = inputNum;
|
||||
}
|
||||
|
||||
public String getManageType() {
|
||||
return manageType;
|
||||
}
|
||||
|
||||
public void setManageType(String manageType) {
|
||||
this.manageType = manageType;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getKeyWord() {
|
||||
return keyWord;
|
||||
}
|
||||
|
||||
public void setKeyWord(String keyWord) {
|
||||
this.keyWord = keyWord;
|
||||
}
|
||||
|
||||
public Integer getBindNum() {
|
||||
return bindNum;
|
||||
}
|
||||
|
||||
public void setBindNum(Integer bindNum) {
|
||||
this.bindNum = bindNum;
|
||||
}
|
||||
|
||||
public String getTypeName() {
|
||||
return typeName;
|
||||
}
|
||||
|
||||
public void setTypeName(String typeName) {
|
||||
this.typeName = typeName;
|
||||
}
|
||||
|
||||
public String getUnitName() {
|
||||
return unitName;
|
||||
}
|
||||
|
||||
public void setUnitName(String unitName) {
|
||||
this.unitName = unitName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("taskId", getTaskId())
|
||||
.append("partId", getPartId())
|
||||
.append("purchasePrice", getPurchasePrice())
|
||||
.append("purchaseNum", getPurchaseNum())
|
||||
.append("supplierId", getSupplierId())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("productionTime", getProductionTime())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("companyId", getCompanyId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,306 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 新购配件任务
|
||||
* @author hay
|
||||
* @date 2024/1/16 13:52
|
||||
*/
|
||||
public class PurchasePartInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
@ApiModelProperty(value = "主键id")
|
||||
private Long id;
|
||||
|
||||
/** 任务ID */
|
||||
@ApiModelProperty(value = "任务ID")
|
||||
private Long taskId;
|
||||
|
||||
@ApiModelProperty(value = "采购单号")
|
||||
@Excel(name = "采购单号")
|
||||
private String code;
|
||||
|
||||
/** 采购日期 */
|
||||
@ApiModelProperty(value = "采购日期")
|
||||
@Excel(name = "采购日期")
|
||||
private String purchaseTime;
|
||||
|
||||
/** 到货日期 */
|
||||
@ApiModelProperty(value = "到货日期")
|
||||
@Excel(name = "到货日期")
|
||||
private String arrivalTime;
|
||||
|
||||
/** 采购员名称 */
|
||||
@ApiModelProperty(value = "采购员名称")
|
||||
@Excel(name = "采购员")
|
||||
private String purchaserName;
|
||||
|
||||
/** 采购员 */
|
||||
@ApiModelProperty(value = "采购员")
|
||||
private Long purchaser;
|
||||
|
||||
/** 采购机具设备名称 */
|
||||
@ApiModelProperty(value = "采购机具设备")
|
||||
@Excel(name = "机具类型名称")
|
||||
private String purchasingTypeName;
|
||||
|
||||
/** 采购机具设备型号 */
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
@Excel(name = "规格型号")
|
||||
private String purchasingTypeCode;
|
||||
|
||||
/** 管理模式 */
|
||||
@ApiModelProperty(value = "管理模式")
|
||||
@Excel(name = "管理模式",readConverterExp = "0=编码管理,1=计数管理")
|
||||
private String manageType;
|
||||
|
||||
/** 机具厂家 */
|
||||
@ApiModelProperty(value = "机具厂家")
|
||||
@Excel(name = "机具厂家")
|
||||
private String supplier;
|
||||
|
||||
/** 采购数量 */
|
||||
@ApiModelProperty(value = "采购数量")
|
||||
@Excel(name = "采购数量")
|
||||
private String purchaseNum;
|
||||
|
||||
/** 验收数量 */
|
||||
@ApiModelProperty(value = "验收数量")
|
||||
@Excel(name = "验收数量")
|
||||
private String checkNum;
|
||||
|
||||
/** 采购状态 */
|
||||
@ApiModelProperty(value = "采购状态")
|
||||
@Excel(name = "状态")
|
||||
private String purchasingStatus;
|
||||
|
||||
/** 入库人员 */
|
||||
@ApiModelProperty(value = "入库人员")
|
||||
private String inputUser;
|
||||
|
||||
/** 入库时间 */
|
||||
@ApiModelProperty(value = "入库时间")
|
||||
private String inputTime;
|
||||
|
||||
/** 入库状态 */
|
||||
@ApiModelProperty(value = "入库状态")
|
||||
private String inputStatus;
|
||||
|
||||
/** 数据所属组织 */
|
||||
@ApiModelProperty(value = "数据所属组织")
|
||||
private Integer companyId;
|
||||
|
||||
public String getKeyWord() {
|
||||
return keyWord;
|
||||
}
|
||||
|
||||
public void setKeyWord(String keyWord) {
|
||||
this.keyWord = keyWord;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "新购配件任务详情")
|
||||
private List<PurchasePartDetails> partDetailsList;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 任务状态(定义数据字典)
|
||||
*/
|
||||
@ApiModelProperty(value="任务状态(数据字典)")
|
||||
private Integer taskStatus;
|
||||
private String keyWord;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setTaskId(Long taskId)
|
||||
{
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public Long getTaskId()
|
||||
{
|
||||
return taskId;
|
||||
}
|
||||
public void setPurchaseTime(String purchaseTime)
|
||||
{
|
||||
this.purchaseTime = purchaseTime;
|
||||
}
|
||||
|
||||
public String getPurchaseTime()
|
||||
{
|
||||
return purchaseTime;
|
||||
}
|
||||
public void setArrivalTime(String arrivalTime)
|
||||
{
|
||||
this.arrivalTime = arrivalTime;
|
||||
}
|
||||
|
||||
public String getArrivalTime()
|
||||
{
|
||||
return arrivalTime;
|
||||
}
|
||||
public void setPurchaser(Long purchaser)
|
||||
{
|
||||
this.purchaser = purchaser;
|
||||
}
|
||||
|
||||
public Long getPurchaser()
|
||||
{
|
||||
return purchaser;
|
||||
}
|
||||
public void setCompanyId(Integer companyId)
|
||||
{
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public Integer getCompanyId()
|
||||
{
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public List<PurchasePartDetails> getPartDetailsList() {
|
||||
return partDetailsList;
|
||||
}
|
||||
|
||||
public void setPartDetailsList(List<PurchasePartDetails> partDetailsList) {
|
||||
this.partDetailsList = partDetailsList;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getPurchasingStatus() {
|
||||
return purchasingStatus;
|
||||
}
|
||||
|
||||
public void setPurchasingStatus(String purchasingStatus) {
|
||||
this.purchasingStatus = purchasingStatus;
|
||||
}
|
||||
|
||||
public String getPurchasingTypeName() {
|
||||
return purchasingTypeName;
|
||||
}
|
||||
|
||||
public void setPurchasingTypeName(String purchasingTypeName) {
|
||||
this.purchasingTypeName = purchasingTypeName;
|
||||
}
|
||||
|
||||
public String getPurchaserName() {
|
||||
return purchaserName;
|
||||
}
|
||||
|
||||
public void setPurchaserName(String purchaserName) {
|
||||
this.purchaserName = purchaserName;
|
||||
}
|
||||
|
||||
public Integer getTaskStatus() {
|
||||
return taskStatus;
|
||||
}
|
||||
|
||||
public void setTaskStatus(Integer taskStatus) {
|
||||
this.taskStatus = taskStatus;
|
||||
}
|
||||
|
||||
public String getPurchasingTypeCode() {
|
||||
return purchasingTypeCode;
|
||||
}
|
||||
|
||||
public void setPurchasingTypeCode(String purchasingTypeCode) {
|
||||
this.purchasingTypeCode = purchasingTypeCode;
|
||||
}
|
||||
|
||||
public String getSupplier() {
|
||||
return supplier;
|
||||
}
|
||||
|
||||
public void setSupplier(String supplier) {
|
||||
this.supplier = supplier;
|
||||
}
|
||||
|
||||
public String getPurchaseNum() {
|
||||
return purchaseNum;
|
||||
}
|
||||
|
||||
public void setPurchaseNum(String purchaseNum) {
|
||||
this.purchaseNum = purchaseNum;
|
||||
}
|
||||
|
||||
public String getCheckNum() {
|
||||
return checkNum;
|
||||
}
|
||||
|
||||
public void setCheckNum(String checkNum) {
|
||||
this.checkNum = checkNum;
|
||||
}
|
||||
|
||||
public String getManageType() {
|
||||
return manageType;
|
||||
}
|
||||
|
||||
public void setManageType(String manageType) {
|
||||
this.manageType = manageType;
|
||||
}
|
||||
|
||||
public String getInputUser() {
|
||||
return inputUser;
|
||||
}
|
||||
|
||||
public void setInputUser(String inputUser) {
|
||||
this.inputUser = inputUser;
|
||||
}
|
||||
|
||||
public String getInputTime() {
|
||||
return inputTime;
|
||||
}
|
||||
|
||||
public void setInputTime(String inputTime) {
|
||||
this.inputTime = inputTime;
|
||||
}
|
||||
|
||||
public String getInputStatus() {
|
||||
return inputStatus;
|
||||
}
|
||||
|
||||
public void setInputStatus(String inputStatus) {
|
||||
this.inputStatus = inputStatus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("taskId", getTaskId())
|
||||
.append("purchaseTime", getPurchaseTime())
|
||||
.append("arrivalTime", getArrivalTime())
|
||||
.append("purchaser", getPurchaser())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("companyId", getCompanyId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.bonus.sgzb.material.mapper;
|
||||
|
||||
import com.bonus.sgzb.material.domain.*;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 新购配件任务
|
||||
* @author hay
|
||||
* @date 2024/1/16 13:12
|
||||
*/
|
||||
@Mapper
|
||||
public interface PurchaseAccessoryMapper
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* 新增新购配件任务 purchase_part_info
|
||||
*
|
||||
* @param purchasePartInfo 新增新购配件任务 purchase_part_info
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPurchasePartInfo(PurchasePartInfo purchasePartInfo);
|
||||
|
||||
/**
|
||||
* @param purchasePartDetailsList
|
||||
* @return 结果
|
||||
* @description 新增新购任务详情
|
||||
* @author hay
|
||||
* @date 2024/1/16 14:05
|
||||
*/
|
||||
int insertPurchasePartDetailsList(@Param("purchasePartDetailsList") List<PurchasePartDetails> purchasePartDetailsList);
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.bonus.sgzb.material.service;
|
||||
|
||||
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
|
||||
import com.bonus.sgzb.material.domain.PurchaseInput;
|
||||
import com.bonus.sgzb.material.domain.PurchasePartInfo;
|
||||
import com.bonus.sgzb.material.vo.NoticeInfoVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 新购配件
|
||||
* @author hay
|
||||
* @date 2024/1/16 13:29
|
||||
*/
|
||||
public interface IPurchaseAccessoryService
|
||||
{
|
||||
/**
|
||||
* 新增新购配件任务
|
||||
* @param purchasePartInfo
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPurchaseAccessory(PurchasePartInfo purchasePartInfo);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
package com.bonus.sgzb.material.service.impl;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.TmTask;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.material.domain.*;
|
||||
import com.bonus.sgzb.material.mapper.PurchaseAccessoryMapper;
|
||||
import com.bonus.sgzb.material.mapper.PurchaseCheckDetailsMapper;
|
||||
import com.bonus.sgzb.material.mapper.PurchaseCheckInfoMapper;
|
||||
import com.bonus.sgzb.material.mapper.TaskMapper;
|
||||
import com.bonus.sgzb.material.service.IPurchaseAccessoryService;
|
||||
import com.bonus.sgzb.material.service.IPurchaseCheckInfoService;
|
||||
import com.bonus.sgzb.material.vo.NoticeInfoVO;
|
||||
import com.bonus.sgzb.system.api.RemoteUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新购验收任务Service业务层处理
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2023-12-10
|
||||
*/
|
||||
@Service
|
||||
public class PurchaseAccessoryServiceImpl implements IPurchaseAccessoryService
|
||||
{
|
||||
@Resource
|
||||
private PurchaseAccessoryMapper purchaseAccessoryMapper;
|
||||
|
||||
@Resource
|
||||
private TaskMapper taskMapper;
|
||||
|
||||
/**
|
||||
* 新增新购验收任务
|
||||
* @param purchasePartInfo 新购验收任务
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int insertPurchaseAccessory(PurchasePartInfo purchasePartInfo)
|
||||
{
|
||||
TmTask task = new TmTask();
|
||||
// 暂定的状态字典表
|
||||
task.setTaskType(67);
|
||||
task.setTaskStatus(68);
|
||||
// 采购单号
|
||||
task.setCode(purchaseCodeRule());
|
||||
task.setCreateTime(DateUtils.getNowDate());
|
||||
task.setCompanyId(purchasePartInfo.getCompanyId());
|
||||
task.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
|
||||
// 创建任务信息
|
||||
taskMapper.insertTmTask(task);
|
||||
purchasePartInfo.setTaskId(task.getTaskId());
|
||||
purchasePartInfo.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
// 批量新增新购任务详情信息
|
||||
List<PurchasePartDetails> partDetailsList = purchasePartInfo.getPartDetailsList();
|
||||
if (partDetailsList != null) {
|
||||
for (PurchasePartDetails purchasePartDetails : partDetailsList) {
|
||||
purchasePartDetails.setTaskId(task.getTaskId());
|
||||
// purchaseCheckDetails.setStatus(2);
|
||||
}
|
||||
purchaseAccessoryMapper.insertPurchasePartDetailsList(partDetailsList);
|
||||
}
|
||||
// 新增任务信息
|
||||
return purchaseAccessoryMapper.insertPurchasePartInfo(purchasePartInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新购配件--采购单号编码生成规则
|
||||
*/
|
||||
private String purchaseCodeRule() {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
String format = dateFormat.format(nowDate);
|
||||
int taskNum = taskMapper.selectTaskNumByMonth(nowDate,67) + 1;
|
||||
String code="";
|
||||
if (taskNum>9 && taskNum<100){
|
||||
code = "XG" + format + "-00" + taskNum;
|
||||
}else if (taskNum>99 && taskNum<1000){
|
||||
code = "XG" + format + "-0" + taskNum;
|
||||
}else {
|
||||
code = "XG" + format + "-000" + taskNum;
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.sgzb.material.mapper.PurchaseAccessoryMapper">
|
||||
|
||||
<insert id="insertPurchasePartDetailsList">
|
||||
<foreach item="partDetails" collection="purchasePartDetailsList" open="" separator=";" close="">
|
||||
insert into purchase_part_details
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="partDetails.taskId != null">task_id,</if>
|
||||
<if test="partDetails.partId != null">part_id,</if>
|
||||
<if test="partDetails.purchasePrice != null">purchase_price,</if>
|
||||
<if test="partDetails.purchaseNum != null">purchase_num,</if>
|
||||
<if test="partDetails.checkNum != null">check_num,</if>
|
||||
<if test="partDetails.checkResult != null">check_result,</if>
|
||||
<if test="partDetails.supplierId != null">supplier_id,</if>
|
||||
<if test="partDetails.createBy != null">create_by,</if>
|
||||
<if test="partDetails.productionTime != null">production_time,</if>
|
||||
<if test="partDetails.createTime != null">create_time,</if>
|
||||
<if test="partDetails.updateBy != null">update_by,</if>
|
||||
<if test="partDetails.updateTime != null">update_time,</if>
|
||||
<if test="partDetails.remark != null">remark,</if>
|
||||
<if test="partDetails.fileName != null">file_name,</if>
|
||||
<if test="partDetails.fileUrl != null">file_url,</if>
|
||||
<if test="partDetails.companyId != null">company_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="partDetails.taskId != null">#{partDetails.taskId},</if>
|
||||
<if test="partDetails.partId != null">#{partDetails.partId},</if>
|
||||
<if test="partDetails.purchasePrice != null">#{partDetails.purchasePrice},</if>
|
||||
<if test="partDetails.purchaseNum != null">#{partDetails.purchaseNum},</if>
|
||||
<if test="partDetails.checkNum != null">#{partDetails.checkNum},</if>
|
||||
<if test="partDetails.checkResult != null">#{partDetails.checkResult},</if>
|
||||
<if test="partDetails.supplierId != null">#{partDetails.supplierId},</if>
|
||||
<if test="partDetails.createBy != null">#{partDetails.createBy},</if>
|
||||
<if test="partDetails.productionTime != null">#{partDetails.productionTime},</if>
|
||||
<if test="partDetails.createTime != null">#{partDetails.createTime},</if>
|
||||
<if test="partDetails.updateBy != null">#{partDetails.updateBy},</if>
|
||||
<if test="partDetails.updateTime != null">#{partDetails.updateTime},</if>
|
||||
<if test="partDetails.remark != null">#{partDetails.remark},</if>
|
||||
<if test="partDetails.fileName != null">#{partDetails.fileName},</if>
|
||||
<if test="partDetails.fileUrl != null">#{partDetails.fileUrl},</if>
|
||||
<if test="partDetails.companyId != null">#{partDetails.companyId},</if>
|
||||
</trim>
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertPurchasePartInfo" parameterType="com.bonus.sgzb.material.domain.PurchasePartInfo" useGeneratedKeys="true" keyProperty="taskId">
|
||||
insert into purchase_part_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="purchaseTime != null and purchaseTime != ''">purchase_time,</if>
|
||||
<if test="arrivalTime != null">arrival_time,</if>
|
||||
<if test="purchaser != null">purchaser,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="purchaseTime != null and purchaseTime != ''">#{purchaseTime},</if>
|
||||
<if test="arrivalTime != null">#{arrivalTime},</if>
|
||||
<if test="purchaser != null">#{purchaser},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue