Commit ea17d3b3 by 田超

Merge branch 'feature/addIpAddress' into 'master'

feat: [none] 编辑创建书加IP

See merge request rays/pcloud-book!1211
parents 369ddb4c 55982a68
......@@ -1646,6 +1646,7 @@ public class BookBizImpl implements BookBiz {
bookAdviser.setDepLabelId(book.getDepLabelId());
bookAdviser.setPurLabelId(book.getPurLabelId());
bookAdviser.setVolLabelId(book.getVolLabelId());
bookAdviser.setIpAddress(book.getIpAddress());
if(book.getIsBookGroup()!=null&&book.getIsBookGroup()){
bookAdviser.setIsOpenRobotProcess(1);
}else{
......
......@@ -36,6 +36,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
......@@ -559,7 +560,7 @@ public interface BookFacade {
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "create4Adviser", method = RequestMethod.POST)
ResponseDto<BookDto> create4Adviser(@RequestHeader("token") String token, @RequestBody Book book)
ResponseDto<BookDto> create4Adviser(@RequestHeader("token") String token, @RequestBody Book book, HttpServletRequest request)
throws BizException, PermissionException, JsonParseException;
/**
......
......@@ -31,6 +31,7 @@ import com.pcloud.common.permission.PermissionException;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.SessionUtil;
import com.pcloud.common.utils.cookie.Cookie;
import com.pcloud.common.utils.nginx.NginxUtils;
import com.pcloud.common.utils.string.StringUtil;
import com.pcloud.wechatgroup.message.enums.IsSystem;
import io.swagger.annotations.ApiOperation;
......@@ -40,6 +41,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
/**
......@@ -762,13 +764,14 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "create4Adviser", method = RequestMethod.POST)
public ResponseDto<BookDto> create4Adviser( @RequestHeader("token") String token, @RequestBody Book book )
public ResponseDto<BookDto> create4Adviser( @RequestHeader("token") String token, @RequestBody Book book, HttpServletRequest request)
throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.TENANT_ID);
// 实体赋值
book.setCreatedUser(adviserId);
book.setAgentId(agentId);
book.setIpAddress(NginxUtils.getClientIp(request));
BookDto bookDto = bookBiz.create4Adviser(book);
return new ResponseDto<>(bookDto);
}
......
......@@ -46,7 +46,7 @@
INSERT INTO BOOK_ADVISER (
BOOK_ID, ADVISER_ID, CHANNEL_ID, CREATED_USER, CREATED_DATE,IS_MAIN_EDITOR, TEMPLET_ID, SECOND_TEMPLET_ID,third_templet_id,
GRA_LABEL_ID,SUB_LABEL_ID,VER_LABEL_ID,AREA_LABEL_ID,pro_label_id, dep_label_id,pur_label_id,is_open_robot_process,
vol_label_id,LAST_MODIFIED_DATE
vol_label_id,LAST_MODIFIED_DATE,ip_address
)
VALUES (
#{bookId, jdbcType=VARCHAR}, #{adviserId, jdbcType=VARCHAR}, #{channelId, jdbcType=VARCHAR},
......@@ -54,7 +54,7 @@
#{secondTempletId, jdbcType=BIGINT},#{thirdTempletId},#{graLabelId, jdbcType=BIGINT},#{subLabelId, jdbcType=BIGINT},
#{verLabelId, jdbcType=BIGINT},#{areaLabelId, jdbcType=BIGINT},#{proLabelId,jdbcType=BIGINT},
#{depLabelId,jdbcType=BIGINT},#{purLabelId,jdbcType=BIGINT},#{isOpenRobotProcess,jdbcType=BIT},
#{volLabelId},now()
#{volLabelId},now(),#{ipAddress}
)
ON
DUPLICATE KEY UPDATE IS_DELETE = 0,LAST_MODIFIED_DATE=now(), IS_MAIN_EDITOR = #{isMainEditor, jdbcType=BIT}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment