增加附件和企业管理

This commit is contained in:
pengjie 2023-12-05 14:47:03 +08:00
parent 538d5a0f3d
commit 96f288cd0e
15 changed files with 565 additions and 15 deletions

View File

@ -0,0 +1,192 @@
package com.zhgd.xmgl.modules.basicdata.controller.admin;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.annotation.OperLog;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.jeecg.common.util.PageUtil;
import com.zhgd.xmgl.modules.basicdata.entity.AnnexFile;
import com.zhgd.xmgl.modules.basicdata.service.IAnnexFileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @Title: Controller
* @Description: 附件
* @author pengj
* @date 2023-12-04
* @version V1.0
*/
@RestController
@RequestMapping("/xmgl/annexFile")
@Slf4j
@Api(tags = "附件管理")
public class AnnexFileController {
@Autowired
private IAnnexFileService annexFileService;
/**
* 分页列表查询
*
* @return
*/
@OperLog(operModul = "附件管理", operType = "分页查询", operDesc = "分页列表查询附件信息")
@ApiOperation(value = " 分页列表查询附件信息", notes = "分页列表查询附件信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer"),
@ApiImplicitParam(name = "relevanceId", value = "关联id", paramType = "body", required = true),
@ApiImplicitParam(name = "fileType", value = "类型(1:工程附件;2:通知公告附件;3:政策法规附件;4:工程附件(单独))", paramType = "body", required = true)
})
@PostMapping(value = "/page")
public Result<IPage<AnnexFile>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
QueryWrapper<AnnexFile> queryWrapper = QueryGenerator.initPageQueryWrapper(AnnexFile.class, map);
Page<AnnexFile> page = PageUtil.getPage(map);
IPage<AnnexFile> pageList = annexFileService.page(page, queryWrapper);
return Result.success(pageList);
}
/**
* 列表查询
*
* @param annexFile
* @return
*/
@OperLog(operModul = "附件管理", operType = "列表查询", operDesc = "列表查询附件信息")
@ApiOperation(value = " 列表查询附件信息", notes = "列表查询附件信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "relevanceId", value = "关联id", paramType = "body", required = true),
@ApiImplicitParam(name = "fileType", value = "类型(1:工程附件;2:通知公告附件;3:政策法规附件;4:工程附件(单独))", paramType = "body", required = true)
})
@PostMapping(value = "/list")
public Result<List<AnnexFile>> queryList(@ApiIgnore @RequestBody AnnexFile annexFile) {
QueryWrapper<AnnexFile> queryWrapper = QueryGenerator.initQueryWrapper(annexFile);
List<AnnexFile> list = annexFileService.list(queryWrapper);
return Result.success(list);
}
/**
* 添加
*
* @param annexFile
* @return
*/
@OperLog(operModul = "附件管理", operType = "新增", operDesc = "添加附件信息")
@ApiOperation(value = " 添加附件信息", notes = "添加附件信息", httpMethod = "POST")
@PostMapping(value = "/add")
public Result<Object> add(@RequestBody AnnexFile annexFile) {
annexFileService.save(annexFile);
return Result.success("添加成功!");
}
/**
* 编辑
*
* @param annexFile
* @return
*/
@OperLog(operModul = "附件管理", operType = "修改", operDesc = "编辑附件信息")
@ApiOperation(value = "编辑附件信息", notes = "编辑附件信息", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<AnnexFile> edit(@RequestBody AnnexFile annexFile) {
Result<AnnexFile> result = new Result<AnnexFile>();
AnnexFile annexFileEntity = annexFileService.getById(annexFile.getFileId());
if (annexFileEntity == null) {
result.error500("未找到对应实体");
} else {
boolean ok = annexFileService.updateById(annexFile);
if (ok) {
result.success("修改成功!");
} else {
result.success("操作失败!");
}
}
return result;
}
/**
* 通过id删除
*
* @return
*/
@OperLog(operModul = "附件管理", operType = "删除", operDesc = "删除附件信息")
@ApiOperation(value = "删除附件信息", notes = "删除附件信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "附件ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/delete")
public Result<AnnexFile> delete(@RequestBody AnnexFile annexFile) {
Result<AnnexFile> result = new Result<AnnexFile>();
AnnexFile annexFileEntity = annexFileService.getById(annexFile.getFileId());
if (annexFileEntity == null) {
result.error500("未找到对应实体");
} else {
boolean ok = annexFileService.removeById(annexFile.getFileId());
if (ok) {
result.success("删除成功!");
} else {
result.success("操作失败!");
}
}
return result;
}
/**
* 批量删除
*
* @return
*/
@OperLog(operModul = "附件管理", operType = "批量删除", operDesc = "批量删除附件信息")
@ApiOperation(value = "批量删除附件信息", notes = "批量删除附件信息", httpMethod = "POST")
@ApiImplicitParam(name = "ids", value = "附件ID字符串", paramType = "body", required = true, dataType = "String")
@PostMapping(value = "/deleteBatch")
public Result<AnnexFile> deleteBatch(@ApiIgnore @RequestBody Map<String, Object> map) {
Result<AnnexFile> result = new Result<AnnexFile>();
String ids = MapUtils.getString(map, "ids");
if (ids == null || "".equals(ids.trim())) {
result.error500("参数不识别!");
} else {
this.annexFileService.removeByIds(Arrays.asList(ids.split(",")));
result.success("删除成功!");
}
return result;
}
/**
* 通过id查询
*
* @return
*/
@OperLog(operModul = "附件管理", operType = "查询", operDesc = "通过id查询附件信息")
@ApiOperation(value = "通过id查询附件信息", notes = "通过id查询附件信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "附件ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/queryById")
public Result<AnnexFile> queryById(@ApiIgnore @RequestBody Map<String, Object> map) {
Result<AnnexFile> result = new Result<AnnexFile>();
AnnexFile annexFile = annexFileService.getById(MapUtils.getString(map, "id"));
if (annexFile == null) {
result.error500("未找到对应实体");
} else {
result.setResult(annexFile);
result.setSuccess(true);
}
return result;
}
}

View File

@ -9,13 +9,11 @@ import com.zhgd.xmgl.modules.basicdata.service.IEnterpriseService;
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService; import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
import com.zhgd.xmgl.modules.basicdata.vo.EnterpriseVo; import com.zhgd.xmgl.modules.basicdata.vo.EnterpriseVo;
import com.zhgd.xmgl.util.CommonUtil; import com.zhgd.xmgl.util.CommonUtil;
import com.zhgd.xmgl.valid.AddGroup;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -50,7 +48,7 @@ public class EntEnterpriseController {
@OperLog(operModul = "企业管理", operType = "新增", operDesc = "企业注册申请") @OperLog(operModul = "企业管理", operType = "新增", operDesc = "企业注册申请")
@ApiOperation(value = " 企业注册申请", notes = "企业注册申请", httpMethod = "POST") @ApiOperation(value = " 企业注册申请", notes = "企业注册申请", httpMethod = "POST")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<Enterprise> add(@RequestBody @Validated(AddGroup.class) EnterpriseVo enterpriseVo) { public Result<Enterprise> add(@RequestBody EnterpriseVo enterpriseVo) {
Result<Enterprise> result = new Result<Enterprise>(); Result<Enterprise> result = new Result<Enterprise>();
if (!CommonUtil.checkStrongPwd(enterpriseVo.getPassword())) { if (!CommonUtil.checkStrongPwd(enterpriseVo.getPassword())) {
result.error500("密码必须包含数字、大小写字母、特殊符号且大于8位"); result.error500("密码必须包含数字、大小写字母、特殊符号且大于8位");

View File

@ -0,0 +1,216 @@
package com.zhgd.xmgl.modules.basicdata.controller.government;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.annotation.OperLog;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.jeecg.common.util.PageUtil;
import com.zhgd.xmgl.modules.basicdata.entity.AnnexFile;
import com.zhgd.xmgl.modules.basicdata.entity.EngineeringAnnex;
import com.zhgd.xmgl.modules.basicdata.service.IAnnexFileService;
import com.zhgd.xmgl.modules.basicdata.service.IEngineeringAnnexService;
import com.zhgd.xmgl.util.ParamEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @Title: Controller
* @Description: 工程附件
* @author pengj
* @date 2023-12-02
* @version V1.0
*/
@RestController
@RequestMapping("/gov/engineeringAnnex")
@Slf4j
@Api(tags = "工程附件管理")
public class GovEngineeringAnnexController {
@Autowired
private IEngineeringAnnexService engineeringAnnexService;
@Autowired
private IAnnexFileService annexFileService;
/**
* 分页列表查询
*
* @return
*/
@OperLog(operModul = "工程附件管理", operType = "分页查询", operDesc = "分页列表查询工程附件信息")
@ApiOperation(value = " 分页列表查询工程附件信息", notes = "分页列表查询工程附件信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer")
})
@PostMapping(value = "/page")
public Result<IPage<EngineeringAnnex>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
QueryWrapper<EngineeringAnnex> queryWrapper = QueryGenerator.initPageQueryWrapper(EngineeringAnnex.class, map);
Page<EngineeringAnnex> page = PageUtil.getPage(map);
IPage<EngineeringAnnex> pageList = engineeringAnnexService.page(page, queryWrapper);
return Result.success(pageList);
}
/**
* 列表查询
*
* @param engineeringAnnex
* @return
*/
@OperLog(operModul = "工程附件管理", operType = "列表查询", operDesc = "列表查询工程附件信息")
@ApiOperation(value = " 列表查询工程附件信息", notes = "列表查询工程附件信息", httpMethod = "POST")
@PostMapping(value = "/list")
public Result<List<EngineeringAnnex>> queryList(@RequestBody EngineeringAnnex engineeringAnnex) {
QueryWrapper<EngineeringAnnex> queryWrapper = QueryGenerator.initQueryWrapper(engineeringAnnex);
List<EngineeringAnnex> list = engineeringAnnexService.list(queryWrapper);
return Result.success(list);
}
/**
* 添加
*
* @param engineeringAnnex
* @return
*/
@OperLog(operModul = "工程附件管理", operType = "新增", operDesc = "添加工程附件信息")
@ApiOperation(value = " 添加工程附件信息", notes = "添加工程附件信息", httpMethod = "POST")
@PostMapping(value = "/add")
public Result<Object> add(@RequestBody EngineeringAnnex engineeringAnnex) {
engineeringAnnexService.save(engineeringAnnex);
return Result.success("添加成功!");
}
/**
* 编辑
*
* @param engineeringAnnex
* @return
*/
@OperLog(operModul = "工程附件管理", operType = "修改", operDesc = "编辑工程附件信息")
@ApiOperation(value = "编辑工程附件信息", notes = "编辑工程附件信息", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<EngineeringAnnex> edit(@RequestBody EngineeringAnnex engineeringAnnex) {
Result<EngineeringAnnex> result = new Result<EngineeringAnnex>();
EngineeringAnnex engineeringAnnexEntity = engineeringAnnexService.getById(engineeringAnnex.getId());
if (engineeringAnnexEntity == null) {
result.error500("未找到对应实体");
} else {
boolean ok = engineeringAnnexService.updateById(engineeringAnnex);
if (ok) {
result.success("修改成功!");
} else {
result.success("操作失败!");
}
}
return result;
}
/**
* 通过id删除
*
* @return
*/
@OperLog(operModul = "工程附件管理", operType = "删除", operDesc = "删除工程附件信息")
@ApiOperation(value = "删除工程附件信息", notes = "删除工程附件信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "工程附件ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/delete")
public Result<EngineeringAnnex> delete(@RequestBody EngineeringAnnex engineeringAnnex) {
Result<EngineeringAnnex> result = new Result<EngineeringAnnex>();
EngineeringAnnex engineeringAnnexEntity = engineeringAnnexService.getById(engineeringAnnex.getId());
if (engineeringAnnexEntity == null) {
result.error500("未找到对应实体");
} else {
boolean ok = engineeringAnnexService.removeById(engineeringAnnex.getId());
if (ok) {
result.success("删除成功!");
} else {
result.success("操作失败!");
}
}
return result;
}
/**
* 批量删除
*
* @return
*/
@OperLog(operModul = "工程附件管理", operType = "批量删除", operDesc = "批量删除工程附件信息")
@ApiOperation(value = "批量删除工程附件信息", notes = "批量删除工程附件信息", httpMethod = "POST")
@ApiImplicitParam(name = "ids", value = "工程附件ID字符串", paramType = "body", required = true, dataType = "String")
@PostMapping(value = "/deleteBatch")
public Result<EngineeringAnnex> deleteBatch(@ApiIgnore @RequestBody Map<String, Object> map) {
Result<EngineeringAnnex> result = new Result<EngineeringAnnex>();
String ids = MapUtils.getString(map, "ids");
if (ids == null || "".equals(ids.trim())) {
result.error500("参数不识别!");
} else {
this.engineeringAnnexService.removeByIds(Arrays.asList(ids.split(",")));
result.success("删除成功!");
}
return result;
}
/**
* 通过id查询
*
* @return
*/
@OperLog(operModul = "工程附件管理", operType = "查询", operDesc = "通过id查询工程附件信息")
@ApiOperation(value = "通过id查询工程附件信息", notes = "通过id查询工程附件信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "工程附件ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/queryById")
public Result<EngineeringAnnex> queryById(@ApiIgnore @RequestBody Map<String, Object> map) {
Result<EngineeringAnnex> result = new Result<EngineeringAnnex>();
EngineeringAnnex engineeringAnnex = engineeringAnnexService.getById(MapUtils.getString(map, "id"));
if (engineeringAnnex == null) {
result.error500("未找到对应实体");
} else {
engineeringAnnex.setAnnexFileList(annexFileService.list(Wrappers.<AnnexFile>lambdaQuery()
.eq(AnnexFile::getRelevanceId, engineeringAnnex.getEngineeringSn())
.eq(AnnexFile::getFileType, ParamEnum.AnnexFileType.ENGINEERING_ANNEX.getValue())));
result.setResult(engineeringAnnex);
result.setSuccess(true);
}
return result;
}
/**
* 文件列表更新
* @return
*/
@OperLog(operModul = "工程附件管理", operType = "修改", operDesc = "文件列表更新")
@ApiOperation(value = " 文件列表更新", notes = "文件列表更新", httpMethod = "POST")
@PostMapping(value = "/batchUpdateFile")
public Result<Object> batchUpdateFile(@RequestBody EngineeringAnnex engineeringAnnex) {
annexFileService.remove(Wrappers.<AnnexFile>lambdaQuery()
.eq(AnnexFile::getRelevanceId, engineeringAnnex.getEngineeringSn())
.eq(AnnexFile::getFileType, ParamEnum.AnnexFileType.ENGINEERING_ANNEX.getValue()));
for (AnnexFile annexFile : engineeringAnnex.getAnnexFileList()) {
annexFile.setRelevanceId(engineeringAnnex.getEngineeringSn());
annexFile.setFileType(ParamEnum.AnnexFileType.ENGINEERING_ANNEX.getValue());
}
annexFileService.saveBatch(engineeringAnnex.getAnnexFileList());
return Result.success(true);
}
}

View File

@ -2,12 +2,15 @@ package com.zhgd.xmgl.modules.basicdata.controller.government;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zhgd.annotation.OperLog; import com.zhgd.annotation.OperLog;
import com.zhgd.jeecg.common.api.vo.Result; import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.system.query.QueryGenerator; import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.xmgl.modules.basicdata.entity.Enterprise; import com.zhgd.xmgl.modules.basicdata.entity.Enterprise;
import com.zhgd.xmgl.modules.basicdata.entity.EnterpriseMain; import com.zhgd.xmgl.modules.basicdata.entity.EnterpriseMain;
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
import com.zhgd.xmgl.modules.basicdata.service.IEnterpriseService; import com.zhgd.xmgl.modules.basicdata.service.IEnterpriseService;
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
import com.zhgd.xmgl.modules.basicdata.vo.EnterpriseVo; import com.zhgd.xmgl.modules.basicdata.vo.EnterpriseVo;
import com.zhgd.xmgl.security.SecurityUser; import com.zhgd.xmgl.security.SecurityUser;
import com.zhgd.xmgl.security.SecurityUtil; import com.zhgd.xmgl.security.SecurityUtil;
@ -43,6 +46,9 @@ public class GovEnterpriseController {
@Autowired @Autowired
private IEnterpriseService enterpriseService; private IEnterpriseService enterpriseService;
@Autowired
private ISystemUserService systemUserService;
/** /**
* 政务分页列表查询企业 * 政务分页列表查询企业
* @return * @return
@ -103,7 +109,7 @@ public class GovEnterpriseController {
result.error500("未找到对应实体"); result.error500("未找到对应实体");
} else { } else {
Integer suggest = MapUtils.getInteger(map, "suggest"); Integer suggest = MapUtils.getInteger(map, "suggest");
boolean ok = enterpriseService.updateInfo(enterpriseEntity, suggest); boolean ok = enterpriseService.examine(enterpriseEntity, suggest);
if (ok) { if (ok) {
result.success("修改成功!"); result.success("修改成功!");
} }
@ -111,6 +117,32 @@ public class GovEnterpriseController {
return result; return result;
} }
@OperLog(operModul = "企业管理", operType = "修改", operDesc = "企业修改")
@ApiOperation(value = "企业修改", notes = "企业修改", httpMethod = "POST")
@PostMapping(value = "/update")
public Result<Enterprise> update(@ApiIgnore @RequestBody EnterpriseVo enterpriseVo) {
Result<Enterprise> result = new Result<Enterprise>();
Enterprise enterprise = enterpriseService.getById(enterpriseVo.getEnterpriseId());
if (enterprise == null) {
result.error500("未找到对应实体");
} else {
// 检验项目账号是否已存在
SystemUser systemUser = systemUserService.getOne(Wrappers.<SystemUser>lambdaQuery().eq(SystemUser::getAccount, enterpriseVo.getAccount())
.ne(SystemUser::getSn, enterprise.getEnterpriseSn()));
if (systemUser != null) {
result.error500("该用户账号已被使用");
return result;
}
enterpriseVo.setEnterpriseSn(enterprise.getEnterpriseSn());
boolean ok = enterpriseService.updateById(enterpriseVo);
if (ok) {
result.success("修改成功!");
}
}
return result;
}
/** /**
* 通过id查询 * 通过id查询

View File

@ -0,0 +1,52 @@
package com.zhgd.xmgl.modules.basicdata.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
import java.util.List;
/**
* @Description: 工程附件
* @author pengj
* @date 2023-12-02
* @version V1.0
*/
@Data
@TableName("engineering_annex")
@ApiModel(value = "EngineeringAnnex实体类", description = "EngineeringAnnex")
public class EngineeringAnnex implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 验收申请附件信息ID
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "验收申请附件信息ID")
private Long id;
/**
* 附件名称
*/
@Excel(name = "附件名称", width = 15)
@ApiModelProperty(value = "附件名称")
private String annexName;
/**
* 工程sn
*/
@Excel(name = "工程sn", width = 15)
@ApiModelProperty(value = "工程sn")
private String engineeringSn;
/**
* 附件列表
*/
@TableField(exist = false)
@ApiModelProperty(value = "附件列表")
private List<AnnexFile> annexFileList;
}

View File

@ -0,0 +1,16 @@
package com.zhgd.xmgl.modules.basicdata.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhgd.xmgl.modules.basicdata.entity.EngineeringAnnex;
import org.apache.ibatis.annotations.Mapper;
/**
* @Description: 工程附件
* @author pengj
* @date 2023-12-02
* @version V1.0
*/
@Mapper
public interface EngineeringAnnexMapper extends BaseMapper<EngineeringAnnex> {
}

View File

@ -0,0 +1,5 @@
<?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.zhgd.xmgl.modules.basicdata.mapper.EngineeringAnnexMapper">
</mapper>

View File

@ -0,0 +1,14 @@
package com.zhgd.xmgl.modules.basicdata.service;
import com.zhgd.xmgl.modules.basicdata.entity.EngineeringAnnex;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 工程附件
* @author pengj
* @date 2023-12-02
* @version V1.0
*/
public interface IEngineeringAnnexService extends IService<EngineeringAnnex> {
}

View File

@ -23,7 +23,7 @@ public interface IEnterpriseService extends IService<Enterprise> {
boolean saveInfo(EnterpriseVo enterpriseVo); boolean saveInfo(EnterpriseVo enterpriseVo);
boolean updateInfo(Enterprise enterprise, Integer suggest); boolean examine(Enterprise enterprise, Integer suggest);
EnterpriseVo getDetailById(Long enterpriseId); EnterpriseVo getDetailById(Long enterpriseId);

View File

@ -0,0 +1,19 @@
package com.zhgd.xmgl.modules.basicdata.service.impl;
import com.zhgd.xmgl.modules.basicdata.entity.EngineeringAnnex;
import com.zhgd.xmgl.modules.basicdata.mapper.EngineeringAnnexMapper;
import com.zhgd.xmgl.modules.basicdata.service.IEngineeringAnnexService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 工程附件
* @author pengj
* @date 2023-12-02
* @version V1.0
*/
@Service
public class EngineeringAnnexServiceImpl extends ServiceImpl<EngineeringAnnexMapper, EngineeringAnnex> implements IEngineeringAnnexService {
}

View File

@ -83,7 +83,7 @@ public class EngineeringSingleServiceImpl extends ServiceImpl<EngineeringSingleM
this.remove(Wrappers.<EngineeringSingle>lambdaQuery() this.remove(Wrappers.<EngineeringSingle>lambdaQuery()
.eq(EngineeringSingle::getEngineeringSn, engineeringSn)); .eq(EngineeringSingle::getEngineeringSn, engineeringSn));
annexFileService.remove(Wrappers.<AnnexFile>lambdaQuery() annexFileService.remove(Wrappers.<AnnexFile>lambdaQuery()
.eq(AnnexFile::getRelevanceId, engineeringSn)); .eq(AnnexFile::getRelevanceId, engineeringSn).eq(AnnexFile::getFileType, ParamEnum.AnnexFileType.ENGINEERING));
List<EngineeringMain> engineeringMains = engineeringMainService.list(Wrappers.<EngineeringMain>lambdaQuery() List<EngineeringMain> engineeringMains = engineeringMainService.list(Wrappers.<EngineeringMain>lambdaQuery()
.eq(EngineeringMain::getEngineeringSn, engineeringSn)); .eq(EngineeringMain::getEngineeringSn, engineeringSn));
List<Long> mainIds = engineeringMains.stream().map(m -> m.getId()).collect(Collectors.toList()); List<Long> mainIds = engineeringMains.stream().map(m -> m.getId()).collect(Collectors.toList());

View File

@ -13,6 +13,7 @@ import com.zhgd.xmgl.modules.basicdata.mapper.ProjectMapper;
import com.zhgd.xmgl.modules.basicdata.service.*; import com.zhgd.xmgl.modules.basicdata.service.*;
import com.zhgd.xmgl.modules.basicdata.vo.EnterpriseVo; import com.zhgd.xmgl.modules.basicdata.vo.EnterpriseVo;
import com.zhgd.xmgl.modules.basicdata.vo.SystemUserVo; import com.zhgd.xmgl.modules.basicdata.vo.SystemUserVo;
import com.zhgd.xmgl.security.SecurityUser;
import com.zhgd.xmgl.security.SecurityUtil; import com.zhgd.xmgl.security.SecurityUtil;
import com.zhgd.xmgl.util.CommonUtil; import com.zhgd.xmgl.util.CommonUtil;
import com.zhgd.xmgl.util.ParamEnum; import com.zhgd.xmgl.util.ParamEnum;
@ -75,8 +76,13 @@ public class EnterpriseServiceImpl extends ServiceImpl<EnterpriseMapper, Enterpr
if (state != null) { if (state != null) {
wrapper.eq("a.state", state); wrapper.eq("a.state", state);
} }
wrapper.eq("a.government_sn", SecurityUtil.getUser().getSn());
wrapper.orderByAsc("a.state").orderByDesc("a.create_time"); wrapper.orderByAsc("a.state").orderByDesc("a.create_time");
SecurityUser user = SecurityUtil.getUser();
if (user.getAccountType() == 3 && user.getEnterpriseMainList().contains(1)) {
user = null;
} else {
wrapper.eq("a.government_sn", SecurityUtil.getUser().getSn());
}
return baseMapper.pageList(page, wrapper); return baseMapper.pageList(page, wrapper);
} }
@ -136,7 +142,7 @@ public class EnterpriseServiceImpl extends ServiceImpl<EnterpriseMapper, Enterpr
} }
@Override @Override
public boolean updateInfo(Enterprise enterprise, Integer suggest) { public boolean examine(Enterprise enterprise, Integer suggest) {
if (suggest == 1) { if (suggest == 1) {
// 修改企业状态为可用 // 修改企业状态为可用
LambdaUpdateWrapper<Enterprise> enterpriseWrapper = Wrappers.<Enterprise>lambdaUpdate(); LambdaUpdateWrapper<Enterprise> enterpriseWrapper = Wrappers.<Enterprise>lambdaUpdate();

View File

@ -9,7 +9,6 @@ import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
@ -53,19 +52,19 @@ public class ProjectQuantity implements Serializable {
*/ */
@Excel(name = "数量", width = 15) @Excel(name = "数量", width = 15)
@ApiModelProperty(value = "数量") @ApiModelProperty(value = "数量")
private Integer number; private String number;
/** /**
* 单价 * 单价
*/ */
@Excel(name = "单价", width = 15) @Excel(name = "单价", width = 15)
@ApiModelProperty(value = "单价") @ApiModelProperty(value = "单价")
private BigDecimal unitPrice; private String unitPrice;
/** /**
* 总价 * 总价
*/ */
@Excel(name = "总价", width = 15) @Excel(name = "总价", width = 15)
@ApiModelProperty(value = "总价") @ApiModelProperty(value = "总价")
private BigDecimal totalPrice; private String totalPrice;
/** /**
* 创建时间 * 创建时间
*/ */

View File

@ -11,7 +11,8 @@ public class ParamEnum {
public enum AnnexFileType { public enum AnnexFileType {
ENGINEERING(1, "工程附件"), ENGINEERING(1, "工程附件"),
NOTICE(2, "工程附件"), NOTICE(2, "工程附件"),
POLICY(3, "政策法规附件"); POLICY(3, "政策法规附件"),
ENGINEERING_ANNEX(4, "工程单独附件");
private Integer value; private Integer value;
private String desc; private String desc;

View File

@ -1,10 +1,10 @@
#mysql #mysql
diver_name=com.mysql.jdbc.Driver diver_name=com.mysql.jdbc.Driver
url=jdbc:mysql://127.0.0.1:3306/wisdomsitezw_hzxmgl?useUnicode=true&characterEncoding=UTF-8&useSSL=false url=jdbc:mysql://139.9.66.234:3306/wisdomsitezw_hzxmgl?useUnicode=true&characterEncoding=UTF-8&useSSL=false
#url=jdbc:mysql://127.0.0.1:3306/itbgp_bank?useUnicode=true&characterEncoding=UTF-8 #url=jdbc:mysql://127.0.0.1:3306/itbgp_bank?useUnicode=true&characterEncoding=UTF-8
#url=jdbc:mysql://139.9.66.234:3306/dev_manage?useUnicode=true&characterEncoding=UTF-8 #url=jdbc:mysql://139.9.66.234:3306/dev_manage?useUnicode=true&characterEncoding=UTF-8
username=root username=root
password=root password=JXJ@admin
database_name=wisdomsitezw_hzxmgl database_name=wisdomsitezw_hzxmgl
#database_name=dev_manage #database_name=dev_manage