Authored by min.ling

绑定招商人员

... ... @@ -13,4 +13,6 @@ public interface ZhimaCertMapper {
int selectCountByCondition(@Param("sellerReqBO") SellerReqBO req);
List<ZhimaCert> selectByConditionPage(@Param("sellerReqBO") SellerReqBO req);
int updateInvestNameByUid(@Param("uid") Integer uid,@Param("investName") String investName);
}
\ No newline at end of file
... ...
package com.yoho.order.model;
import lombok.Data;
import lombok.ToString;
/**
* Created by min.ling on 2019/4/25.
*/
@Data
@ToString
public class InvestUserBO {
private Integer uid;
//绑定的招商人员姓名
private String investName;
}
... ...
... ... @@ -70,4 +70,11 @@
</if>
</sql>
<update id="updateInvestNameByUid">
update zhima_cert
set invest_name = #{investName,jdbcType=VARCHAR}
where status = 1 and uid = #{uid,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
... ...
package com.yoho.ufo.order.controller;
import com.alibaba.fastjson.JSONObject;
import com.yoho.core.rest.client.ServiceCaller;
import com.yoho.order.model.InvestUserBO;
import com.yoho.order.model.StoredSellerReqVo;
import com.yoho.order.model.TradeBillsReq;
import com.yoho.ufo.order.response.StoredSellerRespVo;
import com.yoho.ufo.order.service.ITradeBillsService;
import com.yoho.ufo.service.impl.UserHelper;
import com.yoho.ufo.service.model.ApiResponse;
import com.yoho.ufo.service.model.PageResponseBO;
import com.yohobuy.ufo.model.order.req.ManualDealRequest;
import com.yohobuy.ufo.model.order.resp.TradeBillsResp;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -36,4 +30,14 @@ public class StoredSellerController {
}
@RequestMapping(value = "/saveInvestUser")
public ApiResponse saveInvestUser(InvestUserBO investUserBO){
LOGGER.info("saveInvestUser with req is {}",investUserBO);
int result = billsTradeService.saveInvestUser(investUserBO);
if(result > 0){
return new ApiResponse.ApiResponseBuilder().code(200).message("保存成功").data(result).build();
}
return new ApiResponse.ApiResponseBuilder().code(201).message("参数缺失").data(result).build();
}
}
... ...
package com.yoho.ufo.order.service;
import com.yoho.order.model.InvestUserBO;
import com.yoho.order.model.StoredSellerReqVo;
import com.yoho.order.model.TradeBillsReq;
import com.yoho.ufo.order.response.StoredSellerRespVo;
... ... @@ -13,4 +14,11 @@ public interface ITradeBillsService {
PageResponseBO<StoredSellerRespVo> queryStoredSeller(StoredSellerReqVo req);
/**
* 招商人员绑定
* @param investUserBO
* @return
*/
int saveInvestUser(InvestUserBO investUserBO);
}
... ...
... ... @@ -334,4 +334,21 @@ public class TradeBillsServiceImpl implements ITradeBillsService {
return jsonObject.getJSONObject("data").getInteger("uid");
}
/**
* 招商人员绑定
* @param investUserBO
* @return
*/
public int saveInvestUser(InvestUserBO investUserBO){
LOGGER.info("enter saveInvestUser with req is {}",investUserBO);
if(investUserBO.getUid() == null || StringUtils.isEmpty(investUserBO.getInvestName())){
LOGGER.warn("saveInvestUser with params null");
return 0;
}
int result = zhimaCertMapper.updateInvestNameByUid(investUserBO.getUid(),investUserBO.getInvestName());
LOGGER.info("end saveInvestUser with req is {},result is {}",investUserBO,result);
return result;
}
}
... ...