Browse Source

[feat]采购报价单物料信息表新增字段filestr,photoAttachId,fileIdStr,removeFileIdStr,purchaseQuoteChildList

dev
zhangsiqi 6 months ago
parent
commit
21d204b952
  1. 64
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseQuote.java
  2. 35
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteServiceImpl.java

64
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseQuote.java

@ -1,6 +1,9 @@
package com.ruoyi.purchase.domain;
import java.math.BigDecimal;
import java.util.List;
import com.ruoyi.system.domain.SysPurchaseQuoteChild;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@ -36,7 +39,7 @@ public class PurchaseQuote extends BaseEntity
private String supplierName;
/** 税率 */
private BigDecimal taxRate;
private Double taxRate;
/** 物料合计 */
@Excel(name = "物料合计")
@ -70,7 +73,60 @@ public class PurchaseQuote extends BaseEntity
@Excel(name = "使用状态")
private String useStatus;
public void setPurchaseQuoteId(Long purchaseQuoteId)
//图片索引id
private Long photoAttachId;
/** 照片 */
private String photoUrl;
private String fileIdStr;
private String removeFileIdStr;
private List<SysPurchaseQuoteChild> purchaseQuoteChildList;
public List<SysPurchaseQuoteChild> getPurchaseQuoteChildList() {
return purchaseQuoteChildList;
}
public void setPurchaseQuoteChildList(List<SysPurchaseQuoteChild> purchaseQuoteChildList) {
this.purchaseQuoteChildList = purchaseQuoteChildList;
}
public Long getPhotoAttachId() {
return photoAttachId;
}
public void setPhotoAttachId(Long photoAttachId) {
this.photoAttachId = photoAttachId;
}
public String getPhotoUrl() {
return photoUrl;
}
public void setPhotoUrl(String photoUrl) {
this.photoUrl = photoUrl;
}
public String getFileIdStr() {
return fileIdStr;
}
public void setFileIdStr(String fileIdStr) {
this.fileIdStr = fileIdStr;
}
public String getRemoveFileIdStr() {
return removeFileIdStr;
}
public void setRemoveFileIdStr(String removeFileIdStr) {
this.removeFileIdStr = removeFileIdStr;
}
public void setPurchaseQuoteId(Long purchaseQuoteId)
{
this.purchaseQuoteId = purchaseQuoteId;
}
@ -115,12 +171,12 @@ public class PurchaseQuote extends BaseEntity
{
return supplierName;
}
public void setTaxRate(BigDecimal taxRate)
public void setTaxRate(Double taxRate)
{
this.taxRate = taxRate;
}
public BigDecimal getTaxRate()
public Double getTaxRate()
{
return taxRate;
}

35
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteServiceImpl.java

@ -11,9 +11,11 @@ import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.system.domain.SysAttach;
import com.ruoyi.system.domain.SysPurchaseQuoteChild;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.ISysAttachFileService;
import com.ruoyi.system.service.ISysAttachService;
import com.ruoyi.system.service.ISysPurchaseQuoteChildService;
import com.ruoyi.system.service.ISysRoleService;
import org.activiti.engine.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
@ -22,6 +24,7 @@ import com.ruoyi.purchase.mapper.PurchaseQuoteMapper;
import com.ruoyi.purchase.domain.PurchaseQuote;
import com.ruoyi.purchase.service.IPurchaseQuoteService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional;
/**
* 采购报价单Service业务层处理
@ -58,6 +61,9 @@ public class PurchaseQuoteServiceImpl implements IPurchaseQuoteService
@Autowired
private ISysRoleService roleService;
@Autowired
private ISysPurchaseQuoteChildService purchaseQuoteChildService;
/**
* 查询采购报价单
*
@ -89,6 +95,7 @@ public class PurchaseQuoteServiceImpl implements IPurchaseQuoteService
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int insertPurchaseQuote(PurchaseQuote purchaseQuote)
{
String loginName = ShiroUtils.getLoginName();
@ -102,7 +109,7 @@ public class PurchaseQuoteServiceImpl implements IPurchaseQuoteService
SysAttach attach = new SysAttach();
attach.setCreateBy(loginName);
attach.setCreateTime(DateUtils.getNowDate());
attach.setSourceType("PurchaseQuote");
attach.setSourceType("purchaseQuote");
attach.setSourceSubType("photo");
attach.setRelId(id);
attachService.insertSysAttach(attach);
@ -111,6 +118,17 @@ public class PurchaseQuoteServiceImpl implements IPurchaseQuoteService
List<String> fileIdList = Arrays.asList(fileIdStr.split(";"));
attachFileService.updateAttachIdByIdList(attachId,fileIdList);
}
List<SysPurchaseQuoteChild> childList = purchaseQuote.getPurchaseQuoteChildList();
int childResult = childList.size();
if(childResult >= 1){
for(SysPurchaseQuoteChild child : purchaseQuote.getPurchaseQuoteChildList()){
child.setPurchaseQuoteCode(purchaseQuote.getPurchaseQuoteCode());
child.setCreateBy(loginName);
child.setCreateTime(DateUtils.getNowDate());
child.setTaxRate(purchaseQuote.getTaxRate());
purchaseQuoteChildService.insertSysPurchaseQuoteChild(child);
}
}
return result;
}
@ -121,6 +139,7 @@ public class PurchaseQuoteServiceImpl implements IPurchaseQuoteService
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int updatePurchaseQuote(PurchaseQuote purchaseQuote)
{
String loginName = ShiroUtils.getLoginName();
@ -142,7 +161,7 @@ public class PurchaseQuoteServiceImpl implements IPurchaseQuoteService
SysAttach attach = new SysAttach();
attach.setCreateBy(loginName);
attach.setCreateTime(DateUtils.getNowDate());
attach.setSourceType("PurchaseQuote");
attach.setSourceType("purchaseQuote");
attach.setSourceSubType("photo");
attach.setRelId(id);
attachService.insertSysAttach(attach);
@ -150,6 +169,17 @@ public class PurchaseQuoteServiceImpl implements IPurchaseQuoteService
}
attachFileService.updateAttachIdByIdList(photoAttachId, fileIdList);
}
List<SysPurchaseQuoteChild> childList = purchaseQuote.getPurchaseQuoteChildList();
int childResult = childList.size();
if(childResult >= 1){
for(SysPurchaseQuoteChild child : purchaseQuote.getPurchaseQuoteChildList()){
child.setPurchaseQuoteCode(purchaseQuote.getPurchaseQuoteCode());
child.setCreateBy(loginName);
child.setCreateTime(DateUtils.getNowDate());
child.setTaxRate(purchaseQuote.getTaxRate());
purchaseQuoteChildService.updateSysPurchaseQuoteChild(child);
}
}
return purchaseQuoteMapper.updatePurchaseQuote(purchaseQuote);
}
@ -173,6 +203,7 @@ public class PurchaseQuoteServiceImpl implements IPurchaseQuoteService
* @return 结果
*/
@Override
@Transactional
public int deletePurchaseQuoteById(Long purchaseQuoteId)
{
return purchaseQuoteMapper.deletePurchaseQuoteById(purchaseQuoteId);

Loading…
Cancel
Save