|
|
@ -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); |
|
|
|