修改新增计划企业

zhangtao
dongdingding 1 year ago
parent 963a0fd061
commit 2c39c6cfab

@ -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();
}

@ -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;
/**
* 12
*/
@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;
}

@ -106,5 +106,12 @@ public interface BPlanEnterpriseMapper extends BaseMapper<BPlanEnterprise> {
*/
void updateIdList(String[] idList);
/**
*
* @param bPlanEnterprise
*/
void insertPlan(BPlanEnterpriseRequest bPlanEnterprise);
}

@ -101,5 +101,11 @@ public interface BPlanEnterpriseService extends IService<BPlanEnterprise> {
*/
void updateIdList(String[] idList);
/**
*
* @param bPlanEnterprise
*/
void insert(BPlanEnterpriseRequest bPlanEnterprise);
}

@ -40,7 +40,7 @@ public class BEnterpriseNewServiceImpl implements IBEnterpriseNewService {
*/
@Override
public List<BEnterpriseNew> selectBEnterpriseNewList(BEnterpriseNew bEnterpriseNew) {
bEnterpriseNew.setDistrict(SecurityUtils.getLoginUser().getUser().getPermissionCode());
return bEnterpriseNewMapper.selectBEnterpriseNewList(bEnterpriseNew);
}

@ -41,7 +41,7 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl<BPlanEnterpriseMappe
*/
@Override
public List<BPlanEnterpriseResponse> selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise) {
bPlanEnterprise.setDistrict(SecurityUtils.getLoginUser().getUser().getPermissionCode());
return bPlanEnterpriseMapper.selectBPlanEnterpriseList(bPlanEnterprise);
}
@ -106,6 +106,11 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl<BPlanEnterpriseMappe
bPlanEnterpriseMapper.updateIdList(idList);
}
@Override
public void insert(BPlanEnterpriseRequest bPlanEnterprise) {
bPlanEnterpriseMapper.insertPlan(bPlanEnterprise);
}
}

@ -34,6 +34,7 @@
</sql>
<select id="selectBPlanEnterpriseList" parameterType="BPlanEnterprise" resultType="BPlanEnterpriseResponse">
SELECT
a.id,
@ -315,4 +316,52 @@
</update>
<insert id="insertPlan" parameterType="BPlanEnterpriseRequest" useGeneratedKeys="true" keyProperty="id">
insert into b_plan_enterprise
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="enterpriseId != null">enterprise_id,</if>
<if test="district != null">district,</if>
<if test="plannedYear != null">planned_year,</if>
<if test="isPoint != null">is_point,</if>
<if test="enterpriseName != null">enterprise_name,</if>
<if test="lawSort != null">law_sort,</if>
<if test="lawAreas != null">law_areas,</if>
<if test="lawLevel != null">law_level,</if>
<if test="lawHierarchy != null">law_hierarchy,</if>
<if test="plannedMonth != null">planned_month,</if>
<if test="status != null">status,</if>
<if test="createId != null">create_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateId != null">update_id,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="userId != null">user_id,</if>
<if test="deptId != null">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="enterpriseId != null">#{enterpriseId},</if>
<if test="district != null">#{district},</if>
<if test="plannedYear != null">#{plannedYear},</if>
<if test="isPoint != null">#{isPoint},</if>
<if test="enterpriseName != null">#{enterpriseName},</if>
<if test="lawSort != null">#{lawSort},</if>
<if test="lawAreas != null">#{lawAreas},</if>
<if test="lawLevel != null">#{lawLevel}, </if>
<if test="lawHierarchy != null">#{lawHierarchy},</if>
<if test="plannedMonth != null">#{plannedMonth},</if>
<if test="status != null">#{status},</if>
<if test="createId != null">create_id,</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateId != null">#{updateId},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if>
</trim>
</insert>
</mapper>
Loading…
Cancel
Save