Browse Source

[fix]

基础资料 员工领料单
修改mapper文件返回实体类字段,更新、插入记录的方法
修改员工领料新增、更新方法,修改查询领料信息方法,新增同时查询领料详情列表的功能;
修改添加员工领料单页面,新增审核相关内容;
修改员工领料单详情类,添加审核相关字段;
修改员工领料单详情mapper,新增按领料单号批量查询详情信息的方法;
修改员工领料后端接口,新增加载审核弹窗、完成任务的处理方法;
修改员工领料详情页,增加显示领料单关联子表信息的方法;
[feat]
基础资料 员工领料单
新增员工领料VO实体类
新增委外领料委外经理、委外主管审核页面
dev
王晓迪 4 months ago
parent
commit
ac16acdee5
  1. 124
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseEmpRequisiteOrderController.java
  2. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseEmpRequisiteOrderChild.java
  3. 33
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/BaseEmpRequisiteOrderVO.java
  4. 8
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseEmpRequisiteOrderChildMapper.java
  5. 15
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseEmpRequisiteOrderMapper.java
  6. 22
      ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseEmpRequisiteOrderService.java
  7. 236
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseEmpRequisiteOrderServiceImpl.java
  8. 13
      ruoyi-admin/src/main/resources/mapper/system/BaseEmpRequisiteOrderChildMapper.xml
  9. 44
      ruoyi-admin/src/main/resources/mapper/system/BaseEmpRequisiteOrderMapper.xml
  10. 1
      ruoyi-admin/src/main/resources/mapper/system/OutsourceQuoteMapper.xml
  11. 63
      ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/add.html
  12. 1
      ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/detail.html
  13. 18
      ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/empRequisiteOrder.html
  14. 153
      ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskScjlVerify.html
  15. 151
      ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskSczgVerify.html

124
ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseEmpRequisiteOrderController.java

@ -1,15 +1,21 @@
package com.ruoyi.system.controller;
import java.util.HashMap;
import java.util.List;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.system.domain.Vo.BaseEmpRequisiteOrderVO;
import com.ruoyi.system.domain.Vo.OutsourceQuoteVO;
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;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.BaseEmpRequisiteOrder;
@ -19,6 +25,9 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
/**
* 员工领料单Controller
*
@ -34,6 +43,15 @@ public class BaseEmpRequisiteOrderController extends BaseController
@Autowired
private IBaseEmpRequisiteOrderService baseEmpRequisiteOrderService;
@Autowired
private TaskService taskService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private IProcessService processService;
@RequiresPermissions("system:empRequisiteOrder:view")
@GetMapping()
public String empRequisiteOrder()
@ -47,10 +65,10 @@ public class BaseEmpRequisiteOrderController extends BaseController
@RequiresPermissions("system:empRequisiteOrder:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(BaseEmpRequisiteOrder baseEmpRequisiteOrder)
public TableDataInfo list(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO)
{
startPage();
List<BaseEmpRequisiteOrder> list = baseEmpRequisiteOrderService.selectBaseEmpRequisiteOrderList(baseEmpRequisiteOrder);
List<BaseEmpRequisiteOrderVO> list = baseEmpRequisiteOrderService.selectBaseEmpRequisiteOrderList(baseEmpRequisiteOrderVO);
return getDataTable(list);
}
@ -61,10 +79,10 @@ public class BaseEmpRequisiteOrderController extends BaseController
@Log(title = "员工领料单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(BaseEmpRequisiteOrder baseEmpRequisiteOrder)
public AjaxResult export(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO)
{
List<BaseEmpRequisiteOrder> list = baseEmpRequisiteOrderService.selectBaseEmpRequisiteOrderList(baseEmpRequisiteOrder);
ExcelUtil<BaseEmpRequisiteOrder> util = new ExcelUtil<BaseEmpRequisiteOrder>(BaseEmpRequisiteOrder.class);
List<BaseEmpRequisiteOrderVO> list = baseEmpRequisiteOrderService.selectBaseEmpRequisiteOrderList(baseEmpRequisiteOrderVO);
ExcelUtil<BaseEmpRequisiteOrderVO> util = new ExcelUtil<BaseEmpRequisiteOrderVO>(BaseEmpRequisiteOrderVO.class);
return util.exportExcel(list, "员工领料单数据");
}
@ -84,9 +102,87 @@ public class BaseEmpRequisiteOrderController extends BaseController
@Log(title = "员工领料单", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(BaseEmpRequisiteOrder baseEmpRequisiteOrder)
public AjaxResult addSave(@RequestBody BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO)
{
return toAjax(baseEmpRequisiteOrderService.insertBaseEmpRequisiteOrder(baseEmpRequisiteOrder));
// 审核状态-待审核
baseEmpRequisiteOrderVO.setAuditStatus("0");
baseEmpRequisiteOrderService.submitApply(baseEmpRequisiteOrderVO);
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();
BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO = baseEmpRequisiteOrderService.selectBaseEmpRequisiteOrderById(new Long(processInstance.getBusinessKey()));
mmap.put("formData", baseEmpRequisiteOrderVO);
mmap.put("taskId", taskId);
String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1);
return prefix + "/task" + verifyName;
}
/**
* 自动绑定页面字段
*/
@ModelAttribute("preloadObj")
public BaseEmpRequisiteOrderVO getObj(@RequestParam(value = "requisiteId", required = false) Long baseEmpRequisiteOrderId, HttpSession session) {
if (baseEmpRequisiteOrderId != null) {
return baseEmpRequisiteOrderService.selectBaseEmpRequisiteOrderById(baseEmpRequisiteOrderId);
}
return new BaseEmpRequisiteOrderVO();
}
/**
* 完成任务
*
* @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") BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO, HttpServletRequest request) {
boolean saveEntityBoolean = BooleanUtils.toBoolean(saveEntity);
//获取实例id
String instanceId = baseEmpRequisiteOrderVO.getInstanceId();
//获取实例类型
String instanceType = baseEmpRequisiteOrderVO.getInstanceType();
boolean approvedFlag = processService.complete(taskId, instanceId, baseEmpRequisiteOrderVO.getApplyTitle(), baseEmpRequisiteOrderVO.getRequisitieCode(), "requisition", new HashMap<String, Object>(), request);
if(!approvedFlag){
// 审核状态-审核拒绝
baseEmpRequisiteOrderVO.setAuditStatus("2");
}
// 如果任务已结束更新业务表状态
boolean processIsFinish = processService.judgeProcessIsFinish(instanceId);
if (processIsFinish) {
// 审核通过
baseEmpRequisiteOrderVO.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");
}
}
baseEmpRequisiteOrderService.updateBaseEmpRequisiteOrder(baseEmpRequisiteOrderVO);
// 驳回申请后继续申请,可能修改表单
if (saveEntityBoolean) {
baseEmpRequisiteOrderService.updateBaseEmpRequisiteOrder(baseEmpRequisiteOrderVO);
}
return success("任务已完成");
}
/**
@ -114,9 +210,9 @@ public class BaseEmpRequisiteOrderController extends BaseController
@Log(title = "员工领料单", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(BaseEmpRequisiteOrder baseEmpRequisiteOrder)
public AjaxResult editSave(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO)
{
return toAjax(baseEmpRequisiteOrderService.updateBaseEmpRequisiteOrder(baseEmpRequisiteOrder));
return toAjax(baseEmpRequisiteOrderService.updateBaseEmpRequisiteOrder(baseEmpRequisiteOrderVO));
}
/**

2
ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseEmpRequisiteOrderChild.java

@ -87,7 +87,7 @@ public class BaseEmpRequisiteOrderChild extends BaseEntity
@Excel(name = "审核状态")
private String auditStatus;
public void setRequisitioningChildId(Long requisitioningChildId)
public void setRequisitioningChildId(Long requisitioningChildId)
{
this.requisitioningChildId = requisitioningChildId;
}

33
ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/BaseEmpRequisiteOrderVO.java

@ -0,0 +1,33 @@
package com.ruoyi.system.domain.Vo;
import com.ruoyi.system.domain.BaseEmpRequisiteOrder;
import lombok.Data;
import java.util.Date;
@Data
public class BaseEmpRequisiteOrderVO extends BaseEmpRequisiteOrder {
private static final long serialVersionUID = 1L;
/** 申请人姓名 */
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;
}

8
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseEmpRequisiteOrderChildMapper.java

@ -18,7 +18,13 @@ public interface BaseEmpRequisiteOrderChildMapper
* @return 员工单领料单物料信息
*/
public BaseEmpRequisiteOrderChild selectBaseEmpRequisiteOrderChildById(Long requisitioningChildId);
/**
* 查询员工单领料单物料信息
*
* @param requisitioningCode 员工单领料单号
* @return 员工单领料单物料信息
*/
public List<BaseEmpRequisiteOrderChild> selectBaseEmpRequisiteOrderChildByCode(String requisitioningCode);
/**
* 查询员工单领料单物料信息列表
*

15
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseEmpRequisiteOrderMapper.java

@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.BaseEmpRequisiteOrder;
import com.ruoyi.system.domain.Vo.BaseEmpRequisiteOrderVO;
/**
* 员工领料单Mapper接口
@ -17,31 +18,31 @@ public interface BaseEmpRequisiteOrderMapper
* @param requisiteId 员工领料单ID
* @return 员工领料单
*/
public BaseEmpRequisiteOrder selectBaseEmpRequisiteOrderById(Long requisiteId);
public BaseEmpRequisiteOrderVO selectBaseEmpRequisiteOrderById(Long requisiteId);
/**
* 查询员工领料单列表
*
* @param baseEmpRequisiteOrder 员工领料单
* @param baseEmpRequisiteOrderVO 员工领料单
* @return 员工领料单集合
*/
public List<BaseEmpRequisiteOrder> selectBaseEmpRequisiteOrderList(BaseEmpRequisiteOrder baseEmpRequisiteOrder);
public List<BaseEmpRequisiteOrderVO> selectBaseEmpRequisiteOrderList(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO);
/**
* 新增员工领料单
*
* @param baseEmpRequisiteOrder 员工领料单
* @param baseEmpRequisiteOrderVO 员工领料单
* @return 结果
*/
public int insertBaseEmpRequisiteOrder(BaseEmpRequisiteOrder baseEmpRequisiteOrder);
public int insertBaseEmpRequisiteOrder(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO);
/**
* 修改员工领料单
*
* @param baseEmpRequisiteOrder 员工领料单
* @param baseEmpRequisiteOrderVO 员工领料单
* @return 结果
*/
public int updateBaseEmpRequisiteOrder(BaseEmpRequisiteOrder baseEmpRequisiteOrder);
public int updateBaseEmpRequisiteOrder(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO);
/**
* 删除员工领料单

22
ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseEmpRequisiteOrderService.java

@ -2,6 +2,9 @@ package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.BaseEmpRequisiteOrder;
import com.ruoyi.system.domain.Vo.BaseEmpRequisiteOrderVO;
import com.ruoyi.system.domain.Vo.OutsourceQuoteVO;
import org.activiti.engine.runtime.ProcessInstance;
/**
* 员工领料单Service接口
@ -17,31 +20,31 @@ public interface IBaseEmpRequisiteOrderService
* @param requisiteId 员工领料单ID
* @return 员工领料单
*/
public BaseEmpRequisiteOrder selectBaseEmpRequisiteOrderById(Long requisiteId);
public BaseEmpRequisiteOrderVO selectBaseEmpRequisiteOrderById(Long requisiteId);
/**
* 查询员工领料单列表
*
* @param baseEmpRequisiteOrder 员工领料单
* @param baseEmpRequisiteOrderVO 员工领料单
* @return 员工领料单集合
*/
public List<BaseEmpRequisiteOrder> selectBaseEmpRequisiteOrderList(BaseEmpRequisiteOrder baseEmpRequisiteOrder);
public List<BaseEmpRequisiteOrderVO> selectBaseEmpRequisiteOrderList(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO);
/**
* 新增员工领料单
*
* @param baseEmpRequisiteOrder 员工领料单
* @param baseEmpRequisiteOrderVO 员工领料单
* @return 结果
*/
public int insertBaseEmpRequisiteOrder(BaseEmpRequisiteOrder baseEmpRequisiteOrder);
public int insertBaseEmpRequisiteOrder(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO);
/**
* 修改员工领料单
*
* @param baseEmpRequisiteOrder 员工领料单
* @param baseEmpRequisiteOrderVO 员工领料单
* @return 结果
*/
public int updateBaseEmpRequisiteOrder(BaseEmpRequisiteOrder baseEmpRequisiteOrder);
public int updateBaseEmpRequisiteOrder(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO);
/**
* 批量删除员工领料单
@ -74,4 +77,9 @@ public interface IBaseEmpRequisiteOrderService
int restoreBaseEmpRequisiteOrderById(Long requisiteId);
Object getId();
/**
* 审批流程启动
* */
ProcessInstance submitApply(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO);
}

236
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseEmpRequisiteOrderServiceImpl.java

@ -2,15 +2,33 @@ package com.ruoyi.system.service.impl;
import java.math.BigDecimal;
import java.math.RoundingMode;
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.common.utils.StringUtils;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.system.domain.BaseEmpRequisiteOrderChild;
import com.ruoyi.system.domain.BaseRequisitioningOrderChild;
import com.ruoyi.system.domain.Vo.BaseEmpRequisiteOrderVO;
import com.ruoyi.system.domain.Vo.OutsourceQuoteVO;
import com.ruoyi.system.mapper.BaseEmpRequisiteOrderChildMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.ISysUserService;
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.system.mapper.BaseEmpRequisiteOrderMapper;
@ -39,6 +57,24 @@ public class BaseEmpRequisiteOrderServiceImpl implements IBaseEmpRequisiteOrderS
@Autowired
private ISysUserService userService;
@Autowired
private SysRoleServiceImpl roleService;
@Autowired
private TaskService taskService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private BizTodoItemMapper todoItemMapper;
@Autowired
private SysUserMapper userMapper;
@Autowired
private IProcessService processService;
/**
* 查询员工领料单
*
@ -46,46 +82,102 @@ public class BaseEmpRequisiteOrderServiceImpl implements IBaseEmpRequisiteOrderS
* @return 员工领料单
*/
@Override
public BaseEmpRequisiteOrder selectBaseEmpRequisiteOrderById(Long requisiteId)
public BaseEmpRequisiteOrderVO selectBaseEmpRequisiteOrderById(Long requisiteId)
{
return baseEmpRequisiteOrderMapper.selectBaseEmpRequisiteOrderById(requisiteId);
BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO = baseEmpRequisiteOrderMapper.selectBaseEmpRequisiteOrderById(requisiteId);
if(baseEmpRequisiteOrderChildMapper.selectBaseEmpRequisiteOrderChildByCode(baseEmpRequisiteOrderVO.getRequisitieCode())!=null){
List<BaseEmpRequisiteOrderChild> child = baseEmpRequisiteOrderChildMapper.selectBaseEmpRequisiteOrderChildByCode(baseEmpRequisiteOrderVO.getRequisitieCode());
baseEmpRequisiteOrderVO.setBaseEmpRequisiteOrderChildList(child);
}
return baseEmpRequisiteOrderVO;
}
/**
* 查询员工领料单列表
*
* @param baseEmpRequisiteOrder 员工领料单
* @param baseEmpRequisiteOrderVO 员工领料单
* @return 员工领料单
*/
@Override
public List<BaseEmpRequisiteOrder> selectBaseEmpRequisiteOrderList(BaseEmpRequisiteOrder baseEmpRequisiteOrder)
public List<BaseEmpRequisiteOrderVO> selectBaseEmpRequisiteOrderList(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO)
{
return baseEmpRequisiteOrderMapper.selectBaseEmpRequisiteOrderList(baseEmpRequisiteOrder);
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
// PageHelper 仅对第一个 List 分页
Page<BaseEmpRequisiteOrderVO> list = (Page<BaseEmpRequisiteOrderVO>) baseEmpRequisiteOrderMapper.selectBaseEmpRequisiteOrderList(baseEmpRequisiteOrderVO);
Page<BaseEmpRequisiteOrderVO> returnList = new Page<>();
for (BaseEmpRequisiteOrderVO tempRequisiteVO: list) {
SysUser sysUser = userMapper.selectUserByLoginName(tempRequisiteVO.getCreateBy());
if (sysUser != null) {
tempRequisiteVO.setCreateUserName(sysUser.getUserName());
}
SysUser sysUser2 = userMapper.selectUserByLoginName(tempRequisiteVO.getApplyUser());
if (sysUser2 != null) {
tempRequisiteVO.setApplyUserName(sysUser2.getUserName());
}
String instanceId = tempRequisiteVO.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();
tempRequisiteVO.setTaskId(taskId);
// 设置待办用户
List<String> todoUserList = todoItemMapper.selectUndealTodoUserList(taskId);
if(!org.springframework.util.CollectionUtils.isEmpty(taskList)){
tempRequisiteVO.setTodoUserId(String.join(",",todoUserList));
}
if (task.getSuspensionState() == 2) {
tempRequisiteVO.setTaskName("已挂起");
tempRequisiteVO.setSuspendState("2");
} else {
tempRequisiteVO.setTaskName(task.getName());
tempRequisiteVO.setSuspendState("1");
}
} else {
// 已办结或者已撤销
tempRequisiteVO.setTaskName("已结束");
}
} else {
tempRequisiteVO.setTaskName("未启动");
}
returnList.add(tempRequisiteVO);
}
returnList.setTotal(org.springframework.util.CollectionUtils.isEmpty(list) ? 0 : list.getTotal());
returnList.setPageNum(pageNum);
returnList.setPageSize(pageSize);
return returnList;
}
/**
* 新增员工领料单
*
* @param baseEmpRequisiteOrder 员工领料单
* @param baseEmpRequisiteOrderVO 员工领料单
* @return 结果
*/
@Override
@Transactional(rollbackFor = NullPointerException.class)
public int insertBaseEmpRequisiteOrder(BaseEmpRequisiteOrder baseEmpRequisiteOrder)
public int insertBaseEmpRequisiteOrder(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO)
{
String loginName = ShiroUtils.getLoginName();
baseEmpRequisiteOrder.setCreateBy(loginName);
baseEmpRequisiteOrder.setCreateTime(DateUtils.getNowDate());
if (baseEmpRequisiteOrder.getRequisitieCode() == null) {
baseEmpRequisiteOrder.setRequisitieCode(redisCache.generateBillNo("QG"));
baseEmpRequisiteOrderVO.setCreateBy(loginName);
baseEmpRequisiteOrderVO.setCreateTime(DateUtils.getNowDate());
if (baseEmpRequisiteOrderVO.getRequisitieCode() == null) {
baseEmpRequisiteOrderVO.setRequisitieCode(redisCache.generateBillNo("QG"));
}
List<BaseEmpRequisiteOrderChild> childList = baseEmpRequisiteOrder.getBaseEmpRequisiteOrderChildList();
List<BaseEmpRequisiteOrderChild> childList = baseEmpRequisiteOrderVO.getBaseEmpRequisiteOrderChildList();
Long materialSum = 0L;
BigDecimal materialRmbSum = new BigDecimal(0);
BigDecimal materialNoRmbSum = new BigDecimal(0);
//物料合计
Integer childSize = childList.size();
if (childSize > 0) {
// Integer childSize = childList.size();
if (childList!=null) {
for (BaseEmpRequisiteOrderChild child : childList) {
//物料数量
materialSum += child.getMaterialNum();
@ -93,45 +185,45 @@ public class BaseEmpRequisiteOrderServiceImpl implements IBaseEmpRequisiteOrderS
materialRmbSum = child.getMaterialRmbSum().setScale(2, RoundingMode.HALF_UP).add(materialNoRmbSum);
//物料含税总价(RMB)
materialNoRmbSum = child.getMaterialNoRmbSum().setScale(2, RoundingMode.HALF_UP).add(materialNoRmbSum);
child.setQuoteId(baseEmpRequisiteOrder.getRequisitieCode());
child.setQuoteId(baseEmpRequisiteOrderVO.getRequisitieCode());
child.setCreateBy(loginName);
child.setCreateTime(DateUtils.getNowDate());
baseEmpRequisiteOrderChildMapper.insertBaseEmpRequisiteOrderChild(child);
}
baseEmpRequisiteOrderVO.setMaterialAmount(Long.valueOf(childList.size()));
}
baseEmpRequisiteOrder.setAuditStatus("1");
baseEmpRequisiteOrder.setUseStatus("1");
baseEmpRequisiteOrder.setMaterialAmount(Long.valueOf(childSize));
baseEmpRequisiteOrder.setMaterialSum(materialSum);
baseEmpRequisiteOrder.setRmbSum(materialRmbSum);
baseEmpRequisiteOrder.setNoRmbSum(materialNoRmbSum);
return baseEmpRequisiteOrderMapper.insertBaseEmpRequisiteOrder(baseEmpRequisiteOrder);
// baseEmpRequisiteOrderVO.setUseStatus("1");
baseEmpRequisiteOrderVO.setMaterialSum(materialSum);
baseEmpRequisiteOrderVO.setRmbSum(materialRmbSum);
baseEmpRequisiteOrderVO.setNoRmbSum(materialNoRmbSum);
System.out.println(baseEmpRequisiteOrderVO);
return baseEmpRequisiteOrderMapper.insertBaseEmpRequisiteOrder(baseEmpRequisiteOrderVO);
}
/**
* 修改员工领料单
*
* @param baseEmpRequisiteOrder 员工领料单
* @param baseEmpRequisiteOrderVO 员工领料单
* @return 结果
*/
@Override
@Transactional(rollbackFor = NullPointerException.class)
public int updateBaseEmpRequisiteOrder(BaseEmpRequisiteOrder baseEmpRequisiteOrder)
public int updateBaseEmpRequisiteOrder(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO)
{
String loginName = ShiroUtils.getLoginName();
baseEmpRequisiteOrder.setUpdateBy(loginName);
baseEmpRequisiteOrder.setUpdateTime(DateUtils.getNowDate());
baseEmpRequisiteOrderChildMapper.deleteBaseEmpRequisiteOrderChildByCode(baseEmpRequisiteOrder.getRequisitieCode());
if (baseEmpRequisiteOrder.getRequisitieCode() == null) {
baseEmpRequisiteOrder.setRequisitieCode(redisCache.generateBillNo("QG"));
baseEmpRequisiteOrderVO.setUpdateBy(loginName);
baseEmpRequisiteOrderVO.setUpdateTime(DateUtils.getNowDate());
baseEmpRequisiteOrderChildMapper.deleteBaseEmpRequisiteOrderChildByCode(baseEmpRequisiteOrderVO.getRequisitieCode());
if (baseEmpRequisiteOrderVO.getRequisitieCode() == null) {
baseEmpRequisiteOrderVO.setRequisitieCode(redisCache.generateBillNo("QG"));
}
List<BaseEmpRequisiteOrderChild> childList = baseEmpRequisiteOrder.getBaseEmpRequisiteOrderChildList();
List<BaseEmpRequisiteOrderChild> childList = baseEmpRequisiteOrderVO.getBaseEmpRequisiteOrderChildList();
Long materialSum = 0L;
BigDecimal materialRmbSum = new BigDecimal(0);
BigDecimal materialNoRmbSum = new BigDecimal(0);
//物料合计
Integer childSize = childList.size();
if (childSize > 0) {
// Integer childSize = childList.size();
if (childList!=null) {
for (BaseEmpRequisiteOrderChild child : childList) {
//物料数量
materialSum += child.getMaterialNum();
@ -139,19 +231,19 @@ public class BaseEmpRequisiteOrderServiceImpl implements IBaseEmpRequisiteOrderS
materialRmbSum = child.getMaterialRmbSum().setScale(2, RoundingMode.HALF_UP).add(materialNoRmbSum);
//物料含税总价(RMB)
materialNoRmbSum = child.getMaterialNoRmbSum().setScale(2, RoundingMode.HALF_UP).add(materialNoRmbSum);
child.setQuoteId(baseEmpRequisiteOrder.getRequisitieCode());
child.setQuoteId(baseEmpRequisiteOrderVO.getRequisitieCode());
child.setCreateBy(loginName);
child.setCreateTime(DateUtils.getNowDate());
baseEmpRequisiteOrderChildMapper.insertBaseEmpRequisiteOrderChild(child);
}
baseEmpRequisiteOrderVO.setMaterialAmount(Long.valueOf(childList.size()));
}
baseEmpRequisiteOrder.setAuditStatus("1");
baseEmpRequisiteOrder.setUseStatus("1");
baseEmpRequisiteOrder.setMaterialAmount(Long.valueOf(childSize));
baseEmpRequisiteOrder.setMaterialSum(materialSum);
baseEmpRequisiteOrder.setRmbSum(materialRmbSum);
baseEmpRequisiteOrder.setNoRmbSum(materialNoRmbSum);
return baseEmpRequisiteOrderMapper.updateBaseEmpRequisiteOrder(baseEmpRequisiteOrder);
// baseEmpRequisiteOrderVO.setAuditStatus("1");
// baseEmpRequisiteOrderVO.setUseStatus("1");
baseEmpRequisiteOrderVO.setMaterialSum(materialSum);
baseEmpRequisiteOrderVO.setRmbSum(materialRmbSum);
baseEmpRequisiteOrderVO.setNoRmbSum(materialNoRmbSum);
return baseEmpRequisiteOrderMapper.updateBaseEmpRequisiteOrder(baseEmpRequisiteOrderVO);
}
/**
@ -207,4 +299,68 @@ public class BaseEmpRequisiteOrderServiceImpl implements IBaseEmpRequisiteOrderS
public Object getId() {
return redisCache.generateBillNo("YGLL");
}
/**
* 审批流程启动
* */
@Transactional(rollbackFor = Exception.class)
@Override
public ProcessInstance submitApply(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO) {
SysUser user = ShiroUtils.getSysUser();
baseEmpRequisiteOrderVO.setApplyUser(user.getLoginName());
baseEmpRequisiteOrderVO.setApplyTime(DateUtils.getNowDate());
// 保存
insertBaseEmpRequisiteOrder(baseEmpRequisiteOrderVO);
// 启动流程
String applyTitle = user.getUserName()+"发起了委外报价提交审批-"+DateUtils.dateTimeNow();
String instanceType = "submit";
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,baseEmpRequisiteOrderVO, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 提交实例id
baseEmpRequisiteOrderVO.setSubmitInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
baseEmpRequisiteOrderVO.setAuditStatus("1");
}
baseEmpRequisiteOrderMapper.updateBaseEmpRequisiteOrder(baseEmpRequisiteOrderVO);
return processInstance;
}
/**
* 创建委外报价审核流程
* @param applyTitle
* @param instanceType
* @param user
* @return
*/
private ProcessInstance startProcessInstance(String applyTitle, String instanceType, BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO, SysUser user) {
Long requisiteId = baseEmpRequisiteOrderVO.getRequisiteId();
String businessKey = requisiteId.toString(); // 实体类 ID,作为流程的业务 key
String key = "requisition";
Map<String,Object> variables = new HashMap<>();
// 构造authority传参
buildAuthority(user, variables);
baseEmpRequisiteOrderVO.setApplyTitle(applyTitle);
// 启动流程
ProcessInstance processInstance = processService.submitApply(user.getLoginName(), businessKey, applyTitle, baseEmpRequisiteOrderVO.getRequisitieCode(), key, variables);
String processInstanceId = processInstance.getId();
baseEmpRequisiteOrderVO.setInstanceId(processInstanceId); // 建立双向关系
baseEmpRequisiteOrderVO.setInstanceType(instanceType);
return processInstance;
}
/**
* 发起人节点判断
* */
private void buildAuthority(SysUser user, Map<String, Object> variables) {
Set<String> roleKeys = roleService.selectRoleKeys(user.getUserId());
// 角色不同审核人不同
if(roleKeys.contains("scyRole")){
variables.put("authority",1);
}
}
}

13
ruoyi-admin/src/main/resources/mapper/system/BaseEmpRequisiteOrderChildMapper.xml

@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectBaseEmpRequisiteOrderChildVo">
select requisitioning_child_id, quote_id, material_id, material_code, photoUrl, material_name, material_type, material_model, specifications, brand, describe, materialNum, materialRmb, materialNoRmb, materialNoRmbSum, materialRmbSum, remark, create_by, create_time, update_by, update_time, use_status, audit_status from base_emp_requisite_order_child
select requisitioning_child_id, quote_id, material_id, material_code, photoUrl, material_name, material_type, material_model, specifications, brand, `describe`, materialNum, materialRmb, materialNoRmb, materialNoRmbSum, materialRmbSum, remark, create_by, create_time, update_by, update_time, use_status, audit_status from base_emp_requisite_order_child
</sql>
<select id="selectBaseEmpRequisiteOrderChildList" parameterType="BaseEmpRequisiteOrderChild" resultMap="BaseEmpRequisiteOrderChildResult">
@ -61,7 +61,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectBaseEmpRequisiteOrderChildVo"/>
where requisitioning_child_id = #{requisitioningChildId}
</select>
<select id="selectBaseEmpRequisiteOrderChildByCode" parameterType="String" resultMap="BaseEmpRequisiteOrderChildResult">
<include refid="selectBaseEmpRequisiteOrderChildVo"/>
where quote_id = #{quoteId}
</select>
<insert id="insertBaseEmpRequisiteOrderChild" parameterType="BaseEmpRequisiteOrderChild" useGeneratedKeys="true" keyProperty="requisitioningChildId">
insert into base_emp_requisite_order_child
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -74,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialModel != null">material_model,</if>
<if test="specifications != null">specifications,</if>
<if test="brand != null">brand,</if>
<if test="describe != null">describe,</if>
<if test="describe != null">`describe`,</if>
<if test="materialNum != null">materialNum,</if>
<if test="materialRmb != null">materialRmb,</if>
<if test="materialNoRmb != null">materialNoRmb,</if>
@ -146,7 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deleteBaseEmpRequisiteOrderChildById" parameterType="Long">
delete from base_emp_requisite_order_child where requisitioning_child_id = #{requisitioningChildId}
</delete>
<delete id="deleteBaseEmpRequisiteOrderChildByCode" parameterType="Long">
<delete id="deleteBaseEmpRequisiteOrderChildByCode" parameterType="String">
delete from base_emp_requisite_order_child where quote_id = #{code}
</delete>
<delete id="deleteBaseEmpRequisiteOrderChildByIds" parameterType="String">

44
ruoyi-admin/src/main/resources/mapper/system/BaseEmpRequisiteOrderMapper.xml

@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.BaseEmpRequisiteOrderMapper">
<resultMap type="BaseEmpRequisiteOrder" id="BaseEmpRequisiteOrderResult">
<resultMap type="BaseEmpRequisiteOrderVO" id="BaseEmpRequisiteOrderResult">
<result property="requisiteId" column="requisite_id" />
<result property="auditStatus" column="audit_status" />
<result property="requisitieStatus" column="requisitie_status" />
@ -21,13 +21,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="useStatus" column="use_status" />
<result property="instanceId" column="instance_id" />
<result property="instanceType" column="instance_type" />
<result property="submitInstanceId" column="submit_instance_id" />
<result property="applyTitle" column="apply_title" />
<result property="applyTime" column="apply_time" />
<result property="cancelInstanceId" column="cancel_instance_id" />
<result property="restoreInstanceId" column="restore_instance_id" />
</resultMap>
<sql id="selectBaseEmpRequisiteOrderVo">
select requisite_id, audit_status, requisitie_status, requisitie_code, correlation_code, material_amount, material_sum, noRmbSum, rmbSum, apply_user, create_by, create_time, update_by, update_time, remark, use_status from base_emp_requisite_order
select requisite_id, audit_status, requisitie_status, requisitie_code, correlation_code, material_amount, material_sum, noRmbSum, rmbSum, create_by, create_time, update_by, update_time, remark, use_status,instance_id, instance_type, submit_instance_id, apply_title, apply_time, apply_user, cancel_instance_id, restore_instance_id from base_emp_requisite_order
</sql>
<select id="selectBaseEmpRequisiteOrderList" parameterType="BaseEmpRequisiteOrder" resultMap="BaseEmpRequisiteOrderResult">
<select id="selectBaseEmpRequisiteOrderList" parameterType="BaseEmpRequisiteOrderVO" resultMap="BaseEmpRequisiteOrderResult">
<include refid="selectBaseEmpRequisiteOrderVo"/>
<where>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
@ -44,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where requisite_id = #{requisiteId}
</select>
<insert id="insertBaseEmpRequisiteOrder" parameterType="BaseEmpRequisiteOrder" useGeneratedKeys="true" keyProperty="requisiteId">
<insert id="insertBaseEmpRequisiteOrder" parameterType="BaseEmpRequisiteOrderVO" useGeneratedKeys="true" keyProperty="requisiteId">
insert into base_emp_requisite_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="auditStatus != null">audit_status,</if>
@ -55,13 +62,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialSum != null">material_sum,</if>
<if test="noRmbSum != null">noRmbSum,</if>
<if test="rmbSum != null">rmbSum,</if>
<if test="applyUser != null">apply_user,</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="useStatus != null">use_status,</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="auditStatus != null">#{auditStatus},</if>
@ -72,17 +86,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialSum != null">#{materialSum},</if>
<if test="noRmbSum != null">#{noRmbSum},</if>
<if test="rmbSum != null">#{rmbSum},</if>
<if test="applyUser != null">#{applyUser},</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="useStatus != null">#{useStatus},</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="updateBaseEmpRequisiteOrder" parameterType="BaseEmpRequisiteOrder">
<update id="updateBaseEmpRequisiteOrder" parameterType="BaseEmpRequisiteOrderVO">
update base_emp_requisite_order
<trim prefix="SET" suffixOverrides=",">
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
@ -93,13 +114,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialSum != null">material_sum = #{materialSum},</if>
<if test="noRmbSum != null">noRmbSum = #{noRmbSum},</if>
<if test="rmbSum != null">rmbSum = #{rmbSum},</if>
<if test="applyUser != null">apply_user = #{applyUser},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="useStatus != null">use_status = #{useStatus},</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 requisite_id = #{requisiteId}
</update>

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

@ -20,7 +20,6 @@
<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" />

63
ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/add.html

@ -130,7 +130,7 @@
$("#bootstrap-sub-table-empRequisitionChild").bootstrapTable('insertRow', {
index:1,
row: {
materialId:rowData.id,
materialId:rowData.materialId,
materialCode: rowData.materialNo,
materialName: rowData.materialName,
materialType: rowData.materialType,
@ -139,11 +139,11 @@
unit: rowData.unit,
processMethod: rowData.processMethod,
photoUrl: rowData.photoUrl,
materialNum: "",
materialRmb: "",
materialNoRmb: "",
materialNoRmbSum: "",
materialRmbSum: "",
materialNum: 0,
materialRmb: 0,
materialNoRmb: 0,
materialNoRmbSum: 0,
materialRmbSum: 0,
remark: ""
}
})
@ -165,12 +165,59 @@
values: id
})
}
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-empRequisiteOrder-add').serialize());
var baseEmpRequisiteOrderVO = {};
if ($.validate.form()) {
var baseEmpRequisiteOrderChildList = [];
// 获取表单数据
const Data = $("#form-empRequisiteOrder-add").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
baseEmpRequisiteOrderVO = {
requisitieCode: Data.requisitieCode,
correlationCode: Data.correlationCode,
remark: Data.remark,
materialAmount: 0,
baseEmpRequisiteOrderChildList: []
}
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
var rows = $('#bootstrap-sub-table-empRequisitionChild').bootstrapTable('getData');
// 检查表格数据是否为空
if (rows.length === 0) {
$.modal.alertWarning("请至少添加一条物料信息再保存!");
return;
} else {
baseEmpRequisiteOrderVO.materialAmount = rows.length;
for (var i = 0; i < rows.length; i++) {
var requisiteChild = {
materialId: rows[i].id,
materialCode: rows[i].materialNo,
materialName: rows[i].materialName,
materialType: rows[i].materialType,
describe: rows[i].describe,
brand: rows[i].brand,
unit: rows[i].unit,
processMethod: rows[i].processMethod,
photoUrl: rows[i].photoUrl,
materialNum: rows[i].materialNum,
materialRmb: rows[i].materialRmb,
materialNoRmb: rows[i].materialNoRmb,
materialNoRmbSum: rows[i].materialNoRmbSum,
materialRmbSum: rows[i].materialRmbSum,
remark: rows[i].remark
};
baseEmpRequisiteOrderVO.baseEmpRequisiteOrderChildList.push(requisiteChild);
}
}
console.log(JSON.stringify(baseEmpRequisiteOrderVO));
$.operate.saveJson(prefix + "/add", JSON.stringify(baseEmpRequisiteOrderVO));
// $.operate.save(prefix + "/add", $('#form-empRequisiteOrder-add').serialize());
}
}
}
function getSelections(){
$.ajax({
url: ctx + "system/requisitioning/getEmpUserName",

1
ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/detail.html

@ -59,6 +59,7 @@
pagination: false,
sidePagination: "client",
model: "物料报价信息",
data: [[${baseEmpRequisiteOrder.baseEmpRequisiteOrderChildList}]],
columns: [
{checkbox: true},
{field: 'index',align: 'center', title: "序号",

18
ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/empRequisiteOrder.html

@ -51,6 +51,7 @@
</div>
</div>
<th:block th:include="include :: footer" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:empRequisiteOrder:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:empRequisiteOrder:remove')}]];
@ -59,6 +60,7 @@
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var requisitieStatusDatas = [[${@dict.getType('pickStatus')}]];
var useStatusDatas = [[${@dict.getType('useStatus')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var prefix = ctx + "system/empRequisiteOrder";
$(function() {
@ -107,6 +109,22 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
// 有流程实例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-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.requisiteId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.requisiteId + '\')"><i class="fa fa-deatil"></i>详情</a> ');
if(row.delFlag == '0'){

153
ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskScjlVerify.html

@ -0,0 +1,153 @@
<!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-empRequisition-scjl" th:object="${formData}">
<input name="requisiteId" th:field="*{requisiteId}" 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="requisitieCode" th:field="*{requisitieCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联销售订单号:</label>
<div class="col-sm-8">
<input name="correlationCode" th:field="*{correlationCode}" class="form-control" type="text">
</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">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required" for="scjlVerifyApproved">审批意见:</label>
<div class="col-sm-6">
<select name="p_B_scjlVerifyApproved" id="scjlVerifyApproved" 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>
</form>
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>报价信息</span>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-empRequisitionChild"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<th:block th:include="include :: summernote-js" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "system/empRequisiteOrder";
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
$("#form-empRequisition-scjl").validate({
focusCleanup: true
});
//获取子表信息
$(function() {
var options = {
id:'bootstrap-sub-table-empRequisitionChild',
pagination: false,
sidePagination: "client",
model: "物料报价信息",
data: [[${formData.baseEmpRequisiteOrderChildList}]],
columns: [
{checkbox: true},
{field: 'index',align: 'center', title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
{title: '物料索引id',field: 'materialId',align: 'center',visible: false},
{title: '料号',field: 'materialCode',align: 'center'},
{title: '物料名称',field: 'materialName',align: 'center'},
{title: '图片',field: 'photoUrl',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{title: '物料类型',field: 'materialType',align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{title: '型号',field: 'materialModel',align: 'center'},
{title: '规格',field: 'specification',align: 'center'},
{ title: '描述',field: 'describe',align: 'center'},
{title: '品牌',field: 'brand',align: 'center'},
{ title: '单位',field: 'unit',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value);
}
},
{title: '半成品类型',field: 'processMethod',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{title: '物料的数量', field: 'materialNum',align: 'center',editable: true,},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',},
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',},
{title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',},
{title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',},
{title: '录入人',field: 'createBy',align: 'center',visible: false},
{title: '录入时间',field: 'createTime',align: 'center',visible: false },
{title: '更新人',field: 'updateBy',align: 'center',visible: false},
{title: '上次更新时间',field: 'updateTime',align: 'center',visible: false},
{title: '备注',field: 'remark',align: 'center',editable: true},
],
onEditableSave:function(field, row, oldValue, $el){
row.materialNoRmbSum = Number(row.materialNum * Number(row.materialNoRmb)).toFixed(2);
row.materialRmbSum = Number(row.materialRmb * row.materialNum).toFixed(2);
},
};
$.table.init(options);
});
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-empRequisition-scjl').serialize());
}
}
</script>
</body>
</html>

151
ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/taskSczgVerify.html

@ -0,0 +1,151 @@
<!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-empRequisition-sczg" th:object="${formData}">
<input name="requisiteId" th:field="*{requisiteId}" 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="requisitieCode" th:field="*{requisitieCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联销售订单号:</label>
<div class="col-sm-8">
<input name="correlationCode" th:field="*{correlationCode}" class="form-control" type="text">
</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">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required" for="sczgVerifyApproved">审批意见:</label>
<div class="col-sm-6">
<select name="p_B_sczgVerifyApproved" id="sczgVerifyApproved" 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>
</form>
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>报价信息</span>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-empRequisitionChild"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<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/empRequisiteOrder";
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
$("#form-empRequisition-sczg").validate({
focusCleanup: true
});
//获取子表信息
$(function() {
var options = {
id:'bootstrap-sub-table-empRequisitionChild',
pagination: false,
sidePagination: "client",
model: "物料报价信息",
data: [[${formData.baseEmpRequisiteOrderChildList}]],
columns: [
{checkbox: true},
{field: 'index',align: 'center', title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
{title: '物料索引id',field: 'materialId',align: 'center',visible: false},
{title: '料号',field: 'materialCode',align: 'center'},
{title: '物料名称',field: 'materialName',align: 'center'},
{title: '图片',field: 'photoUrl',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{title: '物料类型',field: 'materialType',align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{title: '型号',field: 'materialModel',align: 'center'},
{title: '规格',field: 'specification',align: 'center'},
{ title: '描述',field: 'describe',align: 'center'},
{title: '品牌',field: 'brand',align: 'center'},
{ title: '单位',field: 'unit',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value);
}
},
{title: '半成品类型',field: 'processMethod',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{title: '物料的数量', field: 'materialNum',align: 'center',editable: true,},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',},
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',},
{title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',},
{title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',},
{title: '录入人',field: 'createBy',align: 'center',visible: false},
{title: '录入时间',field: 'createTime',align: 'center',visible: false },
{title: '更新人',field: 'updateBy',align: 'center',visible: false},
{title: '上次更新时间',field: 'updateTime',align: 'center',visible: false},
{title: '备注',field: 'remark',align: 'center',editable: true},
],
};
console.log(options.data);
$.table.init(options);
});
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-empRequisition-sczg').serialize());
}
}
</script>
</body>
</html>
Loading…
Cancel
Save