添加后注册流程
This commit is contained in:
parent
31db51a250
commit
f1ec277298
|
@ -0,0 +1,101 @@
|
|||
package com.nu.modules.NuBizAdvisoryInfo.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.NuBizAdvisoryInfo.entity.NuBizAdvisoryInfo;
|
||||
import com.nu.modules.NuBizAdvisoryInfo.service.INuBizAdvisoryInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.CommonAPI;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 咨询信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="咨询信息")
|
||||
@RestController
|
||||
@RequestMapping("/h5Api/nuBizAdvisoryInfo")
|
||||
@Slf4j
|
||||
public class H5ApiAdvisoryInfoController extends JeecgController<NuBizAdvisoryInfo, INuBizAdvisoryInfoService> {
|
||||
@Autowired
|
||||
private INuBizAdvisoryInfoService nuBizAdvisoryInfoService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private CommonAPI commonApi;
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param nuBizAdvisoryInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "咨询信息-添加")
|
||||
@ApiOperation(value="咨询信息-添加", notes="咨询信息-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<Object> add(@RequestBody NuBizAdvisoryInfo nuBizAdvisoryInfo) {
|
||||
nuBizAdvisoryInfoService.save(nuBizAdvisoryInfo);
|
||||
return Result.OK(nuBizAdvisoryInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改信息
|
||||
* @param nuBizAdvisoryInfo
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody NuBizAdvisoryInfo nuBizAdvisoryInfo) {
|
||||
nuBizAdvisoryInfoService.updateById(nuBizAdvisoryInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping(value = "/queryByOpenId")
|
||||
public Result<NuBizAdvisoryInfo> queryByOpenId(@RequestParam(name="openId",required=true) String openId) {
|
||||
QueryWrapper<NuBizAdvisoryInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("open_id",openId);
|
||||
NuBizAdvisoryInfo nuBizAdvisoryInfo = nuBizAdvisoryInfoService.getOne(queryWrapper);
|
||||
if(nuBizAdvisoryInfo==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
if(StringUtils.isNotBlank(nuBizAdvisoryInfo.getAdvisoryType())){
|
||||
String dictText = commonApi.translateDict("advisory_type",nuBizAdvisoryInfo.getAdvisoryType());
|
||||
nuBizAdvisoryInfo.setAdvisoryTypeName(dictText);
|
||||
}
|
||||
if(StringUtils.isNotBlank(nuBizAdvisoryInfo.getSex())){
|
||||
String dictText = commonApi.translateDict("sex",nuBizAdvisoryInfo.getSex());
|
||||
nuBizAdvisoryInfo.setSexName(dictText);
|
||||
}
|
||||
if(StringUtils.isNotBlank(nuBizAdvisoryInfo.getSysOrgCode())){
|
||||
String dictText = commonApi.translateDictFromTable("sys_depart","depart_name","id",nuBizAdvisoryInfo.getSysOrgCode());
|
||||
nuBizAdvisoryInfo.setSysOrgCodeName(dictText);
|
||||
}
|
||||
if(StringUtils.isNotBlank(nuBizAdvisoryInfo.getStatus())){
|
||||
String dictText = commonApi.translateDict("advisory_approval",nuBizAdvisoryInfo.getStatus());
|
||||
nuBizAdvisoryInfo.setStatusName(dictText);
|
||||
}
|
||||
return Result.OK(nuBizAdvisoryInfo);
|
||||
}
|
||||
}
|
|
@ -88,11 +88,10 @@ public class NuBizAdvisoryInfoController extends JeecgController<NuBizAdvisoryIn
|
|||
*/
|
||||
@AutoLog(value = "咨询信息-添加")
|
||||
@ApiOperation(value="咨询信息-添加", notes="咨询信息-添加")
|
||||
@RequiresPermissions("NuBizAdvisoryInfo:nu_biz_advisory_info:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody NuBizAdvisoryInfo nuBizAdvisoryInfo) {
|
||||
public Result<Object> add(@RequestBody NuBizAdvisoryInfo nuBizAdvisoryInfo) {
|
||||
nuBizAdvisoryInfoService.save(nuBizAdvisoryInfo);
|
||||
return Result.OK("添加成功!");
|
||||
return Result.OK(nuBizAdvisoryInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,10 +4,8 @@ import java.io.Serializable;
|
|||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
|
@ -73,6 +71,10 @@ public class NuBizAdvisoryInfo implements Serializable {
|
|||
@Excel(name = "审核备注", width = 15)
|
||||
@ApiModelProperty(value = "审核备注")
|
||||
private java.lang.String content;
|
||||
/**机构访问地址*/
|
||||
@Excel(name = "机构访问地址", width = 15)
|
||||
@ApiModelProperty(value = "机构访问地址")
|
||||
private java.lang.String serverUrl;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
|
@ -92,4 +94,14 @@ public class NuBizAdvisoryInfo implements Serializable {
|
|||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
|
||||
@TableField(exist = false)
|
||||
private java.lang.String advisoryTypeName;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String sexName;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String sysOrgCodeName;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String statusName;
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package com.nu.modules.NuBizAdvisoryInfo.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.NuBizAdvisoryInfo.entity.NuBizAdvisoryInfo;
|
||||
|
||||
/**
|
||||
* @Description: 咨询信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ServerAdvisoryInfoService extends IService<NuBizAdvisoryInfo> {
|
||||
|
||||
}
|
|
@ -1,8 +1,16 @@
|
|||
package com.nu.modules.NuBizAdvisoryInfo.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
|
||||
import com.nu.modules.NuBizAdvisoryInfo.entity.NuBizAdvisoryInfo;
|
||||
import com.nu.modules.NuBizAdvisoryInfo.mapper.NuBizAdvisoryInfoMapper;
|
||||
import com.nu.modules.NuBizAdvisoryInfo.service.INuBizAdvisoryInfoService;
|
||||
import com.nu.modules.NuBizAdvisoryInfo.service.ServerAdvisoryInfoService;
|
||||
import com.nu.modules.bizEmployeesInfo.entity.BizEmployeesInfo;
|
||||
import com.nu.modules.bizEmployeesInfo.service.IBizEmployeesInfoService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
@ -16,4 +24,39 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
@Service
|
||||
public class NuBizAdvisoryInfoServiceImpl extends ServiceImpl<NuBizAdvisoryInfoMapper, NuBizAdvisoryInfo> implements INuBizAdvisoryInfoService {
|
||||
|
||||
@Autowired
|
||||
public ServerAdvisoryInfoService serverAdvisoryInfoService;
|
||||
|
||||
@Autowired
|
||||
private IBizEmployeesInfoService bizEmployeesInfoService;
|
||||
|
||||
public boolean save(NuBizAdvisoryInfo entity) {
|
||||
baseMapper.insert(entity);//插入业务数据
|
||||
serverAdvisoryInfoService.save(entity);//插入运维数据
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean updateById(NuBizAdvisoryInfo entity) {
|
||||
baseMapper.updateById(entity);//插入业务数据
|
||||
serverAdvisoryInfoService.updateById(entity);//插入运维数据
|
||||
if(StringUtils.equals("2", entity.getStatus()) && StringUtils.equals("2", entity.getAdvisoryType())){//审核通过并且是要成为员工的
|
||||
//插入员工数据
|
||||
BizEmployeesInfo bizEmployeesInfo = bizEmployeesInfoService.getById(entity.getId());
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if(bizEmployeesInfo == null){
|
||||
bizEmployeesInfo = new BizEmployeesInfo();
|
||||
bizEmployeesInfo.setName(entity.getName());
|
||||
bizEmployeesInfo.setSex(entity.getSex());
|
||||
bizEmployeesInfo.setTel(entity.getTel());
|
||||
bizEmployeesInfo.setId(entity.getId());
|
||||
bizEmployeesInfoService.save(bizEmployeesInfo);
|
||||
}else{
|
||||
bizEmployeesInfo.setName(entity.getName());
|
||||
bizEmployeesInfo.setSex(entity.getSex());
|
||||
bizEmployeesInfo.setTel(entity.getTel());
|
||||
bizEmployeesInfoService.updateById(bizEmployeesInfo);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package com.nu.modules.NuBizAdvisoryInfo.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.NuBizAdvisoryInfo.entity.NuBizAdvisoryInfo;
|
||||
import com.nu.modules.NuBizAdvisoryInfo.mapper.NuBizAdvisoryInfoMapper;
|
||||
import com.nu.modules.NuBizAdvisoryInfo.service.INuBizAdvisoryInfoService;
|
||||
import com.nu.modules.NuBizAdvisoryInfo.service.ServerAdvisoryInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Description: 咨询信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@DS("multi-datasource1")
|
||||
public class ServerAdvisoryInfoServiceImpl extends ServiceImpl<NuBizAdvisoryInfoMapper, NuBizAdvisoryInfo> implements ServerAdvisoryInfoService {
|
||||
|
||||
}
|
|
@ -70,6 +70,7 @@ public class BizEmployeesInfoController extends JeecgController<BizEmployeesInfo
|
|||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<BizEmployeesInfo> queryWrapper = QueryGenerator.initQueryWrapper(bizEmployeesInfo, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
Page<BizEmployeesInfo> page = new Page<BizEmployeesInfo>(pageNo, pageSize);
|
||||
IPage<BizEmployeesInfo> pageList = bizEmployeesInfoService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
|
|
|
@ -189,4 +189,24 @@ public class BizEmployeesInfo implements Serializable {
|
|||
@Excel(name = "服务标签", width = 15)
|
||||
@ApiModelProperty(value = "服务标签")
|
||||
private java.lang.String serviceTag;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
}
|
||||
|
|
|
@ -111,6 +111,7 @@ public class ShiroConfig {
|
|||
filterChainDefinitionMap.put("/sys/getLoginQrcode/**", "anon"); //登录二维码
|
||||
filterChainDefinitionMap.put("/sys/getQrcodeToken/**", "anon"); //监听扫码
|
||||
filterChainDefinitionMap.put("/sys/checkAuth", "anon"); //授权接口排除
|
||||
filterChainDefinitionMap.put("/h5Api/nuBizAdvisoryInfo/**", "anon"); //授权接口排除
|
||||
|
||||
//update-begin--Author:scott Date:20221116 for:排除静态资源后缀
|
||||
filterChainDefinitionMap.put("/", "anon");
|
||||
|
|
|
@ -169,12 +169,12 @@ spring:
|
|||
username: root
|
||||
password: root
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 多数据源配置
|
||||
#multi-datasource1:
|
||||
#url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
#username: root
|
||||
#password: root
|
||||
#driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 多数据源配置-运维系统
|
||||
multi-datasource1:
|
||||
url: jdbc:mysql://1.92.152.160:33061/nursing_unit?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: root
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
#redis 配置
|
||||
redis:
|
||||
database: 0
|
||||
|
|
Loading…
Reference in New Issue