fix:添加企业基本信息查询
This commit is contained in:
parent
e1bfff6996
commit
cbb79d172c
|
@ -0,0 +1,22 @@
|
|||
package com.kakarote.crm.constant;
|
||||
|
||||
public enum CrmPoolEnum {
|
||||
FXQYMDPOOL("风险企业名单公海",34555),
|
||||
ZDFDDWMDPOOL("重点辅导单位名单公海",34554),
|
||||
PXQDMDPOOL("培训签到企业名单公海",34553),
|
||||
XDMRPOOL("系统默认公海",34552),
|
||||
;
|
||||
private final String name;
|
||||
private final int id;
|
||||
private CrmPoolEnum(String name, int id) {
|
||||
this.name = name;
|
||||
this.id = id;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
|
@ -31,6 +31,7 @@ import com.kakarote.crm.entity.VO.CrmMembersSelectVO;
|
|||
import com.kakarote.crm.entity.VO.CrmModelFiledVO;
|
||||
import com.kakarote.crm.service.CrmUploadExcelService;
|
||||
import com.kakarote.crm.service.ICrmCustomerService;
|
||||
import com.kakarote.crm.service.ICrmOpenApiService;
|
||||
import com.kakarote.crm.service.ICrmTeamMembersService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -71,6 +72,9 @@ public class CrmCustomerController {
|
|||
@Autowired
|
||||
private ICrmTeamMembersService teamMembersService;
|
||||
|
||||
@Autowired
|
||||
private ICrmOpenApiService crmOpenApiService;
|
||||
|
||||
@PostMapping("/queryPageList")
|
||||
@ApiOperation("查询列表页数据")
|
||||
public Result<BasePage<Map<String, Object>>> queryPageList(@RequestBody CrmSearchBO search) {
|
||||
|
@ -83,8 +87,15 @@ public class CrmCustomerController {
|
|||
@ApiOperation("保存数据")
|
||||
@SysLogHandler(behavior = BehaviorEnum.SAVE, object = "#crmModel.entity[customerName]", detail = "'新增了客户:' + #crmModel.entity[customerName]")
|
||||
public Result<Map<String, Object>> add(@RequestBody CrmBusinessSaveBO crmModel) {
|
||||
Map<String, Object> map = crmCustomerService.addOrUpdate(crmModel, false, null);
|
||||
return R.ok(map);
|
||||
// Map<String, Object> map = crmCustomerService.addOrUpdate(crmModel, false, null);
|
||||
// return R.ok(map);
|
||||
CrmAddCustomerBo crmAddCustomerBo = new CrmAddCustomerBo();
|
||||
crmAddCustomerBo.setCrmModel(crmModel);
|
||||
// !"101011".equals(appId) && !"crmopenapi".
|
||||
crmAddCustomerBo.setAppId("101011");
|
||||
crmAddCustomerBo.setAppSecret("crmopenapi");
|
||||
crmOpenApiService.crmAddCustomer(crmAddCustomerBo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
|
|
|
@ -2,21 +2,30 @@ package com.kakarote.crm.controller;
|
|||
import com.kakarote.core.common.Result;
|
||||
import com.kakarote.crm.entity.VO.CrmV3SysRiskDataExposedVo;
|
||||
import com.kakarote.crm.service.ICrmQyfxjcjgService;
|
||||
import com.kakarote.crm.service.ICrmQyfxjcjgZbmxService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/crmGetData")
|
||||
@RequestMapping("/crmGetV3Data")
|
||||
public class CrmGetV3SysRiskDataController {
|
||||
|
||||
@Autowired
|
||||
private ICrmQyfxjcjgService iCrmQyfxjcjgService;
|
||||
|
||||
@Autowired
|
||||
private ICrmQyfxjcjgZbmxService crmQyfxjcjgZbmxService;
|
||||
|
||||
@PostMapping(value = "/resp")
|
||||
public Result getV3SysRiskData(@RequestBody CrmV3SysRiskDataExposedVo crmV3SysRiskDataExposedVo) throws IOException {
|
||||
return Result.ok(iCrmQyfxjcjgService.getLocalRiskData(crmV3SysRiskDataExposedVo));
|
||||
}
|
||||
|
||||
@PostMapping("/riskJcmx/{jcId}")
|
||||
public Result getRiskJcmc(@PathVariable String jcId){
|
||||
return Result.ok(crmQyfxjcjgZbmxService.getQyfxjcjgZbmxListByJcId(jcId));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,21 +3,29 @@ package com.kakarote.crm.controller;
|
|||
import com.kakarote.core.common.ParamAspect;
|
||||
import com.kakarote.core.common.R;
|
||||
import com.kakarote.core.common.Result;
|
||||
import com.kakarote.crm.entity.BO.CrmAddCustomerBo;
|
||||
import com.kakarote.crm.service.ICrmOpenApiService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/openApi")
|
||||
@RequestMapping("/crmOpenApi")
|
||||
@Api(tags = "crm对外接口")
|
||||
public class CrmOpenApiController {
|
||||
|
||||
@Autowired
|
||||
private ICrmOpenApiService crmOpenApiService;
|
||||
|
||||
@PostMapping("/crm/addCorporateSeas")
|
||||
@ApiOperation("接口新增公海数据")
|
||||
@ParamAspect
|
||||
public Result addCorporateSeas(){
|
||||
public Result addCorporateSeas(@RequestBody CrmAddCustomerBo crmAddCustomerBo){
|
||||
crmOpenApiService.crmAddCustomer(crmAddCustomerBo);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/qyjbxx")
|
||||
@RequestMapping("/crmQyjbxx")
|
||||
@Api(tags = "企业基本信息")
|
||||
public class CrmQyjbxxController {
|
||||
@Autowired
|
||||
|
@ -38,11 +38,11 @@ public class CrmQyjbxxController {
|
|||
return R.ok(crmQyjbxxService.insertQyjbxx(crmQyjbxx));
|
||||
}
|
||||
|
||||
@PostMapping("/queryByNsrxx")
|
||||
@PostMapping("/queryByCustomerId")
|
||||
@ApiOperation("根据纳税人识别号查询企业基本信息")
|
||||
public Result<CrmQyjbxx> queryByNsrsbh(@RequestBody QyjbxxBo qyjbxxBo) {
|
||||
CrmQyjbxx qyjbxxByNsrsbh = crmQyjbxxService.getQyjbxxByNsxx(qyjbxxBo);
|
||||
return R.ok(qyjbxxByNsrsbh);
|
||||
public Result<CrmQyjbxx> queryByCustomerId(@RequestBody QyjbxxBo qyjbxxBo) {
|
||||
CrmQyjbxx qyjbxxByCustomerId = crmQyjbxxService.getQyJbxxByCustomer(qyjbxxBo);
|
||||
return R.ok(qyjbxxByCustomerId);
|
||||
}
|
||||
|
||||
// @PostMapping("/queryByNsrmc/{nsrmc}")
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package com.kakarote.crm.entity.BO;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
@ApiModel("签到crm添加企业OpenAPi")
|
||||
@Data
|
||||
public class CrmAddCustomerBo {
|
||||
@NotEmpty(message = "appId不能为空!")
|
||||
private String appId;
|
||||
@NotEmpty(message = "appSecret不能为空!")
|
||||
private String appSecret;
|
||||
@ApiModelProperty("客户信息对象")
|
||||
@NotEmpty(message = "客户信息不能为空!")
|
||||
private CrmBusinessSaveBO crmModel;
|
||||
}
|
|
@ -10,6 +10,15 @@ public class QyjbxxBo {
|
|||
* 纳税人识别号
|
||||
*/
|
||||
private String nsrsbh;
|
||||
|
||||
/**
|
||||
* 客户Id
|
||||
*/
|
||||
private Integer customerId;
|
||||
/**
|
||||
* 公海Id
|
||||
*/
|
||||
private Integer poolId;
|
||||
/**
|
||||
* 纳税人名称
|
||||
*/
|
||||
|
|
|
@ -116,6 +116,11 @@ public class CrmQyjbxx implements Serializable {
|
|||
*/
|
||||
private String zgswskfjDm;
|
||||
|
||||
/**
|
||||
* shxydm
|
||||
*/
|
||||
private String shxydm;
|
||||
|
||||
/**
|
||||
* 税收管理员代码
|
||||
*/
|
||||
|
|
|
@ -79,6 +79,7 @@
|
|||
<result column="qyglcjbh" jdbcType="VARCHAR" property="qyglcjbh" />
|
||||
<result column="qyssjt_dm" jdbcType="VARCHAR" property="qyssjtDm" />
|
||||
<result column="stfshxydm" jdbcType="VARCHAR" property="stfshxydm" />
|
||||
<result column="shxydm" jdbcType="VARCHAR" property="shxydm" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
|
|
|
@ -266,4 +266,11 @@ public interface ICrmCustomerService extends BaseService<CrmCustomer> {
|
|||
List<Integer> forgottenCustomer(Integer day, List<Long> userIds, String search);
|
||||
|
||||
List<Integer> unContactCustomer(String search, List<Long> userIds);
|
||||
|
||||
/**
|
||||
* 通过企业名称企业税号联系电话查询客户信息
|
||||
* @param crmModel
|
||||
* @return
|
||||
*/
|
||||
Integer getCustomerByQyjbxx(CrmBusinessSaveBO crmModel);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
package com.kakarote.crm.service;
|
||||
|
||||
import com.kakarote.crm.entity.BO.CrmAddCustomerBo;
|
||||
|
||||
public interface ICrmOpenApiService {
|
||||
void crmAddCustomer(CrmAddCustomerBo crmAddCustomerBo);
|
||||
}
|
||||
|
|
|
@ -39,4 +39,7 @@ public interface ICrmQyfxjcjgZbmxService extends BaseService<CrmQyfxjcjgZbmx> {
|
|||
* @return
|
||||
*/
|
||||
List<CrmQyfxjcjgZbmx> getQyfxjcjgZbmxList(CrmQyfxjcjgZbmx crmQyfxjcjgZbmx);
|
||||
|
||||
List<CrmQyfxjcjgZbmx> getQyfxjcjgZbmxListByJcId(String jcId);
|
||||
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ public interface ICrmQyjbxxService extends BaseService<CrmQyjbxx> {
|
|||
*/
|
||||
CrmQyjbxx getQyjbxxByNsxx(QyjbxxBo qyjbxxBo);
|
||||
|
||||
CrmQyjbxx getQyJbxxByCustomer(QyjbxxBo qyjbxxBo);
|
||||
/**
|
||||
* 通过纳税人名称获取企业基本信息
|
||||
* @param nsrmc
|
||||
|
|
|
@ -102,6 +102,9 @@ public class CrmActivityServiceImpl extends BaseServiceImpl<CrmActivityMapper, C
|
|||
crmActivity.setActivityTypeId(activityTypeId);
|
||||
crmActivity.setContent(content);
|
||||
crmActivity.setCreateUserId(UserUtil.getUserId());
|
||||
if (crmActivity.getCreateUserId() == null) {
|
||||
crmActivity.setCreateUserId(14773L);
|
||||
}
|
||||
crmActivity.setCreateTime(new Date());
|
||||
save(crmActivity);
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.alibaba.fastjson.util.TypeUtils;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.kakarote.core.common.Const;
|
||||
import com.kakarote.core.common.FieldEnum;
|
||||
import com.kakarote.core.common.SystemCodeEnum;
|
||||
|
@ -401,6 +402,9 @@ public class CrmCustomerServiceImpl extends BaseServiceImpl<CrmCustomerMapper, C
|
|||
crmCustomer.setUpdateTime(DateUtil.date());
|
||||
crmCustomer.setReceiveTime(DateUtil.date());
|
||||
crmCustomer.setCreateUserId(UserUtil.getUserId());
|
||||
if (crmCustomer.getCreateUserId() == null) {
|
||||
crmCustomer.setCreateUserId(14773L);
|
||||
}
|
||||
if (!isExcel && crmCustomer.getOwnerUserId() == null) {
|
||||
//导入会手动选择负责人,需要判断
|
||||
crmCustomer.setOwnerUserId(UserUtil.getUserId());
|
||||
|
@ -686,7 +690,12 @@ public class CrmCustomerServiceImpl extends BaseServiceImpl<CrmCustomerMapper, C
|
|||
if (poolBO.getIds().size() == 0) {
|
||||
return;
|
||||
}
|
||||
Long userId = UserUtil.getUserId();
|
||||
Long userId;
|
||||
if (poolBO.getUserId() == null) {
|
||||
userId = UserUtil.getUserId();
|
||||
}else {
|
||||
userId = poolBO.getUserId();
|
||||
}
|
||||
List<CrmOwnerRecord> ownerRecordList = new ArrayList<>();
|
||||
List<CrmCustomerPoolRelation> poolRelationList = new ArrayList<>();
|
||||
for (Integer id : poolBO.getIds()) {
|
||||
|
@ -1559,4 +1568,18 @@ public class CrmCustomerServiceImpl extends BaseServiceImpl<CrmCustomerMapper, C
|
|||
public List<Integer> unContactCustomer(String search, List<Long> userIds) {
|
||||
return getBaseMapper().unContactCustomer(search, userIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过企业名称企业税号联系电话查询客户信息
|
||||
*
|
||||
* @param crmModel
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Integer getCustomerByQyjbxx(CrmBusinessSaveBO crmModel) {
|
||||
CrmCustomer crmCustomer = BeanUtil.copyProperties(crmModel.getEntity(), CrmCustomer.class);
|
||||
LambdaQueryChainWrapper<CrmCustomer> crmCustomerLambdaQueryChainWrapper = this.lambdaQuery()
|
||||
.eq(CrmCustomer::getCustomerName,crmCustomer.getCustomerName());
|
||||
return crmCustomerLambdaQueryChainWrapper.count();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,54 @@
|
|||
package com.kakarote.crm.service.impl;
|
||||
|
||||
import com.kakarote.core.exception.CrmException;
|
||||
import com.kakarote.crm.entity.BO.CrmAddCustomerBo;
|
||||
import com.kakarote.crm.entity.BO.CrmCustomerPoolBO;
|
||||
import com.kakarote.crm.entity.PO.CrmCustomer;
|
||||
import com.kakarote.crm.service.ICrmCustomerService;
|
||||
import com.kakarote.crm.service.ICrmOpenApiService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.kakarote.core.common.SystemCodeEnum.SYSTEM_NO_AUTH;
|
||||
import static com.kakarote.crm.constant.CrmPoolEnum.PXQDMDPOOL;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class CrmOpenApiServiceImpl implements ICrmOpenApiService {
|
||||
@Autowired
|
||||
private ICrmCustomerService customerService;
|
||||
|
||||
|
||||
public void crmAddCustomer(CrmAddCustomerBo crmAddCustomerBo){
|
||||
//权限校验
|
||||
verifyPermissions(crmAddCustomerBo.getAppId(),crmAddCustomerBo.getAppSecret());
|
||||
//判断企业是否存在
|
||||
Integer customerByQyjbxx = customerService.getCustomerByQyjbxx(crmAddCustomerBo.getCrmModel());
|
||||
//存在用户
|
||||
if (customerByQyjbxx >0){
|
||||
|
||||
}else {
|
||||
//添加客户
|
||||
Map<String, Object> stringObjectMap = customerService.addOrUpdate(crmAddCustomerBo.getCrmModel(), false, null);
|
||||
// CrmCustomer crmCustomer = (CrmCustomer) stringObjectMap.get("entity");
|
||||
Integer customerId = Integer.parseInt(stringObjectMap.get("customerId").toString());
|
||||
log.info("添加成功stringObjectMap:{}",stringObjectMap.toString());
|
||||
//转入公海
|
||||
CrmCustomerPoolBO poolBO = new CrmCustomerPoolBO();
|
||||
poolBO.setIds(Arrays.asList(customerId));
|
||||
poolBO.setPoolId(PXQDMDPOOL.getId());
|
||||
customerService.updateCustomerByIds(poolBO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void verifyPermissions(String appId,String appSecret){
|
||||
if (!"101011".equals(appId) && !"crmopenapi".equals(appSecret)){
|
||||
throw new CrmException(SYSTEM_NO_AUTH);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.kakarote.crm.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.kakarote.core.servlet.BaseServiceImpl;
|
||||
import com.kakarote.crm.entity.PO.CrmQyfxjcjgZbmx;
|
||||
import com.kakarote.crm.mapper.CrmQyfxjcjgZbmxMapper;
|
||||
|
@ -41,4 +42,11 @@ public class CrmQyfxjcjgZbmxServiceImpl extends BaseServiceImpl<CrmQyfxjcjgZbmxM
|
|||
CrmQyfxjcjgZbmxQueryWrapper.eq("jcpc_uuid",crmQyfxjcjgZbmx.getJcpcUuid());
|
||||
return crmQyfxjcjgZbmxMapper.selectList(CrmQyfxjcjgZbmxQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CrmQyfxjcjgZbmx> getQyfxjcjgZbmxListByJcId(String jcId) {
|
||||
return new LambdaQueryChainWrapper<>(crmQyfxjcjgZbmxMapper)
|
||||
.eq(CrmQyfxjcjgZbmx::getJcpcUuid,jcId)
|
||||
.list();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,11 +6,15 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.kakarote.core.exception.CrmException;
|
||||
import com.kakarote.core.feign.crm.service.CrmService;
|
||||
import com.kakarote.core.redis.RedisImpl;
|
||||
import com.kakarote.core.servlet.BaseServiceImpl;
|
||||
import com.kakarote.crm.common.CrmModel;
|
||||
import com.kakarote.crm.entity.BO.QyjbxxBo;
|
||||
import com.kakarote.crm.entity.PO.CrmQyjbxx;
|
||||
import com.kakarote.crm.mapper.CrmQyjbxxMapper;
|
||||
import com.kakarote.crm.service.ICrmCustomerService;
|
||||
import com.kakarote.crm.service.ICrmQyjbxxService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -18,11 +22,17 @@ import java.util.List;
|
|||
|
||||
import static com.kakarote.core.common.SystemCodeEnum.SYSTEM_NO_VALID;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class CrmQyjbxxServiceImpl extends BaseServiceImpl<CrmQyjbxxMapper, CrmQyjbxx> implements ICrmQyjbxxService {
|
||||
@Autowired
|
||||
private CrmQyjbxxMapper crmQyjbxxMapper;
|
||||
|
||||
@Autowired
|
||||
private ICrmCustomerService crmCustomerService;
|
||||
|
||||
private RedisImpl redis;
|
||||
|
||||
|
||||
/**
|
||||
* 通过企业Id查询企业基本信息
|
||||
|
@ -47,9 +57,16 @@ public class CrmQyjbxxServiceImpl extends BaseServiceImpl<CrmQyjbxxMapper, CrmQy
|
|||
return eq.eq(CrmQyjbxx::getNsrsbh, qyjbxxBo.getNsrsbh()).last("limit 1").one();
|
||||
}else if (StrUtil.isNotBlank(qyjbxxBo.getNsrmc())) {
|
||||
return eq.eq(CrmQyjbxx::getNsrmc, qyjbxxBo.getNsrmc()).last("limit 1").one();
|
||||
}else {
|
||||
throw new CrmException(SYSTEM_NO_VALID);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CrmQyjbxx getQyJbxxByCustomer(QyjbxxBo qyjbxxBo) {
|
||||
CrmModel model = crmCustomerService.queryById(qyjbxxBo.getCustomerId(), qyjbxxBo.getPoolId());
|
||||
log.info("客户信息:{}", model);
|
||||
qyjbxxBo.setNsrsbh(model.get("website").toString());
|
||||
return getQyjbxxByNsxx(qyjbxxBo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
package com.kakarote.crm.util;
|
||||
|
||||
import org.mybatis.generator.api.IntrospectedColumn;
|
||||
import org.mybatis.generator.api.IntrospectedTable;
|
||||
import org.mybatis.generator.api.dom.java.Field;
|
||||
import org.mybatis.generator.internal.DefaultCommentGenerator;
|
||||
import org.mybatis.generator.internal.util.StringUtility;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
|
||||
/**
|
||||
* @Author: JCccc
|
||||
* @Date: 2022-7-13 10:09
|
||||
* @Description: 注释添加
|
||||
*/
|
||||
public class CommentGenerator extends DefaultCommentGenerator {
|
||||
private boolean addRemarkComments = false;
|
||||
|
||||
/**
|
||||
* 设置用户配置的参数
|
||||
*/
|
||||
@Override
|
||||
public void addConfigurationProperties(Properties properties) {
|
||||
super.addConfigurationProperties(properties);
|
||||
this.addRemarkComments = StringUtility.isTrue(properties.getProperty("addRemarkComments"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 给字段添加注释
|
||||
*/
|
||||
@Override
|
||||
public void addFieldComment(Field field, IntrospectedTable introspectedTable,
|
||||
IntrospectedColumn introspectedColumn) {
|
||||
String remarks = introspectedColumn.getRemarks();
|
||||
//根据参数和备注信息判断是否添加备注信息
|
||||
if (addRemarkComments && StringUtility.stringHasValue(remarks)) {
|
||||
addFieldJavaDoc(field, remarks);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 给model的字段添加注释
|
||||
*/
|
||||
private void addFieldJavaDoc(Field field, String remarks) {
|
||||
//文档注释开始
|
||||
field.addJavaDocLine("/**");
|
||||
//获取数据库字段的备注信息
|
||||
String[] remarkLines = remarks.split(System.getProperty("line.separator"));
|
||||
for (String remarkLine : remarkLines) {
|
||||
field.addJavaDocLine(" * " + remarkLine);
|
||||
}
|
||||
addJavadocTag(field, false);
|
||||
field.addJavaDocLine(" */");
|
||||
}
|
||||
|
||||
}
|
|
@ -45,7 +45,7 @@ public class PermissionServiceImpl implements PermissionService {
|
|||
/**
|
||||
* 不需要cookies
|
||||
*/
|
||||
private static final List<String> NOT_AUTH_URLS = Lists.newArrayList("/crmMarketing/queryMarketingId", "/crmMarketing/queryAddField", "/crmMarketing/saveMarketingInfo", "/adminUser/queryLoginUser", "/crmCall/upload","/adminUser/querySystemStatus","/adminUser/initUser","/crmCustomer/queryPageList","/openApi/crm/addCorporateSeas");
|
||||
private static final List<String> NOT_AUTH_URLS = Lists.newArrayList("/crmMarketing/queryMarketingId", "/crmMarketing/queryAddField", "/crmMarketing/saveMarketingInfo", "/adminUser/queryLoginUser", "/crmCall/upload","/adminUser/querySystemStatus","/adminUser/initUser","/crmCustomer/queryPageList","/crmOpenApi/crm/addCorporateSeas");
|
||||
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue