# Conflicts:
#	ruoyi-admin/src/main/java/com/ruoyi/tc/baseClass/AssetLc.java
#	ruoyi-admin/src/main/java/com/ruoyi/tc/baseClass/AssetTask.java
#	ruoyi-admin/src/main/java/com/ruoyi/tc/baseClass/request/AssetLcRequest.java
main
dongdingding 2 months ago
commit ddc6006ee6

@ -1,46 +1,21 @@
package com.ruoyi.tc.domain;
package com.ruoyi.tc.baseClass;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* (unit_other_contact)
*
* @author du
* @since 2024/11/13 14:44
* @since 2024/11/15 16:01
*/
@Data
@ApiModel("单位其他联系人")
@TableName(value = "unit_other_contact")
public class UnitOtherConcat implements Serializable {
@TableId(type = IdType.AUTO,value = "id")
private Long id;
@ApiModelProperty("单位id")
@NotNull
private Long unitId;
@ApiModelProperty("其他联系人姓名")
private String qtlxrxm;
@ApiModelProperty("其他联系人联系方式")
private String qtlxrlxfs;
@ApiModelProperty("其他联系人邮箱")
private String qtlxryx;
@ApiModelProperty("其他联系人职务职称")
private String qtlxrzwzc;
public class BaseClass {
/**
*
*/
@ -74,4 +49,18 @@ public class UnitOtherConcat implements Serializable {
private Date updateTime;
private String remark;
/**
* ID
*/
@ApiModelProperty("创建ID")
@TableField(fill = FieldFill.INSERT)
private Long createId;
/**
* ID
*/
@ApiModelProperty("更新者ID")
@TableField(fill = FieldFill.UPDATE)
private Long updateId;
}

@ -0,0 +1,292 @@
package com.ruoyi.tc.controller;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.tc.entity.*;
import com.ruoyi.tc.entity.request.AssetCurrentPageRequest;
import com.ruoyi.tc.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* (AssetCurrent)
*
* @author makejava
* @since 2024-11-15 10:03:56
*/
@Api(tags = "现有资产表")
@RestController
@RequestMapping("/tc/assetCurrent")
public class AssetCurrentController extends BaseController {
/**
*
*/
@Resource
private AssetCurrentService assetCurrentService;
@Resource
private AssetSupplyChainService assetSupplyChainService;
@Resource
private AssetBasicNetworkService assetBasicNetworkService;
@Resource
private AssetBusinessFormService assetBusinessFormService;
@Resource
private UnitOtherConcatService unitOtherConcatService;
/**
*
*
* @param as
* @return
*/
@ApiOperation(value = "分页查询所有数据", response = AssetCurrent.class)
@GetMapping
public AjaxResult selectAll(AssetCurrentPageRequest as) {
Page<AssetCurrent> page = new Page<>();
page.setSize(as.getSize());
page.setCurrent(as.getCurrent());
try {
if (!SecurityUtils.getLoginUser().getUser().isAdmin() && !SecurityUtils.hasRole("common")) {
as.setDwmc(SecurityUtils.getLoginUser().getUser().getNickName());
}
} catch (Exception e) {
throw new ServiceException("获取用户信息异常");
}
return success(assetCurrentService.page(page, as));
}
/**
*
*
* @param id
* @return
*/
@ApiOperation(value = "通过主键查询单条数据", response = AssetCurrent.class)
@GetMapping("{id}")
public AjaxResult selectOne(@PathVariable Serializable id) {
return success(assetCurrentService.selectOne(id));
}
/**
*
*
* @param assetCurrent
* @return
*/
@ApiOperation(value = "新增数据")
@PostMapping
@Transactional(rollbackFor = Exception.class)
public AjaxResult insert(@RequestBody @Valid AssetCurrent assetCurrent) {
assetCurrentService.save(assetCurrent);
//新增新监管业务形态
if (assetCurrent.getXjgywxt() != null) {
assetCurrent.getXjgywxt().setAssetId(assetCurrent.getId());
assetBusinessFormService.save(assetCurrent.getXjgywxt());
}
if (!assetCurrent.getGylxxList().isEmpty()) {
for (AssetSupplyChain items : assetCurrent.getGylxxList()) {
items.setAssetId(assetCurrent.getId());
}
//新增供应链
assetSupplyChainService.saveBatch(assetCurrent.getGylxxList());
}
if (!assetCurrent.getJcwlList().isEmpty()) {
for (AssetBasicNetwork items : assetCurrent.getJcwlList()) {
items.setAssetId(assetCurrent.getId());
}
//新增基础网络
assetBasicNetworkService.saveBatch(assetCurrent.getJcwlList());
}
if (!assetCurrent.getOtherConcat().isEmpty()) {
for (UnitOtherConcat items : assetCurrent.getOtherConcat()) {
items.setAssetId(assetCurrent.getId());
}
//新增其他联系人
unitOtherConcatService.saveBatch(assetCurrent.getOtherConcat());
}
return success();
}
/**
*
*
* @param assetCurrent
* @return
*/
@ApiOperation(value = "修改数据")
@PutMapping
public AjaxResult update(@RequestBody @Valid AssetCurrent assetCurrent) {
assetCurrentService.updateById(assetCurrent);
if (assetCurrent.getXjgywxt() != null) {
assetCurrent.getXjgywxt().setAssetId(assetCurrent.getId());
assetBusinessFormService.saveOrUpdate(assetCurrent.getXjgywxt());
}
if (!assetCurrent.getGylxxList().isEmpty()) {
for (AssetSupplyChain items : assetCurrent.getGylxxList()) {
items.setAssetId(assetCurrent.getId());
}
//新增供应链
assetSupplyChainService.saveOrUpdateBatch(assetCurrent.getGylxxList());
}
if (!assetCurrent.getJcwlList().isEmpty()) {
for (AssetBasicNetwork items : assetCurrent.getJcwlList()) {
items.setAssetId(assetCurrent.getId());
}
//新增基础网络
assetBasicNetworkService.saveOrUpdateBatch(assetCurrent.getJcwlList());
}
if (!assetCurrent.getOtherConcat().isEmpty()) {
for (UnitOtherConcat items : assetCurrent.getOtherConcat()) {
items.setAssetId(assetCurrent.getId());
}
//新增其他联系人
unitOtherConcatService.saveOrUpdateBatch(assetCurrent.getOtherConcat());
}
return success();
}
/**
*
*
* @param idList
* @return
*/
@ApiOperation(value = "删除数据")
@DeleteMapping
public AjaxResult delete(@RequestParam("idList") List<Long> idList) {
assetSupplyChainService.deleteByAssetIds(idList);
assetBasicNetworkService.deleteByAssetIds(idList);
assetBusinessFormService.deleteByAssetIds(idList);
unitOtherConcatService.deleteByAssetIds(idList);
assetCurrentService.deleteByUnitIds(idList);
return success();
}
/**
*
*/
@ApiOperation(value = "下载资产导入模板")
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) {
ExcelUtil<AssetExport> util = new ExcelUtil<>(AssetExport.class);
util.importTemplateExcel(response, "资产导入模板");
}
/**
*
*/
@ApiOperation(value = "导出现有资产")
@PostMapping("/export")
public void exportProject(HttpServletResponse response, AssetCurrentPageRequest as) {
List<AssetCurrent> list = assetCurrentService.page(as);
List<AssetExport> proList = new ArrayList<>();
for (AssetCurrent x : list) {
//对应的资产
AssetExport assetExport = new AssetExport();
BeanUtil.copyProperties(x, assetExport);
//查找对应的系统建设单位
AssetSupplyChain jsdw = assetSupplyChainService.getJsdw(x.getId());
BeanUtil.copyProperties(jsdw, assetExport);
List<AssetBasicNetwork> byList = assetBasicNetworkService.getByAssetId(x.getId());
for (AssetBasicNetwork items : byList) {
if (items.getType() == 1) {
//查找对应的服务器信息
BeanUtil.copyProperties(items, assetExport);
}
if (items.getType() == 2) {
//查找对应网络设备
assetExport.setWlpp(items.getPp());
assetExport.setWlyjxh(items.getYjxh());
assetExport.setWlyjbsxx(items.getYjbsxx());
assetExport.setWlsblx(items.getSblx());
assetExport.setWlyjbbxx(items.getYjbbxx());
assetExport.setWlyjxlh(items.getYjxlh());
assetExport.setWlsbIp(items.getSbIp());
assetExport.setWlyjyt(items.getYjyt());
}
if (items.getType() == 3) {
//查找对应安全设备
assetExport.setAqwlpp(items.getPp());
assetExport.setAqwlsblx(items.getSblx());
assetExport.setAqwlsbIp(items.getSbIp());
}
}
proList.add(assetExport);
}
ExcelUtil<AssetExport> util = new ExcelUtil<>(AssetExport.class);
util.exportExcel(response, proList, "现有资产记录");
}
/**
*
*/
@ApiOperation(value = "导入现有资产")
@PostMapping(value = "/import", consumes = "multipart/form-data")
public AjaxResult export(@RequestPart("file") MultipartFile file) throws Exception {
//读取所有的字段
ExcelUtil<AssetExport> util = new ExcelUtil<>(AssetExport.class);
List<AssetExport> proList = util.importExcel(file.getInputStream());
for (AssetExport items : proList) {
AssetCurrent as = new AssetCurrent();
//copy新增到新的现有资产表里面
BeanUtil.copyProperties(items, as);
assetCurrentService.save(as);
//新增系统建设单位
AssetSupplyChain s1 = new AssetSupplyChain();
BeanUtil.copyProperties(items, s1);
s1.setType(5);
s1.setAssetId(as.getId());
assetSupplyChainService.save(s1);
//新增服务器信息
AssetBasicNetwork a1 = new AssetBasicNetwork();
BeanUtil.copyProperties(items, a1);
a1.setType(1);
a1.setAssetId(as.getId());
assetBasicNetworkService.save(a1);
//新增网络设备
AssetBasicNetwork a2 = new AssetBasicNetwork();
a2.setSblx(items.getWlsblx());
a2.setPp(items.getWlpp());
a2.setSbIp(items.getWlsbIp());
a2.setYjxh(items.getWlyjxh());
a2.setYjxlh(items.getWlyjxlh());
a2.setYjbbxx(items.getWlyjbbxx());
a2.setYjyt(items.getWlyjyt());
a2.setYjbsxx(items.getWlyjbsxx());
a2.setType(2);
a2.setAssetId(as.getId());
assetBasicNetworkService.save(a2);
//新增安全设备
AssetBasicNetwork a3 = new AssetBasicNetwork();
a3.setSblx(items.getAqwlsblx());
a3.setPp(items.getAqwlpp());
a3.setSbIp(items.getAqwlsbIp());
a3.setType(3);
a3.setAssetId(as.getId());
assetBasicNetworkService.save(a3);
}
return AjaxResult.success();
}
}

@ -0,0 +1,155 @@
package com.ruoyi.tc.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.request.UnitRequest;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.tc.service.UnitOtherConcatService;
import com.ruoyi.tc.service.UnitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;
/**
* (unit)
*
* @author du
* @since 2024/11/18 17:11
*/
@Api(tags = "单位表控制层")
@RestController
@PreAuthorize("@ss.hasAnyRoles('admin,common')")
@RequestMapping("/tc/unit")
public class UnitController {
@Resource
private UnitService unitService;
@Resource
private UnitOtherConcatService unitOtherConcatService;
/**
*
*/
@ApiOperation(value = "获取单位列表", response = Unit.class)
@GetMapping("/list")
public AjaxResult list(UnitRequest unit) {
Page<Unit> page = new Page<>();
page.setSize(unit.getSize());
page.setCurrent(unit.getCurrent());
return AjaxResult.success(unitService.page(page, unit));
}
/**
*
*/
@ApiOperation(value = "单位导出")
@Log(title = "单位导出", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, UnitRequest unit) {
List<Unit> list = unitService.selectUnitList(unit);
ExcelUtil<Unit> util = new ExcelUtil<>(Unit.class);
util.exportExcel(response, list, "单位数据");
}
/**
*
*/
@ApiOperation(value = "单位导入")
@Log(title = "单位导入", businessType = BusinessType.IMPORT)
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file) throws Exception {
ExcelUtil<Unit> util = new ExcelUtil<>(Unit.class);
List<Unit> list = util.importExcel(file.getInputStream());
unitService.saveBatch(list);
for (Unit x : list) {
//查询用户表是否存在该用户
unitService.validUser(x);
}
return AjaxResult.success();
}
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) {
ExcelUtil<Unit> util = new ExcelUtil<>(Unit.class);
util.importTemplateExcel(response, "单位模板");
}
/**
* id
*/
@ApiOperation(value = "根据用户编号获取详细信息")
@GetMapping("/{id}")
public AjaxResult getInfo(@PathVariable(value = "id") Long id) {
return AjaxResult.success(unitService.getById(id));
}
/**
*
*/
@ApiOperation(value = "新增单位")
@Log(title = "新增单位", businessType = BusinessType.INSERT)
@PostMapping
@Transactional(rollbackFor = Exception.class)
public AjaxResult add(@Valid @RequestBody Unit unit) {
if (!unitService.lambdaQuery().eq(Unit::getUserName, unit.getUserName()).eq(Unit::getDelFlag, "0").list().isEmpty()) {
throw new ServiceException(unit.getUserName() + "'已存在单位!");
}
//新增单位到单位信息表
unitService.save(unit);
//新增其他联系人
unitOtherConcatService.saveBatch(unit.getOtherConcat());
//查询用户表是否存在该用户
unitService.validUser(unit);
return AjaxResult.success();
}
/**
*
*/
@ApiOperation(value = "修改用户")
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping
@Transactional(rollbackFor = Exception.class)
public AjaxResult edit(@Valid @RequestBody Unit x) {
Unit byId = unitService.getById(x.getId());
if (!byId.getUserName().equals(x.getUserName()) || !byId.getNickName().equals(x.getNickName())) {
throw new ServiceException("不允许修改单位名称和统一信用代码!");
}
unitService.updateById(x);
if(!x.getOtherConcat().isEmpty()){
x.getOtherConcat().forEach(y->{
y.setUnitId(x.getId());
});
}
unitOtherConcatService.saveOrUpdateBatch(x.getOtherConcat());
return AjaxResult.success();
}
/**
*
*/
@ApiOperation(value = "删除单位")
@Log(title = "删除单位", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable List<Long> ids) {
List<String> userNames = unitService.selectByIds(ids);
//逻辑删除单位和用户
unitService.deleteUsers(userNames);
unitService.deleteUnits(ids);
unitOtherConcatService.deleteByUnitIds(ids);
return AjaxResult.success();
}
}

@ -1,104 +0,0 @@
package com.ruoyi.tc.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.tc.domain.UnitOtherConcat;
import com.ruoyi.tc.service.UnitOtherConcatService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
/**
* (unit_other_contact)
* @author du
* @since 2024/11/13 14:50
*/
@RestController
@RequestMapping("/unit/otherConcat")
@Api(tags = "单位其他联系人控制层")
public class UnitOtherConcatController extends BaseController {
/**
*
*/
@Resource
private UnitOtherConcatService unitOtherConcatService;
/**
* unit_id
*
* @param unitId unit_id
* @return
*/
// @PreAuthorize("@ss.hasAnyRoles('admin')")
@ApiOperation(value = "根据unit_id查询该单位所有数据", response = UnitOtherConcat.class)
@GetMapping("/selectAll/{unitId}")
public AjaxResult selectAll(@PathVariable Long unitId) {
return success(unitOtherConcatService.lambdaQuery().eq(UnitOtherConcat::getUnitId,unitId).list());
}
/**
*
*
* @param id
* @return
*/
@ApiOperation(value = "通过主键查询单条数据", response = UnitOtherConcat.class)
@GetMapping("/{id}")
public AjaxResult selectOne(@PathVariable Serializable id) {
return success(unitOtherConcatService.getById(id));
}
/**
*
*
* @param u
* @return
*/
// @PreAuthorize("@ss.hasAnyRoles('admin')")
@ApiOperation(value = "新增数据")
@PostMapping
public AjaxResult insert(@Valid @RequestBody UnitOtherConcat u) {
return success(unitOtherConcatService.save(u));
}
/**
*
*
* @param u
* @return
*/
// @PreAuthorize("@ss.hasAnyRoles('admin')")
@ApiOperation(value = "修改数据")
@PostMapping("/edit")
public AjaxResult update(@RequestBody UnitOtherConcat u) {
return success(unitOtherConcatService.updateById(u));
}
/**
*
*
* @param ids
* @return
*/
// @PreAuthorize("@ss.hasAnyRoles('admin')")
@ApiOperation(value = "删除数据")
@PostMapping("/ids")
public AjaxResult delete(Long[] ids) {
return success(unitOtherConcatService.removeBatchByIds(Arrays.asList(ids)));
}
}

@ -0,0 +1,89 @@
package com.ruoyi.tc.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.tc.baseClass.BaseClass;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* (asset_basic_network)
* @author du
* @since 2024/11/13 14:44
*/
@Data
@ApiModel("资产基础网络")
@TableName(value = "asset_basic_network")
public class AssetBasicNetwork extends BaseClass implements Serializable {
@TableId(type = IdType.AUTO,value = "id")
private Integer id;
/**
* id
*/
@ApiModelProperty("资源id")
private Long assetId;
/**
* 1.23
*/
@ApiModelProperty("1.服务器信息2网络设备3安全设备")
private Integer type;
/**
*
*/
@ApiModelProperty("设备类型")
private String sblx;
/**
*
*/
@ApiModelProperty("品牌")
private String pp;
/**
* IP
*/
@ApiModelProperty("设备IP")
private String sbIp;
/**
*
*/
@ApiModelProperty("操作系统")
private Integer czxt;
/**
*
*/
@ApiModelProperty("操作系统版本")
private String czxtbb;
/**
*
*/
@ApiModelProperty("硬件型号")
private String yjxh;
/**
*
*/
@ApiModelProperty("硬件序列号")
private String yjxlh;
/**
*
*/
@ApiModelProperty("硬件版本信息")
private String yjbbxx;
/**
*
*/
@ApiModelProperty("硬件用途")
private String yjyt;
/**
*
*/
@ApiModelProperty("硬件部署位置")
private String yjbsxx;
@ApiModelProperty("删除标志0代表存在 2代表删除")
private String delFlag;
}

@ -0,0 +1,403 @@
package com.ruoyi.tc.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.tc.baseClass.BaseClass;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Size;
import java.io.Serializable;
/**
* (asset_business_form)
* @author du
* @since 2024/11/13 14:44
*/
@Data
@ApiModel("资产新监管业务形态")
@TableName(value = "asset_business_form")
public class AssetBusinessForm extends BaseClass implements Serializable {
@TableId(type = IdType.AUTO,value = "id")
private Integer id;
/**
* id
*/
@ApiModelProperty("资源id")
private Long assetId;
/**
* -
*/
@Size(max= 50,message="云平台-云平台服务商长度不能超过50")
@ApiModelProperty("云平台-云平台服务商")
private String yptFws;
/**
* -
*/
@ApiModelProperty("云平台-是否租户级安全")
private Integer yptSfzh;
/**
* -
*/
@Size(max= 50,message="云平台-云平台类型长度不能超过50")
@ApiModelProperty("云平台-云平台类型")
private String yptLx;
/**
* -
*/
@Size(max= 50,message="云平台-硬件资源大小长度不能超过50")
@ApiModelProperty("云平台-硬件资源大小")
private String yptYjzydx;
/**
* -
*/
@Size(max= 50,message="云平台-平台架构长度不能超过50")
@ApiModelProperty("云平台-平台架构")
private String yptPtjg;
/**
* -IP
*/
@Size(max= 50,message="云平台-互联网IP段长度不能超过50")
@ApiModelProperty("云平台-互联网IP段")
private String yptIp;
/**
* -
*/
@Size(max= 50,message="云平台-机房联系人长度不能超过50")
@ApiModelProperty("云平台-机房联系人")
private String yptJflxr;
/**
* -
*/
@Size(max= 50,message="云平台-机房联系人电话长度不能超过50")
@ApiModelProperty("云平台-机房联系人电话")
private String yptJflxrdh;
/**
* -
*/
@Size(max= 50,message="云平台-服务器设备类型长度不能超过50")
@ApiModelProperty("云平台-服务器设备类型")
private String yptFwqsblx;
/**
* -
*/
@Size(max= 50,message="大数据平台-平台服务商长度不能超过50")
@ApiModelProperty("大数据平台-平台服务商")
private String dsjPtfws;
/**
* -
*/
@Size(max= 50,message="大数据平台-敏感数据类型长度不能超过50")
@ApiModelProperty("大数据平台-敏感数据类型")
private String dsjMgsjlx;
/**
* -
*/
@Size(max= 50,message="大数据平台-硬件资源长度不能超过50")
@ApiModelProperty("大数据平台-硬件资源")
private String dsjYjzy;
/**
* -
*/
@Size(max= 50,message="大数据平台-系统数据量长度不能超过50")
@ApiModelProperty("大数据平台-系统数据量")
private String dsjXtsjl;
/**
* -
*/
@Size(max= 50,message="大数据平台-机房联系人长度不能超过50")
@ApiModelProperty("大数据平台-机房联系人")
private String dsjJflxr;
/**
* -
*/
@Size(max= 50,message="大数据平台-机房联系人电话长度不能超过50")
@ApiModelProperty("大数据平台-机房联系人电话")
private String dsjJflxrdh;
/**
* -
*/
@ApiModelProperty("大数据平台-是否数据审计")
private Integer dsjSfsjsj;
/**
* -
*/
@Size(max= 50,message="一般物联网设备-系统集成商名称长度不能超过50")
@ApiModelProperty("一般物联网设备-系统集成商名称")
private String wlwsbXtjcs;
/**
* -
*/
@Size(max= 50,message="一般物联网设备-用户数量长度不能超过50")
@ApiModelProperty("一般物联网设备-用户数量")
private String wlwsbYhsl;
/**
* -
*/
@ApiModelProperty("一般物联网设备-服务对象")
private Integer wlwsbFwdx;
/**
* -
*/
@Size(max= 50,message="一般物联网设备-终端数量长度不能超过50")
@ApiModelProperty("一般物联网设备-终端数量")
private String wlwsbZdsl;
/**
* -
*/
@ApiModelProperty("一般物联网设备-网络互联情况")
private Integer wlwsbWlhlqk;
/**
* -
*/
@Size(max= 50,message="一般物联网设备-联系人长度不能超过50")
@ApiModelProperty("一般物联网设备-联系人")
private String wlwsbLxr;
/**
* -
*/
@ApiModelProperty("一般物联网设备-服务范围")
private Integer wlwsbFwfw;
/**
* -
*/
@Size(max= 50,message="一般物联网设备-联系人电话长度不能超过50")
@ApiModelProperty("一般物联网设备-联系人电话")
private String wlwsbLxrdh;
/**
* -
*/
@Size(max= 500,message="一般物联网设备-服务内容长度不能超过500")
@ApiModelProperty("一般物联网设备-服务内容")
private String wlwsbFwnr;
/**
* -
*/
@Size(max= 50,message="摄像头-摄像头品牌长度不能超过50")
@ApiModelProperty("摄像头-摄像头品牌")
private String sxtPp;
/**
* -
*/
@Size(max= 255,message="摄像头-位置长度不能超过255")
@ApiModelProperty("摄像头-位置")
private String sxtWz;
/**
* -IP
*/
@Size(max= 50,message="摄像头-摄像头IP长度不能超过50")
@ApiModelProperty("摄像头-摄像头IP")
private String sxtIp;
/**
* -
*/
@Size(max= 50,message="摄像头-区域长度不能超过50")
@ApiModelProperty("摄像头-区域")
private String sxtQy;
/**
* -
*/
@Size(max= 50,message="摄像头-摄像头数量长度不能超过50")
@ApiModelProperty("摄像头-摄像头数量")
private String sxtSl;
/**
* -
*/
@Size(max= 50,message="摄像头-端口长度不能超过50")
@ApiModelProperty("摄像头-端口")
private String sxtDk;
/**
* -
*/
@Size(max= 50,message="摄像头-设备型号长度不能超过50")
@ApiModelProperty("摄像头-设备型号")
private String sxtSbxh;
/**
* -
*/
@Size(max= 50,message="摄像头-固定版本长度不能超过50")
@ApiModelProperty("摄像头-固定版本")
private String sxtGdbb;
/**
* APP-APP
*/
@Size(max= 50,message="移动APP-移动APP系统长度不能超过50")
@ApiModelProperty("移动APP-移动APP系统")
private String appXt;
/**
* APP-
*/
@Size(max= 50,message="移动APP-服务端域名长度不能超过50")
@ApiModelProperty("移动APP-服务端域名")
private String appYm;
/**
* APP-APP
*/
@Size(max= 50,message="移动APP-移动APP渠道长度不能超过50")
@ApiModelProperty("移动APP-移动APP渠道")
private String appQd;
/**
* APP-IP
*/
@Size(max= 50,message="移动APP-服务端IP长度不能超过50")
@ApiModelProperty("移动APP-服务端IP")
private String appIp;
/**
* APP-
*/
@Size(max= 50,message="移动APP-联系人长度不能超过50")
@ApiModelProperty("移动APP-联系人")
private String appLxr;
/**
* APP-
*/
@Size(max= 50,message="移动APP-联系人电话长度不能超过50")
@ApiModelProperty("移动APP-联系人电话")
private String appLxrdh;
/**
* APP-APP
*/
@ApiModelProperty("移动APP-APP是否有身份认证")
private Integer appSfysfrz;
/**
* -
*/
@Size(max= 255,message="工业控制-系统集成商名称长度不能超过255")
@ApiModelProperty("工业控制-系统集成商名称")
private String gykzJcs;
/**
* -
*/
@Size(max= 255,message="工业控制-运行时间长度不能超过255")
@ApiModelProperty("工业控制-运行时间")
private String gykzYxsj;
/**
* -
*/
@ApiModelProperty("工业控制-服务对象")
private Integer gykzFwdx;
/**
* -
*/
@Size(max= 255,message="工业控制-集成商国内外情况长度不能超过255")
@ApiModelProperty("工业控制-集成商国内外情况")
private String gykzJcsqk;
/**
* -
*/
@ApiModelProperty("工业控制-网络互联情况")
private Integer gykzWlhxqk;
/**
* -
*/
@Size(max= 255,message="工业控制-联系人长度不能超过255")
@ApiModelProperty("工业控制-联系人")
private String gykzLxr;
/**
* -
*/
@ApiModelProperty("工业控制-服务范围")
private Integer gykzFwfw;
/**
* -
*/
@Size(max= 50,message="工业控制-联系人电话长度不能超过50")
@ApiModelProperty("工业控制-联系人电话")
private String gykzLxrdh;
/**
* -
*/
@Size(max= 50,message="工业控制-设备名称长度不能超过50")
@ApiModelProperty("工业控制-设备名称")
private String gykzSbmc;
/**
* -
*/
@Size(max= 50,message="工业控制-设备品牌长度不能超过50")
@ApiModelProperty("工业控制-设备品牌")
private String gykzSbpp;
/**
* -
*/
@Size(max= 50,message="工业控制-设备类别长度不能超过50")
@ApiModelProperty("工业控制-设备类别")
private String gykzSblb;
/**
* -
*/
@Size(max= 50,message="工业控制-运营商长度不能超过50")
@ApiModelProperty("工业控制-运营商")
private String gykzYys;
/**
* -IP
*/
@Size(max= 50,message="工业控制-互联网IP长度不能超过50")
@ApiModelProperty("工业控制-互联网IP")
private String gykzHlwIp;
/**
* -
*/
@Size(max= 50,message="工业控制-网络层级长度不能超过50")
@ApiModelProperty("工业控制-网络层级")
private String gykzWlcj;
/**
* -IP
*/
@Size(max= 50,message="工业控制-控制台IP长度不能超过50")
@ApiModelProperty("工业控制-控制台IP")
private String gykzKztIp;
/**
* -
*/
@Size(max= 500,message="工业控制-描述长度不能超过500")
@ApiModelProperty("工业控制-描述")
private String gykzMs;
/**
* CDN-CDN
*/
@Size(max= 255,message="CDN信息-CDN供应商长度不能超过255")
@ApiModelProperty("CDN信息-CDN供应商")
private String cdnGys;
/**
* CDN-CDN使
*/
@ApiModelProperty("CDN信息-CDN是否使用")
private Integer cdnSfsy;
/**
* CDN-CDN
*/
@Size(max= 50,message="CDN信息-CDN类型长度不能超过50")
@ApiModelProperty("CDN信息-CDN类型")
private String cdnLx;
/**
* CDN-CDN
*/
@Size(max= 50,message="CDN信息-CDN域名长度不能超过50")
@ApiModelProperty("CDN信息-CDN域名")
private String cdnYm;
/**
* CDN-
*/
@Size(max= 50,message="CDN信息-联系人长度不能超过50")
@ApiModelProperty("CDN信息-联系人")
private String cdnLxr;
/**
* CDN-
*/
@Size(max= 50,message="CDN信息-联系人电话长度不能超过50")
@ApiModelProperty("CDN信息-联系人电话")
private String cdnLxrdh;
/**
* CDN-CDN
*/
@Size(max= 500,message="CDN信息-CDN加速信息长度不能超过500")
@ApiModelProperty("CDN信息-CDN加速信息")
private String cdnJsxx;
@ApiModelProperty("删除标志0代表存在 2代表删除")
private String delFlag;
}

@ -0,0 +1,129 @@
package com.ruoyi.tc.entity;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
*
* @author du
* @since 2024/11/18 8:55
*/
@Data
@ApiModel("导入导出模板读取字段")
public class AssetExport extends AssetCurrent{
/**
*
*/
@Excel(name = "*系统建设单位名称",width=26,sort = 65)
private String name;
/**
*
*/
@Excel(name = "*系统建设单位统一信用代码",width=26,sort = 66)
private String tyshxydm;
/**
*
*/
@Excel(name = "*系统建设单位联系人",width=26,sort = 67)
private String lxr;
/**
*
*/
@Excel(name = "*系统建设单位联系电话",width=26,sort = 68)
private String lxdh;
/**
*
*/
@Excel(name = "*系统建设单位供应商注册地址",width=26,sort = 69)
private String gyszcdz;
/**
*
*/
@Excel(name = "*系统建设单位注册地址是否为太仓",width=26,sort = 70,dictType = "is_no",comboReadDict = true)
private Integer sfwtc;
/**
*
*/
@Excel(name = "*服务器信息-设备类型",width=26,sort = 77)
private String sblx;
/**
*
*/
@Excel(name = "*服务器信息-品牌",width=26,sort = 78)
private String pp;
/**
* IP
*/
@Excel(name = "*服务器信息-设备IP",width=26,sort = 79)
private String sbIp;
/**
*
*/
@Excel(name = "*服务器信息-操作系统",width=26,sort = 80,dictType = "fwq_czxt",comboReadDict = true)
private Integer czxt;
/**
*
*/
@Excel(name = "*服务器信息-操作系统版本",width=26,sort = 81)
private String czxtbb;
/**
*
*/
@Excel(name = "*服务器信息-硬件型号",width=26,sort = 82)
private String yjxh;
/**
*
*/
@Excel(name = "服务器信息-硬件序列号",width=26,sort = 83)
private String yjxlh;
/**
*
*/
@Excel(name = "服务器信息-硬件版本信息",width=26,sort = 84)
private String yjbbxx;
/**
*
*/
@Excel(name = "*服务器信息-硬件用途",width=26,sort = 85)
private String yjyt;
/**
*
*/
@Excel(name = "*服务器信息-硬件部署位置",width=26,sort = 85)
private String yjbsxx;
@Excel(name = "*网络设备-设备类型",width=26,sort = 86)
private String wlsblx;
@Excel(name = "*网络设备-品牌",width=26,sort = 87)
private String wlpp;
@Excel(name = "*网络设备-设备IP",width=26,sort = 88)
private String wlsbIp;
@Excel(name = "*网络设备-硬件型号",width=26,sort = 89)
private String wlyjxh;
@Excel(name = "网络设备-硬件序列号",width=26,sort = 90)
private String wlyjxlh;
@Excel(name = "网络设备-硬件版本信息",width=26,sort = 91)
private String wlyjbbxx;
@Excel(name = "*网络设备-硬件用途",width=26,sort = 92)
private String wlyjyt;
@Excel(name = "*网络设备-硬件部署位置",width=26,sort = 93)
private String wlyjbsxx;
@Excel(name = "*安全设备-设备类型",width=26,sort = 94)
private String aqwlsblx;
@Excel(name = "*安全设备-品牌",width=26,sort = 95)
private String aqwlpp;
@Excel(name = "*安全设备-设备IP",width=26,sort = 96)
private String aqwlsbIp;
}

@ -0,0 +1,77 @@
package com.ruoyi.tc.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.tc.baseClass.BaseClass;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;
/**
* (asset_supply_chain)
* @author du
* @since 2024/11/13 14:44
*/
@Data
@ApiModel("资产供应链信息")
@TableName(value = "asset_supply_chain")
public class AssetSupplyChain extends BaseClass implements Serializable {
@TableId(value = "id",type = IdType.AUTO)
private Integer id;
/**
* id
*/
@ApiModelProperty("资产id")
private Long assetId;
/**
* 1.2.3.4.5.6.
*/
@ApiModelProperty("1.测评单位2.硬件供应商单位3.机房运维单位4.系统设计单位5.系统建设单位6.安全服务单位")
private Integer type;
/**
*
*/
@Size(max= 50,message="名称长度不能超过50")
@ApiModelProperty("名称")
private String name;
/**
*
*/
@Size(max= 50,message="统一信用代码长度不能超过50")
@ApiModelProperty("统一信用代码")
private String tyshxydm;
/**
*
*/
@Size(max= 50,message="联系人长度不能超过50")
@ApiModelProperty("联系人")
private String lxr;
/**
*
*/
@Size(max= 50,message="联系电话长度不能超过50")
@ApiModelProperty("联系电话")
private String lxdh;
/**
*
*/
@Size(max= 500,message="供应商注册地址长度不能超过500")
@ApiModelProperty("供应商注册地址")
private String gyszcdz;
/**
*
*/
@ApiModelProperty("注册地是否为太仓")
private Integer sfwtc;
@ApiModelProperty("删除标志0代表存在 2代表删除")
private String delFlag;
}

@ -1,5 +1,6 @@
package com.ruoyi.common.core.domain.entity;
package com.ruoyi.tc.entity;
import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
@ -11,6 +12,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.Valid;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
*
@ -148,6 +150,11 @@ public class Unit implements Serializable {
@Excel(name="第一联系人职务职称")
private String dylxrzwzc;
@ApiModelProperty("第一联系人职务职称")
@TableField(exist = false)
private List<UnitOtherConcat> otherConcat;
@ApiModelProperty("检查信息")
private String jcxx;
@ -174,6 +181,20 @@ public class Unit implements Serializable {
@TableField(fill = FieldFill.INSERT)
private String createBy;
/**
* id
*/
@JSONField(serialize = false)
@TableField(fill = FieldFill.INSERT)
private Long createId;
/**
* id
*/
@JSONField(serialize = false)
@TableField(fill = FieldFill.INSERT_UPDATE)
private Long updateId;
/**
*
*/
@ -202,4 +223,7 @@ public class Unit implements Serializable {
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty("删除标志0代表存在 2代表删除")
private String delFlag;
}

@ -0,0 +1,45 @@
package com.ruoyi.tc.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.ruoyi.tc.baseClass.BaseClass;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* (unit_other_contact)
* @author du
* @since 2024/11/13 14:44
*/
@Data
@ApiModel("单位其他联系人")
@TableName(value = "unit_other_contact")
public class UnitOtherConcat extends BaseClass implements Serializable {
@TableId(type = IdType.AUTO,value = "concat_id")
private Long concatId;
@ApiModelProperty("单位id")
private Long unitId;
@ApiModelProperty("资产id")
private Long assetId;
@ApiModelProperty("其他联系人姓名")
private String qtlxrxm;
@ApiModelProperty("其他联系人联系方式")
private String qtlxrlxfs;
@ApiModelProperty("其他联系人邮箱")
private String qtlxryx;
@ApiModelProperty("其他联系人职务职称")
private String qtlxrzwzc;
@ApiModelProperty("删除标志0代表存在 2代表删除")
private String delFlag;
}

@ -0,0 +1,63 @@
package com.ruoyi.tc.entity.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
*
* @author du
* @since 2024/11/15 15:37
*/
@Data
public class AssetCurrentPageRequest {
/**
*
*/
@ApiModelProperty("系统名称")
private String xtmc;
/**
*
*/
@ApiModelProperty("系统类型(字典)")
private Integer xtlx;
/**
*
*/
@ApiModelProperty("单位名称")
private String dwmc;
/**
*
*/
@ApiModelProperty("系统状态(字典)")
private Integer xtzt;
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("开始时间")
private Date startTime;
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("结束时间")
private Date endTime;
@ApiModelProperty("页码")
private Long current=1L;
@ApiModelProperty("页数")
private Long size=10L;
}

@ -1,6 +1,5 @@
package com.ruoyi.common.core.domain.request;
package com.ruoyi.tc.entity.request;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -20,4 +19,10 @@ public class UnitRequest {
@ApiModelProperty("单位类型,传字典数字")
private Integer dwlx;
@ApiModelProperty("页码")
private Long current=1L;
@ApiModelProperty("页数")
private Long size=10L;
}

@ -0,0 +1,26 @@
package com.ruoyi.tc.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.tc.entity.AssetBasicNetwork;
import java.io.Serializable;
import java.util.List;
/**
* (asset_basic_network)访
* @author makejava
* @since 2024-11-15 10:03:56
*/
public interface AssetBasicNetWorkMapper extends BaseMapper<AssetBasicNetwork> {
/**
* id
*/
List<AssetBasicNetwork> getByAssetId(Long id);
/**
*
*/
void deleteByAssetIds(List<Long> idList);
}

@ -0,0 +1,20 @@
package com.ruoyi.tc.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.tc.entity.AssetBusinessForm;
import java.util.List;
/**
* (asset_business_form)访
*
* @author makejava
* @since 2024-11-15 10:03:56
*/
public interface AssetBusinessFormMapper extends BaseMapper<AssetBusinessForm> {
/**
*
*/
void deleteByAssetIds(List<Long> idList);
}

@ -0,0 +1,36 @@
package com.ruoyi.tc.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.tc.entity.AssetCurrent;
import com.ruoyi.tc.entity.request.AssetCurrentPageRequest;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* (AssetCurrent)访
*
* @author makejava
* @since 2024-11-15 10:03:56
*/
public interface AssetCurrentMapper extends BaseMapper<AssetCurrent> {
/**
*
*
* @param page
* @param as
* @return
*/
Page<AssetCurrent> page(Page<AssetCurrent> page,@Param("req") AssetCurrentPageRequest as);
List<AssetCurrent> page(@Param("req") AssetCurrentPageRequest as);
/**
*
*/
void deleteByUnitIds(List<Long> idList);
}

@ -0,0 +1,27 @@
package com.ruoyi.tc.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.tc.entity.AssetSupplyChain;
import java.io.Serializable;
import java.util.List;
/**
* (asset_supply_chain)访
*
* @author makejava
* @since 2024-11-15 10:03:56
*/
public interface AssetSupplyChainMapper extends BaseMapper<AssetSupplyChain> {
/**
* id
*/
AssetSupplyChain getJsdw(Long id);
/**
*
*/
void deleteByAssetIds(List<Long> idList);
}

@ -0,0 +1,53 @@
package com.ruoyi.tc.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.request.UnitRequest;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* unit_info
* @author du
* @since 2024/11/13 15:04
*/
public interface UnitMapper extends BaseMapper<Unit> {
/**
*
*
* @param a
* @return
*/
List<Unit> selectUnitList(@Param("req") UnitRequest a);
/**
*
*
* @param unit
* @return
*/
Page<Unit> selectUnitList(Page<Unit> page, @Param("req") UnitRequest unit);
/**
* id
*/
List<String> selectByIds(List<Long> ids);
/**
*
*/
void deleteUnits(List<Long> ids);
/**
*
*/
void deleteUsers(List<String> userNames);
/**
* id
*/
Unit getById(Long id);
}

@ -1,9 +1,7 @@
package com.ruoyi.tc.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.tc.domain.UnitOtherConcat;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.tc.entity.UnitOtherConcat;
import java.util.List;
@ -13,4 +11,13 @@ import java.util.List;
*/
public interface UnitOtherConcatMapper extends BaseMapper<UnitOtherConcat>
{
/**
* unitId
*/
void deleteByUnitIds(List<Long> idList);
/**
* assetId
*/
void deleteByAssetIds(List<Long> idList);
}

@ -0,0 +1,26 @@
package com.ruoyi.tc.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.AssetBasicNetwork;
import java.io.Serializable;
import java.util.List;
/**
* (asset_basic_network)
*
* @author makejava
* @since 2024-11-15 16:05:26
*/
public interface AssetBasicNetworkService extends IService<AssetBasicNetwork> {
/**
* id
*/
List<AssetBasicNetwork> getByAssetId(Long id);
/**
*
*/
void deleteByAssetIds(List<Long> idList);
}

@ -0,0 +1,21 @@
package com.ruoyi.tc.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.AssetBusinessForm;
import java.util.List;
/**
* (asset_business_form)
*
* @author makejava
* @since 2024-11-15 16:06:53
*/
public interface AssetBusinessFormService extends IService<AssetBusinessForm> {
/**
*
*/
void deleteByAssetIds(List<Long> idList);
}

@ -0,0 +1,49 @@
package com.ruoyi.tc.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.AssetCurrent;
import com.ruoyi.tc.entity.request.AssetCurrentPageRequest;
import java.io.Serializable;
import java.util.List;
/**
* (AssetCurrent)
*
* @author makejava
* @since 2024-11-15 10:04:03
*/
public interface AssetCurrentService extends IService<AssetCurrent> {
/**
*
*
* @param page
* @param as
* @return
*/
Page<AssetCurrent> page(Page<AssetCurrent> page, AssetCurrentPageRequest as );
/**
*
*
* @param as
* @return
*/
List<AssetCurrent> page( AssetCurrentPageRequest as );
/**
*
*
* @param id
* @return
*/
AssetCurrent selectOne(Serializable id);
/**
*
*/
void deleteByUnitIds(List<Long> idList);
}

@ -0,0 +1,25 @@
package com.ruoyi.tc.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.AssetSupplyChain;
import java.io.Serializable;
import java.util.List;
/**
* (asset_supply_chain)
* @author makejava
* @since 2024-11-15 16:07:30
*/
public interface AssetSupplyChainService extends IService<AssetSupplyChain> {
/**
* id
*/
AssetSupplyChain getJsdw(Long id);
/**
*
*/
void deleteByAssetIds(List<Long> idList);
}

@ -1,8 +1,9 @@
package com.ruoyi.tc.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.domain.UnitOtherConcat;
import com.ruoyi.tc.entity.UnitOtherConcat;
import java.util.List;
/**
* (unit_other_contact)
@ -10,4 +11,15 @@ import com.ruoyi.tc.domain.UnitOtherConcat;
* @since 2024/11/13 14:55
*/
public interface UnitOtherConcatService extends IService<UnitOtherConcat> {
/**
* assetId
*/
void deleteByAssetIds(List<Long> idList);
/**
* unitId
*/
void deleteByUnitIds(List<Long> ids);
}

@ -0,0 +1,58 @@
package com.ruoyi.tc.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.request.UnitRequest;
import java.util.List;
/**
* unit_info
* @author du
* @since 2024/11/13 15:02
*/
public interface UnitService extends IService<Unit> {
/**
*
*
* @param unit
* @return
*/
Page<Unit> page(Page<Unit> page, UnitRequest unit);
/**
*
*
* @param unit
* @return
*/
List<Unit> selectUnitList(UnitRequest unit);
/**
* id
*/
Unit getById(Long id);
/**
*
*/
void validUser(Unit unit);
/**
* id
*/
List<String> selectByIds(List<Long> ids);
/**
*
*/
void deleteUsers(List<String> userNames);
/**
*
*/
void deleteUnits(List<Long> ids);
}

@ -0,0 +1,35 @@
package com.ruoyi.tc.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.tc.entity.AssetBasicNetwork;
import com.ruoyi.tc.mapper.AssetBasicNetWorkMapper;
import com.ruoyi.tc.service.AssetBasicNetworkService;
import org.springframework.stereotype.Service;
import java.io.Serializable;
import java.util.List;
/**
* (AssetBasicNetwork)
*
* @author makejava
* @since 2024-11-15 16:05:26
*/
@Service("assetBasicNetworkService")
public class AssetBasicNetworkServiceImpl extends ServiceImpl<AssetBasicNetWorkMapper, AssetBasicNetwork> implements AssetBasicNetworkService {
/**
* id
*/
@Override
public List<AssetBasicNetwork> getByAssetId(Long id) {
return baseMapper.getByAssetId(id);
}
/**
*
*/
@Override
public void deleteByAssetIds(List<Long> idList) {
baseMapper.deleteByAssetIds(idList);
}
}

@ -0,0 +1,28 @@
package com.ruoyi.tc.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.tc.entity.AssetBusinessForm;
import com.ruoyi.tc.mapper.AssetBusinessFormMapper;
import com.ruoyi.tc.service.AssetBusinessFormService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* (AssetBusinessForm)
*
* @author makejava
* @since 2024-11-15 16:06:53
*/
@Service("assetBusinessFormService")
public class AssetBusinessFormServiceImpl extends ServiceImpl<AssetBusinessFormMapper, AssetBusinessForm> implements AssetBusinessFormService {
/**
*
*/
@Override
public void deleteByAssetIds(List<Long> idList) {
baseMapper.deleteByAssetIds(idList);
}
}

@ -0,0 +1,82 @@
package com.ruoyi.tc.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.tc.entity.*;
import com.ruoyi.tc.entity.request.AssetCurrentPageRequest;
import com.ruoyi.tc.mapper.AssetCurrentMapper;
import com.ruoyi.tc.service.*;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;
/**
* (AssetCurrent)
*
* @author makejava
* @since 2024-11-15 10:04:03
*/
@Service("assetCurrentService")
public class AssetCurrentServiceImpl extends ServiceImpl<AssetCurrentMapper, AssetCurrent> implements AssetCurrentService {
@Resource
private AssetSupplyChainService assetSupplyChainService;
@Resource
private AssetBasicNetworkService assetBasicNetworkService;
@Resource
private AssetBusinessFormService assetBusinessFormService;
@Resource
private UnitOtherConcatService unitOtherConcatService;
/**
*
*
* @param page
* @param as
* @return
*/
@Override
public Page<AssetCurrent> page(Page<AssetCurrent> page, AssetCurrentPageRequest as) {
return baseMapper.page(page,as);
}
/**
*
*
* @param as
* @return
*/
@Override
public List<AssetCurrent> page(AssetCurrentPageRequest as) {
return baseMapper.page(as);
}
/**
*
*
* @param id
* @return
*/
@Override
public AssetCurrent selectOne(Serializable id) {
AssetCurrent byId = getById(id);
byId.setGylxxList(assetSupplyChainService.lambdaQuery().eq(AssetSupplyChain::getAssetId,id).eq(AssetSupplyChain::getDelFlag,"0").list());
byId.setJcwlList(assetBasicNetworkService.lambdaQuery().eq(AssetBasicNetwork::getAssetId,id).eq(AssetBasicNetwork::getDelFlag,"0").list());
byId.setXjgywxt(assetBusinessFormService.lambdaQuery().eq(AssetBusinessForm::getAssetId,id).eq(AssetBusinessForm::getDelFlag,"0").one());
byId.setOtherConcat(unitOtherConcatService.lambdaQuery().eq(UnitOtherConcat::getAssetId,id).eq(UnitOtherConcat::getDelFlag,"0").list());
return byId;
}
/**
*
*/
@Override
public void deleteByUnitIds(List<Long> idList) {
baseMapper.deleteByUnitIds(idList);
}
}

@ -0,0 +1,36 @@
package com.ruoyi.tc.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.tc.entity.AssetSupplyChain;
import com.ruoyi.tc.mapper.AssetSupplyChainMapper;
import com.ruoyi.tc.service.AssetSupplyChainService;
import org.springframework.stereotype.Service;
import java.io.Serializable;
import java.util.List;
/**
* (AssetSupplyChain)
*
* @author makejava
* @since 2024-11-15 16:07:30
*/
@Service("assetSupplyChainService")
public class AssetSupplyChainServiceImpl extends ServiceImpl<AssetSupplyChainMapper, AssetSupplyChain> implements AssetSupplyChainService {
/**
* id
*/
@Override
public AssetSupplyChain getJsdw(Long id) {
return baseMapper.getJsdw(id);
}
/**
*
*/
@Override
public void deleteByAssetIds(List<Long> idList) {
baseMapper.deleteByAssetIds(idList);
}
}

@ -1,11 +1,13 @@
package com.ruoyi.tc.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.tc.domain.UnitOtherConcat;
import com.ruoyi.tc.entity.UnitOtherConcat;
import com.ruoyi.tc.mapper.UnitOtherConcatMapper;
import com.ruoyi.tc.service.UnitOtherConcatService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* (unit_other_contact)
* @author du
@ -13,4 +15,19 @@ import org.springframework.stereotype.Service;
*/
@Service
public class UnitOtherConcatServiceImpl extends ServiceImpl<UnitOtherConcatMapper, UnitOtherConcat> implements UnitOtherConcatService {
/**
* assetId
*/
@Override
public void deleteByAssetIds(List<Long> idList) {
baseMapper.deleteByAssetIds(idList);
}
/**
* unitId
*/
@Override
public void deleteByUnitIds(List<Long> ids) {
baseMapper.deleteByUnitIds(ids);
}
}

@ -0,0 +1,103 @@
package com.ruoyi.tc.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.request.UnitRequest;
import com.ruoyi.tc.mapper.UnitMapper;
import com.ruoyi.tc.service.UnitService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* unit_info
* @author du
* @since 2024/11/13 15:02
*/
@Service
public class UnitServiceImpl extends ServiceImpl<UnitMapper, Unit> implements UnitService {
@Resource
private ISysUserService userService;
/**
*
*
* @param unit
* @return
*/
@Override
public Page<Unit> page(Page<Unit> page, UnitRequest unit) {
return baseMapper.selectUnitList(page,unit);
}
/**
*
*
* @param unit
* @return
*/
@Override
public List<Unit> selectUnitList(UnitRequest unit) {
return baseMapper.selectUnitList(unit);
}
/**
* id
*/
@Override
public Unit getById(Long id) {
return baseMapper.getById(id);
}
/**
*
*/
@Override
public void validUser(Unit x) {
SysUser user = new SysUser();
user.setUserName(x.getUserName());
user.setPassword(SecurityUtils.encryptPassword(x.getUserName().substring(x.getUserName().length() - 6)));
user.setNickName(x.getNickName());
SysUser u = userService.selectUserByUserName(x.getUserName());
if (StringUtils.isNull(u)) {
userService.insertUser(user);
Long[] roles = new Long[]{100L};
userService.insertUserAuth(user.getUserId(), roles);
}else {
throw new ServiceException(x.getUserName() + "'已存在单位!");
}
}
/**
* id
*/
@Override
public List<String> selectByIds(List<Long> ids) {
return baseMapper.selectByIds(ids);
}
/**
*
*/
@Override
public void deleteUsers(List<String> userNames) {
baseMapper.deleteUsers(userNames);
}
/**
*
*/
@Override
public void deleteUnits(List<Long> ids) {
baseMapper.deleteUnits(ids);
}
}

@ -1,20 +1,20 @@
package com.ruoyi.web.controller.system;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.entity.Unit;
import com.ruoyi.common.core.domain.request.UnitRequest;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.*;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
@ -22,7 +22,6 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.stream.Collectors;
@ -47,9 +46,6 @@ public class SysUserController extends BaseController {
@Autowired
private ISysPostService postService;
@Resource
private UnitService unitService;
/**
*
*/
@ -61,48 +57,29 @@ public class SysUserController extends BaseController {
return getDataTable(list);
}
@Log(title = "用户单位管理", businessType = BusinessType.EXPORT)
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:user:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, UnitRequest unit) {
// List<SysUser> list = userService.selectUserList(user);
// ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
// util.exportExcel(response, list, "用户数据");
List<Unit> list = unitService.selectUnitList(unit);
ExcelUtil<Unit> util = new ExcelUtil<>(Unit.class);
util.exportExcel(response, list, "单位数据");
public void export(HttpServletResponse response, SysUser user) {
List<SysUser> list = userService.selectUserList(user);
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
util.exportExcel(response, list, "用户数据");
}
@Log(title = "用户单位管理", businessType = BusinessType.IMPORT)
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('system:user:import')")
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
// ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
// List<SysUser> userList = util.importExcel(file.getInputStream());
// String operName = getUsername();
// String message = userService.importUser(userList, updateSupport, operName);
ExcelUtil<Unit> util = new ExcelUtil<>(Unit.class);
List<Unit> list = util.importExcel(file.getInputStream());
unitService.saveBatch(list);
for (Unit x : list) {
SysUser user = new SysUser();
user.setUserName(x.getUserName());
user.setPassword(SecurityUtils.encryptPassword(x.getUserName().substring(x.getUserName().length() - 6)));
user.setNickName(x.getNickName());
SysUser u = userService.selectUserByUserName(x.getUserName());
if (StringUtils.isNull(u)) {
userService.insertUser(user);
Long[] roles = new Long[]{100L};
userService.insertUserAuth(user.getUserId(), roles);
}
//未做修改
}
return success();
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
List<SysUser> userList = util.importExcel(file.getInputStream());
String operName = getUsername();
String message = userService.importUser(userList, updateSupport, operName);
return success(message);
}
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) {
ExcelUtil<Unit> util = new ExcelUtil<>(Unit.class);
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
util.importTemplateExcel(response, "用户数据");
}
@ -119,12 +96,10 @@ public class SysUserController extends BaseController {
ajax.put(AjaxResult.DATA_TAG, sysUser);
ajax.put("postIds", postService.selectPostListByUserId(userId));
ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
ajax.put("unit", unitService.lambdaQuery().eq(Unit::getUserName,sysUser.getUserName()).one());
}
List<SysRole> roles = roleService.selectRoleAll();
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
ajax.put("posts", postService.selectPostAll());
ajax.put("posts", postService.selectPostAll());
return ajax;
}
@ -140,20 +115,12 @@ public class SysUserController extends BaseController {
if (!userService.checkUserNameUnique(user)) {
return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
}
if (!unitService.lambdaQuery().eq(Unit::getUserName, user.getUserName()).list().isEmpty()) {
return error("新增用户'" + user.getUserName() + "'已存在单位!");
}
//新增单位到单位信息表
unitService.save(user.getUnitInfo());
// else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
// {
// else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
// return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
// }
// else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
// {
// } else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
// return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
// }
// user.setCreateBy(getUsername());
user.setCreateBy(getUsername());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
return toAjax(userService.insertUser(user));
}
@ -172,19 +139,12 @@ public class SysUserController extends BaseController {
if (!userService.checkUserNameUnique(user)) {
return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
}
if (!unitService.lambdaQuery().eq(Unit::getUserName, user.getUserName()).list().isEmpty()) {
return error("修改用户'" + user.getUserName() + "'已存在单位!");
}
unitService.updateById(user.getUnitInfo());
// else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
// {
// else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
// return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
// }
// else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
// {
// } else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
// return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
// }
// user.setUpdateBy(getUsername());
user.setUpdateBy(getUsername());
return toAjax(userService.updateUser(user));
}
@ -211,7 +171,7 @@ public class SysUserController extends BaseController {
userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
// user.setUpdateBy(getUsername());
user.setUpdateBy(getUsername());
return toAjax(userService.resetPwd(user));
}
@ -224,7 +184,7 @@ public class SysUserController extends BaseController {
public AjaxResult changeStatus(@RequestBody SysUser user) {
userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId());
// user.setUpdateBy(getUsername());
user.setUpdateBy(getUsername());
return toAjax(userService.updateUserStatus(user));
}

@ -101,9 +101,9 @@ token:
# mybatis-plus配置
mybatis-plus:
# 搜索指定包别名
typeAliasesPackage: com.ruoyi.**.domain
typeAliasesPackage: com.ruoyi.**.domain,com.ruoyi.**.entity,
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
mapperLocations: classpath*:mapper/**/*Mapper.xml,classpath*:mapper/**/*.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.tc.mapper.AssetBasicNetWorkMapper">
<update id="deleteByAssetIds">
update asset_basic_network set del_flag = '2' where asset_id in
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<select id="getByAssetId" resultType="com.ruoyi.tc.entity.AssetBasicNetwork">
select *
from asset_basic_network
where asset_id = #{id}
group by type,
id,
sblx,
pp,
sb_ip,
czxt,
czxtbb,
yjxh,
yjxlh,
yjbbxx,
yjyt,
yjbsxx
order by create_time asc
</select>
</mapper>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.tc.mapper.AssetBusinessFormMapper">
<update id="deleteByAssetIds">
update asset_business_form set del_flag = '2' where asset_id in
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.tc.mapper.AssetCurrentMapper">
<select id="page" resultType="com.ruoyi.tc.entity.AssetCurrent">
select * from asset_current
<where>
del_flag = '0'
<if test="req.xtmc!=null and req.xtmc!='' ">
and xtmc like concat('%',#{req.xtmc},'%')
</if>
<if test="req.dwmc!=null and req.dwmc!='' ">
and dwmc like concat('%',#{req.dwmc},'%')
</if>
<if test="req.xtmc!=null">
and xtlx = #{req.xtmc}
</if>
<if test="req.xtzt!=null">
and xtzt = #{req.xtmc}
</if>
<if test="req.startTime != null ">
and create_time &gt;= #{req.startTime}
</if>
<if test="req.endTime != null">
and create_time &lt;= #{req.endTime}
</if>
</where>
</select>
<update id="deleteByUnitIds">
update asset_current set del_flag = '2' where id in
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.tc.mapper.AssetSupplyChainMapper">
<update id="deleteByAssetIds">
update asset_supply_chain set del_flag = '2' where asset_id in
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<select id="getJsdw" resultType="com.ruoyi.tc.entity.AssetSupplyChain">
select *
from asset_supply_chain
where asset_id = #{id} and type = 5
order by create_time asc
limit 1
</select>
</mapper>

@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.UnitMapper">
<mapper namespace="com.ruoyi.tc.mapper.UnitMapper">
<resultMap id="unitResult" type="Unit">
<id property="id" column="id" />
@ -43,24 +43,67 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="dtwd" column="dtwd"/>
<result property="sjdw" column="sjdw"/>
<result property="createBy" column="create_by"/>
<result property="createId" column="create_id"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateId" column="update_id"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<result property="delFlag" column="del_flag"/>
<collection property="otherConcat" javaType="java.util.List" ofType="com.ruoyi.tc.entity.UnitOtherConcat" >
<id property="concatId" column="concat_id" />
<result property="qtlxrxm" column="qtlxrlxfs" />
<result property="qtlxrlxfs" column="qtlxrlxfs" />
<result property="qtlxryx" column="qtlxryx" />
<result property="qtlxrzwzc" column="qtlxrzwzc" />
<result property="createBy" column="create_by"/>
<result property="createId" column="create_id"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateId" column="update_id"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</collection>
</resultMap>
<select id="selectUnitList" parameterType="unit" resultMap="unitResult">
select * from unit_info
select a.* from unit_info a
<where>
a.del_flag = '0'
<if test="req.nickName != null and req.nickName != '' ">
and nick_name like concat('%',#{req.nickName},'%')
and a.nick_name like concat('%',#{req.nickName},'%')
</if>
<if test="req.dwlx != null">
and dwlx = #{req.dwlx}
and a.dwlx = #{req.dwlx}
</if>
<if test="req.userName != null and req.userName != '' ">
and user_name like concat('%',#{req.userName},'%')
and a.user_name like concat('%',#{req.userName},'%')
</if>
</where>
</select>
<select id="getById" parameterType="unit" resultMap="unitResult">
select a.*,c.* from unit_info a
left join unit_other_contact c on a.id = c.unit_id
where id = #{id}
</select>
<select id="selectByIds" resultType="java.lang.String">
select user_name from unit_info where id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<update id="deleteUnits">
update unit_info set del_flag = '2' where id in
<foreach collection="array" item="ids" open="(" separator="," close=")">
#{ids}
</foreach>
</update>
<update id="deleteUsers">
update sys_user set del_flag = '2' where user_name in
<foreach collection="array" item="userNames" open="(" separator="," close=")">
#{userNames}
</foreach>
</update>
</mapper>

@ -4,4 +4,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.tc.mapper.UnitOtherConcatMapper">
<update id="deleteByUnitIds">
update asset_supply_chain set del_flag = '2' where unit_id in
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<update id="deleteByAssetIds">
update asset_supply_chain set del_flag = '2' where asset_id in
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

@ -20,7 +20,7 @@ public @interface Excel
{
/**
* excel
*
*/
public boolean required() default false;

@ -38,15 +38,8 @@ public class SysUser extends BaseEntity
private String nickName;
public Unit getUnitInfo() {
return unitInfo;
}
public void setUnitInfo(Unit unitInfo) {
this.unitInfo = unitInfo;
}
private Unit unitInfo;
// /** 用户邮箱 */
// @Excel(name = "用户邮箱")

@ -115,7 +115,7 @@ public class SecurityConfig
// 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
.antMatchers("/system/user/**").permitAll()
// .antMatchers("/tc/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated();
})

@ -109,6 +109,9 @@ public interface SysUserMapper
*/
public SysUser checkUserNameUnique(String userName);
List<SysUser> selectUserByIds(Long[] userIds);
// /**
// * 校验手机号码是否唯一
// *

@ -1,24 +0,0 @@
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.core.domain.entity.Unit;
import com.ruoyi.common.core.domain.request.UnitRequest;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* unit_info
* @author du
* @since 2024/11/13 15:04
*/
public interface UnitMapper extends BaseMapper<Unit> {
/**
*
*
* @param a
* @return
*/
List<Unit> selectUnitList(@Param("req") UnitRequest a);
}

@ -1,24 +0,0 @@
package com.ruoyi.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.entity.Unit;
import com.ruoyi.common.core.domain.request.UnitRequest;
import java.util.List;
/**
* unit_info
* @author du
* @since 2024/11/13 15:02
*/
public interface UnitService extends IService<Unit> {
/**
*
*
* @param unit
* @return
*/
List<Unit> selectUnitList(UnitRequest unit);
}

@ -1,31 +0,0 @@
package com.ruoyi.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.entity.Unit;
import com.ruoyi.common.core.domain.request.UnitRequest;
import com.ruoyi.system.mapper.UnitMapper;
import com.ruoyi.system.service.UnitService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* unit_info
* @author du
* @since 2024/11/13 15:02
*/
@Service
public class UnitServiceImpl extends ServiceImpl<UnitMapper, Unit> implements UnitService {
/**
*
*
* @param unit
* @return
*/
@Override
public List<Unit> selectUnitList(UnitRequest unit) {
return baseMapper.selectUnitList(unit);
}
}

@ -24,14 +24,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<association property="dept" javaType="SysDept" resultMap="deptResult" />
<association property="unitInfo"
javaType="Unit"
column="user_name"
select="UnitList"/>
<!-- <association property="unitInfo"-->
<!-- javaType="Unit"-->
<!-- column="user_name"-->
<!-- select="UnitList"/>-->
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap>
<select id="UnitList" parameterType="Unit" resultMap="com.ruoyi.system.mapper.UnitMapper.unitResult">
<select id="UnitList" parameterType="Unit" resultMap="com.ruoyi.tc.mapper.UnitMapper.unitResult">
select * from unit_info where user_name = #{user_name}
</select>
@ -67,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.avatar, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
left join unit_info c on u.user_name = c.user_name
where u.del_flag = '0'
<if test="userId != null and userId != 0">
AND u.user_id = #{userId}
@ -133,8 +133,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' limit 1
</select>
<!-- <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">-->
<!-- <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">-->
<!-- select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1-->
<!-- </select>-->
<!-- -->
@ -208,5 +209,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{userId}
</foreach>
</delete>
<select id="selectUserByIds" resultType="com.ruoyi.common.core.domain.entity.SysUser">
select * from sys_user where user_id in
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</select>
</mapper>
Loading…
Cancel
Save