|
|
|
@ -3,12 +3,16 @@ package com.ruoyi.programManagement.controller;
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
|
import com.ruoyi.programManagement.entity.BAdministrative;
|
|
|
|
|
import com.ruoyi.programManagement.entity.BKeyEnterprise;
|
|
|
|
|
import com.ruoyi.programManagement.entity.BPlanEnterprise;
|
|
|
|
|
import com.ruoyi.programManagement.entity.BPlanManage;
|
|
|
|
|
import com.ruoyi.programManagement.entity.request.BPlanManageAddRequest;
|
|
|
|
|
import com.ruoyi.programManagement.entity.request.checkResultRequest;
|
|
|
|
|
import com.ruoyi.programManagement.entity.response.BPlanManagePageResponse;
|
|
|
|
|
import com.ruoyi.programManagement.entity.response.BPlanManageResponse;
|
|
|
|
|
import com.ruoyi.programManagement.service.BKeyEnterpriseService;
|
|
|
|
|
import com.ruoyi.programManagement.service.BPlanEnterpriseService;
|
|
|
|
|
import com.ruoyi.programManagement.service.BPlanManageService;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
@ -18,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -41,6 +46,9 @@ public class BPlanManageController extends BaseController {
|
|
|
|
|
@Resource
|
|
|
|
|
private BPlanEnterpriseService bPlanEnterpriseService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private BKeyEnterpriseService bKeyEnterpriseService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分页条件查询所有数据
|
|
|
|
|
*
|
|
|
|
@ -76,6 +84,8 @@ public class BPlanManageController extends BaseController {
|
|
|
|
|
public AjaxResult insert(@RequestBody BPlanManageAddRequest bPlanManageAddRequest) {
|
|
|
|
|
BPlanManage bPlanManage = new BPlanManage();
|
|
|
|
|
BeanUtils.copyProperties(bPlanManageAddRequest, bPlanManage);
|
|
|
|
|
bPlanManage.setCreateId(getUserId());
|
|
|
|
|
bPlanManage.setDeptId(getDeptId());
|
|
|
|
|
//新增计划管理
|
|
|
|
|
bPlanManageService.save(bPlanManage);
|
|
|
|
|
//新增企业 获取企业id和计划id
|
|
|
|
@ -88,9 +98,18 @@ public class BPlanManageController extends BaseController {
|
|
|
|
|
String[] districtArray = district.split(",");
|
|
|
|
|
int i = 0;
|
|
|
|
|
for (String entId : idArray) {
|
|
|
|
|
//根据企业id查询重点企业表是 1:重点企业 ,2:非重点企业
|
|
|
|
|
BKeyEnterprise count = bKeyEnterpriseService.getByentCode(entId);
|
|
|
|
|
if (count != null) {
|
|
|
|
|
bPlanEnterprise.setIsPoint(1);
|
|
|
|
|
}else{
|
|
|
|
|
bPlanEnterprise.setIsPoint(2);
|
|
|
|
|
}
|
|
|
|
|
bPlanEnterprise.setPlanId(id);
|
|
|
|
|
bPlanEnterprise.setId(null);
|
|
|
|
|
bPlanEnterprise.setEnterpriseId(entId);
|
|
|
|
|
bPlanEnterprise.setCreateId(getUserId());
|
|
|
|
|
bPlanEnterprise.setDeptId(getDeptId());
|
|
|
|
|
bPlanEnterprise.setDistrict(districtArray[i]);
|
|
|
|
|
bPlanEnterpriseService.save(bPlanEnterprise);
|
|
|
|
|
i += 1;
|
|
|
|
@ -123,11 +142,21 @@ public class BPlanManageController extends BaseController {
|
|
|
|
|
//获取逗号分隔的id
|
|
|
|
|
String[] eidArray = enterPriseId.split(",");
|
|
|
|
|
for (String entId : eidArray) {
|
|
|
|
|
//根据企业id查询重点企业表是 1:重点企业 ,2:非重点企业
|
|
|
|
|
BKeyEnterprise count = bKeyEnterpriseService.getByentCode(entId);
|
|
|
|
|
if (count != null) {
|
|
|
|
|
bPlanEnterprise.setIsPoint(1);
|
|
|
|
|
}else{
|
|
|
|
|
bPlanEnterprise.setIsPoint(2);
|
|
|
|
|
}
|
|
|
|
|
bPlanEnterprise.setPlanId(id);
|
|
|
|
|
bPlanEnterprise.setId(null);
|
|
|
|
|
bPlanEnterprise.setEnterpriseId(entId);
|
|
|
|
|
bPlanEnterprise.setCreateId(getUserId());
|
|
|
|
|
bPlanEnterprise.setDeptId(getDeptId());
|
|
|
|
|
bPlanEnterpriseService.save(bPlanEnterprise);
|
|
|
|
|
}
|
|
|
|
|
bPlanManage.setUpdateId(getDeptId());
|
|
|
|
|
return success(bPlanManageService.updateById(bPlanManage));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -149,6 +178,16 @@ public class BPlanManageController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 导出计划管理
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "导出计划管理")
|
|
|
|
|
@PostMapping("/export")
|
|
|
|
|
public void export(HttpServletResponse response, BPlanManage bPlanManage) {
|
|
|
|
|
List<BPlanManage> list = bPlanManageService.selectBybPlanManage(bPlanManage);
|
|
|
|
|
ExcelUtil<BPlanManage> util = new ExcelUtil<BPlanManage>(BPlanManage.class);
|
|
|
|
|
util.exportExcel(response, list, "导出计划管理");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|