|
@@ -8,9 +8,7 @@ import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
import com.fdkankan.sale.common.CacheUtil;
|
|
import com.fdkankan.sale.common.CacheUtil;
|
|
import com.fdkankan.sale.common.FilePath;
|
|
import com.fdkankan.sale.common.FilePath;
|
|
import com.fdkankan.sale.common.ResultCode;
|
|
import com.fdkankan.sale.common.ResultCode;
|
|
-import com.fdkankan.sale.entity.Customer;
|
|
|
|
-import com.fdkankan.sale.entity.MailTemplate;
|
|
|
|
-import com.fdkankan.sale.entity.RepairInvoice;
|
|
|
|
|
|
+import com.fdkankan.sale.entity.*;
|
|
import com.fdkankan.sale.exception.BusinessException;
|
|
import com.fdkankan.sale.exception.BusinessException;
|
|
import com.fdkankan.sale.mapper.IRepairInvoiceMapper;
|
|
import com.fdkankan.sale.mapper.IRepairInvoiceMapper;
|
|
import com.fdkankan.sale.service.*;
|
|
import com.fdkankan.sale.service.*;
|
|
@@ -18,6 +16,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.fdkankan.sale.vo.request.RepairInvoiceParam;
|
|
import com.fdkankan.sale.vo.request.RepairInvoiceParam;
|
|
import com.fdkankan.sale.vo.response.RepairInvoiceVo;
|
|
import com.fdkankan.sale.vo.response.RepairInvoiceVo;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -58,6 +57,25 @@ public class RepairInvoiceServiceImpl extends ServiceImpl<IRepairInvoiceMapper,
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ public void invoiceRegister(RepairInvoice param, Long userId) {
|
|
|
|
+ if(StringUtils.isBlank(param.getRepairId()) ){
|
|
|
|
+ throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
|
+ }
|
|
|
|
+ Repair repair = repairService.getById(param.getRepairId());
|
|
|
|
+ if(repair == null){
|
|
|
|
+ throw new BusinessException(ResultCode.ORDER_PAY_NOT_EXITS);
|
|
|
|
+ }
|
|
|
|
+ RepairInvoice repairInvoice = this.getByRepairId(param.getRepairId());
|
|
|
|
+ if(repairInvoice !=null){
|
|
|
|
+ throw new BusinessException(ResultCode.ORDER_INVOICE_EXITS);
|
|
|
|
+ }
|
|
|
|
+ repairInvoice = new RepairInvoice();
|
|
|
|
+ BeanUtils.copyProperties(param,repairInvoice);
|
|
|
|
+ this.save(repairInvoice);
|
|
|
|
+ repairService.updateRepairInvoiceStatus(repair.getRepairId(),1);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
public void open(RepairInvoice param, Long userId) {
|
|
public void open(RepairInvoice param, Long userId) {
|
|
if(param.getInvoiceId() == null ){
|
|
if(param.getInvoiceId() == null ){
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|