Browse Source

[fix] 售后管理 销售管理

修改售后通知单和售后单的客户要求出发日期类型为Date类型
新增 根据售后单号查询销售售后通知单后端接口
新增 销售售后通知单审批通过后生产售后单后端接口
新增根据销售单号查询生产订单后端接口
dev
liuxiaoxu 4 months ago
parent
commit
22a1795593
  1. 14
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AftersalesOrder.java
  2. 5
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOrderService.java
  3. 44
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOrderServiceImpl.java
  4. 10
      ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesAftersalesNoticeController.java
  5. 14
      ruoyi-admin/src/main/java/com/ruoyi/sales/domain/SalesAftersalesNotice.java
  6. 5
      ruoyi-admin/src/main/java/com/ruoyi/sales/mapper/SalesAftersalesNoticeMapper.java
  7. 5
      ruoyi-admin/src/main/java/com/ruoyi/sales/service/ISalesAftersalesNoticeService.java
  8. 9
      ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesAftersalesNoticeServiceImpl.java
  9. 6
      ruoyi-admin/src/main/resources/mapper/sales/SalesAftersalesNoticeMapper.xml

14
ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AftersalesOrder.java

@ -74,7 +74,7 @@ public class AftersalesOrder extends BaseEntity
/** 客户要求出发日期 */ /** 客户要求出发日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "客户要求出发日期", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "客户要求出发日期", width = 30, dateFormat = "yyyy-MM-dd")
private String startDate; private Date startDate;
/** 收货联系人 */ /** 收货联系人 */
@Excel(name = "收货联系人") @Excel(name = "收货联系人")
@ -261,15 +261,15 @@ public class AftersalesOrder extends BaseEntity
{ {
return enterpriseSum; return enterpriseSum;
} }
public void setStartDate(String startDate)
{
this.startDate = startDate;
}
public String getStartDate() public Date getStartDate() {
{
return startDate; return startDate;
} }
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public void setDeliveryName(String deliveryName) public void setDeliveryName(String deliveryName)
{ {
this.deliveryName = deliveryName; this.deliveryName = deliveryName;

5
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOrderService.java

@ -2,6 +2,7 @@ package com.ruoyi.aftersales.service;
import java.util.List; import java.util.List;
import com.ruoyi.aftersales.domain.AftersalesOrder; import com.ruoyi.aftersales.domain.AftersalesOrder;
import com.ruoyi.sales.domain.VO.SalesAftersalesNoticeVO;
import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.runtime.ProcessInstance;
/** /**
@ -83,4 +84,8 @@ public interface IAftersalesOrderService
*/ */
int restoreAftersalesOrderById(Long aftersalesOrderId); int restoreAftersalesOrderById(Long aftersalesOrderId);
/**
* 销售售后通知单 审核后生成售后单
* */
void generateAftersalesOrderBySalesAftersalesNotice(SalesAftersalesNoticeVO tempSalesAftersalesNoticeVO);
} }

44
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOrderServiceImpl.java

@ -8,12 +8,16 @@ import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper; import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.sales.domain.VO.SalesAftersalesNoticeVO;
import com.ruoyi.system.domain.SysAttach; import com.ruoyi.system.domain.SysAttach;
import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.mapper.SysAttachMapper; import com.ruoyi.system.mapper.SysAttachMapper;
import com.ruoyi.system.mapper.SysMakeOrderMapper;
import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.ISysAttachFileService; import com.ruoyi.system.service.ISysAttachFileService;
import com.ruoyi.system.service.ISysAttachService; import com.ruoyi.system.service.ISysAttachService;
import com.ruoyi.system.service.ISysRoleService; import com.ruoyi.system.service.ISysRoleService;
import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.TaskService; import org.activiti.engine.TaskService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -29,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
* @author 刘晓旭 * @author 刘晓旭
* @date 2024-04-24 * @date 2024-04-24
*/ */
@Slf4j
@Service @Service
public class AftersalesOrderServiceImpl implements IAftersalesOrderService public class AftersalesOrderServiceImpl implements IAftersalesOrderService
{ {
@ -41,6 +46,8 @@ public class AftersalesOrderServiceImpl implements IAftersalesOrderService
@Autowired @Autowired
private ISysAttachFileService attachFileService; private ISysAttachFileService attachFileService;
@Autowired
private SysMakeOrderMapper sysMakeOrderMapper;
/** /**
* 查询售后单 * 查询售后单
@ -64,7 +71,8 @@ public class AftersalesOrderServiceImpl implements IAftersalesOrderService
public AftersalesOrder selectAftersalesOrderWithAttachById(Long aftersalesOrderId) public AftersalesOrder selectAftersalesOrderWithAttachById(Long aftersalesOrderId)
{ {
AftersalesOrder aftersalesOrder = aftersalesOrderMapper.selectAftersalesOrderWithAttachById(aftersalesOrderId); AftersalesOrder aftersalesOrder = aftersalesOrderMapper.selectAftersalesOrderWithAttachById(aftersalesOrderId);
String startDate = aftersalesOrder.getStartDate();
Date startDate = aftersalesOrder.getStartDate();
aftersalesOrder.setStartDate(startDate); aftersalesOrder.setStartDate(startDate);
return aftersalesOrder; return aftersalesOrder;
} }
@ -193,4 +201,38 @@ public class AftersalesOrderServiceImpl implements IAftersalesOrderService
return aftersalesOrderMapper.restoreAftersalesOrderById(aftersalesOrderId); return aftersalesOrderMapper.restoreAftersalesOrderById(aftersalesOrderId);
} }
/**
* 销售售后通知单 审核后生成售后单
* */
@Override
public void generateAftersalesOrderBySalesAftersalesNotice(SalesAftersalesNoticeVO tempSalesAftersalesNoticeVO) {
AftersalesOrder aftersalesOrder = new AftersalesOrder();
String salesOrderCode = tempSalesAftersalesNoticeVO.getSalesOrderCode();
SysMakeOrder sysMakeOrder = sysMakeOrderMapper.selectMakeOrderBySaleNo(salesOrderCode);
if (sysMakeOrder == null){
log.warn("与生产单号关联的销售单号为空:{}",salesOrderCode);
}
aftersalesOrder.setAftersalesOrderCode(tempSalesAftersalesNoticeVO.getAftersalesNoticeCode());
aftersalesOrder.setSalesOrderCode(salesOrderCode);
aftersalesOrder.setMakeNo(sysMakeOrder.getMakeNo());
aftersalesOrder.setBusinessName(tempSalesAftersalesNoticeVO.getBusinessMembers());
aftersalesOrder.setAftersalesName(tempSalesAftersalesNoticeVO.getApplyUser());
aftersalesOrder.setAftersalesStatus(tempSalesAftersalesNoticeVO.getAftersalesStatus());
aftersalesOrder.setCustomerId(tempSalesAftersalesNoticeVO.getEnterpriseCode());
aftersalesOrder.setCustomerName(tempSalesAftersalesNoticeVO.getEnterpriseName());
aftersalesOrder.setMaterialSum(tempSalesAftersalesNoticeVO.getMaterialSum());
aftersalesOrder.setEnterpriseSum(tempSalesAftersalesNoticeVO.getEnterpriseSum());
aftersalesOrder.setStartDate(tempSalesAftersalesNoticeVO.getStartTime());
aftersalesOrder.setDeliveryName(tempSalesAftersalesNoticeVO.getCustomerContact());
aftersalesOrder.setDeliveryNumber(tempSalesAftersalesNoticeVO.getContactNumber());
aftersalesOrder.setCompanyAddress(tempSalesAftersalesNoticeVO.getCompanyAddress());
aftersalesOrder.setCreateBy(tempSalesAftersalesNoticeVO.getCreateBy());
aftersalesOrder.setCreateTime(tempSalesAftersalesNoticeVO.getCreateTime());
aftersalesOrderMapper.insertAftersalesOrder(aftersalesOrder);
}
} }

10
ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesAftersalesNoticeController.java

@ -3,6 +3,7 @@ package com.ruoyi.sales.controller;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import com.ruoyi.aftersales.service.IAftersalesOrderService;
import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.sales.domain.VO.SalesAftersalesNoticeVO; import com.ruoyi.sales.domain.VO.SalesAftersalesNoticeVO;
import org.activiti.engine.RuntimeService; import org.activiti.engine.RuntimeService;
@ -51,6 +52,9 @@ public class SalesAftersalesNoticeController extends BaseController
@Autowired @Autowired
private IProcessService processService; private IProcessService processService;
@Autowired
private IAftersalesOrderService aftersalesOrderService;
@RequiresPermissions("sales:afterSalesNotice:view") @RequiresPermissions("sales:afterSalesNotice:view")
@GetMapping() @GetMapping()
@ -168,6 +172,12 @@ public class SalesAftersalesNoticeController extends BaseController
if (processIsFinish) { if (processIsFinish) {
// 审核通过 // 审核通过
aftersalesNoticeVO.setAuditStatus("1"); aftersalesNoticeVO.setAuditStatus("1");
String aftersalesNoticeCode = aftersalesNoticeVO.getAftersalesNoticeCode();
SalesAftersalesNoticeVO tempSalesAftersalesNoticeVO = salesAftersalesNoticeService.selectSalesAftersalesNoticeByCode(aftersalesNoticeCode);
//如果审核通过生成售后单
aftersalesOrderService.generateAftersalesOrderBySalesAftersalesNotice(tempSalesAftersalesNoticeVO);
// 提交 // 提交
if("submit".equals(instanceType)){ if("submit".equals(instanceType)){
// 使用状态-是 // 使用状态-是

14
ruoyi-admin/src/main/java/com/ruoyi/sales/domain/SalesAftersalesNotice.java

@ -66,7 +66,7 @@ public class SalesAftersalesNotice extends BaseEntity
/** 客户要求出发日期 */ /** 客户要求出发日期 */
@Excel(name = "客户要求出发日期") @Excel(name = "客户要求出发日期")
private String startTime; private Date startTime;
/** 联系人 */ /** 联系人 */
@Excel(name = "联系人") @Excel(name = "联系人")
@ -221,15 +221,15 @@ public class SalesAftersalesNotice extends BaseEntity
{ {
return enterpriseSum; return enterpriseSum;
} }
public void setStartTime(String startTime)
{
this.startTime = startTime;
}
public String getStartTime() public Date getStartTime() {
{
return startTime; return startTime;
} }
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public void setCustomerContact(String customerContact) public void setCustomerContact(String customerContact)
{ {
this.customerContact = customerContact; this.customerContact = customerContact;

5
ruoyi-admin/src/main/java/com/ruoyi/sales/mapper/SalesAftersalesNoticeMapper.java

@ -75,4 +75,9 @@ public interface SalesAftersalesNoticeMapper
* @return 结果 * @return 结果
*/ */
public int restoreSalesAftersalesNoticeById(Long aftersalesNoticeId); public int restoreSalesAftersalesNoticeById(Long aftersalesNoticeId);
/**
* 根据售后单号查询销售售后通知单
* */
SalesAftersalesNoticeVO selectSalesAftersalesNoticeByCode(String aftersalesNoticeCode);
} }

5
ruoyi-admin/src/main/java/com/ruoyi/sales/service/ISalesAftersalesNoticeService.java

@ -83,4 +83,9 @@ public interface ISalesAftersalesNoticeService
* 审批流程启动 * 审批流程启动
* */ * */
ProcessInstance submitApply(SalesAftersalesNotice salesAftersalesNotice); ProcessInstance submitApply(SalesAftersalesNotice salesAftersalesNotice);
/**
* 根据售后单号查询销售售后通知单
* */
SalesAftersalesNoticeVO selectSalesAftersalesNoticeByCode(String aftersalesNoticeCode);
} }

9
ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesAftersalesNoticeServiceImpl.java

@ -242,6 +242,15 @@ public class SalesAftersalesNoticeServiceImpl implements ISalesAftersalesNoticeS
return processInstance; return processInstance;
} }
/**
* 根据售后单号查询销售售后通知单
* */
@Override
public SalesAftersalesNoticeVO selectSalesAftersalesNoticeByCode(String aftersalesNoticeCode) {
return salesAftersalesNoticeMapper.selectSalesAftersalesNoticeByCode(aftersalesNoticeCode);
}
/** /**
* 创建售后单审核流程 * 创建售后单审核流程

6
ruoyi-admin/src/main/resources/mapper/sales/SalesAftersalesNoticeMapper.xml

@ -62,6 +62,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where aftersales_notice_id = #{aftersalesNoticeId} where aftersales_notice_id = #{aftersalesNoticeId}
</select> </select>
<select id="selectSalesAftersalesNoticeByCode" parameterType="String" resultMap="SalesAftersalesNoticeResult">
<include refid="selectSalesAftersalesNoticeVo"/>
where aftersales_notice_code = #{aftersalesNoticeCode}
</select>
<insert id="insertSalesAftersalesNotice" parameterType="SalesAftersalesNoticeVO" useGeneratedKeys="true" keyProperty="aftersalesNoticeId"> <insert id="insertSalesAftersalesNotice" parameterType="SalesAftersalesNoticeVO" useGeneratedKeys="true" keyProperty="aftersalesNoticeId">
insert into sales_aftersales_notice insert into sales_aftersales_notice
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

Loading…
Cancel
Save