提交 add4b7de authored 作者: wulf's avatar wulf

初始项目

上级
package com.isoft91.gonn.gps;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@MapperScan(basePackages = "com.isoft91.gonn.gps.**.mapper")
public class GonnPmsApplication {
public static void main(String[] args) {
SpringApplication.run(GonnPmsApplication.class, args);
}
}
package com.isoft91.gonn.gps.business.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.isoft91.gonn.gps.business.dto.BaseStationInfoDto;
import com.isoft91.gonn.gps.business.service.IBaseStationInfoService;
import com.isoft91.gonn.gps.business.service.IComputerRoomInfoService;
import com.isoft91.gonn.gps.utils.Result.Ret;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author jiangpengpeng
* @since 2021-04-02
*/
@RestController
@RequestMapping("/base-station-info")
public class BaseStationInfoController {
@Autowired
private IBaseStationInfoService iBaseStationInfoService;
/**
* 新分页查询2.0
*/
@Transactional(propagation = Propagation.NOT_SUPPORTED)
@PostMapping("/pages")
@ApiOperation(value = "分页查询项目", notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页", required = true),
@ApiImplicitParam(name = "size", value = "页大小", required = true)})
public Ret selectPages(BaseStationInfoDto searchDto, Integer page, Integer size) {
if (page == null && size == null) {
return Ret.error().setMsg("当前页和页大小不能为空");
}
IPage iPage = iBaseStationInfoService.selectPages(searchDto, new Page(page, size));
return Ret.ok().setData(iPage);
}
}
package com.isoft91.gonn.gps.business.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.isoft91.gonn.gps.business.dto.BaseStationInfoDto;
import com.isoft91.gonn.gps.utils.Result.Ret;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author jiangpengpeng
* @since 2021-04-02
*/
@RestController
@RequestMapping("/computer-room-info")
public class ComputerRoomInfoController {
}
package com.isoft91.gonn.gps.business.controller;
import com.isoft91.gonn.gps.business.service.IOaCBusiConfService;
import com.isoft91.gonn.gps.business.vo.OaCBusiConfVo;
import com.isoft91.gonn.gps.utils.Result.Ret;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
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;
/**
* <p>
* 前端控制器
* </p>
*
* @author wulingfang
* @since 2021-06-28
*/
@RestController
@RequestMapping("/conf/oa-cbusi-conf")
public class OaCBusiConfController {
@Autowired
IOaCBusiConfService oaCBusiConfService;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
@PostMapping("/list")
@ApiOperation(value = "不分页查询模型", notes = "")
public Ret selectList( @RequestBody OaCBusiConfVo vo) {
return Ret.ok().setData(oaCBusiConfService.selectList(vo));
}
}
package com.isoft91.gonn.gps.business.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.isoft91.gonn.gps.business.dto.QuerySDeptDTO;
import com.isoft91.gonn.gps.business.dto.ResultSDeptDTO;
import com.isoft91.gonn.gps.business.entity.SDept;
import com.isoft91.gonn.gps.business.service.ISDeptService;
import com.isoft91.gonn.gps.utils.DozerUtils;
import com.isoft91.gonn.gps.utils.Result.Ret;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* <p>
* 部门表 前端控制器
* </p>
*
* @author 91isoft
* @since 2019-12-30
*/
@RestController
@RequestMapping("/sdept")
public class SDeptController {
@Autowired
ISDeptService isDeptServiceImpl;
@Transactional(rollbackFor = Exception.class)
@PutMapping("/{businessId:\\w+}")
@ApiOperation(value = "修改部门信息", notes = "")
public Ret updateDeptById(@PathVariable(value = "businessId") String businessId, QuerySDeptDTO sDeptDTO) {
SDept sDept = DozerUtils.map(sDeptDTO, SDept.class);
//判断id 是否为空
if (StrUtil.isNotEmpty(businessId)) {
sDept.setBusinessId(businessId);
if (isDeptServiceImpl.updateById(sDept)) {
return Ret.ok().setMsg("修改成功").setData(sDept);
} else {
return Ret.error().setMsg("修改失败");
}
} else {
return Ret.error().setMsg("deptId不能为空");
}
}
@Transactional(rollbackFor = Exception.class)
@DeleteMapping("/{businessId:\\w+}")
@ApiOperation(value = "物理删除部门信息", notes = "")
public Ret removeDeptById(@PathVariable(value = "businessId") String businessId) {
if (StrUtil.isNotBlank(businessId)) {
return Ret.ok().setData(isDeptServiceImpl.delete(businessId));
} else {
return Ret.error().setMsg("deptId不能为空");
}
}
@Transactional(rollbackFor = Exception.class)
@PutMapping("/logDel/{businessId:\\w+}")
@ApiOperation(value = "逻辑删除部门", notes = "")
public Ret logicalDeleteDeptById(@PathVariable(value = "businessId") String businessId) {
if (StrUtil.isNotBlank(businessId) && isDeptServiceImpl.logicalDelete(businessId) > 0) {
return Ret.ok().setMsg("操作成功");
} else {
return Ret.error().setMsg("deptId不能为空");
}
}
@Transactional(propagation = Propagation.NOT_SUPPORTED)
@GetMapping
@ApiOperation(value = "查询所有部门信息(不带分页)", notes = "查询所有部门信息列表(传id即查询编辑页信息)")
public Ret<List<ResultSDeptDTO>> selectDeptList(QuerySDeptDTO querySDeptDTO) {
return Ret.ok().setData(isDeptServiceImpl.getDeptList(querySDeptDTO));
}
@Transactional(propagation = Propagation.NOT_SUPPORTED)
@GetMapping("/page")
@ApiOperation(value = "分页部门信息", notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页", required = true),
@ApiImplicitParam(name = "size", value = "页大小", required = true)})
public Ret<IPage<ResultSDeptDTO>> selectDeptListPage(QuerySDeptDTO querySDeptDTO, Integer page, Integer size) {
if (page == null && size == null) {
return Ret.error().setMsg("当前页和页大小不能为空");
}
return Ret.ok().setData(isDeptServiceImpl.getDeptListPage(new Page<>(page, size), querySDeptDTO));
}
}
package com.isoft91.gonn.gps.business.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.isoft91.gonn.gps.business.dto.*;
import com.isoft91.gonn.gps.business.entity.SDictionary;
import com.isoft91.gonn.gps.business.service.ISDictionaryService;
import com.isoft91.gonn.gps.utils.DozerUtils;
import com.isoft91.gonn.gps.utils.Result.Ret;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* <p>
* 数据字典 前端控制器
* </p>
*
* @author 91isoft
* @since 2019-12-25
*/
@RestController
@RequestMapping("/sdictionary")
public class SDictionaryController {
@Autowired
ISDictionaryService dictionaryServiceImpl;
@Transactional(rollbackFor=Exception.class)
@PostMapping
@ApiOperation(value = "添加数据字典", notes = "添加数据字典")
@ApiImplicitParams({
@ApiImplicitParam(name = "type" ,value ="数据字典type",required = false),
@ApiImplicitParam(name = "name",value ="数据字典名称"),
@ApiImplicitParam(name = "value",value ="数据字典value")
})
public Ret insert(QuerySDictionaryDTO dictionaryDto) {
SDictionary dictionary = DozerUtils.map(dictionaryDto, SDictionary.class);
if (dictionaryServiceImpl.save(dictionary) ) {
return Ret.ok().setMsg("添加成功").setData(dictionaryDto);
} else {
return Ret.error().setMsg("添加失败");
}
}
@Transactional(rollbackFor=Exception.class)
@PutMapping("/{businessId:\\w+}")
@ApiOperation(value = "修改数据字典", notes = "")
public Ret updateById(@PathVariable(value = "businessId") String businessId, QuerySDictionaryDTO dictionaryDto) {
SDictionary dictionary = DozerUtils.map(dictionaryDto, SDictionary.class);
//判断id 是否为空
if (StrUtil.isNotEmpty(businessId)) {
dictionary.setBusinessId(businessId);
if (dictionaryServiceImpl.updateById(dictionary)) {
return Ret.ok().setMsg("修改成功").setData(dictionary);
} else {
return Ret.error().setMsg("修改失败");
}
} else {
return Ret.error().setMsg("businessId不能为空");
}
}
@Transactional(rollbackFor=Exception.class)
@DeleteMapping("/{businessId:\\w+}")
@ApiOperation(value = "物理删除数据字典", notes = "")
public Ret removeById(@PathVariable(value="businessId") String businessId) {
if (StrUtil.isNotBlank(businessId)) {
return Ret.ok().setData(dictionaryServiceImpl.delete(businessId));
}else {
return Ret.error().setMsg("businessId不能为空");
}
}
@Transactional(rollbackFor=Exception.class)
@PutMapping("/logDel/{businessId:\\w+}")
@ApiOperation(value = "逻辑删除数据字典", notes = "")
public Ret logicalDeleteById(@PathVariable(value="businessId") String businessId) {
if (StrUtil.isNotBlank(businessId) && dictionaryServiceImpl.logicalDelete(businessId) > 0) {
return Ret.ok().setMsg("操作成功");
}else {
return Ret.error().setMsg("businessId不能为空");
}
}
@Transactional(propagation=Propagation.NOT_SUPPORTED )
@GetMapping("byId")
@ApiOperation(value = "根据id查询数据字典列表")
public Ret<ResultSDictionaryDTO> selectDicById(String businessId) {
return Ret.ok().setData(dictionaryServiceImpl.getDictionaryByID(businessId));
}
@Transactional(propagation=Propagation.NOT_SUPPORTED )
@GetMapping
@ApiOperation(value = "查询所有数据字典列表(不带分页)", notes = "查询数据字典列表(传id即查询编辑页信息)")
public Ret<List<ResultSDictionaryDTO>> selectList(QuerySDictionaryDTO dictionary) {
return Ret.ok().setData(dictionaryServiceImpl.getDictionaryList(dictionary));
}
@Transactional(propagation=Propagation.NOT_SUPPORTED )
@GetMapping("/page")
@ApiOperation(value = "分页查询数据字典", notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页", required = true),
@ApiImplicitParam(name = "size", value = "页大小", required = true)})
public Ret<IPage<ResultSDictionaryDTO>> selectListPage(QuerySDictionaryDTO sDictionary, Integer page, Integer size) {
if (page == null && size == null) {
return Ret.error().setMsg("当前页和页大小不能为空");
}
return Ret.ok().setData(dictionaryServiceImpl.getDictionaryListPage(new Page<>(page,size),sDictionary));
}
@Transactional(propagation=Propagation.NOT_SUPPORTED )
@GetMapping("/pageBy")
@ApiOperation(value = "条件分页查询数据字典")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页", required = true),
@ApiImplicitParam(name = "size", value = "页大小", required = true)})
public Ret<IPage> selectListPageBy(QuerySDictionaryDTO querySDictionaryDTO, Integer page, Integer size) {
if (page == null && size == null) {
return Ret.error().setMsg("当前页和页大小不能为空");
}
IPage iPage = dictionaryServiceImpl.getDictionaryListPageBy(new Page<>(page, size),querySDictionaryDTO);
return Ret.ok().setData(iPage);
}
@Transactional(propagation=Propagation.NOT_SUPPORTED)
@GetMapping("/getDictionaryListByType")
@ApiOperation(value = "根据类型查询数据字典")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "数据字典类型", required = true)})
public Ret<IPage<ResultSDictionaryDTO>> getDictionaryListByType(String type) {
if (type == null || type == ""){
return Ret.error().setMsg("数据的字典类型不能为空");
}
List dictionaryListByType = dictionaryServiceImpl.getDictionaryListByType(type);
return Ret.ok().setData(dictionaryListByType);
}
@Transactional(propagation=Propagation.NOT_SUPPORTED )
@GetMapping("/getGradeDic")
@ApiOperation(value = "获取业务级联数据(0310)")
@ApiImplicitParams({
// @ApiImplicitParam(name = "type", value = "数据字典类型", required = false)
})
public Ret<IPage<ResultSDictionaryDTO>> getGradeDic() {
Map dictionaryListByType = dictionaryServiceImpl.getGradeDic();
return Ret.ok().setData(dictionaryListByType);
}
@Transactional(propagation=Propagation.NOT_SUPPORTED )
@GetMapping("/getTemplateType")
@ApiOperation(value = "查询所有模板类型")
public Ret<List<ResultSearchDTO>> selectTemplateTypeList() {
return Ret.ok().setData(dictionaryServiceImpl.getTemplateTypeList());
}
@Transactional(propagation=Propagation.NOT_SUPPORTED )
@GetMapping("/getTemplateGrade")
@ApiOperation(value = "查询所有模板级别")
public Ret<List<ResultSearchDTO>> selectTemplateGradeList() {
return Ret.ok().setData(dictionaryServiceImpl.getTemplateGradeList());
}
@Transactional(propagation=Propagation.NOT_SUPPORTED )
@GetMapping("/getProjecetStage")
@ApiOperation(value = "查询项目阶段")
public Ret<List<SdProjectStageDTO>> getProjecetStage(){
return dictionaryServiceImpl.getProjecetStage();
}
@Transactional(propagation=Propagation.NOT_SUPPORTED )
@GetMapping("/getServiceStage")
@ApiOperation(value = "查询业务阶段")
public Ret<List<SdServiceStageDTO>> getServiceStage(){
return dictionaryServiceImpl.getServiceStage();
}
}
package com.isoft91.gonn.gps.business.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.isoft91.gonn.gps.business.dto.BaseStationInfoDto;
import com.isoft91.gonn.gps.business.dto.ProvinceDto;
import com.isoft91.gonn.gps.business.service.ISProvinceService;
import com.isoft91.gonn.gps.business.vo.ProvinceVo;
import com.isoft91.gonn.gps.utils.Result.Ret;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
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;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author wulingfang
* @since 2021-04-15
*/
@RestController
@RequestMapping("/info/s-province")
public class SProvinceController {
@Autowired
ISProvinceService provinceService;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
@PostMapping("/instProvince")
@ApiOperation(value = "分页查询项目", notes = "")
public Ret instProvince(@RequestBody ProvinceVo provinceDto) {
return Ret.ok().setData( provinceService.instProvince(provinceDto));
}
}
package com.isoft91.gonn.gps.business.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.isoft91.gonn.gps.business.dto.QuerySRoleDTO;
import com.isoft91.gonn.gps.business.dto.ResultSDictionaryDTO;
import com.isoft91.gonn.gps.business.dto.ResultSRoleDTO;
import com.isoft91.gonn.gps.business.entity.SRole;
import com.isoft91.gonn.gps.business.service.ISRoleService;
import com.isoft91.gonn.gps.utils.DozerUtils;
import com.isoft91.gonn.gps.utils.Result.Ret;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* <p>
* 角色表 前端控制器
* </p>
*
* @author 91isoft
* @since 2019-12-30
*/
@RestController
@RequestMapping("/srole")
public class SRoleController {
@Autowired
ISRoleService isRoleServiceImpl;
@Transactional(rollbackFor=Exception.class)
@PutMapping("/{businessId:\\w+}")
@ApiOperation(value = "修改角色信息", notes = "")
public Ret updateRoleById(@PathVariable(value="businessId") String businessId, QuerySRoleDTO sRoleDTO) {
SRole sRole = DozerUtils.map(sRoleDTO, SRole.class);
//判断id 是否为空
if (StrUtil.isNotEmpty(businessId)) {
sRole.setBusinessId(businessId);
if (isRoleServiceImpl.updateById(sRole)) {
return Ret.ok().setMsg("修改成功").setData(sRole);
} else {
return Ret.error().setMsg("修改失败");
}
} else {
return Ret.error().setMsg("businessId不能为空");
}
}
@Transactional(rollbackFor=Exception.class)
@DeleteMapping("/{businessId:\\w+}")
@ApiOperation(value = "物理删除角色信息", notes = "")
public Ret removeRoleById(@PathVariable(value="businessId") String businessId) {
if (StrUtil.isNotBlank(businessId)) {
return Ret.ok().setData(isRoleServiceImpl.delete(businessId));
}else {
return Ret.error().setMsg("businessId不能为空");
}
}
@Transactional(rollbackFor=Exception.class)
@PutMapping("/logDel/{businessId:\\w+}")
@ApiOperation(value = "逻辑删除角色信息", notes = "")
public Ret logicalDeleteRoleById(@PathVariable(value="businessId") String businessId) {
if (StrUtil.isNotBlank(businessId) && isRoleServiceImpl.logicalDelete(businessId) > 0) {
return Ret.ok().setMsg("操作成功");
}else {
return Ret.error().setMsg("businessId不能为空");
}
}
@Transactional(propagation= Propagation.NOT_SUPPORTED )
@GetMapping
@ApiOperation(value = "查询所有角色信息列表(不带分页)", notes = "查询所有角色信息列表(传id即查询编辑页信息)")
public Ret<List<ResultSRoleDTO>> selectRoleList(QuerySRoleDTO querySRoleDTO) {
return Ret.ok().setData(isRoleServiceImpl.getRoleList(querySRoleDTO));
}
@Transactional(propagation=Propagation.NOT_SUPPORTED )
@GetMapping("/page")
@ApiOperation(value = "分页查询角色信息", notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页", required = true),
@ApiImplicitParam(name = "size", value = "页大小", required = true)})
public Ret<IPage<ResultSDictionaryDTO>> selectListPage(QuerySRoleDTO querySRoleDTO, Integer page, Integer size) {
if (page == null && size == null) {
return Ret.error().setMsg("当前页和页大小不能为空");
}
return Ret.ok().setData(isRoleServiceImpl.getRoleListPage(new Page<>(page,size),querySRoleDTO));
}
}
package com.isoft91.gonn.gps.business.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 用户表 前端控制器
* </p>
*
* @author jiangpengpeng
* @since 2020-01-09
*/
@RestController
@RequestMapping("/suser/s-user")
public class SUserController {
}
package com.isoft91.gonn.gps.business.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 用户角色表 前端控制器
* </p>
*
* @author jiangpengpeng
* @since 2020-02-20
*/
@RestController
@RequestMapping("/suserrole/s-user-role")
public class SUserRoleController {
}
package com.isoft91.gonn.gps.business.controller;
import com.isoft91.gonn.gps.business.service.impl.SUserSYNServiceImpl;
import com.isoft91.gonn.gps.sys.service.CommonMesServiceImpl;
import com.isoft91.gonn.gps.utils.Result.Ret;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.DigestUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
@RestController
@RequestMapping("/userSYN")
public class SUserSYNController {
@Autowired
private SUserSYNServiceImpl sUserSYNService;
@Value("${global.path.serverAuthenticateStaticKey}")
private String key;
@Value("${global.path.app_secret}")
private String secret;
@ApiOperation(value = "同步用户", notes = "同步用户")
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@GetMapping(value = "/synUser")
public Ret addUser(String timestamp, String sign) {
return sUserSYNService.synUser(timestamp, sign);
}
//后台同步数据
@GetMapping(value = "/synInfo")
public Ret synInfo() {
String round =Long.toString(System.currentTimeMillis() / 1000L);
String sign=secret+round+key;
sign= CommonMesServiceImpl.sha1(sign);
sign = DigestUtils.md5DigestAsHex(sign.getBytes());
return sUserSYNService.synUser(round, sign);
}
}
package com.isoft91.gonn.gps.business.dto;
import lombok.Data;
import java.util.List;
@Data
public class BaseStationInfoDto {
/**
* 网络类型
*/
private String networkType;
/**
* 运营商
*/
private String operator;
/**
* 站名
*/
private String jzName;
/**
* 站号
*/
private String jzNumber;
}
package com.isoft91.gonn.gps.business.dto;
import lombok.Data;
import java.util.List;
@Data
public class ProvinceDto {
private String name;
private String level;
private List<String> center;
private String district;
private String objectId;
}
package com.isoft91.gonn.gps.business.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import java.time.LocalDateTime;
/**
* @author 武斌
* @date 2019/12/31 - 13:55
*/
@Data
public class QuerySDeptDTO {
private String code;
private String businessId;
private String parentId;
private String name;
private Integer caseCount;
private Integer sort;
}
package com.isoft91.gonn.gps.business.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
@Data
public class QuerySDictionaryDTO {
private String businessId;
private String pid;
private String type;
private String name;
private String value;
private String remarks;
private String flag;
private String delFlag;
}
package com.isoft91.gonn.gps.business.dto;
import lombok.Data;
@Data
public class QuerySRoleDTO {
private String businessId;
private String roleName;
private String code;
}
package com.isoft91.gonn.gps.business.dto;
import lombok.Data;
/**
* @author 武斌
* @date 2019/12/31 - 13:55
*/
@Data
public class ResultSDeptDTO {
private String code;
private String businessId;
private String parentId;
private String name;
private Integer caseCount;
private Integer sort;
}
package com.isoft91.gonn.gps.business.dto;
import lombok.Data;
@Data
public class ResultSDictionaryDTO {
private String businessId;
private String pid;
private String type;
private String name;
private String serviceName;
private String value;
private String child;
}
package com.isoft91.gonn.gps.business.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.time.LocalDateTime;
/**
* @Author: 武斌
* @Description:
* @Date: 2020/3/25 14:06
*/
@Data
public class ResultSDictionaryPageDTO {
private String businessId;
private String pid;
private String type;
private String name;
private String serviceName;
private String remarks;
private String value;
private String child;
private String createName;
private String updateName;
@JsonFormat(timezone = "GMT+8",pattern = "yyyy/MM/dd HH:mm:ss")
private LocalDateTime createDate;
@JsonFormat(timezone = "GMT+8",pattern = "yyyy/MM/dd HH:mm:ss")
private LocalDateTime updateDate;
}
package com.isoft91.gonn.gps.business.dto;
import lombok.Data;
@Data
public class ResultSRoleDTO {
private String businessId;
private String roleName;
private String code;
}
package com.isoft91.gonn.gps.business.dto;
import lombok.Data;
import java.util.List;
/*
* @author 武斌
* @date
*/
@Data
public class ResultSearchDTO {
private String name;
private String value;
private List<ResultSDictionaryDTO> child;
}
package com.isoft91.gonn.gps.business.dto;
import lombok.Data;
/**
* TODO
*
* @author :jiangpengpeng
* @date:2020/2/19 14:00
*/
@Data
public class SdProjectStageDTO {
private String name;
private String value;
}
package com.isoft91.gonn.gps.business.dto;
import lombok.Data;
/**
* TODO
*
* @author :jiangpengpeng
* @date:2020/2/19 14:00
*/
@Data
public class SdServiceStageDTO {
private String name;
private String value;
}
package com.isoft91.gonn.gps.business.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.isoft91.gonn.gps.common.entity.IdEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
/**
* <p>
*
* </p>
*
* @author jiangpengpeng
* @since 2021-04-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("base_station_info")
public class BaseStationInfo extends IdEntity {
private static final long serialVersionUID = 1L;
/**
* id号
*/
@TableField("number")
private String number;
/**
* 网络类型
*/
@TableField("network_type")
private String networkType;
/**
* 运营商
*/
@TableField("operator")
private String operator;
/**
* 入网时间
*/
@TableField("start_time")
private String startTime;
/**
* 需求号
*/
@TableField("demand_number")
private String demandNumber;
/**
* 站名
*/
@TableField("jz_name")
private String jzName;
/**
* 站号
*/
@TableField("jz_number")
private Integer jzNumber;
/**
* 基站地址
*/
@TableField("jz_address")
private String jzAddress;
/**
* 经度
*/
@TableField("longitude")
private String longitude;
/**
* 维度
*/
@TableField("dimension")
private String dimension;
/**
* 设备型号
*/
@TableField("unit_type")
private String unitType;
/**
* 数量
*/
@TableField("jz_num")
private String jzNum;
/**
* 海拔
*/
@TableField("height")
private String height;
/**
* 设备建设方式
*/
@TableField("building_modes")
private String buildingModes;
/**
* 维护联系人
*/
@TableField("whb_user")
private String whbUser;
/**
* 维护联系电话
*/
@TableField("whb_phone")
private String whbPhone;
/**
* 区域
*/
@TableField("region_id")
private String regionId;
/**
* 部门
*/
@TableField("dept_id")
private String deptId;
/**
* 物理区域
*/
@TableField("region")
private String region;
/**
* 上联机房
*/
@TableField("computer_room")
private String computerRoom;
/**
* 上联机房id
*/
@TableField("computer_room_id")
private String computerRoomId;
/**
* 传输方式
*/
@TableField("transmission_mode")
private String transmissionMode;
/**
* 网元信息
*/
@TableField("network_element_information")
private String networkElementInformation;
}
package com.isoft91.gonn.gps.business.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.isoft91.gonn.gps.common.entity.IdEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
/**
* <p>
*
* </p>
*
* @author jiangpengpeng
* @since 2021-04-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("computer_room_info")
public class ComputerRoomInfo extends IdEntity {
private static final long serialVersionUID = 1L;
/**
* id号
*/
@TableField("number")
private String number;
/**
* 产权单位
*/
@TableField("owner_unit")
private String ownerUnit;
/**
* 机房名称
*/
@TableField("computer_room_name")
private String computerRoomName;
/**
* 机房地址
*/
@TableField("computer_room_address")
private String computerRoomAddress;
/**
* 机房机柜
*/
@TableField("cabinet")
private String cabinet;
/**
* 机房机架
*/
@TableField("frame")
private String frame;
/**
* 经度
*/
@TableField("longitude")
private String longitude;
/**
* 维度
*/
@TableField("dimension")
private String dimension;
/**
* 供电电压
*/
@TableField("voltage")
private String voltage;
/**
* 功率
*/
@TableField("power")
private String power;
/**
* 备用电池组
*/
@TableField("spare_batteries")
private String spareBatteries;
/**
* 电器防雷系统
*/
@TableField("lightning_protection_system")
private String lightningProtectionSystem;
/**
* 空调排风系统
*/
@TableField("conditioning_exhaust_system")
private String conditioningExhaustSystem;
/**
* 消防系统
*/
@TableField("fire_fighting_system")
private String fireFightingSystem;
/**
* 门禁
*/
@TableField("access_control")
private String accessControl;
/**
* 是否远程监控
*/
@TableField("is_long_range_monitor")
private String isLongRangeMonitor;
/**
* 上联机房
*/
@TableField("computer_room")
private String computerRoom;
/**
* 上联机房id
*/
@TableField("computer_room_id")
private String computerRoomId;
/**
* 维护联系人
*/
@TableField("whb_user")
private String whbUser;
/**
* 维护联系电话
*/
@TableField("whb_phone")
private String whbPhone;
/**
* 区域
*/
@TableField("region_id")
private String regionId;
/**
* 部门
*/
@TableField("dept_id")
private String deptId;
/**
* 物理区域
*/
@TableField("region")
private String region;
}
package com.isoft91.gonn.gps.business.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.isoft91.gonn.gps.common.entity.DelStatus;
import com.isoft91.gonn.gps.common.entity.FlagStatus;
import com.isoft91.gonn.gps.common.entity.IdEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
*
* </p>
*
* @author wulingfang
* @since 2021-06-28
*/
@Data
@Accessors(chain = true)
@TableName("oa_c_busi_conf")
public class OaCBusiConf implements Serializable {
private static final long serialVersionUID = 1L;
@TableId("id")
@TableField(fill = FieldFill.INSERT)
private String id;
@TableField("type")
private String type;
@TableField("name")
private String name;
@TableField("key")
private String key;
@TableField("value")
private String value;
@TableField("pid")
private Integer pid;
@TableField("create_by")
private String createBy;
@TableField("create_date")
private LocalDateTime createDate;
@TableField("update_by")
private String updateBy;
@TableField("update_date")
private LocalDateTime updateDate;
@TableField("flag")
private String flag;
@TableField("remarks")
private String remarks;
/**
* 对应单位id
*/
@TableField("comid")
private Integer comid;
/**
* 删除标记(0:正常;1:删除;2:审核)
*/
@TableField(value="DEL_FLAG", fill = FieldFill.INSERT)
protected String delFlag;
/**
* 设置删除
*/
public void setDeleted(){
this.setDelFlag(DelStatus.DELETED.getStatus());
}
/**
* 设置非删除
*/
public void setNotDeleted(){
this.setDelFlag(DelStatus.NORMAL.getStatus());
}
/**
* 设置启用
*/
public void setStart(){
this.setFlag(FlagStatus.NORMAL.getStatus());
}
/**
* 设置停用
*/
public void setStop(){
this.setFlag(FlagStatus.ABNORMAL.getStatus());
}
/**
* 设置非删除&启用
*/
public void setNormal(){
this.setFlag(FlagStatus.NORMAL.getStatus());
this.setDelFlag(DelStatus.NORMAL.getStatus());
}
/**
* 设置非删除&启用
*/
public void setPublish(){
this.setFlag(FlagStatus.NORMAL.getStatus());
this.setDelFlag(DelStatus.NORMAL.getStatus());
}
}
package com.isoft91.gonn.gps.business.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
//import com.sun.xml.internal.bind.v2.model.core.ID;
import com.isoft91.gonn.gps.common.entity.DataEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 部门表
* </p>
*
* @author 91isoft
* @since 2019-12-30
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("s_dept")
public class SDept extends DataEntity {
private static final long serialVersionUID = 1L;
/**
* 部门code
*/
@TableField("CODE")
private String code;
/**
* ID
*/
@TableId("BUSINESS_ID")
private String businessId;
/**
* 上级部门id
*/
@TableField("PARENT_ID")
private String parentId;
/**
* 部门名称
*/
@TableField("NAME")
private String name;
/**
* 层级
*/
@TableField("CASE_COUNT")
private Integer caseCount;
/**
* 排序
*/
@TableField("SORT")
private Integer sort;
/**
* 创建人
*/
/* @TableField("CREATE_BY")
private String createBy;
*//**
* 创建日期*//*
@TableField("CREATE_DATE")
private LocalDateTime createDate;
*//**
* 修改人*//*
@TableField("UPDATE_BY")
private String updateBy;
*//**
* 修改日期*//*
@TableField("UPDATE_DATE")
private LocalDateTime updateDate;
*//**
* 删除标识 1 删除 0 未删除 2 审核
*//*
@TableField("DEL_FLAG")
private String delFlag;
*//**
* 启用标记(0:停用;1:启用)
*//*
@TableField("FLAG")
private String flag;
*//**
* 备注
*//*
@TableField("REMARKS")
private String remarks;*/
}
package com.isoft91.gonn.gps.business.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import com.isoft91.gonn.gps.common.entity.IdEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 数据字典
* </p>
*
* @author 91isoft
* @since 2019-12-25
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("s_dictionary")
public class SDictionary extends IdEntity<SDictionary> implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 父节点id
*/
@TableField("PID")
private String pid;
/**
* 类型
*/
@TableField("TYPE")
private String type;
/**
* 名字
*/
@TableField("NAME")
private String name;
/**
* 值
*/
@TableField("VALUE")
private String value;
/**
* 备注
*/
@TableField("REMARKS")
private String remarks;
}
package com.isoft91.gonn.gps.business.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.isoft91.gonn.gps.common.entity.IdEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
*
* </p>
*
* @author wulingfang
* @since 2021-04-15
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("s_province")
public class SProvince extends IdEntity<SProvince> implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 父节点id
*/
@TableField("PID")
private String pid;
/**
* 名字
*/
@TableField("NAME")
private String name;
@TableField("OBJECTID")
private String objectid;
/**
* 类型
*/
@TableField("layer")
private String layer;
/**
* 备注
*/
@TableField("REMARKS")
private String remarks;
/**
* 经度
*/
@TableField("longitude")
private String longitude;
/**
* 维度
*/
@TableField("dimension")
private String dimension;
}
package com.isoft91.gonn.gps.business.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.isoft91.gonn.gps.common.entity.DataEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
* 角色表
* </p>
*
* @author 91isoft
* @since 2019-12-30
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("s_role")
public class SRole extends DataEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 业务主键
*/
@TableId("BUSINESS_ID")
private String businessId;
/**
* 角色名称
*/
@TableField("ROLE_NAME")
private String roleName;
/**
* 创建人
*/
/* @TableField("CREATE_BY")
private String createBy;*/
/**
* 创建日期
*/
/*@TableField("CREATE_DATE")
private LocalDateTime createDate;*/
/**
* 修改人
*/
/*@TableField("UPDATE_BY")
private String updateBy;
*/
/**
* 修改日期
*/
/* @TableField("UPDATE_DATE")
private LocalDateTime updateDate;
*/
/**
* 删除标识 1 删除 0 未删除 2 审核
*/
/* @TableField("DEL_FLAG")
private String delFlag;
*//**
* 启用标记(0:停用;1:启用)
*//*
@TableField("FLAG")
private String flag;
*//**
* 备注
*//*
@TableField("REMARKS")
private String remarks;
*/
/**
* 编号
*/
@TableField("CODE")
private String code;
}
package com.isoft91.gonn.gps.business.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.isoft91.gonn.gps.common.entity.DataEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 用户表
* </p>
*
* @author jiangpengpeng
* @since 2020-01-09
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("s_user")
public class SUser extends DataEntity {
private static final long serialVersionUID = 1L;
/**
* 业务主键
*/
@TableId("BUSINESS_ID")
private String businessId;
/**
* 用户名
*/
@TableField("LOGIN_NAME")
private String loginName;
/**
* 密码
*/
@TableField("PASSWORD")
private String password;
/**
* 姓名
*/
@TableField("NAME")
private String name;
/**
* 性别(0:男,1:女)
*/
@TableField("SEX")
private String sex;
/**
* 手机号码
*/
@TableField("PHONE")
private String phone;
/**
* 部门表id
*/
@TableField("DEPT_ID")
private String deptId;
/**
* 邮箱
*/
@TableField("EMAIL")
private String email;
/* *//**
* 创建人
*//*
@TableField("CREATE_BY")
private String createBy;
*//**
* 创建日期
*//*
@TableField("CREATE_DATE")
private LocalDateTime createDate;
*//**
* 修改人
*//*
@TableField("UPDATE_BY")
private String updateBy;
*//**
* 修改日期
*//*
@TableField("UPDATE_DATE")
private LocalDateTime updateDate;
*//**
* 删除标识 1 删除 0 未删除 2 审核
*//*
@TableField("DEL_FLAG")
private String delFlag;
*//**
* 启用标记(0:停用;1:启用)
*//*
@TableField("FLAG")
private String flag;
*/
/**
* 备注
*/
@TableField("REMARKS")
private String remarks;
}
package com.isoft91.gonn.gps.business.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* <p>
* 用户角色表
* </p>
*
* @author jiangpengpeng
* @since 2020-02-20
*/
@Data
@Accessors(chain = true)
@TableName("s_user_role")
public class SUserRole {
private static final long serialVersionUID = 1L;
/**
* 用户id
*/
@TableId("BUSINESS_ID")
private String businessId;
/**
* 用户id
*/
@TableField("USER_ID")
private String userId;
/**
* 角色id
*/
@TableField("ROLE_ID")
private String roleId;
}
package com.isoft91.gonn.gps.business.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SUserSYN {
/**
* 用户id
*/
private String businessId;
/**
* 用户姓名
*/
private String name;
/**
* 部门id
*/
private String deptId;
/**
* 角色id
*/
private String roleId;
/**
* 角色名称
*/
private String roleName;
/**
* 电子邮件
*/
private String email;
}
package com.isoft91.gonn.gps.business.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.isoft91.gonn.gps.business.entity.BaseStationInfo;
/**
* <p>
* Mapper 接口
* </p>
*
* @author jiangpengpeng
* @since 2021-04-02
*/
public interface BaseStationInfoMapper extends BaseMapper<BaseStationInfo> {
}
package com.isoft91.gonn.gps.business.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.isoft91.gonn.gps.business.entity.ComputerRoomInfo;
/**
* <p>
* Mapper 接口
* </p>
*
* @author jiangpengpeng
* @since 2021-04-02
*/
public interface ComputerRoomInfoMapper extends BaseMapper<ComputerRoomInfo> {
}
package com.isoft91.gonn.gps.business.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.isoft91.gonn.gps.business.entity.OaCBusiConf;
import com.isoft91.gonn.gps.business.vo.OaCBusiConfVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* <p>
* Mapper 接口
* </p>
*
* @author wulingfang
* @since 2021-06-28
*/
public interface OaCBusiConfMapper extends BaseMapper<OaCBusiConf> {
List<OaCBusiConf> selectConfList(@Param("vo") OaCBusiConfVo vo);
}
package com.isoft91.gonn.gps.business.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.isoft91.gonn.gps.business.dto.QuerySDeptDTO;
import com.isoft91.gonn.gps.business.dto.ResultSDeptDTO;
import com.isoft91.gonn.gps.business.entity.SDept;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* <p>
* 部门表 Mapper 接口
* </p>
*
* @author 91isoft
* @since 2019-12-30
*/
public interface SDeptMapper extends BaseMapper<SDept> {
@Select("<script>" +
"SELECT * " +
"FROM s_dept where del_flag = '0' and flag = '1' order by sort asc</script> ")
List<ResultSDeptDTO> getDeptList(QuerySDeptDTO dictionary);
@Select("<script>SELECT * FROM s_dept WHERE 1=1 "
+ "<if test=\"delFlag !=null and delFlag != '' \"> and DEL_FLAG = #{delFlag} </if> "
+ "<if test=\"flag !=null and flag != '' \"> and FLAG = #{flag} </if>"
+ "<if test=\"name !=null and name != '' \"> and NAME like concat('%',#{name},'%') </if> "
+ " order by sort asc</script>")
List<SDept> findAll(SDept sysDept);
@Select("<script>" +
" select s.BUSINESS_ID FROM " +
" s_dept s " +
"where s.PARENT_ID=#{parentId} and s.`NAME` like concat('%',#{type},'%')" +
"</script>")
String selectByParentId (@Param("parentId") String parentId,@Param("type")String type);
}
package com.isoft91.gonn.gps.business.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.isoft91.gonn.gps.business.entity.SDept;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface SDeptSYNRepo extends BaseMapper<SDept> {
@Insert("<script>insert into s_dept(business_id," +
"parent_id," +
"name," +
"case_count," +
"sort," +
"code," +
"create_by," +
"create_date," +
"update_by," +
"update_date," +
"del_flag," +
"flag) value " +
"<foreach collection =\"sDepts\" item=\"item\" separator=\",\" > " +
"(" +
"#{item.businessId}, " +
"#{item.parentId}, " +
"#{item.name}, " +
"#{item.caseCount}, " +
"#{item.sort}," +
"#{item.code}," +
"#{item.createBy}," +
"#{item.createDate}," +
"#{item.updateBy}," +
"#{item.updateDate}," +
"#{item.delFlag}," +
"#{item.flag}" +
")" +
"</foreach></script>")
int saveDeptSYN(@Param("sDepts") List<SDept> sDepts);
@Update("delete from s_dept where 1=1")
void removeAll();
}
package com.isoft91.gonn.gps.business.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.isoft91.gonn.gps.business.dto.*;
import com.isoft91.gonn.gps.business.entity.SDictionary;
import org.apache.ibatis.annotations.*;
import java.util.List;
/**
* <p>
* 数据字典 Mapper 接口
* </p>
*
* @author 91isoft
* @since 2019-12-25
*/
@Mapper
public interface SDictionaryMapper extends BaseMapper<SDictionary> {
@Select("<script>" +
"SELECT * " +
"FROM s_dictionary where del_flag = '0' and flag = '1' </script> ")
List<ResultSDictionaryDTO> getDictionaryList(QuerySDictionaryDTO dictionary);
@Select("<script>" +
" SELECT value,#{mapper} as name FROM `s_dictionary` where type = #{serviceType} " +
" </script> ")
@Results({
@Result(property = "child", javaType = List.class, column = "{value=value,name=name}",
many = @Many(select = "com.isoft91.gonn.pms.business.sdictionary.mapper.SDictionaryMapper.selectChild"))
})
List<ResultSearchDTO> selectGradeList(String serviceType, String mapper);
@Select("<script>" +
" select s1.business_id,s1.type,s1.name,s1.value, s2.name as serviceName from s_dictionary s1 " +
"left join s_dictionary s2 on s1.value = s2.value " +
"where s1.value LIKE concat('%',#{value},'%') and s1.Type = #{name} and s2.type = #{value} " +
" </script> ")
List<ResultSDictionaryDTO> selectChild(String value, String name);
@Select("<script>SELECT " +
"sd.`NAME` AS NAME, " +
"sd.`VALUE` AS " +
"VALUE " +
" " +
"FROM " +
"s_dictionary sd " +
"WHERE " +
"sd.FLAG = #{flag} " +
"AND sd.DEL_FLAG = #{delFlag} " +
"AND sd.TYPE = #{type}</script>")
List<SdProjectStageDTO> getProjecetStage(SDictionary sDictionary);
@Select("<script>SELECT " +
"sd.`NAME` AS NAME, " +
"sd.`VALUE` AS " +
"VALUE " +
" " +
"FROM " +
"s_dictionary sd " +
"WHERE " +
"sd.FLAG = #{flag} " +
"AND sd.DEL_FLAG = #{delFlag} " +
"AND sd.TYPE = #{type}</script>")
List<SdServiceStageDTO> getServiceStage(SDictionary sDictionary);
@Select("<script>" +
"SELECT " +
"sd.`NAME` " +
"FROM " +
"s_dictionary sd " +
"WHERE " +
"sd.`VALUE` = #{value} " +
"AND sd.TYPE = #{type} " +
"and sd.FLAG='1' " +
" and sd.DEL_FLAG='0' " +
"</script>")
List<String> NameByTypeValue(@Param("type") String type, @Param("value") String value);
@Select("<script>" +
"SELECT " +
"sd.`VALUE` " +
"FROM " +
"s_dictionary sd " +
"WHERE " +
"sd.`NAME` = #{name} " +
"AND sd.TYPE = #{type} " +
"and sd.FLAG='1' " +
" and sd.DEL_FLAG='0' " +
"</script>")
List<String> valueByTypeName(@Param("type") String type, @Param("name") String name);
@Select("<script>" +
"SELECT " +
"sd.BUSINESS_ID, " +
"sd.TYPE, " +
"sd.NAME, " +
"sd.VALUE, " +
"sd.REMARKS, " +
"su1.NAME as createName, " +
"sd.CREATE_DATE, " +
"su2.NAME as updateName, " +
"sd.UPDATE_DATE " +
"FROM " +
"s_dictionary sd " +
"LEFT JOIN s_user su1 ON sd.CREATE_BY = su1.BUSINESS_ID " +
"LEFT JOIN s_user su2 ON sd.UPDATE_BY = su2.BUSINESS_ID " +
"WHERE " +
"<if test=\"querySDictionaryDTO.delFlag!=null\"> sd.DEL_FLAG=#{querySDictionaryDTO.delFlag}</if>\n" +
"<if test=\"querySDictionaryDTO.flag!=null and querySDictionaryDTO.flag !=''\">AND sd.FLAG=#{querySDictionaryDTO.flag}</if>\n" +
"<if test=\"querySDictionaryDTO.name!=null and querySDictionaryDTO.name !=''\"> AND sd.NAME like concat('%',#{querySDictionaryDTO.name},'%') </if>" +
"<if test=\"querySDictionaryDTO.type!=null and querySDictionaryDTO.type !=''\"> AND sd.TYPE like concat('%',#{querySDictionaryDTO.type},'%') </if>" +
"<if test=\"querySDictionaryDTO.value!=null and querySDictionaryDTO.value !='' \"> AND sd.VALUE like concat('%',#{querySDictionaryDTO.value},'%') </if>" +
"order By sd.CREATE_DATE DESC" +
"</script>")
IPage<ResultSDictionaryPageDTO> selSDictionaryPage(@Param("querySDictionaryDTO") QuerySDictionaryDTO querySDictionaryDTO, @Param("page") Page page);
}
package com.isoft91.gonn.gps.business.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.isoft91.gonn.gps.business.entity.SProvince;
import org.apache.ibatis.annotations.Param;
/**
* <p>
* Mapper 接口
* </p>
*
* @author wulingfang
* @since 2021-04-15
*/
public interface SProvinceMapper extends BaseMapper<SProvince> {
SProvince selectProvinceByName(@Param("name")String name);
}
package com.isoft91.gonn.gps.business.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.isoft91.gonn.gps.business.dto.QuerySRoleDTO;
import com.isoft91.gonn.gps.business.dto.ResultSRoleDTO;
import com.isoft91.gonn.gps.business.entity.SRole;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* <p>
* 角色表 Mapper 接口
* </p>
*
* @author 91isoft
* @since 2019-12-30
*/
public interface SRoleMapper extends BaseMapper<SRole> {
@Select("<script>" +
"SELECT * " +
"FROM s_role where del_flag = '0' and flag = '1' </script> ")
List<ResultSRoleDTO> getDictionaryList(QuerySRoleDTO SRole);
@Select("<script> select su.ROLE_NAME from s_user_role sur,s_role su " +
"where sur.ROLE_ID=su.BUSINESS_ID and sur.USER_ID=#{userID} and su.ROLE_NAME=#{roleName}" +
"</script>")
String selectByUserID(@Param("userID") String userID, @Param("roleName") String roleName);
@Select("<script> select su.BUSINESS_ID,su.ROLE_NAME,su.`CODE` from s_user_role sur,s_role su " +
"where sur.ROLE_ID=su.BUSINESS_ID and sur.USER_ID=#{userID} " +
"</script>")
List<ResultSRoleDTO> selectByUserIDs(@Param("userID") String userID);
}
package com.isoft91.gonn.gps.business.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.isoft91.gonn.gps.business.entity.SRole;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface SRoleSYNRepo extends BaseMapper<SRole> {
//int removeAll();
@Insert("<script>insert into s_role (business_id, " +
"role_name, " +
"code, " +
"create_by, " +
"create_date, " +
"update_by, " +
"update_date, " +
"del_flag, " +
"flag ) value " +
"<foreach collection =\"sRoles\" item=\"item\" separator=\",\" > " +
"(" +
"#{item.businessId}, " +
"#{item.roleName}, " +
"#{item.businessId}, " +
"#{item.createBy}, " +
"#{item.createDate}, " +
"#{item.updateBy}, " +
"#{item.updateDate}, " +
"#{item.delFlag}, " +
"#{item.flag}" +
")" +
"</foreach></script>")
int saveRoleSYN(@Param("sRoles") List<SRole> sRoles);
@Update("delete from s_role where 1=1")
void removeAll();
}
package com.isoft91.gonn.gps.business.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.isoft91.gonn.gps.business.entity.SUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
/**
* <p>
* 用户表 Mapper 接口
* </p>
*
* @author jiangpengpeng
* @since 2020-01-09
*/
public interface SUserMapper extends BaseMapper<SUser> {
/**
* @param sUserList
* @return
*/
@Insert("<script>insert into s_user(business_id," +
"name," +
"login_name," +
"password," +
"sex," +
"email, " +
"remarks," +
"dept_id," +
"create_by," +
"create_date," +
"update_by," +
"update_date," +
"del_flag," +
"flag) value" +
"<foreach collection =\"sUserList\" item=\"item\" separator=\",\" > " +
"(" +
"#{item.businessId}," +
"#{item.name}," +
"#{item.loginName}," +
"#{item.password}," +
"#{item.sex}," +
"#{item.email}," +
"#{item.remarks}," +
"#{item.deptId}," +
"#{item.createBy}," +
"#{item.createDate}," +
"#{item.updateBy}," +
"#{item.updateDate}," +
"#{item.delFlag}," +
"#{item.flag}" +
")" +
"</foreach></script>")
int saveUserSYN(@Param("sUserList") List<SUser> sUserList);
/**
* 删除
*/
@Update("delete from s_user where 1=1")
void removeAll();
@Select("<script> " +
"select su.`NAME` from s_user_role sur, s_user su where " +
"sur.ROLE_ID=#{roleId} and sur.USER_ID=su.BUSINESS_ID " +
"<if test=\"userId!='' and userId != null\"> AND su.BUSINESS_ID = #{userId} </if> " +
"<if test=\"deptId!='' and deptId != null\"> and su.DEPT_ID=#{deptId}</if> " +
"</script>")
String selectName(@Param("userId") String userId, @Param("deptId") String deptId, @Param("roleId") String roleId);
@Select("<script> " +
"select su.BUSINESS_ID from s_user_role sur, s_user su where " +
"sur.ROLE_ID=#{roleId} and sur.USER_ID=su.BUSINESS_ID " +
"<if test=\"userId!='' and userId != null\"> AND su.BUSINESS_ID = #{userId} </if> " +
"<if test=\"deptId!='' and deptId != null\"> and su.DEPT_ID=#{deptId}</if> " +
"</script>")
List<Integer> selectId(@Param("userId") String userId, @Param("deptId") String deptId, @Param("roleId") String roleId);
}
package com.isoft91.gonn.gps.business.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.isoft91.gonn.gps.business.entity.SUserRole;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* <p>
* 用户角色表 Mapper 接口
* </p>
*
* @author jiangpengpeng
* @since 2020-02-20
*/
public interface SUserRoleMapper extends BaseMapper<SUserRole> {
@Select("<script>SELECT " +
"sur.ROLE_ID " +
"FROM " +
"s_user_role sur " +
"WHERE " +
"sur.USER_ID = #{userId}</script>")
List<String> selectRole(@Param("userId") String userId);
}
package com.isoft91.gonn.gps.business.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.isoft91.gonn.gps.business.entity.SUserRole;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface SUserRoleSYNRepo extends BaseMapper<SUserRole> {
@Insert("<script>insert into s_user_role(business_id," +
"user_id," +
"role_id) value " +
"<foreach collection =\"sUserRoles\" item=\"item\" separator=\",\" > " +
"(" +
"#{item.businessId}, " +
"#{item.userId}, " +
"#{item.roleId})" +
"</foreach></script>")
int saveUserRoleSYN(@Param("sUserRoles") List<SUserRole> sUserRoles);
@Update("delete from s_user_role where 1=1")
void removeAll();
}
package com.isoft91.gonn.gps.business.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.isoft91.gonn.gps.business.dto.BaseStationInfoDto;
import com.isoft91.gonn.gps.business.entity.BaseStationInfo;
/**
* <p>
* 服务类
* </p>
*
* @author jiangpengpeng
* @since 2021-04-02
*/
public interface IBaseStationInfoService extends IService<BaseStationInfo> {
IPage selectPages(BaseStationInfoDto searchDto, Page page);
}
package com.isoft91.gonn.gps.business.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.isoft91.gonn.gps.business.dto.BaseStationInfoDto;
import com.isoft91.gonn.gps.business.entity.ComputerRoomInfo;
/**
* <p>
* 服务类
* </p>
*
* @author jiangpengpeng
* @since 2021-04-02
*/
public interface IComputerRoomInfoService extends IService<ComputerRoomInfo> {
}
package com.isoft91.gonn.gps.business.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.isoft91.gonn.gps.business.entity.OaCBusiConf;
import com.isoft91.gonn.gps.business.vo.OaCBusiConfVo;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author wulingfang
* @since 2021-06-28
*/
public interface IOaCBusiConfService extends IService<OaCBusiConf> {
List<OaCBusiConf> selectList(OaCBusiConfVo dto);
}
package com.isoft91.gonn.gps.business.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.isoft91.gonn.gps.business.dto.QuerySDeptDTO;
import com.isoft91.gonn.gps.business.entity.SDept;
import java.util.List;
/**
* <p>
* 部门表 服务类
* </p>
*
* @author 91isoft
* @since 2019-12-30
*/
public interface ISDeptService extends IService<SDept> {
int logicalDelete(String id);
int delete(String id);
List getDeptList(QuerySDeptDTO sDeptDTO);
IPage getDeptListPage(Page page, QuerySDeptDTO sDeptDTO);
}
\ No newline at end of file
package com.isoft91.gonn.gps.business.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.isoft91.gonn.gps.business.dto.QuerySDictionaryDTO;
import com.isoft91.gonn.gps.business.dto.ResultSearchDTO;
import com.isoft91.gonn.gps.business.dto.SdProjectStageDTO;
import com.isoft91.gonn.gps.business.dto.SdServiceStageDTO;
import com.isoft91.gonn.gps.business.entity.SDictionary;
import com.isoft91.gonn.gps.utils.Result.Ret;
import java.util.List;
import java.util.Map;
/**
* <p>
* 数据字典 服务类
* </p>
*
* @author 91isoft
* @since 2019-12-25
*/
public interface ISDictionaryService extends IService<SDictionary> {
int logicalDelete(String id);
int delete(String id);
List getDictionaryList(QuerySDictionaryDTO sDictionary);
SDictionary getDictionaryByID(String sDictionaryId);
IPage getDictionaryListPage(Page page, QuerySDictionaryDTO sDictionary);
/**
* 条件分页查询数据字典
*/
IPage getDictionaryListPageBy(Page page,QuerySDictionaryDTO querySDictionaryDTO);
List getDictionaryListByType(String type);
Map getGradeDic();
/**
* 查询所有模板类型数据
*/
List<ResultSearchDTO> getTemplateTypeList();
/**
* 查询所有模板级别数据
*/
List<ResultSearchDTO> getTemplateGradeList();
Ret<List<SdProjectStageDTO>> getProjecetStage();
Ret<List<SdServiceStageDTO>> getServiceStage();
}
package com.isoft91.gonn.gps.business.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.isoft91.gonn.gps.business.dto.ProvinceDto;
import com.isoft91.gonn.gps.business.entity.SProvince;
import com.isoft91.gonn.gps.business.vo.ProvinceVo;
import com.isoft91.gonn.gps.utils.Result.Ret;
import java.util.List;
public interface ISProvinceService extends IService<SProvince> {
Ret instProvince(ProvinceVo provinceDto);
}
package com.isoft91.gonn.gps.business.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.isoft91.gonn.gps.business.dto.QuerySRoleDTO;
import com.isoft91.gonn.gps.business.entity.SRole;
import java.util.List;
/**
* <p>
* 角色表 服务类
* </p>
*
* @author 91isoft
* @since 2019-12-30
*/
public interface ISRoleService extends IService<SRole> {
/**
* 逻辑删除
*/
int logicalDelete(String id);
/**
* 物理删除
*/
int delete(String id);
/**
* 获取角色列表
*/
List getRoleList(QuerySRoleDTO sRole);
/**
* 分页显示角色列表
*/
IPage getRoleListPage(Page page, QuerySRoleDTO sRole);
/**
* 根据id获取角色列表
*/
List getRoleListById(String id);
}
package com.isoft91.gonn.gps.business.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.isoft91.gonn.gps.business.entity.SUserRole;
/**
* <p>
* 用户角色表 服务类
* </p>
*
* @author jiangpengpeng
* @since 2020-02-20
*/
public interface ISUserRoleService extends IService<SUserRole> {
}
package com.isoft91.gonn.gps.business.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.isoft91.gonn.gps.business.entity.SUser;
/**
* <p>
* 用户表 服务类
* </p>
*
* @author jiangpengpeng
* @since 2020-01-09
*/
public interface ISUserService extends IService<SUser> {
}
package com.isoft91.gonn.gps.business.service;
import com.isoft91.gonn.gps.utils.Result.Ret;
public interface SUserSYNService {
/**
* 同步 用户表
*
* @param
* @return
*/
Ret synUser(String timestamp, String sign);
}
package com.isoft91.gonn.gps.business.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.isoft91.gonn.gps.business.dto.BaseStationInfoDto;
import com.isoft91.gonn.gps.business.entity.BaseStationInfo;
import com.isoft91.gonn.gps.business.entity.SUser;
import com.isoft91.gonn.gps.business.mapper.BaseStationInfoMapper;
import com.isoft91.gonn.gps.business.mapper.SUserMapper;
import com.isoft91.gonn.gps.business.service.IBaseStationInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author jiangpengpeng
* @since 2021-04-02
*/
@Service
public class BaseStationInfoServiceImpl extends ServiceImpl<BaseStationInfoMapper, BaseStationInfo> implements IBaseStationInfoService {
@Autowired
SUserMapper sUserMapper;
@Override
public IPage selectPages(BaseStationInfoDto searchDto, Page page) {
//获取当前登录人部门
String userId = (String) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
SUser sUser = sUserMapper.selectById(userId);
return null;
}
}
package com.isoft91.gonn.gps.business.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.isoft91.gonn.gps.business.dto.BaseStationInfoDto;
import com.isoft91.gonn.gps.business.entity.ComputerRoomInfo;
import com.isoft91.gonn.gps.business.entity.SUser;
import com.isoft91.gonn.gps.business.mapper.ComputerRoomInfoMapper;
import com.isoft91.gonn.gps.business.mapper.SUserMapper;
import com.isoft91.gonn.gps.business.service.IComputerRoomInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author jiangpengpeng
* @since 2021-04-02
*/
@Service
public class ComputerRoomInfoServiceImpl extends ServiceImpl<ComputerRoomInfoMapper, ComputerRoomInfo> implements IComputerRoomInfoService {
}
package com.isoft91.gonn.gps.business.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.isoft91.gonn.gps.business.entity.OaCBusiConf;
import com.isoft91.gonn.gps.business.mapper.OaCBusiConfMapper;
import com.isoft91.gonn.gps.business.service.IOaCBusiConfService;
import com.isoft91.gonn.gps.business.vo.OaCBusiConfVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author wulingfang
* @since 2021-06-28
*/
@Service
public class OaCBusiConfServiceImpl extends ServiceImpl<OaCBusiConfMapper, OaCBusiConf> implements IOaCBusiConfService {
@Autowired
OaCBusiConfMapper oaCBusiConfMapper;
@Override
public List<OaCBusiConf> selectList(OaCBusiConfVo dto) {
return oaCBusiConfMapper.selectConfList(dto);
}
}
package com.isoft91.gonn.gps.business.service.impl;
import cn.hutool.core.util.StrUtil;
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.isoft91.gonn.gps.business.dto.QuerySDeptDTO;
import com.isoft91.gonn.gps.business.dto.ResultSDeptDTO;
import com.isoft91.gonn.gps.business.entity.SDept;
import com.isoft91.gonn.gps.business.mapper.SDeptMapper;
import com.isoft91.gonn.gps.business.service.ISDeptService;
import com.isoft91.gonn.gps.utils.DozerUtils;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 部门表 服务实现类
* </p>
*
* @author 91isoft
* @since 2019-12-30
*/
@Service
public class SDeptServiceImpl extends ServiceImpl<SDeptMapper, SDept> implements ISDeptService {
@Override
public int logicalDelete(String id) {
SDept sDept = new SDept();
sDept.setDeleted();
sDept.setStop();
sDept.setBusinessId(id);
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("business_id", id);
int line = this.baseMapper.updateById(sDept);
return line;
}
@Override
public int delete(String id) {
return this.baseMapper.deleteById(id);
}
@Override
public List getDeptList(QuerySDeptDTO sDeptDTO) {
QueryWrapper queryWrapper = getQueryWrapper(sDeptDTO);
queryWrapper.select().orderByDesc("SORT");
List<SDept> sDepts = this.baseMapper.selectList(queryWrapper);
List<ResultSDeptDTO> resultSDeptDTOSDtos = DozerUtils.mapList(sDepts, ResultSDeptDTO.class);
return resultSDeptDTOSDtos;
}
@Override
public IPage getDeptListPage(Page page, QuerySDeptDTO sDeptDTO) {
QueryWrapper queryWrapper = getQueryWrapper(sDeptDTO);
return this.baseMapper.selectPage(page, queryWrapper);
}
private QueryWrapper getQueryWrapper(QuerySDeptDTO sDeptDTO) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.ne("del_flag", "1");
queryWrapper.ne("flag", "0");
if (StrUtil.isNotBlank(sDeptDTO.getBusinessId())){
queryWrapper.eq("busienss_id", sDeptDTO.getBusinessId());
}
return queryWrapper;
}
}
package com.isoft91.gonn.gps.business.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.isoft91.gonn.gps.business.dto.*;
import com.isoft91.gonn.gps.business.entity.SDictionary;
import com.isoft91.gonn.gps.business.mapper.SDictionaryMapper;
import com.isoft91.gonn.gps.business.service.ISDictionaryService;
import com.isoft91.gonn.gps.common.entity.DelStatus;
import com.isoft91.gonn.gps.common.entity.FlagStatus;
import com.isoft91.gonn.gps.utils.DozerUtils;
import com.isoft91.gonn.gps.utils.Result.Ret;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>
* 数据字典 服务实现类
* </p>
*
* @author 91isoft
* @since 2019-12-25
*/
@Service
public class SDictionaryServiceImpl extends ServiceImpl<SDictionaryMapper, SDictionary> implements ISDictionaryService {
@Value("${dictionary.mapper}")
private String mapper;
@Value("${dictionary.templateType.service}")
private String serviceType;
@Value("${dictionary.templateType.project}")
private String projectType;
@Value("${dictionary.templateStage.project}")
private String projectStageType;
@Value("${dictionary.templateStage.business}")
private String businessStageType;
@Value("${dictionary.templateStage.service}")
private String serviceStageType;
@Value("${dictionary.tempType}")
private String tempType;
@Autowired
SDictionaryMapper sDictionaryMapper;
@Override
public int logicalDelete(String id) {
SDictionary sDictionary = new SDictionary();
sDictionary.setDeleted();
sDictionary.setStop();
sDictionary.setBusinessId(id);
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("business_id", id);
int line = this.baseMapper.updateById(sDictionary);
return line;
}
@Override
public int delete(String id) {
return this.baseMapper.deleteById(id);
}
@Override
public List<ResultSDictionaryDTO> getDictionaryList(QuerySDictionaryDTO sDictionary) {
QueryWrapper queryWrapper = getQueryWrapper(sDictionary);
List<SDictionary> sDictionaries = this.baseMapper.selectList(queryWrapper);
List<ResultSDictionaryDTO> resultSictionaryDtos = DozerUtils.mapList(sDictionaries, ResultSDictionaryDTO.class);
return resultSictionaryDtos;
}
@Override
public SDictionary getDictionaryByID(String sDictionaryId) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.ne("del_flag", "1");
queryWrapper.ne("flag", "0");
queryWrapper.eq("BUSINESS_ID", sDictionaryId);
return this.baseMapper.selectOne(queryWrapper);
}
@Override
public IPage getDictionaryListPage(Page page, QuerySDictionaryDTO sDictionary) {
QueryWrapper queryWrapper = getQueryWrapper(sDictionary);
return this.baseMapper.selectPage(page, queryWrapper);
}
/**
* 条件分页查询数据字典
*/
@Override
public IPage getDictionaryListPageBy(Page page, QuerySDictionaryDTO querySDictionaryDTO) {
/*QueryWrapper<SDictionary> queryWrapper = new QueryWrapper();
queryWrapper.ne("del_flag", "1");
queryWrapper.ne("flag", "0");
queryWrapper.orderByDesc("create_date");
queryWrapper.like(StringUtils.isNotBlank(querySDictionaryDTO.getName()), "name", querySDictionaryDTO.getName())
.like(StringUtils.isNotBlank(querySDictionaryDTO.getType()), "type", querySDictionaryDTO.getType())
.like(StringUtils.isNotBlank(querySDictionaryDTO.getValue()), "value", querySDictionaryDTO.getValue())
.eq(StringUtils.isNotBlank(querySDictionaryDTO.getPid()), "PID", querySDictionaryDTO.getPid())
.eq(StringUtils.isNotBlank(querySDictionaryDTO.getBusinessId()), "BUSINESS_ID", querySDictionaryDTO.getBusinessId());*/
querySDictionaryDTO.setFlag(FlagStatus.NORMAL.getStatus());
querySDictionaryDTO.setDelFlag(DelStatus.NORMAL.getStatus());
return this.baseMapper.selSDictionaryPage(querySDictionaryDTO,page);
}
/**
* 根据类型查询数据字典
*
* @param type
* @return
*/
@Override
public List getDictionaryListByType(String type) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.ne("del_flag", "1");
queryWrapper.ne("flag", "0");
queryWrapper.eq("TYPE", type);
return this.baseMapper.selectList(queryWrapper);
}
@Override
public Map getGradeDic() {
Map map = new HashMap();
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("TYPE", projectType);
List<SDictionary> dictionaries = this.baseMapper.selectList(wrapper);
List<ResultSDictionaryDTO> resultSDictionaryDTOS = DozerUtils.mapList(dictionaries,ResultSDictionaryDTO.class);
map.put("projectStage",resultSDictionaryDTOS);
wrapper = new QueryWrapper();
wrapper.eq("TYPE",businessStageType);
dictionaries = this.baseMapper.selectList(wrapper);
resultSDictionaryDTOS = DozerUtils.mapList(dictionaries,ResultSDictionaryDTO.class);
map.put("businessStage",resultSDictionaryDTOS);
wrapper = new QueryWrapper();
wrapper.eq("TYPE",serviceStageType);
map.put("serviceStage",sDictionaryMapper.selectGradeList(serviceType,mapper));
return map;
}
@Override
public List<ResultSearchDTO> getTemplateTypeList() {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.ne("del_flag", "1");
queryWrapper.ne("flag", "0");
queryWrapper.eq("type", tempType);
List<SDictionary> sDictionaries = this.baseMapper.selectList(queryWrapper);
List<ResultSearchDTO> resultTemplateDTOs = DozerUtils.mapList(sDictionaries, ResultSearchDTO.class);
for (ResultSearchDTO dto: resultTemplateDTOs){
if (serviceType.equals(dto.getValue())){
queryWrapper = new QueryWrapper();
queryWrapper.eq("type",serviceType);
dto.setChild(DozerUtils.mapList(sDictionaryMapper.selectList(queryWrapper),ResultSDictionaryDTO.class));
}
}
return resultTemplateDTOs;
}
@Override
public List<ResultSearchDTO> getTemplateGradeList() {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.ne("del_flag", "1");
queryWrapper.ne("flag", "0");
queryWrapper.eq("type", "TEMP_GRADE");
List<SDictionary> sDictionaries = this.baseMapper.selectList(queryWrapper);
List<ResultSearchDTO> resultTemplateDTOs = DozerUtils.mapList(sDictionaries, ResultSearchDTO.class);
return resultTemplateDTOs;
}
/**
* 查询项目数据字典项目阶段
* []
*
* @return {@link Ret<List<SdProjectStageDTO>>}
* @throws
* @author jiangpengpeng
* @date 2020/2/19 14:03
*/
@Override
public Ret<List<SdProjectStageDTO>> getProjecetStage() {
SDictionary sDictionary = new SDictionary();
sDictionary.setType(projectStageType);
sDictionary.setNormal();
List<SdProjectStageDTO> projecetStage = sDictionaryMapper.getProjecetStage(sDictionary);
if (projecetStage.size() == 0) {
return Ret.error().setMsg("未查找到项目阶段");
}
return Ret.ok().setData(projecetStage);
}
@Override
public Ret<List<SdServiceStageDTO>> getServiceStage() {
SDictionary sDictionary = new SDictionary();
sDictionary.setType(serviceStageType);
sDictionary.setNormal();
List<SdServiceStageDTO> serviceStageDTOList = sDictionaryMapper.getServiceStage(sDictionary);
if (serviceStageDTOList.size() == 0) {
return Ret.error().setMsg("未查找到项目阶段");
}
return Ret.ok().setData(serviceStageDTOList);
}
private QueryWrapper getQueryWrapper(QuerySDictionaryDTO sDictionary) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.ne("del_flag", "1");
queryWrapper.ne("flag", "0");
if (StrUtil.isNotBlank(sDictionary.getBusinessId())) {
queryWrapper.eq("busienss_id", sDictionary.getBusinessId());
}
if (StrUtil.isNotBlank(sDictionary.getType())) {
queryWrapper.eq("type", sDictionary.getType());
}
if (StrUtil.isNotBlank(sDictionary.getName())) {
queryWrapper.eq("name", sDictionary.getName());
}
if (StrUtil.isNotBlank(sDictionary.getValue())) {
queryWrapper.eq("value", sDictionary.getValue());
}
return queryWrapper;
}
}
package com.isoft91.gonn.gps.business.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.isoft91.gonn.gps.business.dto.ProvinceDto;
import com.isoft91.gonn.gps.business.entity.SProvince;
import com.isoft91.gonn.gps.business.mapper.SProvinceMapper;
import com.isoft91.gonn.gps.business.service.ISProvinceService;
import com.isoft91.gonn.gps.business.vo.ProvinceVo;
import com.isoft91.gonn.gps.utils.Result.Ret;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author wulingfang
* @since 2021-04-15
*/
@Service
public class SProvinceServiceImpl extends ServiceImpl<SProvinceMapper, SProvince> implements ISProvinceService {
@Autowired
SProvinceMapper sProvinceMapper;
@Override
public Ret instProvince(ProvinceVo provinceDto) {
boolean a=false;
for (ProvinceDto dto: provinceDto.getProvinceDto()) {
SProvince province=new SProvince();
province.setName(dto.getName());
province.setLayer(dto.getLevel());
province.setLongitude(dto.getCenter().get(0));
province.setDimension(dto.getCenter().get(1));
if(StringUtils.isNotBlank(dto.getDistrict())){
//根据名称查询id
SProvince province1 = sProvinceMapper.selectProvinceByName(dto.getDistrict());
province.setPid(province1.getBusinessId());
}
province.setObjectid(dto.getObjectId());
int insert = sProvinceMapper.insert(province);
if (insert>0){
a=true;
}
}
if(a){
return Ret.ok();
}else {
return Ret.error();
}
}
}
package com.isoft91.gonn.gps.business.service.impl;
import cn.hutool.core.util.StrUtil;
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.isoft91.gonn.gps.business.dto.QuerySRoleDTO;
import com.isoft91.gonn.gps.business.dto.ResultSRoleDTO;
import com.isoft91.gonn.gps.business.entity.SRole;
import com.isoft91.gonn.gps.business.mapper.SRoleMapper;
import com.isoft91.gonn.gps.business.service.ISRoleService;
import com.isoft91.gonn.gps.utils.DozerUtils;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 角色表 服务实现类
* </p>
*
* @author 91isoft
* @since 2019-12-30
*/
@Service
public class SRoleServiceImpl extends ServiceImpl<SRoleMapper, SRole> implements ISRoleService {
@Override
public int logicalDelete(String id) {
SRole sRole = new SRole();
sRole.setDeleted();
sRole.setStop();
sRole.setBusinessId(id);
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("business_id", id);
int line = this.baseMapper.updateById(sRole);
return line;
}
@Override
public int delete(String id) {
return this.baseMapper.deleteById(id);
}
@Override
public List getRoleList(QuerySRoleDTO sRole) {
QueryWrapper queryWrapper = getQueryWrapper(sRole);
List<SRole> sRoles = this.baseMapper.selectList(queryWrapper);
List<ResultSRoleDTO> resultSRoleDTOS = DozerUtils.mapList(sRoles, ResultSRoleDTO.class);
return resultSRoleDTOS;
}
@Override
public IPage getRoleListPage(Page page, QuerySRoleDTO sRole) {
QueryWrapper queryWrapper = getQueryWrapper(sRole);
return this.baseMapper.selectPage(page, queryWrapper);
}
@Override
public List getRoleListById(String id) {
return null;
}
private QueryWrapper getQueryWrapper(QuerySRoleDTO sRole) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.ne("del_flag", "1");
queryWrapper.ne("flag", "0");
if (StrUtil.isNotBlank(sRole.getBusinessId())) {
queryWrapper.eq("busienss_id", sRole.getBusinessId());
}
return queryWrapper;
}
}
package com.isoft91.gonn.gps.business.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.isoft91.gonn.gps.business.entity.SUserRole;
import com.isoft91.gonn.gps.business.mapper.SUserRoleMapper;
import com.isoft91.gonn.gps.business.service.ISUserRoleService;
import org.springframework.stereotype.Service;
/**
* <p>
* 用户角色表 服务实现类
* </p>
*
* @author jiangpengpeng
* @since 2020-02-20
*/
@Service
public class SUserRoleServiceImpl extends ServiceImpl<SUserRoleMapper, SUserRole> implements ISUserRoleService {
}
package com.isoft91.gonn.gps.business.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.isoft91.gonn.gps.business.entity.SUser;
import com.isoft91.gonn.gps.business.mapper.SUserMapper;
import com.isoft91.gonn.gps.business.service.ISUserService;
import org.springframework.stereotype.Service;
/**
* <p>
* 用户表 服务实现类
* </p>
*
* @author jiangpengpeng
* @since 2020-01-09
*/
@Service
public class SUserServiceImpl extends ServiceImpl<SUserMapper, SUser> implements ISUserService {
}
package com.isoft91.gonn.gps.business.vo;
import lombok.Data;
@Data
public class OaCBusiConfVo {
private String type;
private String key;
private String value;
private String pId;
}
package com.isoft91.gonn.gps.business.vo;
import com.isoft91.gonn.gps.business.dto.ProvinceDto;
import lombok.Data;
import java.util.List;
@Data
public class ProvinceVo {
private List<ProvinceDto> provinceDto;
}
package com.isoft91.gonn.gps.common.aop;
import io.swagger.annotations.ApiOperation;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.*;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
/**
* 系统日志:切面处理类
*/
@Aspect
@Component
public class SysLogAspect implements Ordered {
private static Logger logger ;
//定义切点 @Pointcut
@Pointcut("execution(* com.isoft91.gonn.gps.business.*.controller..*.*(..)),order=3") //切点
public void webRequestLog(){}
@Pointcut("execution(* com.isoft91.gonn.gps.business.*.controller..*.*(..)),order=3") //切点
public void webExceptionLog(){}
@Before("webRequestLog()")
@Order(1)
public void doBefore(JoinPoint joinPoint){
try {
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 异常通知 用于拦截异常日志
*
* @param joinPoint
* @param e
*/
@Order(0)
@AfterThrowing(pointcut = "webExceptionLog()", throwing = "e")
public void doAfterThrowing(JoinPoint joinPoint, Throwable e) {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
try {
} catch (Exception ex) {
//记录本地异常日志
e.printStackTrace();
logger.error("==异常通知异常==");
}
}
@Override
public int getOrder() {
return 0;
}
/**
* 获取 方法上的注释
* @param joinPoint
* @return
*/
private String getMethodMess(JoinPoint joinPoint){
String value = "";
try {
Signature signature = joinPoint.getSignature();
MethodSignature methodSignature = (MethodSignature) signature;
Method targetMethod = methodSignature.getMethod();
Method realMethod = joinPoint.getTarget().getClass().getDeclaredMethod(signature.getName(), targetMethod.getParameterTypes());
if (realMethod.isAnnotationPresent(ApiOperation.class)) {
ApiOperation apiOperation = (ApiOperation) realMethod.getAnnotation(ApiOperation.class);
value = apiOperation.value();
}
}catch (Exception e) {
e.printStackTrace();
}
return value;
}
}
package com.isoft91.gonn.gps.common.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* Created with family.
* author: cy
* Date: 16/6/23
* Time: 上午10:04
* description: data 实体 常用属性
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public abstract class DataEntity<T> implements Serializable {
protected static final long serialVersionUID = 1L;
/**
* 创建人
*/
// @TableField("CREATE_BY")
@TableField(value="CREATE_BY", fill = FieldFill.INSERT)
protected String createBy;
/**
* 创建日期
*/
@TableField(value="CREATE_DATE", fill = FieldFill.INSERT)
@DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy/MM/dd HH:mm:ss")
protected LocalDateTime createDate;
/**
* 修改人
*/
// @TableField("UPDATE_BY")
@TableField(value="UPDATE_BY", fill = FieldFill.INSERT_UPDATE)
protected String updateBy;
/**
* 修改日期
*/
@TableField(value="UPDATE_DATE", fill = FieldFill.INSERT_UPDATE)
@DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy/MM/dd HH:mm:ss")
protected LocalDateTime updateDate;
/**
* 删除标记(0:正常;1:删除;2:审核)
*/
@TableField(value="DEL_FLAG", fill = FieldFill.INSERT)
protected String delFlag;
/**
* 启用标记(0:停用;1:启用)
*/
@TableField(value="FLAG", fill = FieldFill.INSERT)
protected String flag;
/**
* 设置删除
*/
public void setDeleted(){
this.setDelFlag(DelStatus.DELETED.getStatus());
}
/**
* 设置非删除
*/
public void setNotDeleted(){
this.setDelFlag(DelStatus.NORMAL.getStatus());
}
/**
* 设置启用
*/
public void setStart(){
this.setFlag(FlagStatus.NORMAL.getStatus());
}
/**
* 设置停用
*/
public void setStop(){
this.setFlag(FlagStatus.ABNORMAL.getStatus());
}
/**
* 设置非删除&启用
*/
public void setNormal(){
this.setFlag(FlagStatus.NORMAL.getStatus());
this.setDelFlag(DelStatus.NORMAL.getStatus());
}
/**
* 设置非删除&启用
*/
public void setPublish(){
this.setFlag(FlagStatus.NORMAL.getStatus());
this.setDelFlag(DelStatus.NORMAL.getStatus());
}
}
package com.isoft91.gonn.gps.common.entity;
/**
* Created with family.
* author: cy
* Date: 16/6/23
* Time: 下午2:06
* description:
*/
public enum DelStatus {
//正常0 逻辑删除1
NORMAL("0"),DELETED("1");
private String status;
public String getStatus(){
return status;
}
private DelStatus(String status){
this.status = status;
}
}
package com.isoft91.gonn.gps.common.entity;
/**
* Created with family.
* author: cy
* Date: 16/6/23
* Time: 下午2:06
* description:
*/
public enum FieldFilterStatus {
// 筛选1 不参与筛选 0
FILTER("1"),NOT_FILTER("0");
private String status;
public String getStatus(){
return status;
}
private FieldFilterStatus(String status){
this.status = status;
}
}
package com.isoft91.gonn.gps.common.entity;
/**
* Created with family.
* author: cy
* Date: 16/6/23
* Time: 下午2:06
* description:
*/
public enum FieldHeaderStatus {
// 显示在表头 1 不显示 0
SHOW("1"),NOT_SHOW("0");
private String status;
public String getStatus(){
return status;
}
private FieldHeaderStatus(String status){
this.status = status;
}
}
package com.isoft91.gonn.gps.common.entity;
/**
* Created with family.
* author: cy
* Date: 16/6/23
* Time: 下午2:06
* description:
*/
public enum FieldSortStatus {
// 参与排序 1 不排序 0
SORT("1"),NOT_SORT("0");
private String status;
public String getStatus(){
return status;
}
private FieldSortStatus(String status){
this.status = status;
}
}
package com.isoft91.gonn.gps.common.entity;
public enum FixedField {
createBy("createBy", "创建人"),
createDate("createDate","创建时间"),
updateBy("updateBy","更新人"),
updateDate("updateDate","更新时间"),
projectStage("stage","业务阶段"),
state("state","流程状态"),
name("name","任务节点")
;
private String label;
private String fieldName;
public static String getNameByLabel(String label) {
for (FixedField fix : FixedField.values()) {
if (fix.getLabel().equals(label)) {
return fix.getFieldName();
}
}
return null;
}
public static boolean equalsFieldId(String label) {
for (FixedField fix : FixedField.values()) {
if (fix.getLabel().equals(label)) {
return true;
}
}
return false;
}
public String getFieldName(){
return fieldName;
}
public String getLabel(){
return label;
}
private FixedField(String label, String fieldName){
this.label = label;
this.fieldName = fieldName;
}
}
package com.isoft91.gonn.gps.common.entity;
/**
* Created with family.
* author: cy
* Date: 16/6/23
* Time: 下午2:06
* description:
*/
public enum FlagStatus {
//启用1 停用0
PUBLISHED("2"),NORMAL("1"),ABNORMAL("0");
private String status;
public String getStatus(){
return status;
}
private FlagStatus(String status){
this.status = status;
}
}
package com.isoft91.gonn.gps.common.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import java.io.Serializable;
import java.util.UUID;
/**
* Created with family.
* author: cy
* Date: 16/6/2
* Time: 上午9:15
* description: id entity
*/
@Data
public abstract class IdEntity<T> extends DataEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 编号
*/
@TableId("BUSINESS_ID")
@TableField(fill = FieldFill.INSERT)
private String businessId;
@TableField(exist = false)
protected String token;
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
/**
* 通用设置ID
*/
public void setCommonBusinessId(){
this.setBusinessId(UUID.randomUUID().toString().replaceAll("-", ""));
}
}
\ No newline at end of file
package com.isoft91.gonn.gps.common.entity;
/**
* done
*
* @author :jiangpengpeng
* @date:2020/2/28 14:33
*/
public enum InstanceStates {
UNCOMMIT("0", "未提交审核"),
INREVIEW("1", "审核中"),
REJECTED("2", "已驳回"),
INWRITE("3", "待填写"),
PASSED("4", "已通过"),
BREAKINREVIEW("5", "终止审核中"),
BREAKINWRITE("6", "终止待填写"),
BREAKREJECTED("7", "终止已驳回"),
BREAKPASSED("8", "已终止"),
DELETE("10", "已删除"),
DELETEINREVIEW("9", "删除审核中"),
DELETEREJECTED("12", "删除已驳回"),
DELETEINWRITE("11", "待填写");
private String code;
private String message;
public String getCode() {
return code;
}
public String getMessage() {
return message;
}
public static String getMessByCode(String code) {
for (InstanceStates states : InstanceStates.values()) {
if (states.getCode().equals(code)) {
return states.getMessage();
}
}
return null;
}
private InstanceStates(String code, String message) {
this.code = code;
this.message = message;
}
}
package com.isoft91.gonn.gps.common.entity;
/**
* @Author: jiangpengpeng
* @Description:
* @Date: Created in 11:21 2019/9/11
* @Modified By:
*/
import lombok.Getter;
@Getter
public enum KDFormIdEnum {
MATERIAL("PAEZ_001"),//物料
OUT_STOCK("SAL_OUTSTOCK"),//出库单
STOCK("BD_STOCK"),//仓库
CUSTOMER("BD_Customer");//客户
private String formid;
KDFormIdEnum(String formid) {
this.formid = formid;
}
}
package com.isoft91.gonn.gps.common.entity;
import lombok.Getter;
/**
* 付款单是否可编辑
*
* @author :jiangpengpeng
* @date:2020/4/16 14:02
*/
@Getter
public enum PayIsWriteStatus {
WRITE("1"),
NOWRITE("0");
private String status;
PayIsWriteStatus(String status){
this.status = status;
};
}
package com.isoft91.gonn.gps.common.entity;
import lombok.Getter;
/**
* 付款单状态
*
* @author :jiangpengpeng
* @date:2020/4/16 14:02
*/
@Getter
public enum PayStatus {
RUN("0"),
HADPAY("1"),
REJECT("2"),
BREAK("5");
private String status;
PayStatus(String status){
this.status = status;
};
}
package com.isoft91.gonn.gps.common.entity;
public enum RoleType {
TIJIAOREN("提交人"),
ERJIJINGLI("二级经理"),
SANJIYUANGONG("三级员工(可进行新增基站操作)"),
SANJIJINGLI("三级经理"),
JIHUAYUHEGUIBUJINGLI("计划与合规部经理"),
WEIHUSANJIJINGLI("维护三级经理"),
QUYUZHUGUAN("区域主管"),
HEGUIBU("合规部"),
GUISHUBUMEN("department"),
GUISHUFUZEREN("personInCharge"),
JIANSHEBUMEN("buildDept"),
JIANSHEFUZEREN("buildUser");
private String status;
public String getStatus() {
return status;
}
private RoleType(String status) {
this.status = status;
}
}
package com.isoft91.gonn.gps.common.generator;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.*;
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class CodeGenerator {
/**
* <p>
* 读取控制台内容
* </p>
*/
public static String scanner(String tip) {
Scanner scanner = new Scanner(System.in);
StringBuilder help = new StringBuilder();
help.append("请输入" + tip + ":");
System.out.println(help.toString());
if (scanner.hasNext()) {
String ipt = scanner.next();
if (StrUtil.isNotBlank(ipt)) {
return ipt;
}
}
throw new MybatisPlusException("请输入正确的" + tip + "!");
}
public static void main(String[] args) {
// 代码生成器
AutoGenerator mpg = new AutoGenerator();
// 全局配置
GlobalConfig gc = new GlobalConfig();
String projectPath = System.getProperty("user.dir");
gc.setOutputDir(projectPath + "/src/main/java/");
gc.setAuthor("wulingfang");
gc.setOpen(false);
mpg.setGlobalConfig(gc);
// 数据源配置
DataSourceConfig dsc = new DataSourceConfig();
dsc.setUrl("jdbc:mysql://123.114.208.158:33060/oa?useUnicode=true&characterEncoding=utf-8&useSSL=false");
dsc.setDriverName("com.mysql.jdbc.Driver");
dsc.setUsername("gonn");
dsc.setPassword("qazxsw!2");
mpg.setDataSource(dsc);
// 包配置
PackageConfig pc = new PackageConfig();
pc.setModuleName(scanner("模块名"));
pc.setParent("com.isoft91.gonn.gps.business");
mpg.setPackageInfo(pc);
// 自定义配置
InjectionConfig cfg = new InjectionConfig() {
@Override
public void initMap() {
// to do nothing
}
};
// 如果模板引擎是 freemarker
String templatePath = "/templates/mapper.xml.ftl";
// 如果模板引擎是 velocity
// String templatePath = "/templates/mapper.xml.vm";
// 自定义输出配置
List<FileOutConfig> focList = new ArrayList<>();
// 自定义配置会被优先输出
focList.add(new FileOutConfig(templatePath) {
@Override
public String outputFile(TableInfo tableInfo) {
// 自定义输出文件名
return projectPath + "/src/main/resources/mapper/" + pc.getModuleName()
+ "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
}
});
cfg.setFileOutConfigList(focList);
mpg.setCfg(cfg);
// 配置模板
TemplateConfig templateConfig = new TemplateConfig();
// 配置自定义输出模板
// templateConfig.setEntity();
// templateConfig.setService();
// templateConfig.setController();
templateConfig.setXml(null);
mpg.setTemplate(templateConfig);
// 策略配置
StrategyConfig strategy = new StrategyConfig();
strategy.setNaming(NamingStrategy.underline_to_camel);
strategy.setColumnNaming(NamingStrategy.underline_to_camel);
strategy.setEntityLombokModel(true);
strategy.setRestControllerStyle(true);
strategy.setInclude(scanner("表名,多个英文逗号分割").split(","));
strategy.setSuperEntityColumns("id");
strategy.setControllerMappingHyphenStyle(true);
strategy.setTablePrefix("_");
strategy.setSuperEntityClass("com.isoft91.gonn.gps.common.entity.IdEntity");
strategy.setEntityLombokModel(true);
strategy.setRestControllerStyle(true);
strategy.entityTableFieldAnnotationEnable(true);
mpg.setStrategy(strategy);
mpg.setTemplateEngine(new FreemarkerTemplateEngine());
mpg.execute();
}
}
package com.isoft91.gonn.gps.common.help;
import org.springframework.stereotype.Component;
/**
* TODO 生成项目编号和获取当前登录人部门信息
*
* @author :jiangpengpeng
* @date:2020/4/17 16:14
*/
@Component
public class GetDept {
}
package com.isoft91.gonn.gps.common.help;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class StartProcessHelper {
}
package com.isoft91.gonn.gps.common.help;
import org.springframework.stereotype.Component;
import java.util.UUID;
@Component
public class UUIDGenerator {
public String getNextId() {
return UUID.randomUUID().toString().replaceAll("-", "");
}
}
\ No newline at end of file
package com.isoft91.gonn.gps.config.exception;
import lombok.Data;
@Data
public class ExceptionCommon extends RuntimeException {
public ExceptionCommon(){
super();
}
/**
* 指定详细描述构造通用异常
* @param detailedMessage 详细描述
*/
public ExceptionCommon(String detailedMessage) {
super(detailedMessage);
}
public ExceptionCommon(String message, Throwable cause) {
super(message, cause);
}
}
package com.isoft91.gonn.gps.config.exception;
import com.isoft91.gonn.gps.utils.Result.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.multipart.MaxUploadSizeExceededException;
import javax.servlet.http.HttpServletRequest;
@RestControllerAdvice
public class MyExceptionHandler {
@Value("${spring.servlet.multipart.max-file-size}")
private String maxFileSize;
@ExceptionHandler(MaxUploadSizeExceededException.class)
@ResponseBody
public Ret uploadException(MaxUploadSizeExceededException e) {
return Ret.error().setMsg("超出支持的最大上传文件大小(" + maxFileSize +")!");
}
@ExceptionHandler(Exception.class)
@ResponseBody
public Ret<?> handleException(HttpServletRequest request, Exception ex) {
String msg = null;
if (ex instanceof ExceptionCommon) {
ExceptionCommon bizException = (ExceptionCommon) ex;
msg = bizException.getMessage();
}
if (msg == null) {
msg = ex.getMessage();
}
return Ret.error().setData(msg);
}
}
package com.isoft91.gonn.gps.config.exception;
/**
* Done
*
* @author :jiangpengpeng
* @date:2020/1/7 16:52
*/
public class PmsTemplateExecution extends RuntimeException {
public PmsTemplateExecution(String message){
super(message);
}
}
package com.isoft91.gonn.gps.config.exception;
public class UsernameNotExistException extends RuntimeException {
public UsernameNotExistException(String message) {
super(message);
}
}
package com.isoft91.gonn.gps.config.filter;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.filter.GenericFilterBean;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;
public class JwtFilter extends GenericFilterBean {
@Value("${jwt.tokenHeader}")
private String tokenHeader;
@Value("${jwt.tokenPrefix}")
private String tokenPrefix;
@Value("${jwt.secret}")
private String secret;
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) servletRequest;
try {
String jwtToken = req.getHeader(tokenHeader);
if (jwtToken == null) {
filterChain.doFilter(req, servletResponse);
return;
}
Claims claims = Jwts.parser().setSigningKey(secret).parseClaimsJws(jwtToken.replace(tokenPrefix, ""))
.getBody();
String username = claims.getSubject();//获取当前登录用户名
List<GrantedAuthority> authorities = AuthorityUtils.commaSeparatedStringToAuthorityList((String) claims.get("authorities"));
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(username, null, authorities);
SecurityContextHolder.getContext().setAuthentication(token);
} catch (Exception e) {
System.out.println(e);
}
filterChain.doFilter(req, servletResponse);
}
}
package com.isoft91.gonn.gps.config.filter;
import com.alibaba.fastjson.JSON;
import com.isoft91.gonn.gps.config.exception.UsernameNotExistException;
import com.isoft91.gonn.gps.sys.entity.User;
import com.isoft91.gonn.gps.sys.service.UserDetailsServiceImpl;
import com.isoft91.gonn.gps.utils.Result.ResultEnums;
import com.isoft91.gonn.gps.utils.Result.Ret;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
/**
* 登陆信息 验证过滤器: JwtLoginFilter
*/
public class JwtLoginFilter extends AbstractAuthenticationProcessingFilter {
@Autowired
private UserDetailsServiceImpl userDetailsService;
@Value("${jwt.tokenHeader}")
private String tokenHeader;
@Value("${jwt.tokenPrefix}")
private String tokenPrefix;
@Value("${jwt.secret}")
private String secret;
@Value("${jwt.expiration}")
private int expiration;
public JwtLoginFilter(String defaultFilterProcessesUrl, AuthenticationManager authenticationManager) {
super(new AntPathRequestMatcher(defaultFilterProcessesUrl));
setAuthenticationManager(authenticationManager);
}
/**
* 接收并解析用户登陆信息 /login,为已验证的用户返回一个已填充的身份验证令牌,表示成功的身份验证
*/
@Override
public Authentication attemptAuthentication(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws AuthenticationException, IOException, ServletException {
//得到用户登陆信息,并封装到 Authentication 中,供自定义用户组件使用.
//这里并没有对用户名密码进行验证,而是使用 AuthenticationProvider 提供的 authenticate 方法
//返回一个完全经过身份验证的对象
return getAuthenticationManager().authenticate(new UsernamePasswordAuthenticationToken( (String)httpServletRequest.getParameter("username"), (String)httpServletRequest.getParameter("password")));
}
/**
*
* 登陆成功后,此方法会被调用,因此我们可以在次方法中生成token,并返回给客户端
*/
@Override
protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException {
Collection<? extends GrantedAuthority> authorities = authResult.getAuthorities();
StringBuffer as = new StringBuffer();
StringBuilder roleName = new StringBuilder();
/* for(GrantedAuthority authority: authorities) {
as.append(authority.getAuthority()).append(",");
}*/
as.append(authResult.getName()).append(",");
// as.append(userRoles);
String jwt = Jwts.builder()
.claim("authorities", as)//配置用户角色
.setSubject(authResult.getName())
.setExpiration(new Date(System.currentTimeMillis() + expiration))
.signWith(SignatureAlgorithm.HS512,secret)
.compact();
response.setContentType("application/json;charset=utf-8");
// response.setHeader("token", jwt);
PrintWriter out = response.getWriter();
// out.write(new ObjectMapper().writeValueAsString(jwt));
Map<String,String> resultMap = new HashMap<>();
resultMap.put(tokenHeader, jwt);
resultMap.put("role", roleName.toString());
User user = (User) authResult.getPrincipal();
resultMap.put("email", user.getEmail());
String resJson = JSON.toJSONString(Ret.build(ResultEnums.LOGIN_SUCCESS).setData(resultMap));
out.write(resJson);
out.flush();
out.close();
}
@Override
protected void unsuccessfulAuthentication(HttpServletRequest req, HttpServletResponse resp, AuthenticationException failed) throws IOException, ServletException {
resp.setContentType("application/json;charset=utf-8");
PrintWriter out = resp.getWriter();
String tipInfo;
if (failed.getCause() instanceof UsernameNotExistException) {
tipInfo = failed.getMessage();
// } else if (failed.getCause() instanceof RedisConnectionFailureException) {
// tipInfo = "Redis连接失败";
} else if (failed instanceof BadCredentialsException) {
tipInfo = "用户名或密码错误";
} else {
tipInfo = failed.getMessage();
}
String resJson = JSON.toJSONString(Ret.build(ResultEnums.LOGIN_ERROR).setData(tipInfo));
out.write(resJson);
out.flush();
out.close();
}
}
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论