Authored by min.ling

绑定招商人员

@@ -13,4 +13,6 @@ public interface ZhimaCertMapper { @@ -13,4 +13,6 @@ public interface ZhimaCertMapper {
13 int selectCountByCondition(@Param("sellerReqBO") SellerReqBO req); 13 int selectCountByCondition(@Param("sellerReqBO") SellerReqBO req);
14 14
15 List<ZhimaCert> selectByConditionPage(@Param("sellerReqBO") SellerReqBO req); 15 List<ZhimaCert> selectByConditionPage(@Param("sellerReqBO") SellerReqBO req);
  16 +
  17 + int updateInvestNameByUid(@Param("uid") Integer uid,@Param("investName") String investName);
16 } 18 }
  1 +package com.yoho.order.model;
  2 +
  3 +import lombok.Data;
  4 +import lombok.ToString;
  5 +
  6 +/**
  7 + * Created by min.ling on 2019/4/25.
  8 + */
  9 +@Data
  10 +@ToString
  11 +public class InvestUserBO {
  12 +
  13 + private Integer uid;
  14 +
  15 + //绑定的招商人员姓名
  16 + private String investName;
  17 +
  18 +}
@@ -70,4 +70,11 @@ @@ -70,4 +70,11 @@
70 </if> 70 </if>
71 </sql> 71 </sql>
72 72
  73 + <update id="updateInvestNameByUid">
  74 + update zhima_cert
  75 + set invest_name = #{investName,jdbcType=VARCHAR}
  76 + where status = 1 and uid = #{uid,jdbcType=INTEGER}
  77 + </update>
  78 +
  79 +
73 </mapper> 80 </mapper>
1 package com.yoho.ufo.order.controller; 1 package com.yoho.ufo.order.controller;
2 2
3 -import com.alibaba.fastjson.JSONObject;  
4 -import com.yoho.core.rest.client.ServiceCaller; 3 +import com.yoho.order.model.InvestUserBO;
5 import com.yoho.order.model.StoredSellerReqVo; 4 import com.yoho.order.model.StoredSellerReqVo;
6 -import com.yoho.order.model.TradeBillsReq;  
7 import com.yoho.ufo.order.response.StoredSellerRespVo; 5 import com.yoho.ufo.order.response.StoredSellerRespVo;
8 import com.yoho.ufo.order.service.ITradeBillsService; 6 import com.yoho.ufo.order.service.ITradeBillsService;
9 -import com.yoho.ufo.service.impl.UserHelper;  
10 import com.yoho.ufo.service.model.ApiResponse; 7 import com.yoho.ufo.service.model.ApiResponse;
11 import com.yoho.ufo.service.model.PageResponseBO; 8 import com.yoho.ufo.service.model.PageResponseBO;
12 -import com.yohobuy.ufo.model.order.req.ManualDealRequest;  
13 -import com.yohobuy.ufo.model.order.resp.TradeBillsResp;  
14 -import org.apache.commons.lang3.StringUtils;  
15 import org.slf4j.Logger; 9 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory; 10 import org.slf4j.LoggerFactory;
17 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,4 +30,14 @@ public class StoredSellerController { @@ -36,4 +30,14 @@ public class StoredSellerController {
36 } 30 }
37 31
38 32
  33 + @RequestMapping(value = "/saveInvestUser")
  34 + public ApiResponse saveInvestUser(InvestUserBO investUserBO){
  35 + LOGGER.info("saveInvestUser with req is {}",investUserBO);
  36 + int result = billsTradeService.saveInvestUser(investUserBO);
  37 + if(result > 0){
  38 + return new ApiResponse.ApiResponseBuilder().code(200).message("保存成功").data(result).build();
  39 + }
  40 + return new ApiResponse.ApiResponseBuilder().code(201).message("参数缺失").data(result).build();
  41 + }
  42 +
39 } 43 }
1 package com.yoho.ufo.order.service; 1 package com.yoho.ufo.order.service;
2 2
  3 +import com.yoho.order.model.InvestUserBO;
3 import com.yoho.order.model.StoredSellerReqVo; 4 import com.yoho.order.model.StoredSellerReqVo;
4 import com.yoho.order.model.TradeBillsReq; 5 import com.yoho.order.model.TradeBillsReq;
5 import com.yoho.ufo.order.response.StoredSellerRespVo; 6 import com.yoho.ufo.order.response.StoredSellerRespVo;
@@ -13,4 +14,11 @@ public interface ITradeBillsService { @@ -13,4 +14,11 @@ public interface ITradeBillsService {
13 14
14 PageResponseBO<StoredSellerRespVo> queryStoredSeller(StoredSellerReqVo req); 15 PageResponseBO<StoredSellerRespVo> queryStoredSeller(StoredSellerReqVo req);
15 16
  17 + /**
  18 + * 招商人员绑定
  19 + * @param investUserBO
  20 + * @return
  21 + */
  22 + int saveInvestUser(InvestUserBO investUserBO);
  23 +
16 } 24 }
@@ -334,4 +334,21 @@ public class TradeBillsServiceImpl implements ITradeBillsService { @@ -334,4 +334,21 @@ public class TradeBillsServiceImpl implements ITradeBillsService {
334 return jsonObject.getJSONObject("data").getInteger("uid"); 334 return jsonObject.getJSONObject("data").getInteger("uid");
335 } 335 }
336 336
  337 +
  338 + /**
  339 + * 招商人员绑定
  340 + * @param investUserBO
  341 + * @return
  342 + */
  343 + public int saveInvestUser(InvestUserBO investUserBO){
  344 + LOGGER.info("enter saveInvestUser with req is {}",investUserBO);
  345 + if(investUserBO.getUid() == null || StringUtils.isEmpty(investUserBO.getInvestName())){
  346 + LOGGER.warn("saveInvestUser with params null");
  347 + return 0;
  348 + }
  349 + int result = zhimaCertMapper.updateInvestNameByUid(investUserBO.getUid(),investUserBO.getInvestName());
  350 + LOGGER.info("end saveInvestUser with req is {},result is {}",investUserBO,result);
  351 + return result;
  352 + }
  353 +
337 } 354 }