|
@@ -0,0 +1,56 @@
|
|
|
+package com.fjhx.service.after.impl;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.fjhx.base.Condition;
|
|
|
+import com.fjhx.entity.after.AfterSalesDetails;
|
|
|
+import com.fjhx.entity.after.AfterSalesInfo;
|
|
|
+import com.fjhx.params.after.AfterSalesInfoEx;
|
|
|
+import com.fjhx.params.after.AfterSalesInfoVo;
|
|
|
+import com.fjhx.mapper.after.AfterSalesInfoMapper;
|
|
|
+import com.fjhx.service.after.AfterSalesDetailsService;
|
|
|
+import com.fjhx.service.after.AfterSalesInfoService;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.fjhx.utils.wrapperUtil.IWrapper;
|
|
|
+import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 售后信息 服务实现类
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author ${author}
|
|
|
+ * @since 2023-03-15
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class AfterSalesInfoServiceImpl extends ServiceImpl<AfterSalesInfoMapper, AfterSalesInfo> implements AfterSalesInfoService {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ AfterSalesDetailsService afterSalesDetailsService;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Page<AfterSalesInfoEx> getPage(Condition condition) {
|
|
|
+ IWrapper<AfterSalesInfo> wrapper = IWrapper.getWrapper(condition);
|
|
|
+ wrapper.eq(ObjectUtil.isNotEmpty(condition.getType()),"type",condition.getType());
|
|
|
+ wrapper.eq(ObjectUtil.isNotEmpty(condition.getStatus()),"status",condition.getStatus());
|
|
|
+ wrapper.like(ObjectUtil.isNotEmpty(condition.getKeyword()),"cause",condition.getStatus());
|
|
|
+ return baseMapper.getPage(condition.getPage(), wrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public void add(AfterSalesInfoVo afterSalesInfoVo) {
|
|
|
+ save(afterSalesInfoVo);
|
|
|
+ //保存售后明细
|
|
|
+ List<AfterSalesDetails> afterSalesDetailsList = afterSalesInfoVo.getAfterSalesDetailsList();
|
|
|
+ for (AfterSalesDetails afterSalesDetails: afterSalesDetailsList) {
|
|
|
+ afterSalesDetails.setAfterSalesInfoId(afterSalesInfoVo.getId());
|
|
|
+ }
|
|
|
+ afterSalesDetailsService.saveBatch(afterSalesDetailsList);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|