|
@@ -2,11 +2,18 @@ package com.ygj.yuemum.service.distributionchannel;
|
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
+import com.ygj.yuemum.component.Constant;
|
|
import com.ygj.yuemum.dao.distributionchannel.DcIntroducerDao;
|
|
import com.ygj.yuemum.dao.distributionchannel.DcIntroducerDao;
|
|
|
|
+import com.ygj.yuemum.domain.distributionchannel.DcIntroduceLog;
|
|
import com.ygj.yuemum.domain.distributionchannel.DcIntroducer;
|
|
import com.ygj.yuemum.domain.distributionchannel.DcIntroducer;
|
|
|
|
+import com.ygj.yuemum.domain.distributionchannel.DcIntroducerExtract;
|
|
|
|
+import com.ygj.yuemum.domain.distributionchannel.DcIntroducerRelation;
|
|
|
|
+import com.ygj.yuemum.domain.order.YSOrder;
|
|
|
|
+import com.ygj.yuemum.service.order.YSOrderService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.io.File;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -16,6 +23,15 @@ public class DcIntroducerService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private DcIntroducerDao dcIntroducerDao;
|
|
private DcIntroducerDao dcIntroducerDao;
|
|
|
|
+ @Autowired
|
|
|
|
+ private YSOrderService ysOrderService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private DcIntroduceLogService dcIntroduceLogService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private DcIntroducerExtractService dcIntroducerExtractService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private DcIntroducerRelationService dcIntroducerRelationService;
|
|
|
|
+ public static final String imgbankcard = Constant.IMGBANKCARD;
|
|
|
|
|
|
//分页
|
|
//分页
|
|
public Map<String, Object> getDcIntroducers(int page, int limit) {
|
|
public Map<String, Object> getDcIntroducers(int page, int limit) {
|
|
@@ -46,12 +62,41 @@ public class DcIntroducerService {
|
|
}
|
|
}
|
|
|
|
|
|
public int updateDcIntroducer(DcIntroducer dcIntroducer) {
|
|
public int updateDcIntroducer(DcIntroducer dcIntroducer) {
|
|
- return dcIntroducerDao.updateDcIntroducer(dcIntroducer);
|
|
|
|
|
|
+ //更新介绍人信息,更新介绍人日志信息,更新订单推荐人信息
|
|
|
|
+ try {
|
|
|
|
+ //订单表
|
|
|
|
+ YSOrder ysOrder = new YSOrder();
|
|
|
|
+ ysOrder.setOd_introducer_phone(dcIntroducer.getWv_phone());
|
|
|
|
+ ysOrder.setOd_introducer_phoneOld(dcIntroducer.getWv_phoneOld());
|
|
|
|
+ ysOrderService.updateDCPhone(ysOrder);
|
|
|
|
+ //介绍人日志表
|
|
|
|
+ DcIntroduceLog dcIntroduceLog = new DcIntroduceLog();
|
|
|
|
+ dcIntroduceLog.setXul_introducer_phone(dcIntroducer.getWv_phone());
|
|
|
|
+ dcIntroduceLog.setXul_introducer_phoneOld(dcIntroducer.getWv_phoneOld());
|
|
|
|
+ dcIntroduceLogService.updateDcIntroduceLogByPhone(dcIntroduceLog);
|
|
|
|
+ //介绍人提现表
|
|
|
|
+ DcIntroducerExtract dcIntroducerExtract = new DcIntroducerExtract();
|
|
|
|
+ dcIntroducerExtract.setWue_phone(dcIntroducer.getWv_phone());
|
|
|
|
+ dcIntroducerExtract.setWue_phoneOld(dcIntroducer.getWv_phoneOld());
|
|
|
|
+ dcIntroducerExtractService.updateIEByPhoneChange(dcIntroducerExtract);
|
|
|
|
+ //介绍人顾问关系表
|
|
|
|
+ DcIntroducerRelation dcIntroducerRelation = new DcIntroducerRelation();
|
|
|
|
+ dcIntroducerRelation.setDig_introducer_phone(dcIntroducer.getWv_phone());
|
|
|
|
+ dcIntroducerRelation.setDig_introducer_phoneOld(dcIntroducer.getWv_phoneOld());
|
|
|
|
+ dcIntroducerRelationService.updateIRByPhoneChange(dcIntroducerRelation);
|
|
|
|
+ //介绍人表
|
|
|
|
+ dcIntroducerDao.updateDcIntroducer(dcIntroducer);
|
|
|
|
+ } catch (Exception ex) {
|
|
|
|
+ ex.printStackTrace();
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ return 1;
|
|
}
|
|
}
|
|
|
|
|
|
public int updateAccountNumber(DcIntroducer dcIntroducer) {
|
|
public int updateAccountNumber(DcIntroducer dcIntroducer) {
|
|
return dcIntroducerDao.updateAccountNumber(dcIntroducer);
|
|
return dcIntroducerDao.updateAccountNumber(dcIntroducer);
|
|
}
|
|
}
|
|
|
|
+
|
|
public List<DcIntroducer> queryDcIntroducersByUser(String xul_phone) {
|
|
public List<DcIntroducer> queryDcIntroducersByUser(String xul_phone) {
|
|
return dcIntroducerDao.queryDcIntroducersByUser(xul_phone);
|
|
return dcIntroducerDao.queryDcIntroducersByUser(xul_phone);
|
|
}
|
|
}
|
|
@@ -61,4 +106,21 @@ public class DcIntroducerService {
|
|
return dcIntroducerDao.checkDcIntroducers(wv_phone);
|
|
return dcIntroducerDao.checkDcIntroducers(wv_phone);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public int delAccountNumber(String wv_phone) {
|
|
|
|
+ try {
|
|
|
|
+ DcIntroducer dcIntroducer = dcIntroducerDao.checkDcIntroducers(wv_phone);
|
|
|
|
+ String fName = dcIntroducer.getWv_account_number_path().trim();
|
|
|
|
+ String temp[] = fName.split("/");
|
|
|
|
+ String fileName = temp[temp.length - 1];
|
|
|
|
+ String path = imgbankcard + "/" + fileName;
|
|
|
|
+ File dest = new File(path);
|
|
|
|
+ dest.delete();
|
|
|
|
+ dcIntroducerDao.delAccountNumber(wv_phone);
|
|
|
|
+ } catch (Exception ex) {
|
|
|
|
+ ex.printStackTrace();
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|