|
@ -1,5 +1,7 @@ |
|
|
package com.ruoyi.aftersales.service.impl; |
|
|
package com.ruoyi.aftersales.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDate; |
|
|
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import com.ruoyi.common.utils.DateUtils; |
|
|
import com.ruoyi.common.utils.DateUtils; |
|
|
import com.ruoyi.common.utils.ShiroUtils; |
|
|
import com.ruoyi.common.utils.ShiroUtils; |
|
@ -13,6 +15,7 @@ import com.ruoyi.aftersales.mapper.AftersalesComplaintNoticeMapper; |
|
|
import com.ruoyi.aftersales.domain.AftersalesComplaintNotice; |
|
|
import com.ruoyi.aftersales.domain.AftersalesComplaintNotice; |
|
|
import com.ruoyi.aftersales.service.IAftersalesComplaintNoticeService; |
|
|
import com.ruoyi.aftersales.service.IAftersalesComplaintNoticeService; |
|
|
import com.ruoyi.common.core.text.Convert; |
|
|
import com.ruoyi.common.core.text.Convert; |
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 售后客诉通知单Service业务层处理 |
|
|
* 售后客诉通知单Service业务层处理 |
|
@ -60,9 +63,14 @@ public class AftersalesComplaintNoticeServiceImpl implements IAftersalesComplain |
|
|
* @param aftersalesComplaintNotice 售后客诉通知单 |
|
|
* @param aftersalesComplaintNotice 售后客诉通知单 |
|
|
* @return 结果 |
|
|
* @return 结果 |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
@Transactional |
|
|
@Override |
|
|
@Override |
|
|
public int insertAftersalesComplaintNotice(AftersalesComplaintNotice aftersalesComplaintNotice) |
|
|
public int insertAftersalesComplaintNotice(AftersalesComplaintNotice aftersalesComplaintNotice) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
// 生成complaintNoticeCode
|
|
|
|
|
|
String complaintNoticeCode = generateComplainNoticeCode(); |
|
|
|
|
|
aftersalesComplaintNotice.setComplaintNoticeCode(complaintNoticeCode); |
|
|
String loginName = ShiroUtils.getLoginName(); |
|
|
String loginName = ShiroUtils.getLoginName(); |
|
|
aftersalesComplaintNotice.setCreateBy(loginName); |
|
|
aftersalesComplaintNotice.setCreateBy(loginName); |
|
|
aftersalesComplaintNotice.setCreateTime(DateUtils.getNowDate()); |
|
|
aftersalesComplaintNotice.setCreateTime(DateUtils.getNowDate()); |
|
@ -144,4 +152,17 @@ public class AftersalesComplaintNoticeServiceImpl implements IAftersalesComplain |
|
|
} |
|
|
} |
|
|
return sysMakeOrders; |
|
|
return sysMakeOrders; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 按照特定编码生成complaintNoticeCode |
|
|
|
|
|
* */ |
|
|
|
|
|
private String generateComplainNoticeCode(){ |
|
|
|
|
|
LocalDate currentDate = LocalDate.now(); |
|
|
|
|
|
String formatDate = currentDate.format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
|
|
|
|
|
//查询今天已经生成的最大序号
|
|
|
|
|
|
int maxSequenceForToday = aftersalesComplaintNoticeMapper.getMaxSequenceForToday(formatDate); |
|
|
|
|
|
//序号自增如果是当天第一条,则序号为001
|
|
|
|
|
|
String sequence =String.format("%03d",maxSequenceForToday+1); |
|
|
|
|
|
return "KS"+formatDate+sequence; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|