|
|
@ -150,7 +150,7 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { |
|
|
|
} |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public int updateSysCustomerQuote(SysCustomerQuoteVo sysCustomerQuote) { |
|
|
|
public ProcessInstance updateSysCustomerQuote(SysCustomerQuoteVo sysCustomerQuote) { |
|
|
|
String loginName = ShiroUtils.getLoginName(); |
|
|
|
sysCustomerQuote.setUpdateBy(loginName); |
|
|
|
sysCustomerQuote.setUpdateTime(DateUtils.getNowDate()); |
|
|
@ -158,24 +158,41 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { |
|
|
|
int list = sysCustomerQuoteMapper.updateSysCustomerQuote(sysCustomerQuote); |
|
|
|
List<SysCustomerQuoteChild> sysCustomerQuoteChild = sysCustomerQuote.getSysCustomerQuoteChildList(); |
|
|
|
int s = sysCustomerQuoteChild.size(); |
|
|
|
if (s == 0){ |
|
|
|
return 0; |
|
|
|
} |
|
|
|
for(SysCustomerQuoteChild sysCustomerQuoteChild1 : sysCustomerQuoteChild){ |
|
|
|
if (sysCustomerQuoteChild1.getId() == null || sysCustomerQuoteChild1.getId() == 0L){ |
|
|
|
sysCustomerQuoteChild1.setQuoteId(sysCustomerQuote.getSupplierCode()); |
|
|
|
sysCustomerQuoteChild1.setCreateBy(loginName); |
|
|
|
sysCustomerQuoteChild1.setCreateTime(DateUtils.getNowDate()); |
|
|
|
sysCustomerQuoteChildMapper.insertSysCustomerQuoteChild(sysCustomerQuoteChild1); |
|
|
|
}else { |
|
|
|
sysCustomerQuoteChild1.setUpdateBy(loginName); |
|
|
|
sysCustomerQuoteChild1.setUpdateTime(DateUtils.getNowDate()); |
|
|
|
sysCustomerQuoteChildMapper.updateSysCustomerQuoteChild(sysCustomerQuoteChild1); |
|
|
|
if (s > 0){ |
|
|
|
for(SysCustomerQuoteChild sysCustomerQuoteChild1 : sysCustomerQuoteChild){ |
|
|
|
if (sysCustomerQuoteChild1.getId() == null || sysCustomerQuoteChild1.getId() == 0L){ |
|
|
|
sysCustomerQuoteChild1.setQuoteId(sysCustomerQuote.getSupplierCode()); |
|
|
|
sysCustomerQuoteChild1.setCreateBy(loginName); |
|
|
|
sysCustomerQuoteChild1.setCreateTime(DateUtils.getNowDate()); |
|
|
|
sysCustomerQuoteChildMapper.insertSysCustomerQuoteChild(sysCustomerQuoteChild1); |
|
|
|
}else { |
|
|
|
sysCustomerQuoteChild1.setUpdateBy(loginName); |
|
|
|
sysCustomerQuoteChild1.setUpdateTime(DateUtils.getNowDate()); |
|
|
|
sysCustomerQuoteChildMapper.updateSysCustomerQuoteChild(sysCustomerQuoteChild1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 启动流程
|
|
|
|
return list; |
|
|
|
|
|
|
|
sysCustomerQuote.setApplyUser(user.getLoginName()); |
|
|
|
sysCustomerQuote.setApplyTime(DateUtils.getNowDate()); |
|
|
|
sysCustomerQuoteMapper.updateSysCustomerQuote(sysCustomerQuote); |
|
|
|
// 启动流程
|
|
|
|
String applyTitle = user.getUserName()+"发起了客户报价信息提交审批-"+DateUtils.dateTimeNow(); |
|
|
|
String instanceType = "submit"; |
|
|
|
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,sysCustomerQuote, user); |
|
|
|
String processInstanceId = processInstance.getProcessInstanceId(); |
|
|
|
// 提交实例id
|
|
|
|
sysCustomerQuote.setSubmitInstanceId(processInstanceId); |
|
|
|
// 存在提交完就流程结束的情况
|
|
|
|
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId); |
|
|
|
if(processIsFinish){ |
|
|
|
// 审核状态-审核通过
|
|
|
|
sysCustomerQuote.setAuditStatus("1"); |
|
|
|
// 使用状态-是
|
|
|
|
sysCustomerQuote.setUseStatus("1"); |
|
|
|
} |
|
|
|
sysCustomerQuoteMapper.updateSysCustomerQuote(sysCustomerQuote); |
|
|
|
return processInstance; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|