Browse Source

[fix]

委外加工 委外报价
修改委外报价VO实体类
修改委外报价实体类 添加审批流程必需字段
修改前端页面 添加审批相关内容
修改添加委外报价页面 取消添加委外工序按钮身份认证标识
修改mapper文件返回实体类字段,更新、插入记录的方法
修改委外报价列表查询方法 新增启动审批流程、发起人节点判断方法
修改后端接口 新增加载审批弹窗、审批任务完成的处理流程方法

[feat]
委外加工 委外报价
新增委外报价委外经理、委外主管审核页面
dev
王晓迪 4 months ago
parent
commit
bd1aabc60e
  1. 171
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java
  2. 93
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceQuote.java
  3. 131
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/OutsourceQuoteVO.java
  4. 32
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/OutsourceRequisitionVO.java
  5. 13
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceQuoteMapper.java
  6. 35
      ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceQuoteService.java
  7. 229
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceQuoteServiceImpl.java
  8. 60
      ruoyi-admin/src/main/resources/mapper/system/OutsourceQuoteMapper.xml
  9. 3
      ruoyi-admin/src/main/resources/templates/system/outsource_quote/add.html
  10. 98
      ruoyi-admin/src/main/resources/templates/system/outsource_quote/outsource_quote.html
  11. 160
      ruoyi-admin/src/main/resources/templates/system/outsource_quote/taskWwjlVerify.html
  12. 160
      ruoyi-admin/src/main/resources/templates/system/outsource_quote/taskWwzgVerify.html

171
ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java

@ -1,14 +1,23 @@
package com.ruoyi.system.controller;
import java.util.HashMap;
import java.util.List;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.system.domain.OutsourceQuote;
import com.ruoyi.system.domain.OutsourceQuoteChild;
import com.ruoyi.system.domain.Vo.OutsourceQuoteVO;
import com.ruoyi.system.service.IOutsourceProcessService;
import com.ruoyi.system.service.IOutsourceQuoteService;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.system.service.impl.OutsourceQuoteServiceImpl;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -20,6 +29,9 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
/**
* 委外报价Controller
*
@ -38,6 +50,19 @@ public class OutsourceQuoteController extends BaseController
@Autowired
private IOutsourceProcessService outsourceProcessService;
@Autowired
private ISysUserService sysUserService;
@Autowired
private TaskService taskService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private IProcessService processService;
@RequiresPermissions("system:outsource_quote:view")
@GetMapping()
public String outsource_quote()
@ -51,10 +76,10 @@ public class OutsourceQuoteController extends BaseController
@RequiresPermissions("system:outsource_quote:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(OutsourceQuote outsourceQuote)
public TableDataInfo list(OutsourceQuoteVO outsourceQuoteVo)
{
startPage();
List<OutsourceQuote> list = outsourceQuoteService.selectOutsourceQuoteList(outsourceQuote);
List<OutsourceQuoteVO> list = outsourceQuoteService.selectOutsourceQuoteList(outsourceQuoteVo);
return getDataTable(list);
}
@ -65,10 +90,10 @@ public class OutsourceQuoteController extends BaseController
@Log(title = "委外报价", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(OutsourceQuote outsourceQuote)
public AjaxResult export(OutsourceQuoteVO outsourceQuoteVo)
{
List<OutsourceQuote> list = outsourceQuoteService.selectOutsourceQuoteList(outsourceQuote);
ExcelUtil<OutsourceQuote> util = new ExcelUtil<OutsourceQuote>(OutsourceQuote.class);
List<OutsourceQuoteVO> list = outsourceQuoteService.selectOutsourceQuoteList(outsourceQuoteVo);
ExcelUtil<OutsourceQuoteVO> util = new ExcelUtil<OutsourceQuoteVO>(OutsourceQuoteVO.class);
return util.exportExcel(list, "委外报价数据");
}
/**
@ -76,7 +101,7 @@ public class OutsourceQuoteController extends BaseController
*/
@RequiresPermissions("system:outsource_quote:detail")
@GetMapping("/detail/{outsourceQuoteId}")
public String detail(@PathVariable("outsourceQuoteId") int outsourceQuoteId, ModelMap mmap)
public String detail(@PathVariable("outsourceQuoteId") Long outsourceQuoteId, ModelMap mmap)
{
mmap.put("outsourceQuote", outsourceQuoteService.selectOutsourceQuoteByOutsourceQuoteId(outsourceQuoteId));
@ -106,21 +131,100 @@ public class OutsourceQuoteController extends BaseController
@Log(title = "委外报价", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(@RequestBody OutsourceQuoteVO childVO)
public AjaxResult addSave(@RequestBody OutsourceQuoteVO outsourceQuoteVO)
{
System.out.println(childVO);
return toAjax(outsourceQuoteService.insertOutsourceQuote(childVO));
// System.out.println(outsourceQuoteVO);
// 审核状态-待审核
outsourceQuoteVO.setAuditStatus("0");
outsourceQuoteService.submitApply(outsourceQuoteVO);
return AjaxResult.success();
}
/**
* 加载审批弹窗
* @param taskId
* @param mmap
* @return
*/
@GetMapping("/showVerifyDialog/{taskId}")
public String showVerifyDialog(@PathVariable("taskId") String taskId, ModelMap mmap) {
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
String processInstanceId = task.getProcessInstanceId();
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
OutsourceQuoteVO outsourceQuoteVO = outsourceQuoteService.selectOutsourceQuoteByOutsourceQuoteId(new Long(processInstance.getBusinessKey()));
System.out.println(outsourceQuoteVO);
mmap.put("formData", outsourceQuoteVO);
mmap.put("taskId", taskId);
String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1);
return prefix + "/task" + verifyName;
}
/**
* 自动绑定页面字段
*/
@ModelAttribute("preloadObj")
public OutsourceQuoteVO getObj(@RequestParam(value = "outsourceQuoteId", required = false) Long outsourceQuoteId, HttpSession session) {
if (outsourceQuoteId != null) {
return outsourceQuoteService.selectOutsourceQuoteByOutsourceQuoteId(outsourceQuoteId);
}
return new OutsourceQuoteVO();
}
/**
* 完成任务
*
* @return
*/
@RequestMapping(value = "/complete/{taskId}", method = {RequestMethod.POST, RequestMethod.GET})
@ResponseBody
public AjaxResult complete(@PathVariable("taskId") String taskId, @RequestParam(value = "saveEntity", required = false) String saveEntity,
@ModelAttribute("preloadObj") OutsourceQuoteVO outsourceQuoteVO, HttpServletRequest request) {
boolean saveEntityBoolean = BooleanUtils.toBoolean(saveEntity);
//获取实例id
String instanceId = outsourceQuoteVO.getInstanceId();
//获取实例类型
String instanceType = outsourceQuoteVO.getInstanceType();
boolean approvedFlag = processService.complete(taskId, instanceId, outsourceQuoteVO.getApplyTitle(), outsourceQuoteVO.getOutsourceQuoteCode(), "outsourceQuote", new HashMap<String, Object>(), request);
if(!approvedFlag){
// 审核状态-审核拒绝
outsourceQuoteVO.setAuditStatus("2");
}
// 如果任务已结束更新业务表状态
boolean processIsFinish = processService.judgeProcessIsFinish(instanceId);
if (processIsFinish) {
// 审核通过
outsourceQuoteVO.setAuditStatus("1");
// 提交
if("submit".equals(instanceType)){
// 使用状态-是
// erpBomVo.setUseStatus("1");
}
// 作废
else if("cancel".equals(instanceType)){
// 使用状态-已作废
// erpBomVo.setUseStatus("2");
}
// 恢复
else if("restore".equals(instanceType)){
// 使用状态-是
// erpBomVo.setUseStatus("1");
}
}
outsourceQuoteService.updateOutsourceQuote(outsourceQuoteVO);
// 驳回申请后继续申请,可能修改表单
if (saveEntityBoolean) {
outsourceQuoteService.updateOutsourceQuote(outsourceQuoteVO);
}
return success("任务已完成");
}
/**
* 修改委外报价
*/
@RequiresPermissions("system:outsource_quote:edit")
@GetMapping("/edit/{outsourceQuoteId}")
public String edit(@PathVariable("outsourceQuoteId") Integer outsourceQuoteId, ModelMap mmap)
public String edit(@PathVariable("outsourceQuoteId") Long outsourceQuoteId, ModelMap mmap)
{
OutsourceQuote outsourceQuote = outsourceQuoteService.selectOutsourceQuoteByOutsourceQuoteId(outsourceQuoteId);
System.out.println(outsourceQuote.toString());
mmap.put("outsourceQuote", outsourceQuote);
OutsourceQuoteVO outsourceQuoteVO = outsourceQuoteService.selectOutsourceQuoteByOutsourceQuoteId(outsourceQuoteId);
System.out.println(outsourceQuoteVO.toString());
mmap.put("outsourceQuote", outsourceQuoteVO);
return prefix + "/edit";
}
@ -131,17 +235,17 @@ public class OutsourceQuoteController extends BaseController
@Log(title = "委外报价", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(@RequestBody OutsourceQuote outsourceQuote)
public AjaxResult editSave(@RequestBody OutsourceQuoteVO outsourceQuoteVO)
{
List<OutsourceQuoteChild> children = outsourceQuote.getOutsourceQuoteChildList();
List<OutsourceQuoteChild> children = outsourceQuoteVO.getOutsourceQuoteChildList();
for (OutsourceQuoteChild child:children) {
child.setOutsourceQuoteCode(outsourceQuote.getOutsourceQuoteCode());
child.setSupplierCode(outsourceQuote.getSupplierQuoteCode());
child.setSupplierName(outsourceQuote.getSupplierName());
child.setTaxRate(outsourceQuote.getTaxRate());
child.setOutsourceQuoteCode(outsourceQuoteVO.getOutsourceQuoteCode());
child.setSupplierCode(outsourceQuoteVO.getSupplierQuoteCode());
child.setSupplierName(outsourceQuoteVO.getSupplierName());
child.setTaxRate(outsourceQuoteVO.getTaxRate());
}
// System.out.println(children);
return toAjax(outsourceQuoteService.updateOutsourceQuote(outsourceQuote));
return toAjax(outsourceQuoteService.updateOutsourceQuote(outsourceQuoteVO));
}
/**
@ -151,9 +255,9 @@ public class OutsourceQuoteController extends BaseController
@Log(title = "委外报价", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
public AjaxResult remove(Long id)
{
return toAjax(outsourceQuoteService.deleteOutsourceQuoteByOutsourceQuoteIds(ids));
return toAjax(outsourceQuoteService.deleteOutsourceQuoteByOutsourceQuoteId(id));
}
@ -168,4 +272,27 @@ public class OutsourceQuoteController extends BaseController
String result = outsourceQuoteService.generateOutsourceQuoteCode();
return result;
}
/**
* 作废委外报价单
*/
@RequiresPermissions("system:outsource_quote:cancel")
@Log(title = "委外报价单", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
return toAjax(outsourceQuoteService.cancelOutsourceQuoteById(id));
}
/**
* 恢复委外报价单
*/
// @RequiresPermissions("system:outsource_quote:restore")
// @Log(title = "委外报价单", businessType = BusinessType.RESTORE)
// @GetMapping( "/restore/{id}")
// @ResponseBody
// public AjaxResult restore(@PathVariable("id")Long id)
// {
// return toAjax(outsourceQuoteService.restoreOutsourceQuoteById(id));
// }
}

93
ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceQuote.java

@ -19,7 +19,7 @@ public class OutsourceQuote extends BaseEntity
private static final long serialVersionUID = 1L;
/** 委外报价ID */
private Integer outsourceQuoteId;
private Long outsourceQuoteId;
/** 委外报价单号 */
@Excel(name = "委外报价单号")
@ -49,16 +49,103 @@ public class OutsourceQuote extends BaseEntity
@Excel(name = "审核状态")
private String auditStatus;
/** 流程实例ID */
private String instanceId;
/** 流程实例类型 */
private String instanceType;
/** 流程提交实例ID */
private String submitInstanceId;
/** 申请标题 */
private String applyTitle;
/** 申请时间 */
private Date applyTime;
/** 申请人 */
private String applyUser;
/** 流程作废实例ID */
private String cancelInstanceId;
/** 流程恢复实例ID */
private String restoreInstanceId;
/** 委外报价工序信息信息 */
private List<OutsourceQuoteChild> outsourceQuoteChildList;
public void setOutsourceQuoteId(Integer outsourceQuoteId)
public void setOutsourceQuoteId(Long outsourceQuoteId)
{
this.outsourceQuoteId = outsourceQuoteId;
}
public Integer getOutsourceQuoteId()
public String getInstanceId() {
return instanceId;
}
public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}
public String getInstanceType() {
return instanceType;
}
public void setInstanceType(String instanceType) {
this.instanceType = instanceType;
}
public String getSubmitInstanceId() {
return submitInstanceId;
}
public void setSubmitInstanceId(String submitInstanceId) {
this.submitInstanceId = submitInstanceId;
}
public String getApplyTitle() {
return applyTitle;
}
public void setApplyTitle(String applyTitle) {
this.applyTitle = applyTitle;
}
public Date getApplyTime() {
return applyTime;
}
public void setApplyTime(Date applyTime) {
this.applyTime = applyTime;
}
public String getApplyUser() {
return applyUser;
}
public void setApplyUser(String applyUser) {
this.applyUser = applyUser;
}
public String getCancelInstanceId() {
return cancelInstanceId;
}
public void setCancelInstanceId(String cancelInstanceId) {
this.cancelInstanceId = cancelInstanceId;
}
public String getRestoreInstanceId() {
return restoreInstanceId;
}
public void setRestoreInstanceId(String restoreInstanceId) {
this.restoreInstanceId = restoreInstanceId;
}
public Long getOutsourceQuoteId()
{
return outsourceQuoteId;
}

131
ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/OutsourceQuoteVO.java

@ -1,115 +1,36 @@
package com.ruoyi.system.domain.Vo;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.system.domain.OutsourceQuote;
import com.ruoyi.system.domain.OutsourceQuoteChild;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
public class OutsourceQuoteVO extends BaseEntity {
/** 委外报价单号 */
private String outsourceQuoteCode;
/** 供应商编号 */
private String supplierQuoteCode;
/** 供应商名称 */
private String supplierName;
/** 工序合计 */
private String processAmount;
/** 税率 */
private BigDecimal taxRate;
/** 定价日期 */
private Date pricingDate;
/** 审核状态 */
private String auditStatus;
/** 委外报价工序信息 */
private List<OutsourceQuoteChild> outsourceQuoteChildList;
public String getOutsourceQuoteCode() {
return outsourceQuoteCode;
}
public void setOutsourceQuoteCode(String outsourceQuoteCode) {
this.outsourceQuoteCode = outsourceQuoteCode;
}
public String getSupplierQuoteCode() {
return supplierQuoteCode;
}
public void setSupplierQuoteCode(String supplierQuoteCode) {
this.supplierQuoteCode = supplierQuoteCode;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public String getProcessAmount() {
return processAmount;
}
public void setProcessAmount(String processAmount) {
this.processAmount = processAmount;
}
public BigDecimal getTaxRate() {
return taxRate;
}
public void setTaxRate(BigDecimal taxRate) {
this.taxRate = taxRate;
}
public Date getPricingDate() {
return pricingDate;
}
public void setPricingDate(Date pricingDate) {
this.pricingDate = pricingDate;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public List<OutsourceQuoteChild> getOutsourceQuoteChildList() {
return outsourceQuoteChildList;
}
public void setOutsourceQuoteChildList(List<OutsourceQuoteChild> outsourceQuoteChildList) {
this.outsourceQuoteChildList = outsourceQuoteChildList;
}
@Override
public String toString() {
return "OutsourceQuoteChildVO{" +
"outsourceQuoteCode='" + outsourceQuoteCode + '\'' +
", supplierQuoteCode='" + supplierQuoteCode + '\'' +
", supplierName='" + supplierName + '\'' +
", processAmount='" + processAmount + '\'' +
", taxRate=" + taxRate +
", pricingDate='" + pricingDate + '\'' +
", auditStatus='" + auditStatus + '\'' +
", outsourceQuoteChildList=" + outsourceQuoteChildList +
'}';
}
@Data
public class OutsourceQuoteVO extends OutsourceQuote {
/** 申请人姓名 */
private String applyUserName;
/** 任务ID */
private String taskId;
/** 任务名称 */
private String taskName;
/** 办理时间 */
private Date doneTime;
/** 创建人 */
private String createUserName;
/** 流程实例状态 1 激活 2 挂起 */
private String suspendState;
/** 待办用户id */
private String todoUserId;
/** 流程实例类型名称 */
private String instanceTypeName;
/**
* 关键词
*/
private String keyword;
}

32
ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/OutsourceRequisitionVO.java

@ -0,0 +1,32 @@
package com.ruoyi.system.domain.Vo;
import com.ruoyi.system.domain.OutsourceRequisition;
import lombok.Data;
import java.util.Date;
@Data
public class OutsourceRequisitionVO extends OutsourceRequisition {
/** 申请人姓名 */
private String applyUserName;
/** 任务ID */
private String taskId;
/** 任务名称 */
private String taskName;
/** 办理时间 */
private Date doneTime;
/** 创建人 */
private String createUserName;
/** 流程实例状态 1 激活 2 挂起 */
private String suspendState;
/** 待办用户id */
private String todoUserId;
/** 流程实例类型名称 */
private String instanceTypeName;
/**
* 关键词
*/
private String keyword;
}

13
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceQuoteMapper.java

@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.OutsourceQuote;
import com.ruoyi.system.domain.OutsourceQuoteChild;
import com.ruoyi.system.domain.Vo.OutsourceQuoteVO;
import java.util.List;
@ -20,15 +21,15 @@ public interface OutsourceQuoteMapper
* @param outsourceQuoteId 委外报价主键
* @return 委外报价
*/
public OutsourceQuote selectOutsourceQuoteByOutsourceQuoteId(Integer outsourceQuoteId);
public OutsourceQuoteVO selectOutsourceQuoteByOutsourceQuoteId(Long outsourceQuoteId);
/**
* 查询委外报价列表
*
* @param outsourceQuote 委外报价
* @param outsourceQuoteVO 委外报价
* @return 委外报价集合
*/
public List<OutsourceQuote> selectOutsourceQuoteList(OutsourceQuote outsourceQuote);
public List<OutsourceQuoteVO> selectOutsourceQuoteList(OutsourceQuoteVO outsourceQuoteVO);
/**
* 查询委外报价工序信息列表
*
@ -40,10 +41,10 @@ public interface OutsourceQuoteMapper
/**
* 新增委外报价
*
* @param outsourceQuote 委外报价
* @param outsourceQuoteVO 委外报价
* @return 结果
*/
public int insertOutsourceQuote(OutsourceQuote outsourceQuote);
public int insertOutsourceQuote(OutsourceQuoteVO outsourceQuoteVO);
/**
* 修改委外报价
@ -59,7 +60,7 @@ public interface OutsourceQuoteMapper
* @param outsourceQuoteId 委外报价主键
* @return 结果
*/
public int deleteOutsourceQuoteByOutsourceQuoteId(Integer outsourceQuoteId);
public int deleteOutsourceQuoteByOutsourceQuoteId(Long outsourceQuoteId);
/**
* 批量删除委外报价

35
ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceQuoteService.java

@ -1,7 +1,9 @@
package com.ruoyi.system.service;
import com.ruoyi.aftersales.domain.AftersalesOrder;
import com.ruoyi.system.domain.OutsourceQuote;
import com.ruoyi.system.domain.Vo.OutsourceQuoteVO;
import org.activiti.engine.runtime.ProcessInstance;
import java.util.List;
@ -20,15 +22,15 @@ public interface IOutsourceQuoteService
* @param outsourceQuoteId 委外报价主键
* @return 委外报价
*/
public OutsourceQuote selectOutsourceQuoteByOutsourceQuoteId(Integer outsourceQuoteId);
public OutsourceQuoteVO selectOutsourceQuoteByOutsourceQuoteId(Long outsourceQuoteId);
/**
* 查询委外报价列表
*
* @param outsourceQuote 委外报价
* @param outsourceQuoteVO 委外报价
* @return 委外报价集合
*/
public List<OutsourceQuote> selectOutsourceQuoteList(OutsourceQuote outsourceQuote);
public List<OutsourceQuoteVO> selectOutsourceQuoteList(OutsourceQuoteVO outsourceQuoteVO);
/**
* 新增委外报价
@ -41,18 +43,10 @@ public interface IOutsourceQuoteService
/**
* 修改委外报价
*
* @param outsourceQuote 委外报价
* @param outsourceQuoteVO 委外报价
* @return 结果
*/
public int updateOutsourceQuote(OutsourceQuote outsourceQuote);
/**
* 批量删除委外报价
*
* @param outsourceQuoteIds 需要删除的委外报价主键集合
* @return 结果
*/
public int deleteOutsourceQuoteByOutsourceQuoteIds(String outsourceQuoteIds);
public int updateOutsourceQuote(OutsourceQuoteVO outsourceQuoteVO);
/**
* 删除委外报价信息
@ -60,18 +54,27 @@ public interface IOutsourceQuoteService
* @param outsourceQuoteId 委外报价主键
* @return 结果
*/
public int deleteOutsourceQuoteByOutsourceQuoteId(Integer outsourceQuoteId);
public int deleteOutsourceQuoteByOutsourceQuoteId(Long outsourceQuoteId);
/**
* 新增委外报价工序信息信息
*
* @param outsourceQuote 委外报价对象
* @param outsourceQuoteVO 委外报价对象
*/
public void insertOutsourceQuoteChild(OutsourceQuote outsourceQuote);
public void insertOutsourceQuoteChild(OutsourceQuoteVO outsourceQuoteVO);
/**
* 自动生成委外报价编号
* */
String generateOutsourceQuoteCode();
/**
* 审批流程启动
* */
ProcessInstance submitApply(OutsourceQuoteVO outsourceQuoteVO);
/**
* 作废委外报价单
* */
int cancelOutsourceQuoteById(Long id);
}

229
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceQuoteServiceImpl.java

@ -1,22 +1,36 @@
package com.ruoyi.system.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.github.pagehelper.Page;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.system.domain.OutsourceQuote;
import com.ruoyi.system.domain.OutsourceQuoteChild;
import com.ruoyi.system.domain.Vo.OutsourceQuoteVO;
import com.ruoyi.system.mapper.OutsourceQuoteMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.IOutsourceQuoteService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.impl.persistence.entity.TaskEntityImpl;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.common.core.text.Convert;
/**
* 委外报价Service业务层处理
*
@ -32,6 +46,23 @@ public class OutsourceQuoteServiceImpl implements IOutsourceQuoteService
@Autowired
private RedisCache redisCache;
@Autowired
private SysRoleServiceImpl roleService;
@Autowired
private TaskService taskService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private BizTodoItemMapper todoItemMapper;
@Autowired
private SysUserMapper userMapper;
@Autowired
private IProcessService processService;
/**
* 查询委外报价
*
@ -39,24 +70,75 @@ public class OutsourceQuoteServiceImpl implements IOutsourceQuoteService
* @return 委外报价
*/
@Override
public OutsourceQuote selectOutsourceQuoteByOutsourceQuoteId(Integer outsourceQuoteId)
public OutsourceQuoteVO selectOutsourceQuoteByOutsourceQuoteId(Long outsourceQuoteId)
{
OutsourceQuote outsourceQuote = outsourceQuoteMapper.selectOutsourceQuoteByOutsourceQuoteId(outsourceQuoteId);
List<OutsourceQuoteChild> children = outsourceQuoteMapper.selectOutsourceQuoteChildList(outsourceQuote.getOutsourceQuoteCode());
outsourceQuote.setOutsourceQuoteChildList(children);
return outsourceQuote;
OutsourceQuoteVO outsourceQuoteVO = outsourceQuoteMapper.selectOutsourceQuoteByOutsourceQuoteId(outsourceQuoteId);
List<OutsourceQuoteChild> children = outsourceQuoteMapper.selectOutsourceQuoteChildList(outsourceQuoteVO.getOutsourceQuoteCode());
outsourceQuoteVO.setOutsourceQuoteChildList(children);
return outsourceQuoteVO;
}
/**
* 查询委外报价列表
*
* @param outsourceQuote 委外报价
* @param outsourceQuoteVO 委外报价
* @return 委外报价
*/
@Override
public List<OutsourceQuote> selectOutsourceQuoteList(OutsourceQuote outsourceQuote)
public List<OutsourceQuoteVO> selectOutsourceQuoteList(OutsourceQuoteVO outsourceQuoteVO)
{
return outsourceQuoteMapper.selectOutsourceQuoteList(outsourceQuote);
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
// PageHelper 仅对第一个 List 分页
Page<OutsourceQuoteVO> list = (Page<OutsourceQuoteVO>) outsourceQuoteMapper.selectOutsourceQuoteList(outsourceQuoteVO);
Page<OutsourceQuoteVO> returnList = new Page<>();
for (OutsourceQuoteVO tempOutsourceQuoteVO: list) {
SysUser sysUser = userMapper.selectUserByLoginName(tempOutsourceQuoteVO.getCreateBy());
if (sysUser != null) {
tempOutsourceQuoteVO.setCreateUserName(sysUser.getUserName());
}
SysUser sysUser2 = userMapper.selectUserByLoginName(tempOutsourceQuoteVO.getApplyUser());
if (sysUser2 != null) {
tempOutsourceQuoteVO.setApplyUserName(sysUser2.getUserName());
}
String instanceId = tempOutsourceQuoteVO.getInstanceId();
// 当前环节
if (StringUtils.isNotBlank(instanceId)) {
List<Task> taskList = taskService.createTaskQuery()
.processInstanceId(instanceId)
// .singleResult();
.list(); // 例如请假会签,会同时拥有多个任务
if (!org.springframework.util.CollectionUtils.isEmpty(taskList)) {
TaskEntityImpl task = (TaskEntityImpl) taskList.get(0);
String taskId = task.getId();
tempOutsourceQuoteVO.setTaskId(taskId);
// 设置待办用户
List<String> todoUserList = todoItemMapper.selectUndealTodoUserList(taskId);
if(!org.springframework.util.CollectionUtils.isEmpty(taskList)){
tempOutsourceQuoteVO.setTodoUserId(String.join(",",todoUserList));
}
if (task.getSuspensionState() == 2) {
tempOutsourceQuoteVO.setTaskName("已挂起");
tempOutsourceQuoteVO.setSuspendState("2");
} else {
tempOutsourceQuoteVO.setTaskName(task.getName());
tempOutsourceQuoteVO.setSuspendState("1");
}
} else {
// 已办结或者已撤销
tempOutsourceQuoteVO.setTaskName("已结束");
}
} else {
tempOutsourceQuoteVO.setTaskName("未启动");
}
returnList.add(tempOutsourceQuoteVO);
}
returnList.setTotal(org.springframework.util.CollectionUtils.isEmpty(list) ? 0 : list.getTotal());
returnList.setPageNum(pageNum);
returnList.setPageSize(pageSize);
return returnList;
}
/**
@ -65,12 +147,10 @@ public class OutsourceQuoteServiceImpl implements IOutsourceQuoteService
* @param childVO 委外报价
* @return 结果
*/
@Transactional
@Override
public int insertOutsourceQuote(OutsourceQuoteVO childVO)
{
// System.out.println(childVO.toString());
// System.out.println(childVO.getOutsourceQuoteCode());
String loginName = ShiroUtils.getLoginName();
List<OutsourceQuoteChild> children = childVO.getOutsourceQuoteChildList();
for (OutsourceQuoteChild child:children) {
child.setOutsourceQuoteCode(childVO.getOutsourceQuoteCode());
@ -78,50 +158,31 @@ public class OutsourceQuoteServiceImpl implements IOutsourceQuoteService
child.setSupplierName(childVO.getSupplierName());
child.setTaxRate(childVO.getTaxRate());
}
System.out.println(children);
OutsourceQuote outsourceQuote = new OutsourceQuote();
outsourceQuote.setOutsourceQuoteCode(childVO.getOutsourceQuoteCode());
outsourceQuote.setPricingDate(DateUtils.parseDate(childVO.getPricingDate()));
outsourceQuote.setProcessAmount(children.size());
outsourceQuote.setSupplierQuoteCode(childVO.getSupplierQuoteCode());
outsourceQuote.setSupplierName(childVO.getSupplierName());
outsourceQuote.setOutsourceQuoteChildList(children);
outsourceQuote.setCreateTime(DateUtils.getNowDate());
int rows = outsourceQuoteMapper.insertOutsourceQuote(outsourceQuote);
insertOutsourceQuoteChild(outsourceQuote);
childVO.setProcessAmount(children.size());
childVO.setOutsourceQuoteChildList(children);
childVO.setCreateTime(DateUtils.getNowDate());
childVO.setCreateBy(loginName);
int rows = outsourceQuoteMapper.insertOutsourceQuote(childVO);
insertOutsourceQuoteChild(childVO);
return rows;
}
/**
* 修改委外报价
*
* @param outsourceQuote 委外报价
* @return 结果
*/
@Transactional
@Override
public int updateOutsourceQuote(OutsourceQuote outsourceQuote)
{
outsourceQuote.setUpdateTime(DateUtils.getNowDate());
outsourceQuoteMapper.deleteOutsourceQuoteChildByOutsourceQuoteCode(outsourceQuote.getOutsourceQuoteCode());
insertOutsourceQuoteChild(outsourceQuote);
return outsourceQuoteMapper.updateOutsourceQuote(outsourceQuote);
}
/**
* 批量删除委外报价
*
* @param outsourceQuoteIds 需要删除的委外报价主键
* @param outsourceQuoteVO 委外报价
* @return 结果
*/
@Transactional
@Override
public int deleteOutsourceQuoteByOutsourceQuoteIds(String outsourceQuoteIds)
public int updateOutsourceQuote(OutsourceQuoteVO outsourceQuoteVO)
{
outsourceQuoteMapper.deleteOutsourceQuoteChildByOutsourceProcessCodes(Convert.toStrArray(outsourceQuoteIds));
return outsourceQuoteMapper.deleteOutsourceQuoteByOutsourceQuoteIds(Convert.toStrArray(outsourceQuoteIds));
SysUser user = ShiroUtils.getSysUser();
outsourceQuoteVO.setUpdateTime(DateUtils.getNowDate());
outsourceQuoteVO.setUpdateBy(user.getLoginName());
outsourceQuoteMapper.deleteOutsourceQuoteChildByOutsourceQuoteCode(outsourceQuoteVO.getOutsourceQuoteCode());
insertOutsourceQuoteChild(outsourceQuoteVO);
return outsourceQuoteMapper.updateOutsourceQuote(outsourceQuoteVO);
}
/**
@ -132,7 +193,7 @@ public class OutsourceQuoteServiceImpl implements IOutsourceQuoteService
*/
@Transactional
@Override
public int deleteOutsourceQuoteByOutsourceQuoteId(Integer outsourceQuoteId)
public int deleteOutsourceQuoteByOutsourceQuoteId(Long outsourceQuoteId)
{
OutsourceQuote outsourceQuote = outsourceQuoteMapper.selectOutsourceQuoteByOutsourceQuoteId(outsourceQuoteId);
outsourceQuoteMapper.deleteOutsourceQuoteChildByOutsourceQuoteCode(outsourceQuote.getOutsourceQuoteCode());
@ -144,7 +205,7 @@ public class OutsourceQuoteServiceImpl implements IOutsourceQuoteService
*
* @param outsourceQuote 委外报价对象
*/
public void insertOutsourceQuoteChild(OutsourceQuote outsourceQuote)
public void insertOutsourceQuoteChild(OutsourceQuoteVO outsourceQuote)
{
List<OutsourceQuoteChild> outsourceQuoteChildList = outsourceQuote.getOutsourceQuoteChildList();
if (StringUtils.isNotNull(outsourceQuoteChildList))
@ -165,5 +226,77 @@ public class OutsourceQuoteServiceImpl implements IOutsourceQuoteService
return redisCache.generateBillNo("WWBJ");
}
/**
* 审批流程启动
* */
@Transactional(rollbackFor = Exception.class)
@Override
public ProcessInstance submitApply(OutsourceQuoteVO outsourceQuoteVO) {
SysUser user = ShiroUtils.getSysUser();
outsourceQuoteVO.setApplyUser(user.getLoginName());
outsourceQuoteVO.setApplyTime(DateUtils.getNowDate());
// 保存
insertOutsourceQuote(outsourceQuoteVO);
// 启动流程
String applyTitle = user.getUserName()+"发起了委外报价提交审批-"+DateUtils.dateTimeNow();
String instanceType = "submit";
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,outsourceQuoteVO, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 提交实例id
outsourceQuoteVO.setSubmitInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
outsourceQuoteVO.setAuditStatus("1");
}
outsourceQuoteMapper.updateOutsourceQuote(outsourceQuoteVO);
return processInstance;
}
@Override
public int cancelOutsourceQuoteById(Long id) {
return 0;
}
/**
* 创建委外报价审核流程
* @param applyTitle
* @param instanceType
* @param user
* @return
*/
private ProcessInstance startProcessInstance(String applyTitle, String instanceType, OutsourceQuoteVO outsourceQuoteVO, SysUser user) {
Long outsourceQuoteId = outsourceQuoteVO.getOutsourceQuoteId();
String businessKey = outsourceQuoteId.toString(); // 实体类 ID,作为流程的业务 key
String key = "outsourceQuote";
Map<String,Object> variables = new HashMap<>();
// 构造authority传参
buildAuthority(user, variables);
outsourceQuoteVO.setApplyTitle(applyTitle);
// 启动流程
ProcessInstance processInstance = processService.submitApply(user.getLoginName(), businessKey, applyTitle, outsourceQuoteVO.getOutsourceQuoteCode(), key, variables);
String processInstanceId = processInstance.getId();
outsourceQuoteVO.setInstanceId(processInstanceId); // 建立双向关系
outsourceQuoteVO.setInstanceType(instanceType);
return processInstance;
}
/**
* 发起人节点判断
* */
private void buildAuthority(SysUser user, Map<String, Object> variables) {
Set<String> roleKeys = roleService.selectRoleKeys(user.getUserId());
// 角色不同审核人不同
if(roleKeys.contains("wwyRole")){
variables.put("authority",1);
}else if(roleKeys.contains("wwjlRole")){
variables.put("authority",2);
}else if(roleKeys.contains("wwzgRole")){
variables.put("authority",3);
}
}
}

60
ruoyi-admin/src/main/resources/mapper/system/OutsourceQuoteMapper.xml

@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.OutsourceQuoteMapper">
<resultMap type="OutsourceQuote" id="OutsourceQuoteResult">
<resultMap type="OutsourceQuoteVO" id="OutsourceQuoteResult">
<result property="outsourceQuoteId" column="outsource_quote_id" />
<result property="outsourceQuoteCode" column="outsource_quote_code" />
<result property="supplierQuoteCode" column="supplier_quote_code" />
@ -18,9 +18,19 @@
<result property="updateTime" column="update_time" />
<result property="auditStatus" column="audit_status" />
<result property="remark" column="remark" />
<result property="instanceId" column="instance_id" />
<result property="instanceType" column="instance_type" />
<result property="instanceTypeName" column="instance_type_name" />
<result property="submitInstanceId" column="submit_instance_id" />
<result property="applyTitle" column="apply_title" />
<result property="applyTime" column="apply_time" />
<result property="applyUser" column="apply_user" />
<result property="cancelInstanceId" column="cancel_instance_id" />
<result property="restoreInstanceId" column="restore_instance_id" />
</resultMap>
<resultMap id="OutsourceQuoteOutsourceQuoteChildResult" type="OutsourceQuote" extends="OutsourceQuoteResult">
<resultMap id="OutsourceQuoteOutsourceQuoteChildResult" type="OutsourceQuoteVO" extends="OutsourceQuoteResult">
<collection property="outsourceQuoteChildList" ofType="OutsourceQuoteChild" column="outsource_quote_id" select="selectOutsourceQuoteChildList" />
</resultMap>
@ -45,10 +55,10 @@
</resultMap>
<sql id="selectOutsourceQuoteVo">
select outsource_quote_id, outsource_quote_code, supplier_quote_code, supplier_name, process_amount, tax_rate, pricingDate, create_by, create_time, update_by, update_time, audit_status, remark from outsource_quote
select outsource_quote_id, outsource_quote_code, supplier_quote_code, supplier_name, process_amount, tax_rate, pricingDate, create_by, create_time, update_by, update_time, audit_status, remark,instance_id, instance_type, submit_instance_id, apply_title, apply_time, apply_user, cancel_instance_id, restore_instance_id from outsource_quote
</sql>
<select id="selectOutsourceQuoteList" parameterType="OutsourceQuote" resultMap="OutsourceQuoteResult">
<select id="selectOutsourceQuoteList" parameterType="OutsourceQuoteVO" resultMap="OutsourceQuoteResult">
<include refid="selectOutsourceQuoteVo"/>
<where>
<if test="outsourceQuoteCode != null and outsourceQuoteCode != ''"> and outsource_quote_code = #{outsourceQuoteCode}</if>
@ -62,9 +72,8 @@
</where>
</select>
<select id="selectOutsourceQuoteByOutsourceQuoteId" parameterType="Integer" resultMap="OutsourceQuoteOutsourceQuoteChildResult">
select outsource_quote_id, outsource_quote_code, supplier_quote_code, supplier_name, process_amount, tax_rate, pricingDate, create_by, create_time, update_by, update_time, audit_status, remark
from outsource_quote
<select id="selectOutsourceQuoteByOutsourceQuoteId" parameterType="Long" resultMap="OutsourceQuoteOutsourceQuoteChildResult">
<include refid="selectOutsourceQuoteVo"/>
where outsource_quote_id = #{outsourceQuoteId}
</select>
@ -74,7 +83,7 @@
where outsource_quote_code = #{outsource_quote_code}
</select>
<insert id="insertOutsourceQuote" parameterType="OutsourceQuote" useGeneratedKeys="true" keyProperty="outsourceQuoteCode">
<insert id="insertOutsourceQuote" parameterType="OutsourceQuoteVO" useGeneratedKeys="true" keyProperty="outsourceQuoteId">
insert into outsource_quote
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="outsourceQuoteCode != null and outsourceQuoteCode != ''">outsource_quote_code,</if>
@ -89,6 +98,14 @@
<if test="updateTime != null">update_time,</if>
<if test="auditStatus != null">audit_status,</if>
<if test="remark != null">remark,</if>
<if test="instanceId != null">instance_id,</if>
<if test="instanceType != null">instance_type,</if>
<if test="submitInstanceId != null">submit_instance_id,</if>
<if test="applyTitle != null">apply_title,</if>
<if test="applyTime != null">apply_time,</if>
<if test="applyUser != null">apply_user,</if>
<if test="cancelInstanceId != null">cancel_instance_id,</if>
<if test="restoreInstanceId != null">restore_instance_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="outsourceQuoteCode != null and outsourceQuoteCode != ''">#{outsourceQuoteCode},</if>
@ -103,10 +120,18 @@
<if test="updateTime != null">#{updateTime},</if>
<if test="auditStatus != null">#{auditStatus},</if>
<if test="remark != null">#{remark},</if>
<if test="instanceId != null">#{instanceId},</if>
<if test="instanceType != null">#{instanceType},</if>
<if test="submitInstanceId != null">#{submitInstanceId},</if>
<if test="applyTitle != null">#{applyTitle},</if>
<if test="applyTime != null">#{applyTime},</if>
<if test="applyUser != null">#{applyUser},</if>
<if test="cancelInstanceId != null">#{cancelInstanceId},</if>
<if test="restoreInstanceId != null">#{restoreInstanceId},</if>
</trim>
</insert>
<update id="updateOutsourceQuote" parameterType="OutsourceQuote">
<update id="updateOutsourceQuote" parameterType="OutsourceQuoteVO">
update outsource_quote
<trim prefix="SET" suffixOverrides=",">
<if test="outsourceQuoteCode != null and outsourceQuoteCode != ''">outsource_quote_code = #{outsourceQuoteCode},</if>
@ -121,11 +146,19 @@
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="instanceId != null">instance_id = #{instanceId},</if>
<if test="instanceType != null">instance_type = #{instanceType},</if>
<if test="submitInstanceId != null">submit_instance_id = #{submitInstanceId},</if>
<if test="applyTitle != null">apply_title = #{applyTitle},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="applyUser != null">apply_user = #{applyUser},</if>
<if test="cancelInstanceId != null">cancel_instance_id = #{cancelInstanceId},</if>
<if test="restoreInstanceId != null">restore_instance_id = #{restoreInstanceId},</if>
</trim>
where outsource_quote_id = #{outsourceQuoteId}
</update>
<delete id="deleteOutsourceQuoteByOutsourceQuoteId" parameterType="Integer">
<delete id="deleteOutsourceQuoteByOutsourceQuoteId" parameterType="Long">
delete from outsource_quote where outsource_quote_id = #{outsourceQuoteId}
</delete>
@ -162,4 +195,11 @@
</foreach>
</insert>
<update id="cancelOutsourceQuoteById" parameterType="Long">
update outsource_quote set del_flag = '1' where outsource_quote_id = #{outsourceQuoteId}
</update>
<update id="restoreOutsourceQuoteById" parameterType="Long">
update outsource_quote set del_flag = '0' where outsource_quote_id = #{outsourceQuoteId}
</update>
</mapper>

3
ruoyi-admin/src/main/resources/templates/system/outsource_quote/add.html

@ -58,7 +58,8 @@
<div class="row">
<div class="col-xs-12">
<!-- <button type="button" class="btn btn-blue btn-sm" onclick="addRow()"><i class="fa fa-plus"> 增加</i></button>-->
<a class="btn btn-success" onclick="processadd()" shiro:hasPermission="system:outsource_quote:processadd">
<a class="btn btn-success" onclick="processadd()" >
<!-- shiro:hasPermission="system:outsource_quote:processadd"-->
<i class="fa fa-plus"></i> 添加
</a>
<div class="col-sm-12 select-table table-striped">

98
ruoyi-admin/src/main/resources/templates/system/outsource_quote/outsource_quote.html

@ -76,13 +76,16 @@
</div>
</div>
<th:block th:include="include :: footer" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:outsource_quote:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:outsource_quote:remove')}]];
var detailFlag= [[${@permission.hasPermi('system:outsource_quote:detail')}]]
var auditStatusDatas = [[${@dict.getType('audit_status')}]];
var detailFlag= [[${@permission.hasPermi('system:outsource_quote:detail')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var prefix = ctx + "system/outsource_quote";
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
$(function() {
var options = {
url: prefix + "/list",
@ -100,6 +103,65 @@
title: '委外报价ID',
visible: false
},
{
field: 'instanceId',
title: '流程实例ID',
visible: false
},
{
field: 'submitInstanceId',
title: '流程提交实例ID',
visible: false
},
{
field: 'cancelInstanceId',
title: '流程作废实例ID',
visible: false
},
{
field: 'restoreInstanceId',
title: '流程恢复实例ID',
visible: false
},
{
field: 'instanceTypeName',
title: '流程实例类型',
visible: false
},
{
field: 'applyUser',
title: '申请人ID',
visible: false
},
{
field: 'applyUserName',
title: '<span style="color: red;">申请人</span>',
formatter: function(value, row, index) {
return '<span style="color: red;">' + (value ? value : "-") + '</span>';
}
},
{
field: 'applyTime',
title: '申请时间'
},
{
field: 'taskId',
title: '当前任务ID',
visible: false
},
{
field: 'todoUserId',
title: '待办用户ID',
visible: false
},
{
field: 'taskName',
title: '当前任务名称',
align: 'center',
formatter: function(value, row, index) {
return '<span class="badge badge-primary">' + value + '</span>';
}
},
{
field: 'auditStatus',
title: '审核状态',
@ -144,12 +206,39 @@
field: 'updateTime',
title: '上次更新时间'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.outsourceQuoteId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// 审核状态-审核通过
// if(row.auditStatus=="1"){
// // 编辑
// // actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
// actions.push('<a class="btn btn-success btn-xs ' + sendOrdersFlag + '" href="javascript:void(0)" onclick="sendOrders(\'' + row.outsourceQuoteId + '\')"><i class="fa fa-edit"></i>派单</a> ');
// actions.push('<a class="btn btn-success btn-xs ' + uploadReportFlag + '" href="javascript:void(0)" onclick="uploadReport(\'' + row.outsourceQuoteId + '\')"><i class="fa fa-edit"></i>上传报告</a> ');
// }
// 审核状态-审核拒绝
if(row.auditStatus=="2"){
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.outsourceQuoteId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
}
// 有流程实例id
if (row.instanceId) {
// 有待办人展示审批按钮,
if (row.todoUserId) {
var todoUserIdList = row.todoUserId.split(",");
if(todoUserIdList.includes(loginName) || loginName == 'admin'){
var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批';
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+"申请" + '\')"><i class="fa fa-edit"></i> '+nodeName+'</a> ');
}
}
// 审批历史
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="showHistoryDialog(\'' + row.instanceId + '\')"><i class="fa fa-list"></i> 审批历史</a> ');
// 进度查看
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
}
actions.push('<a class="btn btn-info btn-xs ' + detailFlag + '" href="javascript:;" onclick="$.operate.detail(\'' + row.outsourceQuoteId + '\')"><i class="fa fa-search"></i>详情</a> ');
return actions.join('');
}
@ -157,6 +246,9 @@
};
$.table.init(options);
});
</script>
</body>
</html>

160
ruoyi-admin/src/main/resources/templates/system/outsource_quote/taskWwjlVerify.html

@ -0,0 +1,160 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('委外经理审核委外报价单')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-outsourceQuote-wwjl" th:object="${formData}">
<input name="outsourceQuoteId" th:field="*{outsourceQuoteId}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<input name="taskName" th:field="*{taskName}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden">
<input name="instanceType" th:field="*{instanceType}" type="hidden">
<input type="hidden" name="p_COM_comment" />
<div class="form-group">
<label class="col-sm-3 control-label">委外报价单号:</label>
<div class="col-sm-8">
<input name="outsourceQuoteCode" th:field="*{outsourceQuoteCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商编号:</label>
<div class="col-sm-8">
<input name="supplierQuoteCode" th:field="*{supplierQuoteCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商名称:</label>
<div class="col-sm-8">
<input name="supplierName" th:field="*{supplierName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工序合计:</label>
<div class="col-sm-8">
<input name="processAmount" th:field="*{processAmount}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">税率:</label>
<div class="col-sm-8">
<input name="taxRate" th:field="*{taxRate}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">定价日期:</label>
<div class="col-sm-8">
<input name="pricingDate" th:field="*{pricingDate}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required" for="wwjlVerifyApproved">审批意见:</label>
<div class="col-sm-6">
<select name="p_B_wwjlVerifyApproved" id="wwjlVerifyApproved" class="form-control" required>
<option value=""></option>
<option value="true">同意</option>
<option value="false">拒绝</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">批注:</label>
<div class="col-sm-6">
<textarea name="comment" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
</div>
</form>
<div class="col-sm-12">
<h4>委外工序信息</h4>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table-process"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: summernote-js" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "system/outsource_quote";
$("#form-outsourceQuote-wwjl").validate({
focusCleanup: true
});
var childData = [[${formData.outsourceQuoteChildList}]];
function submitHandler() {
if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) {
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val());
}
var taskId = [[${taskId}]];
$.operate.save(prefix + "/complete/" + taskId, $('#form-outsourceQuote-wwjl').serialize());
}
}
$(function() {
console.log(childData);
var options = {
id: "bootstrap-table-process",
pagination: false,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
sidePagination: "client",
data: [[${formData.outsourceQuoteChildList}]],
columns: [
{
field: 'outsourceProcessId',
align: 'center',
title: '委外工序主键',
visible: false,
},
{
field: 'outsourceProcessNo',
align: 'center',
title: '委外工序编号',
},
{
field: 'outsourceProcessName',
align: 'center',
title: '委外工序名称',
},
{
field: 'chargeUnit',
align: 'center',
title: '计价单位',
},
{
field: 'materialNormb',
align: 'center',
title: '工序的不含税单价(RMB) ',
},
{
field: 'materialRmb',
align: 'center',
title: '工序的含税单价(RMB)',
}
]
};
$.table.init(options);
var quoteDetail = options.data;
});
</script>
</body>
</html>

160
ruoyi-admin/src/main/resources/templates/system/outsource_quote/taskWwzgVerify.html

@ -0,0 +1,160 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('业务主管审核委外报价单')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-outsourceQuote-wwzg" th:object="${formData}">
<input name="outsourceQuoteId" th:field="*{outsourceQuoteId}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<input name="taskName" th:field="*{taskName}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden">
<input name="instanceType" th:field="*{instanceType}" type="hidden">
<input type="hidden" name="p_COM_comment" />
<div class="form-group">
<label class="col-sm-3 control-label">委外报价单号:</label>
<div class="col-sm-8">
<input name="outsourceQuoteCode" th:field="*{outsourceQuoteCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商编号:</label>
<div class="col-sm-8">
<input name="supplierQuoteCode" th:field="*{supplierQuoteCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商名称:</label>
<div class="col-sm-8">
<input name="supplierName" th:field="*{supplierName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工序合计:</label>
<div class="col-sm-8">
<input name="processAmount" th:field="*{processAmount}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">税率:</label>
<div class="col-sm-8">
<input name="taxRate" th:field="*{taxRate}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">定价日期:</label>
<div class="col-sm-8">
<input name="pricingDate" th:field="*{pricingDate}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required" for="wwzgVerifyApproved">审批意见:</label>
<div class="col-sm-6">
<select name="p_B_wwzgVerifyApproved" id="wwzgVerifyApproved" class="form-control" required>
<option value=""></option>
<option value="true">同意</option>
<option value="false">拒绝</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">批注:</label>
<div class="col-sm-6">
<textarea name="comment" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
</div>
</form>
<div class="col-sm-12">
<h4>委外工序信息</h4>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table-process"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: summernote-js" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "system/outsource_quote";
$("#form-outsourceQuote-wwzg").validate({
focusCleanup: true
});
var childData = [[${formData.outsourceQuoteChildList}]];
function submitHandler() {
if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) {
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val());
}
var taskId = [[${taskId}]];
$.operate.save(prefix + "/complete/" + taskId, $('#form-outsourceQuote-wwzg').serialize());
}
}
$(function() {
console.log(childData);
var options = {
id: "bootstrap-table-process",
pagination: false,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
sidePagination: "client",
data: [[${formData.outsourceQuoteChildList}]],
columns: [
{
field: 'outsourceProcessId',
align: 'center',
title: '委外工序主键',
visible: false,
},
{
field: 'outsourceProcessNo',
align: 'center',
title: '委外工序编号',
},
{
field: 'outsourceProcessName',
align: 'center',
title: '委外工序名称',
},
{
field: 'chargeUnit',
align: 'center',
title: '计价单位',
},
{
field: 'materialNormb',
align: 'center',
title: '工序的不含税单价(RMB) ',
},
{
field: 'materialRmb',
align: 'center',
title: '工序的含税单价(RMB)',
}
]
};
$.table.init(options);
var quoteDetail = options.data;
});
</script>
</body>
</html>
Loading…
Cancel
Save