diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java index a9dab4a..a073f68 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java @@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** @@ -77,9 +78,6 @@ public class AssetCurrentController extends BaseController { private UnitOtherConcatCpService unitOtherConcatCpService; - - - /** * 分页查询所有数据 * @@ -146,7 +144,7 @@ public class AssetCurrentController extends BaseController { @Transactional(rollbackFor = Exception.class) public AjaxResult insert(@RequestBody @Valid AssetCurrent assetCurrent) { StringBuilder a = new StringBuilder(); - if (!assetCurrent.getGlymList().isEmpty()) { + if (assetCurrent.getGlymList() != null) { assetCurrent.getGlymList().forEach(x -> { a.append(x.getKey()); a.append(","); @@ -154,7 +152,7 @@ public class AssetCurrentController extends BaseController { } assetCurrent.setGlym(a.toString()); StringBuilder b = new StringBuilder(); - if (!assetCurrent.getGlIpList().isEmpty()) { + if (assetCurrent.getGlIpList() != null) { assetCurrent.getGlymList().forEach(x -> { b.append(x.getKey()); b.append(","); @@ -167,21 +165,21 @@ public class AssetCurrentController extends BaseController { assetCurrent.getXjgywxt().setAssetId(assetCurrent.getId()); assetBusinessFormService.save(assetCurrent.getXjgywxt()); } - if (!assetCurrent.getGylxxList().isEmpty()) { + if (assetCurrent.getGylxxList() != null) { for (AssetSupplyChain items : assetCurrent.getGylxxList()) { items.setAssetId(assetCurrent.getId()); } //新增供应链 assetSupplyChainService.saveBatch(assetCurrent.getGylxxList()); } - if (!assetCurrent.getJcwlList().isEmpty()) { + if (assetCurrent.getJcwlList() != null) { for (AssetBasicNetwork items : assetCurrent.getJcwlList()) { items.setAssetId(assetCurrent.getId()); } //新增基础网络 assetBasicNetworkService.saveBatch(assetCurrent.getJcwlList()); } - if (!assetCurrent.getOtherConcat().isEmpty()) { + if (assetCurrent.getOtherConcat() != null) { for (UnitOtherConcat items : assetCurrent.getOtherConcat()) { items.setAssetId(assetCurrent.getId()); } @@ -206,7 +204,7 @@ public class AssetCurrentController extends BaseController { assetCurrentCpPo.getXjgywxt().setTaskId(assetTask.getId()); assetBusinessFormCpService.save(assetCurrentCpPo.getXjgywxt()); } - if (!assetCurrent.getGylxxList().isEmpty()) { + if (assetCurrent.getGylxxList() != null) { for (AssetSupplyChainCpPo items : assetCurrentCpPo.getGylxxList()) { items.setAssetId(id); items.setTaskId(assetTask.getId()); @@ -214,7 +212,7 @@ public class AssetCurrentController extends BaseController { //新增供应链 assetSupplyChainCpService.saveBatch(assetCurrentCpPo.getGylxxList()); } - if (!assetCurrent.getJcwlList().isEmpty()) { + if (assetCurrent.getJcwlList() != null) { for (AssetBasicNetworkCpPo items : assetCurrentCpPo.getJcwlList()) { items.setAssetId(assetCurrent.getId()); items.setTaskId(assetTask.getId()); @@ -222,7 +220,7 @@ public class AssetCurrentController extends BaseController { //新增基础网络 assetBasicNetworkCpService.saveBatch(assetCurrentCpPo.getJcwlList()); } - if (!assetCurrent.getOtherConcat().isEmpty()) { + if (assetCurrent.getOtherConcat() != null) { for (UnitOtherConcatCpPo items : assetCurrentCpPo.getOtherConcat()) { items.setAssetId(assetCurrent.getId()); items.setTaskId(assetTask.getId()); @@ -247,7 +245,7 @@ public class AssetCurrentController extends BaseController { @PutMapping public AjaxResult update(@RequestBody @Valid AssetCurrent assetCurrent) { StringBuilder a = new StringBuilder(); - if (!assetCurrent.getGlymList().isEmpty()) { + if (assetCurrent.getGlymList() != null) { assetCurrent.getGlymList().forEach(x -> { a.append(x.getKey()); a.append(","); @@ -255,7 +253,7 @@ public class AssetCurrentController extends BaseController { } assetCurrent.setGlym(a.toString()); StringBuilder b = new StringBuilder(); - if (!assetCurrent.getGlIpList().isEmpty()) { + if (assetCurrent.getGlIpList() != null) { assetCurrent.getGlymList().forEach(x -> { b.append(x.getKey()); b.append(","); @@ -272,7 +270,7 @@ public class AssetCurrentController extends BaseController { assetCurrent.getXjgywxt().setId(null); assetBusinessFormService.save(assetCurrent.getXjgywxt()); } - if (!assetCurrent.getGylxxList().isEmpty()) { + if (assetCurrent.getGylxxList() != null) { for (AssetSupplyChain items : assetCurrent.getGylxxList()) { items.setAssetId(assetCurrent.getId()); items.setId(null); @@ -280,7 +278,7 @@ public class AssetCurrentController extends BaseController { //新增供应链 assetSupplyChainService.saveBatch(assetCurrent.getGylxxList()); } - if (!assetCurrent.getJcwlList().isEmpty()) { + if (assetCurrent.getJcwlList() != null) { for (AssetBasicNetwork items : assetCurrent.getJcwlList()) { items.setAssetId(assetCurrent.getId()); items.setId(null); @@ -288,7 +286,7 @@ public class AssetCurrentController extends BaseController { //新增基础网络 assetBasicNetworkService.saveBatch(assetCurrent.getJcwlList()); } - if (!assetCurrent.getOtherConcat().isEmpty()) { + if (assetCurrent.getOtherConcat() != null) { for (UnitOtherConcat items : assetCurrent.getOtherConcat()) { items.setAssetId(assetCurrent.getId()); items.setConcatId(null); @@ -361,7 +359,19 @@ public class AssetCurrentController extends BaseController { AssetCurrent as = new AssetCurrent(); //copy新增到新的现有资产表里面 BeanUtil.copyProperties(items, as); - assetCurrentService.save(as); + AssetCurrent one = assetCurrentService.lambdaQuery().eq(AssetCurrent::getXtmc, as.getXtmc()) + .eq(AssetCurrent::getDwmc, as.getDwmc()).one(); + if (one != null) { + as.setId(one.getId()); + assetCurrentService.updateById(as); + List a1 = new ArrayList<>(); + a1.add(one.getId()); + assetSupplyChainService.deleteIdList(a1); + assetBasicNetworkService.deleteIdList(a1); + } else { + assetCurrentService.save(as); + } + //新增系统建设单位 AssetSupplyChain s1 = new AssetSupplyChain(); BeanUtil.copyProperties(items, s1); @@ -416,8 +426,16 @@ public class AssetCurrentController extends BaseController { AssetCurrentCpPo assetCurrentCpPo = new AssetCurrentCpPo(); BeanUtil.copyProperties(as, assetCurrentCpPo); assetCurrentCpPo.setTaskId(assetTask.getId()); - assetCurrentCpService.save(assetCurrentCpPo); - + AssetCurrentCpPo two = assetCurrentCpService.lambdaQuery().eq(AssetCurrentCpPo::getXtmc, as.getXtmc()) + .eq(AssetCurrentCpPo::getDwmc, as.getDwmc()).one(); + if (two != null) { + assetCurrentCpPo.setId(two.getId()); + assetCurrentCpService.updateById(assetCurrentCpPo); + assetSupplyChainCpService.deletByAssetIdandTaskId(id,assetTask.getId()); + assetBasicNetworkCpService.deletByAssetIdandTaskId(id,assetTask.getId()); + } else { + assetCurrentCpService.save(assetCurrentCpPo); + } //新增系统建设单位 AssetSupplyChainCpPo co1 = new AssetSupplyChainCpPo(); BeanUtil.copyProperties(items, co1); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/UnitController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/UnitController.java index d24aaf1..5a1b247 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/UnitController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/UnitController.java @@ -3,20 +3,19 @@ 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.common.core.domain.entity.SysUser; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.system.service.ISysUserService; -import com.ruoyi.tc.entity.Unit; -import com.ruoyi.tc.entity.request.UnitRequest; +import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.service.ISysDeptService; +import com.ruoyi.system.service.ISysUserService; +import com.ruoyi.tc.entity.Unit; +import com.ruoyi.tc.entity.request.UnitRequest; import com.ruoyi.tc.service.ExamineInfoService; 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; @@ -24,9 +23,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 单位(unit)表控制层 @@ -36,7 +33,7 @@ import java.util.Map; */ @Api(tags = "单位表控制层") @RestController -@PreAuthorize("@ss.hasAnyRoles('admin,common')") +//@PreAuthorize("@ss.hasAnyRoles('admin,common')") @RequestMapping("/tc/unit") public class UnitController { @@ -52,6 +49,9 @@ public class UnitController { @Resource private ISysUserService iSysUserService; + @Resource + private ISysDeptService iSysDeptService; + /** * 获取单位列表 */ @@ -70,7 +70,7 @@ public class UnitController { @ApiOperation(value = "获取所有单位列表", response = Unit.class) @GetMapping("/allList") public AjaxResult allList(UnitRequest unit) { - return AjaxResult.success(unitService.selectUnitList( unit)); + return AjaxResult.success(unitService.selectUnitList(unit)); } /** @@ -95,12 +95,38 @@ public class UnitController { public AjaxResult importData(MultipartFile file) throws Exception { ExcelUtil util = new ExcelUtil<>(Unit.class); List list = util.importExcel(file.getInputStream()); - unitService.saveBatch(list); - Map a1 = new HashMap<>(); + //做组织架构的处理和更新处理 + List sd = iSysDeptService.selectDeptList(new SysDept()); + Set set = new HashSet<>(); + for (SysDept i : sd) { + set.add(i.getDeptName()); + } + List list1 = unitService.list(); + for (int i = 0; i < list.size(); i++) { + for (Unit unit : list1) { + if (unit.getNickName().equals(list.get(i).getNickName()) + && unit.getUserName().equals(list.get(i).getUserName()) + ) { + list.get(i).setId(unit.getId()); + } + } + if (set.contains(list.get(i).getDeptName())) { + for (SysDept s : sd) { + if (list.get(i).getDeptName().equals(s.getDeptName())) { + list.get(i).setDeptId(s.getDeptId()); + } + } + } else { + throw new ServiceException("第" + i + "行,组织机构名称填写错误!"); + } + } + //批量新增或者修改单位 + unitService.saveOrUpdateBatch(list); + Map a1 = new HashMap<>(); for (Unit x : list) { //查询用户表是否存在该用户 String s = unitService.validUser(x); - a1.put(x.getUserName(),s); + a1.put(x.getUserName(), s); } return AjaxResult.success(a1); } @@ -117,7 +143,7 @@ public class UnitController { @ApiOperation(value = "根据用户编号获取详细信息") @GetMapping("/{id}") public AjaxResult getInfo(@PathVariable(value = "id") Long id) { - System.out.println(SecurityUtils.encryptPassword("TcZc@2024")); +// System.out.println(SecurityUtils.encryptPassword("TcZc@2024")); return AjaxResult.success(unitService.getById(id)); } @@ -135,15 +161,15 @@ public class UnitController { //新增单位到单位信息表 unitService.save(unit); //新增其他联系人 - if(!unit.getOtherConcat().isEmpty()){ - unit.getOtherConcat().forEach(x->{ + if (unit.getOtherConcat()!=null) { + unit.getOtherConcat().forEach(x -> { x.setUnitId(unit.getId()); }); unitOtherConcatService.saveBatch(unit.getOtherConcat()); } //新增检查信息 - if(!unit.getJcxxList().isEmpty()){ - unit.getJcxxList().forEach(x->{ + if (unit.getJcxxList()!=null) { + unit.getJcxxList().forEach(x -> { x.setUnitId(unit.getId()); }); examineInfoService.saveBatch(unit.getJcxxList()); @@ -161,22 +187,24 @@ public class UnitController { @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())){ + if (!byId.getUserName().equals(x.getUserName()) || !byId.getNickName().equals(x.getNickName())) { throw new ServiceException("单位名称和社会信用代码不允许修改!"); } unitService.updateById(x); //先删除 unitOtherConcatService.deleteByUnitIds(x.getId()); examineInfoService.deleteByUnitIds(x.getId()); - if(!x.getOtherConcat().isEmpty()){ - x.getOtherConcat().forEach(y->{ + unitService.validUser(x); + + if (x.getOtherConcat()!=null) { + x.getOtherConcat().forEach(y -> { y.setUnitId(x.getId()); y.setConcatId(null); }); unitOtherConcatService.saveBatch(x.getOtherConcat()); } - if(!x.getJcxxList().isEmpty()){ - x.getJcxxList().forEach(y->{ + if (x.getJcxxList()!=null) { + x.getJcxxList().forEach(y -> { y.setUnitId(x.getId()); y.setJcid(null); }); @@ -194,9 +222,9 @@ public class UnitController { public AjaxResult remove(@PathVariable Long id) { List userNames = unitService.selectByIds(id); //逻辑删除单位和用户 - if(!userNames.isEmpty()){ + if (!userNames.isEmpty()) { for (String it : userNames) { - if(it!=null){ + if (it != null) { unitService.deleteUsers(it); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetApp.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetApp.java new file mode 100644 index 0000000..9253763 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetApp.java @@ -0,0 +1,134 @@ +package com.ruoyi.tc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.tc.baseClass.BaseClass; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 资产移动应用程序(asset_app)表 + * + * @author du + */ +@Data +@ApiModel("资产移动应用程序") +@TableName(value = "asset_app") +public class AssetApp extends BaseClass implements Serializable { + + + @ApiModelProperty("id") + private Long id; + /** + * 所属单位 + */ + @ApiModelProperty("所属单位") + @Excel(name = "所属单位", sort = 1, width = 24) + private String ssdw; + /** + * 移动应用名称 + */ + @ApiModelProperty("移动应用名称") + @Excel(name = "移动应用名称", sort = 2, width = 22) + private String appName; + /** + * 包名 + */ + @Excel(name = "包名", sort = 3, width = 28) + @ApiModelProperty("包名") + private String pack; + /** + * icp备案状态(字典) + */ + @Excel(name = "icp备案状态",dictType = "app_icp_state",comboReadDict = true,sort = 4, width = 22) + @ApiModelProperty("icp备案状态(字典)") + private String icpState; + /** + * icp备案号 + */ + @Excel(name = "icp备案号", sort = 5) + @ApiModelProperty("icp备案号") + private String icpbah; + /** + * 统一社会信用代码 + */ + @Excel(name = "统一社会信用代码", sort = 6,width = 22) + @ApiModelProperty("统一社会信用代码") + private String tyshxydm; + /** + * 文件名 + */ + @Excel(name = "文件名", sort = 7,width = 22) + @ApiModelProperty("文件名") + private String wjm; + /** + * 所属行业(字典) + */ + @ApiModelProperty("所属行业(字典)") + @Excel(name = "所属行业",dictType = "app_sshy",comboReadDict = true,sort = 8, width = 18) + private String sshy; + /** + * 重点行业(字典) + */ + @Excel(name = "重点行业",dictType = "app_zdhy",comboReadDict = true,sort = 9, width = 18) + @ApiModelProperty("重点行业(字典)") + private String zdhy; + /** + * 行政区划(字典) + */ + @Excel(name = "行政区划",dictType = "app_xzqh",comboReadDict = true,sort = 10, width = 18) + @ApiModelProperty("行政区划(字典)") + private String xzqh; + /** + * 简介 + */ + @Excel(name = "简介",sort = 11, width = 28) + @ApiModelProperty("简介") + private String jj; + /** + * 安全加固情况(字典) + */ + @Excel(name = "安全加固情况",dictType = "app_aqjgqk",comboReadDict = true,sort = 12, width = 18) + @ApiModelProperty("安全加固情况(字典)") + private String aqjgqk; + /** + * 版本信息 + */ + @Excel(name = "版本信息",sort = 13, width = 20) + @ApiModelProperty("版本信息") + private String bbxx; + /** + * 版本号 + */ + @Excel(name = "版本信息(版本号)",sort = 14, width = 24) + @ApiModelProperty("版本号") + private String bbh; + /** + * 版本信息(MD5) + */ + @Excel(name = "版本信息(MD5)",sort = 15, width = 28) + @ApiModelProperty("版本信息(MD5)") + private String bbxxMd5; + /** + * 版本信息(上架平台) + */ + @Excel(name = "版本信息(上架平台)",sort = 16, width = 24) + @ApiModelProperty("版本信息(上架平台)") + private String bbxxSjpt; + /** + * 文件大小 + */ + @Excel(name = "文件大小",sort = 17, width = 20) + @ApiModelProperty("文件大小") + private String wjdx; + + /** + * 删除标志(0代表存在 2代表删除) + */ + @ApiModelProperty("删除标志(0代表存在 2代表删除)") + private String delFlag; + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetCurrent.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetCurrent.java index 4026a3e..7e0bb60 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetCurrent.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetCurrent.java @@ -41,12 +41,6 @@ public class AssetCurrent extends BaseClass implements Serializable { @Excel(name = "*系统名称",sort = 2,width = 40,required = true) private String xtmc; -// /** -// * 资产类型 -// */ -// @ApiModelProperty("资产类型") -// private String zclx; - /** * 单位名称 */ @@ -128,8 +122,8 @@ public class AssetCurrent extends BaseClass implements Serializable { /** * 关联ip(多个用,分隔) */ -// @Excel(name ="关联资产(多个资产用逗号隔开,例如{\"ipv4\"",sort = 7,width = 60) - @Excel(name ="关联资产(多个资产用逗号隔开,例如\n{\"ipv4\":[\"1.1.1.1:8080\",\"2.2.2.2:8080\"],\"ipv6\":\n[\"fe80::ec3e:9cff:fe25:687b\",\"de71::ec3e:9cff:fe25:687b\"]})",sort = 7,width = 60) + @Excel(name ="关联资产(多个资产用逗号隔开,例如{\"ipv4\"",sort = 7,width = 60) +// @Excel(name ="关联资产(多个资产用逗号隔开,例如\n{\"ipv4\":[\"1.1.1.1:8080\",\"2.2.2.2:8080\"],\"ipv6\":\n[\"fe80::ec3e:9cff:fe25:687b\",\"de71::ec3e:9cff:fe25:687b\"]})",sort = 7,width = 60) @Size(max= 500,message="关联ip长度不能超过500") @ApiModelProperty("关联ip(多个用,分隔)") private String glIp; @@ -150,8 +144,8 @@ public class AssetCurrent extends BaseClass implements Serializable { * 是否关基系统(字典) */ //@NotNull -// @Excel(name = "是否关基系统",dictType = "is_no",comboReadDict = true,sort = 10) - @Excel(name = "*是否关基系统",dictType = "is_no",comboReadDict = true,sort = 10) + @Excel(name = "是否关基系统",dictType = "is_no",comboReadDict = true,sort = 10) +// @Excel(name = "*是否关基系统",dictType = "is_no",comboReadDict = true,sort = 10) @ApiModelProperty("是否关基系统(字典)") private String gjxt; /** @@ -194,8 +188,8 @@ public class AssetCurrent extends BaseClass implements Serializable { /** * 系统状态(字典) */ -// @Excel(name = "系统状态",dictType = "zc_xtzt",comboReadDict = true,sort = 36) - @Excel(name = "*系统状态",dictType = "zc_xtzt",comboReadDict = true,sort = 36) + @Excel(name = "系统状态",dictType = "zc_xtzt",comboReadDict = true,sort = 36) +// @Excel(name = "*系统状态",dictType = "zc_xtzt",comboReadDict = true,sort = 36) //@NotNull @ApiModelProperty("系统状态(字典)") private String xtzt; @@ -254,8 +248,8 @@ public class AssetCurrent extends BaseClass implements Serializable { /** * 系统特征(,分隔) */ -// @Excel(width = 60,name = "系统特征(多选,多个特征用逗号隔开。选项为",sort = 52) - @Excel(width = 60,name = "系统特征(多选,多个特征用逗号隔开。选项为:党政机关门户网站、重点新闻网站,大型网络平台,系统业务覆盖单个地市级行政区30%以上人口的工作、生活,系统业务覆盖10万人以上用水、用电、用气、用油、取暖或交通出行,存储超过5万人以上个人敏感信息,存储超过100万条以上地理、人口、资源等国家基础数据)",sort = 52) + @Excel(width = 60,name = "系统特征(多选,多个特征用逗号隔开。选项为",sort = 52) +// @Excel(width = 60,name = "系统特征(多选,多个特征用逗号隔开。选项为:党政机关门户网站、重点新闻网站,大型网络平台,系统业务覆盖单个地市级行政区30%以上人口的工作、生活,系统业务覆盖10万人以上用水、用电、用气、用油、取暖或交通出行,存储超过5万人以上个人敏感信息,存储超过100万条以上地理、人口、资源等国家基础数据)",sort = 52) @ApiModelProperty("系统特征(,分隔)") private String xttz; /** @@ -506,8 +500,8 @@ public class AssetCurrent extends BaseClass implements Serializable { /** * ICP备案信息-ICP备案编号 */ -// @Excel(name = "ICP备案编号",sort = 25,width = 46) - @Excel(name = "ICP备案编号(ICP备案状态选择为是则必填)",sort = 25,width = 46) + @Excel(name = "ICP备案编号",sort = 25,width = 46) +// @Excel(name = "ICP备案编号(ICP备案状态选择为是则必填)",sort = 25,width = 46) //@NotBlank @Size(max= 50,message="ICP备案信息-ICP备案编号长度不能超过50") @ApiModelProperty("ICP备案信息-ICP备案编号") @@ -693,10 +687,10 @@ public class AssetCurrent extends BaseClass implements Serializable { /** * 等保信息-是否有第三方测评 */ -// @Excel(name = "是否有第三方测评",width = 45,dictType = "is_no",comboReadDict = true,sort = 45) + @Excel(name = "是否有第三方测评",width = 45,dictType = "is_no",comboReadDict = true,sort = 45) @ApiModelProperty("等保信息-是否有第三方测评") //@NotNull - @Excel(name = "是否有第三方测评(是否是等保系统选择是则必填)",width = 45,dictType = "is_no",comboReadDict = true,sort = 45) +// @Excel(name = "是否有第三方测评(是否是等保系统选择是则必填)",width = 45,dictType = "is_no",comboReadDict = true,sort = 45) private String dbxxSfydsfcp; @ApiModelProperty("地理位置-省") @@ -1045,4 +1039,7 @@ public class AssetCurrent extends BaseClass implements Serializable { @ApiModelProperty("报废原因") private String bfyy; + + @ApiModelProperty("不通过原因") + private String btgyy; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetEmail.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetEmail.java new file mode 100644 index 0000000..5cf30e4 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetEmail.java @@ -0,0 +1,137 @@ +package com.ruoyi.tc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.tc.baseClass.BaseClass; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 电子邮件资产表(asset_email)实体类 + * @author du + * @since 2024/11/13 14:44 +*/ +@Data +@ApiModel("电子邮件资产表") +@TableName(value = "asset_email") +public class AssetEmail extends BaseClass implements Serializable { + + + @ApiModelProperty("id") + private Long id; + /** + * 所属单位 + */ + @Excel(name = "所属单位", sort = 1, width = 24) + @ApiModelProperty("所属单位") + private String ssdw; + /** + * 电子邮箱后缀 + */ + @Excel(name = "电子邮箱后缀", sort = 2, width = 20) + @ApiModelProperty("电子邮箱后缀") + private String dzyxhz; + /** + * 建设类型(字典) + */ + @Excel(name = "建设类型", sort = 3, width = 20,dictType = "email_jslx",comboReadDict = true) + @ApiModelProperty("建设类型(字典)") + private String jslx; + /** + * 邮箱系统供应商 + */ + @Excel(name = "邮箱系统供应商", sort = 4, width = 24) + @ApiModelProperty("邮箱系统供应商") + private String yjxtgys; + /** + * 密码算法 + */ + @Excel(name = "密码算法", sort = 5, width = 22) + @ApiModelProperty("密码算法") + private String mmsf; + /** + * 邮寄系统状态(字典) + */ + @Excel(name = "邮寄系统状态", sort = 6, width = 20,dictType = "email_state",comboReadDict = true) + @ApiModelProperty("邮寄系统状态(字典)") + private String yjxtzc; + /** + * 安全防护系统(字典) + */ + @Excel(name = "安全防护系统", sort = 7, dictType = "email_hasorno",comboReadDict = true) + @ApiModelProperty("安全防护系统(字典)") + private String aqfhxt; + /** + * 安全备份环境(字典) + */ + @Excel(name = "安全备份环境", sort = 8, dictType = "email_hasorno",comboReadDict = true) + @ApiModelProperty("安全备份环境(字典)") + private String aqbfhj; + /** + * 数字证书厂商 + */ + @Excel(name = "数字证书厂商", sort = 9) + @ApiModelProperty("数字证书厂商") + private String szzscs; + /** + * 上线时间 + */ + @Excel(name = "上线时间", sort = 10) + @ApiModelProperty("上线时间") + private String sxsj; + /** + * 所属行业(字典) + */ + @Excel(name = "所属行业",dictType = "app_sshy",comboReadDict = true,sort = 11, width = 18) + @ApiModelProperty("所属行业(字典)") + private String sshy; + /** + * 重点行业(字典) + */ + @Excel(name = "重点行业",dictType = "app_zdhy",comboReadDict = true,sort = 12, width = 18) + @ApiModelProperty("重点行业(字典)") + private String zdhy; + /** + * 行政区划(字典) + */ + @Excel(name = "行政区划",dictType = "app_xzqh",comboReadDict = true,sort = 13, width = 18) + @ApiModelProperty("行政区划(字典)") + private String xzqh; + /** + * 简介 + */ + @Excel(name = "简介",sort = 14, width = 28) + @ApiModelProperty("简介") + private String jj; + /** + * 系统责任人 + */ + @Excel(name = "系统责任人",sort = 15) + @ApiModelProperty("系统责任人") + private String xtzrr; + /** + * 系统责任人电话 + */ + @Excel(name = "系统责任人电话",sort = 16) + @ApiModelProperty("系统责任人电话") + private String xtzrrdh; + /** + * 系统责任人邮箱 + */ + @Excel(name = "系统责任人邮箱",sort = 17) + @ApiModelProperty("系统责任人邮箱") + private String xtzrryx; + /** + * 系统责任人地址 + */ + @Excel(name = "系统责任人地址",sort = 18) + @ApiModelProperty("系统责任人地址") + private String xtzrrdz; + + + @ApiModelProperty("删除标志(0代表存在 2代表删除)") + private String delFlag; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetMiniPrograms.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetMiniPrograms.java new file mode 100644 index 0000000..f50f6fb --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetMiniPrograms.java @@ -0,0 +1,205 @@ +package com.ruoyi.tc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.ruoyi.common.annotation.Excel; +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_mini_programs)实体类 + * + * @author du + * @since 2024/11/13 14:44 + */ +@Data +@ApiModel("小程序资产表") +@TableName(value = "asset_mini_programs") +public class AssetMiniPrograms extends BaseClass implements Serializable { + + /** + * + */ + @ApiModelProperty("id") + private Long id; + /** + * 所属单位 + */ + @Excel(name = "所属单位", sort = 1, width = 22) + @ApiModelProperty("所属单位") + private String ssdw; + /** + * 小程序名称 + */ + @Excel(name = "小程序名称", sort = 2, width = 22) + @ApiModelProperty("小程序名称") + private String xcxmc; + /** + * appid + */ + @Excel(name = "APPID", sort = 3, width = 22) + @ApiModelProperty("appid") + private String appId; + /** + * 认证主体 + */ + @Excel(name = "认证主体", sort = 4, width = 26) + @ApiModelProperty("认证主体") + private String rzzt; + /** + * 统一社会信用代码 + */ + @Excel(name = "统一社会信用代码", sort = 5) + @ApiModelProperty("统一社会信用代码") + private String tyshxydm; + /** + * 小程序状态(字典) + */ + @Excel(name = "小程序包状态", sort = 6,dictType = "email_state",comboReadDict = true) + @ApiModelProperty("小程序状态(字典)") + private String state; + /** + * 账号原始ID + */ + @Excel(name = "账号原始ID", sort = 6,dictType = "email_state",comboReadDict = true) + @ApiModelProperty("账号原始ID") + private String ysId; + /** + * 小程序包状态(字典) + */ + @Size(max= 10,message="编码长度不能超过10") + @ApiModelProperty("小程序包状态(字典)") + @Length(max= 10,message="编码长度不能超过10") + private String packState; + /** + * 认证状态(字典) + */ + @Size(max= 10,message="编码长度不能超过10") + @ApiModelProperty("认证状态(字典)") + @Length(max= 10,message="编码长度不能超过10") + private String rzState; + /** + * 认证时间 + */ + @Size(max= 50,message="编码长度不能超过50") + @ApiModelProperty("认证时间") + @Length(max= 50,message="编码长度不能超过50") + private String rzsj; + /** + * 认证类型(字典) + */ + @Size(max= 255,message="编码长度不能超过255") + @ApiModelProperty("认证类型(字典)") + @Length(max= 255,message="编码长度不能超过255") + private String rzlx; + /** + * icp备案状态 + */ + @Size(max= 100,message="编码长度不能超过100") + @ApiModelProperty("icp备案状态") + @Length(max= 100,message="编码长度不能超过100") + private String icpState; + /** + * 域命白名单 + */ + @Size(max= 255,message="编码长度不能超过255") + @ApiModelProperty("域命白名单") + @Length(max= 255,message="编码长度不能超过255") + private String ymbmd; + /** + * 服务类目 + */ + @Size(max= 255,message="编码长度不能超过255") + @ApiModelProperty("服务类目") + @Length(max= 255,message="编码长度不能超过255") + private String fwlm; + /** + * 行业电子邮箱 + */ + @Size(max= 100,message="编码长度不能超过100") + @ApiModelProperty("行业电子邮箱") + @Length(max= 100,message="编码长度不能超过100") + private String hydzyx; + /** + * 所属行业(字典) + */ + @Size(max= 10,message="编码长度不能超过10") + @ApiModelProperty("所属行业(字典)") + @Length(max= 10,message="编码长度不能超过10") + private String sshy; + /** + * 重点行业(字典) + */ + @Size(max= 10,message="编码长度不能超过10") + @ApiModelProperty("重点行业(字典)") + @Length(max= 10,message="编码长度不能超过10") + private String zdhy; + /** + * 行政区划(字典) + */ + @Size(max= 10,message="编码长度不能超过10") + @ApiModelProperty("行政区划(字典)") + @Length(max= 10,message="编码长度不能超过10") + private String xzqh; + /** + * 系统简介 + */ + @Size(max= 500,message="编码长度不能超过500") + @ApiModelProperty("系统简介") + @Length(max= 500,message="编码长度不能超过500") + private String xtjj; + /** + * 系统责任人 + */ + @Size(max= 50,message="编码长度不能超过50") + @ApiModelProperty("系统责任人") + @Length(max= 50,message="编码长度不能超过50") + private String xtzrr; + /** + * 系统责任人电话 + */ + @Size(max= 50,message="编码长度不能超过50") + @ApiModelProperty("系统责任人电话") + @Length(max= 50,message="编码长度不能超过50") + private String xtzrrdh; + /** + * 系统责任人邮箱 + */ + @Size(max= 50,message="编码长度不能超过50") + @ApiModelProperty("系统责任人邮箱") + @Length(max= 50,message="编码长度不能超过50") + private String xtzrryx; + /** + * 系统责任人地址 + */ + @Size(max= 255,message="编码长度不能超过255") + @ApiModelProperty("系统责任人地址") + @Length(max= 255,message="编码长度不能超过255") + private String xtzrrdz; + /** + * 引用插件appid + */ + @Size(max= 255,message="编码长度不能超过255") + @ApiModelProperty("引用插件appid") + @Length(max= 255,message="编码长度不能超过255") + private String yycjAppid; + /** + * 引用插件开发者 + */ + @Size(max= 255,message="编码长度不能超过255") + @ApiModelProperty("引用插件开发者") + @Length(max= 255,message="编码长度不能超过255") + private String yycjKfz; + /** + * 删除标志(0代表存在 2代表删除) + */ + @ApiModelProperty("删除标志(0代表存在 2代表删除)") + private String delFlag; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetOfficialAccount.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetOfficialAccount.java new file mode 100644 index 0000000..dca6c78 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetOfficialAccount.java @@ -0,0 +1,166 @@ +package com.ruoyi.tc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.tc.baseClass.BaseClass; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 公众号资产表(asset_official_account)实体类 + * + * @author du + * @since 2024/11/13 14:44 + */ +@Data +@ApiModel("公众号资产表") +@TableName(value = "asset_official_account") +public class AssetOfficialAccount extends BaseClass implements Serializable { + + + @ApiModelProperty("id") + private Long id; + + /** + * 所属单位 + */ + @Excel(name = "所属单位", sort = 1, width = 24) + @ApiModelProperty("所属单位") + private String ssdw; + + /** + * 公众号名称 + */ + @Excel(name = "公众号名称", sort = 2, width = 20) + @ApiModelProperty("公众号名称") + private String gzhmc; + /** + * 微信号 + */ + @Excel(name = "微信号", sort = 3, width = 22) + @ApiModelProperty("微信号") + private String wxh; + /** + * 认证主体 + */ + @Excel(name = "认证主体", sort = 4, width = 24) + @ApiModelProperty("认证主体") + private String rzzt; + /** + * 统一社会信用代码 + */ + @Excel(name = "统一社会信用代码", sort = 5, width = 24) + @ApiModelProperty("统一社会信用代码") + private String tyshxydm; + /** + * 公众号状态(字典) + */ + @Excel(name = "公众号状态", sort = 6, dictType = "gzh_state", comboReadDict = true) + @ApiModelProperty("公众号状态(字典)") + private String gzhzt; + /** + * 公众号id + */ + @Excel(name = "公众号ID", sort = 7) + @ApiModelProperty("公众号id") + private String gzhId; + /** + * 公众号类型(字典) + */ + @Excel(name = "公众号类型", sort = 8, dictType = "gzh_lx", comboReadDict = true) + @ApiModelProperty("公众号类型(字典)") + private String gzhlx; + /** + * 认证状态(字典) + */ + @Excel(name = "公众号类型", sort = 9, dictType = "gzh_rzzt", comboReadDict = true) + @ApiModelProperty("认证状态(字典)") + private String rzState; + /** + * 认证时间 + */ + @Excel(name = "认证时间", sort = 10) + @ApiModelProperty("认证时间") + private String rzsj; + /** + * 认证类型(字典) + */ + @Excel(name = "认证类型", sort = 11, dictType = "gzh_rzlx", comboReadDict = true) + @ApiModelProperty("认证类型(字典)") + private String rzlx; + /** + * 所属行业(字典) + */ + @Excel(name = "所属行业", dictType = "app_sshy", comboReadDict = true, sort = 12, width = 18) + @ApiModelProperty("所属行业(字典)") + private String sshy; + /** + * 重点行业(字典) + */ + @Excel(name = "重点行业", dictType = "app_zdhy", comboReadDict = true, sort = 13, width = 18) + @ApiModelProperty("重点行业(字典)") + private String zdhy; + /** + * 行政区划(字典) + */ + @Excel(name = "行政区划", dictType = "app_xzqh", comboReadDict = true, sort = 14, width = 18) + @ApiModelProperty("行政区划(字典)") + private String xzqh; + /** + * 系统简介 + */ + @Excel(name = "系统简介", sort = 15, width = 26) + @ApiModelProperty("系统简介") + private String xtjj; + /** + * 系统责任人 + */ + @Excel(name = "系统责任人", sort = 16) + @ApiModelProperty("系统责任人") + private String xtzrr; + /** + * 系统责任人电话 + */ + @Excel(name = "系统责任人电话", sort = 17) + @ApiModelProperty("系统责任人电话") + private String xtzrrdh; + /** + * 系统责任人邮箱 + */ + @Excel(name = "系统责任人邮箱", sort = 18) + @ApiModelProperty("系统责任人邮箱") + private String xtzrryx; + /** + * 系统责任人地址 + */ + @Excel(name = "系统责任人地址", sort = 19) + @ApiModelProperty("系统责任人地址") + private String xtzrrdz; + /** + * 菜单名称 + */ + @Excel(name = "菜单信息(菜单名称)", sort = 20) + @ApiModelProperty("菜单名称") + private String cdmc; + /** + * 菜单链接 + */ + @Excel(name = "菜单信息(菜单链接)", sort = 21,width = 28) + @ApiModelProperty("菜单链接") + private String cdlj; + /** + * 菜单类型 + */ + @Excel(name = "菜单信息(菜单类型)", sort = 22, dictType = "gzh_cdlx", comboReadDict = true) + @ApiModelProperty("菜单类型") + private String cdlx; + + /** + * 删除标志(0代表存在 2代表删除) + */ + @ApiModelProperty("删除标志(0代表存在 2代表删除)") + private String delFlag; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/Unit.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/Unit.java index c5b0eac..5152c0a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/Unit.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/Unit.java @@ -11,6 +11,7 @@ import org.springframework.format.annotation.DateTimeFormat; import javax.validation.Valid; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.Date; import java.util.List; @@ -29,11 +30,26 @@ public class Unit implements Serializable { @TableId(type = IdType.AUTO,value = "id") private Long id; + @NotBlank @ApiModelProperty("单位名称/用户昵称") @Excel(name = "单位名称*",required = true) private String nickName; + @NotNull + @ApiModelProperty("组织机构(部门id)") + private Long deptId; + + @ApiModelProperty("组织机构名称(部门名称)") + @Excel(name = "组织机构名称*",required = true) + @TableField(exist = false) + private String deptName; + + @ApiModelProperty("组织机构名称(加上父级deptId部门名称),返回体") + @TableField(exist = false) + private String ancestors; + + @ApiModelProperty("单位简称") @Excel(name = "单位简称") private String dwjc; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/po/AssetCurrentCpPo.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/po/AssetCurrentCpPo.java index a4a76f2..be8cca9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/po/AssetCurrentCpPo.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/po/AssetCurrentCpPo.java @@ -174,6 +174,7 @@ public class AssetCurrentCpPo extends BaseClass implements Serializable { @ApiModelProperty("使用人") + @TableField(exist = false) private String syr; /** * C-机密性(字典) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/UnitRequest.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/UnitRequest.java index d0fb404..7470407 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/UnitRequest.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/UnitRequest.java @@ -15,6 +15,9 @@ public class UnitRequest { // @ApiModelProperty("1 查询已有资产的单位") // private String isSearch; + @ApiModelProperty("组织机构代码") + private Long deptId; + @ApiModelProperty("统一社会信用代码") private String userName; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetCurrentServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetCurrentServiceImpl.java index 3cd7205..2160b34 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetCurrentServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetCurrentServiceImpl.java @@ -35,16 +35,17 @@ public class AssetCurrentServiceImpl extends ServiceImpl page(Page page, AssetCurrentPageRequest as) { - return baseMapper.page(page,as); + return baseMapper.page(page, as); } /** @@ -67,19 +68,19 @@ public class AssetCurrentServiceImpl extends ServiceImpl a1 = new ArrayList<>(); - Arrays.asList(byId.getGlym().split(",")).forEach(x->{ + Arrays.asList(byId.getGlym().split(",")).forEach(x -> { Acomma acomma = new Acomma(); acomma.setKey(x); a1.add(acomma); }); byId.setGlymList(a1); List a2 = new ArrayList<>(); - Arrays.asList(byId.getGlIp().split(",")).forEach(x->{ + Arrays.asList(byId.getGlIp().split(",")).forEach(x -> { Acomma acomma = new Acomma(); acomma.setKey(x); a2.add(acomma); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/UnitServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/UnitServiceImpl.java index 2e44aba..0a13944 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/UnitServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/UnitServiceImpl.java @@ -65,17 +65,23 @@ public class UnitServiceImpl extends ServiceImpl implements Un */ @Override public String validUser(Unit x) { - if (x.getUserName() != null) { + if (x.getUserName() != null && x.getNickName() != null) { String password = PasswordGenerator.password(); SysUser user = new SysUser(); user.setUserName(x.getUserName()); user.setPassword(SecurityUtils.encryptPassword(password)); user.setNickName(x.getNickName()); + user.setDeptId(x.getDeptId()); SysUser u = userService.selectUserByUserName(x.getUserName()); + //如果存在用户就做修改 + //不存在用户就做新增 if (StringUtils.isNull(u)) { userService.insertUser(user); Long[] roles = new Long[]{100L}; userService.insertUserAuth(user.getUserId(), roles); + } else { + u.setDeptId(x.getDeptId()); + userService.updateUserProfile(u); } return password; } else { diff --git a/ruoyi-admin/src/main/resources/mapper/UnitMapper.xml b/ruoyi-admin/src/main/resources/mapper/UnitMapper.xml index 060616b..7184fdf 100644 --- a/ruoyi-admin/src/main/resources/mapper/UnitMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/UnitMapper.xml @@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -84,9 +85,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + select a.*,c.*,e.*,d.dept_name as deptName, + IF(d.ancestors != 0,concat(d.ancestors,',',d.dept_id),d.dept_id) + as ancestors from unit_info a left join unit_other_contact c on a.id = c.unit_id left join unit_examine_info e on a.id = e.unit_id + left join sys_dept d on a.dept_id = d.dept_id where id = #{id}