Browse Source

[fix]销售订单模块

dev
zhangsiqi 8 months ago
parent
commit
d6b74c44f5
  1. 6
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java
  2. 6
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java
  3. 5
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java
  4. 3
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java
  5. 109
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java
  6. 18
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java
  7. 17
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java
  8. 12
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrder.java
  9. 83
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrderChild.java
  10. 3
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java
  11. 3
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerService.java
  12. 11
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java
  13. 4
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java
  14. 22
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java
  15. 24
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java
  16. 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
  17. 5
      ruoyi-admin/src/main/resources/application-druid.yml
  18. 24
      ruoyi-admin/src/main/resources/mapper/system/SysCustomerMapper.xml
  19. 20
      ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml
  20. 48
      ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml
  21. 123
      ruoyi-admin/src/main/resources/templates/system/salesOrder/add.html
  22. 94
      ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html
  23. 2
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwjlVerify.html

6
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java

@ -84,9 +84,6 @@ public class ErpBomController extends BaseController
Long userId = curUser.getUserId();
Set<String> roleKeys = roleService.selectRoleKeys(userId);
// 工程文员角色只能看到自己创建的数据
if(roleKeys.contains("gcwyRole")){
erpBomVo.setCreateBy(curUser.getLoginName());
}
startPage();
List<ErpBomVo> list = erpBomService.selectErpBomList(erpBomVo);
return getDataTable(list);
@ -202,7 +199,8 @@ public class ErpBomController extends BaseController
String instanceId = erpBomVo.getInstanceId();
//获取实例类型
String instanceType = erpBomVo.getInstanceType();
boolean approvedFlag = processService.complete(taskId, instanceId, erpBomVo.getApplyTitle(), erpBomVo.getBomNo(), "erpBom", new HashMap<String, Object>(), request);
boolean approvedFlag = processService.complete(taskId, instanceId, erpBomVo.getApplyTitle(),
erpBomVo.getBomNo(), "erpBom", new HashMap<String, Object>(), request);
if(!approvedFlag){
// 审核状态-审核拒绝
erpBomVo.setAuditStatus("2");

6
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java

@ -90,10 +90,6 @@ public class ErpMaterialController extends BaseController
Long userId = curUser.getUserId();
Set<String> roleKeys = roleService.selectRoleKeys(userId);
// 工程文员角色只能看到自己创建的数据
if(roleKeys.contains("gcwyRole")){
erpMaterialVo.setCreateBy(curUser.getLoginName());
}
//
startPage();
List<ErpMaterialVo> list = erpMaterialService.selectErpMaterialList(erpMaterialVo);
return getDataTable(list);
@ -196,7 +192,7 @@ public class ErpMaterialController extends BaseController
erpMaterialVo.setUseStatus("1");
}
}
erpMaterialMapper.updateErpMaterial(erpMaterialVo);
erpMaterialService.updateErpMaterial(erpMaterialVo);
// 驳回申请后继续申请,可能修改表单
if (saveEntityBoolean) {
erpMaterialService.updateErpMaterial(erpMaterialVo);

5
ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java

@ -3,6 +3,7 @@ package com.ruoyi.erp.service;
import com.ruoyi.erp.domain.ErpMaterial;
import com.ruoyi.erp.domain.ErpMaterialVo;
import org.activiti.engine.runtime.ProcessInstance;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@ -67,6 +68,7 @@ public interface IErpMaterialService
* @param id
* @return
*/
@Transactional(rollbackFor = Exception.class)
ProcessInstance cancelErpMaterialById(Long id);
/**
@ -74,6 +76,7 @@ public interface IErpMaterialService
* @param id
* @return
*/
@Transactional(rollbackFor = Exception.class)
ProcessInstance restoreErpMaterialById(Long id);
String checkMaterialNoUnique(String materialNo);
@ -97,5 +100,5 @@ public interface IErpMaterialService
* @param erpMaterial
* @return
*/
ProcessInstance submitApply(ErpMaterial erpMaterial);
public ProcessInstance submitApply(ErpMaterial erpMaterial);
}

3
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java

@ -627,7 +627,8 @@ private ISysAttachService attachService;
buildAuthority(user, variables);
erpBom.setApplyTitle(applyTitle);
// 启动流程
ProcessInstance processInstance = processService.submitApply(user.getLoginName(), businessKey, applyTitle, erpBom.getBomNo(), key, variables);
ProcessInstance processInstance = processService.submitApply(user.getLoginName(), businessKey,
applyTitle, erpBom.getBomNo(), key, variables);
String processInstanceId = processInstance.getId();
erpBom.setInstanceId(processInstanceId); // 建立双向关系
erpBom.setInstanceType(instanceType);

109
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java

@ -259,60 +259,7 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
return erpMaterialMapper.deleteErpMaterialById(id);
}
@Override
@Transactional(rollbackFor = Exception.class)
public ProcessInstance cancelErpMaterialById(Long id) {
ErpMaterialVo erpMaterialVo = erpMaterialMapper.selectErpMaterialById(id);
// 审核状态-待审核
erpMaterialVo.setAuditStatus("0");
SysUser user = ShiroUtils.getSysUser();
// 启动流程
String applyTitle = user.getUserName()+"发起了物料信息作废审批-"+DateUtils.dateTimeNow();
String instanceType = "cancel";
ErpMaterial erpMaterial = new ErpMaterial();
BeanUtils.copyProperties(erpMaterialVo,erpMaterial);
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,erpMaterial, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 作废实例id
erpMaterial.setCancelInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
erpMaterial.setAuditStatus("1");
// 使用状态-已作废
erpMaterial.setUseStatus("2");
}
erpMaterialMapper.updateErpMaterial(erpMaterial);
return processInstance;
}
@Override
public ProcessInstance restoreErpMaterialById(Long id) {
ErpMaterialVo erpMaterialVo = erpMaterialMapper.selectErpMaterialById(id);
// 审核状态-待审核
erpMaterialVo.setAuditStatus("0");
SysUser user = ShiroUtils.getSysUser();
// 启动流程
String applyTitle = user.getUserName()+"发起了物料信息恢复审批-"+DateUtils.dateTimeNow();
String instanceType = "restore";
ErpMaterial erpMaterial = new ErpMaterial();
BeanUtils.copyProperties(erpMaterialVo,erpMaterial);
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,erpMaterial, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 恢复实例id
erpMaterial.setRestoreInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
erpMaterial.setAuditStatus("1");
// 使用状态-是
erpMaterial.setUseStatus("1");
}
erpMaterialMapper.updateErpMaterial(erpMaterial);
return processInstance;
}
@Override
public String checkMaterialNoUnique(String materialNo) {
@ -369,7 +316,60 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
erpMaterialMapper.updateErpMaterial(erpMaterial);
return processInstance;
}
@Override
@Transactional(rollbackFor = Exception.class)
public ProcessInstance cancelErpMaterialById(Long id) {
ErpMaterialVo erpMaterialVo = erpMaterialMapper.selectErpMaterialById(id);
// 审核状态-待审核
erpMaterialVo.setAuditStatus("0");
SysUser user = ShiroUtils.getSysUser();
// 启动流程
String applyTitle = user.getUserName()+"发起了物料信息作废审批-"+DateUtils.dateTimeNow();
String instanceType = "cancel";
ErpMaterial erpMaterial = new ErpMaterial();
BeanUtils.copyProperties(erpMaterialVo,erpMaterial);
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,erpMaterial, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 作废实例id
erpMaterial.setCancelInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
erpMaterial.setAuditStatus("1");
// 使用状态-已作废
erpMaterial.setUseStatus("2");
}
erpMaterialMapper.updateErpMaterial(erpMaterial);
return processInstance;
}
@Override
public ProcessInstance restoreErpMaterialById(Long id) {
ErpMaterialVo erpMaterialVo = erpMaterialMapper.selectErpMaterialById(id);
// 审核状态-待审核
erpMaterialVo.setAuditStatus("0");
SysUser user = ShiroUtils.getSysUser();
// 启动流程
String applyTitle = user.getUserName()+"发起了物料信息恢复审批-"+DateUtils.dateTimeNow();
String instanceType = "restore";
ErpMaterial erpMaterial = new ErpMaterial();
BeanUtils.copyProperties(erpMaterialVo,erpMaterial);
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,erpMaterial, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 恢复实例id
erpMaterial.setRestoreInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
erpMaterial.setAuditStatus("1");
// 使用状态-是
erpMaterial.setUseStatus("1");
}
erpMaterialMapper.updateErpMaterial(erpMaterial);
return processInstance;
}
private ProcessInstance startProcessInstance(String applyTitle,String instanceType,ErpMaterial erpMaterial, SysUser user) {
Long materialId = erpMaterial.getId();
String businessKey = materialId.toString(); // 实体类 ID,作为流程的业务 key
@ -379,7 +379,8 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
buildAuthority(user, variables);
erpMaterial.setApplyTitle(applyTitle);
// 启动流程
ProcessInstance processInstance = processService.submitApply(user.getLoginName(), businessKey, applyTitle, erpMaterial.getMaterialNo(), key, variables);
ProcessInstance processInstance = processService.submitApply(user.getLoginName(), businessKey,
applyTitle, erpMaterial.getMaterialNo(), key, variables);
String processInstanceId = processInstance.getId();
erpMaterial.setInstanceId(processInstanceId); // 建立双向关系
erpMaterial.setInstanceType(instanceType);

18
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java

@ -15,10 +15,7 @@ import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.erp.mapper.ErpMaterialMapper;
import com.ruoyi.erp.service.IErpMaterialService;
import com.ruoyi.finance.domain.Customer;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.remind.service.RemindService;
import com.ruoyi.system.domain.*;
@ -100,9 +97,6 @@ public class SysCustomerController extends BaseController
Long userId = curUser.getUserId();
Set<String> roleKeys = roleService.selectRoleKeys(userId);
// 业务员角色只能看到自己创建的数据
if(roleKeys.contains("ywyRole")){
sysCustomerVo.setCreateBy(curUser.getLoginName());
}
startPage();
List<SysCustomerVo> list = sysCustomerService.selectSysCustomerList(sysCustomerVo);
return getDataTable(list);
@ -111,18 +105,18 @@ public class SysCustomerController extends BaseController
/**
* 导出客户基本信息列表
*/
/*
@RequiresPermissions("system:customer:export")
@Log(title = "客户基本信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(SysCustomer sysCustomer)
public AjaxResult export(SysCustomerVo sysCustomer)
{
List<SysCustomer> list = sysCustomerService.selectSysCustomerList(sysCustomer);
ExcelUtil<SysCustomer> util = new ExcelUtil<SysCustomer>(SysCustomer.class);
List<SysCustomerVo> list = sysCustomerService.selectSysCustomerList(sysCustomer);
ExcelUtil<SysCustomerVo> util = new ExcelUtil<SysCustomerVo>(SysCustomerVo.class);
return util.exportExcel(list, "客户基本信息数据");
}
*/
/**
* 新增客户基本信息

17
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java

@ -144,7 +144,8 @@ public class SysSalesOrderController extends BaseController
{
sysSalesOrder.setUseStatus("0");
sysSalesOrder.setAuditStatus("0");
return AjaxResult.success(sysSalesOrderService.submitApply(sysSalesOrder));
sysSalesOrderService.submitApply(sysSalesOrder);
return AjaxResult.success();
}
/**
@ -379,7 +380,7 @@ public class SysSalesOrderController extends BaseController
boolean approvedFlag = processService.complete(taskId, instanceId,
salesOrderVo.getApplyTitle(), salesOrderVo.getSalesOrderCode(),
"salesOrder", new HashMap<String, Object>(), request);
"salesorder", new HashMap<String, Object>(), request);
if(!approvedFlag){
// 审核状态-审核拒绝
salesOrderVo.setAuditStatus("2");
@ -432,20 +433,16 @@ public class SysSalesOrderController extends BaseController
@GetMapping( "/cancel/{id}")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
SysSalesOrder sysSalesOrder = new SysSalesOrder();
sysSalesOrder.setSalesOrderId(id);
sysSalesOrder.setUseStatus("2");
return AjaxResult.success(sysSalesOrderService.updateSysSalesOrder(sysSalesOrder));
sysSalesOrderService.cancelSysCustomerById(id);
return AjaxResult.success();
}
@Log(title = "客户销售订单信息", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
@ResponseBody
public AjaxResult restore(@PathVariable("id") Long id){
SysSalesOrder sysSalesOrder = new SysSalesOrder();
sysSalesOrder.setSalesOrderId(id);
sysSalesOrder.setUseStatus("1");
return AjaxResult.success(sysSalesOrderService.updateSysSalesOrder(sysSalesOrder));
sysSalesOrderService.restoreSysCustomerById(id);
return AjaxResult.success();
}
@RequestMapping("/getSysSalesOrderSelList")

12
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrder.java

@ -46,7 +46,7 @@ public class SysSalesOrder extends BaseEntity {
/*美元汇率*/
private Double usdTax;
/*税率*/
private String taxRate;
private Double taxRate;
/*是否开票*/
private String invoice;
/* 客户名称*/
@ -75,7 +75,7 @@ public class SysSalesOrder extends BaseEntity {
/*含税单价(美元)*/
private Double usdPrice;
/*含税总价(美元)*/
private String usdTaxSum;
private Double usdTaxSum;
/*计划交付时间*/
private String deliveryTime;
/*客户收货人*/
@ -257,11 +257,11 @@ public class SysSalesOrder extends BaseEntity {
this.usdTax = usdTax;
}
public String getTaxRate() {
public Double getTaxRate() {
return taxRate;
}
public void setTaxRate(String taxRate) {
public void setTaxRate(Double taxRate) {
this.taxRate = taxRate;
}
@ -369,11 +369,11 @@ public class SysSalesOrder extends BaseEntity {
this.usdPrice = usdPrice;
}
public String getUsdTaxSum() {
public Double getUsdTaxSum() {
return usdTaxSum;
}
public void setUsdTaxSum(String usdTaxSum) {
public void setUsdTaxSum(Double usdTaxSum) {
this.usdTaxSum = usdTaxSum;
}

83
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrderChild.java

@ -4,9 +4,6 @@ import com.google.common.base.Objects;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.math.BigDecimal;
import java.util.Date;
/**
* 销售订单对象 sys_sales_order
*
@ -75,43 +72,45 @@ public class SysSalesOrderChild extends BaseEntity {
@Excel(name = "美元汇率")
private Double usdTax;
/*物料合计*/
private Double materialSum;
private Integer materialSum;
/*数量合计*/
private Double enterpriseSum;
@Excel(name = "物料的数量")
private Integer materialNum;
@Excel(name = "物料的对外售价")
private BigDecimal materialSole;
private Double materialSole;
/** 物料的不含税单价(RMB) */
@Excel(name = "物料的不含税单价(RMB) ")
private BigDecimal materialRmb;
private Double materialRmb;
/** 物料的含税单价(RMB) */
@Excel(name = "物料的含税单价(RMB)")
private BigDecimal materialNoRmb;
private Double materialNoRmb;
/** 物料的不含税单价(USD) */
@Excel(name = "物料的不含税单价(USD)")
private BigDecimal materialNoUsd;
private Double materialNoUsd;
/** 物料的含税单价(USD) */
@Excel(name = "物料的含税单价(USD)")
private BigDecimal materialUsd;
private Double materialUsd;
/** 物料的含税总价(USD) */
@Excel(name = "物料的含税总价(USD)")
private BigDecimal materialUsdSum;
private Double materialUsdSum;
/** 物料的不含税总价(USD) */
@Excel(name = "物料的不含税总价(USD)")
private BigDecimal materialNoUsdSum;
private Double materialNoUsdSum;
/** 物料的含税总价(RMB) */
@Excel(name = "物料的含税总价(RMB)")
private BigDecimal materialNoRmbSum;
private Double materialNoRmbSum;
/** 物料的不含税总价(RMB) */
@Excel(name = "物料的不含税总价(RMB)")
private BigDecimal materialRmbSum;
private Double materialRmbSum;
/*业务人员*/
@Excel(name = "业务人员")
@ -241,10 +240,7 @@ public class SysSalesOrderChild extends BaseEntity {
this.photoUrl = photoUrl;
}
public String getDescribe() {
return describe;
}
public String getDescribe() { return describe;}
public void setDescribe(String describe) {
this.describe = describe;
}
@ -265,13 +261,9 @@ public class SysSalesOrderChild extends BaseEntity {
this.usdTax = usdTax;
}
public Double getMaterialSum() {
return materialSum;
}
public Integer getMaterialSum() {return materialSum;}
public void setMaterialSum(Double materialSum) {
this.materialSum = materialSum;
}
public void setMaterialSum(Integer materialSum) {this.materialSum = materialSum;}
public Double getEnterpriseSum() {
return enterpriseSum;
@ -281,75 +273,83 @@ public class SysSalesOrderChild extends BaseEntity {
this.enterpriseSum = enterpriseSum;
}
public BigDecimal getMaterialSole() {
public Integer getMaterialNum() {
return materialNum;
}
public void setMaterialNum(Integer materialNum) {
this.materialNum = materialNum;
}
public Double getMaterialSole() {
return materialSole;
}
public void setMaterialSole(BigDecimal materialSole) {
public void setMaterialSole(Double materialSole) {
this.materialSole = materialSole;
}
public BigDecimal getMaterialRmb() {
public Double getMaterialRmb() {
return materialRmb;
}
public void setMaterialRmb(BigDecimal materialRmb) {
public void setMaterialRmb(Double materialRmb) {
this.materialRmb = materialRmb;
}
public BigDecimal getMaterialNoRmb() {
public Double getMaterialNoRmb() {
return materialNoRmb;
}
public void setMaterialNoRmb(BigDecimal materialNoRmb) {
public void setMaterialNoRmb(Double materialNoRmb) {
this.materialNoRmb = materialNoRmb;
}
public BigDecimal getMaterialNoUsd() {
public Double getMaterialNoUsd() {
return materialNoUsd;
}
public void setMaterialNoUsd(BigDecimal materialNoUsd) {
public void setMaterialNoUsd(Double materialNoUsd) {
this.materialNoUsd = materialNoUsd;
}
public BigDecimal getMaterialUsd() {
public Double getMaterialUsd() {
return materialUsd;
}
public void setMaterialUsd(BigDecimal materialUsd) {
public void setMaterialUsd(Double materialUsd) {
this.materialUsd = materialUsd;
}
public BigDecimal getMaterialUsdSum() {
public Double getMaterialUsdSum() {
return materialUsdSum;
}
public void setMaterialUsdSum(BigDecimal materialUsdSum) {
public void setMaterialUsdSum(Double materialUsdSum) {
this.materialUsdSum = materialUsdSum;
}
public BigDecimal getMaterialNoUsdSum() {
public Double getMaterialNoUsdSum() {
return materialNoUsdSum;
}
public void setMaterialNoUsdSum(BigDecimal materialNoUsdSum) {
public void setMaterialNoUsdSum(Double materialNoUsdSum) {
this.materialNoUsdSum = materialNoUsdSum;
}
public BigDecimal getMaterialNoRmbSum() {
public Double getMaterialNoRmbSum() {
return materialNoRmbSum;
}
public void setMaterialNoRmbSum(BigDecimal materialNoRmbSum) {
public void setMaterialNoRmbSum(Double materialNoRmbSum) {
this.materialNoRmbSum = materialNoRmbSum;
}
public BigDecimal getMaterialRmbSum() {
public Double getMaterialRmbSum() {
return materialRmbSum;
}
public void setMaterialRmbSum(BigDecimal materialRmbSum) {
public void setMaterialRmbSum(Double materialRmbSum) {
this.materialRmbSum = materialRmbSum;
}
@ -413,6 +413,7 @@ public class SysSalesOrderChild extends BaseEntity {
.add("describe", describe)
.add("countTax", countTax)
.add("usdTax", usdTax)
.add("materialNum", materialNum)
.add("materialSum", materialSum)
.add("enterpriseSum", enterpriseSum)
.add("materialSole", materialSole)

3
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java

@ -84,6 +84,5 @@ public interface ISysCustomerQuoteService
@Transactional(rollbackFor = Exception.class)
ProcessInstance restoreSysCustomerById(Long id);
@Transactional(rollbackFor = Exception.class)
ProcessInstance submitApply(SysCustomerQuote sysCustomerQuote);
public ProcessInstance submitApply(SysCustomerQuote sysCustomerQuote);
}

3
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerService.java

@ -82,7 +82,6 @@ public interface ISysCustomerService
@Transactional(rollbackFor = Exception.class)
ProcessInstance restoreSysCustomerById(Long id);
@Transactional(rollbackFor = Exception.class)
ProcessInstance submitApply(SysCustomer sysCustomer);
public ProcessInstance submitApply(SysCustomer sysCustomer);
}

11
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java

@ -67,10 +67,15 @@ public interface ISysSalesOrderService
public int deleteSysSalesOrderById(Long salesOrderId);
public String getId();
/**
* 弃用申请
* */
@Transactional(rollbackFor = Exception.class)
ProcessInstance cancelSysCustomerById(Long id);
/**
* 恢复申请 */
ProcessInstance restoreSysCustomerById(Long id);
@Transactional(rollbackFor = Exception.class)
ProcessInstance submitApply(SysSalesOrder sysSalesOrder);
/**
* 提交申请*/
public ProcessInstance submitApply(SysSalesOrder sysSalesOrder);
}

4
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java

@ -256,7 +256,7 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
// 使用状态-是
sysCustomerQuote.setUseStatus("1");
}
sysCustomerQuoteMapper.updateSysCustomerQuote(sysCustomerQuote);
return processInstance;
}
@ -313,7 +313,7 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
private void buildAuthority(SysUser user, Map<String, Object> variables) {
Set<String> roleKeys = roleService.selectRoleKeys(user.getUserId());
// 角色不同审核人不同
if(roleKeys.contains("zozjRole")){
if(roleKeys.contains("zozjRole") || roleKeys.contains("zjlRole")){
variables.put("authority",4);
}else if(roleKeys.contains("ywzgRole")){
variables.put("authority",3);

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

@ -182,7 +182,9 @@ public class SysCustomerServiceImpl implements ISysCustomerService
sysShippingAddress.setEnterpriseName(sysCustomer.getEnterpriseName());
sysShippingAddressService.insertSysShippingAddress(sysShippingAddress);
sysCustomer.setDeliveryAddressId(sysShippingAddress.getDeliveryId());
return sysCustomerMapper.insertSysCustomer(sysCustomer);
int result = sysCustomerMapper.insertSysCustomer(sysCustomer);
sysCustomer.getCustomerId();
return result;
}
/**
@ -275,7 +277,7 @@ public class SysCustomerServiceImpl implements ISysCustomerService
// 使用状态-已作废
sysCustomer.setUseStatus("2");
}
sysCustomerMapper.updateSysCustomer(sysCustomerVo);
sysCustomerMapper.updateSysCustomer(sysCustomer);
return processInstance;
}
@ -289,21 +291,21 @@ public class SysCustomerServiceImpl implements ISysCustomerService
// 启动流程
String applyTitle = user.getUserName()+"发起了客户恢复审批-"+DateUtils.dateTimeNow();
String instanceType = "restore";
ErpMaterial erpMaterial = new ErpMaterial();
BeanUtils.copyProperties(sysCustomerVo,erpMaterial);
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,sysCustomerVo, user);
SysCustomer sysCustomer = new SysCustomer();
BeanUtils.copyProperties(sysCustomerVo,sysCustomer);
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,sysCustomer, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 恢复实例id
erpMaterial.setRestoreInstanceId(processInstanceId);
sysCustomer.setRestoreInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
erpMaterial.setAuditStatus("1");
sysCustomer.setAuditStatus("1");
// 使用状态-是
erpMaterial.setUseStatus("1");
sysCustomer.setUseStatus("1");
}
sysCustomerMapper.updateSysCustomer(sysCustomer);
return processInstance;
}
@ -360,7 +362,7 @@ public class SysCustomerServiceImpl implements ISysCustomerService
private void buildAuthority(SysUser user, Map<String, Object> variables) {
Set<String> roleKeys = roleService.selectRoleKeys(user.getUserId());
// 角色不同审核人不同
if(roleKeys.contains("zozjRole")){
if(roleKeys.contains("zozjRole") || roleKeys.contains("zjlRole")){
variables.put("authority",4);
}else if(roleKeys.contains("ywzgRole")){
variables.put("authority",3);

24
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java

@ -164,6 +164,8 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
public int insertSysSalesOrder(SysSalesOrder sysSalesOrder){
String loginName = ShiroUtils.getLoginName();
sysSalesOrder.setCreateBy(loginName);
int result = sysSalesOrderMapper.insertSysSalesOrder(sysSalesOrder);
sysSalesOrder.getSalesOrderId();
int s = sysSalesOrder.getSysSalesOrderChildList().size();
if (s == 0){
return 0;
@ -174,7 +176,7 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
sysSalesOrderChild.setCreateBy(loginName);
sysSalesOrderChildService.insertSysSalesOrderChild(sysSalesOrderChild);
}
return sysSalesOrderMapper.insertSysSalesOrder(sysSalesOrder);
return result;
}
@ -213,7 +215,8 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
sysSalesOrderChildService.insertSysSalesOrderChild(sysSalesOrderChild);
}
}
return sysSalesOrderMapper.updateSysSalesOrder(sysSalesOrder);
int result = sysSalesOrderMapper.updateSysSalesOrder(sysSalesOrder);
return result;
}
/**
@ -269,7 +272,7 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
// 使用状态-已作废
sysSalesOrder.setUseStatus("2");
}
sysSalesOrderMapper.updateSysSalesOrder(sysSalesOrderVo);
sysSalesOrderMapper.updateSysSalesOrder(sysSalesOrder);
return processInstance;
}
@ -284,7 +287,7 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
String applyTitle = user.getUserName()+"发起了客户报价恢复审批-"+DateUtils.dateTimeNow();
String instanceType = "restore";
SysSalesOrder sysSalesOrder = new SysSalesOrder();
BeanUtils.copyProperties(sysSalesOrder,sysSalesOrder);
BeanUtils.copyProperties(sysSalesOrderVo,sysSalesOrder);
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,sysSalesOrder, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 恢复实例id
@ -297,7 +300,7 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
// 使用状态-是
sysSalesOrder.setUseStatus("1");
}
sysSalesOrderMapper.updateSysSalesOrder(sysSalesOrder);
return processInstance;
}
@ -337,8 +340,9 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
private ProcessInstance startProcessInstance(String applyTitle,String instanceType,SysSalesOrder sysSalesOrder, SysUser user) {
String businessKey = sysSalesOrder.getSalesOrderCode(); // 实体类 ID,作为流程的业务 key
String key = "salesOrder";
Long nessKey = sysSalesOrder.getSalesOrderId();
String businessKey = String.valueOf(nessKey); // 实体类 ID,作为流程的业务 key
String key = "salesorder";
Map<String,Object> variables = new HashMap<>();
// 构造authority传参
buildAuthority(user, variables);
@ -354,11 +358,9 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
private void buildAuthority(SysUser user, Map<String, Object> variables) {
Set<String> roleKeys = roleService.selectRoleKeys(user.getUserId());
// 角色不同审核人不同
if(roleKeys.contains("zozjRole")){
variables.put("authority",4);
}else if(roleKeys.contains("ywjlRole")){
if(roleKeys.contains("ywzgRole")){
variables.put("authority",3);
}else if(roleKeys.contains("ywzgRole")){
}else if(roleKeys.contains("ywjlRole")){
variables.put("authority",2);
}else if(roleKeys.contains("ywyRole")){
variables.put("authority",1);

1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java

@ -307,5 +307,4 @@ public class SysUserController extends BaseController
userSelList = userSelList.stream().filter(map -> map.get("userType").equals("1")).collect(Collectors.toList());
return success(userSelList);
}
}

5
ruoyi-admin/src/main/resources/application-druid.yml

@ -36,8 +36,9 @@ spring:
# username: root
# password: RuiYi123
# url: jdbc:mysql://39.104.169.14:3306/wancaierpdemo?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
url: jdbc:mysql://120.24.213.253:3306/wancaierpdemo?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
# url: jdbc:mysql://localhost:3306/wancaierpdemo?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
url: jdbc:mysql://120.24.213.253:3306/wancaierpdemo?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&&allowMultiQueries=true
# url: jdbc:mysql://localhost:3306/wancaierpdemo?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
username: root
# password: RuiYi2022
password: Read-in2023

24
ruoyi-admin/src/main/resources/mapper/system/SysCustomerMapper.xml

@ -216,6 +216,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="identifyingPeople!=null">identifying_people,</if>
<if test="deginflag!=null">degin_flag,</if>
<if test="customerRemarks!=null">customer_remarks,</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="cancelInstanceId != null">cancel_instance_id,</if>
<if test="restoreInstanceId != null">restore_instance_id,</if>
<if test="applyTitle != null">apply_title,</if>
<if test="applyUser != null">apply_user,</if>
<if test="applyTime != null">apply_time,</if>
use_status,
audit_status,
del_flag,
@ -260,14 +268,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deliveryCustomerFax!=null">#{deliveryCustomerFax},</if>
<if test="businessMembers!=null">#{businessMembers},</if>
<if test="customerRemarks!=null">#{customerRemarks},</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="cancelInstanceId != null">cancel_instance_id,</if>
<if test="restoreInstanceId != null">restore_instance_id,</if>
<if test="applyTitle != null">apply_title,</if>
<if test="applyUser != null">apply_user,</if>
<if test="applyTime != null">apply_time,</if>
<if test="instanceId != null">#{instanceId},</if>
<if test="instanceType != null">#{instanceType},</if>
<if test="submitInstanceId != null">#{submitInstanceId},</if>
<if test="cancelInstanceId != null">#{cancelInstanceId},</if>
<if test="restoreInstanceId != null">#{restoreInstanceId},</if>
<if test="applyTitle != null">#{applyTitle},</if>
<if test="applyUser != null">#{applyUser},</if>
<if test="applyTime != null">#{applyTime},</if>
0,
0,
0,

20
ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml

@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.SysSalesOrderChildMapperChildMapper">
<mapper namespace="com.ruoyi.system.mapper.SysSalesOrderChildMapper">
<resultMap type="SysSalesOrderChild" id="SysSalesOrderChildResult">
<result property="id" column="id" />
<result property="quoteId" column="quoteId" />
@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectSysSalesOrderChild">
select id, quoteId, materialId, materialCode, materialName, materialType, processMethod, brand, photoUrl,,unit, `describe`,
countTax, usdTax, materialNum,materialSole, materialRmb, materialNoRmb, materialNoUsd, materialUsd, materialUsdSum,
materialNoUsdSum, materialNoRmbSum, materialRmbSum, create_by, create_time, update_by,
materialNoUsdSum, materialNoRmbSum, materialRmbSum,out_bound_quantity, un_bound_quantity, create_by, create_time, update_by,
update_time, remark, use_status,audit_status from sys_sales_order_child
</sql>
<select id="selectSysSalesOrderChildList" parameterType="SysSalesOrderChild" resultMap="SysSalesOrderChildResult">
@ -71,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialType != null">materialType,</if>
<if test="processMethod != null">processMethod,</if>
<if test="brand != null">brand,</if>
<if test="unit != null">unit,</if>
<if test="photoUrl != null">photoUrl,</if>
<if test="describe != null">`describe`,</if>
<if test="countTax != null">countTax,</if>
@ -85,8 +86,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialNoUsdSum != null">materialNoUsdSum,</if>
<if test="materialNoRmbSum != null">materialNoRmbSum,</if>
<if test="materialRmbSum != null">materialRmbSum,</if>
<if test="outBoundQuantity != null">out_bound_quantity,</if>
<if test="unBoundQuantity != null">un_bound_quantity,</if>
<if test="createBy != null">create_by,</if>
<if test="remark != null">remark,</if>
use_status,audit_status,create_time
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -112,6 +116,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialNoUsdSum != null">#{materialNoUsdSum},</if>
<if test="materialNoRmbSum != null">#{materialNoRmbSum},</if>
<if test="materialRmbSum != null">#{materialRmbSum},</if>
<if test="outBoundQuantity != null">#{outBoundQuantity},</if>
<if test="unBoundQuantity != null">#{unBoundQuantity},</if>
<if test="createBy != null">#{createBy},</if>
<if test="remark != null">#{remark},</if>
0,0,now()
@ -143,27 +149,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialNoUsdSum != null">materialNoUsdSum = #{materialNoUsdSum},</if>
<if test="materialNoRmbSum != null">materialNoRmbSum = #{materialNoRmbSum},</if>
<if test="materialRmbSum != null">materialRmbSum = #{materialRmbSum},</if>
<if test="outBoundQuantity != null">out_bound_quantity = #{outBoundQuantity},</if>
<if test="unBoundQuantity != null">un_bound_quantity = #{unBoundQuantity},</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="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="useStatus != null">use_status = #{useStatus},</if>
update_time = now()
</trim>
where id = #{id}
</update>
<delete id="deleteSysSalesOrderChildById" parameterType="Long">
update sys_sales_order_child set use_status = 1 where id = #{id}
delete from sys_sales_order_child where id = #{id}
</delete>
<delete id="deleteSysSalesOrderChildByIds" parameterType="String">
update sys_sales_order_child set use_status = 1 where id in
delete from sys_sales_order_child where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteSysSalesOrderChildByQuoteIds" parameterType="String">
update sys_sales_order_child set use_status = 1 where quoteId in
delete from sys_sales_order_child where quoteId in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>

48
ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml

@ -90,16 +90,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSysSalesOrderList" parameterType="SysSalesOrderVo" resultMap="SysSalesOrderResult">
select s.sales_order_id, s.use_status, s.audit_status, s.make_status, s.delivery_status,
s.close_status, s.sales_order_code, s.sales_order_number, s.sales_order_type,s.enterprise_code,s.customer_purser,s.common_currency,
s.enterprise_name, s.material_sum, s.enterprise_sum, s.noRmbPrice, s.noRmbSum, s.rmbPrice, s.rmbTaxSum,
s.noUsdPrice, s.noUsdSum, s.usdPrice, s.usdTaxSum, s.payment_terms, s.delivery_time,
s.delivery_conditions, s.delivery_method, s.delivery_address,s.delivery_phone,s.customer_delivery,
s.order_receiving_mode,s.customer_contact, s.contact_number,s.contact_email, s.contact_post, s.customer_fax,
s.business_members, s.confirm_tax, s.tax_rate, s.usd_tax,s.invoice,s.total_amount, s.billing_time,
s.modification_time,s.standby_one,s.standby_two, s.first_add_time,
s.update_info_time, s.file_upload, s.create_by, s.create_time, s.update_by, s.update_time, s.remark,
s.out_bound_quantity, s.un_bound_quantity, s.trade_clause, s.instance_id, s.instance_type,
s.submit_instance_id, s.cancel_instance_id, s.restore_instance_id, s.apply_title, s.apply_user,
s.close_status, s.sales_order_code, s.sales_order_number, s.sales_order_type,s.enterprise_code,
s.customer_purser,s.common_currency,s.enterprise_name, s.material_sum, s.enterprise_sum,
s.noRmbPrice, s.noRmbSum, s.rmbPrice, s.rmbTaxSum,s.noUsdPrice, s.noUsdSum, s.usdPrice, s.usdTaxSum,
s.payment_terms, s.delivery_time,s.delivery_conditions, s.delivery_method, s.delivery_address,s.delivery_phone,
s.customer_delivery,s.order_receiving_mode,s.customer_contact, s.contact_number,s.contact_email, s.contact_post,
s.customer_fax,s.business_members, s.confirm_tax, s.tax_rate, s.usd_tax,s.invoice,s.total_amount, s.billing_time,
s.modification_time,s.standby_one,s.standby_two, s.first_add_time,s.update_info_time, s.file_upload, s.create_by,
s.create_time, s.update_by, s.update_time, s.remark,s.out_bound_quantity, s.un_bound_quantity, s.trade_clause,
s.instance_id, s.instance_type,s.submit_instance_id, s.cancel_instance_id, s.restore_instance_id, s.apply_title, s.apply_user,
s.apply_time,p.dict_value as instance_type_name
from sys_sales_order as s
left join(
@ -160,7 +159,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="paymentTerms != null">payment_terms,</if>
<if test="deliveryTime != null">delivery_time,</if>
<if test="deliveryConditions != null">delivery_conditions,</if>
<if test="deliveryMethod != null">delivery_method ,</if>
<if test="deliveryMethod != null">delivery_method,</if>
<if test="deliveryPhone != null">delivery_phone,</if>
<if test="deliveryAddress != null">delivery_address,</if>
<if test="customerDelivery != null">customer_delivery,</if>
@ -172,16 +171,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="contactNumber != null">contact_number,</if>
<if test="customerFax != null">customer_fax,</if>
<if test="businessMembers != null">business_members,</if>
<if test="totalAmount !=null">total_amount,</if>
<if test="modificationTime != null">modification_time,</if>
<if test="tradeClause != null">trade_clause,</if>
<if test="standbyOne != null">standby_one,</if>
<if test="standbyTwo != null">standby_two,</if>
<if test="fileUpload != null">file_upload,</if>
<if test="remark != null">remark,</if>
<if test="outBoundQuantity != null">out_bound_quantity,</if>
<if test="unBoundQuantity != null"> un_bound_quantity </if>
<if test="tradeClause != null">trade_clause,</if>
<if test="unBoundQuantity != null"> un_bound_quantity,</if>
<if test="useStatus != null">use_status,</if>
<if test="auditStatus != null">audit_status,</if>
<if test="makeStatus != null">make_status,</if>
@ -189,6 +185,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="closeStatus != null">close_status,</if>
<if test="instanceType != null">instance_type,</if>
<if test="instanceId != null">instance_id,</if>
<if test="submitInstanceId != null and submitInstanceId != ''">submit_instance_id,</if>
<if test="cancelInstanceId != null and cancelInstanceId != ''">cancel_instance_id,</if>
<if test="restoreInstanceId != null and restoreInstanceId != ''">restore_instance_id,</if>
<if test="applyUser != null">apply_user,</if>
<if test="applyTime != null">apply_time,</if>
<if test="applyTitle != null">apply_title,</if>
@ -201,7 +200,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="enterpriseCode != null">#{enterpriseCode},</if>
<if test="enterpriseName != null">#{enterpriseName},</if>
<if test="customerPurser !=null">#{customerPurser},</if>
<if test="commonCurrency != null">#{commonCurrency},</if>
<if test="commonCurrency !=null">#{commonCurrency},</if>
<if test="materialSum != null">#{materialSum},</if>
<if test="enterpriseSum != null">#{enterpriseSum},</if>
<if test="noRmbPrice != null">#{noRmbPrice},</if>
@ -231,16 +230,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="contactNumber != null">#{contactNumber},</if>
<if test="customerFax != null">#{customerFax},</if>
<if test="businessMembers != null">#{businessMembers},</if>
<if test="totalAmount !=null">#{totalAmount},</if>
<if test="modificationTime != null">#{modificationTime},</if>
<if test="tradeClause != null">#{tradeClause},</if>
<if test="standbyOne != null">#{standbyOne},</if>
<if test="standbyTwo != null">#{standbyTwo},</if>
<if test="fileUpload != null">#{fileUpload},</if>
<if test="standbyTwo != null">#standbyTwo},</if>
<if test="remark != null">#{remark},</if>
<if test="outBoundQuantity != null">#{unBoundQuantity},</if>
<if test="unBoundQuantity != null">#{unBoundQuantity}</if>
<if test="tradeClause != null">#{tradeClause},</if>
<if test="outBoundQuantity != null">#{outBoundQuantity},</if>
<if test="unBoundQuantity != null"> #{unBoundQuantity}, </if>
<if test="useStatus != null">#{useStatus},</if>
<if test="auditStatus != null">#{auditStatus},</if>
<if test="makeStatus != null">#{makeStatus},</if>
@ -248,6 +244,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="closeStatus != null">#{closeStatus},</if>
<if test="instanceType != null">#{instanceType},</if>
<if test="instanceId != null">#{instanceId},</if>
<if test="submitInstanceId != null and submitInstanceId != ''">#{submitInstanceId},</if>
<if test="cancelInstanceId != null and cancelInstanceId != ''">#{cancelInstanceId},</if>
<if test="restoreInstanceId != null and restoreInstanceId != ''">#{restoreInstanceId},</if>
<if test="applyUser != null">#{applyUser},</if>
<if test="applyTime != null">#{applyTime},</if>
<if test="applyTitle != null">#{applyTitle},</if>
@ -295,14 +294,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="businessMembers != null">business_members = #{businessMembers},</if>
<if test="totalAmount !=null">total_amount = #{totalAmount},</if>
<if test="modificationTime != null">modification_time = #{modificationTime},</if>
<if test="tradeClause != null">tarde_clause = #{tradeClause},</if>
<if test="tradeClause != null">trade_clause = #{tradeClause},</if>
<if test="standbyOne != null">standby_one = #{standbyOne},</if>
<if test="standbyTwo != null">standby_two = #{standbyTwo},</if>
<if test="fileUpload != null">file_upload = #{fileUpload},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="outBoundQuantity != null">un_bound_quantity = #{unBoundQuantity},</if>
<if test="unBoundQuantity != null">un_bound_quantity =#{unBoundQuantity}</if>
<if test="tradeClause != null">trade_clause = #{tradeClause},</if>
<if test="unBoundQuantity != null">un_bound_quantity =#{unBoundQuantity},</if>
<if test="useStatus != null">use_status = #{useStatus},</if>
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="makeStatus != null">make_status = #{makeStatus},</if>

123
ruoyi-admin/src/main/resources/templates/system/salesOrder/add.html

@ -1,6 +1,6 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml">
<head>
<th:block th:include="include :: header('新增客户销售订单')"/>
<th:block th:include="include :: datetimepicker-css"/>
@ -89,13 +89,13 @@
<div class="form-group">
<label class="col-sm-3 control-label">事业部:</label>
<div class="col-sm-8">
<input readonly name="customerPurser" class="form-control" type="text" disabled>
<input readonly name="customerPurser" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">客户联系人:</label>
<div class="col-sm-8">
<select id="customerContact" name="customerContact" class="form-control m-b" required>
<select id="customerContact_add" name="customerContact" class="form-control m-b" required>
</select>
</div>
</div>
@ -120,7 +120,7 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">客户收货人:</label>
<div class="col-sm-8">
<select name="customerDelivery" class="form-control m-b" required>
<select name="customerDelivery" id="customerDelivery_add" class="form-control m-b" required>
</select>
</div>
</div>
@ -139,7 +139,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">客户订单号:</label>
<div class="col-sm-8">
<input name="salesOrderNumber" class="form-control" type="text" required>
<input name="salesOrderNumber" class="form-control" type="text">
</div>
</div>
<div class="form-group">
@ -258,7 +258,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">业务员:</label>
<div class="col-sm-8">
<select name="businessMembers" class="form-control m-b" required>
<select name="businessMembers" id="businessMembers_add" class="form-control m-b" required >
</select>
</div>
</div>
@ -610,16 +610,16 @@
commonCurrency = $("#commonCurrency_add option:selected").val();
console.log("commonCurrency",commonCurrency);
});
$('#customerContact').on('select2:select', function (e) {
$('#customerContact_add').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='contactPost']").val(data.customerPosition);
$("input[name='contactNumber']").val(data.cellPhone);
$("input[name='contactEmail']").val(data.commonEmail);
});
$('#customerDelivery').on('select2:select', function (e) {
var datao = e.params.data;
$("input[name='deliveryPhone']").val(datao.customerPhone);
$("input[name='deliveryAddress']").val(datao.deliveryAddress);
$('#customerDelivery_add').on('select2:select', function (e) {
var data1 = e.params.data;
$("input[name='deliveryPhone']").val(data1.customerPhone);
$("input[name='deliveryAddress']").val(data1.deliveryAddress);
});
//获取单号
@ -642,17 +642,17 @@
$.ajax({
url: ctx + 'system/user/list',
type: 'post',
data:{
userName: '业务'
},
success: function (res) {
console.log(res)
if (res.rows.length > 0) {
var usertData = res.rows;
//alert(JSON.stringify(data));
for (let i in usertData) {
// console.log(finishProductData[i].finishProductCode)
$("#form-salesOrder-add select[name='businessMembers']").append(
$("#businessMembers_add").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("#form-salesOrder-add select[name='businessMembers']").val(userName).trigger("change");
$("#businessMembers_add").val(userName).trigger("change");
} else {
$.modal.msgError(res.msg);
}
@ -724,55 +724,43 @@
values: id
})
}
$("#form-salesOrder-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
var formData = $("#form-salesOrder-add").serializeArray();
console.log("formData",formData);
var tableData = $("#bootstrap-sub-table-order").bootstrapTable('getData');
console.log("tableData",JSON.stringify(tableData));
var rows = tableData.length;
if(rows==0){
$.modal.alertWarning("子表数据不能为空!");
}else{
formData.push({"name": "sysSalesOrderChildList", "value": tableData});
var jsonData = $.common.formDataToJson(formData);
console.log("jsonData");
console.log(jsonData);
$.operate.saveJson(prefix + "/add", jsonData);
}
}
}
function getTotalAmount(){
// $("#addFinishbomTable").bootstrapTable('refresh');
let getData = $("#bootstrap-sub-table-quoteChild").bootstrapTable('getData', true);
var enterprise = "";let enterpriseSum = 0; let noRmb = 0;
let rmb = 0;let noRmbSum = 0;let rmbSum = 0;let noUsd = 0;
let usd = 0;let noUsdSum = 0; let usdSum = 0;
let getData = $("#bootstrap-sub-table-order").bootstrapTable('getData', true);
let enterprise = Number(0);let enterpriseSum = Number(0); let noRmb = Number(0);
let rmb = Number(0);let noRmbSum = Number(0);let rmbSum = Number(0);let noUsd = Number(0);
let usd = Number(0);let noUsdSum = Number(0); let usdSum = Number(0);
$("#enterprise_add").val(0);
$("#enterpriseSum_add").val(0);
$("#noRmb_add").val(0);
$("#rmb_add").val(0);
$("#noRmbSum_add").val(0);
$("#rmbTax_add").val(0);
$("#noUsd_add").val(0);
$("#usd_add").val(0);
$("#noUsdSum_add").val(0);
for(let i=0;i<getData.length;i++){
enterprise += getData[i].materialName + ":" + getData[i].materialNum +",";
enterpriseSum += getData[i].materialNum;
noRmb += getData[i].materialNoRmb;
rmb += getData[i].materialRmb ;
noRmbSum += getData[i].materialNoRmbSum;
rmbSum += getData[i].materialRmbSum;
noUsd += getData[i].materialNoUsd ;
usd += getData[i].materialUsd ;
noUsdSum += getData[i].materialNoUsdSum;
usdSum += getData[i].materialUsdSum;
enterprise += 1;
enterpriseSum = Number(enterprise + getData[i].materialNum).toFixed(0);
noRmb = Number(noRmb + getData[i].materialNoRmb).toFixed(2);
rmb = Number(rmb + getData[i].materialRmb).toFixed(2) ;
noRmbSum = Number(noRmbSum + getData[i].materialNoRmbSum).toFixed(2);
rmbSum = Number(rmbSum + getData[i].materialRmbSum).toFixed(2);
noUsd = Number(noUsd + getData[i].materialNoUsd).toFixed(2) ;
usd = Number(usd + getData[i].materialUsd).toFixed(2) ;
noUsdSum = Number(noUsdSum + getData[i].materialNoUsdSum).toFixed(2);
usdSum = Number(usdSum + getData[i].materialUsdSum).toFixed(2);
}
$("#enterprise_add").val(enterprise);
$("#enterpriseSum_add").val(Number(enterpriseSum).toFixed(2));
$("#noRmb_add").val(Number(noRmb).toFixed(2));
$("#rmb_add").val(Number(rmb).toFixed(2));
$("#noRmbSum_add").val(Number(noRmbSum).toFixed(2));
$("#rmbSum_add").val(Number(rmbSum).toFixed(2));
$("#noUsd_add").val(Number(noUsd).toFixed(2));
$("#usd_add").val(Number(usd).toFixed(2));
$("#noUsdSum_add").val(Number(noUsdSum).toFixed(2));
$("#usdSum_add").val(Number(usdSum).toFixed(2));
$("#enterpriseSum_add").val(enterpriseSum);
$("#noRmb_add").val(noRmb);
$("#rmb_add").val(rmb);
$("#noRmbSum_add").val(noRmbSum);
$("#rmbTax_add").val(rmbSum);
$("#noUsd_add").val(noUsd);
$("#usd_add").val(usd);
$("#noUsdSum_add").val(noUsdSum);
$("#usdSum_add").val(usdSum);
}
$("input[name='pricingDate']").datetimepicker({
format: "yyyy-mm-dd",
@ -794,6 +782,21 @@
minView: "month",
autoclose: true
});
function submitHandler() {
if ($.validate.form()) {
var formData = $("#form-salesOrder-add").serializeArray();
var tableData = $("#bootstrap-sub-table-order").bootstrapTable('getData');
console.log("tableData",JSON.stringify(tableData));
var rows = tableData.length;
if(rows==0){
$.modal.alertWarning("子表数据不能为空!");
}else{
formData.push({"name": "sysSalesOrderChildList", "value": tableData});
var jsonData = $.common.formDataToJson(formData);
$.operate.saveJson(prefix + "/add", jsonData);
}
}
}
</script>
</body>
</html>

94
ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html

@ -236,36 +236,12 @@
columns: [
{checkbox: true},
{title: '订单id',field: 'salesOrderId',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
},
{title: '流程实例ID',field: 'instanceId',visible: false},
{ itle: '流程提交实例ID',field: 'submitInstanceId',visible: false},
{ title:'流程作废实例ID',field: 'cancelInstanceId',visible: false},
{title: '流程恢复实例ID',field: 'restoreInstanceId', visible: false},
{ title: '流程实例类型', field: 'instanceTypeName',visible: false},
{title: '申请人ID',field: 'applyUser', visible: false},
{
field: 'applyUserName',
title: '<span style="color: red;">申请人</span>',
@ -273,23 +249,11 @@
return '<span style="color: red;">' + (value ? value : "-") + '</span>';
}
},
{
field: 'applyTime',
title: '申请时间'
{field: 'applyTime',title: '申请时间'
},
{
field: 'taskId',
title: '当前任务ID',
visible: false
},
{
field: 'todoUserId',
title: '待办用户ID',
visible: false
},
{
field: 'taskName',
title: '当前任务名称',
{title: '当前任务ID',field: 'taskId',visible: false},
{ title: '待办用户ID',field: 'todoUserId', visible: false},
{ title: '当前任务名称',field: 'taskName',
align: 'center',
formatter: function(value, row, index) {
return '<span class="badge badge-primary">' + value + '</span>';
@ -362,25 +326,25 @@
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.salesOrderId + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
// 已作废
// if(row.useStatus=="2" && !row.restoreInstanceId){
// // 恢复
// actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i> 恢复</a> ');
// }
// // 有流程实例id
// if (row.instanceId) {
// // 有待办人展示审批按钮,
// if (row.todoUserId) {
// var todoUserIdList = row.todoUserId.split(",");
// if(todoUserIdList.includes(loginName) || loginName == 'admin'){
// var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批';
// actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+row.instanceTypeName+"申请" + '\')"><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> ');
// }
if(row.useStatus=="2" && !row.restoreInstanceId){
// 恢复
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i> 恢复</a> ');
}
// 有流程实例id
if (row.instanceId) {
// 有待办人展示审批按钮,
if (row.todoUserId) {
var todoUserIdList = row.todoUserId.split(",");
if(todoUserIdList.includes(loginName)){
var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批';
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+row.instanceTypeName+"申请" + '\')"><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-primary btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.salesOrderId + '\')"><i class="fa fa-eye"></i> 详情</a> ');
return actions.join('');

2
ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwjlVerify.html

@ -245,7 +245,7 @@
<label class="col-sm-2"> 不含税单价:</label><input placeholder="RMB" class="col-sm-3" name="noRmbPrice" id="noRmb_edit" type="number" readonly/>
<label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-3" name="noRmbSum" id="noRmbSum_edit" type="number" readonly/>
<label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-3" name="rmbPrice" id="rmb_edit" type="number" readonly/>
<label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-3" name="rmbTaxSum" id="_edit" type="number" readonly/>
<label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-3" name="rmbTaxSum" id="rmbTax_edit" type="number" readonly/>
</div>
<div class="col-xs-12">
<label class="col-sm-2">不含税单价:</label><input placeholder="美元" class="col-sm-3" name="noUsdPrice" id="noUsd_edit" type="number" readonly/>

Loading…
Cancel
Save