Browse Source

[fix] 售后管理 销售管理

修改售后通知单和售后单的客户要求出发日期类型为Date类型
新增 根据售后单号查询销售售后通知单后端接口
新增 销售售后通知单审批通过后生产售后单后端接口
新增根据销售单号查询生产订单后端接口
dev
liuxiaoxu 4 months ago
parent
commit
22a1795593
  1. 16
      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. 16
      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. 8
      ruoyi-admin/src/main/resources/mapper/sales/SalesAftersalesNoticeMapper.xml

16
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")
@Excel(name = "客户要求出发日期", width = 30, dateFormat = "yyyy-MM-dd")
private String startDate;
private Date startDate;
/** 收货联系人 */
@Excel(name = "收货联系人")
@ -261,16 +261,16 @@ public class AftersalesOrder extends BaseEntity
{
return enterpriseSum;
}
public void setStartDate(String startDate)
{
this.startDate = startDate;
}
public String getStartDate()
{
public Date getStartDate() {
return startDate;
}
public void setDeliveryName(String deliveryName)
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public void setDeliveryName(String 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 com.ruoyi.aftersales.domain.AftersalesOrder;
import com.ruoyi.sales.domain.VO.SalesAftersalesNoticeVO;
import org.activiti.engine.runtime.ProcessInstance;
/**
@ -83,4 +84,8 @@ public interface IAftersalesOrderService
*/
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.process.general.service.IProcessService;
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.SysMakeOrder;
import com.ruoyi.system.mapper.SysAttachMapper;
import com.ruoyi.system.mapper.SysMakeOrderMapper;
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 lombok.extern.slf4j.Slf4j;
import org.activiti.engine.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -29,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
* @author 刘晓旭
* @date 2024-04-24
*/
@Slf4j
@Service
public class AftersalesOrderServiceImpl implements IAftersalesOrderService
{
@ -41,6 +46,8 @@ public class AftersalesOrderServiceImpl implements IAftersalesOrderService
@Autowired
private ISysAttachFileService attachFileService;
@Autowired
private SysMakeOrderMapper sysMakeOrderMapper;
/**
* 查询售后单
@ -64,7 +71,8 @@ public class AftersalesOrderServiceImpl implements IAftersalesOrderService
public AftersalesOrder selectAftersalesOrderWithAttachById(Long aftersalesOrderId)
{
AftersalesOrder aftersalesOrder = aftersalesOrderMapper.selectAftersalesOrderWithAttachById(aftersalesOrderId);
String startDate = aftersalesOrder.getStartDate();
Date startDate = aftersalesOrder.getStartDate();
aftersalesOrder.setStartDate(startDate);
return aftersalesOrder;
}
@ -193,4 +201,38 @@ public class AftersalesOrderServiceImpl implements IAftersalesOrderService
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.List;
import com.ruoyi.aftersales.service.IAftersalesOrderService;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.sales.domain.VO.SalesAftersalesNoticeVO;
import org.activiti.engine.RuntimeService;
@ -51,6 +52,9 @@ public class SalesAftersalesNoticeController extends BaseController
@Autowired
private IProcessService processService;
@Autowired
private IAftersalesOrderService aftersalesOrderService;
@RequiresPermissions("sales:afterSalesNotice:view")
@GetMapping()
@ -168,6 +172,12 @@ public class SalesAftersalesNoticeController extends BaseController
if (processIsFinish) {
// 审核通过
aftersalesNoticeVO.setAuditStatus("1");
String aftersalesNoticeCode = aftersalesNoticeVO.getAftersalesNoticeCode();
SalesAftersalesNoticeVO tempSalesAftersalesNoticeVO = salesAftersalesNoticeService.selectSalesAftersalesNoticeByCode(aftersalesNoticeCode);
//如果审核通过生成售后单
aftersalesOrderService.generateAftersalesOrderBySalesAftersalesNotice(tempSalesAftersalesNoticeVO);
// 提交
if("submit".equals(instanceType)){
// 使用状态-是

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

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

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

@ -75,4 +75,9 @@ public interface SalesAftersalesNoticeMapper
* @return 结果
*/
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);
/**
* 根据售后单号查询销售售后通知单
* */
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;
}
/**
* 根据售后单号查询销售售后通知单
* */
@Override
public SalesAftersalesNoticeVO selectSalesAftersalesNoticeByCode(String aftersalesNoticeCode) {
return salesAftersalesNoticeMapper.selectSalesAftersalesNoticeByCode(aftersalesNoticeCode);
}
/**
* 创建售后单审核流程

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

@ -61,7 +61,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectSalesAftersalesNoticeVo"/>
where aftersales_notice_id = #{aftersalesNoticeId}
</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 into sales_aftersales_notice
<trim prefix="(" suffix=")" suffixOverrides=",">

Loading…
Cancel
Save