From 6ab811ab1dfc5fedb806cc7b4f8f7e3d29eeaa61 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Thu, 18 Jul 2024 10:57:08 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E5=94=AE=E5=90=8E=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=94=AE=E5=90=8E=E5=8D=95=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=AE=A1=E6=A0=B8=E6=B5=81=E7=A8=8B=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=AD=97=E6=AE=B5=E5=92=8C=E6=96=B9=E6=B3=95=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=94=AE=E5=90=8E=E5=8D=95=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=B1=82=E5=AE=A1=E6=A0=B8=E6=B5=81=E7=A8=8B=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20=E5=88=A0=E9=99=A4=E5=94=AE=E5=90=8E?= =?UTF-8?q?=E5=8D=95mapper.xml=E5=B1=82=E5=AE=A1=E6=A0=B8=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E7=9B=B8=E5=85=B3=E5=AD=97=E6=AE=B5=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=94=AE=E5=90=8E=E5=8D=95VO=E7=B1=BB=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=94=AE=E5=90=8E=E5=8D=95=E9=9B=86=E5=90=88=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=94=AE=E5=90=8E=E5=8D=95=E8=AF=A6=E6=83=85=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AftersalesOrderController.java | 105 +----------- .../domain/vo/AftersalesOrderVO.java | 33 ---- .../mapper/AftersalesOrderMapper.java | 5 +- .../service/IAftersalesOrderService.java | 11 +- .../impl/AftersalesOrderServiceImpl.java | 157 +----------------- .../SalesAftersalesNoticeController.java | 1 - .../SalesAftersalesNoticeServiceImpl.java | 2 - .../aftersales/AftersalesOrderMapper.xml | 9 +- .../aftersalesOrder/aftersalesOrder.html | 89 +--------- 9 files changed, 18 insertions(+), 394 deletions(-) delete mode 100644 ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/AftersalesOrderVO.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOrderController.java index 8bb917cd..1ee033c5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOrderController.java @@ -1,21 +1,14 @@ package com.ruoyi.aftersales.controller; -import java.util.HashMap; import java.util.List; -import com.ruoyi.aftersales.domain.vo.AftersalesOrderVO; import com.ruoyi.aftersales.domain.vo.SelectDeviceVO; import com.ruoyi.aftersales.service.IAfterSalesShippingDeviceService; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.process.general.service.IProcessService; -import com.ruoyi.system.domain.SysMakeorderPick; -import com.ruoyi.system.domain.SysMakeorderPickVo; import com.ruoyi.system.service.ISysUserService; 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; @@ -30,9 +23,6 @@ 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 * @@ -79,10 +69,10 @@ public class AftersalesOrderController extends BaseController @RequiresPermissions("aftersales:aftersalesOrder:list") @PostMapping("/list") @ResponseBody - public TableDataInfo list(AftersalesOrderVO aftersalesOrderVO) + public TableDataInfo list(AftersalesOrder aftersalesOrder) { startPage(); - List list = aftersalesOrderService.selectAftersalesOrderList(aftersalesOrderVO); + List list = aftersalesOrderService.selectAftersalesOrderList(aftersalesOrder); return getDataTable(list); } @@ -95,10 +85,10 @@ public class AftersalesOrderController extends BaseController @Log(title = "售后单", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody - public AjaxResult export(AftersalesOrderVO aftersalesOrderVO) + public AjaxResult export(AftersalesOrder aftersalesOrder) { - List list = aftersalesOrderService.selectAftersalesOrderList(aftersalesOrderVO); - ExcelUtil util = new ExcelUtil(AftersalesOrderVO.class); + List list = aftersalesOrderService.selectAftersalesOrderList(aftersalesOrder); + ExcelUtil util = new ExcelUtil(AftersalesOrder.class); return util.exportExcel(list, "售后单数据"); } @@ -120,93 +110,10 @@ public class AftersalesOrderController extends BaseController @ResponseBody public AjaxResult addSave(AftersalesOrder aftersalesOrder) { - // 审核状态-待审核 - aftersalesOrder.setAuditStatus("0"); - aftersalesOrderService.submitApply(aftersalesOrder); - 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(); - AftersalesOrderVO aftersalesOrderVO = aftersalesOrderService.selectAftersalesOrderById(new Long(processInstance.getBusinessKey())); - mmap.put("formData", aftersalesOrderVO); - mmap.put("taskId", taskId); - String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1); - return prefix + "/task" + verifyName; + return toAjax(aftersalesOrderService.insertAftersalesOrder(aftersalesOrder)); } - /** - * 自动绑定页面字段 - */ - @ModelAttribute("preloadObj") - public AftersalesOrderVO getObj(@RequestParam(value = "aftersalesOrderId", required = false) Long aftersalesOrderId, HttpSession session) { - if (aftersalesOrderId != null) { - - return aftersalesOrderService.selectAftersalesOrderById(aftersalesOrderId); - } - return new AftersalesOrderVO(); - } - - - /** - * 完成任务 - * - * @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") AftersalesOrderVO aftersalesOrderVO, HttpServletRequest request) { - boolean saveEntityBoolean = BooleanUtils.toBoolean(saveEntity); - //获取实例id - String instanceId = aftersalesOrderVO.getInstanceId(); - //获取实例类型 - String instanceType = aftersalesOrderVO.getInstanceType(); - boolean approvedFlag = processService.complete(taskId, instanceId, aftersalesOrderVO.getApplyTitle(), aftersalesOrderVO.getAftersalesOrderCode(), "aftersalesOrder", new HashMap(), request); - if(!approvedFlag){ - // 审核状态-审核拒绝 - aftersalesOrderVO.setAuditStatus("2"); - } - // 如果任务已结束更新业务表状态 - boolean processIsFinish = processService.judgeProcessIsFinish(instanceId); - if (processIsFinish) { - // 审核通过 - aftersalesOrderVO.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"); - } - } - aftersalesOrderService.updateAftersalesOrder(aftersalesOrderVO); - // 驳回申请后继续申请,可能修改表单 - if (saveEntityBoolean) { - aftersalesOrderService.updateAftersalesOrder(aftersalesOrderVO); - } - return success("任务已完成"); - } - - /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/AftersalesOrderVO.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/AftersalesOrderVO.java deleted file mode 100644 index 85cf7b51..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/AftersalesOrderVO.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.ruoyi.aftersales.domain.vo; - -import com.ruoyi.aftersales.domain.AftersalesOrder; -import lombok.Data; - -import java.util.Date; - -@Data -public class AftersalesOrderVO extends AftersalesOrder { - private static final long serialVersionUID = -3627380777050403384L; - - /** 申请人姓名 */ - 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; -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AftersalesOrderMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AftersalesOrderMapper.java index 89cf1fd4..7861c76f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AftersalesOrderMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AftersalesOrderMapper.java @@ -2,7 +2,6 @@ package com.ruoyi.aftersales.mapper; import java.util.List; import com.ruoyi.aftersales.domain.AftersalesOrder; -import com.ruoyi.aftersales.domain.vo.AftersalesOrderVO; /** * 售后单Mapper接口 @@ -18,7 +17,7 @@ public interface AftersalesOrderMapper * @param aftersalesOrderId 售后单ID * @return 售后单 */ - public AftersalesOrderVO selectAftersalesOrderById(Long aftersalesOrderId); + public AftersalesOrder selectAftersalesOrderById(Long aftersalesOrderId); /** @@ -35,7 +34,7 @@ public interface AftersalesOrderMapper * @param aftersalesOrder 售后单 * @return 售后单集合 */ - public List selectAftersalesOrderList(AftersalesOrder aftersalesOrder); + public List selectAftersalesOrderList(AftersalesOrder aftersalesOrder); /** * 新增售后单 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOrderService.java index 4756078e..b118a1b1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOrderService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOrderService.java @@ -2,8 +2,6 @@ package com.ruoyi.aftersales.service; import java.util.List; import com.ruoyi.aftersales.domain.AftersalesOrder; -import com.ruoyi.aftersales.domain.vo.AftersalesOrderVO; -import com.ruoyi.system.domain.SysMakeorderPick; import org.activiti.engine.runtime.ProcessInstance; /** @@ -20,7 +18,7 @@ public interface IAftersalesOrderService * @param aftersalesOrderId 售后单ID * @return 售后单 */ - public AftersalesOrderVO selectAftersalesOrderById(Long aftersalesOrderId); + public AftersalesOrder selectAftersalesOrderById(Long aftersalesOrderId); /** @@ -37,7 +35,7 @@ public interface IAftersalesOrderService * @param aftersalesOrderVO 售后单 * @return 售后单集合 */ - public List selectAftersalesOrderList(AftersalesOrderVO aftersalesOrderVO); + public List selectAftersalesOrderList(AftersalesOrder aftersalesOrder); /** * 新增售后单 @@ -85,9 +83,4 @@ public interface IAftersalesOrderService */ int restoreAftersalesOrderById(Long aftersalesOrderId); - - /** - * 审批流程启动 - * */ - ProcessInstance submitApply(AftersalesOrder aftersalesOrder); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOrderServiceImpl.java index a400d58a..f1d15f54 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOrderServiceImpl.java @@ -1,13 +1,7 @@ package com.ruoyi.aftersales.service.impl; -import java.text.SimpleDateFormat; import java.util.*; -import com.github.pagehelper.Page; -import com.ruoyi.aftersales.domain.vo.AftersalesOrderVO; -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; @@ -15,16 +9,12 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper; import com.ruoyi.system.domain.SysAttach; -import com.ruoyi.system.domain.SysMakeorderPick; import com.ruoyi.system.mapper.SysAttachMapper; import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.service.ISysAttachFileService; import com.ruoyi.system.service.ISysAttachService; import com.ruoyi.system.service.ISysRoleService; 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.aftersales.mapper.AftersalesOrderMapper; @@ -52,28 +42,6 @@ public class AftersalesOrderServiceImpl implements IAftersalesOrderService private ISysAttachFileService attachFileService; - @Autowired - private IProcessService processService; - - @Autowired - private SysAttachMapper sysAttachMapper; - - @Autowired - private RedisCache redisCache; - - @Autowired - private ISysRoleService roleService; - - - @Autowired - private SysUserMapper userMapper; - - @Autowired - private TaskService taskService; - - @Autowired - private BizTodoItemMapper todoItemMapper; - /** * 查询售后单 * @@ -81,7 +49,7 @@ public class AftersalesOrderServiceImpl implements IAftersalesOrderService * @return 售后单 */ @Override - public AftersalesOrderVO selectAftersalesOrderById(Long aftersalesOrderId) + public AftersalesOrder selectAftersalesOrderById(Long aftersalesOrderId) { return aftersalesOrderMapper.selectAftersalesOrderById(aftersalesOrderId); } @@ -109,60 +77,9 @@ public class AftersalesOrderServiceImpl implements IAftersalesOrderService * @return 售后单 */ @Override - public List selectAftersalesOrderList(AftersalesOrderVO aftersalesOrderVO) + public List selectAftersalesOrderList(AftersalesOrder aftersalesOrder) { - PageDomain pageDomain = TableSupport.buildPageRequest(); - Integer pageNum = pageDomain.getPageNum(); - Integer pageSize = pageDomain.getPageSize(); - - // PageHelper 仅对第一个 List 分页 - Page list = (Page) aftersalesOrderMapper.selectAftersalesOrderList(aftersalesOrderVO); - Page returnList = new Page<>(); - for (AftersalesOrderVO tempAftersalesOrderVO: list) { - SysUser sysUser = userMapper.selectUserByLoginName(tempAftersalesOrderVO.getCreateBy()); - if (sysUser != null) { - tempAftersalesOrderVO.setCreateUserName(sysUser.getUserName()); - } - SysUser sysUser2 = userMapper.selectUserByLoginName(tempAftersalesOrderVO.getApplyUser()); - if (sysUser2 != null) { - tempAftersalesOrderVO.setApplyUserName(sysUser2.getUserName()); - } - String instanceId = tempAftersalesOrderVO.getInstanceId(); - // 当前环节 - if (StringUtils.isNotBlank(instanceId)) { - List taskList = taskService.createTaskQuery() - .processInstanceId(instanceId) -// .singleResult(); - .list(); // 例如请假会签,会同时拥有多个任务 - if (!org.springframework.util.CollectionUtils.isEmpty(taskList)) { - TaskEntityImpl task = (TaskEntityImpl) taskList.get(0); - String taskId = task.getId(); - tempAftersalesOrderVO.setTaskId(taskId); - // 设置待办用户 - List todoUserList = todoItemMapper.selectUndealTodoUserList(taskId); - if(!org.springframework.util.CollectionUtils.isEmpty(taskList)){ - tempAftersalesOrderVO.setTodoUserId(String.join(",",todoUserList)); - } - if (task.getSuspensionState() == 2) { - tempAftersalesOrderVO.setTaskName("已挂起"); - tempAftersalesOrderVO.setSuspendState("2"); - } else { - tempAftersalesOrderVO.setTaskName(task.getName()); - tempAftersalesOrderVO.setSuspendState("1"); - } - } else { - // 已办结或者已撤销 - tempAftersalesOrderVO.setTaskName("已结束"); - } - } else { - tempAftersalesOrderVO.setTaskName("未启动"); - } - returnList.add(tempAftersalesOrderVO); - } - returnList.setTotal(org.springframework.util.CollectionUtils.isEmpty(list) ? 0 : list.getTotal()); - returnList.setPageNum(pageNum); - returnList.setPageSize(pageSize); - return returnList; + return aftersalesOrderMapper.selectAftersalesOrderList(aftersalesOrder); } /** @@ -276,72 +193,4 @@ public class AftersalesOrderServiceImpl implements IAftersalesOrderService return aftersalesOrderMapper.restoreAftersalesOrderById(aftersalesOrderId); } - /** - * 审批流程启动 - * */ - @Transactional(rollbackFor = Exception.class) - @Override - public ProcessInstance submitApply(AftersalesOrder aftersalesOrder) { - - SysUser user = ShiroUtils.getSysUser(); - aftersalesOrder.setApplyUser(user.getLoginName()); - aftersalesOrder.setApplyTime(DateUtils.getNowDate()); - aftersalesOrder.setAftersalesOrderCode(redisCache.generateBillNo("SH")); - // 保存 - insertAftersalesOrder(aftersalesOrder); - // 启动流程 - String applyTitle = user.getUserName()+"发起了售后单提交审批-"+DateUtils.dateTimeNow(); - String instanceType = "submit"; - ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,aftersalesOrder, user); - String processInstanceId = processInstance.getProcessInstanceId(); - // 提交实例id - aftersalesOrder.setSubmitInstanceId(processInstanceId); - // 存在提交完就流程结束的情况 - boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId); - if(processIsFinish){ - // 审核状态-审核通过 - aftersalesOrder.setAuditStatus("1"); - } - aftersalesOrderMapper.updateAftersalesOrder(aftersalesOrder); - return processInstance; - } - - - /** - * 创建售后单审核流程 - * @param applyTitle - * @param instanceType - * @param user - * @return - */ - private ProcessInstance startProcessInstance(String applyTitle, String instanceType, AftersalesOrder aftersalesOrder, SysUser user) { - Long aftersalesOrderId = aftersalesOrder.getAftersalesOrderId(); - String businessKey = aftersalesOrderId.toString(); // 实体类 ID,作为流程的业务 key - String key = "aftersalesOrder"; - Map variables = new HashMap<>(); - // 构造authority传参 - buildAuthority(user, variables); - aftersalesOrder.setApplyTitle(applyTitle); - // 启动流程 - ProcessInstance processInstance = processService.submitApply(user.getLoginName(), businessKey, applyTitle, aftersalesOrder.getAftersalesOrderCode(), key, variables); - String processInstanceId = processInstance.getId(); - aftersalesOrder.setInstanceId(processInstanceId); // 建立双向关系 - aftersalesOrder.setInstanceType(instanceType); - return processInstance; - } - - /** - * 发起人节点判断 - * */ - private void buildAuthority(SysUser user, Map variables) { - Set roleKeys = roleService.selectRoleKeys(user.getUserId()); - // 角色不同审核人不同 - if(roleKeys.contains("ywyRole")){ - variables.put("authority",1); - }else if(roleKeys.contains("ywjlRole")){ - variables.put("authority",2); - }else if(roleKeys.contains("ywzgRole")){ - variables.put("authority",3); - } - } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesAftersalesNoticeController.java b/ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesAftersalesNoticeController.java index 89e62691..7240a215 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesAftersalesNoticeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesAftersalesNoticeController.java @@ -3,7 +3,6 @@ package com.ruoyi.sales.controller; import java.util.HashMap; import java.util.List; -import com.ruoyi.aftersales.domain.vo.AftersalesOrderVO; import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.sales.domain.VO.SalesAftersalesNoticeVO; import org.activiti.engine.RuntimeService; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesAftersalesNoticeServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesAftersalesNoticeServiceImpl.java index a9cb7436..c3482da9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesAftersalesNoticeServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesAftersalesNoticeServiceImpl.java @@ -6,8 +6,6 @@ import java.util.Map; import java.util.Set; import com.github.pagehelper.Page; -import com.ruoyi.aftersales.domain.AftersalesOrder; -import com.ruoyi.aftersales.domain.vo.AftersalesOrderVO; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.page.PageDomain; import com.ruoyi.common.core.page.TableSupport; diff --git a/ruoyi-admin/src/main/resources/mapper/aftersales/AftersalesOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/aftersales/AftersalesOrderMapper.xml index a1b38e81..90d9e7c5 100644 --- a/ruoyi-admin/src/main/resources/mapper/aftersales/AftersalesOrderMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/aftersales/AftersalesOrderMapper.xml @@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -33,7 +33,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - @@ -47,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select aftersales_order_id, aftersales_order_code, sales_order_code, make_no, user_id, audit_status, aftersales_status, business_name, aftersales_name, customer_id, customer_name, material_no, material_name, material_sum, enterprise_sum, start_date, delivery_name, delivery_number, company_address, create_by, create_time, update_by, update_time, remark, service_content, user_comment_attachment, instance_id, instance_type, submit_instance_id, apply_title, apply_time, apply_user, cancel_instance_id, restore_instance_id from aftersales_order - and aftersales_order_code = #{aftersalesOrderCode} @@ -110,7 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where so.aftersales_order_id = #{aftersalesOrderId} - + insert into aftersales_order aftersales_order_code, @@ -184,7 +183,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + update aftersales_order aftersales_order_code = #{aftersalesOrderCode}, diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOrder/aftersalesOrder.html b/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOrder/aftersalesOrder.html index 3161e9dc..6451dd0a 100644 --- a/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOrder/aftersalesOrder.html +++ b/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOrder/aftersalesOrder.html @@ -72,8 +72,6 @@ var prefix = ctx + "aftersales/aftersalesOrder"; - var loginName = [[${@permission.getPrincipalProperty('loginName')}]]; - $(function() { var options = { url: prefix + "/list", @@ -97,74 +95,6 @@ field: 'aftersalesOrderId', 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: '申请人', - formatter: function(value, row, index) { - return '' + (value ? value : "-") + ''; - } - }, - { - 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 '' + value + ''; - } - }, - - { - title: '审核状态', - field: 'auditStatus', - formatter: function(value, row, index) { - return $.table.selectDictLabel(auditStatusDatas, value); - } - }, { title: '售后状态', field: 'aftersalesStatus', @@ -247,28 +177,11 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - // 审核状态-审核通过 - if(row.auditStatus=="1"){ + // 编辑 // actions.push(' 编辑 '); actions.push('派单 '); actions.push('上传报告 '); - } - // 有流程实例id - if (row.instanceId) { - // 有待办人展示审批按钮, - if (row.todoUserId) { - var todoUserIdList = row.todoUserId.split(","); - if(todoUserIdList.includes(loginName) || loginName == 'admin'){ - var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批'; - actions.push(' '+nodeName+' '); - } - } - // 审批历史 - actions.push(' 审批历史 '); - // 进度查看 - actions.push(' 进度查看 '); - } // 详情 actions.push('详情 '); return actions.join('');