Explorar el Código

1.介绍人管理
2.免单季接口调用调整
3.单顾问只能看自己的订单,增加权限控制

Shanks hace 6 años
padre
commit
ba5e7bdb74
Se han modificado 28 ficheros con 383 adiciones y 36 borrados
  1. 7 0
      src/main/java/com/ygj/yuemum/controller/distributionchannel/DcIntroduceLogController.java
  2. 8 4
      src/main/java/com/ygj/yuemum/controller/distributionchannel/DcIntroducerController.java
  3. 6 6
      src/main/java/com/ygj/yuemum/controller/distributionchannel/MdjCalculate.java
  4. 4 0
      src/main/java/com/ygj/yuemum/dao/distributionchannel/DcIntroduceLogDao.java
  5. 2 0
      src/main/java/com/ygj/yuemum/dao/distributionchannel/DcIntroducerDao.java
  6. 1 1
      src/main/java/com/ygj/yuemum/dao/distributionchannel/DcIntroducerExtractDao.java
  7. 2 0
      src/main/java/com/ygj/yuemum/dao/distributionchannel/DcIntroducerRelationDao.java
  8. 2 0
      src/main/java/com/ygj/yuemum/dao/order/YSOrderDao.java
  9. 9 0
      src/main/java/com/ygj/yuemum/domain/admin/JlAdminRole.java
  10. 9 0
      src/main/java/com/ygj/yuemum/domain/admin/JlAdminUser.java
  11. 19 0
      src/main/java/com/ygj/yuemum/domain/distributionchannel/DcIntroduceLog.java
  12. 17 0
      src/main/java/com/ygj/yuemum/domain/distributionchannel/DcIntroducer.java
  13. 10 0
      src/main/java/com/ygj/yuemum/domain/distributionchannel/DcIntroducerExtract.java
  14. 9 0
      src/main/java/com/ygj/yuemum/domain/distributionchannel/DcIntroducerRelation.java
  15. 18 0
      src/main/java/com/ygj/yuemum/domain/order/YSOrder.java
  16. 14 0
      src/main/java/com/ygj/yuemum/service/distributionchannel/DcIntroduceLogService.java
  17. 3 0
      src/main/java/com/ygj/yuemum/service/distributionchannel/DcIntroducerExtractService.java
  18. 4 0
      src/main/java/com/ygj/yuemum/service/distributionchannel/DcIntroducerRelationService.java
  19. 63 1
      src/main/java/com/ygj/yuemum/service/distributionchannel/DcIntroducerService.java
  20. 19 9
      src/main/java/com/ygj/yuemum/service/ocr/BaiDuInfoServices.java
  21. 9 6
      src/main/java/com/ygj/yuemum/service/order/YSOrderService.java
  22. 16 6
      src/main/resources/mybatis/mapper/admin/JlAdminRoleMapper.xml
  23. 20 1
      src/main/resources/mybatis/mapper/admin/JlAdminUserMapper.xml
  24. 49 0
      src/main/resources/mybatis/mapper/distributionchannel/DcIntroduceLogMapper.xml
  25. 11 0
      src/main/resources/mybatis/mapper/distributionchannel/DcIntroducerExtractMapper.xml
  26. 27 1
      src/main/resources/mybatis/mapper/distributionchannel/DcIntroducerMapper.xml
  27. 9 0
      src/main/resources/mybatis/mapper/distributionchannel/DcIntroducerRelationMapper.xml
  28. 16 1
      src/main/resources/mybatis/mapper/order/YSOrder.xml

+ 7 - 0
src/main/java/com/ygj/yuemum/controller/distributionchannel/DcIntroduceLogController.java

@@ -23,6 +23,13 @@ public class DcIntroduceLogController {
         return jso;
     }
 
+    @PostMapping ("/queryDcILbyrebate")
+    public String queryDcILbyrebate(@ModelAttribute DcIntroduceLog dcIntroduceLog) {
+        Map<String, Object> queryDcIntroduceLogs = dcIntroduceLogService.queryDcILbyrebate(dcIntroduceLog);
+        String jso = JSONObject.toJSONString(queryDcIntroduceLogs);
+        return jso;
+    }
+
     @PostMapping("/insertDcIntroduceLog")
     public int insertDcIntroduceLog(@ModelAttribute DcIntroduceLog dcIntroduceLog) {
         return dcIntroduceLogService.insertDcIntroduceLog(dcIntroduceLog);

+ 8 - 4
src/main/java/com/ygj/yuemum/controller/distributionchannel/DcIntroducerController.java

@@ -41,13 +41,17 @@ public class DcIntroducerController {
     }
 
     @PostMapping("/insertDcIntroducer")
-    public int insertDcIntroducer(@ModelAttribute DcIntroducer wxVip) {
-        return dcIntroducerService.insertDcIntroducer(wxVip);
+    public int insertDcIntroducer(@ModelAttribute DcIntroducer dcIntroducer) {
+        return dcIntroducerService.insertDcIntroducer(dcIntroducer);
     }
 
     @PostMapping("/updateDcIntroducer")
-    public int updateDcIntroducer(@ModelAttribute DcIntroducer wxVip) {
-        return dcIntroducerService.updateDcIntroducer(wxVip);
+    public int updateDcIntroducer(@ModelAttribute DcIntroducer dcIntroducer) {
+        return dcIntroducerService.updateDcIntroducer(dcIntroducer);
+    }
+    @GetMapping("/delAccountNumber")
+    public int delAccountNumber(@RequestParam("wv_phone")  String wv_phone) {
+        return dcIntroducerService.delAccountNumber(wv_phone);
     }
 
 }

+ 6 - 6
src/main/java/com/ygj/yuemum/controller/distributionchannel/MdjCalculate.java

@@ -24,13 +24,13 @@ public class MdjCalculate {
         CloseableHttpClient client = HttpClients.createDefault();
         String respContent = null;
         JSONObject jsonParam = new JSONObject();
-        jsonParam.put("odCityCode", "js");
-        jsonParam.put("odAmount", 10000);
-        jsonParam.put("odNo", "YS20181129150999");
-        jsonParam.put("odPhone", "15295794045");
+        jsonParam.put("odCityCode", mdjCalculateOrder.getOdCityCode());
+        jsonParam.put("odAmount", mdjCalculateOrder.getOdAmount());
+        jsonParam.put("odNo", mdjCalculateOrder.getOdAmount());
+        jsonParam.put("odPhone", mdjCalculateOrder.getOdPhone());
         jsonParam.put("odStatus", 1);
-        jsonParam.put("odIntroducerPhone", "15295795404");
-        jsonParam.put("odProductItem", "item_1");
+        jsonParam.put("odIntroducerPhone", mdjCalculateOrder.getOdIntroducerPhone());
+        jsonParam.put("odProductItem", mdjCalculateOrder.getOdProductItem());
         StringEntity entity = new StringEntity(jsonParam.toString(),"utf-8");//解决中文乱码问题
         entity.setContentEncoding("UTF-8");
         entity.setContentType("application/json");

+ 4 - 0
src/main/java/com/ygj/yuemum/dao/distributionchannel/DcIntroduceLogDao.java

@@ -15,8 +15,12 @@ public interface DcIntroduceLogDao {
 
     int checkFirstDILogs (DcIntroduceLog dcIntroduceLog);
 
+    int updateDcIntroduceLogByPhone (DcIntroduceLog dcIntroduceLog);
+
     List<DcIntroduceLog> queryDcIntroduceLogs(DcIntroduceLog dcIntroduceLog);
 
+    List<DcIntroduceLog> queryDcILbyrebate(DcIntroduceLog dcIntroduceLog);
+
     List<DcIntroduceLog> getDcIntroduceLogs(String phone);
 
 

+ 2 - 0
src/main/java/com/ygj/yuemum/dao/distributionchannel/DcIntroducerDao.java

@@ -21,5 +21,7 @@ public interface DcIntroducerDao {
 
     DcIntroducer checkDcIntroducers(String wv_phone);
 
+    int delAccountNumber(String wv_phone);
+
 
 }

+ 1 - 1
src/main/java/com/ygj/yuemum/dao/distributionchannel/DcIntroducerExtractDao.java

@@ -12,7 +12,7 @@ public interface DcIntroducerExtractDao {
     List<DcIntroducerExtract> date_DcIntroducerExtracts(String applydate);
     DcIntroducerExtract queryOneDcIntroducerExtract(Integer id);
     int updateDcIntroducerExtract(DcIntroducerExtract dcIntroducerExtract);
-
+    int updateIEByPhoneChange(DcIntroducerExtract dcIntroducerExtract);
     int insertDcIntroducerExtract(DcIntroducerExtract dcIntroducerExtract);
     int getAESeq ();
 

+ 2 - 0
src/main/java/com/ygj/yuemum/dao/distributionchannel/DcIntroducerRelationDao.java

@@ -12,5 +12,7 @@ public interface DcIntroducerRelationDao {
 
     int insertDcIntroducerRelation(DcIntroducerRelation dcIntroducerRelation);
 
+    int updateIRByPhoneChange(DcIntroducerRelation dcIntroducerRelation);
+
 
 }

+ 2 - 0
src/main/java/com/ygj/yuemum/dao/order/YSOrderDao.java

@@ -22,6 +22,8 @@ public interface YSOrderDao {
 
     int updateYsOrderStatus(YSOrder ysOrder);
 
+    int updateDCPhone (YSOrder ysOrder);
+
     YSOrder selectByOdNo(String od_no);
 
     YSOrder selectByPrimaryKey(Integer id);

+ 9 - 0
src/main/java/com/ygj/yuemum/domain/admin/JlAdminRole.java

@@ -3,10 +3,19 @@ package com.ygj.yuemum.domain.admin;
 public class JlAdminRole {
     private String id;
     private String jr_rolename;
+    private Integer jl_visit_my_order;
     private Integer page;
     private Integer limit;
     private String permissions;
 
+    public Integer getJl_visit_my_order() {
+        return jl_visit_my_order;
+    }
+
+    public void setJl_visit_my_order(Integer jl_visit_my_order) {
+        this.jl_visit_my_order = jl_visit_my_order;
+    }
+
     public String getPermissions() {
         return permissions;
     }

+ 9 - 0
src/main/java/com/ygj/yuemum/domain/admin/JlAdminUser.java

@@ -12,6 +12,7 @@ public class JlAdminUser {
     private Date last_login_time;
     private String last_login_ip;
     private Integer role;
+    private Integer isvisit;
     private Integer status;
     private Integer org;
     private String last_login_location;
@@ -29,6 +30,14 @@ public class JlAdminUser {
     private Integer limit;
     private String cityname;
 
+    public Integer getIsvisit() {
+        return isvisit;
+    }
+
+    public void setIsvisit(Integer isvisit) {
+        this.isvisit = isvisit;
+    }
+
     public String getCityname() {
         return cityname;
     }

+ 19 - 0
src/main/java/com/ygj/yuemum/domain/distributionchannel/DcIntroduceLog.java

@@ -11,9 +11,28 @@ public class DcIntroduceLog {
     private Integer xul_event;
     private String xul_date;
     private String xul_introducer_phone;
+    private String xul_introducer_phoneOld;
+    private Integer od_rebate_amount;
     private Integer xul_pm_type;
     private String xul_orderno;
 
+
+    public Integer getOd_rebate_amount() {
+        return od_rebate_amount;
+    }
+
+    public void setOd_rebate_amount(Integer od_rebate_amount) {
+        this.od_rebate_amount = od_rebate_amount;
+    }
+
+    public String getXul_introducer_phoneOld() {
+        return xul_introducer_phoneOld;
+    }
+
+    public void setXul_introducer_phoneOld(String xul_introducer_phoneOld) {
+        this.xul_introducer_phoneOld = xul_introducer_phoneOld;
+    }
+
     public Integer getPage() {
         return page;
     }

+ 17 - 0
src/main/java/com/ygj/yuemum/domain/distributionchannel/DcIntroducer.java

@@ -4,6 +4,7 @@ public class DcIntroducer {
 
     private Integer id;
     private String wv_phone;
+    private String wv_phoneOld;
     private Integer wv_gradeid;
     private Double wv_Introduction_total;
     private Double wv_withdraw_total;
@@ -15,12 +16,28 @@ public class DcIntroducer {
     private Integer wv_contract_count;
     private Integer wv_finish_count;
     private Integer wv_consultant;
+    private String wv_consultantname;
     private String wv_account_number;
     private String wv_account_bank;
     private String wv_account_number_path;
     private Integer page;
     private Integer limit;
 
+    public String getWv_phoneOld() {
+        return wv_phoneOld;
+    }
+
+    public void setWv_phoneOld(String wv_phoneOld) {
+        this.wv_phoneOld = wv_phoneOld;
+    }
+
+    public String getWv_consultantname() {
+        return wv_consultantname;
+    }
+
+    public void setWv_consultantname(String wv_consultantname) {
+        this.wv_consultantname = wv_consultantname;
+    }
 
     public Integer getId() {
         return id;

+ 10 - 0
src/main/java/com/ygj/yuemum/domain/distributionchannel/DcIntroducerExtract.java

@@ -4,6 +4,7 @@ public class DcIntroducerExtract {
 
     private Integer id;
     private String wue_phone;
+    private String wue_phoneOld;
     private String wue_bank_card;
     private String wue_orderno;
     private Integer wue_type;
@@ -17,6 +18,15 @@ public class DcIntroducerExtract {
     private Integer page;
     private Integer limit;
 
+
+    public String getWue_phoneOld() {
+        return wue_phoneOld;
+    }
+
+    public void setWue_phoneOld(String wue_phoneOld) {
+        this.wue_phoneOld = wue_phoneOld;
+    }
+
     public String getWue_remarks() {
         return wue_remarks;
     }

+ 9 - 0
src/main/java/com/ygj/yuemum/domain/distributionchannel/DcIntroducerRelation.java

@@ -3,8 +3,17 @@ package com.ygj.yuemum.domain.distributionchannel;
 public class DcIntroducerRelation {
     private Integer id;
     private String dig_introducer_phone;
+    private String dig_introducer_phoneOld;
     private Integer dig_consultant_id;
 
+    public String getDig_introducer_phoneOld() {
+        return dig_introducer_phoneOld;
+    }
+
+    public void setDig_introducer_phoneOld(String dig_introducer_phoneOld) {
+        this.dig_introducer_phoneOld = dig_introducer_phoneOld;
+    }
+
     public Integer getId() {
         return id;
     }

+ 18 - 0
src/main/java/com/ygj/yuemum/domain/order/YSOrder.java

@@ -20,6 +20,7 @@ public class YSOrder {
     private Integer od_consultantid;
     private String od_consultantname;
     private String od_introducer_phone;
+    private String od_introducer_phoneOld;
     private Integer od_introducer_consultant;
     private Integer od_order_amount;
     private Integer od_order_pay_amount;
@@ -37,6 +38,23 @@ public class YSOrder {
     private String od_username;
     private String od_date;
     private String od_product_name;
+    private String od_product_img;
+
+    public String getOd_introducer_phoneOld() {
+        return od_introducer_phoneOld;
+    }
+
+    public void setOd_introducer_phoneOld(String od_introducer_phoneOld) {
+        this.od_introducer_phoneOld = od_introducer_phoneOld;
+    }
+
+    public String getOd_product_img() {
+        return od_product_img;
+    }
+
+    public void setOd_product_img(String od_product_img) {
+        this.od_product_img = od_product_img;
+    }
 
     private Integer page;
     private Integer limit;

+ 14 - 0
src/main/java/com/ygj/yuemum/service/distributionchannel/DcIntroduceLogService.java

@@ -35,6 +35,17 @@ public class DcIntroduceLogService {
         return tableData;
     }
 
+    public Map<String, Object> queryDcILbyrebate(DcIntroduceLog dcIntroduceLog) {
+        PageHelper.startPage(dcIntroduceLog.getPage(), dcIntroduceLog.getLimit());
+        List<DcIntroduceLog> dcIntroduceLogs = dcIntroduceLogDao.queryDcILbyrebate(dcIntroduceLog);
+        PageInfo<DcIntroduceLog> pageInfo = new PageInfo<DcIntroduceLog>(dcIntroduceLogs);
+        long count = pageInfo.getTotal(); //获取总记录数
+        Map<String, Object> tableData = new HashMap<>();
+        tableData.put("items", dcIntroduceLogs);
+        tableData.put("total", count);
+        return tableData;
+    }
+
 
     public int insertDcIntroduceLog(DcIntroduceLog dcIntroduceLog) {
         if (dcIntroduceLog.getXul_introducer_phone() == null || dcIntroduceLog.getXul_introducer_phone().equals("null") || dcIntroduceLog.getXul_introducer_phone() == "" || dcIntroduceLog.getXul_introducer_phone() == " ") {
@@ -66,5 +77,8 @@ public class DcIntroduceLogService {
     public int checkFirstDILogs(DcIntroduceLog dcIntroduceLog) {
         return dcIntroduceLogDao.checkFirstDILogs(dcIntroduceLog);
     }
+    public int updateDcIntroduceLogByPhone (DcIntroduceLog dcIntroduceLog){
+        return dcIntroduceLogDao.updateDcIntroduceLogByPhone(dcIntroduceLog);
+    }
 
 }

+ 3 - 0
src/main/java/com/ygj/yuemum/service/distributionchannel/DcIntroducerExtractService.java

@@ -81,6 +81,9 @@ public class DcIntroducerExtractService {
     public DcIntroducerExtract queryOneDcIntroducerExtract(Integer id) {
         return dcIntroducerExtractDao.queryOneDcIntroducerExtract(id);
     }
+    public int updateIEByPhoneChange(DcIntroducerExtract dcIntroducerExtract) {
+        return dcIntroducerExtractDao.updateIEByPhoneChange(dcIntroducerExtract);
+    }
 
 
 }

+ 4 - 0
src/main/java/com/ygj/yuemum/service/distributionchannel/DcIntroducerRelationService.java

@@ -20,4 +20,8 @@ public class DcIntroducerRelationService {
         return dcIntroducerRelationDao.insertDcIntroducerRelation(dcIntroducerRelation);
     }
 
+    public int updateIRByPhoneChange (DcIntroducerRelation dcIntroducerRelation) {
+        return dcIntroducerRelationDao.updateIRByPhoneChange(dcIntroducerRelation);
+    }
+
 }

+ 63 - 1
src/main/java/com/ygj/yuemum/service/distributionchannel/DcIntroducerService.java

@@ -2,11 +2,18 @@ package com.ygj.yuemum.service.distributionchannel;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.ygj.yuemum.component.Constant;
 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.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.stereotype.Service;
 
+import java.io.File;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -16,6 +23,15 @@ public class DcIntroducerService {
 
     @Autowired
     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) {
@@ -46,12 +62,41 @@ public class DcIntroducerService {
     }
 
     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) {
         return dcIntroducerDao.updateAccountNumber(dcIntroducer);
     }
+
     public List<DcIntroducer> queryDcIntroducersByUser(String xul_phone) {
         return dcIntroducerDao.queryDcIntroducersByUser(xul_phone);
     }
@@ -61,4 +106,21 @@ public class DcIntroducerService {
         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;
+    }
+
 }

+ 19 - 9
src/main/java/com/ygj/yuemum/service/ocr/BaiDuInfoServices.java

@@ -20,6 +20,7 @@ import java.net.HttpURLConnection;
 import java.net.URL;
 import java.net.URLEncoder;
 import java.text.SimpleDateFormat;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -92,16 +93,16 @@ public class BaiDuInfoServices {
         // 银行卡识别url
         String bankcardIdentificate = BANKCARD;
         // 保存图片
+        Calendar Cld = Calendar.getInstance();
+        int SS = Cld.get(Calendar.SECOND);
+        int MI = Cld.get(Calendar.MILLISECOND);
         int dot = file.getOriginalFilename().lastIndexOf('.');
-        String newName = file.getOriginalFilename().substring(dot);
-        File dest = new File(IMGBANKCARD + phone +newName);
+        String newName = phone + SS + MI + file.getOriginalFilename().substring(dot);
+        File dest = new File(IMGBANKCARD + newName);
         try {
-            if (dest.exists()) {
-                dest.delete();
-            }
             file.transferTo(dest);
-            String filePath = IMGBANKCARD + phone + newName;
-            String httpfilePath  = HTTPIMGBANKCARD + phone + newName;
+            String filePath = IMGBANKCARD + newName;
+            String httpfilePath = HTTPIMGBANKCARD + newName;
             byte[] imgData = FileUtil.readFileByBytes(filePath);
             String imgStr = Base64Util.encode(imgData);
             String params = URLEncoder.encode("image", "UTF-8") + "=" + URLEncoder.encode(imgStr, "UTF-8");
@@ -112,12 +113,21 @@ public class BaiDuInfoServices {
             String accessToken = baiDuInfo.getAccess_token();
             String result = HttpUtil.post(bankcardIdentificate, accessToken, params);
             JSONObject jsonObject = new JSONObject(result);
-            if(jsonObject.has("error_code")){
+            if (jsonObject.has("error_code")) {
                 return "0";
             }
             String bank_card_number = jsonObject.getJSONObject("result").getString("bank_card_number");
             String account_bank = jsonObject.getJSONObject("result").getString("bank_name");
-
+            // 识别成功吧之前的删掉
+            DcIntroducer dcIntroducerOld = dcIntroducerService.checkDcIntroducers(phone);
+            String OldPath = dcIntroducerOld.getWv_account_number_path();
+            if (OldPath != null) {
+                String[] pathname = OldPath.split("/");
+                String name = pathname[pathname.length - 1];
+                String path = IMGBANKCARD + "/" + name;
+                File destOld = new File(path);
+                destOld.delete();
+            }
             DcIntroducer dcIntroducer = new DcIntroducer();
             dcIntroducer.setWv_phone(phone);
             dcIntroducer.setWv_account_number_path(httpfilePath);

+ 9 - 6
src/main/java/com/ygj/yuemum/service/order/YSOrderService.java

@@ -244,13 +244,13 @@ public class YSOrderService {
                 CloseableHttpClient client = HttpClients.createDefault();
                 String respContent = null;
                 JSONObject jsonParam = new JSONObject();
-                jsonParam.put("odCityCode", "js");
-                jsonParam.put("odAmount", 10000);
-                jsonParam.put("odNo", "YS20181129150999");
-                jsonParam.put("odPhone", "15295794045");
+                jsonParam.put("odCityCode", ysOrder.getOd_cityid());
+                jsonParam.put("odAmount", ysOrder.getOd_order_amount());
+                jsonParam.put("odNo", ysOrder.getOd_no());
+                jsonParam.put("odPhone", ysOrder.getOd_phone());
                 jsonParam.put("odStatus", 3);
-                jsonParam.put("odIntroducerPhone", "15295795404");
-                jsonParam.put("odProductItem", "item_1");
+                jsonParam.put("odIntroducerPhone", ysOrder.getOd_introducer_phone());
+                jsonParam.put("odProductItem", ysOrder.getOd_product_id());
                 StringEntity entity = new StringEntity(jsonParam.toString(),"utf-8");//解决中文乱码问题
                 entity.setContentEncoding("UTF-8");
                 entity.setContentType("application/json");
@@ -271,6 +271,9 @@ public class YSOrderService {
         }
         return 1;
     }
+    public int updateDCPhone(YSOrder ysOrder) {
+        return YSOrderDao.updateDCPhone(ysOrder);
+    }
 
 
 }

+ 16 - 6
src/main/resources/mybatis/mapper/admin/JlAdminRoleMapper.xml

@@ -5,26 +5,27 @@
     <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.admin.JlAdminRole" >
         <id column="id" property="id" jdbcType="INTEGER" />
         <result column="jr_rolename" property="jr_rolename" jdbcType="VARCHAR" />
+        <result column="jl_visit_my_order" property="jl_visit_my_order" jdbcType="INTEGER" />
     </resultMap>
 
     <!--获取所有数据-->
     <select id="getAdminRoles" resultType="com.ygj.yuemum.domain.admin.JlAdminRole" >
         select
-        id,jr_rolename
+        id,jr_rolename,jl_visit_my_order
         from jl_admin_role
         order by id asc
     </select>
 
     <select id="getOneAdminRole" resultType="com.ygj.yuemum.domain.admin.JlAdminRole" parameterType="java.lang.Integer">
         select
-        id,jr_rolename
+        id,jr_rolename,jl_visit_my_order
         from jl_admin_role
         where id =  #{id,jdbcType=INTEGER}
     </select>
 
     <select id="queryAdminRoles" resultType="com.ygj.yuemum.domain.admin.JlAdminRole" parameterType="com.ygj.yuemum.domain.admin.JlAdminRole">
         select
-        id,jr_rolename
+        id,jr_rolename,jl_visit_my_order
         from jl_admin_role
         where 1=1
         <if test="id != null" >
@@ -45,12 +46,18 @@
         insert into jl_admin_role
         <trim prefix="(" suffix=")" suffixOverrides="," >
             <if test="jr_rolename != null" >
-                jr_rolename
+                jr_rolename,
+            </if>
+            <if test="jl_visit_my_order != null" >
+                jl_visit_my_order
             </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides="," >
             <if test="jr_rolename != null" >
-                #{jr_rolename,jdbcType=VARCHAR}
+                #{jr_rolename,jdbcType=VARCHAR},
+            </if>
+            <if test="jl_visit_my_order != null" >
+                #{jl_visit_my_order,jdbcType=INTEGER}
             </if>
         </trim>
     </insert>
@@ -65,7 +72,10 @@
         update jl_admin_role
         <set >
             <if test="jr_rolename != null" >
-                jr_rolename = #{jr_rolename,jdbcType=DATE}
+                jr_rolename = #{jr_rolename,jdbcType=DATE},
+            </if>
+            <if test="jl_visit_my_order != null" >
+                jl_visit_my_order = #{jl_visit_my_order,jdbcType=DATE}
             </if>
         </set>
         where id = #{id,jdbcType=INTEGER}

+ 20 - 1
src/main/resources/mybatis/mapper/admin/JlAdminUserMapper.xml

@@ -121,7 +121,26 @@
 
     <select id="getUserMkt" resultMap="BaseResultMap" parameterType="java.lang.String">
         select
-        *
+        id,
+        username,
+        email,
+        name,
+        password,
+        create_time,
+        last_login_time,
+        last_login_ip,
+        role,
+        fgetisvisit(role) isvisit,
+        status,
+        org,
+        last_login_location,
+        remark,
+        phone,
+        province,
+        city,
+        district,
+        enabled,
+        update_time
         from jl_admin_user
         where
         username =  #{username,jdbcType=VARCHAR}

+ 49 - 0
src/main/resources/mybatis/mapper/distributionchannel/DcIntroduceLogMapper.xml

@@ -70,6 +70,45 @@
         order by xul_event desc, id desc , xul_pm_type asc
     </select>
 
+    <select id="queryDcILbyrebate" resultType="com.ygj.yuemum.domain.distributionchannel.DcIntroduceLog"
+            parameterType="com.ygj.yuemum.domain.distributionchannel.DcIntroduceLog">
+        SELECT
+        ta.id,
+        xul_openid,
+        xul_phone,
+        xul_event,
+        xul_date,
+        xul_introducer_phone,
+        xul_pm_type,
+        xul_orderno,
+        ifnull(tb.od_rebate_amount,0) od_rebate_amount
+        FROM
+        dc_introduce_log ta
+        LEFT JOIN ys_order tb ON ta.xul_orderno = tb.od_no
+        where 1=1
+        <if test="xul_openid != null and xul_openid != ''">
+            and xul_openid = #{xul_openid,jdbcType=VARCHAR}
+        </if>
+        <if test="xul_phone != null and xul_phone != ''">
+            and xul_phone = #{xul_phone,jdbcType=VARCHAR}
+        </if>
+        <if test="xul_event != null and xul_event != ''">
+            and xul_event = #{xul_event,jdbcType=INTEGER}
+        </if>
+        <if test="xul_date != null and xul_date != ''">
+            and xul_date = #{xul_date,jdbcType=DATE}
+        </if>
+        <if test="xul_introducer_phone != null and xul_introducer_phone != ''">
+            and xul_introducer_phone = #{xul_introducer_phone,jdbcType=VARCHAR}
+        </if>
+        <if test="xul_pm_type != null and xul_pm_type != ''">
+            and xul_pm_type = #{xul_pm_type,jdbcType=INTEGER}
+        </if>
+        <if test="xul_orderno != null and xul_orderno != ''">
+            and xul_orderno = #{xul_orderno,jdbcType=VARCHAR}
+        </if>
+        order by xul_event desc, id desc , xul_pm_type asc
+    </select>
 
     <select id="getDcIntroduceLogs" resultType="com.ygj.yuemum.domain.distributionchannel.DcIntroduceLog"
             parameterType="java.lang.String">
@@ -139,4 +178,14 @@
 
         </trim>
     </insert>
+
+    <update id="updateDcIntroduceLogByPhone" parameterType="com.ygj.yuemum.domain.distributionchannel.DcIntroduceLog" >
+        update dc_introduce_log
+        <set >
+            <if test="xul_introducer_phone != null" >
+                xul_introducer_phone = #{xul_introducer_phone,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where xul_introducer_phone = #{xul_introducer_phoneOld,jdbcType=VARCHAR}
+    </update>
 </mapper>

+ 11 - 0
src/main/resources/mybatis/mapper/distributionchannel/DcIntroducerExtractMapper.xml

@@ -248,4 +248,15 @@
         from dc_introducer_extract
         where date_format(wue_applydate,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
     </select>
+    <update id="updateIEByPhoneChange" parameterType="com.ygj.yuemum.domain.distributionchannel.DcIntroducerExtract" >
+        update dc_introducer_extract
+        <set >
+            <if test="wue_phone != null" >
+                wue_phone = #{wue_phone,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where wue_phone = #{wue_phoneOld,jdbcType=VARCHAR}
+    </update>
+
+
 </mapper>

+ 27 - 1
src/main/resources/mybatis/mapper/distributionchannel/DcIntroducerMapper.xml

@@ -32,7 +32,23 @@
     <select id="checkDcIntroducers" resultType="com.ygj.yuemum.domain.distributionchannel.DcIntroducer"
             parameterType="java.lang.String">
         select
-        *
+        id,
+        wv_phone,
+        wv_gradeid,
+        wv_Introduction_total,
+        wv_withdraw_total,
+        wv_Introduction_count,
+        wv_people_count,
+        wv_register_count,
+        wv_contract_count,
+        wv_finish_count,
+        wv_extract_count,
+        wv_qrcode,
+        wv_consultant,
+        fgetuser_name(wv_consultant) wv_consultantname,
+        wv_account_number,
+        wv_account_bank,
+        wv_account_number_path
         from dc_introducer
         where wv_phone = #{wv_phone,jdbcType=VARCHAR}
         order by id desc
@@ -73,6 +89,7 @@
         wv_contract_count,
         wv_finish_count,
         wv_consultant,
+        fgetuser_name(wv_consultant) wv_consultantname,
         wv_account_number,
         wv_account_bank,
         wv_account_number_path
@@ -196,6 +213,15 @@
     </update>
 
 
+    <update id="delAccountNumber" parameterType="java.lang.String">
+        update dc_introducer
+            set wv_account_number = NULL,
+            wv_account_bank = NULL,
+            wv_account_number_path = NULL
+        where wv_phone = #{wv_phone,jdbcType=VARCHAR}
+    </update>
+
+
     <insert id="insertDcIntroducer" parameterType="com.ygj.yuemum.domain.distributionchannel.DcIntroducer">
         insert into dc_introducer
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 9 - 0
src/main/resources/mybatis/mapper/distributionchannel/DcIntroducerRelationMapper.xml

@@ -42,4 +42,13 @@
             </if>
         </trim>
     </insert>
+    <update id="updateIRByPhoneChange" parameterType="com.ygj.yuemum.domain.distributionchannel.DcIntroducerRelation" >
+        update dc_introducer_relation
+        <set >
+            <if test="dig_introducer_phone != null" >
+                dig_introducer_phone = #{dig_introducer_phone,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where dig_introducer_phone = #{dig_introducer_phoneOld,jdbcType=VARCHAR}
+    </update>
 </mapper>

+ 16 - 1
src/main/resources/mybatis/mapper/order/YSOrder.xml

@@ -90,6 +90,7 @@
         od_mmid,
         fgetmmname (od_mmid) od_mmname,
         fgetpackagename (od_product_id) od_product_name,
+        fgetpackageimg (od_product_id) od_product_img,
         od_product_id,
         od_product_item_id,
         od_cityid,
@@ -184,6 +185,7 @@
         od_mmid,
         fgetmmname (od_mmid) od_mmname,
         fgetpackagename (od_product_id) od_product_name,
+        fgetpackageimg (od_product_id) od_product_img,
         od_product_id,
         od_product_item_id,
         od_cityid,
@@ -295,7 +297,7 @@
 
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
         delete from ys_order
-        where id = #{id,jdbcType=VARCHAR}
+        where id = #{id,jdbcType=INTEGER}
     </delete>
 
     <!-- 插入一条培训信息 -->
@@ -560,6 +562,9 @@
             <if test="od_promotion_id != null" >
                 od_promotion_id = #{od_promotion_id,jdbcType=INTEGER},
             </if>
+            <if test="od_promotion_id == null" >
+                od_promotion_id = NULL,
+            </if>
             <if test="od_ismdj != null" >
                 od_ismdj = #{od_ismdj,jdbcType=INTEGER},
             </if>
@@ -605,4 +610,14 @@
         where od_no = #{od_no,jdbcType=INTEGER}
     </update>
 
+    <update id="updateDCPhone" parameterType="com.ygj.yuemum.domain.order.YSOrder" >
+        update ys_order
+        <set >
+            <if test="od_introducer_phone != null" >
+                od_introducer_phone = #{od_introducer_phone,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where od_introducer_phone = #{od_introducer_phoneOld,jdbcType=VARCHAR}
+    </update>
+
 </mapper>