diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java index 8b260c5..c7fef20 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java @@ -5,9 +5,9 @@ import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.programManagement.entity.BKeyEnterprise; import com.ruoyi.programManagement.entity.BPlanEnterprise; import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest; +import com.ruoyi.programManagement.entity.request.BPlanEnterpriseRequest; import com.ruoyi.programManagement.entity.request.PlanMxRequest; import com.ruoyi.programManagement.entity.request.checkResultRequest; import com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse; @@ -117,33 +117,9 @@ public class BPlanEnterpriseController extends BaseController { * @return 新增结果 */ @PostMapping - @ApiOperation(value = "新增计划企业表", response = BPlanEnterprise.class) - public AjaxResult insert(@RequestBody BPlanEnterprise bPlanEnterprise) { - - String enterPriseId = String.valueOf(bPlanEnterprise.getEnterpriseId()); - String district = bPlanEnterprise.getDistrict(); - String enterpriseName = bPlanEnterprise.getEnterpriseName(); - String[] idArray = enterPriseId.split(","); - String[] districtArray = district.split(","); - String[] enterpriseNameArray = enterpriseName.split(","); - int i = 0; - for (String entId : idArray) { - //根据企业id查询重点企业表是 1:重点企业 ,2:非重点企业 - BKeyEnterprise count = bKeyEnterpriseService.getByentCode(entId); - if (count != null) { - bPlanEnterprise.setIsPoint(1); - } - bPlanEnterprise.setIsPoint(2); - bPlanEnterprise.setId(null); - bPlanEnterprise.setEnterpriseId(entId); - - bPlanEnterprise.setDeptId(getDeptId()); - bPlanEnterprise.setDistrict(districtArray[i]); - bPlanEnterprise.setEnterpriseName(enterpriseNameArray[i]); - bPlanEnterpriseService.save(bPlanEnterprise); - i += 1; - - } + @ApiOperation(value = "新增计划企业表") + public AjaxResult insert(@RequestBody BPlanEnterpriseRequest bPlanEnterprise) { + bPlanEnterpriseService.insert(bPlanEnterprise); return success(); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/request/BPlanEnterpriseRequest.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/request/BPlanEnterpriseRequest.java new file mode 100644 index 0000000..c53e34e --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/request/BPlanEnterpriseRequest.java @@ -0,0 +1,230 @@ +package com.ruoyi.programManagement.entity.request; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +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 java.util.Date; + +/** + * 计划企业新增请求类 + */ +@Data +@ApiModel("计划企业新增请求类") +public class BPlanEnterpriseRequest { + private static final long serialVersionUID = -98531345456142440L; + /** + * 编号 + */ + @ApiModelProperty(value = "编号") + @TableId(type = IdType.AUTO) + private Long id; + + + /** + * 企业id + */ + @ApiModelProperty(value = "企业id") + private String enterpriseId; + + /** + * 创建者ID + */ + @ApiModelProperty(value = "创建者ID") + private Long createId; + + /** + * 创建者 + */ + @ApiModelProperty(value = "创建者") + private String createBy; + + /** + * 创建时间 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd ", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty(value = "创建时间") + private Date createTime; + + /** + * 更新者ID + */ + @ApiModelProperty(value = "更新者ID") + private Long updateId; + + /** + * 更新者 + */ + @ApiModelProperty(value = "更新者") + private String updateBy; + + /** + * 更新时间 + */ + @ApiModelProperty(value = "更新时间") + private Date updateTime; + + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + private String remark; + + /** + * 用户权限id + */ + @ApiModelProperty(value = "用户权限id") + private Long userId; + + /** + * 部门权限id + */ + @ApiModelProperty(value = "部门权限id") + private Long deptId; + + /** + * 计划年份 + */ + @ApiModelProperty(value = "计划年份") + @Excel(name = "计划年份") + private String plannedYear; + + + /** + * 计划月份 + */ + @Excel(name = "计划月份") + @ApiModelProperty(value = "计划月份") + private String plannedMonth; + + + /** + * 行政区划 + */ + @ApiModelProperty(value = "行政区划") + @Excel(name = "行政区划") + private String district; + + + /** + * 企业名称 + */ + @Excel(name = "企业名称") + @ApiModelProperty(value = "企业名称") + private String enterpriseName; + + + /** + * 是否重点企业1:是2:否 + */ + @Excel(name = "是否省重点", readConverterExp = "1=是,2=否") + @ApiModelProperty(value = "是否重点企业1:是2:否") + private Integer isPoint; + + + /** + * 执法地区 + */ + @Excel(name = "执法地区") + @ApiModelProperty(value = "执法地区") + private String lawAreas; + + + /** + * 执法级别 + */ + @Excel(name = "执法级别") + @ApiModelProperty(value = "执法级别") + private String lawLevel; + + + /** + * 执法层级 + */ + @Excel(name = "执法层级") + @ApiModelProperty(value = "执法层级") + private String lawHierarchy; + + + /** + * 0:草稿 1:正式 + */ + @Excel(name = "状态",readConverterExp = "0=草稿,1=正式") + @ApiModelProperty(value = "0:草稿 1:正式") + private Integer status; + + /** + * 企业主表名称 + */ + @TableField(exist = false) + @ApiModelProperty(value = "企业主表名称") + private String entprName; + + + /** + * 执法排序 + */ + @ApiModelProperty(value = "执法排序") + private Long lawSort; + + + + + + + /** + * 0:未检查 1:已检查 + */ + @ApiModelProperty(value = "0:未检查 1:已检查") + private Integer checkStatus; + + + /** + * 检查id + */ + @ApiModelProperty(value = "检查id") + private Integer checkId; + + + /** + * 1当月 2提前 3滞后 + */ + @ApiModelProperty(value = "1当月 2提前 3滞后") + private Integer checkAgeing; + + + /** + * 1当月 2提前 3滞后 + */ + @ApiModelProperty(value = "1当月 2提前 3滞后") + private Integer RISK_LEVEL; + + + /** + * 安全风险等级 + */ + @ApiModelProperty(value = "安全风险等级") + private String riskLevel; + + + /** + * 标准化等级 + */ + @ApiModelProperty(value = "标准化等级") + private String standLevel; + + + /** + * 上次检查时间 + */ + @ApiModelProperty(value = "上次检查时间") + private Date examineEndTime; + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java index 14a07de..32c46dd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java @@ -106,5 +106,12 @@ public interface BPlanEnterpriseMapper extends BaseMapper { */ void updateIdList(String[] idList); + + /** + * 新增 + * @param bPlanEnterprise + */ + void insertPlan(BPlanEnterpriseRequest bPlanEnterprise); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java index 8381714..55e3aeb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java @@ -101,5 +101,11 @@ public interface BPlanEnterpriseService extends IService { */ void updateIdList(String[] idList); + + /** + * 新增 + * @param bPlanEnterprise + */ + void insert(BPlanEnterpriseRequest bPlanEnterprise); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BEnterpriseNewServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BEnterpriseNewServiceImpl.java index 7372b8e..3d59560 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BEnterpriseNewServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BEnterpriseNewServiceImpl.java @@ -40,7 +40,7 @@ public class BEnterpriseNewServiceImpl implements IBEnterpriseNewService { */ @Override public List selectBEnterpriseNewList(BEnterpriseNew bEnterpriseNew) { - bEnterpriseNew.setDistrict(SecurityUtils.getLoginUser().getUser().getPermissionCode()); + return bEnterpriseNewMapper.selectBEnterpriseNewList(bEnterpriseNew); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java index 90bd4e6..ebcee76 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java @@ -41,7 +41,7 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise) { - bPlanEnterprise.setDistrict(SecurityUtils.getLoginUser().getUser().getPermissionCode()); + return bPlanEnterpriseMapper.selectBPlanEnterpriseList(bPlanEnterprise); } @@ -106,6 +106,11 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl +