|
|
@@ -11,11 +11,8 @@ import com.dk.common.response.ResponseResultUtil;
|
|
|
import com.dk.common.response.ResponseResultVO;
|
|
|
import com.dk.mdm.infrastructure.convert.mst.CusFollowConvert;
|
|
|
import com.dk.mdm.infrastructure.util.AuthUtils;
|
|
|
-import com.dk.mdm.mapper.mst.CusFollowStaffMapper;
|
|
|
-import com.dk.mdm.mapper.mst.CustomerMapper;
|
|
|
-import com.dk.mdm.mapper.mst.StaffMapper;
|
|
|
+import com.dk.mdm.mapper.mst.*;
|
|
|
import com.dk.mdm.model.pojo.mst.*;
|
|
|
-import com.dk.mdm.mapper.mst.CusFollowMapper;
|
|
|
import com.dk.common.service.BaseService;
|
|
|
import com.dk.common.mapper.BaseMapper;
|
|
|
import com.dk.mdm.model.query.mst.CusFollowQuery;
|
|
|
@@ -72,6 +69,12 @@ public class CusFollowService extends BaseService<CusFollow> {
|
|
|
|
|
|
@Autowired
|
|
|
private MeasureReceiptService measureReceiptService;
|
|
|
+ @Autowired
|
|
|
+ private MeasureReceiptMapper measureReceiptMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private MeasureRoomMapper measureRoomMapper;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* @desc : 重写主键
|
|
|
@@ -100,6 +103,25 @@ public class CusFollowService extends BaseService<CusFollow> {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * @desc : 跟进id查询
|
|
|
+ * @author : 于继渤
|
|
|
+ * @date : 2023/1/5 9:39
|
|
|
+ */
|
|
|
+ public ResponseResultVO<CusFollowResponse> selectById(CusFollowQuery cusFollowQuery) {
|
|
|
+ CusFollowResponse cusFollowResponse = cusFollowMapper.selectByCond(cusFollowQuery).get(0);
|
|
|
+
|
|
|
+ if (cusFollowResponse.getFollowId() != null && cusFollowResponse.getMeasureStatus().equals(Constant.BasicDataConstant.MEASURE_STATUS_1.getValue())) {
|
|
|
+ //已量尺
|
|
|
+ MeasureReceipt measureReceipts = measureReceiptMapper.selectByFollowId(new MeasureReceipt().setFollowId(cusFollowResponse.getFollowId()));
|
|
|
+ cusFollowResponse.setMeasureReceipt(measureReceipts);
|
|
|
+ //查询 空间
|
|
|
+ List<MeasureRoom> measureRooms = measureRoomMapper.selectByReceiptId(new MeasureRoom().setReceiptId(measureReceipts.getReceiptId()));
|
|
|
+ cusFollowResponse.setMeasureRoomList(measureRooms);
|
|
|
+ }
|
|
|
+ return ResponseResultUtil.success(cusFollowResponse);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* @desc : 新建
|
|
|
* @author : 于继渤
|
|
|
* @date : 2023/1/5 9:39
|
|
|
@@ -434,30 +456,34 @@ public class CusFollowService extends BaseService<CusFollow> {
|
|
|
//更新客户信息
|
|
|
customerService.updateByUuid(customer);
|
|
|
} else {
|
|
|
- StaffEntity staff = authUtils.getStaff();
|
|
|
- Customer customer = new Customer();
|
|
|
- customer.setCusName(cusFollowVO.getCusName());
|
|
|
- customer.setCusPhone(cusFollowVO.getCusPhone());
|
|
|
- customer.setAddressName(cusFollowVO.getAddressName());
|
|
|
- customer.setAddressNo(cusFollowVO.getAddressNo());
|
|
|
- customer.setOrgId(cusFollowVO.getFollowOrg());
|
|
|
- customer.setAddressFull(cusFollowVO.getAddressFull());
|
|
|
- customer.setAddressArea(cusFollowVO.getAddressArea());
|
|
|
- customer.setSaleStatus(cusFollowVO.getSaleStatus());
|
|
|
- customer.setAddressGcj02(cusFollowVO.getAddressGcj02());
|
|
|
- customer.setReportStaff(cusFollowVO.getFollowStaff());
|
|
|
- customer.setReportTime(LocalDateTime.now());
|
|
|
- customer.setCpId(staff.getCpId());
|
|
|
- List<String> list = new ArrayList<>();
|
|
|
- list.add(staff.getStaffId());
|
|
|
- customer.setFollowStaffs(list);
|
|
|
- customer.setSaleStatus("客成状态-潜客");
|
|
|
- customer.setChannelId(cusFollowVO.getChannelId());
|
|
|
- Map<String, Object> customerNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.CUSTOMER.getName(), true);
|
|
|
- customer.setCusId(customerNoteCode.get("outId").toString());
|
|
|
- //新建客户
|
|
|
- customerMapper.insert(customer);
|
|
|
- cusFollow.setCusId(customer.getCusId());
|
|
|
+ //不是陌生接待
|
|
|
+ if(!cusFollowVO.getFollowStatus().equals(Constant.BasicDataConstant.FOLLOW_STATUS_4.getValue())){
|
|
|
+ StaffEntity staff = authUtils.getStaff();
|
|
|
+ Customer customer = new Customer();
|
|
|
+ customer.setCusName(cusFollowVO.getCusName());
|
|
|
+ customer.setCusPhone(cusFollowVO.getCusPhone());
|
|
|
+ customer.setAddressName(cusFollowVO.getAddressName());
|
|
|
+ customer.setAddressNo(cusFollowVO.getAddressNo());
|
|
|
+ customer.setOrgId(cusFollowVO.getFollowOrg());
|
|
|
+ customer.setAddressFull(cusFollowVO.getAddressFull());
|
|
|
+ customer.setAddressArea(cusFollowVO.getAddressArea());
|
|
|
+ customer.setSaleStatus(cusFollowVO.getSaleStatus());
|
|
|
+ customer.setAddressGcj02(cusFollowVO.getAddressGcj02());
|
|
|
+ customer.setReportStaff(cusFollowVO.getFollowStaff());
|
|
|
+ customer.setReportTime(LocalDateTime.now());
|
|
|
+ customer.setCpId(staff.getCpId());
|
|
|
+ List<String> list = new ArrayList<>();
|
|
|
+ list.add(staff.getStaffId());
|
|
|
+ customer.setFollowStaffs(list);
|
|
|
+ customer.setSaleStatus("客成状态-潜客");
|
|
|
+ customer.setChannelId(cusFollowVO.getChannelId());
|
|
|
+ Map<String, Object> customerNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.CUSTOMER.getName(), true);
|
|
|
+ customer.setCusId(customerNoteCode.get("outId").toString());
|
|
|
+ //新建客户
|
|
|
+ customerMapper.insert(customer);
|
|
|
+ cusFollow.setCusId(customer.getCusId());
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
//更新总单
|
|
|
super.updateByUuid(cusFollow);
|