feat():修改企业生成账号登录问题
parent
040f466b7f
commit
2914d640f2
|
@ -22,6 +22,11 @@
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>muyu-common-core</artifactId>
|
<artifactId>muyu-common-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
@ -29,7 +30,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@TableName("enterprise")
|
@TableName("enterprise")
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ApiModel(value = "Enterprise", description = "企业信息")
|
@ApiModel(value = "Enterprise", description = "车辆运营平台")
|
||||||
public class Enterprise extends BaseEntity {
|
public class Enterprise extends BaseEntity {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
@ -37,7 +38,7 @@ public class Enterprise extends BaseEntity {
|
||||||
/** 主键 */
|
/** 主键 */
|
||||||
@TableId(value = "id",type = IdType.AUTO)
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
@ApiModelProperty(name = "主键", value = "主键")
|
@ApiModelProperty(name = "主键", value = "主键")
|
||||||
private String id;
|
private Integer id;
|
||||||
|
|
||||||
/** 企业名称 */
|
/** 企业名称 */
|
||||||
@Excel(name = "企业名称")
|
@Excel(name = "企业名称")
|
||||||
|
@ -83,7 +84,7 @@ public class Enterprise extends BaseEntity {
|
||||||
/** 企业当前状态 */
|
/** 企业当前状态 */
|
||||||
@Excel(name = "企业当前状态")
|
@Excel(name = "企业当前状态")
|
||||||
@ApiModelProperty(name = "企业当前状态", value = "企业当前状态")
|
@ApiModelProperty(name = "企业当前状态", value = "企业当前状态")
|
||||||
private String status;
|
private String enterpriseStatus;
|
||||||
|
|
||||||
/** 企业入驻平台时期 */
|
/** 企业入驻平台时期 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@ -130,7 +131,7 @@ public class Enterprise extends BaseEntity {
|
||||||
.address(enterpriseQueryReq.getAddress())
|
.address(enterpriseQueryReq.getAddress())
|
||||||
.contactPhone(enterpriseQueryReq.getContactPhone())
|
.contactPhone(enterpriseQueryReq.getContactPhone())
|
||||||
.email(enterpriseQueryReq.getEmail())
|
.email(enterpriseQueryReq.getEmail())
|
||||||
.status(enterpriseQueryReq.getStatus())
|
.enterpriseStatus(enterpriseQueryReq.getEnterpriseStatus())
|
||||||
.registrationDate(enterpriseQueryReq.getRegistrationDate())
|
.registrationDate(enterpriseQueryReq.getRegistrationDate())
|
||||||
.certificationId(enterpriseQueryReq.getCertificationId())
|
.certificationId(enterpriseQueryReq.getCertificationId())
|
||||||
.authenticationDate(enterpriseQueryReq.getAuthenticationDate())
|
.authenticationDate(enterpriseQueryReq.getAuthenticationDate())
|
||||||
|
@ -153,43 +154,40 @@ public class Enterprise extends BaseEntity {
|
||||||
.address(enterpriseSaveReq.getAddress())
|
.address(enterpriseSaveReq.getAddress())
|
||||||
.contactPhone(enterpriseSaveReq.getContactPhone())
|
.contactPhone(enterpriseSaveReq.getContactPhone())
|
||||||
.email(enterpriseSaveReq.getEmail())
|
.email(enterpriseSaveReq.getEmail())
|
||||||
.status(enterpriseSaveReq.getStatus())
|
.enterpriseStatus(enterpriseSaveReq.getEnterpriseStatus())
|
||||||
.registrationDate(enterpriseSaveReq.getRegistrationDate())
|
.registrationDate(enterpriseSaveReq.getRegistrationDate())
|
||||||
.certificationId(enterpriseSaveReq.getCertificationId())
|
.certificationId(enterpriseSaveReq.getCertificationId())
|
||||||
.authenticationDate(enterpriseSaveReq.getAuthenticationDate())
|
.authenticationDate(enterpriseSaveReq.getAuthenticationDate())
|
||||||
.serviceLevel(enterpriseSaveReq.getServiceLevel())
|
.serviceLevel(enterpriseSaveReq.getServiceLevel())
|
||||||
.openServerId(enterpriseSaveReq.getOpenServerId())
|
.openServerId(enterpriseSaveReq.getOpenServerId())
|
||||||
.addServerId(enterpriseSaveReq.getAddServerId())
|
.addServerId(enterpriseSaveReq.getAddServerId())
|
||||||
.createBy(enterpriseSaveReq.getCreateBy())
|
.createBy(SecurityUtils.getUsername())
|
||||||
.createTime(new Date())
|
.createTime(new Date())
|
||||||
.remark(enterpriseSaveReq.getRemark())
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改构造器
|
* 修改构造器
|
||||||
*/
|
*/
|
||||||
public static Enterprise editBuild(String id, EnterpriseEditReq enterpriseEditReq){
|
public static Enterprise editBuild(Integer id, EnterpriseEditReq enterpriseEditReq){
|
||||||
return Enterprise.builder()
|
return Enterprise.builder()
|
||||||
.id(id)
|
.id(id)
|
||||||
.ebterpriseName(enterpriseEditReq.getEbterpriseName())
|
.ebterpriseName(enterpriseEditReq.getEbterpriseName()) .legalPerson(enterpriseEditReq.getLegalPerson())
|
||||||
.legalPerson(enterpriseEditReq.getLegalPerson())
|
|
||||||
.businessLincenseNumber(enterpriseEditReq.getBusinessLincenseNumber())
|
.businessLincenseNumber(enterpriseEditReq.getBusinessLincenseNumber())
|
||||||
.estabinessDate(enterpriseEditReq.getEstabinessDate())
|
.estabinessDate(enterpriseEditReq.getEstabinessDate())
|
||||||
.businessScope(enterpriseEditReq.getBusinessScope())
|
.businessScope(enterpriseEditReq.getBusinessScope())
|
||||||
.address(enterpriseEditReq.getAddress())
|
.address(enterpriseEditReq.getAddress())
|
||||||
.contactPhone(enterpriseEditReq.getContactPhone())
|
.contactPhone(enterpriseEditReq.getContactPhone())
|
||||||
.email(enterpriseEditReq.getEmail())
|
.email(enterpriseEditReq.getEmail())
|
||||||
.status(enterpriseEditReq.getStatus())
|
.enterpriseStatus(enterpriseEditReq.getEnterpriseStatus())
|
||||||
.registrationDate(enterpriseEditReq.getRegistrationDate())
|
.registrationDate(enterpriseEditReq.getRegistrationDate())
|
||||||
.certificationId(enterpriseEditReq.getCertificationId())
|
.certificationId(enterpriseEditReq.getCertificationId())
|
||||||
.authenticationDate(enterpriseEditReq.getAuthenticationDate())
|
.authenticationDate(enterpriseEditReq.getAuthenticationDate())
|
||||||
.serviceLevel(enterpriseEditReq.getServiceLevel())
|
.serviceLevel(enterpriseEditReq.getServiceLevel())
|
||||||
.openServerId(enterpriseEditReq.getOpenServerId())
|
.openServerId(enterpriseEditReq.getOpenServerId())
|
||||||
.addServerId(enterpriseEditReq.getAddServerId())
|
.addServerId(enterpriseEditReq.getAddServerId())
|
||||||
.updateBy(enterpriseEditReq.getUpdateBy())
|
.updateBy(SecurityUtils.getUsername())
|
||||||
.updateTime(new Date())
|
.updateTime(new Date())
|
||||||
.remark(enterpriseEditReq.getRemark())
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,18 +9,19 @@ import lombok.AllArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业信息对象 enterprise
|
* 车辆运营平台对象 enterprise
|
||||||
*
|
*
|
||||||
* @author muyu
|
* @author muyu
|
||||||
* @date 2024-05-27
|
* @date 2024-06-05
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@ApiModel(value = "EnterpriseEditReq", description = "企业信息")
|
@ApiModel(value = "EnterpriseEditReq", description = "车辆运营平台")
|
||||||
public class EnterpriseEditReq extends BaseEntity {
|
public class EnterpriseEditReq extends BaseEntity {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
@ -60,7 +61,7 @@ public class EnterpriseEditReq extends BaseEntity {
|
||||||
|
|
||||||
/** 企业当前状态 */
|
/** 企业当前状态 */
|
||||||
@ApiModelProperty(name = "企业当前状态", value = "企业当前状态")
|
@ApiModelProperty(name = "企业当前状态", value = "企业当前状态")
|
||||||
private String status;
|
private String enterpriseStatus;
|
||||||
|
|
||||||
/** 企业入驻平台时期 */
|
/** 企业入驻平台时期 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
|
|
@ -11,16 +11,16 @@ import io.swagger.annotations.*;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业信息对象 enterprise
|
* 车辆运营平台对象 enterprise
|
||||||
*
|
*
|
||||||
* @author muyu
|
* @author muyu
|
||||||
* @date 2024-05-27
|
* @date 2024-06-05
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@ApiModel(value = "EnterpriseQueryReq", description = "企业信息")
|
@ApiModel(value = "EnterpriseQueryReq", description = "车辆运营平台")
|
||||||
public class EnterpriseQueryReq extends BaseEntity {
|
public class EnterpriseQueryReq extends BaseEntity {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
@ -60,7 +60,7 @@ public class EnterpriseQueryReq extends BaseEntity {
|
||||||
|
|
||||||
/** 企业当前状态 */
|
/** 企业当前状态 */
|
||||||
@ApiModelProperty(name = "企业当前状态", value = "企业当前状态")
|
@ApiModelProperty(name = "企业当前状态", value = "企业当前状态")
|
||||||
private String status;
|
private String enterpriseStatus;
|
||||||
|
|
||||||
/** 企业入驻平台时期 */
|
/** 企业入驻平台时期 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
|
|
@ -11,16 +11,16 @@ import io.swagger.annotations.*;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业信息对象 enterprise
|
* 车辆运营平台对象 enterprise
|
||||||
*
|
*
|
||||||
* @author muyu
|
* @author muyu
|
||||||
* @date 2024-05-27
|
* @date 2024-06-05
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@ApiModel(value = "EnterpriseSaveReq", description = "企业信息")
|
@ApiModel(value = "EnterpriseSaveReq", description = "车辆运营平台")
|
||||||
public class EnterpriseSaveReq extends BaseEntity {
|
public class EnterpriseSaveReq extends BaseEntity {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
@ -74,7 +74,7 @@ public class EnterpriseSaveReq extends BaseEntity {
|
||||||
/** 企业当前状态 */
|
/** 企业当前状态 */
|
||||||
|
|
||||||
@ApiModelProperty(name = "企业当前状态", value = "企业当前状态")
|
@ApiModelProperty(name = "企业当前状态", value = "企业当前状态")
|
||||||
private String status;
|
private String enterpriseStatus;
|
||||||
|
|
||||||
/** 企业入驻平台时期 */
|
/** 企业入驻平台时期 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
|
|
@ -10,17 +10,12 @@ import com.muyu.common.system.domain.SysDept;
|
||||||
import com.muyu.common.system.domain.SysUser;
|
import com.muyu.common.system.domain.SysUser;
|
||||||
import com.muyu.system.remote.RemoteSysDeptService;
|
import com.muyu.system.remote.RemoteSysDeptService;
|
||||||
import com.muyu.system.remote.RemoteSysUserService;
|
import com.muyu.system.remote.RemoteSysUserService;
|
||||||
|
import com.muyu.system.remote.factory.RemoteSysDeptFactory;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||||
import com.muyu.common.core.web.controller.BaseController;
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
|
@ -35,23 +30,21 @@ import com.muyu.net.working.service.EnterpriseService;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业信息Controller
|
* 车辆运营平台Controller
|
||||||
*
|
*
|
||||||
* @author muyu
|
* @author muyu
|
||||||
* @date 2024-05-27
|
* @date 2024-06-05
|
||||||
*/
|
*/
|
||||||
@Api(tags = "车辆运营平台")
|
@Api(tags = "车辆运营平台")
|
||||||
@Log4j2
|
@Log4j2
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/car")
|
@RequestMapping("/car")
|
||||||
public class EnterpriseController extends BaseController {
|
public class EnterpriseController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private EnterpriseService enterpriseService;
|
private EnterpriseService enterpriseService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RemoteSysDeptService remoteSysDeptService;
|
private RemoteSysDeptService remoteSysDeptService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RemoteSysUserService remoteSysUserService;
|
private RemoteSysUserService remoteSysUserService;
|
||||||
|
|
||||||
|
@ -164,10 +157,21 @@ public class EnterpriseController extends BaseController {
|
||||||
@Log(title = "车辆运营平台", businessType = BusinessType.UPDATE)
|
@Log(title = "车辆运营平台", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/{id}")
|
@PutMapping("/{id}")
|
||||||
@ApiOperation("修改车辆运营平台")
|
@ApiOperation("修改车辆运营平台")
|
||||||
public Result<String> edit(@PathVariable String id, @RequestBody EnterpriseEditReq enterpriseEditReq) {
|
public Result<String> edit(@PathVariable Integer id, @RequestBody EnterpriseEditReq enterpriseEditReq) {
|
||||||
|
String username = SecurityUtils.getUsername();
|
||||||
return toAjax(enterpriseService.updateById(Enterprise.editBuild(id,enterpriseEditReq)));
|
return toAjax(enterpriseService.updateById(Enterprise.editBuild(id,enterpriseEditReq)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运营平台列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/selectByName")
|
||||||
|
public Result<Enterprise> selectByName() {
|
||||||
|
String username = SecurityUtils.getLoginUser().getUsername();
|
||||||
|
Enterprise enterprise = enterpriseService.selectByName(username);
|
||||||
|
return Result.success(enterprise);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除车辆运营平台
|
* 删除车辆运营平台
|
||||||
*/
|
*/
|
||||||
|
@ -177,7 +181,26 @@ public class EnterpriseController extends BaseController {
|
||||||
@ApiOperation("删除车辆运营平台")
|
@ApiOperation("删除车辆运营平台")
|
||||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "String", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "String", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
||||||
public Result<String> remove(@PathVariable List<String> ids) {
|
public Result<String> remove(@PathVariable List<String> ids) {
|
||||||
|
|
||||||
return toAjax(enterpriseService.removeBatchByIds(ids));
|
return toAjax(enterpriseService.removeBatchByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完善企业信息
|
||||||
|
* @param id
|
||||||
|
* @param enterpriseEditReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/updateEnterprise/{id}")
|
||||||
|
public Result<String> updateEnterprise(@PathVariable Integer id, @RequestBody EnterpriseEditReq enterpriseEditReq) {
|
||||||
|
return toAjax(enterpriseService.updateById(Enterprise.editBuild(id,enterpriseEditReq)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业认证
|
||||||
|
*/
|
||||||
|
@PostMapping("/authentication")
|
||||||
|
public Result<String> authentication(@RequestBody Enterprise enterprise ) {
|
||||||
|
enterpriseService.authentication(enterprise);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.net.working.mapper;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.net.working.domain.Enterprise;
|
import com.muyu.net.working.domain.Enterprise;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业信息Mapper接口
|
* 企业信息Mapper接口
|
||||||
|
@ -12,4 +13,8 @@ import com.muyu.net.working.domain.Enterprise;
|
||||||
*/
|
*/
|
||||||
public interface EnterpriseMapper extends BaseMapper<Enterprise> {
|
public interface EnterpriseMapper extends BaseMapper<Enterprise> {
|
||||||
|
|
||||||
|
Enterprise selectByName(@Param("name") String name);
|
||||||
|
|
||||||
|
void authentication(Enterprise enterprise);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,10 @@ public interface EnterpriseService extends IService<Enterprise> {
|
||||||
* @param enterprise 企业信息
|
* @param enterprise 企业信息
|
||||||
* @return 企业信息集合
|
* @return 企业信息集合
|
||||||
*/
|
*/
|
||||||
public List<Enterprise> list(Enterprise enterprise);
|
List<Enterprise> list(Enterprise enterprise);
|
||||||
|
|
||||||
|
Enterprise selectByName(String name);
|
||||||
|
|
||||||
|
void authentication(Enterprise enterprise);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,18 @@
|
||||||
package com.muyu.net.working.service.impl;
|
package com.muyu.net.working.service.impl;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.muyu.common.core.utils.ObjUtils;
|
import com.muyu.common.core.utils.ObjUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.muyu.net.working.mapper.EnterpriseMapper;
|
import com.muyu.net.working.mapper.EnterpriseMapper;
|
||||||
import com.muyu.net.working.domain.Enterprise;
|
import com.muyu.net.working.domain.Enterprise;
|
||||||
|
@ -21,11 +30,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@Service
|
@Service
|
||||||
public class EnterpriseServiceImpl extends ServiceImpl<EnterpriseMapper, Enterprise> implements EnterpriseService {
|
public class EnterpriseServiceImpl extends ServiceImpl<EnterpriseMapper, Enterprise> implements EnterpriseService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EnterpriseMapper enterpriseMapper;
|
||||||
/**
|
/**
|
||||||
* 查询企业信息列表
|
* 查询车辆运营平台列表
|
||||||
*
|
*
|
||||||
* @param enterprise 企业信息
|
* @param enterprise 车辆运营平台
|
||||||
* @return 企业信息
|
* @return 车辆运营平台
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Enterprise> list(Enterprise enterprise) {
|
public List<Enterprise> list(Enterprise enterprise) {
|
||||||
|
@ -64,8 +75,8 @@ public class EnterpriseServiceImpl extends ServiceImpl<EnterpriseMapper, Enterpr
|
||||||
queryWrapper.eq(Enterprise::getEmail, enterprise.getEmail());
|
queryWrapper.eq(Enterprise::getEmail, enterprise.getEmail());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ObjUtils.notNull(enterprise.getStatus())){
|
if (ObjUtils.notNull(enterprise.getEnterpriseStatus())){
|
||||||
queryWrapper.eq(Enterprise::getStatus, enterprise.getStatus());
|
queryWrapper.eq(Enterprise::getEnterpriseStatus, enterprise.getEnterpriseStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ObjUtils.notNull(enterprise.getRegistrationDate())){
|
if (ObjUtils.notNull(enterprise.getRegistrationDate())){
|
||||||
|
@ -92,10 +103,59 @@ public class EnterpriseServiceImpl extends ServiceImpl<EnterpriseMapper, Enterpr
|
||||||
queryWrapper.eq(Enterprise::getAddServerId, enterprise.getAddServerId());
|
queryWrapper.eq(Enterprise::getAddServerId, enterprise.getAddServerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return list(queryWrapper);
|
return list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Enterprise selectByName(String name) {
|
||||||
|
return enterpriseMapper.selectByName(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void authentication(Enterprise enterprise) {
|
||||||
|
enterpriseMapper.authentication(enterprise);
|
||||||
|
try {
|
||||||
|
postTest(enterprise);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void postTest(Enterprise enterprise) throws Exception {
|
||||||
|
// 1.请求URL
|
||||||
|
String postUrl = "http://101.34.248.9:10006/webhook/%E6%96%B0%E5%BB%BA%E4%BC%81%E4%B8%9A%E6%95%B0%E6%8D%AE%E5%BA%93";
|
||||||
|
// 2.请求参数JSON格式
|
||||||
|
Integer id = enterprise.getId();
|
||||||
|
Map<String, String> parammap = new HashMap<>();
|
||||||
|
parammap.put("entId", "jiang-"+id);
|
||||||
|
parammap.put("mysqlPort", String.valueOf(3306+enterprise.getId()));
|
||||||
|
String json = JSON.toJSONString(parammap);
|
||||||
|
// 3.创建连接与设置连接参数
|
||||||
|
URL urlObj = new URL(postUrl);
|
||||||
|
HttpURLConnection httpConn = (HttpURLConnection) urlObj.openConnection();
|
||||||
|
httpConn.setRequestMethod("POST");
|
||||||
|
httpConn.setRequestProperty("Charset", "UTF-8");
|
||||||
|
// POST请求且JSON数据,必须设置
|
||||||
|
httpConn.setRequestProperty("Content-Type", "application/json");
|
||||||
|
// 打开输出流,默认是false
|
||||||
|
httpConn.setDoOutput(true);
|
||||||
|
// 打开输入流,默认是true,可省略
|
||||||
|
httpConn.setDoInput(true);
|
||||||
|
// 4.从HttpURLConnection获取输出流和写数据
|
||||||
|
OutputStream oStream = httpConn.getOutputStream();
|
||||||
|
oStream.write(json.getBytes());
|
||||||
|
oStream.flush();
|
||||||
|
// 5.发起http调用(getInputStream触发http请求)
|
||||||
|
if (httpConn.getResponseCode() != 200) {
|
||||||
|
throw new Exception("调用服务端异常.");
|
||||||
|
}
|
||||||
|
// 6.从HttpURLConnection获取输入流和读数据
|
||||||
|
BufferedReader br = new BufferedReader(
|
||||||
|
new InputStreamReader(httpConn.getInputStream()));
|
||||||
|
String resultData = br.readLine();
|
||||||
|
System.out.println("从服务端返回结果: " + resultData);
|
||||||
|
// 7.关闭HttpURLConnection连接
|
||||||
|
httpConn.disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="address" column="address" />
|
<result property="address" column="address" />
|
||||||
<result property="contactPhone" column="contact_phone" />
|
<result property="contactPhone" column="contact_phone" />
|
||||||
<result property="email" column="email" />
|
<result property="email" column="email" />
|
||||||
<result property="status" column="status" />
|
<result property="enterpriseStatus" column="enterprise_status" />
|
||||||
<result property="registrationDate" column="registration_date" />
|
<result property="registrationDate" column="registration_date" />
|
||||||
<result property="certificationId" column="certification_id" />
|
<result property="certificationId" column="certification_id" />
|
||||||
<result property="authenticationDate" column="authentication_date" />
|
<result property="authenticationDate" column="authentication_date" />
|
||||||
|
@ -29,6 +29,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectEnterpriseVo">
|
<sql id="selectEnterpriseVo">
|
||||||
select id, ebterprise_name, legal_person, business_lincense_number, estabiness_date, business_scope, address, contact_phone, email, status, registration_date, certification_id, authentication_date, service_level, open_server_id, add_server_id, create_by, create_time, update_by, update_time, remark from enterprise
|
select id, ebterprise_name, legal_person, business_lincense_number, estabiness_date, business_scope, address, contact_phone, email, enterprise_status, registration_date, certification_id, authentication_date, service_level, open_server_id, add_server_id, create_by, create_time, update_by, update_time, remark from enterprise
|
||||||
</sql>
|
</sql>
|
||||||
|
<update id="authentication">
|
||||||
|
update enterprise set enterprise_status = 'N' where id = #{id}
|
||||||
|
</update>
|
||||||
|
<select id="selectByName" resultType="com.muyu.net.working.domain.Enterprise">
|
||||||
|
select * from enterprise where ebterprise_name = #{name}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -11,6 +11,12 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 远程调用部门接口 RemoteSysDeptService
|
||||||
|
*
|
||||||
|
* @author PengJiang
|
||||||
|
* Date 2024/6/7 09:00
|
||||||
|
*/
|
||||||
@FeignClient(
|
@FeignClient(
|
||||||
contextId = "remoteSysDeptService",
|
contextId = "remoteSysDeptService",
|
||||||
value = ServiceNameConstants.SYSTEM_SERVICE,
|
value = ServiceNameConstants.SYSTEM_SERVICE,
|
||||||
|
@ -18,11 +24,9 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||||
path = "/dept"
|
path = "/dept"
|
||||||
)
|
)
|
||||||
public interface RemoteSysDeptService {
|
public interface RemoteSysDeptService {
|
||||||
|
|
||||||
@GetMapping("/selectDeptByName")
|
@GetMapping("/selectDeptByName")
|
||||||
public Result<SysDept> selectDeptByName (@RequestParam("name") String name);
|
Result<SysDept> selectDeptByName(@RequestParam("name") String name);
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result add (@Validated @RequestBody SysDept dept);
|
Result add(@Validated @RequestBody SysDept dept);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,12 @@ import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 远程调用用户 RemoteSysUserService
|
||||||
|
*
|
||||||
|
* @author PengJiang
|
||||||
|
* Date 2024/6/7 08:51
|
||||||
|
*/
|
||||||
@FeignClient(
|
@FeignClient(
|
||||||
contextId = "remoteSysUserService",
|
contextId = "remoteSysUserService",
|
||||||
value = ServiceNameConstants.SYSTEM_SERVICE,
|
value = ServiceNameConstants.SYSTEM_SERVICE,
|
||||||
|
@ -24,5 +30,5 @@ public interface RemoteSysUserService {
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("system:user:add")
|
@RequiresPermissions("system:user:add")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result add (@Validated @RequestBody SysUser user);
|
Result add(@Validated @RequestBody SysUser user);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,6 @@
|
||||||
<sql id="selectUserVo">
|
<sql id="selectUserVo">
|
||||||
select u.user_id,
|
select u.user_id,
|
||||||
u.dept_id,
|
u.dept_id,
|
||||||
-- u.type,
|
|
||||||
u.user_name,
|
u.user_name,
|
||||||
u.nick_name,
|
u.nick_name,
|
||||||
u.email,
|
u.email,
|
||||||
|
|
Loading…
Reference in New Issue