Commit 55982a68 by 郑永强

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

parent 369ddb4c
...@@ -1646,6 +1646,7 @@ public class BookBizImpl implements BookBiz { ...@@ -1646,6 +1646,7 @@ public class BookBizImpl implements BookBiz {
bookAdviser.setDepLabelId(book.getDepLabelId()); bookAdviser.setDepLabelId(book.getDepLabelId());
bookAdviser.setPurLabelId(book.getPurLabelId()); bookAdviser.setPurLabelId(book.getPurLabelId());
bookAdviser.setVolLabelId(book.getVolLabelId()); bookAdviser.setVolLabelId(book.getVolLabelId());
bookAdviser.setIpAddress(book.getIpAddress());
if(book.getIsBookGroup()!=null&&book.getIsBookGroup()){ if(book.getIsBookGroup()!=null&&book.getIsBookGroup()){
bookAdviser.setIsOpenRobotProcess(1); bookAdviser.setIsOpenRobotProcess(1);
}else{ }else{
......
...@@ -36,6 +36,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -36,6 +36,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -559,7 +560,7 @@ public interface BookFacade { ...@@ -559,7 +560,7 @@ public interface BookFacade {
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"), @ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")}) @ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "create4Adviser", method = RequestMethod.POST) @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; throws BizException, PermissionException, JsonParseException;
/** /**
......
...@@ -31,6 +31,7 @@ import com.pcloud.common.permission.PermissionException; ...@@ -31,6 +31,7 @@ import com.pcloud.common.permission.PermissionException;
import com.pcloud.common.utils.ListUtils; import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.SessionUtil; import com.pcloud.common.utils.SessionUtil;
import com.pcloud.common.utils.cookie.Cookie; import com.pcloud.common.utils.cookie.Cookie;
import com.pcloud.common.utils.nginx.NginxUtils;
import com.pcloud.common.utils.string.StringUtil; import com.pcloud.common.utils.string.StringUtil;
import com.pcloud.wechatgroup.message.enums.IsSystem; import com.pcloud.wechatgroup.message.enums.IsSystem;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -40,6 +41,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -40,6 +41,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.*; import java.util.*;
/** /**
...@@ -762,13 +764,14 @@ public class BookFacadeImpl implements BookFacade { ...@@ -762,13 +764,14 @@ public class BookFacadeImpl implements BookFacade {
*/ */
@Override @Override
@RequestMapping(value = "create4Adviser", method = RequestMethod.POST) @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 { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.TENANT_ID); Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.TENANT_ID);
// 实体赋值 // 实体赋值
book.setCreatedUser(adviserId); book.setCreatedUser(adviserId);
book.setAgentId(agentId); book.setAgentId(agentId);
book.setIpAddress(NginxUtils.getClientIp(request));
BookDto bookDto = bookBiz.create4Adviser(book); BookDto bookDto = bookBiz.create4Adviser(book);
return new ResponseDto<>(bookDto); return new ResponseDto<>(bookDto);
} }
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
INSERT INTO BOOK_ADVISER ( 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, 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, 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 ( VALUES (
#{bookId, jdbcType=VARCHAR}, #{adviserId, jdbcType=VARCHAR}, #{channelId, jdbcType=VARCHAR}, #{bookId, jdbcType=VARCHAR}, #{adviserId, jdbcType=VARCHAR}, #{channelId, jdbcType=VARCHAR},
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
#{secondTempletId, jdbcType=BIGINT},#{thirdTempletId},#{graLabelId, jdbcType=BIGINT},#{subLabelId, jdbcType=BIGINT}, #{secondTempletId, jdbcType=BIGINT},#{thirdTempletId},#{graLabelId, jdbcType=BIGINT},#{subLabelId, jdbcType=BIGINT},
#{verLabelId, jdbcType=BIGINT},#{areaLabelId, jdbcType=BIGINT},#{proLabelId,jdbcType=BIGINT}, #{verLabelId, jdbcType=BIGINT},#{areaLabelId, jdbcType=BIGINT},#{proLabelId,jdbcType=BIGINT},
#{depLabelId,jdbcType=BIGINT},#{purLabelId,jdbcType=BIGINT},#{isOpenRobotProcess,jdbcType=BIT}, #{depLabelId,jdbcType=BIGINT},#{purLabelId,jdbcType=BIGINT},#{isOpenRobotProcess,jdbcType=BIT},
#{volLabelId},now() #{volLabelId},now(),#{ipAddress}
) )
ON ON
DUPLICATE KEY UPDATE IS_DELETE = 0,LAST_MODIFIED_DATE=now(), IS_MAIN_EDITOR = #{isMainEditor, jdbcType=BIT} 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