首页接口修改

zhangtao
dongdingding 1 year ago
parent 0251f076d6
commit 17ca84cfcc

@ -8,6 +8,7 @@ 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.*;
import com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse;
import com.ruoyi.programManagement.entity.response.BPlanEnterpriseZhifaResponse;
import com.ruoyi.programManagement.mapper.BPlanEnterpriseMapper;
import com.ruoyi.programManagement.service.BKeyEnterpriseService;
@ -23,8 +24,6 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
/**
@ -66,17 +65,17 @@ public class BPlanEnterpriseController extends BaseController {
@GetMapping("/list")
public AjaxResult list(BPlanEnterprise bPlanEnterprise) {
List<BPlanEnterprise> list = bPlanEnterpriseService.selectBPlanEnterpriseList(bPlanEnterprise);
for (BPlanEnterprise a : list) {
String enterPriseId = String.valueOf(a.getEnterpriseId());
BKeyEnterprise count = bKeyEnterpriseService.getByentCode(enterPriseId);
if (count != null) {
a.setIsPoint(1);
} else {
a.setIsPoint(2);
}
bPlanEnterpriseService.updateById(a);
}
// for (BPlanEnterprise a : list) {
// String enterPriseId = String.valueOf(a.getEnterpriseId());
// BKeyEnterprise count = bKeyEnterpriseService.getByentCode(enterPriseId);
// if (count != null) {
// a.setIsPoint(1);
// } else {
// a.setIsPoint(2);
// }
//
// bPlanEnterpriseService.updateById(a);
// }
return AjaxResult.success(list);
}
@ -86,53 +85,9 @@ public class BPlanEnterpriseController extends BaseController {
@ApiOperation(value = "查询首页", response = BPlanEnterPriseTreeResponse.class)
@GetMapping("/tree")
public AjaxResult tree(BPlanEnterprisePageRequest req) {
//区划list
List<BPlanEnterPrisetDistrictRequest> list = bAdministrativeDivisionService.selectByEnterPrisecountyList();
//乡镇list
List<BPlanEnterPriseTreeRequest> listsub = bAdministrativeDivisionService.selectByEnterPriseList();
List<BPlanEnterPrisetDistrictRequest> cascadingSelectData = new ArrayList<>();
DecimalFormat decimalFormat = new DecimalFormat("0.00");
for (BPlanEnterPrisetDistrictRequest item1 : list) {
req.setCode(item1.getDistrictCode());
//获取计划企业数量
Integer getEnterPriseCounty=bPlanEnterpriseService.getgetEnterPriseList(req);
//获取完成执法数量
Integer getEnterPriseFinsh=bPlanEnterpriseService.getEnterPriseFinsh(req);
//完成率
double result1 = (double) getEnterPriseFinsh / getEnterPriseCounty;
if(getEnterPriseFinsh.equals(0)||getEnterPriseCounty.equals(0)){
result1=0;
}
if(!getEnterPriseFinsh.equals(0)){
getEnterPriseFinsh=getEnterPriseFinsh-1;
}
if(!getEnterPriseCounty.equals(0)){
getEnterPriseCounty=getEnterPriseCounty-1;
}
String formattedResult1 = decimalFormat.format(result1);
BPlanEnterPrisetDistrictRequest parentDto = new BPlanEnterPrisetDistrictRequest(item1.getDistrictCode(),item1.getDistrict(),getEnterPriseCounty,getEnterPriseFinsh,formattedResult1);
for (BPlanEnterPriseTreeRequest item2 : listsub) {
if (item2.getCountyCode() != null && !item2.getCountyCode().equals("")) {
if (item2.getCountyCode().substring(0,6).equals(item1.getDistrictCode())) {
req.setCode(item2.getCountyCode());
//获取计划企业数量
Integer getEnterPriseTown=bPlanEnterpriseService.getgetEnterPriseList(req);
//获取完成执法数量
Integer getEnterPriseTownFinsh=bPlanEnterpriseService.getEnterPriseFinsh(req);
//完成率
double result2 = (double) getEnterPriseTownFinsh / getEnterPriseTown;
if(getEnterPriseTown.equals(0)||getEnterPriseTownFinsh.equals(0)){
result2=0;
}
String formattedResult2 = decimalFormat.format(result2);
BPlanEnterPriseTreeRequest childDto = new BPlanEnterPriseTreeRequest(item2.getCounty(), item2.getCountyCode(),item2.getSort(),getEnterPriseTown,getEnterPriseTownFinsh,formattedResult2);
parentDto.addChild(childDto);
}
}
}
cascadingSelectData.add(parentDto);
}
return success(cascadingSelectData);
return success(bPlanEnterpriseService.getShouyeList(req));
}

@ -112,20 +112,7 @@ public class BPlanEnterprise implements Serializable {
@Excel(name = "计划年份")
private String plannedYear;
/**
*
*/
@ApiModelProperty(value = "计划标题")
@Excel(name = "计划标题")
private String planName;
/**
*
*/
@ApiModelProperty(value = "计划内容")
@Excel(name = "计划内容")
private String planContent;
/**
@ -189,7 +176,7 @@ public class BPlanEnterprise implements Serializable {
* 0稿 1
*/
@ApiModelProperty(value = "0草稿 1正式")
private Integer status;
private Integer status =0;
/**
@ -212,5 +199,6 @@ public class BPlanEnterprise implements Serializable {
@ApiModelProperty(value = "1当月 2提前 3滞后")
private Integer checkAgeing;
}

@ -1,69 +0,0 @@
package com.ruoyi.programManagement.entity.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
*/
@ApiModel
@Data
@Builder(toBuilder = true)
@NoArgsConstructor
public class BPlanEnterPriseTreeRequest {
/**
*
*
*/
@ApiModelProperty("所在乡镇")
private String county;
/**
*
*/
@ApiModelProperty("所在乡镇(街道)代码")
private String countyCode;
/**
*
*/
@ApiModelProperty("排序")
private String sort;
/**
*
*/
@ApiModelProperty("计划企业数量")
private Integer enterPriseCounty;
/**
*
*/
@ApiModelProperty("计划企业完成数量")
private Integer enterPriseFinsh;
/**
*
*/
@ApiModelProperty("完成率")
private String result;
public BPlanEnterPriseTreeRequest(String county, String countyCode, String sort, Integer enterPriseCounty, Integer enterPriseFinsh,String result) {
this.county = county;
this.countyCode = countyCode;
this.enterPriseCounty = enterPriseCounty;
this.enterPriseFinsh = enterPriseFinsh;
this.result=result;
this.sort = sort;
}
}

@ -1,57 +0,0 @@
package com.ruoyi.programManagement.entity.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
*
*/
@Data
@ApiModel("首页请求类")
public class BPlanEnterPriseTreeResponse {
/**
*
*/
@ApiModelProperty("所在县(市,区)")
private String institutionName;
/**
*
*/
@ApiModelProperty("执法计划数量")
private Integer plannedEnterpriseCount;
/**
*
*/
@ApiModelProperty("完成执法数量")
private Integer checkEnterpriseCount;
/**
*
*/
@ApiModelProperty("百分比")
private double pt;
// private List<BPlanEnterPriseTreeResponse> children;
//
//
// public BPlanEnterPriseTreeResponse(String county, String subdistrict) {
// this.county = county;
// this.subdistrict = subdistrict;
// this.children = new ArrayList<>();
// }
//
// public void addChild(BPlanEnterPriseTreeResponse childDto) {
// this.children.add(childDto);
// }
}

@ -1,67 +0,0 @@
package com.ruoyi.programManagement.entity.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.ArrayList;
import java.util.List;
@ApiModel
@Data
@Builder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
public class BPlanEnterPrisetDistrictRequest {
/**
*
*/
@ApiModelProperty("区划代码")
private String districtCode;
/**
*
*/
@ApiModelProperty("区划")
private String district;
/**
*
*/
@ApiModelProperty("计划企业数量")
private Integer enterPriseCounty;
/**
*
*/
@ApiModelProperty("计划企业完成数量")
private Integer enterPriseFinsh;
/**
*
*/
@ApiModelProperty("完成率")
private String result;
private List<BPlanEnterPriseTreeRequest> children;
public BPlanEnterPrisetDistrictRequest(String districtCode, String district, Integer enterPriseCounty, Integer enterPriseFinsh,String result) {
this.districtCode = districtCode;
this.enterPriseCounty = enterPriseCounty;
this.enterPriseFinsh = enterPriseFinsh;
this.district = district;
this.result=result;
this.children = new ArrayList<>();
}
public void addChild(BPlanEnterPriseTreeRequest childDto) {
this.children.add(childDto);
}
}

@ -26,9 +26,13 @@ public class BPlanEnterprisePageRequest {
/**
*
*
*/
@ApiModelProperty(value = "区划代码")
private String code;
@ApiModelProperty(value = "执法地区")
private String lawAreas;
}

@ -0,0 +1,46 @@
package com.ruoyi.programManagement.entity.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@Data
@ApiModel("首页请求类")
public class BPlanEnterPriseTreeResponse {
/**
*
*/
@ApiModelProperty(value = "执法地区")
private String lawAreas;
/**
*
*/
@ApiModelProperty(value = "排序")
private String sort;
/**
*
*/
@ApiModelProperty("执法计划数量")
private Integer count;
/**
*
*/
@ApiModelProperty("完成执法数量")
private Integer completed;
/**
*
*/
@ApiModelProperty("百分比")
private double completionRate;
}

@ -5,8 +5,6 @@ import java.util.List;
import com.ruoyi.programManagement.domain.BAdministrativeDivision;
import com.ruoyi.programManagement.entity.request.BAdministrativeDistrictRequest;
import com.ruoyi.programManagement.entity.request.BAdministrativeTreeRequest;
import com.ruoyi.programManagement.entity.request.BPlanEnterPriseTreeRequest;
import com.ruoyi.programManagement.entity.request.BPlanEnterPrisetDistrictRequest;
/**
* Mapper
@ -81,19 +79,9 @@ public interface BAdministrativeDivisionMapper {
/**
*
*
* @return list
*/
List<BPlanEnterPrisetDistrictRequest> selectByEnterPrisecountyList();
/**
*
*
* @return list
*/
List<BPlanEnterPriseTreeRequest> selectByEnterPriseList();
}

@ -2,7 +2,7 @@ package com.ruoyi.programManagement.mapper;
import com.ruoyi.programManagement.entity.BAdministrative;
import com.ruoyi.programManagement.entity.request.BAdministrativeTreeRequest;
import com.ruoyi.programManagement.entity.request.BPlanEnterPriseTreeResponse;
import com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse;
import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest;
import org.apache.ibatis.annotations.Param;

@ -2,14 +2,8 @@ package com.ruoyi.programManagement.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.programManagement.entity.BPlanEnterprise;
import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest;
import com.ruoyi.programManagement.entity.request.PlanMxRequest;
import com.ruoyi.programManagement.entity.request.checkResultRequest;
import com.ruoyi.programManagement.entity.request.zhifaRequest;
import com.ruoyi.programManagement.entity.response.BPlanEnterpriseZhifaResponse;
import com.ruoyi.programManagement.entity.response.PlanMxResponse;
import com.ruoyi.programManagement.entity.response.zhifaCountResponse;
import com.ruoyi.programManagement.entity.response.zhifaPlanResponse;
import com.ruoyi.programManagement.entity.request.*;
import com.ruoyi.programManagement.entity.response.*;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -86,21 +80,19 @@ public interface BPlanEnterpriseMapper extends BaseMapper<BPlanEnterprise> {
/**
*
*
*
* @param req
* @return
*/
Integer getgetEnterPriseList(@Param("req") BPlanEnterprisePageRequest req);
List<BPlanEnterPriseTreeResponse> getShouyeList(@Param("req")BPlanEnterprisePageRequest req);
/**
*
*
*
* @param req
* @return
*/
Integer getEnterPriseFinsh( @Param("req") BPlanEnterprisePageRequest req);
List<BPlanEnterPriseTreeResponse>getShouYeMxList(@Param("req") BPlanEnterprisePageRequest req);
}

@ -50,75 +50,75 @@ public class EnterpristQuartz {
@ApiOperation(value = "定时任务")
public AjaxResult updateInformationData() {
// 查询szs_enterprise_informa tion表中的数据
List<SzsEnterpriseInformation> enterpriseInformationList = szsEnterpriseInformationMapper.selectSzsEnterpriseInformationList(null);
// 遍历数据并更新到b_enterprise_new表中
List<String> szsList = new ArrayList<>();
for (SzsEnterpriseInformation enterpriseInformation : enterpriseInformationList) {
BEnterpriseNew enterpriseNew = new BEnterpriseNew();
enterpriseNew.setEnterpriseId(enterpriseInformation.getUuitNo());
enterpriseNew.setEnterpriseName(enterpriseInformation.getEnterpriseName());
enterpriseNew.setDistrict(enterpriseInformation.getSubdistrict());
enterpriseNew.setSupervisionLarge(enterpriseInformation.getSupervisionLarge());
// 根据enterpriseId判断数据是否已存在
QueryWrapper<BEnterpriseNew> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("enterprise_id", enterpriseInformation.getUuitNo());
//获取enterpriseName
szsList.add(enterpriseNew.getEnterpriseName());
Long count = bEnterpriseNewMapper.selectCount(queryWrapper);
if (count > 0) {
// 更新数据
bEnterpriseNewMapper.updateBEnterpriseNew(enterpriseNew);
} else {
// 插入数据
bEnterpriseNewMapper.insertBEnterpriseNew(enterpriseNew);
}
}
// 查询b_enterprise_new表中的所有企业名称
List<BEnterpriseNew> enterpriseList = bEnterpriseNewMapper.selectBEnterpriseNewList(null);
// 查询b_standardization表中的所有企业名称
List<BStandardization> standardizationList = bStandardizationMapper.selectBStandardizationList(null);
//更新b_enterprise_new表中匹配的企业的STAND_LEVEL字段
for (BEnterpriseNew enterprise : enterpriseList) {
for (BStandardization standardization : standardizationList) {
if (enterprise.getEnterpriseName().equals(standardization.getEnterpriseName())) {
// 执行更新操作,例如:
enterprise.setStandLevel(standardization.getStandardizedGrade());
bEnterpriseNewMapper.updateBEnterpriseNew(enterprise);
} else {
enterprise.setStandLevel("/");
bEnterpriseNewMapper.updateBEnterpriseNew(enterprise);
}
}
}
// 找出在b_standardization表中存在但在b_enterprise_new表中不存在的企业名称
List<BStandardization> notInEnterpriseNew = new ArrayList<>();
for (BStandardization standardization : standardizationList) {
boolean found = false;
for (BEnterpriseNew enterprise : enterpriseList) {
if (enterprise.getEnterpriseName().equals(standardization.getEnterpriseName())) {
found = true;
break;
}
}
if (!found) {
BStandardization b = new BStandardization();
b.setStandardizedGrade(standardization.getStandardizedGrade());
b.setEnterpriseName(standardization.getEnterpriseName());
notInEnterpriseNew.add(b);
}
// List<SzsEnterpriseInformation> enterpriseInformationList = szsEnterpriseInformationMapper.selectSzsEnterpriseInformationList(null);
// // 遍历数据并更新到b_enterprise_new表中
// List<String> szsList = new ArrayList<>();
// for (SzsEnterpriseInformation enterpriseInformation : enterpriseInformationList) {
// BEnterpriseNew enterpriseNew = new BEnterpriseNew();
// enterpriseNew.setEnterpriseId(enterpriseInformation.getUuitNo());
// enterpriseNew.setEnterpriseName(enterpriseInformation.getEnterpriseName());
// enterpriseNew.setDistrict(enterpriseInformation.getSubdistrict());
// enterpriseNew.setSupervisionLarge(enterpriseInformation.getSupervisionLarge());
// // 根据enterpriseId判断数据是否已存在
// QueryWrapper<BEnterpriseNew> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("enterprise_id", enterpriseInformation.getUuitNo());
// //获取enterpriseName
// szsList.add(enterpriseNew.getEnterpriseName());
// Long count = bEnterpriseNewMapper.selectCount(queryWrapper);
// if (count > 0) {
// // 更新数据
// bEnterpriseNewMapper.updateBEnterpriseNew(enterpriseNew);
// } else {
// // 插入数据
// bEnterpriseNewMapper.insertBEnterpriseNew(enterpriseNew);
// }
// }
// // 查询b_enterprise_new表中的所有企业名称
// List<BEnterpriseNew> enterpriseList = bEnterpriseNewMapper.selectBEnterpriseNewList(null);
// // 查询b_standardization表中的所有企业名称
// List<BStandardization> standardizationList = bStandardizationMapper.selectBStandardizationList(null);
// //更新b_enterprise_new表中匹配的企业的STAND_LEVEL字段
// for (BEnterpriseNew enterprise : enterpriseList) {
// for (BStandardization standardization : standardizationList) {
// if (enterprise.getEnterpriseName().equals(standardization.getEnterpriseName())) {
// // 执行更新操作,例如:
// enterprise.setStandLevel(standardization.getStandardizedGrade());
// bEnterpriseNewMapper.updateBEnterpriseNew(enterprise);
// } else {
// enterprise.setStandLevel("/");
// bEnterpriseNewMapper.updateBEnterpriseNew(enterprise);
// }
// }
// }
// // 找出在b_standardization表中存在但在b_enterprise_new表中不存在的企业名称
// List<BStandardization> notInEnterpriseNew = new ArrayList<>();
// for (BStandardization standardization : standardizationList) {
// boolean found = false;
// for (BEnterpriseNew enterprise : enterpriseList) {
// if (enterprise.getEnterpriseName().equals(standardization.getEnterpriseName())) {
// found = true;
// break;
// }
// }
// if (!found) {
// BStandardization b = new BStandardization();
// b.setStandardizedGrade(standardization.getStandardizedGrade());
// b.setEnterpriseName(standardization.getEnterpriseName());
// notInEnterpriseNew.add(b);
// }
}
// 查询b_enterprise_new表中的所有企业名称 更新检查时间
for (BEnterpriseNew a : enterpriseList) {
BEnterpriseNew bEnterpriseNew = new BEnterpriseNew();
List<SzEnforExamine> szEnforExamineList = szEnforExamineService.getByEnterPriseCode(a.getEnterpriseId());
for (SzEnforExamine b:szEnforExamineList) {
bEnterpriseNew.setId(a.getId());
bEnterpriseNew.setExamineEndTime(b.getExamineEndTime());
bEnterpriseNewMapper.updateBEnterpriseNew(bEnterpriseNew);
}
}
return AjaxResult.success(notInEnterpriseNew);
// }
// // 查询b_enterprise_new表中的所有企业名称 更新检查时间
// for (BEnterpriseNew a : enterpriseList) {
// BEnterpriseNew bEnterpriseNew = new BEnterpriseNew();
// List<SzEnforExamine> szEnforExamineList = szEnforExamineService.getByEnterPriseCode(a.getEnterpriseId());
// for (SzEnforExamine b:szEnforExamineList) {
// bEnterpriseNew.setId(a.getId());
// bEnterpriseNew.setExamineEndTime(b.getExamineEndTime());
// bEnterpriseNewMapper.updateBEnterpriseNew(bEnterpriseNew);
// }
// }
return AjaxResult.success(null);
}

@ -1,14 +1,10 @@
package com.ruoyi.programManagement.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.ruoyi.programManagement.entity.BPlanEnterprise;
import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest;
import com.ruoyi.programManagement.entity.request.PlanMxRequest;
import com.ruoyi.programManagement.entity.request.checkResultRequest;
import com.ruoyi.programManagement.entity.request.zhifaRequest;
import com.ruoyi.programManagement.entity.request.*;
import com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse;
import com.ruoyi.programManagement.entity.response.BPlanEnterpriseZhifaResponse;
import com.ruoyi.programManagement.entity.response.zhifaCountResponse;
import com.ruoyi.programManagement.entity.response.zhifaPlanResponse;
import java.util.List;
@ -91,19 +87,11 @@ public interface BPlanEnterpriseService extends IService<BPlanEnterprise> {
/**
*
*
* @param req
* @return
*/
Integer getgetEnterPriseList(BPlanEnterprisePageRequest req);
/**
*
* @param req
* @return
*/
Integer getEnterPriseFinsh(BPlanEnterprisePageRequest req);
List<BPlanEnterPriseTreeResponse> getShouyeList(BPlanEnterprisePageRequest req);
}

@ -3,8 +3,6 @@ package com.ruoyi.programManagement.service;
import com.ruoyi.programManagement.domain.BAdministrativeDivision;
import com.ruoyi.programManagement.entity.request.BAdministrativeDistrictRequest;
import com.ruoyi.programManagement.entity.request.BAdministrativeTreeRequest;
import com.ruoyi.programManagement.entity.request.BPlanEnterPriseTreeRequest;
import com.ruoyi.programManagement.entity.request.BPlanEnterPrisetDistrictRequest;
import java.util.List;
@ -79,21 +77,10 @@ public interface IBAdministrativeDivisionService {
List<BAdministrativeDistrictRequest> selectBycountyList();
/**
*
*
* @return list
*/
List<BPlanEnterPrisetDistrictRequest> selectByEnterPrisecountyList();
/**
*
*
* @return list
*/
List<BPlanEnterPriseTreeRequest> selectByEnterPriseList();
}

@ -1,7 +1,7 @@
package com.ruoyi.programManagement.service;
import com.ruoyi.programManagement.entity.BAdministrative;
import com.ruoyi.programManagement.entity.request.BPlanEnterPriseTreeResponse;
import com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse;
import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest;
import java.util.List;

@ -4,8 +4,6 @@ import java.util.List;
import com.ruoyi.programManagement.entity.request.BAdministrativeDistrictRequest;
import com.ruoyi.programManagement.entity.request.BAdministrativeTreeRequest;
import com.ruoyi.programManagement.entity.request.BPlanEnterPriseTreeRequest;
import com.ruoyi.programManagement.entity.request.BPlanEnterPrisetDistrictRequest;
import org.springframework.stereotype.Service;
import com.ruoyi.programManagement.mapper.BAdministrativeDivisionMapper;
import com.ruoyi.programManagement.domain.BAdministrativeDivision;
@ -100,14 +98,5 @@ public class BAdministrativeDivisionServiceImpl implements IBAdministrativeDivis
}
@Override
public List<BPlanEnterPrisetDistrictRequest> selectByEnterPrisecountyList() {
return bAdministrativeDivisionMapper.selectByEnterPrisecountyList();
}
@Override
public List<BPlanEnterPriseTreeRequest> selectByEnterPriseList() {
return bAdministrativeDivisionMapper.selectByEnterPriseList();
}
}

@ -2,8 +2,7 @@ package com.ruoyi.programManagement.service.impl;
import com.ruoyi.programManagement.entity.BAdministrative;
import com.ruoyi.programManagement.entity.request.BAdministrativeTreeRequest;
import com.ruoyi.programManagement.entity.request.BPlanEnterPriseTreeResponse;
import com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse;
import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest;
import com.ruoyi.programManagement.mapper.BAdministrativeMapper;
import com.ruoyi.programManagement.service.IBAdministrativeService;

@ -4,19 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.programManagement.entity.BPlanEnterprise;
import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest;
import com.ruoyi.programManagement.entity.request.PlanMxRequest;
import com.ruoyi.programManagement.entity.request.checkResultRequest;
import com.ruoyi.programManagement.entity.request.zhifaRequest;
import com.ruoyi.programManagement.entity.response.BPlanEnterpriseZhifaResponse;
import com.ruoyi.programManagement.entity.response.PlanMxResponse;
import com.ruoyi.programManagement.entity.response.zhifaCountResponse;
import com.ruoyi.programManagement.entity.response.zhifaPlanResponse;
import com.ruoyi.programManagement.entity.request.*;
import com.ruoyi.programManagement.entity.response.*;
import com.ruoyi.programManagement.mapper.BPlanEnterpriseMapper;
import com.ruoyi.programManagement.service.BPlanEnterpriseService;
import io.swagger.models.auth.In;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.HashMap;
@ -47,8 +39,7 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl<BPlanEnterpriseMappe
* @return
*/
@Override
public List<BPlanEnterprise> selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise)
{
public List<BPlanEnterprise> selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise) {
return bPlanEnterpriseMapper.selectBPlanEnterpriseList(bPlanEnterprise);
}
@ -68,7 +59,7 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl<BPlanEnterpriseMappe
}
@Override
public Map<String,Object> getzhifacount(zhifaRequest req) {
public Map<String, Object> getzhifacount(zhifaRequest req) {
List<zhifaCountResponse> getZhifa = bPlanEnterpriseMapper.getzhifacount(req);
PageHelper.startPage(req.getPageNum(), req.getPageSize());
PageInfo<zhifaCountResponse> pageInfo = new PageInfo<>(getZhifa);
@ -81,7 +72,6 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl<BPlanEnterpriseMappe
}
@Override
public List<zhifaPlanResponse> getplan() {
return bPlanEnterpriseMapper.getplan();
@ -104,13 +94,14 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl<BPlanEnterpriseMappe
}
@Override
public Integer getgetEnterPriseList(BPlanEnterprisePageRequest req) {
return bPlanEnterpriseMapper.getgetEnterPriseList(req);
public List<BPlanEnterPriseTreeResponse> getShouyeList(BPlanEnterprisePageRequest req) {
List<BPlanEnterPriseTreeResponse> list = null;
if (req.getLawAreas() != null) {
list=bPlanEnterpriseMapper.getShouYeMxList(req);
} else {
list = bPlanEnterpriseMapper.getShouyeList(req);
}
@Override
public Integer getEnterPriseFinsh(BPlanEnterprisePageRequest req) {
return bPlanEnterpriseMapper.getEnterPriseFinsh(req);
return list;
}

@ -45,17 +45,7 @@
from b_administrative_division
group by districtCode,district
</select>
<select id="selectByEnterPrisecountyList"
resultType="com.ruoyi.programManagement.entity.request.BPlanEnterPrisetDistrictRequest">
select district_code as districtCode,district
from b_administrative_division
group by districtCode,district
</select>
<select id="selectByEnterPriseList"
resultType="com.ruoyi.programManagement.entity.request.BPlanEnterPriseTreeRequest">
select county_code as countyCode, county, sort
from b_administrative_division
</select>
<insert id="insertBAdministrativeDivision" parameterType="BAdministrativeDivision" useGeneratedKeys="true"
keyProperty="id">

@ -50,7 +50,7 @@
from b_administrative
</select>
<select id="selectBPlanEnterPriseTreeRequestRequestList"
resultType="com.ruoyi.programManagement.entity.request.BPlanEnterPriseTreeResponse">
resultType="com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse">
SELECT
s.institutionName,

@ -1,47 +1,68 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.programManagement.mapper.BEnterpriseNewMapper">
<resultMap type="BEnterpriseNew" id="BEnterpriseNewResult">
<result property="id" column="id" />
<result property="enterpriseId" column="enterprise_id" />
<result property="enterpriseName" column="enterprise_name" />
<result property="district" column="district" />
<result property="supervisionLarge" column="SUPERVISION_LARGE" />
<result property="riskLevel" column="RISK_LEVEL" />
<result property="standLevel" column="STAND_LEVEL" />
<result property="examineEndTime" column="EXAMINE_END_TIME" />
<result property="createId" column="create_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateId" column="update_id" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="userId" column="user_id" />
<result property="deptId" column="dept_id" />
<result property="id" column="id"/>
<result property="enterpriseId" column="enterprise_id"/>
<result property="enterpriseName" column="enterprise_name"/>
<result property="district" column="district"/>
<result property="supervisionLarge" column="SUPERVISION_LARGE"/>
<result property="riskLevel" column="RISK_LEVEL"/>
<result property="standLevel" column="STAND_LEVEL"/>
<result property="examineEndTime" column="EXAMINE_END_TIME"/>
<result property="createId" column="create_id"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateId" column="update_id"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<result property="userId" column="user_id"/>
<result property="deptId" column="dept_id"/>
</resultMap>
<sql id="selectBEnterpriseNewVo">
select id, enterprise_id, enterprise_name, district, SUPERVISION_LARGE, RISK_LEVEL, STAND_LEVEL, EXAMINE_END_TIME, create_id, create_by, create_time, update_id, update_by, update_time, remark, user_id, dept_id from b_enterprise_new
select id,
enterprise_id,
enterprise_name,
district,
SUPERVISION_LARGE,
RISK_LEVEL,
STAND_LEVEL,
EXAMINE_END_TIME,
create_id,
create_by,
create_time,
update_id,
update_by,
update_time,
remark,
user_id,
dept_id
from b_enterprise_new
</sql>
<select id="selectBEnterpriseNewList" parameterType="BEnterpriseNew" resultMap="BEnterpriseNewResult">
<include refid="selectBEnterpriseNewVo"/>
<where>
<if test="enterpriseId != null and enterpriseId != ''"> and enterprise_id = #{enterpriseId}</if>
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="district != null and district != ''"> and district = #{district}</if>
<if test="supervisionLarge != null and supervisionLarge != ''"> and SUPERVISION_LARGE = #{supervisionLarge}</if>
<if test="riskLevel != null and riskLevel != ''"> and RISK_LEVEL = #{riskLevel}</if>
<if test="standLevel != null and standLevel != ''"> and STAND_LEVEL = #{standLevel}</if>
<if test="examineEndTime != null "> and EXAMINE_END_TIME = #{examineEndTime}</if>
<if test="createId != null "> and create_id = #{createId}</if>
<if test="updateId != null "> and update_id = #{updateId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="enterpriseId != null and enterpriseId != ''">and enterprise_id = #{enterpriseId}</if>
<if test="enterpriseName != null and enterpriseName != ''">and enterprise_name like concat('%',
#{enterpriseName}, '%')
</if>
<if test="district != null and district != ''">and district = #{district}</if>
<if test="supervisionLarge != null and supervisionLarge != ''">and SUPERVISION_LARGE =
#{supervisionLarge}
</if>
<if test="riskLevel != null and riskLevel != ''">and RISK_LEVEL = #{riskLevel}</if>
<if test="standLevel != null and standLevel != ''">and STAND_LEVEL = #{standLevel}</if>
<if test="examineEndTime != null ">and EXAMINE_END_TIME = #{examineEndTime}</if>
<if test="createId != null ">and create_id = #{createId}</if>
<if test="updateId != null ">and update_id = #{updateId}</if>
<if test="userId != null ">and user_id = #{userId}</if>
<if test="deptId != null ">and dept_id = #{deptId}</if>
</where>
</select>
@ -114,7 +135,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteBEnterpriseNewById" parameterType="Long">
delete from b_enterprise_new where id = #{id}
delete
from b_enterprise_new
where id = #{id}
</delete>
<delete id="deleteBEnterpriseNewByIds" parameterType="String">

@ -4,25 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.programManagement.mapper.BPlanEnterpriseMapper">
<!-- <resultMap type="BPlanEnterprise" id="BPlanEnterpriseResult">-->
<!-- <result property="id" column="id"/>-->
<!-- <result property="enterpriseId" column="enterprise_id"/>-->
<!-- <result property="createId" column="create_id"/>-->
<!-- <result property="createBy" column="create_by"/>-->
<!-- <result property="createTime" column="create_time"/>-->
<!-- <result property="updateId" column="update_id"/>-->
<!-- <result property="updateBy" column="update_by"/>-->
<!-- <result property="updateTime" column="update_time"/>-->
<!-- <result property="remark" column="remark"/>-->
<!-- <result property="userId" column="user_id"/>-->
<!-- <result property="deptId" column="dept_id"/>-->
<!-- <result property="district" column="district"/>-->
<!-- <result property="plannedYear" column="planned_year"/>-->
<!-- <result property="planName" column="plan_name"/>-->
<!-- <result property="planContent" column="plan_content"/>-->
<!-- <result property="isPoint" column="is_point"/>-->
<!-- <result property="enterpriseName" column="enterprise_name"/>-->
<!-- </resultMap>-->
<sql id="selectBPlanEnterpriseVo">
select id,
enterprise_id,
@ -37,8 +19,6 @@
dept_id,
district,
planned_year,
plan_name,
plan_content,
is_point,
enterprise_name,
law_sort,
@ -54,20 +34,49 @@
</sql>
<select id="selectBPlanEnterpriseList" parameterType="BPlanEnterprise" resultType="BPlanEnterprise">
<include refid="selectBPlanEnterpriseVo"/>
select a.id,
a. enterprise_id,
a.create_id,
a.create_by,
a.create_time,
a.update_id,
a. update_by,
a.update_time,
a.remark,
a. user_id,
a. dept_id,
a. district,
a.planned_year,
a. is_point,
a.enterprise_name,
a.law_sort,
a.law_areas,
a.law_level,
a. law_hierarchy,
a. planned_month,
a.status,
a. check_status,
a. check_id,
a.check_ageing,
CASE WHEN b.ent_code IS NOT NULL THEN 1 ELSE 2 END AS isPoint
from b_plan_enterprise a
LEFT JOIN
b_key_enterprise b ON a.enterprise_id = b.ent_code
<where>
<if test="enterpriseId != null and enterpriseId != ''">and enterprise_id = #{enterpriseId}</if>
<if test="createId != null ">and create_id = #{createId}</if>
<if test="updateId != null ">and update_id = #{updateId}</if>
<if test="userId != null ">and user_id = #{userId}</if>
<if test="deptId != null ">and dept_id = #{deptId}</if>
<if test="district != null and district != ''">and district like concat('%', #{district}, '%')</if>
<if test="plannedYear != null and plannedYear != ''">and planned_year = #{plannedYear}</if>
<if test="planName != null and planName != ''">and plan_name like concat('%', #{planName}, '%')</if>
<if test="planContent != null and planContent != ''">and plan_content = #{planContent}</if>
<if test="isPoint != null ">and is_point = #{isPoint}</if>
<if test="enterpriseName != null and enterpriseName != ''">and enterprise_name like concat('%',#{enterpriseName}, '%')</if>
<if test="enterpriseId != null and enterpriseId != ''">and a.enterprise_id = #{enterpriseId}</if>
<if test="createId != null ">and a.create_id = #{createId}</if>
<if test="updateId != null ">and a.update_id = #{updateId}</if>
<if test="userId != null ">and a.user_id = #{userId}</if>
<if test="deptId != null ">and a.dept_id = #{deptId}</if>
<if test="district != null and district != ''">and a.district like concat('%', #{district}, '%')</if>
<if test="plannedYear != null and plannedYear != ''">and a.planned_year = #{plannedYear}</if>
<if test="isPoint != null ">and a.is_point = #{isPoint}</if>
<if test="enterpriseName != null and enterpriseName != ''">and a.enterprise_name like
concat('%',#{enterpriseName}, '%')
</if>
</where>
order by isPoint desc
</select>
<delete id="deleteByPlanId">
delete
@ -197,20 +206,22 @@
a.dept_id,
a.district,
a.planned_year,
a.plan_name,
a.plan_content,
a.is_point,
a.enterprise_name as entprName
from b_plan_enterprise a
where a.id = #{id}
</select>
<select id="getgetEnterPriseList" resultType="java.lang.Integer">
select count(*) from b_plan_enterprise
<select id="getShouyeList"
resultType="com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse">
SELECT
IFNULL(law_areas, '合计') AS lawAreas,
MAX(law_sort) AS sort,
COUNT(law_areas) AS count,
SUM(CASE WHEN check_status = 1 THEN 1 ELSE 0 END) AS completed,
100 * SUM(CASE WHEN check_status = 1 THEN 1 ELSE 0 END) / COUNT(law_areas) AS completion_rate
FROM b_plan_enterprise
<where>
<if test="req.code !=null and req.code!='' ">
AND district like concat('%', #{req.code}, '%')
</if>
<if test="req.plannedYear !=null and req.plannedYear!='' ">
and planned_year =#{req.plannedYear}
</if>
@ -220,17 +231,24 @@
#{item}
</foreach>
</if>
</where>
GROUP BY law_areas WITH ROLLUP
ORDER BY
CASE WHEN GROUPING(law_areas) = 1 THEN 1 ELSE 0 END,
sort
</select>
<select id="getEnterPriseFinsh" resultType="java.lang.Integer">
select count(*)
from b_plan_enterprise
<select id="getShouYeMxList"
resultType="com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse">
SELECT
IFNULL(law_hierarchy, '合计') AS lawAreas,
MAX(law_sort) AS sort,
COUNT(law_areas) AS count,
SUM(CASE WHEN check_status = 1 THEN 1 ELSE 0 END) AS completed,
100 * SUM(CASE WHEN check_status = 1 THEN 1 ELSE 0 END) / COUNT(law_areas) AS completion_rate
FROM b_plan_enterprise
<where>
<if test="req.code !=null and req.code!='' ">
AND district like concat('%', #{req.code}, '%')
</if>
<if test="req.plannedYear !=null and req.plannedYear!='' ">
and planned_year =#{req.plannedYear}
</if>
@ -240,10 +258,17 @@
#{item}
</foreach>
</if>
and check_status = 1
<if test="req.lawAreas !=null and req.lawAreas!='' ">
and law_areas =#{req.lawAreas}
</if>
</where>
GROUP BY law_hierarchy WITH ROLLUP
ORDER BY
CASE WHEN GROUPING(law_hierarchy) = 1 THEN 1 ELSE 0 END,
sort
</select>
</mapper>
Loading…
Cancel
Save