diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java index 457f5c27..55169ac4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java @@ -1,5 +1,6 @@ package com.ruoyi.system.controller; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.ruoyi.ck.utils.Result; @@ -13,10 +14,7 @@ import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.erp.domain.ErpMaterialVo; import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.remind.service.RemindService; -import com.ruoyi.system.domain.SysCustomerQuote; -import com.ruoyi.system.domain.SysCustomerQuoteChild; -import com.ruoyi.system.domain.SysCustomerQuoteVo; -import com.ruoyi.system.domain.SysCustomerVo; +import com.ruoyi.system.domain.*; import com.ruoyi.system.domain.exportDto.SysCustomerDto; import com.ruoyi.system.mapper.SysCustomerQuoteChildMapper; import com.ruoyi.system.service.*; @@ -36,6 +34,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Set; @@ -167,7 +166,7 @@ public class SysCustomerQuoteController extends BaseController @Log(title = "客户报价信息", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody - public AjaxResult editSave(@RequestBody SysCustomerQuote sysCustomerQuote) + public AjaxResult editSave(@RequestBody SysCustomerQuoteVo sysCustomerQuote) { System.out.println("SysCustomerQuoteController.editSave:" + sysCustomerQuote.toString()); sysCustomerQuote.setAuditStatus("0"); @@ -226,7 +225,13 @@ public class SysCustomerQuoteController extends BaseController String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1); return prefix + "/task" + verifyName; } - + @ModelAttribute("/preloadObj") + public SysCustomerQuoteVo getObj(@RequestParam(value = "id", required = false) Long id, HttpSession session) { + if (id != null) { + return sysCustomerQuoteService.selectSysCustomerQuoteById(id); + } + return new SysCustomerQuoteVo(); + } /** * 完成任务 * @@ -235,8 +240,10 @@ public class SysCustomerQuoteController extends BaseController @RequestMapping(value = "/complete/{taskId}", method = {RequestMethod.POST, RequestMethod.GET}) @ResponseBody public AjaxResult complete(@PathVariable("taskId") String taskId, @RequestParam(value = "saveEntity", required = false) String saveEntity, + @RequestParam(value = "customerQuoteChildList", required = false) String customerQuoteChildList, @ModelAttribute("preloadObj") SysCustomerQuoteVo sysCustomerQuoteVo, HttpServletRequest request) { boolean saveEntityBoolean = BooleanUtils.toBoolean(saveEntity); + sysCustomerQuoteVo.setSysCustomerQuoteChildList(JSON.parseArray(customerQuoteChildList, SysCustomerQuoteChild.class)); String instanceId = sysCustomerQuoteVo.getInstanceId(); String instanceType = sysCustomerQuoteVo.getInstanceType(); boolean approvedFlag = processService.complete(taskId, instanceId, sysCustomerQuoteVo.getApplyTitle(), @@ -274,13 +281,7 @@ public class SysCustomerQuoteController extends BaseController } return success("任务已完成"); } - @ModelAttribute("/preloadObj") - public SysCustomerQuoteVo getObj(@RequestParam(value = "id", required = false) Long id, HttpSession session) { - if (id != null) { - return sysCustomerQuoteService.selectSysCustomerQuoteById(id); - } - return new SysCustomerQuoteVo(); - } + /** * 作废客户报价 */ @@ -289,7 +290,6 @@ public class SysCustomerQuoteController extends BaseController @GetMapping( "/cancel/{id}") @ResponseBody public AjaxResult cancel(@PathVariable("id") Long id){ - ; return AjaxResult.success(sysCustomerQuoteService.cancelSysCustomerById(id)); } @@ -312,4 +312,6 @@ public class SysCustomerQuoteController extends BaseController sysCustomerQuoteVo.setKeyword(keyword); return success(sysCustomerQuoteService.selectSysCustomerQuoteList(sysCustomerQuoteVo)); } + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java index be4d546b..ad61b4f2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java @@ -50,7 +50,7 @@ public interface ISysCustomerQuoteService * @param sysCustomerQuote 客户报价信息 * @return 结果 */ - int updateSysCustomerQuote(SysCustomerQuote sysCustomerQuote); + int updateSysCustomerQuote(SysCustomerQuoteVo sysCustomerQuote); /** * 删除客户报价信息 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java index 6513b7c3..9e6bffd4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java @@ -132,9 +132,13 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { public int insertSysCustomerQuote(SysCustomerQuote sysCustomerQuote) { String loginName = ShiroUtils.getLoginName(); sysCustomerQuote.setCreateBy(loginName); + sysCustomerQuote.setCreateTime(DateUtils.getNowDate()); int result = sysCustomerQuoteMapper.insertSysCustomerQuote(sysCustomerQuote); sysCustomerQuote.getId(); List sysCustomerQuoteChildList = sysCustomerQuote.getSysCustomerQuoteChildList(); + if (CollectionUtils.isEmpty(sysCustomerQuoteChildList)){ + return result; + } for (SysCustomerQuoteChild sysCustomerQuoteChild : sysCustomerQuoteChildList) { sysCustomerQuoteChild.setQuoteId(sysCustomerQuote.getSupplierCode()); sysCustomerQuoteChildMapper.insertSysCustomerQuoteChild(sysCustomerQuoteChild); @@ -143,12 +147,31 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { } @Override - public int updateSysCustomerQuote(SysCustomerQuote sysCustomerQuote) { + public int updateSysCustomerQuote(SysCustomerQuoteVo sysCustomerQuote) { String loginName = ShiroUtils.getLoginName(); sysCustomerQuote.setUpdateBy(loginName); + sysCustomerQuote.setUpdateTime(DateUtils.getNowDate()); SysUser user = ShiroUtils.getSysUser(); + int list = sysCustomerQuoteMapper.updateSysCustomerQuote(sysCustomerQuote); + List sysCustomerQuoteChild = sysCustomerQuote.getSysCustomerQuoteChildList(); + int s = sysCustomerQuoteChild.size(); + if (s == 0){ + return 0; + } + for(SysCustomerQuoteChild sysCustomerQuoteChild1 : sysCustomerQuoteChild){ + if (sysCustomerQuoteChild1.getId() == null || sysCustomerQuoteChild1.getId() == 0L){ + sysCustomerQuoteChild1.setQuoteId(sysCustomerQuote.getSupplierCode()); + sysCustomerQuoteChild1.setCreateBy(loginName); + sysCustomerQuoteChild1.setCreateTime(DateUtils.getNowDate()); + sysCustomerQuoteChildMapper.insertSysCustomerQuoteChild(sysCustomerQuoteChild1); + }else { + sysCustomerQuoteChild1.setUpdateBy(loginName); + sysCustomerQuoteChild1.setUpdateTime(DateUtils.getNowDate()); + sysCustomerQuoteChildMapper.updateSysCustomerQuoteChild(sysCustomerQuoteChild1); + } + } // 启动流程 - return sysCustomerQuoteMapper.updateSysCustomerQuote(sysCustomerQuote); + return list; } @@ -297,7 +320,7 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { private void buildAuthority(SysUser user, Map variables) { Set roleKeys = roleService.selectRoleKeys(user.getUserId()); // 角色不同审核人不同 - if(roleKeys.contains("zozjRole") || roleKeys.contains("zjlRole")){ + if(roleKeys.contains("zozjRole")){ variables.put("authority",4); }else if(roleKeys.contains("ywzgRole")){ variables.put("authority",3); diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml index c90e9aa5..f187a262 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml @@ -68,7 +68,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where dict_type = 'processType' ) as p on s.instance_type = p.dict_value - + + and s.business_members = #{businessMembers} and s.supplierCode like concat('%', #{supplierCode}, '%') and s.customerCode like concat('%', #{customerCode}, '%') and s.customerName like concat('%', #{customerName}, '%') @@ -85,6 +86,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and s.pricingDate between #{params.beginCreateTime} and #{params.endCreateTime} + + and s.create_time between #{params.beginCreateTime} and #{params.endCreateTime} + @@ -135,9 +139,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" apply_title, apply_user, apply_time, - audit_status, - use_status, - create_time, + use_status, + audit_status, + create_time, #{supplierCode}, @@ -171,9 +175,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{applyTitle}, #{applyUser}, #{applyTime}, - 0, - 0, - now(), + #{useStatus}, + #{auditStatus}, + #{createTime}, @@ -212,7 +216,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" apply_title = #{applyTitle}, apply_user = #{applyUser}, apply_time = #{applyTime}, - update_time = now() + update_time = #{updateTime}, where id = #{id} diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html index 1df6f11b..bd55cf66 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html @@ -14,7 +14,7 @@ -
+
+
@@ -84,25 +84,28 @@
-
+

计算

-
- - -
- -
- - - - -
-
- - - - -
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
@@ -136,9 +139,7 @@ var userName = [[${@permission.getPrincipalProperty('userName')}]]; var prefix = ctx + "system/customerQuote"; var commonCurrency = $("#commonCurrency_add option:selected").val(); - $("#form-customerQuote-add").validate({ - focusCleanup: true, - }); + $("#form-customerQuote-add").validate({focusCleanup: true}); function submitHandler() { if ($.validate.form()) { var formData = $("#form-customerQuote-add").serializeArray(); @@ -403,8 +404,8 @@ }); /*业务员列表*/ $.ajax({ - url: ctx + 'system/user/list', - type: 'post', + url: ctx + 'system/salesOrder/getBinessMembers', + type: 'get', success: function (res) { console.log(res) if (res.rows.length > 0) { diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html index 64ed15ec..85f45870 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html @@ -11,7 +11,7 @@
  • - +
  • @@ -23,17 +23,37 @@
  • - +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • - +
  • +
  • + + + - +
  •  搜索  重置 @@ -62,7 +82,6 @@ diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html index c220dfe9..abd0cfe7 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html @@ -20,7 +20,7 @@
-
+
- + +
@@ -87,26 +87,30 @@
-
+

计算

-
+
+
+
+
+
@@ -122,7 +126,7 @@
-
+
@@ -147,8 +151,8 @@ $(function() { /*业务员列表*/ $.ajax({ - url: ctx + 'system/user/list', - type: 'post', + url: ctx + 'system/salesOrder/getBinessMembers', + type: 'get', success: function (res) { console.log(res) if (res.rows.length > 0) { @@ -177,7 +181,7 @@ }); $(function() { var options = { - id: "bootstrap-table-Quote-child", + id: "bootstrap-table-Quote-child-edit1", url: ctx + "system/quoteChild/list", queryParams: queryParams, pagination: false, @@ -299,7 +303,7 @@ if ($.validate.form()) { var formData = $("#form-customerQuote-edit").serializeArray(); console.log("formData",formData); - var tableData = $("#bootstrap-table-Quote-child").bootstrapTable('getData'); + var tableData = $("#bootstrap-table-Quote-child-edit1").bootstrapTable('getData'); console.log("tableData",JSON.stringify(tableData)); var rows = tableData.length; if(rows==0){ @@ -319,8 +323,8 @@ let enterpriseSum = $("#enterpriseSum").val(); $("#enterpriseSum").val((enterpriseSum==''?0:enterpriseSum) + 1); var timestamp = new Date().getTime(); - var totalNum = $("#bootstrap-table-Quote-child").bootstrapTable('getData').length; - $("#bootstrap-table-Quote-child").bootstrapTable('insertRow', { + var totalNum = $("#bootstrap-table-Quote-child-edit1").bootstrapTable('getData').length; + $("#bootstrap-table-Quote-child-edit1").bootstrapTable('insertRow', { index: totalNum, row: { id:'', @@ -376,7 +380,7 @@ }); //计算 function getTotalAmount(){ - let getData = $("#bootstrap-table-Quote-child").bootstrapTable('getData', true); + let getData = $("#bootstrap-table-Quote-child-edit1").bootstrapTable('getData', true); var enterprise = ""; let enterpriseSum = 0; let noRmb = 0;let rmb = 0;let noRmbSum = 0; diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskModifyApply.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskModifyApply.html index 042ecf3e..865ae2d8 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskModifyApply.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskModifyApply.html @@ -7,9 +7,12 @@
-
+ + + +
@@ -100,8 +103,8 @@
- - + +
@@ -115,21 +118,24 @@

计算

- - + + +
+
+ +
-
- - - - + + +
+
+ +
- - - - + +

@@ -142,6 +148,7 @@
+
@@ -157,7 +164,7 @@
-
+
@@ -168,7 +175,7 @@ diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html index bd34a709..c5428c75 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html @@ -7,9 +7,12 @@
-
+ + + +
@@ -47,20 +50,20 @@
-
- +
- +
@@ -75,7 +78,7 @@
-
@@ -92,15 +95,15 @@
- +
- - + +
@@ -117,18 +120,21 @@
-
- - - - + + +
+
+ +
-
- - - - +
+ + +
+
+ +
@@ -149,6 +155,7 @@
+
@@ -161,7 +168,7 @@
-
+
@@ -180,20 +187,20 @@ var sysCustomerQuote = [[${formData}]]; var prefix = ctx + "system/customerQuote" var commonCurrency = $("#commonCurrency_edit option:selected").val(); - $("#form-zozj-audit").validate({focusCleanup: true}); + $("#form-customerQuote-zozj").validate({focusCleanup: true}); $(function() { /*业务员列表*/ $.ajax({ - url: ctx + 'system/user/list', - type: 'post', + url: ctx + 'system/salesOrder/getBinessMembers', + type: 'get', success: function (res) { console.log(res) if (res.rows.length > 0) { var usertData = res.rows; for (let i in usertData) { - $("#form-zozj-audit select[name='businessMembers']").append(""); + $("#form-customerQuote-zozj select[name='businessMembers']").append(""); } - $("#form-zozj-audit select[name='businessMembers']").val(sysCustomerQuote.businessMembers).trigger("change") + $("#form-customerQuote-zozj select[name='businessMembers']").val(sysCustomerQuote.businessMembers).trigger("change") } else { $.modal.msgError(res.msg); } @@ -212,7 +219,7 @@ }); $(function() { var options = { - id: "bootstrap-table-Quote-child", + id: "bootstrap-table-Quote-child5", url: ctx + "system/quoteChild/list", queryParams: queryParams, pagination: false, @@ -328,7 +335,7 @@ }); //计算 function getTotalAmount(){ - let getData = $("#bootstrap-table-Quote-child").bootstrapTable('getData'); + let getData = $("#bootstrap-table-Quote-child5").bootstrapTable('getData'); var enterprise = ""; let enterpriseSum = 0; let noRmb = 0;let rmb = 0;let noRmbSum = 0; @@ -360,8 +367,12 @@ 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-zozj-audit').serialize()); + var tableData = $("#bootstrap-table-Quote-child5").bootstrapTable('getData'); + $.operate.save(prefix + "/complete/" + taskId, $('#form-customerQuote-zozj').serialize()); } }