企业在线管理修改

cert
anthonywj 2 years ago
parent 6d6166fd44
commit 1dad2813f8

@ -1,5 +1,6 @@
package com.glxp.api.controller.sup;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
@ -15,6 +16,7 @@ import com.glxp.api.req.basic.ProductInfoFilterRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.auth.registComPerResponse;
import com.glxp.api.res.sup.UserCompanyOnlineResponse;
import com.glxp.api.res.sup.UserCompanyResponse;
import com.glxp.api.service.sup.UserCompanyOnlineService;
import com.glxp.api.service.sup.UserCompanyService;
import com.glxp.api.util.DateUtil;
@ -24,6 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
@ -76,6 +79,7 @@ public class UserComanyController extends BaseController {
/**
* 线
*
* @param filterUserComapanyRequest
* @return
*/
@ -84,20 +88,36 @@ public class UserComanyController extends BaseController {
public BaseResponse filterCompanyStaus(FilterUserComapanyRequest filterUserComapanyRequest) {
List<UserCompanyEntity> userCompanyEntities = userCompanyService.filterCompanyName(filterUserComapanyRequest);
List<UserCompanyResponse> userCompanyResponses = new ArrayList<>();
if (CollUtil.isNotEmpty(userCompanyEntities)) {
for (UserCompanyEntity userCompanyEntity : userCompanyEntities) {
UserCompanyResponse userCompanyResponse = new UserCompanyResponse();
BeanUtil.copyProperties(userCompanyEntity, userCompanyResponse);
userCompanyResponse.setRemark(null);
UserCompanyOnlineResponse userCompanyOnlineResponse = userCompanyOnlineService.findOnLineByConfig(userCompanyEntity.getId());
if (DateUtil.isExpire(userCompanyOnlineResponse.getUpdateTime(), userCompanyOnlineResponse.getHeartRate())) {
userCompanyEntity.setOnLineStatus(2);
} else
userCompanyEntity.setOnLineStatus(1);
if (userCompanyOnlineResponse == null) {
userCompanyResponse.setOnLineStatus(3);
} else {
if (userCompanyOnlineResponse.getUpdateTime() == null) {
userCompanyResponse.setOnLineStatus(3);
} else if (DateUtil.isExpire(userCompanyOnlineResponse.getUpdateTime(), userCompanyOnlineResponse.getHeartRate())) {
userCompanyResponse.setOnLineStatus(2);
} else {
userCompanyResponse.setOnLineStatus(1);
}
userCompanyResponse.setUpdateTime(userCompanyOnlineResponse.getUpdateTime());
userCompanyResponse.setHeartRate(userCompanyOnlineResponse.getHeartRate());
userCompanyResponse.setLastIp(userCompanyOnlineResponse.getLastIp());
userCompanyResponse.setRemark(userCompanyOnlineResponse.getRemark());
userCompanyResponse.setUserId(userCompanyOnlineResponse.getUserId());
}
userCompanyResponses.add(userCompanyResponse);
}
}
PageInfo<UserCompanyEntity> pageInfo = new PageInfo<>(userCompanyEntities);
PageSimpleResponse<UserCompanyEntity> pageSimpleResponse = new PageSimpleResponse<>();
PageInfo<UserCompanyResponse> pageInfo = new PageInfo<>(userCompanyResponses);
PageSimpleResponse<UserCompanyResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(userCompanyEntities);
pageSimpleResponse.setList(userCompanyResponses);
return ResultVOUtils.success(pageSimpleResponse);
}

@ -1,12 +1,15 @@
package com.glxp.api.controller.sup;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.entity.sup.UserCompanyConfigEntity;
import com.glxp.api.req.sup.UserCompanyConfigRequest;
import com.glxp.api.service.sup.UserCompanyConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@ -19,11 +22,22 @@ public class UserCompanyConfigController {
@Resource
UserCompanyConfigService userCompanyConfigService;
//获取企业任务配置
//企业登录后获取企业任务配置
@PostMapping("/admin/user/config/get")
public BaseResponse heartPost(String companyId) {
UserCompanyConfigEntity userCompanyConfigEntity = userCompanyConfigService.getOne(new QueryWrapper<UserCompanyConfigEntity>().eq("companyId", companyId));
return ResultVOUtils.success(userCompanyConfigEntity);
}
//编辑企业设置
@PostMapping("/admin/user/config/update")
public BaseResponse updateConfig(@RequestBody UserCompanyConfigRequest userCompanyConfigRequest) {
UserCompanyConfigEntity userCompanyConfigEntity = new UserCompanyConfigEntity();
BeanUtil.copyProperties(userCompanyConfigRequest, userCompanyConfigEntity);
userCompanyConfigService.updateByCompanyId(userCompanyConfigEntity);
return ResultVOUtils.success("修改成功!");
}
}

@ -6,6 +6,7 @@ import com.glxp.api.entity.sup.UserCompanyOnlineEntity;
import com.glxp.api.req.sup.UserCompanyOnlineRequest;
import com.glxp.api.service.sup.UserCompanyOnlineService;
import com.glxp.api.util.BeanCopyUtils;
import com.glxp.api.util.IpUtils;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
@ -13,6 +14,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
@Api(tags = "心跳任务接口")
@RestController
@ -29,12 +32,13 @@ public class UserOnLineController {
* @return
*/
@PostMapping("/admin/user/online/heart")
public BaseResponse heartPost(@RequestBody UserCompanyOnlineRequest userCompanyOnlineRequest) {
public BaseResponse heartPost(@RequestBody UserCompanyOnlineRequest userCompanyOnlineRequest, HttpServletRequest request) {
UserCompanyOnlineEntity userCompanyOnlineEntity = new UserCompanyOnlineEntity();
BeanCopyUtils.copy(userCompanyOnlineRequest, userCompanyOnlineEntity);
userCompanyOnlineEntity.setUpdateTime(new Date());
userCompanyOnlineEntity.setLastIp(IpUtils.getIpAddr(request));
userCompanyOnlineService.saveOrUpdate(userCompanyOnlineEntity);
return ResultVOUtils.success("报告成功!");
}
}

@ -49,7 +49,7 @@ import springfox.documentation.annotations.ApiIgnore;
@ApiIgnore
@RestController
@Slf4j
public class UserRegisterController extends BaseController {
public class UserRegisterController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(UserRegisterController.class);
@Resource
private UserRegisterService userRegisterService;
@ -69,10 +69,9 @@ public class UserRegisterController extends BaseController {
private IEmailService iEmailService;
@PostMapping("/admin/auth/register/getCheckcode")
public BaseResponse getCheckcode(@RequestBody loginmobileRequest params, HttpSession httpSession) {
return CaptchaUtils.getCheckcode(params,httpSession);
return CaptchaUtils.getCheckcode(params, httpSession);
}
@PostMapping("/admin/auth/register/checkCode")
@ -87,11 +86,11 @@ public class UserRegisterController extends BaseController {
*/
@GetMapping("/admin/auth/register/get/{mobile}")
public BaseResponse getInfo(@PathVariable String mobile) {
Map<String,Object> map = new HashMap<>();
Map<String, Object> map = new HashMap<>();
UserRegisterEntity userRegisterEntity = userRegisterService.getOne(new QueryWrapper<UserRegisterEntity>().eq("mobile", mobile));
List<UserPersonEntity> userPersons = new ArrayList<>();
List<UserCertEntity> userCerts = new ArrayList<>();
if(userRegisterEntity==null) {
if (userRegisterEntity == null) {
userRegisterEntity = new UserRegisterEntity();
userRegisterEntity.setMobile(mobile);
userRegisterService.saveOrUpdate(userRegisterEntity);
@ -122,17 +121,16 @@ public class UserRegisterController extends BaseController {
}
}
UserRegisterEntity userRegisterEntity2 = userRegisterService.getOne(new QueryWrapper<UserRegisterEntity>().eq("companyName", userRegisterEntity.getCompanyName()));
if (userRegisterEntity2 !=null ) {
if(userRegisterEntity.getId()==null)
if (userRegisterEntity2 != null) {
if (userRegisterEntity.getId() == null)
return ResultVOUtils.error(500, "该单位已被注册!");
if(userRegisterEntity2.getId()!=userRegisterEntity.getId())
if (userRegisterEntity2.getId() != userRegisterEntity.getId())
return ResultVOUtils.error(500, "该单位已被注册!");
}
if(StringUtils.isEmpty(userRegisterEntity.getCheckStatus()))
if (StringUtils.isEmpty(userRegisterEntity.getCheckStatus()))
userRegisterEntity.setCheckStatus("0");
boolean b = false;
b = userRegisterService.saveOrUpdate(userRegisterEntity);
if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
@ -141,27 +139,26 @@ public class UserRegisterController extends BaseController {
}
//第一次完善信息 插入默认数据
@GetMapping("/admin/auth/register/insertInitial")
public BaseResponse insertInitial (String mobile){
public BaseResponse insertInitial(String mobile) {
Map<Object, Object> map = new HashMap<>();
//根据手机号去查询 数据是否存在 不存在插入
UserRegisterEntity userRegister = userRegisterService.getOne(new QueryWrapper<UserRegisterEntity>().eq("mobile", mobile));
if(userRegister == null){
if (userRegister == null) {
//插入初始数据
UserRegisterEntity userRegisterEntity = new UserRegisterEntity();
UserCompanyEntity userCompanyEntity = new UserCompanyEntity();
// UserPersonEntity userPersonEntity = new UserPersonEntity();
userCompanyEntity.setId(IdUtil.getSnowflakeNextId());
userCompanyEntity.setCheckStatus(0+"");
userCompanyEntity.setCheckStatus(0 + "");
userCompanyEntity.setRegisterTime(new Date());
userRegisterEntity.setId(IdUtil.getSnowflakeNextId());
userRegisterEntity.setCompanyId(userCompanyEntity.getId());
userRegisterEntity.setMobile(mobile);
userRegisterEntity.setCheckStatus(0+"");
userRegisterEntity.setCheckStatus(0 + "");
userRegisterEntity.setRegisterTime(new Date());
@ -173,19 +170,19 @@ public class UserRegisterController extends BaseController {
userRegisterService.insert(userRegisterEntity);
int insert = userCompanyService.insert(userCompanyEntity);
// userPersonService.insert(userPersonEntity);
if(insert>0){
if (insert > 0) {
// map.put("upId",userPersonEntity.getId()+"");
map.put("ucId",userCompanyEntity.getId()+"");
map.put("urId",userRegisterEntity.getId()+"");
map.put("ucId", userCompanyEntity.getId() + "");
map.put("urId", userRegisterEntity.getId() + "");
return ResultVOUtils.success(map);
}
return ResultVOUtils.error(500,"添加失败");
}else{
return ResultVOUtils.error(500, "添加失败");
} else {
UserRegisterFilterRequest userRegisterFilterRequest = new UserRegisterFilterRequest();
userRegisterFilterRequest.setCompanyId(userRegister.getCompanyId()+"");
userRegisterFilterRequest.setCompanyId(userRegister.getCompanyId() + "");
registComPerResponse registComPerResponse = userRegisterService.selectAllInfo(userRegisterFilterRequest);
map.put("registComPerResponse",registComPerResponse);
map.put("registComPerResponse", registComPerResponse);
return ResultVOUtils.success(map);
}
@ -193,38 +190,38 @@ public class UserRegisterController extends BaseController {
@PostMapping("/admin/auth/register/saveAllInfo")
public BaseResponse saveAllInfo(@RequestBody registComPerResponse registComPerResponse){
public BaseResponse saveAllInfo(@RequestBody registComPerResponse registComPerResponse) {
UserRegisterEntity userRegisterEntity = new UserRegisterEntity();
// UserPersonEntity userPersonEntity = new UserPersonEntity();
UserCompanyEntity userCompanyEntity = new UserCompanyEntity();
BeanUtils.copyProperties(registComPerResponse,userRegisterEntity);
BeanUtils.copyProperties(registComPerResponse, userRegisterEntity);
// BeanUtils.copyProperties(registComPerResponse,userPersonEntity);
BeanUtils.copyProperties(registComPerResponse,userCompanyEntity);
BeanUtils.copyProperties(registComPerResponse, userCompanyEntity);
userRegisterEntity.setId(Long.valueOf(registComPerResponse.getUrId()));
// userPersonEntity.setId(Long.valueOf(registComPerResponse.getUpId()));
userCompanyEntity.setId(Long.valueOf(registComPerResponse.getUcId()));
userCompanyEntity.setContactWay(registComPerResponse.getFmobile());
if("key".equals(registComPerResponse.getKey())){
if ("key".equals(registComPerResponse.getKey())) {
//提交审核
userCompanyEntity.setCheckStatus(3+"");
userRegisterEntity.setCheckStatus(3+"");
userCompanyEntity.setCheckStatus(3 + "");
userRegisterEntity.setCheckStatus(3 + "");
}
//插入资质证书
for (UserCertEntity userCertEntity : registComPerResponse.getList()) {
userCertService.saveOrUpdate(userCertEntity);
}
userRegisterService.update(userRegisterEntity);
userCompanyService.update(userCompanyEntity);
//插入资质证书
for (UserCertEntity userCertEntity : registComPerResponse.getList()) {
userCertService.saveOrUpdate(userCertEntity);
}
userRegisterService.update(userRegisterEntity);
userCompanyService.update(userCompanyEntity);
// userPersonService.update(userPersonEntity);
return ResultVOUtils.success();
return ResultVOUtils.success();
}
@PostMapping("/admin/auth/register/list")
public BaseResponse selectReslist(@RequestBody UserRegisterFilterRequest userRegisterFilterRequest, BindingResult bindingResult){
public BaseResponse selectReslist(@RequestBody UserRegisterFilterRequest userRegisterFilterRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
@ -235,12 +232,14 @@ public class UserRegisterController extends BaseController {
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(selectlist);
return ResultVOUtils.success(pageSimpleResponse);
return ResultVOUtils.success(pageSimpleResponse);
}
@Resource
UserCompanyConfigService userCompanyConfigService;
@PostMapping("/admin/auth/register/NotApproved")
public BaseResponse NotApproved(@RequestBody registComPerResponse registComPerResponse,BindingResult bindingResult){
public BaseResponse NotApproved(@RequestBody registComPerResponse registComPerResponse, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
@ -248,26 +247,26 @@ public class UserRegisterController extends BaseController {
UserCompanyEntity userCompanyEntity = new UserCompanyEntity();
UserCheckEntity userCheckEntity = new UserCheckEntity();
// UserCertSetEntity userCertSetEntity = new UserCertSetEntity();
if("isPass".equals(registComPerResponse.getIsPass())){
if ("isPass".equals(registComPerResponse.getIsPass())) {
//审核通过
//资质证书全部通过才能审核 审核通过
certRequest certRequest = new certRequest();
certRequest.setBusinessId(Long.valueOf(registComPerResponse.getUcId()));
List<UserCertEntity> userCertEntities = userCertService.selectBybId(certRequest);
for (UserCertEntity userCertEntity : userCertEntities) {
if(!"1".equals(userCertEntity.getCheckStatus())){
return ResultVOUtils.error(500,"证书未全部通过,不能通过");
if (!"1".equals(userCertEntity.getCheckStatus())) {
return ResultVOUtils.error(500, "证书未全部通过,不能通过");
}
}
//通过之后 修改注册状态 和企业状态 将注册信息插入到系统负责人表中 生成用户名密码
userCheckEntity.setCheckResult(1+"");
userCheckEntity.setCheckResult(1 + "");
userCheckEntity.setResultExplain("通过");
//生成账号密码
String userName = "YYJY"+UuidUtils.getShortUuid(4);
String userName = "YYJY" + UuidUtils.getShortUuid(4);
String password = "123456";
UserRegisterEntity id = userRegisterService.getOne(new QueryWrapper<UserRegisterEntity>().eq("id", registComPerResponse.getId()));
UserPersonEntity userPersonEntity = new UserPersonEntity();
BeanUtils.copyProperties(id,userPersonEntity);
BeanUtils.copyProperties(id, userPersonEntity);
userPersonEntity.setId(IdUtil.getSnowflakeNextId());
userPersonEntity.setEmail(id.getXemail());
userPersonEntity.setUserName(userName);
@ -276,28 +275,26 @@ public class UserRegisterController extends BaseController {
userPersonEntity.setRegisterId(Long.valueOf(registComPerResponse.getId()));
userPersonService.insert(userPersonEntity);
//发送邮件
iEmailService.sendSimpleMail(id.getXemail(),"测试邮箱","账号:"+userName+",密码:"+password);
iEmailService.sendSimpleMail(id.getXemail(), "测试邮箱", "账号:" + userName + ",密码:" + password);
// 生产企业任务配置表
UserCompanyConfigEntity userCompanyConfigEntity = new UserCompanyConfigEntity();
userCompanyConfigEntity.setCompanyId(Long.valueOf(registComPerResponse.getUcId()));
userCompanyConfigEntity.setHeartRate(10);
userCompanyConfigService.updateByCompanyId(userCompanyConfigEntity);
}
//修改注册表中的状态 企业状态 操作表中插入记录
userCheckEntity.setId(IdUtil.getSnowflakeNextId());
userCheckEntity.setBusinessId(Long.valueOf(registComPerResponse.getUcId()));
userCheckEntity.setCreateUser(registComPerResponse.getReviewer());
if(!"isPass".equals(registComPerResponse.getIsPass())){
userCheckEntity.setCheckResult(0+"");
if (!"isPass".equals(registComPerResponse.getIsPass())) {
userCheckEntity.setCheckResult(0 + "");
userCheckEntity.setResultExplain(registComPerResponse.getReason());
}
userCheckEntity.setCreateTime(new Date());
// userCertSetEntity.setId(IdUtil.getSnowflakeNextId());
// userCertSetEntity.setName(registComPerResponse.getName());
// userCertSetEntity.setCreateUser(registComPerResponse.getReviewer());
// userCertSetEntity.setCreateTime(new Date());
userRegisterEntity.setId(Long.valueOf(registComPerResponse.getId()));
userRegisterEntity.setCheckStatus(registComPerResponse.getCheckStatus());
userCompanyEntity.setId(Long.valueOf(registComPerResponse.getUcId()));
@ -308,15 +305,15 @@ public class UserRegisterController extends BaseController {
userRegisterService.updateById(userRegisterEntity);
userCompanyService.updateById(userCompanyEntity);
userCheckService.insert(userCheckEntity);
// userCertSetService.insert(userCertSetEntity);
return ResultVOUtils.success();
// userCertSetService.insert(userCertSetEntity);
return ResultVOUtils.success();
}
//对手机 验证码进行加密/解密
//对手机 验证码进行加密/解密
@PostMapping("/admin/auth/register/encrypt")
public BaseResponse encrypt(@RequestBody MobileCaptchaRequest mobileCaptchaRequest){
if(mobileCaptchaRequest == null){
return ResultVOUtils.error(500,"");
public BaseResponse encrypt(@RequestBody MobileCaptchaRequest mobileCaptchaRequest) {
if (mobileCaptchaRequest == null) {
return ResultVOUtils.error(500, "");
}
MobileCaptchaRequest mobileCaptchaRequest1 = new MobileCaptchaRequest();
String mobile;
@ -326,11 +323,11 @@ public class UserRegisterController extends BaseController {
"0123456789ABHAEQ".getBytes(),
// iv加盐按照实际需求添加
"DYgjCEIMVrj2W9xN".getBytes());
if("key".equals(mobileCaptchaRequest.getKey())){
if ("key".equals(mobileCaptchaRequest.getKey())) {
// 加密
mobile = aes.encryptHex(mobileCaptchaRequest.getMobile());
captcha = aes.encryptHex(mobileCaptchaRequest.getCaptcha());
}else{
} else {
mobile = aes.decryptStr(mobileCaptchaRequest.getMobile());
captcha = aes.decryptStr(mobileCaptchaRequest.getCaptcha());
@ -342,8 +339,4 @@ public class UserRegisterController extends BaseController {
}
}

@ -12,7 +12,7 @@ import lombok.Data;
@Data
@TableName(value = "user_company_config")
public class UserCompanyConfigEntity implements Serializable {
@TableId(value = "id", type = IdType.INPUT)
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
@ -27,5 +27,12 @@ public class UserCompanyConfigEntity implements Serializable {
@TableField(value = "heartRate")
private Integer heartRate;
/**
*
*/
@TableField(value = "remark")
private String remark;
private static final long serialVersionUID = 1L;
}

@ -104,12 +104,6 @@ public class UserCompanyEntity implements Serializable {
@TableField(value = "`reason`")
private String reason;
/**
* 线 1线2线
*/
@ApiModelProperty(value = "在线状态 1在线2离线")
@TableField(exist = false)
private Integer onLineStatus;
private static final long serialVersionUID = 1L;
}

@ -23,5 +23,9 @@ public class UserCompanyOnlineEntity implements Serializable {
@TableField(value = "updateTime")
private Date updateTime;
@TableField(value = "lastIp")
private String lastIp;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,27 @@
package com.glxp.api.req.sup;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
@Data
public class UserCompanyConfigRequest {
private Integer id;
/**
* ID
*/
private Long companyId;
/**
* (
*/
private Integer heartRate;
/**
*
*/
private String remark;
}

@ -1,12 +1,16 @@
package com.glxp.api.res.sup;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.glxp.api.entity.sup.UserCompanyEntity;
import lombok.Data;
import java.util.Date;
@Data
public class UserCompanyOnlineResponse {
public class UserCompanyOnlineResponse extends UserCompanyEntity {
private Long companyId;
private Long userId;
@ -15,4 +19,8 @@ public class UserCompanyOnlineResponse {
private Long heartRate;
private String lastIp;
private String remark;
}

@ -0,0 +1,26 @@
package com.glxp.api.res.sup;
import com.baomidou.mybatisplus.annotation.TableField;
import com.glxp.api.entity.sup.UserCompanyEntity;
import lombok.Data;
import java.util.Date;
@Data
public class UserCompanyResponse extends UserCompanyEntity {
private Long userId;
private Date updateTime;
private Long heartRate;
/**
* 线 1线2线; 3:
*/
private Integer onLineStatus;
private String lastIp;
private String remark;
}

@ -1,10 +1,20 @@
package com.glxp.api.service.sup;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.dao.sup.UserCompanyConfigMapper;
import com.glxp.api.entity.sup.UserCompanyConfigEntity;
import javax.annotation.Resource;
@Service
public class UserCompanyConfigService extends ServiceImpl<UserCompanyConfigMapper, UserCompanyConfigEntity> {
@Resource
UserCompanyConfigMapper userCompanyConfigMapper;
public boolean updateByCompanyId(UserCompanyConfigEntity userCompanyConfigEntity) {
return saveOrUpdate(userCompanyConfigEntity, new QueryWrapper<UserCompanyConfigEntity>().eq("companyId", userCompanyConfigEntity.getCompanyId()));
}
}

@ -4,9 +4,9 @@ server:
spring:
datasource:
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_cpt?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
jdbc-url: jdbc:p6spy:mysql://192.168.0.66:3364/udi_cpt?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: 123456
password: Glxp@6066
hikari:
connection-timeout: 60000
maximum-pool-size: 20

@ -3,11 +3,11 @@
<mapper namespace="com.glxp.api.dao.sup.UserCompanyMapper">
<select id="filterCompanyName" parameterType="com.glxp.api.req.auth.FilterUserComapanyRequest"
resultType="com.glxp.api.entity.sup.UserCompanyEntity">
SELECT id,companyName
SELECT *
FROM user_company
<where>
<if test="companyName != '' and companyName != null">
AND companyName LIKE concat('%',#{companyName}, '%')
AND companyName LIKE concat('%', #{companyName}, '%')
</if>
</where>
GROUP BY companyName

@ -3,10 +3,9 @@
<mapper namespace="com.glxp.api.dao.sup.UserCompanyOnlineMapper">
<select id="findOnLineByConfig"
resultType="com.glxp.api.res.sup.UserCompanyOnlineResponse">
SELECT user_company_online.*, ucc.heartRate
FROM user_company_online
left join user_company_config ucc on user_company_online.companyId = ucc.companyId
SELECT user_company_online.*, ucc.heartRate, ucc.remark
FROM user_company_config ucc
left join user_company_online on user_company_online.companyId = ucc.companyId
where user_company_online.companyId = #{companyId}
</select>
</mapper>

Loading…
Cancel
Save