Commit a9d5dce3 by wangjian

2025-07-17 规范建设 V3

parent b9977b08
...@@ -112,10 +112,10 @@ public class SjGfjsJcdwkhpjController extends BaseController ...@@ -112,10 +112,10 @@ public class SjGfjsJcdwkhpjController extends BaseController
endRq=nd+"-03"; endRq=nd+"-03";
}else if("第二季度".equals(zqfw)) { }else if("第二季度".equals(zqfw)) {
startRq=nd+"-04"; startRq=nd+"-04";
endRq=nd+"-6"; endRq=nd+"-06";
}else if("第三季度".equals(zqfw)) { }else if("第三季度".equals(zqfw)) {
startRq=nd+"-07"; startRq=nd+"-07";
endRq=nd+"-9"; endRq=nd+"-09";
}else { }else {
startRq=nd+"-10"; startRq=nd+"-10";
endRq=nd+"-12"; endRq=nd+"-12";
...@@ -147,7 +147,8 @@ public class SjGfjsJcdwkhpjController extends BaseController ...@@ -147,7 +147,8 @@ public class SjGfjsJcdwkhpjController extends BaseController
//先保存再查询 //先保存再查询
SjGfjsZdgz sjGfjsZdgz=new SjGfjsZdgz(); SjGfjsZdgz sjGfjsZdgz=new SjGfjsZdgz();
sjGfjsZdgz.setLx(deptLx); // sjGfjsZdgz.setLx(deptLx);
sjGfjsZdgz.setLx("基础");
sjGfjsZdgz.setNd(nd); sjGfjsZdgz.setNd(nd);
List<SjGfjsZdgzCb> sjGfjsZdgzList=sjGfjsZdgzMapper.selectSjGfjsZdgzCxBzList(sjGfjsZdgz); List<SjGfjsZdgzCb> sjGfjsZdgzList=sjGfjsZdgzMapper.selectSjGfjsZdgzCxBzList(sjGfjsZdgz);
List<SjGfjsZsdwkhpj> addList=new ArrayList<>(); List<SjGfjsZsdwkhpj> addList=new ArrayList<>();
...@@ -173,7 +174,7 @@ public class SjGfjsJcdwkhpjController extends BaseController ...@@ -173,7 +174,7 @@ public class SjGfjsJcdwkhpjController extends BaseController
zsdwkhpj.setJb("基层单位"); zsdwkhpj.setJb("基层单位");
zsdwkhpj.setZbId(sjGfjsZsdwkhpjZbnew.getId()); zsdwkhpj.setZbId(sjGfjsZsdwkhpjZbnew.getId());
zsdwkhpj.setYl1(i+1L); zsdwkhpj.setYl1(i+1L);
zsdwkhpj.setKhfz("-0"); zsdwkhpj.setKhfz("A");
//计算问题 //计算问题
List<String> collect = sjGfjsZsdwwtcjs.stream().filter(item -> item.getPjbzid().equals(zsdwkhpj.getPjbzid())) List<String> collect = sjGfjsZsdwwtcjs.stream().filter(item -> item.getPjbzid().equals(zsdwkhpj.getPjbzid()))
.map(SjGfjsZsdwwtcj::getWtmc).collect(Collectors.toList()); .map(SjGfjsZsdwwtcj::getWtmc).collect(Collectors.toList());
......
package com.qianhe.controller;
import com.qianhe.common.annotation.Log;
import com.qianhe.common.core.controller.BaseController;
import com.qianhe.common.core.domain.AjaxResult;
import com.qianhe.common.core.domain.entity.SysDept;
import com.qianhe.common.core.page.TableDataInfo;
import com.qianhe.common.enums.BusinessType;
import com.qianhe.common.exception.BusinessException;
import com.qianhe.common.utils.DateUtils;
import com.qianhe.common.utils.SecurityUtils;
import com.qianhe.common.utils.StringUtils;
import com.qianhe.domain.SjGfjsZdgzCb;
import com.qianhe.domain.SjGfjsZsdwwtcj;
import com.qianhe.mapper.SjGfjsZdgzMapper;
import com.qianhe.service.ISjGfjsJgbmjcService;
import com.qianhe.system.mapper.SysDeptMapper;
import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 规范建设-机关部门检查Controller
*
* @author qianhe
* @date 2024-07-23
*/
@RestController
@RequestMapping("/system/sjGfjsJgbmjc")
public class SjGfjsJgbmjcController extends BaseController
{
@Autowired
private ISjGfjsJgbmjcService sjGfjsJcdwwtcjService;
@Autowired
private SysDeptMapper sysDeptMapper;
@Autowired
private SjGfjsZdgzMapper sjGfjsZdgzMapper;
/**
* 查询规范建设-机关部门检查列表
*/
@GetMapping("/list")
public TableDataInfo list(SjGfjsZsdwwtcj sjGfjsZsdwwtcj)
{
sjGfjsZsdwwtcj.setJcjb("机关部门检查");
startPage();
List<SjGfjsZsdwwtcj> list = sjGfjsJcdwwtcjService.selectSjGfjsZsdwwtcjList(sjGfjsZsdwwtcj);
return getDataTable(list);
}
/**
* 导出规范建设-机关部门检查列表
*/
@Log(title = "规范建设-机关部门检查", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SjGfjsZsdwwtcj sjGfjsZsdwwtcj)
{
Workbook exl = null;
OutputStream out = null;
InputStream in = null;
try {
in =this.getClass().getResourceAsStream("/static/jgbmwtjc.xlsx");
exl = WorkbookFactory.create(in);
out = response.getOutputStream();
response.reset();
String filename = URLEncoder.encode("机关部门检查模板.xlsx", "UTF-8");
response.setCharacterEncoding("UTF-8");
response.setHeader("Content-Disposition", "attachment;filename=" + filename);
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
exl.write(out);
exl.close();
}catch(Exception e){
e.getMessage();
throw new BusinessException("导出Excel失败,请联系网站管理员!");
}finally{
if (exl != null) {
try {
exl.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
if (out != null) {
try {
out.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
}
/**
* 获取规范建设-机关部门检查详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sjGfjsJcdwwtcjService.selectSjGfjsZsdwwtcjById(id));
}
/**
* 新增规范建设-机关部门检查
*/
@Log(title = "规范建设-机关部门检查", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SjGfjsZsdwwtcj sjGfjsZsdwwtcj)
{
sjGfjsZsdwwtcj.setJcjb("机关部门检查");
return toAjax(sjGfjsJcdwwtcjService.insertSjGfjsZsdwwtcj(sjGfjsZsdwwtcj));
}
/**
* 修改规范建设-机关部门检查
*/
@Log(title = "规范建设-机关部门检查", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SjGfjsZsdwwtcj sjGfjsZsdwwtcj)
{
sjGfjsZsdwwtcj.setJcjb("机关部门检查");
return toAjax(sjGfjsJcdwwtcjService.updateSjGfjsZsdwwtcj(sjGfjsZsdwwtcj));
}
/**
* 删除规范建设-机关部门检查
*/
@Log(title = "规范建设-机关部门检查", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sjGfjsJcdwwtcjService.deleteSjGfjsZsdwwtcjByIds(ids));
}
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception{
XSSFWorkbook workbook = null;
List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
try {
//装载流
workbook = new XSSFWorkbook(file.getInputStream());
// 获取一个工作表,下标从0开始
XSSFSheet sheet = workbook.getSheetAt(0);
int lastRowNum = sheet.getLastRowNum();
List<SjGfjsZsdwwtcj> list=new ArrayList<>();
// 通过循环,逐行取出表中每行数据
for(int i=0;i<=lastRowNum;i++) {//跳过第一行和第二行
if(i==0 || i==1){
continue;
}
// 获取行
XSSFRow row = sheet.getRow(i);
SjGfjsZsdwwtcj zsdwwtcj=new SjGfjsZsdwwtcj();
System.out.println(row);
//日期
String rq=new DataFormatter().formatCellValue(row.getCell(1));
if(StringUtils.isEmpty(rq)){
return AjaxResult.error("导入失败,第"+(i+1)+"行日期不能为空");
}
Date date = DateUtils.parseDate(rq);
if(date==null){
return AjaxResult.error("导入失败,第"+(i+1)+"行日期格式错误");
}
zsdwwtcj.setRq(DateUtils.parseDateToStr("yyyy-MM",date));
//机关部门
String jgbm=new DataFormatter().formatCellValue(row.getCell(2)) ;
if(StringUtils.isEmpty(jgbm)){
return AjaxResult.error("导入失败,第"+(i+1)+"行机关部门不能为空");
}
String[] jgsplit = jgbm.split("/");
if(jgsplit.length==1){
String bm=jgsplit[0]; // 部门
SysDept bmdept = deptList.stream().filter(dept -> dept.getDeptName().equals(bm)).findFirst().orElse(null);
if(bmdept==null){
return AjaxResult.error("导入失败,第"+(i+1)+"行,机关部门:未匹配到机关名称");
}
zsdwwtcj.setYl3(bmdept.getDeptId());
}else{
String bm=jgsplit[0];// 部门
String ks=jgsplit[1];// 科室
SysDept bmdept = deptList.stream().filter(dept -> dept.getDeptName().equals(bm)).findFirst().orElse(null);
if(bmdept==null){
return AjaxResult.error("导入失败,第"+(i+1)+"行,机关部门:未匹配到机关名称");
}
SysDept ksdept = deptList.stream().filter(dept -> dept.getDeptName().equals(ks) && dept.getParentId().equals(bmdept.getDeptId())).findFirst().orElse(null);
if(ksdept==null){
return AjaxResult.error("导入失败,第"+(i+1)+"行,机关部门:未匹配到科室名称");
}
zsdwwtcj.setYl3(ksdept.getDeptId());
}
//受检单位
String dw=new DataFormatter().formatCellValue(row.getCell(3)) ;
if(StringUtils.isEmpty(dw)){
return AjaxResult.error("导入失败,第"+(i+1)+"行受检单位不能为空");
}
//查询受检单位id
String[] split = dw.split("/");
if(split.length<2){
return AjaxResult.error("导入失败,第"+(i+1)+"行输入的受检单位格式有误!");
}
String ejdw=split[0];
SysDept ejdept = deptList.stream().filter(dept -> dept.getDeptName().equals(ejdw)).findFirst().orElse(null);
if(ejdept==null){
return AjaxResult.error("导入失败,第"+(i+1)+"行,受检单位:未匹配到二级单位");
}
String sjdw=split[1];
SysDept sjdept = deptList.stream().filter(dept -> dept.getDeptName().equals(sjdw) && dept.getParentId().equals(ejdept.getDeptId())).findFirst().orElse(null);
if(sjdept==null){
return AjaxResult.error("导入失败,第"+(i+1)+"行,受检单位:未匹配到三级单位");
}
zsdwwtcj.setDeptId(sjdept.getDeptId());
//问题描述
String wtms=new DataFormatter().formatCellValue(row.getCell(4)) ;
if(StringUtils.isEmpty(wtms)){
return AjaxResult.error("导入失败,第"+(i+1)+"行问题描述不能为空");
}
zsdwwtcj.setWtmc(wtms);
//考核内容
String khnr=new DataFormatter().formatCellValue(row.getCell(5)) ;
if(StringUtils.isEmpty(khnr)){
return AjaxResult.error("导入失败,第"+(i+1)+"行考核内容不能为空");
}
zsdwwtcj.setKhnr(khnr);
//考核项点
String khxd=new DataFormatter().formatCellValue(row.getCell(6)) ;
if(StringUtils.isEmpty(khxd)){
return AjaxResult.error("导入失败,第"+(i+1)+"行考核项点不能为空");
}
zsdwwtcj.setKhxd(khxd);
String pjbz=new DataFormatter().formatCellValue(row.getCell(7)) ;
if(StringUtils.isEmpty(pjbz)){
return AjaxResult.error("导入失败,第"+(i+1)+"行评价标准不能为空");
}
//匹配评价标准
String substring = pjbz.substring(4);
long l = Long.parseLong(substring);
SjGfjsZdgzCb sjGfjsZdgzCb=new SjGfjsZdgzCb();
sjGfjsZdgzCb.setKhxd(khxd);
sjGfjsZdgzCb.setKhnr(khnr);
sjGfjsZdgzCb.setLx(sjdept.getDeptLx());
if(StringUtils.isEmpty(sjdept.getDeptLx())){
return AjaxResult.error("导入失败,第"+(i+1)+"行单位未设置类型");
}
sjGfjsZdgzCb.setPx(l);
sjGfjsZdgzCb.setNd(rq.substring(0,4));
SjGfjsZdgzCb cb=sjGfjsZdgzMapper.selectSjGfjsZdgzCb(sjGfjsZdgzCb);
if(cb==null){
return AjaxResult.error("导入失败,第"+(i+1)+"行未匹配到评价标准");
}
zsdwwtcj.setPjbzid(cb.getId()+"");
zsdwwtcj.setPjbzmc(cb.getPjbz());
String zgzrr=new DataFormatter().formatCellValue(row.getCell(8)) ;
zsdwwtcj.setZgzrr(zgzrr);
String zgcs=new DataFormatter().formatCellValue(row.getCell(9)) ;
zsdwwtcj.setZgcs(zgcs);
String zgqx=new DataFormatter().formatCellValue(row.getCell(10)) ;
zsdwwtcj.setZgqx(zgqx);
String zgzt=new DataFormatter().formatCellValue(row.getCell(11)) ;
zsdwwtcj.setZgzt(zgzt);
zsdwwtcj.setJcjb("机关部门检查");
zsdwwtcj.setCreateTime(DateUtils.getNowDate());
zsdwwtcj.setCreateBy(SecurityUtils.getUsername());
list.add(zsdwwtcj);
}
if(list.size()>0){
sjGfjsJcdwwtcjService.batchSave(list);
}
} catch (IOException e) {
e.getMessage();
e.printStackTrace();
throw new BusinessException("导入Excel失败,请联系网站管理员!");
} finally {
workbook.close();
}
return AjaxResult.success("导入成功");
}
}
package com.qianhe.controller;
import com.qianhe.common.annotation.Log;
import com.qianhe.common.core.controller.BaseController;
import com.qianhe.common.core.domain.AjaxResult;
import com.qianhe.common.core.domain.entity.SysDept;
import com.qianhe.common.core.page.TableDataInfo;
import com.qianhe.common.enums.BusinessType;
import com.qianhe.common.exception.BusinessException;
import com.qianhe.common.utils.DateUtils;
import com.qianhe.common.utils.SecurityUtils;
import com.qianhe.common.utils.StringUtils;
import com.qianhe.domain.SjGfjsYdjcjl;
import com.qianhe.domain.SjGfjsZdgzCb;
import com.qianhe.domain.SjGfjsZsdwwtcj;
import com.qianhe.mapper.SjGfjsZdgzMapper;
import com.qianhe.service.ISjGfjsYdjcjlService;
import com.qianhe.system.mapper.SysDeptMapper;
import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 规范建设 月度检查记录Controller
*
* @author qianhe
* @date 2025-07-10
*/
@RestController
@RequestMapping("/system/sjGfjsYdjcjlZsdw")
public class SjGfjsYdjcjlZsdwController extends BaseController
{
@Autowired
private ISjGfjsYdjcjlService sjGfjsYdjcjlService;
@Autowired
private SysDeptMapper sysDeptMapper;
@Autowired
private SjGfjsZdgzMapper sjGfjsZdgzMapper;
/**
* 查询规范建设 月度检查记录列表
*/
@GetMapping("/list")
public TableDataInfo list(SjGfjsYdjcjl sjGfjsYdjcjl)
{
sjGfjsYdjcjl.setJcjb("直属单位自查");
startPage();
List<SjGfjsYdjcjl> list = sjGfjsYdjcjlService.selectSjGfjsYdjcjlList(sjGfjsYdjcjl);
return getDataTable(list);
}
/**
* 导出规范建设 月度检查记录列表
*/
@Log(title = "规范建设 月度检查记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SjGfjsYdjcjl sjGfjsYdjcjl)
{
Workbook exl = null;
OutputStream out = null;
InputStream in = null;
try {
in =this.getClass().getResourceAsStream("/static/gfjs_ydjcjl_wt.xlsx");
exl = WorkbookFactory.create(in);
out = response.getOutputStream();
response.reset();
String filename = URLEncoder.encode("直属单位问题采集模板.xlsx", "UTF-8");
response.setCharacterEncoding("UTF-8");
response.setHeader("Content-Disposition", "attachment;filename=" + filename);
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
exl.write(out);
exl.close();
}catch(Exception e){
e.getMessage();
throw new BusinessException("导出Excel失败,请联系网站管理员!");
}finally{
if (exl != null) {
try {
exl.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
if (out != null) {
try {
out.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
}
/**
* 获取规范建设 月度检查记录详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sjGfjsYdjcjlService.selectSjGfjsYdjcjlById(id));
}
/**
* 新增规范建设 月度检查记录
*/
@Log(title = "规范建设 月度检查记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SjGfjsYdjcjl sjGfjsYdjcjl)
{
sjGfjsYdjcjl.setJcjb("直属单位自查");
SysDept dept = sysDeptMapper.selectDeptById(sjGfjsYdjcjl.getDeptId());
sjGfjsYdjcjl.setYl3(dept.getParentId());
return toAjax(sjGfjsYdjcjlService.insertSjGfjsYdjcjl(sjGfjsYdjcjl));
}
/**
* 修改规范建设 月度检查记录
*/
@Log(title = "规范建设 月度检查记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SjGfjsYdjcjl sjGfjsYdjcjl)
{
sjGfjsYdjcjl.setJcjb("直属单位自查");
SysDept dept = sysDeptMapper.selectDeptById(sjGfjsYdjcjl.getDeptId());
sjGfjsYdjcjl.setYl3(dept.getParentId());
return toAjax(sjGfjsYdjcjlService.updateSjGfjsYdjcjl(sjGfjsYdjcjl));
}
/**
* 删除规范建设 月度检查记录
*/
@Log(title = "规范建设 月度检查记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sjGfjsYdjcjlService.deleteSjGfjsYdjcjlByIds(ids));
}
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception{
XSSFWorkbook workbook = null;
List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
try {
//装载流
workbook = new XSSFWorkbook(file.getInputStream());
// 获取一个工作表,下标从0开始
XSSFSheet sheet = workbook.getSheetAt(0);
int lastRowNum = sheet.getLastRowNum();
List<SjGfjsZsdwwtcj> list=new ArrayList<>();
// 通过循环,逐行取出表中每行数据
for(int i=0;i<=lastRowNum;i++) {//跳过第一行和第二行
if(i==0 || i==1){
continue;
}
// 获取行
XSSFRow row = sheet.getRow(i);
SjGfjsZsdwwtcj zsdwwtcj=new SjGfjsZsdwwtcj();
System.out.println(row);
//日期
String rq=new DataFormatter().formatCellValue(row.getCell(1));
if(StringUtils.isEmpty(rq)){
return AjaxResult.error("导入失败,第"+(i+1)+"行日期不能为空");
}
Date date = DateUtils.parseDate(rq);
if(date==null){
return AjaxResult.error("导入失败,第"+(i+1)+"行日期格式错误");
}
zsdwwtcj.setRq(DateUtils.parseDateToStr("yyyy-MM",date));
//单位
String dw=new DataFormatter().formatCellValue(row.getCell(2)) ;
if(StringUtils.isEmpty(dw)){
return AjaxResult.error("导入失败,第"+(i+1)+"行单位不能为空");
}
//查询单位id
String[] split = dw.split("/");
if(split.length<2){
return AjaxResult.error("导入失败,第"+(i+1)+"行输入的单位格式有误!");
}
String ejdw=split[0];
SysDept ejdept = deptList.stream().filter(dept -> dept.getDeptName().equals(ejdw)).findFirst().orElse(null);
if(ejdept==null){
return AjaxResult.error("导入失败,第"+(i+1)+"行未匹配到二级单位");
}
String sjdw=split[1];
SysDept sjdept = deptList.stream().filter(dept -> dept.getDeptName().equals(sjdw) && dept.getParentId().equals(ejdept.getDeptId())).findFirst().orElse(null);
if(sjdept==null){
return AjaxResult.error("导入失败,第"+(i+1)+"行未匹配到三级单位");
}
zsdwwtcj.setDeptId(sjdept.getDeptId());
zsdwwtcj.setYl3(sjdept.getDeptId());
//问题描述
String wtms=new DataFormatter().formatCellValue(row.getCell(3)) ;
if(StringUtils.isEmpty(wtms)){
return AjaxResult.error("导入失败,第"+(i+1)+"行问题描述不能为空");
}
zsdwwtcj.setWtmc(wtms);
//考核内容
String khnr=new DataFormatter().formatCellValue(row.getCell(4)) ;
if(StringUtils.isEmpty(khnr)){
return AjaxResult.error("导入失败,第"+(i+1)+"行考核内容不能为空");
}
zsdwwtcj.setKhnr(khnr);
//考核项点
String khxd=new DataFormatter().formatCellValue(row.getCell(5)) ;
if(StringUtils.isEmpty(khxd)){
return AjaxResult.error("导入失败,第"+(i+1)+"行考核项点不能为空");
}
zsdwwtcj.setKhxd(khxd);
String pjbz=new DataFormatter().formatCellValue(row.getCell(6)) ;
if(StringUtils.isEmpty(pjbz)){
return AjaxResult.error("导入失败,第"+(i+1)+"行评价标准不能为空");
}
//匹配评价标准
String substring = pjbz.substring(6);
long l = Long.parseLong(substring);
SjGfjsZdgzCb sjGfjsZdGzCb=new SjGfjsZdgzCb();
sjGfjsZdGzCb.setKhxd(khxd);
sjGfjsZdGzCb.setKhnr(khnr);
sjGfjsZdGzCb.setPx(l);
sjGfjsZdGzCb.setNd(rq.substring(0,4));
SjGfjsZdgzCb cb=sjGfjsZdgzMapper.selectSjGfjsZdgzCb(sjGfjsZdGzCb);
if(cb==null){
return AjaxResult.error("导入失败,第"+(i+1)+"行未匹配到评价标准");
}
zsdwwtcj.setPjbzid(cb.getId()+"");
zsdwwtcj.setPjbzmc(cb.getPjbz());
String zgzrr=new DataFormatter().formatCellValue(row.getCell(7)) ;
zsdwwtcj.setZgzrr(zgzrr);
String zgcs=new DataFormatter().formatCellValue(row.getCell(8)) ;
zsdwwtcj.setZgcs(zgcs);
String zgqx=new DataFormatter().formatCellValue(row.getCell(9)) ;
zsdwwtcj.setZgqx(zgqx);
String zgzt=new DataFormatter().formatCellValue(row.getCell(10)) ;
zsdwwtcj.setZgzt(zgzt);
zsdwwtcj.setJcjb("直属单位自查");
zsdwwtcj.setCreateTime(DateUtils.getNowDate());
zsdwwtcj.setCreateBy(SecurityUtils.getUsername());
list.add(zsdwwtcj);
}
if(list.size()>0){
// sjGfjsYdjcjlService.batchSave(list);
return AjaxResult.success(list);
}
} catch (IOException e) {
e.getMessage();
e.printStackTrace();
throw new BusinessException("导入Excel失败,请联系网站管理员!");
} finally {
workbook.close();
}
return AjaxResult.success("导入失败");
}
}
package com.qianhe.controller;
import com.qianhe.common.annotation.Log;
import com.qianhe.common.core.controller.BaseController;
import com.qianhe.common.core.domain.AjaxResult;
import com.qianhe.common.core.domain.entity.SysDept;
import com.qianhe.common.core.page.TableDataInfo;
import com.qianhe.common.enums.BusinessType;
import com.qianhe.common.exception.BusinessException;
import com.qianhe.common.utils.DateUtils;
import com.qianhe.common.utils.SecurityUtils;
import com.qianhe.common.utils.StringUtils;
import com.qianhe.domain.SjGfjsKhwtCb;
import com.qianhe.domain.SjGfjsZsdwfjxcj;
import com.qianhe.mapper.SjGfjsKhwtMapper;
import com.qianhe.service.ISjGfjsZsdwfjxcjService;
import com.qianhe.system.mapper.SysDeptMapper;
import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 规范建设-直属单位否决项采集Controller
*
* @author qianhe
* @date 2024-07-24
*/
@RestController
@RequestMapping("/system/sjGfjsZsdwfjxcj")
public class SjGfjsZsdwfjxcjController extends BaseController
{
@Autowired
private ISjGfjsZsdwfjxcjService sjGfjsZsdwfjxcjService;
@Autowired
private SysDeptMapper sysDeptMapper;
@Autowired
private SjGfjsKhwtMapper sjGfjsKhwtMapper;
/**
* 查询规范建设-直属单位否决项采集列表
*/
@GetMapping("/list")
public TableDataInfo list(SjGfjsZsdwfjxcj sjGfjsZsdwfjxcj)
{
startPage();
List<SjGfjsZsdwfjxcj> list = sjGfjsZsdwfjxcjService.selectSjGfjsZsdwfjxcjList(sjGfjsZsdwfjxcj);
return getDataTable(list);
}
/**
* 导出规范建设-直属单位否决项采集列表
*/
@Log(title = "规范建设-直属单位否决项采集", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SjGfjsZsdwfjxcj sjGfjsZsdwfjxcj)
{
Workbook exl = null;
OutputStream out = null;
InputStream in = null;
try {
in =this.getClass().getResourceAsStream("/static/gfjs_zsdwfjxcj.xlsx");
exl = WorkbookFactory.create(in);
out = response.getOutputStream();
response.reset();
String filename = URLEncoder.encode("否决项采集模板.xlsx", "UTF-8");
response.setCharacterEncoding("UTF-8");
response.setHeader("Content-Disposition", "attachment;filename=" + filename);
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
exl.write(out);
exl.close();
}catch(Exception e){
e.getMessage();
throw new BusinessException("导出Excel失败,请联系网站管理员!");
}finally{
if (exl != null) {
try {
exl.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
if (out != null) {
try {
out.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
}
/**
* 获取规范建设-直属单位否决项采集详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sjGfjsZsdwfjxcjService.selectSjGfjsZsdwfjxcjById(id));
}
/**
* 新增规范建设-直属单位否决项采集
*/
@Log(title = "规范建设-直属单位否决项采集", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SjGfjsZsdwfjxcj sjGfjsZsdwfjxcj)
{
return toAjax(sjGfjsZsdwfjxcjService.insertSjGfjsZsdwfjxcj(sjGfjsZsdwfjxcj));
}
/**
* 修改规范建设-直属单位否决项采集
*/
@Log(title = "规范建设-直属单位否决项采集", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SjGfjsZsdwfjxcj sjGfjsZsdwfjxcj)
{
return toAjax(sjGfjsZsdwfjxcjService.updateSjGfjsZsdwfjxcj(sjGfjsZsdwfjxcj));
}
/**
* 删除规范建设-直属单位否决项采集
*/
@Log(title = "规范建设-直属单位否决项采集", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sjGfjsZsdwfjxcjService.deleteSjGfjsZsdwfjxcjByIds(ids));
}
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception{
XSSFWorkbook workbook = null;
List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
try {
//装载流
workbook = new XSSFWorkbook(file.getInputStream());
// 获取一个工作表,下标从0开始
XSSFSheet sheet = workbook.getSheetAt(0);
int lastRowNum = sheet.getLastRowNum();
List<SjGfjsZsdwfjxcj> list=new ArrayList<>();
// 通过循环,逐行取出表中每行数据
for(int i=0;i<=lastRowNum;i++) {//跳过第一行和第二行
if(i==0 || i==1){
continue;
}
// 获取行
XSSFRow row = sheet.getRow(i);
SjGfjsZsdwfjxcj zsdwwtcj=new SjGfjsZsdwfjxcj();
System.out.println(row);
//日期
String rq=new DataFormatter().formatCellValue(row.getCell(1));
if(StringUtils.isEmpty(rq)){
return AjaxResult.error("导入失败,第"+(i+1)+"行日期不能为空");
}
Date date = DateUtils.parseDate(rq);
if(date==null){
return AjaxResult.error("导入失败,第"+(i+1)+"行日期格式错误");
}
zsdwwtcj.setRq(DateUtils.parseDateToStr("yyyy-MM",date));
//机关部门
String jgbm=new DataFormatter().formatCellValue(row.getCell(2)) ;
if(StringUtils.isEmpty(jgbm)){
return AjaxResult.error("导入失败,第"+(i+1)+"行机关部门不能为空");
}
String[] jgsplit = jgbm.split("/");
if(jgsplit.length==1){
String bm=jgsplit[0]; // 部门
SysDept bmdept = deptList.stream().filter(dept -> dept.getDeptName().equals(bm)).findFirst().orElse(null);
if(bmdept==null){
return AjaxResult.error("导入失败,第"+(i+1)+"行,机关部门:未匹配到机关名称");
}
zsdwwtcj.setYl3(bmdept.getDeptId());
}else{
String bm=jgsplit[0];// 部门
String ks=jgsplit[1];// 科室
SysDept bmdept = deptList.stream().filter(dept -> dept.getDeptName().equals(bm)).findFirst().orElse(null);
if(bmdept==null){
return AjaxResult.error("导入失败,第"+(i+1)+"行,机关部门:未匹配到机关名称");
}
SysDept ksdept = deptList.stream().filter(dept -> dept.getDeptName().equals(ks) && dept.getParentId().equals(bmdept.getDeptId())).findFirst().orElse(null);
if(ksdept==null){
return AjaxResult.error("导入失败,第"+(i+1)+"行,机关部门:未匹配到科室名称");
}
zsdwwtcj.setYl3(ksdept.getDeptId());
}
//受检单位
String dw=new DataFormatter().formatCellValue(row.getCell(3)) ;
if(StringUtils.isEmpty(dw)){
return AjaxResult.error("导入失败,第"+(i+1)+"行受检单位不能为空");
}
//查询单位id
String[] split = dw.split("/");
if(split.length<2){
return AjaxResult.error("导入失败,第"+(i+1)+"行输入的受检单位格式有误!");
}
String ejdw=split[0];
SysDept ejdept = deptList.stream().filter(dept -> dept.getDeptName().equals(ejdw)).findFirst().orElse(null);
if(ejdept==null){
return AjaxResult.error("导入失败,第"+(i+1)+"行,受检单位:未匹配到二级单位");
}
String sjdw=split[1];
SysDept sjdept = deptList.stream().filter(dept -> dept.getDeptName().equals(sjdw) && dept.getParentId().equals(ejdept.getDeptId())).findFirst().orElse(null);
if(sjdept==null){
return AjaxResult.error("导入失败,第"+(i+1)+"行,受检单位:未匹配到三级单位");
}
zsdwwtcj.setDeptId(sjdept.getDeptId());
//分类名称
String flmc=new DataFormatter().formatCellValue(row.getCell(4)) ;
if(StringUtils.isEmpty(flmc)){
return AjaxResult.error("导入失败,第"+(i+1)+"行否决项分类不能为空");
}
zsdwwtcj.setFlmc(flmc);
//评价标准
String pjbz=new DataFormatter().formatCellValue(row.getCell(5)) ;
if(StringUtils.isEmpty(pjbz)){
return AjaxResult.error("导入失败,第"+(i+1)+"行评价标准不能为空");
}
//匹配评价标准
String substring = pjbz.substring(4);
long l = Long.parseLong(substring);
SjGfjsKhwtCb sjGfjsKhwtCb=new SjGfjsKhwtCb();
sjGfjsKhwtCb.setFlmc(flmc);
sjGfjsKhwtCb.setPx(l);
sjGfjsKhwtCb.setNd(rq.substring(0,4));
SjGfjsKhwtCb cb=sjGfjsKhwtMapper.selectSjGfjsKhwtCb(sjGfjsKhwtCb);
if(cb==null){
return AjaxResult.error("导入失败,第"+(i+1)+"行未匹配到评价标准");
}
zsdwwtcj.setPjbzid(cb.getId()+"");
zsdwwtcj.setPjbzmc(cb.getPjbz());
String wtms=new DataFormatter().formatCellValue(row.getCell(6)) ;
zsdwwtcj.setWtmc(wtms);
zsdwwtcj.setCreateTime(DateUtils.getNowDate());
zsdwwtcj.setCreateBy(SecurityUtils.getUsername());
list.add(zsdwwtcj);
}
if(list.size()>0){
sjGfjsZsdwfjxcjService.batchSave(list);
}
} catch (IOException e) {
e.getMessage();
e.printStackTrace();
throw new BusinessException("导入Excel失败,请联系网站管理员!");
} finally {
workbook.close();
}
return AjaxResult.success("导入成功");
}
}
package com.qianhe.controller;
import com.qianhe.common.annotation.Log;
import com.qianhe.common.constant.HttpStatus;
import com.qianhe.common.core.controller.BaseController;
import com.qianhe.common.core.domain.AjaxResult;
import com.qianhe.common.core.domain.entity.SysDept;
import com.qianhe.common.core.page.TableDataInfo;
import com.qianhe.common.enums.BusinessType;
import com.qianhe.common.exception.BusinessException;
import com.qianhe.common.utils.StringUtils;
import com.qianhe.domain.*;
import com.qianhe.mapper.SjGfjsZdgzMapper;
import com.qianhe.mapper.SjGfjsYdjcjlMapper;
import com.qianhe.service.ISjGfjsZsdwkhpjService;
import com.qianhe.service.ISjGfjsZsdwkhpjZbService;
import com.qianhe.system.mapper.SysDeptMapper;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 规范建设-直属单位考核评价Controller
*
* @author qianhe
* @date 2024-07-24
*/
@RestController
@RequestMapping("/system/sjGfjsZsdwkhpj")
public class SjGfjsZsdwkhpjController extends BaseController
{
@Autowired
private SysDeptMapper sysDeptMapper;
@Autowired
private ISjGfjsZsdwkhpjService sjGfjsZsdwkhpjService;
@Autowired
private ISjGfjsZsdwkhpjZbService sjGfjsZsdwkhpjZbService;
@Autowired
private SjGfjsYdjcjlMapper sjGfjsYdjcjlMapper;
// private SjGfjsZsdwwtcjMapper sjGfjsYdjcjlMapper;
@Autowired
private SjGfjsZdgzMapper sjGfjsZdgzMapper;
// private SjGfjsZdgzMapper sjGfjsZdgzMapper;
// @Autowired
// private SjGfjsFjxbzMapper sjGfjsFjxbzMapper;
// @Autowired
// private ISjGfjsZsdwkhpjfjxService sjGfjsZsdwkhpjfjxService;
// @Autowired
// private SjGfjsZsdwfjxcjMapper sjGfjsZsdwfjxcjMapper;
/**
* 查询规范建设-直属单位考核评价列表
*/
@GetMapping("/list")
public TableDataInfo list(SjGfjsZsdwkhpj sjGfjsZsdwkhpj)
{
startPage();
List<SjGfjsZsdwkhpj> list = sjGfjsZsdwkhpjService.selectSjGfjsZsdwkhpjList(sjGfjsZsdwkhpj);
return getDataTable(list);
}
/**
* 查询考核评价
* @return
*/
@GetMapping("/listAll")
public Map<String,Object> listAll(SjGfjsZsdwkhpj sjGfjsZsdwkhpj)
{
// PageDomain pageDomain = TableSupport.buildPageRequest();
// Integer pageNum = pageDomain.getPageNum();
// Integer pageSize = pageDomain.getPageSize();
Map<String,Object> map=new HashMap<>();
Long deptId = sjGfjsZsdwkhpj.getDeptId();
String nd = sjGfjsZsdwkhpj.getNd();
SysDept dept = sysDeptMapper.selectDeptById(deptId);
String deptLx = dept.getDeptLx();
if(StringUtils.isEmpty(deptLx)){
map.put("code",5);
map.put("msg","该单位未维护单位类型");
map.put("khpjData",new ArrayList<>());
map.put("fjxData",new ArrayList<>());
return map;
}
String zqfw = sjGfjsZsdwkhpj.getZqfw();
String startRq=null;
String endRq=null;
if("上半年".equals(zqfw)){
startRq=nd+"-01";
endRq=nd+"-06";
}else {
startRq=nd+"-01";
endRq=nd+"-12";
}
//查询考核评价是否保存到从表
List<SjGfjsZsdwkhpj> sjGfjsZsdwkhpjs = sjGfjsZsdwkhpjService.selectSjGfjsZsdwkhpjList(sjGfjsZsdwkhpj);
// List<SjGfjsZsdwkhpj>
if(sjGfjsZsdwkhpjs.size()<=0){
//查询主表信息
SjGfjsZsdwkhpjZb sjGfjsZsdwkhpjZb=new SjGfjsZsdwkhpjZb();
sjGfjsZsdwkhpjZb.setNd(nd);
sjGfjsZsdwkhpjZb.setDeptId(deptId);
sjGfjsZsdwkhpjZb.setZqfw(sjGfjsZsdwkhpj.getZqfw());
SjGfjsZsdwkhpjZb sjGfjsZsdwkhpjZbnew =sjGfjsZsdwkhpjZbService.selectSjGfjsZsdwkhpjZb(sjGfjsZsdwkhpjZb);
if(sjGfjsZsdwkhpjZbnew==null){
sjGfjsZsdwkhpjZbnew=new SjGfjsZsdwkhpjZb();
sjGfjsZsdwkhpjZbnew.setNd(nd);
sjGfjsZsdwkhpjZbnew.setDeptId(deptId);
sjGfjsZsdwkhpjZbnew.setParentDeptId(dept.getParentId());
sjGfjsZsdwkhpjZbnew.setZqfw(sjGfjsZsdwkhpj.getZqfw());
sjGfjsZsdwkhpjZbnew.setZqlx("半年度");
sjGfjsZsdwkhpjZbnew.setJb("直属单位");
sjGfjsZsdwkhpjZbnew.setDeptDfl(dept.getDeptDfl());
sjGfjsZsdwkhpjZbnew.setDeptLx(dept.getDeptLx());
sjGfjsZsdwkhpjZbnew.setDeptYwfl(dept.getDeptYwfl());
sjGfjsZsdwkhpjZbService.insertSjGfjsZsdwkhpjZb(sjGfjsZsdwkhpjZbnew);
}
//先保存再查询
SjGfjsZdgz sjGfjsZdgz=new SjGfjsZdgz();
// sjGfjsZdgz.setLx(deptLx);
sjGfjsZdgz.setLx("基础");
sjGfjsZdgz.setNd(nd);
List<SjGfjsZdgzCb> sjGfjsZdgzList=sjGfjsZdgzMapper.selectSjGfjsZdgzCxBzList(sjGfjsZdgz);
List<SjGfjsZsdwkhpj> addList=new ArrayList<>();
//查询问题
SjGfjsZsdwwtcj sjGfjsZsdwwtcj =new SjGfjsZsdwwtcj();
sjGfjsZsdwwtcj.setDeptId(deptId);
sjGfjsZsdwwtcj.setStartRq(startRq);
sjGfjsZsdwwtcj.setEndRq(endRq);
sjGfjsZsdwwtcj.setJcjb("直属单位自查");
List<SjGfjsZsdwwtcj> sjGfjsZsdwwtcjs = sjGfjsYdjcjlMapper.selectSjGfjsZsdwwtcjList(sjGfjsZsdwwtcj);
for(int i=0;i<sjGfjsZdgzList.size();i++){
SjGfjsZdgzCb sjGfjsZdgzCb = sjGfjsZdgzList.get(i);
SjGfjsZsdwkhpj zsdwkhpj=new SjGfjsZsdwkhpj();
zsdwkhpj.setKhnr(sjGfjsZdgzCb.getKhnr());
zsdwkhpj.setKhxd(sjGfjsZdgzCb.getKhxd());
zsdwkhpj.setPjbzid(sjGfjsZdgzCb.getId()+"");
zsdwkhpj.setPjbzmc(sjGfjsZdgzCb.getPjbz());
zsdwkhpj.setDeptId(deptId);
zsdwkhpj.setNd(nd);
zsdwkhpj.setZqfw(sjGfjsZsdwkhpj.getZqfw());
zsdwkhpj.setZqlx("半年度");
zsdwkhpj.setJb("直属单位");
zsdwkhpj.setZbId(sjGfjsZsdwkhpjZbnew.getId());
zsdwkhpj.setYl1(i+1L);
zsdwkhpj.setKhfz("A");
//计算问题
List<String> collect = sjGfjsZsdwwtcjs.stream().filter(item -> item.getPjbzid().equals(zsdwkhpj.getPjbzid()))
.map(SjGfjsZsdwwtcj::getWtmc).collect(Collectors.toList());
zsdwkhpj.setSj(collect.size()+"");
zsdwkhpj.setWtms(String.join(";",collect));
addList.add(zsdwkhpj);
}
//保存考核评价
if(addList.size()>0){
sjGfjsZsdwkhpjService.batchSave(addList);
}
}
//查询考核评价
List<SjGfjsZsdwkhpj> resjGfjsZsdwkhpjs = sjGfjsZsdwkhpjService.selectSjGfjsZsdwkhpjList(sjGfjsZsdwkhpj);
map.put("code",HttpStatus.SUCCESS);
map.put("msg","查询成功");
map.put("khpjData",resjGfjsZsdwkhpjs);
return map;
}
/**
* 导出规范建设-直属单位考核评价列表
*/
@Log(title = "规范建设-直属单位考核评价", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SjGfjsZsdwkhpj sjGfjsZsdwkhpj)
{
List<SjGfjsZsdwkhpj> list = sjGfjsZsdwkhpjService.selectSjGfjsZsdwkhpjList(sjGfjsZsdwkhpj);
Workbook exl = null;
OutputStream out = null;
InputStream in = null;
try {
in =this.getClass().getResourceAsStream("/static/gfjs_zsdwkhpj.xlsx");
exl = WorkbookFactory.create(in);
out = response.getOutputStream();
response.reset();
String filename = URLEncoder.encode("考核评价.xlsx", "UTF-8");
response.setCharacterEncoding("UTF-8");
response.setHeader("Content-Disposition", "attachment;filename=" + filename);
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
Sheet sheet = exl.getSheet("Sheet1");
// sheet.getRow(0).getCell(0).setCellValue(sjGfjsZsdwkhpj.getNd()+"年"+sjGfjsZsdwkhpj.getZqfw()+sjGfjsZsdwkhpj.getDeptName());
CellStyle cellStyle = exl.createCellStyle();
cellStyle.setWrapText(true);
cellStyle.setAlignment(HorizontalAlignment.LEFT);
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
cellStyle.setBorderBottom(BorderStyle.THIN);
cellStyle.setBottomBorderColor(IndexedColors.BLACK.getIndex());
cellStyle.setBorderLeft(BorderStyle.THIN);
cellStyle.setLeftBorderColor(IndexedColors.BLACK.getIndex());
cellStyle.setBorderRight(BorderStyle.THIN);
cellStyle.setRightBorderColor(IndexedColors.BLACK.getIndex());
cellStyle.setBorderTop(BorderStyle.THIN);
cellStyle.setTopBorderColor(IndexedColors.BLACK.getIndex());
String deptName="";
int lastRow = sheet.getLastRowNum()+1;
for( SjGfjsZsdwkhpj zsdwkhpj:list){
deptName= zsdwkhpj.getDeptName();;
Row row = sheet.createRow(lastRow);
row.setHeightInPoints(18);
int m = 0;
Cell cell = row.createCell(m++);cell.setCellStyle(cellStyle); cell.setCellValue(zsdwkhpj.getKhnr());
cell = row.createCell(m++);cell.setCellStyle(cellStyle); cell.setCellValue(zsdwkhpj.getKhxd());
cell = row.createCell(m++);cell.setCellStyle(cellStyle); cell.setCellValue(zsdwkhpj.getPjbzmc());
cell = row.createCell(m++);cell.setCellStyle(cellStyle); cell.setCellValue(zsdwkhpj.getSj());
cell = row.createCell(m++);cell.setCellStyle(cellStyle); cell.setCellValue(zsdwkhpj.getWtms());
cell = row.createCell(m++);cell.setCellStyle(cellStyle); cell.setCellValue(zsdwkhpj.getKhfz());
cell = row.createCell(m++);cell.setCellStyle(cellStyle); cell.setCellValue(zsdwkhpj.getId());
cell = row.createCell(m++);cell.setCellStyle(cellStyle); cell.setCellValue(zsdwkhpj.getZbId());
lastRow++;
}
//合并行
mergeCellsByColumn(sheet,0);
mergeCellsByColumn(sheet,1);
sheet.getRow(0).getCell(0).setCellValue(sjGfjsZsdwkhpj.getNd()+sjGfjsZsdwkhpj.getZqfw()+deptName+"考核评价");
exl.write(out);
exl.close();
}catch (Exception e){
e.getMessage();
throw new BusinessException("导出Excel失败,请联系网站管理员!");
}finally {
if (exl != null) {
try {
exl.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
if (out != null) {
try {
out.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
}
// 根据某一列的值是否相同,对其他列的单元格进行合并
private static void mergeCellsByColumn(Sheet sheet, int columnIndex) {
Map<String, Integer> groups = new HashMap<>();
// 遍历该列,记录相同值的行索引
int start=1;
int end=1;
String old="";
for (int i = 1; i <= sheet.getLastRowNum(); i++) {
Row row = sheet.getRow(i);
Cell cell = row.getCell(columnIndex);
String cellValue = cell.getStringCellValue();
if (!groups.containsKey(cellValue)) {
if(groups.get(old)!=null){
start = groups.get(old);
}
old=cellValue;
groups.put(cellValue, i);
//合并行
mergeCellsInRange(sheet, columnIndex, start, end);
start=i;
end=i;
} else {
end++;
if(i==sheet.getLastRowNum()){
mergeCellsInRange(sheet, columnIndex, start, end);
}
}
}
}
// 合并指定范围内的单元格
private static void mergeCellsInRange(Sheet sheet, int columnIndex, int startIndex, int endIndex) {
if(startIndex!=endIndex){
sheet.addMergedRegion(new CellRangeAddress(startIndex, endIndex, columnIndex, columnIndex));
}
}
/**
* 获取规范建设-直属单位考核评价详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sjGfjsZsdwkhpjService.selectSjGfjsZsdwkhpjById(id));
}
/**
* 新增规范建设-直属单位考核评价
*/
@Log(title = "规范建设-直属单位考核评价", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SjGfjsZsdwkhpj sjGfjsZsdwkhpj)
{
return toAjax(sjGfjsZsdwkhpjService.insertSjGfjsZsdwkhpj(sjGfjsZsdwkhpj));
}
/**
* 修改规范建设-直属单位考核评价
*/
@Log(title = "规范建设-直属单位考核评价", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SjGfjsZsdwkhpj sjGfjsZsdwkhpj)
{
return toAjax(sjGfjsZsdwkhpjService.updateSjGfjsZsdwkhpj(sjGfjsZsdwkhpj));
}
/**
* 删除规范建设-直属单位考核评价
*/
@Log(title = "规范建设-直属单位考核评价", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sjGfjsZsdwkhpjService.deleteSjGfjsZsdwkhpjByIds(ids));
}
/**
* 修改规范建设-直属单位考核评价
*/
@Log(title = "规范建设-直属单位考核评价", businessType = BusinessType.UPDATE)
@PutMapping("/pledit")
public AjaxResult pledit(@RequestBody List<SjGfjsZsdwkhpj> list)
{
return toAjax(sjGfjsZsdwkhpjService.pledit(list));
}
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception{
XSSFWorkbook workbook = null;
// List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
try {
//装载流
workbook = new XSSFWorkbook(file.getInputStream());
// 获取一个工作表,下标从0开始
XSSFSheet sheet = workbook.getSheetAt(0);
int lastRowNum = sheet.getLastRowNum();
List<SjGfjsZsdwkhpj> list=new ArrayList<>();
// 通过循环,逐行取出表中每行数据
for(int i=0;i<=lastRowNum;i++) {//跳过第一行和第二行
if(i==0 || i==1){
continue;
}
// 获取行
XSSFRow row = sheet.getRow(i);
SjGfjsZsdwkhpj zsdwkhpj=new SjGfjsZsdwkhpj();
System.out.println(row);
//id
String id=new DataFormatter().formatCellValue(row.getCell(6));
if(StringUtils.isEmpty(id)){
return AjaxResult.error("id不能为空");
}
zsdwkhpj.setId(Long.parseLong(id));
//主表id
String zbid=new DataFormatter().formatCellValue(row.getCell(7));
if(StringUtils.isEmpty(zbid)){
return AjaxResult.error("主表id不能为空");
}
zsdwkhpj.setZbId(Long.parseLong(zbid));
String khnr=new DataFormatter().formatCellValue(row.getCell(1));
zsdwkhpj.setKhnr(khnr);
String xd=new DataFormatter().formatCellValue(row.getCell(2));
zsdwkhpj.setKhxd(xd);
String pj=new DataFormatter().formatCellValue(row.getCell(3));
zsdwkhpj.setPjbzmc(pj);
String sl=new DataFormatter().formatCellValue(row.getCell(3));
zsdwkhpj.setSj(sl);
//问题描述
String wtms=new DataFormatter().formatCellValue(row.getCell(4));
zsdwkhpj.setWtms(wtms);
//考核分值
String khfz=new DataFormatter().formatCellValue(row.getCell(5));
zsdwkhpj.setKhfz(khfz);
list.add(zsdwkhpj);
}
if(list.size()>0){
sjGfjsZsdwkhpjService.pledit(list);
}
} catch (IOException e) {
e.getMessage();
e.printStackTrace();
throw new BusinessException("导入Excel失败,请联系网站管理员!");
} finally {
workbook.close();
}
return AjaxResult.success("导入成功");
}
}
package com.qianhe.controller;
import com.qianhe.common.annotation.Log;
import com.qianhe.common.core.controller.BaseController;
import com.qianhe.common.core.domain.AjaxResult;
import com.qianhe.common.core.page.TableDataInfo;
import com.qianhe.common.enums.BusinessType;
import com.qianhe.common.exception.BusinessException;
import com.qianhe.common.utils.StringUtils;
import com.qianhe.domain.SjGfjsZsdwkhpjfjx;
import com.qianhe.service.ISjGfjsZsdwkhpjfjxService;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 规范建设-直属单位考核评价否决项Controller
*
* @author qianhe
* @date 2024-07-24
*/
@RestController
@RequestMapping("/system/sjGfjsZsdwkhpjfjx")
public class SjGfjsZsdwkhpjfjxController extends BaseController
{
@Autowired
private ISjGfjsZsdwkhpjfjxService sjGfjsZsdwkhpjfjxService;
/**
* 查询规范建设-直属单位考核评价否决项列表
*/
@GetMapping("/list")
public TableDataInfo list(SjGfjsZsdwkhpjfjx sjGfjsZsdwkhpjfjx)
{
startPage();
List<SjGfjsZsdwkhpjfjx> list = sjGfjsZsdwkhpjfjxService.selectSjGfjsZsdwkhpjfjxList(sjGfjsZsdwkhpjfjx);
return getDataTable(list);
}
/**
* 导出规范建设-直属单位考核评价否决项列表
*/
@Log(title = "规范建设-直属单位考核评价否决项", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SjGfjsZsdwkhpjfjx sjGfjsZsdwkhpjfjx)
{
List<SjGfjsZsdwkhpjfjx> list = sjGfjsZsdwkhpjfjxService.selectSjGfjsZsdwkhpjfjxList(sjGfjsZsdwkhpjfjx);
Workbook exl = null;
OutputStream out = null;
InputStream in = null;
try {
in =this.getClass().getResourceAsStream("/static/gfjs_zsdwfjx.xlsx");
exl = WorkbookFactory.create(in);
out = response.getOutputStream();
response.reset();
String filename = URLEncoder.encode("否决项.xlsx", "UTF-8");
response.setCharacterEncoding("UTF-8");
response.setHeader("Content-Disposition", "attachment;filename=" + filename);
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
Sheet sheet = exl.getSheet("Sheet1");
// sheet.getRow(0).getCell(0).setCellValue(sjGfjsZsdwkhpj.getNd()+"年"+sjGfjsZsdwkhpj.getZqfw()+sjGfjsZsdwkhpj.getDeptName());
CellStyle cellStyle = exl.createCellStyle();
cellStyle.setWrapText(true);
cellStyle.setAlignment(HorizontalAlignment.LEFT);
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
cellStyle.setBorderBottom(BorderStyle.THIN);
cellStyle.setBottomBorderColor(IndexedColors.BLACK.getIndex());
cellStyle.setBorderLeft(BorderStyle.THIN);
cellStyle.setLeftBorderColor(IndexedColors.BLACK.getIndex());
cellStyle.setBorderRight(BorderStyle.THIN);
cellStyle.setRightBorderColor(IndexedColors.BLACK.getIndex());
cellStyle.setBorderTop(BorderStyle.THIN);
cellStyle.setTopBorderColor(IndexedColors.BLACK.getIndex());
String deptName="";
int lastRow = sheet.getLastRowNum()+1;
for( SjGfjsZsdwkhpjfjx zsdwkhpj:list){
deptName= zsdwkhpj.getDeptName();;
Row row = sheet.createRow(lastRow);
row.setHeightInPoints(18);
int m = 0;
Cell cell = row.createCell(m++);cell.setCellStyle(cellStyle); cell.setCellValue(zsdwkhpj.getFlmc());
cell = row.createCell(m++);cell.setCellStyle(cellStyle); cell.setCellValue(zsdwkhpj.getPjbzmc());
cell = row.createCell(m++);cell.setCellStyle(cellStyle); cell.setCellValue(zsdwkhpj.getSffs());
cell = row.createCell(m++);cell.setCellStyle(cellStyle); cell.setCellValue(zsdwkhpj.getWtms());
cell = row.createCell(m++);cell.setCellStyle(cellStyle); cell.setCellValue(zsdwkhpj.getId());
cell = row.createCell(m++);cell.setCellStyle(cellStyle); cell.setCellValue(zsdwkhpj.getZbId());
lastRow++;
}
//合并行
mergeCellsByColumn(sheet,0);
sheet.getRow(0).getCell(0).setCellValue(sjGfjsZsdwkhpjfjx.getNd()+sjGfjsZsdwkhpjfjx.getZqfw()+deptName+"否决项评价");
exl.write(out);
exl.close();
}catch (Exception e){
e.getMessage();
throw new BusinessException("导出Excel失败,请联系网站管理员!");
}finally {
if (exl != null) {
try {
exl.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
if (out != null) {
try {
out.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
}
// 根据某一列的值是否相同,对其他列的单元格进行合并
private static void mergeCellsByColumn(Sheet sheet, int columnIndex) {
Map<String, Integer> groups = new HashMap<>();
// 遍历该列,记录相同值的行索引
int start=1;
int end=1;
String old="";
for (int i = 1; i <= sheet.getLastRowNum(); i++) {
Row row = sheet.getRow(i);
Cell cell = row.getCell(columnIndex);
String cellValue = cell.getStringCellValue();
if (!groups.containsKey(cellValue)) {
if(groups.get(old)!=null){
start = groups.get(old);
}
old=cellValue;
groups.put(cellValue, i);
//合并行
mergeCellsInRange(sheet, columnIndex, start, end);
start=i;
end=i;
} else {
end++;
if(i==sheet.getLastRowNum()){
mergeCellsInRange(sheet, columnIndex, start, end);
}
}
}
}
// 合并指定范围内的单元格
private static void mergeCellsInRange(Sheet sheet, int columnIndex, int startIndex, int endIndex) {
if(startIndex!=endIndex){
sheet.addMergedRegion(new CellRangeAddress(startIndex, endIndex, columnIndex, columnIndex));
}
}
/**
* 获取规范建设-直属单位考核评价否决项详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sjGfjsZsdwkhpjfjxService.selectSjGfjsZsdwkhpjfjxById(id));
}
/**
* 新增规范建设-直属单位考核评价否决项
*/
@Log(title = "规范建设-直属单位考核评价否决项", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SjGfjsZsdwkhpjfjx sjGfjsZsdwkhpjfjx)
{
return toAjax(sjGfjsZsdwkhpjfjxService.insertSjGfjsZsdwkhpjfjx(sjGfjsZsdwkhpjfjx));
}
/**
* 修改规范建设-直属单位考核评价否决项
*/
@Log(title = "规范建设-直属单位考核评价否决项", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SjGfjsZsdwkhpjfjx sjGfjsZsdwkhpjfjx)
{
return toAjax(sjGfjsZsdwkhpjfjxService.updateSjGfjsZsdwkhpjfjx(sjGfjsZsdwkhpjfjx));
}
/**
* 删除规范建设-直属单位考核评价否决项
*/
@Log(title = "规范建设-直属单位考核评价否决项", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sjGfjsZsdwkhpjfjxService.deleteSjGfjsZsdwkhpjfjxByIds(ids));
}
/**
* 修改规范建设-直属单位考核评价否决项
*/
@Log(title = "规范建设-直属单位考核评价否决项", businessType = BusinessType.UPDATE)
@PutMapping("/pledit")
public AjaxResult pledit(@RequestBody List<SjGfjsZsdwkhpjfjx> list)
{
return toAjax(sjGfjsZsdwkhpjfjxService.pledit(list));
}
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception{
XSSFWorkbook workbook = null;
// List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
try {
//装载流
workbook = new XSSFWorkbook(file.getInputStream());
// 获取一个工作表,下标从0开始
XSSFSheet sheet = workbook.getSheetAt(0);
int lastRowNum = sheet.getLastRowNum();
List<SjGfjsZsdwkhpjfjx> list=new ArrayList<>();
// 通过循环,逐行取出表中每行数据
for(int i=0;i<=lastRowNum;i++) {//跳过第一行和第二行
if(i==0 || i==1){
continue;
}
// 获取行
XSSFRow row = sheet.getRow(i);
SjGfjsZsdwkhpjfjx zsdwkhpj=new SjGfjsZsdwkhpjfjx();
System.out.println(row);
//id
String id=new DataFormatter().formatCellValue(row.getCell(4));
if(StringUtils.isEmpty(id)){
return AjaxResult.error("id不能为空");
}
zsdwkhpj.setId(Long.parseLong(id));
//主表id
String zbid=new DataFormatter().formatCellValue(row.getCell(5));
if(StringUtils.isEmpty(zbid)){
return AjaxResult.error("主表id不能为空");
}
zsdwkhpj.setZbId(Long.parseLong(zbid));
//是否发生
String sffs=new DataFormatter().formatCellValue(row.getCell(2));
zsdwkhpj.setSffs(sffs);
//问题描述
String wtms=new DataFormatter().formatCellValue(row.getCell(3));
zsdwkhpj.setWtms(wtms);
list.add(zsdwkhpj);
}
if(list.size()>0){
sjGfjsZsdwkhpjfjxService.pledit(list);
}
} catch (IOException e) {
e.getMessage();
e.printStackTrace();
throw new BusinessException("导入Excel失败,请联系网站管理员!");
} finally {
workbook.close();
}
return AjaxResult.success("导入成功");
}
}
package com.qianhe.domain;
import com.qianhe.common.annotation.Excel;
import com.qianhe.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 规范建设-直属单位否决项采集对象 sj_zdbf_zsdwfjxcj
*
* @author qianhe
* @date 2024-07-24
*/
@Data
public class SjGfjsZsdwfjxcj extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 单位id */
@Excel(name = "单位id")
private Long deptId;
/** 日期 */
@Excel(name = "日期")
private String rq;
/** 分类名称 */
@Excel(name = "分类名称")
private String flmc;
/** 评价标准id */
@Excel(name = "评价标准id")
private String pjbzid;
/** 评价标准名称 */
@Excel(name = "评价标准名称")
private String pjbzmc;
/** 问题描述 */
@Excel(name = "问题描述")
private String wtmc;
/** 预留1 */
@Excel(name = "预留1")
private String yl1;
/** 预留2 */
@Excel(name = "预留2")
private String yl2;
/** 预留3 */
@Excel(name = "预留3")
private Long yl3;
/** 预留4 */
@Excel(name = "预留4")
private String yl4;
/** 预留5 */
@Excel(name = "预留5")
private String yl5;
private String deptName;
private String startRq;
private String endRq;
private String deptLx;
private String yl3name;
}
package com.qianhe.domain;
import com.qianhe.common.annotation.Excel;
import com.qianhe.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.poi.ss.usermodel.IndexedColors;
/**
* 规范建设-直属单位考核评价否决项对象 sj_gfjs_zsdwkhpjfjx
*
* @author qianhe
* @date 2024-07-24
*/
@Data
public class SjGfjsZsdwkhpjfjx extends BaseEntity
{
private static final long serialVersionUID = 1L;
@Excel(name = "单位名称)")
private String deptName;
/** 年度 */
@Excel(name = "年度")
private String nd;
/** 周期范围(第一季度-第四季度、上半年、下半年) */
@Excel(name = "周期范围")
private String zqfw;
/** 周期类型(季度、半年度、年度) */
// @Excel(name = "周期类型", readConverterExp = "季=度、半年度、年度")
private String zqlx;
/** 级别(直属单位(半年度)、基层单位(季度)、三基帮扶组(年度)) */
// @Excel(name = "级别", readConverterExp = "直=属单位(半年度")
private String jb;
/** 分类名称 */
@Excel(name = "分类名称")
private String flmc;
/** 评价标准名称 */
@Excel(name = "评价标准")
private String pjbzmc;
/** 是否发生 */
@Excel(name = "是否发生")
private String sffs;
/** 问题描述 */
@Excel(name = "问题描述")
private String wtms;
/** 预留1 */
// @Excel(name = "预留1")
private Long yl1;
/** 预留2 */
// @Excel(name = "预留2")
private String yl2;
/** 预留3 */
// @Excel(name = "预留3")
private String yl3;
/** 预留4 */
// @Excel(name = "预留4")
private String yl4;
/** 预留5 */
// @Excel(name = "预留5")
private String yl5;
/** 主键 */
@Excel(name = "id(勿动)",headerColor = IndexedColors.RED1)
private Long id;
/** 主表id */
@Excel(name = "主表id(勿动)",headerColor = IndexedColors.RED1)
private Long zbId;
/** 单位id */
@Excel(name = "单位id(勿动)",headerColor = IndexedColors.RED1)
private Long deptId;
/** 评价标准id */
@Excel(name = "评价标准id")
private String pjbzid;
}
package com.qianhe.mapper;
import com.qianhe.domain.SjGfjsZsdwwtcj;
import java.util.List;
/**
* 规范建设-机关部门检查Mapper接口
*
* @author qianhe
* @date 2024-07-23
*/
public interface SjGfjsJgbmjcMapper
{
/**
* 查询规范建设-机关部门检查
*
* @param id 规范建设-机关部门检查主键
* @return 规范建设-机关部门检查
*/
public SjGfjsZsdwwtcj selectSjGfjsZsdwwtcjById(Long id);
/**
* 查询规范建设-机关部门检查列表
*
* @param sjGfjsZsdwwtcj 规范建设-机关部门检查
* @return 规范建设-机关部门检查集合
*/
public List<SjGfjsZsdwwtcj> selectSjGfjsZsdwwtcjList(SjGfjsZsdwwtcj sjGfjsZsdwwtcj);
/**
* 新增规范建设-机关部门检查
*
* @param sjGfjsZsdwwtcj 规范建设-机关部门检查
* @return 结果
*/
public int insertSjGfjsZsdwwtcj(SjGfjsZsdwwtcj sjGfjsZsdwwtcj);
/**
* 修改规范建设-机关部门检查
*
* @param sjGfjsZsdwwtcj 规范建设-机关部门检查
* @return 结果
*/
public int updateSjGfjsZsdwwtcj(SjGfjsZsdwwtcj sjGfjsZsdwwtcj);
/**
* 删除规范建设-机关部门检查
*
* @param id 规范建设-机关部门检查主键
* @return 结果
*/
public int deleteSjGfjsZsdwwtcjById(Long id);
/**
* 批量删除规范建设-机关部门检查
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSjGfjsZsdwwtcjByIds(Long[] ids);
int batchSave(List<SjGfjsZsdwwtcj> list);
}
package com.qianhe.mapper;
import com.qianhe.domain.SjGfjsZsdwfjxcj;
import java.util.List;
/**
* 规范建设-直属单位否决项采集Mapper接口
*
* @author qianhe
* @date 2024-07-24
*/
public interface SjGfjsZsdwfjxcjMapper
{
/**
* 查询规范建设-直属单位否决项采集
*
* @param id 规范建设-直属单位否决项采集主键
* @return 规范建设-直属单位否决项采集
*/
public SjGfjsZsdwfjxcj selectSjGfjsZsdwfjxcjById(Long id);
/**
* 查询规范建设-直属单位否决项采集列表
*
* @param sjGfjsZsdwfjxcj 规范建设-直属单位否决项采集
* @return 规范建设-直属单位否决项采集集合
*/
public List<SjGfjsZsdwfjxcj> selectSjGfjsZsdwfjxcjList(SjGfjsZsdwfjxcj sjGfjsZsdwfjxcj);
/**
* 新增规范建设-直属单位否决项采集
*
* @param sjGfjsZsdwfjxcj 规范建设-直属单位否决项采集
* @return 结果
*/
public int insertSjGfjsZsdwfjxcj(SjGfjsZsdwfjxcj sjGfjsZsdwfjxcj);
/**
* 修改规范建设-直属单位否决项采集
*
* @param sjGfjsZsdwfjxcj 规范建设-直属单位否决项采集
* @return 结果
*/
public int updateSjGfjsZsdwfjxcj(SjGfjsZsdwfjxcj sjGfjsZsdwfjxcj);
/**
* 删除规范建设-直属单位否决项采集
*
* @param id 规范建设-直属单位否决项采集主键
* @return 结果
*/
public int deleteSjGfjsZsdwfjxcjById(Long id);
/**
* 批量删除规范建设-直属单位否决项采集
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSjGfjsZsdwfjxcjByIds(Long[] ids);
int batchSave(List<SjGfjsZsdwfjxcj> list);
}
package com.qianhe.mapper;
import com.qianhe.domain.SjGfjsZsdwkhpjfjx;
import java.util.List;
/**
* 规范建设-直属单位考核评价否决项Mapper接口
*
* @author qianhe
* @date 2024-07-24
*/
public interface SjGfjsZsdwkhpjfjxMapper
{
/**
* 查询规范建设-直属单位考核评价否决项
*
* @param id 规范建设-直属单位考核评价否决项主键
* @return 规范建设-直属单位考核评价否决项
*/
public SjGfjsZsdwkhpjfjx selectSjGfjsZsdwkhpjfjxById(Long id);
/**
* 查询规范建设-直属单位考核评价否决项列表
*
* @param sjGfjsZsdwkhpjfjx 规范建设-直属单位考核评价否决项
* @return 规范建设-直属单位考核评价否决项集合
*/
public List<SjGfjsZsdwkhpjfjx> selectSjGfjsZsdwkhpjfjxList(SjGfjsZsdwkhpjfjx sjGfjsZsdwkhpjfjx);
/**
* 新增规范建设-直属单位考核评价否决项
*
* @param sjGfjsZsdwkhpjfjx 规范建设-直属单位考核评价否决项
* @return 结果
*/
public int insertSjGfjsZsdwkhpjfjx(SjGfjsZsdwkhpjfjx sjGfjsZsdwkhpjfjx);
/**
* 修改规范建设-直属单位考核评价否决项
*
* @param sjGfjsZsdwkhpjfjx 规范建设-直属单位考核评价否决项
* @return 结果
*/
public int updateSjGfjsZsdwkhpjfjx(SjGfjsZsdwkhpjfjx sjGfjsZsdwkhpjfjx);
/**
* 删除规范建设-直属单位考核评价否决项
*
* @param id 规范建设-直属单位考核评价否决项主键
* @return 结果
*/
public int deleteSjGfjsZsdwkhpjfjxById(Long id);
/**
* 批量删除规范建设-直属单位考核评价否决项
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSjGfjsZsdwkhpjfjxByIds(Long[] ids);
int batchSave(List<SjGfjsZsdwkhpjfjx> fjxList);
int pledit(List<SjGfjsZsdwkhpjfjx> list);
}
package com.qianhe.service;
import com.qianhe.domain.SjGfjsZsdwwtcj;
import java.util.List;
/**
* 规范建设-机关部门检查Service接口
*
* @author qianhe
* @date 2024-07-23
*/
public interface ISjGfjsJgbmjcService
{
/**
* 查询规范建设-机关部门检查
*
* @param id 规范建设-机关部门检查主键
* @return 规范建设-机关部门检查
*/
public SjGfjsZsdwwtcj selectSjGfjsZsdwwtcjById(Long id);
/**
* 查询规范建设-机关部门检查列表
*
* @param sjGfjsZsdwwtcj 规范建设-机关部门检查
* @return 规范建设-机关部门检查集合
*/
public List<SjGfjsZsdwwtcj> selectSjGfjsZsdwwtcjList(SjGfjsZsdwwtcj sjGfjsZsdwwtcj);
/**
* 新增规范建设-机关部门检查
*
* @param sjGfjsZsdwwtcj 规范建设-机关部门检查
* @return 结果
*/
public int insertSjGfjsZsdwwtcj(SjGfjsZsdwwtcj sjGfjsZsdwwtcj);
/**
* 修改规范建设-机关部门检查
*
* @param sjGfjsZsdwwtcj 规范建设-机关部门检查
* @return 结果
*/
public int updateSjGfjsZsdwwtcj(SjGfjsZsdwwtcj sjGfjsZsdwwtcj);
/**
* 批量删除规范建设-机关部门检查
*
* @param ids 需要删除的规范建设-机关部门检查主键集合
* @return 结果
*/
public int deleteSjGfjsZsdwwtcjByIds(Long[] ids);
/**
* 删除规范建设-机关部门检查信息
*
* @param id 规范建设-机关部门检查主键
* @return 结果
*/
public int deleteSjGfjsZsdwwtcjById(Long id);
int batchSave(List<SjGfjsZsdwwtcj> list);
}
package com.qianhe.service;
import com.qianhe.domain.SjGfjsZsdwfjxcj;
import java.util.List;
/**
* 规范建设-直属单位否决项采集Service接口
*
* @author qianhe
* @date 2024-07-24
*/
public interface ISjGfjsZsdwfjxcjService
{
/**
* 查询规范建设-直属单位否决项采集
*
* @param id 规范建设-直属单位否决项采集主键
* @return 规范建设-直属单位否决项采集
*/
public SjGfjsZsdwfjxcj selectSjGfjsZsdwfjxcjById(Long id);
/**
* 查询规范建设-直属单位否决项采集列表
*
* @param sjGfjsZsdwfjxcj 规范建设-直属单位否决项采集
* @return 规范建设-直属单位否决项采集集合
*/
public List<SjGfjsZsdwfjxcj> selectSjGfjsZsdwfjxcjList(SjGfjsZsdwfjxcj sjGfjsZsdwfjxcj);
/**
* 新增规范建设-直属单位否决项采集
*
* @param sjGfjsZsdwfjxcj 规范建设-直属单位否决项采集
* @return 结果
*/
public int insertSjGfjsZsdwfjxcj(SjGfjsZsdwfjxcj sjGfjsZsdwfjxcj);
/**
* 修改规范建设-直属单位否决项采集
*
* @param sjGfjsZsdwfjxcj 规范建设-直属单位否决项采集
* @return 结果
*/
public int updateSjGfjsZsdwfjxcj(SjGfjsZsdwfjxcj sjGfjsZsdwfjxcj);
/**
* 批量删除规范建设-直属单位否决项采集
*
* @param ids 需要删除的规范建设-直属单位否决项采集主键集合
* @return 结果
*/
public int deleteSjGfjsZsdwfjxcjByIds(Long[] ids);
/**
* 删除规范建设-直属单位否决项采集信息
*
* @param id 规范建设-直属单位否决项采集主键
* @return 结果
*/
public int deleteSjGfjsZsdwfjxcjById(Long id);
int batchSave(List<SjGfjsZsdwfjxcj> list);
}
package com.qianhe.service;
import com.qianhe.domain.SjGfjsZsdwkhpj;
import java.util.List;
/**
* 规范建设-直属单位考核评价Service接口
*
* @author qianhe
* @date 2024-07-24
*/
public interface ISjGfjsZsdwkhpjService
{
/**
* 查询规范建设-直属单位考核评价
*
* @param id 规范建设-直属单位考核评价主键
* @return 规范建设-直属单位考核评价
*/
public SjGfjsZsdwkhpj selectSjGfjsZsdwkhpjById(Long id);
/**
* 查询规范建设-直属单位考核评价列表
*
* @param sjGfjsZsdwkhpj 规范建设-直属单位考核评价
* @return 规范建设-直属单位考核评价集合
*/
public List<SjGfjsZsdwkhpj> selectSjGfjsZsdwkhpjList(SjGfjsZsdwkhpj sjGfjsZsdwkhpj);
/**
* 新增规范建设-直属单位考核评价
*
* @param sjGfjsZsdwkhpj 规范建设-直属单位考核评价
* @return 结果
*/
public int insertSjGfjsZsdwkhpj(SjGfjsZsdwkhpj sjGfjsZsdwkhpj);
/**
* 修改规范建设-直属单位考核评价
*
* @param sjGfjsZsdwkhpj 规范建设-直属单位考核评价
* @return 结果
*/
public int updateSjGfjsZsdwkhpj(SjGfjsZsdwkhpj sjGfjsZsdwkhpj);
/**
* 批量删除规范建设-直属单位考核评价
*
* @param ids 需要删除的规范建设-直属单位考核评价主键集合
* @return 结果
*/
public int deleteSjGfjsZsdwkhpjByIds(Long[] ids);
/**
* 删除规范建设-直属单位考核评价信息
*
* @param id 规范建设-直属单位考核评价主键
* @return 结果
*/
public int deleteSjGfjsZsdwkhpjById(Long id);
int batchSave(List<SjGfjsZsdwkhpj> addList);
int pledit(List<SjGfjsZsdwkhpj> list);
}
package com.qianhe.service;
import com.qianhe.domain.SjGfjsZsdwkhpjfjx;
import java.util.List;
/**
* 规范建设-直属单位考核评价否决项Service接口
*
* @author qianhe
* @date 2024-07-24
*/
public interface ISjGfjsZsdwkhpjfjxService
{
/**
* 查询规范建设-直属单位考核评价否决项
*
* @param id 规范建设-直属单位考核评价否决项主键
* @return 规范建设-直属单位考核评价否决项
*/
public SjGfjsZsdwkhpjfjx selectSjGfjsZsdwkhpjfjxById(Long id);
/**
* 查询规范建设-直属单位考核评价否决项列表
*
* @param sjGfjsZsdwkhpjfjx 规范建设-直属单位考核评价否决项
* @return 规范建设-直属单位考核评价否决项集合
*/
public List<SjGfjsZsdwkhpjfjx> selectSjGfjsZsdwkhpjfjxList(SjGfjsZsdwkhpjfjx sjGfjsZsdwkhpjfjx);
/**
* 新增规范建设-直属单位考核评价否决项
*
* @param sjGfjsZsdwkhpjfjx 规范建设-直属单位考核评价否决项
* @return 结果
*/
public int insertSjGfjsZsdwkhpjfjx(SjGfjsZsdwkhpjfjx sjGfjsZsdwkhpjfjx);
/**
* 修改规范建设-直属单位考核评价否决项
*
* @param sjGfjsZsdwkhpjfjx 规范建设-直属单位考核评价否决项
* @return 结果
*/
public int updateSjGfjsZsdwkhpjfjx(SjGfjsZsdwkhpjfjx sjGfjsZsdwkhpjfjx);
/**
* 批量删除规范建设-直属单位考核评价否决项
*
* @param ids 需要删除的规范建设-直属单位考核评价否决项主键集合
* @return 结果
*/
public int deleteSjGfjsZsdwkhpjfjxByIds(Long[] ids);
/**
* 删除规范建设-直属单位考核评价否决项信息
*
* @param id 规范建设-直属单位考核评价否决项主键
* @return 结果
*/
public int deleteSjGfjsZsdwkhpjfjxById(Long id);
int batchSave(List<SjGfjsZsdwkhpjfjx> fjxList);
int pledit(List<SjGfjsZsdwkhpjfjx> list);
}
package com.qianhe.service.impl;
import com.qianhe.common.annotation.DataScope;
import com.qianhe.common.utils.DateUtils;
import com.qianhe.common.utils.SecurityUtils;
import com.qianhe.domain.SjGfjsZsdwwtcj;
import com.qianhe.mapper.SjGfjsJgbmjcMapper;
import com.qianhe.service.ISjGfjsJgbmjcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 规范建设-机关部门检查Service业务层处理
*
* @author qianhe
* @date 2024-07-23
*/
@Service
public class SjGfjsJgbmjcServiceImpl implements ISjGfjsJgbmjcService
{
@Autowired
private SjGfjsJgbmjcMapper sjGfjsJcdwwtcjMapper;
/**
* 查询规范建设-机关部门检查
*
* @param id 规范建设-机关部门检查主键
* @return 规范建设-机关部门检查
*/
@Override
public SjGfjsZsdwwtcj selectSjGfjsZsdwwtcjById(Long id)
{
SjGfjsZsdwwtcj zsdwwtcj = sjGfjsJcdwwtcjMapper.selectSjGfjsZsdwwtcjById(id);
return zsdwwtcj;
}
/**
* 查询规范建设-机关部门检查列表
*
* @param sjGfjsZsdwwtcj 规范建设-机关部门检查
* @return 规范建设-机关部门检查
*/
@Override
@DataScope(deptAlias = "c")
public List<SjGfjsZsdwwtcj> selectSjGfjsZsdwwtcjList(SjGfjsZsdwwtcj sjGfjsZsdwwtcj)
{
return sjGfjsJcdwwtcjMapper.selectSjGfjsZsdwwtcjList(sjGfjsZsdwwtcj);
}
/**
* 新增规范建设-机关部门检查
*
* @param sjGfjsZsdwwtcj 规范建设-机关部门检查
* @return 结果
*/
@Override
public int insertSjGfjsZsdwwtcj(SjGfjsZsdwwtcj sjGfjsZsdwwtcj)
{
sjGfjsZsdwwtcj.setCreateTime(DateUtils.getNowDate());
sjGfjsZsdwwtcj.setCreateBy(SecurityUtils.getUsername());
return sjGfjsJcdwwtcjMapper.insertSjGfjsZsdwwtcj(sjGfjsZsdwwtcj);
}
/**
* 修改规范建设-机关部门检查
*
* @param sjGfjsZsdwwtcj 规范建设-机关部门检查
* @return 结果
*/
@Override
public int updateSjGfjsZsdwwtcj(SjGfjsZsdwwtcj sjGfjsZsdwwtcj)
{
sjGfjsZsdwwtcj.setUpdateTime(DateUtils.getNowDate());
sjGfjsZsdwwtcj.setUpdateBy(SecurityUtils.getUsername());
return sjGfjsJcdwwtcjMapper.updateSjGfjsZsdwwtcj(sjGfjsZsdwwtcj);
}
/**
* 批量删除规范建设-机关部门检查
*
* @param ids 需要删除的规范建设-机关部门检查主键
* @return 结果
*/
@Override
public int deleteSjGfjsZsdwwtcjByIds(Long[] ids)
{
return sjGfjsJcdwwtcjMapper.deleteSjGfjsZsdwwtcjByIds(ids);
}
/**
* 删除规范建设-机关部门检查信息
*
* @param id 规范建设-机关部门检查主键
* @return 结果
*/
@Override
public int deleteSjGfjsZsdwwtcjById(Long id)
{
return sjGfjsJcdwwtcjMapper.deleteSjGfjsZsdwwtcjById(id);
}
@Override
public int batchSave(List<SjGfjsZsdwwtcj> list) {
return sjGfjsJcdwwtcjMapper.batchSave(list);
}
}
package com.qianhe.service.impl;
import com.qianhe.common.annotation.DataScope;
import com.qianhe.common.utils.DateUtils;
import com.qianhe.common.utils.SecurityUtils;
import com.qianhe.domain.SjGfjsZsdwfjxcj;
import com.qianhe.mapper.SjGfjsZsdwfjxcjMapper;
import com.qianhe.service.ISjGfjsZsdwfjxcjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 规范建设-直属单位否决项采集Service业务层处理
*
* @author qianhe
* @date 2024-07-24
*/
@Service
public class SjGfjsZsdwfjxcjServiceImpl implements ISjGfjsZsdwfjxcjService
{
@Autowired
private SjGfjsZsdwfjxcjMapper sjGfjsZsdwfjxcjMapper;
/**
* 查询规范建设-直属单位否决项采集
*
* @param id 规范建设-直属单位否决项采集主键
* @return 规范建设-直属单位否决项采集
*/
@Override
public SjGfjsZsdwfjxcj selectSjGfjsZsdwfjxcjById(Long id)
{
return sjGfjsZsdwfjxcjMapper.selectSjGfjsZsdwfjxcjById(id);
}
/**
* 查询规范建设-直属单位否决项采集列表
*
* @param sjGfjsZsdwfjxcj 规范建设-直属单位否决项采集
* @return 规范建设-直属单位否决项采集
*/
@Override
@DataScope(deptAlias = "c")
public List<SjGfjsZsdwfjxcj> selectSjGfjsZsdwfjxcjList(SjGfjsZsdwfjxcj sjGfjsZsdwfjxcj)
{
return sjGfjsZsdwfjxcjMapper.selectSjGfjsZsdwfjxcjList(sjGfjsZsdwfjxcj);
}
/**
* 新增规范建设-直属单位否决项采集
*
* @param sjGfjsZsdwfjxcj 规范建设-直属单位否决项采集
* @return 结果
*/
@Override
public int insertSjGfjsZsdwfjxcj(SjGfjsZsdwfjxcj sjGfjsZsdwfjxcj)
{
sjGfjsZsdwfjxcj.setCreateTime(DateUtils.getNowDate());
sjGfjsZsdwfjxcj.setCreateBy(SecurityUtils.getUsername());
return sjGfjsZsdwfjxcjMapper.insertSjGfjsZsdwfjxcj(sjGfjsZsdwfjxcj);
}
/**
* 修改规范建设-直属单位否决项采集
*
* @param sjGfjsZsdwfjxcj 规范建设-直属单位否决项采集
* @return 结果
*/
@Override
public int updateSjGfjsZsdwfjxcj(SjGfjsZsdwfjxcj sjGfjsZsdwfjxcj)
{
sjGfjsZsdwfjxcj.setUpdateTime(DateUtils.getNowDate());
sjGfjsZsdwfjxcj.setUpdateBy(SecurityUtils.getUsername());
return sjGfjsZsdwfjxcjMapper.updateSjGfjsZsdwfjxcj(sjGfjsZsdwfjxcj);
}
/**
* 批量删除规范建设-直属单位否决项采集
*
* @param ids 需要删除的规范建设-直属单位否决项采集主键
* @return 结果
*/
@Override
public int deleteSjGfjsZsdwfjxcjByIds(Long[] ids)
{
return sjGfjsZsdwfjxcjMapper.deleteSjGfjsZsdwfjxcjByIds(ids);
}
/**
* 删除规范建设-直属单位否决项采集信息
*
* @param id 规范建设-直属单位否决项采集主键
* @return 结果
*/
@Override
public int deleteSjGfjsZsdwfjxcjById(Long id)
{
return sjGfjsZsdwfjxcjMapper.deleteSjGfjsZsdwfjxcjById(id);
}
@Override
public int batchSave(List<SjGfjsZsdwfjxcj> list) {
return sjGfjsZsdwfjxcjMapper.batchSave(list);
}
}
package com.qianhe.service.impl;
import com.qianhe.common.annotation.DataScope;
import com.qianhe.common.core.domain.entity.SysDept;
import com.qianhe.common.core.domain.entity.SysDictData;
import com.qianhe.common.utils.DateUtils;
import com.qianhe.common.utils.SecurityUtils;
import com.qianhe.common.utils.StringUtils;
import com.qianhe.domain.SjGfjsZsdwkhpj;
import com.qianhe.domain.SjGfjsZsdwkhpjZb;
import com.qianhe.mapper.SjGfjsZsdwkhpjMapper;
import com.qianhe.mapper.SjGfjsZsdwkhpjZbMapper;
import com.qianhe.service.ISjGfjsZsdwkhpjService;
import com.qianhe.system.mapper.SysDeptMapper;
import com.qianhe.system.mapper.SysDictDataMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 规范建设-直属单位考核评价Service业务层处理
*
* @author qianhe
* @date 2024-07-24
*/
@Service
public class SjGfjsZsdwkhpjServiceImpl implements ISjGfjsZsdwkhpjService
{
@Autowired
private SjGfjsZsdwkhpjMapper sjGfjsZsdwkhpjMapper;
@Autowired
private SjGfjsZsdwkhpjZbMapper sjGfjsZsdwkhpjZbMapper;
@Autowired
private SysDictDataMapper sysDictDataMapper;
@Autowired
private SysDeptMapper sysDeptMapper;
/**
* 查询规范建设-直属单位考核评价
*
* @param id 规范建设-直属单位考核评价主键
* @return 规范建设-直属单位考核评价
*/
@Override
public SjGfjsZsdwkhpj selectSjGfjsZsdwkhpjById(Long id)
{
return sjGfjsZsdwkhpjMapper.selectSjGfjsZsdwkhpjById(id);
}
/**
* 查询规范建设-直属单位考核评价列表
*
* @param sjGfjsZsdwkhpj 规范建设-直属单位考核评价
* @return 规范建设-直属单位考核评价
*/
@Override
@DataScope(deptAlias = "d")
public List<SjGfjsZsdwkhpj> selectSjGfjsZsdwkhpjList(SjGfjsZsdwkhpj sjGfjsZsdwkhpj)
{
return sjGfjsZsdwkhpjMapper.selectSjGfjsZsdwkhpjList(sjGfjsZsdwkhpj);
}
/**
* 新增规范建设-直属单位考核评价
*
* @param sjGfjsZsdwkhpj 规范建设-直属单位考核评价
* @return 结果
*/
@Override
public int insertSjGfjsZsdwkhpj(SjGfjsZsdwkhpj sjGfjsZsdwkhpj)
{
sjGfjsZsdwkhpj.setCreateTime(DateUtils.getNowDate());
return sjGfjsZsdwkhpjMapper.insertSjGfjsZsdwkhpj(sjGfjsZsdwkhpj);
}
/**
* 修改规范建设-直属单位考核评价
*
* @param sjGfjsZsdwkhpj 规范建设-直属单位考核评价
* @return 结果
*/
@Override
public int updateSjGfjsZsdwkhpj(SjGfjsZsdwkhpj sjGfjsZsdwkhpj)
{
sjGfjsZsdwkhpj.setUpdateTime(DateUtils.getNowDate());
sjGfjsZsdwkhpj.setUpdateBy(SecurityUtils.getUsername());
//计算分数
return sjGfjsZsdwkhpjMapper.updateSjGfjsZsdwkhpj(sjGfjsZsdwkhpj);
}
/**
* 批量删除规范建设-直属单位考核评价
*
* @param ids 需要删除的规范建设-直属单位考核评价主键
* @return 结果
*/
@Override
public int deleteSjGfjsZsdwkhpjByIds(Long[] ids)
{
return sjGfjsZsdwkhpjMapper.deleteSjGfjsZsdwkhpjByIds(ids);
}
/**
* 删除规范建设-直属单位考核评价信息
*
* @param id 规范建设-直属单位考核评价主键
* @return 结果
*/
@Override
public int deleteSjGfjsZsdwkhpjById(Long id)
{
return sjGfjsZsdwkhpjMapper.deleteSjGfjsZsdwkhpjById(id);
}
@Override
public int batchSave(List<SjGfjsZsdwkhpj> addList) {
return sjGfjsZsdwkhpjMapper.batchSave(addList);
}
@Override
public int pledit(List<SjGfjsZsdwkhpj> list) {
//计算分数
SjGfjsZsdwkhpj sjGfjsZsdwkhpj = list.get(0);
SjGfjsZsdwkhpjZb sjGfjsZsdwkhpjZb = sjGfjsZsdwkhpjZbMapper.selectSjGfjsZsdwkhpjZbById(sjGfjsZsdwkhpj.getZbId());
SysDept dept = sysDeptMapper.selectDeptById(sjGfjsZsdwkhpjZb.getDeptId());
Map<String,List<SjGfjsZsdwkhpj>> stringListMap = list.stream().collect(Collectors.groupingBy(SjGfjsZsdwkhpj::getKhnr));
List<SysDictData> GfjsKhnr = sysDictDataMapper.selectDictDataByType("gfjs_sslj");
for(SysDictData data:GfjsKhnr){
String dictValue = data.getDictValue();
List<SjGfjsZsdwkhpj> sjGfjsZsdwkhpjs = stringListMap.get(data.getDictValue());
//计算分数
List<Double> doubleList=new ArrayList<>();
if(sjGfjsZsdwkhpjs==null){
continue;
}
// sjGfjsZsdwkhpjs.forEach(item->{
// if(StringUtils.isEmpty(item.getKhfz())){
// item.setKhfz("0");
// }
// doubleList.add(Double.parseDouble(item.getKhfz()));
// });
// double kf = doubleList.stream().mapToDouble(Double::doubleValue).sum();
// if("党建引领".equals(dictValue)){
// //扣分
// sjGfjsZsdwkhpjZb.setDjyjkfs(new BigDecimal(kf));
// //扣分比列
// BigDecimal df = sjGfjsZsdwkhpjZb.getDjyjzfs().add(new BigDecimal(kf));
// BigDecimal kfbl =df.divide(sjGfjsZsdwkhpjZb.getDjyjzfs(),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
// sjGfjsZsdwkhpjZb.setDjyjkfbl(new BigDecimal(100).subtract(kfbl));
// //得分
// sjGfjsZsdwkhpjZb.setDjyjdf(df);
//
//
// } else if ("素质提升".equals(dictValue)) {
////扣分
// sjGfjsZsdwkhpjZb.setSztskfs(new BigDecimal(kf));
// //扣分比列
// BigDecimal df = sjGfjsZsdwkhpjZb.getSztszfs().add(new BigDecimal(kf));
// BigDecimal kfbl =df.divide(sjGfjsZsdwkhpjZb.getSztszfs(),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
// sjGfjsZsdwkhpjZb.setSztsfbl(new BigDecimal(100).subtract(kfbl));
// //得分
// sjGfjsZsdwkhpjZb.setSztsdf(df);
// } else if ("管理精益".equals(dictValue)) {
// sjGfjsZsdwkhpjZb.setGlgfkfs(new BigDecimal(kf));
// //扣分比列
// BigDecimal df = sjGfjsZsdwkhpjZb.getGlgfzfs().add(new BigDecimal(kf));
// BigDecimal kfbl =df.divide(sjGfjsZsdwkhpjZb.getGlgfzfs(),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
// sjGfjsZsdwkhpjZb.setGlgfbl(new BigDecimal(100).subtract(kfbl));
// //得分
// sjGfjsZsdwkhpjZb.setGlgfdf(df);
// } else if ("业务创效".equals(dictValue)) {
// sjGfjsZsdwkhpjZb.setYwcxkfs(new BigDecimal(kf));
// //扣分比列
// BigDecimal df = sjGfjsZsdwkhpjZb.getYwcxzfs().add(new BigDecimal(kf));
// BigDecimal kfbl =df.divide(sjGfjsZsdwkhpjZb.getYwcxzfs(),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
// sjGfjsZsdwkhpjZb.setYwcxbl(new BigDecimal(100).subtract(kfbl));
// //得分
// sjGfjsZsdwkhpjZb.setYwcxdf(df);
// }
//
// }
//
// BigDecimal sum = sjGfjsZsdwkhpjZb.getDjyjzfs().add(sjGfjsZsdwkhpjZb.getSztszfs()).add(sjGfjsZsdwkhpjZb.getGlgfzfs()).add(sjGfjsZsdwkhpjZb.getYwcxzfs());
// //总得分
// BigDecimal sunfs = sjGfjsZsdwkhpjZb.getDjyjdf().add(sjGfjsZsdwkhpjZb.getSztsdf()).add(sjGfjsZsdwkhpjZb.getGlgfdf()).add(sjGfjsZsdwkhpjZb.getYwcxdf());
// sjGfjsZsdwkhpjZb.setZdf(sunfs);
// //总扣分
// sjGfjsZsdwkhpjZb.setZkf(sum.subtract(sunfs));
// //总扣分比例
// BigDecimal bigDecimal = sunfs.divide(sum,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
// sjGfjsZsdwkhpjZb.setZkfbl(new BigDecimal(100).subtract(bigDecimal));
// //综合得分
// String deptDfl = dept.getDeptDfl();
// if(StringUtils.isNotEmpty(deptDfl)){
// if ("B类".equals(deptDfl)) {
// sjGfjsZsdwkhpjZb.setZhdf( sunfs.multiply(new BigDecimal(0.9)).setScale(2, BigDecimal.ROUND_HALF_UP));
// }else if ("C类".equals(deptDfl)) {
// sjGfjsZsdwkhpjZb.setZhdf( sunfs.multiply(new BigDecimal(0.85)).setScale(2, BigDecimal.ROUND_HALF_UP));
// }else {
// sjGfjsZsdwkhpjZb.setZhdf(sunfs);
// }
}
//更新主表
sjGfjsZsdwkhpjZbMapper.updateSjGfjsZsdwkhpjZb(sjGfjsZsdwkhpjZb);
return sjGfjsZsdwkhpjMapper.pledit(list);
}
public static void main(String[] args) {
System.out.println(Double.parseDouble("-5"));
System.out.println(Double.parseDouble("+5"));
}
}
package com.qianhe.service.impl;
import com.qianhe.common.annotation.DataScope;
import com.qianhe.common.utils.DateUtils;
import com.qianhe.domain.SjGfjsZsdwkhpjZb;
import com.qianhe.domain.SjGfjsZsdwkhpjfjx;
import com.qianhe.mapper.SjGfjsZsdwkhpjZbMapper;
import com.qianhe.mapper.SjGfjsZsdwkhpjfjxMapper;
import com.qianhe.service.ISjGfjsZsdwkhpjfjxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;
/**
* 规范建设-直属单位考核评价否决项Service业务层处理
*
* @author qianhe
* @date 2024-07-24
*/
@Service
public class SjGfjsZsdwkhpjfjxServiceImpl implements ISjGfjsZsdwkhpjfjxService
{
@Autowired
private SjGfjsZsdwkhpjfjxMapper sjGfjsZsdwkhpjfjxMapper;
@Autowired
private SjGfjsZsdwkhpjZbMapper sjGfjsZsdwkhpjZbMapper;
/**
* 查询规范建设-直属单位考核评价否决项
*
* @param id 规范建设-直属单位考核评价否决项主键
* @return 规范建设-直属单位考核评价否决项
*/
@Override
public SjGfjsZsdwkhpjfjx selectSjGfjsZsdwkhpjfjxById(Long id)
{
return sjGfjsZsdwkhpjfjxMapper.selectSjGfjsZsdwkhpjfjxById(id);
}
/**
* 查询规范建设-直属单位考核评价否决项列表
*
* @param sjGfjsZsdwkhpjfjx 规范建设-直属单位考核评价否决项
* @return 规范建设-直属单位考核评价否决项
*/
@Override
@DataScope(deptAlias = "d")
public List<SjGfjsZsdwkhpjfjx> selectSjGfjsZsdwkhpjfjxList(SjGfjsZsdwkhpjfjx sjGfjsZsdwkhpjfjx)
{
return sjGfjsZsdwkhpjfjxMapper.selectSjGfjsZsdwkhpjfjxList(sjGfjsZsdwkhpjfjx);
}
/**
* 新增规范建设-直属单位考核评价否决项
*
* @param sjGfjsZsdwkhpjfjx 规范建设-直属单位考核评价否决项
* @return 结果
*/
@Override
public int insertSjGfjsZsdwkhpjfjx(SjGfjsZsdwkhpjfjx sjGfjsZsdwkhpjfjx)
{
sjGfjsZsdwkhpjfjx.setCreateTime(DateUtils.getNowDate());
return sjGfjsZsdwkhpjfjxMapper.insertSjGfjsZsdwkhpjfjx(sjGfjsZsdwkhpjfjx);
}
/**
* 修改规范建设-直属单位考核评价否决项
*
* @param sjGfjsZsdwkhpjfjx 规范建设-直属单位考核评价否决项
* @return 结果
*/
@Override
public int updateSjGfjsZsdwkhpjfjx(SjGfjsZsdwkhpjfjx sjGfjsZsdwkhpjfjx)
{
sjGfjsZsdwkhpjfjx.setUpdateTime(DateUtils.getNowDate());
return sjGfjsZsdwkhpjfjxMapper.updateSjGfjsZsdwkhpjfjx(sjGfjsZsdwkhpjfjx);
}
/**
* 批量删除规范建设-直属单位考核评价否决项
*
* @param ids 需要删除的规范建设-直属单位考核评价否决项主键
* @return 结果
*/
@Override
public int deleteSjGfjsZsdwkhpjfjxByIds(Long[] ids)
{
return sjGfjsZsdwkhpjfjxMapper.deleteSjGfjsZsdwkhpjfjxByIds(ids);
}
/**
* 删除规范建设-直属单位考核评价否决项信息
*
* @param id 规范建设-直属单位考核评价否决项主键
* @return 结果
*/
@Override
public int deleteSjGfjsZsdwkhpjfjxById(Long id)
{
return sjGfjsZsdwkhpjfjxMapper.deleteSjGfjsZsdwkhpjfjxById(id);
}
@Override
public int batchSave(List<SjGfjsZsdwkhpjfjx> fjxList) {
return sjGfjsZsdwkhpjfjxMapper.batchSave(fjxList);
}
@Override
public int pledit(List<SjGfjsZsdwkhpjfjx> list) {
SjGfjsZsdwkhpjfjx sjGfjsZsdwkhpjfjx = list.get(0);
SjGfjsZsdwkhpjZb sjGfjsZsdwkhpjZb = sjGfjsZsdwkhpjZbMapper.selectSjGfjsZsdwkhpjZbById(sjGfjsZsdwkhpjfjx.getZbId());
List<SjGfjsZsdwkhpjfjx> collect = list.stream().filter(item -> "是".equals(item.getSffs())).collect(Collectors.toList());
sjGfjsZsdwkhpjZb.setSffjxs(new BigDecimal(collect.size()));
sjGfjsZsdwkhpjZbMapper.updateSjGfjsZsdwkhpjZb(sjGfjsZsdwkhpjZb);
return sjGfjsZsdwkhpjfjxMapper.pledit(list);
}
}
<?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.qianhe.mapper.SjGfjsJgbmjcMapper">
<resultMap type="SjGfjsZsdwwtcj" id="SjGfjsZsdwwtcjResult">
<result property="id" column="id" />
<result property="deptId" column="dept_id" />
<result property="rq" column="rq" />
<result property="jcjb" column="jcjb" />
<result property="wtmc" column="wtmc" />
<result property="khnr" column="khnr" />
<result property="khxd" column="khxd" />
<result property="pjbzid" column="pjbzid" />
<result property="pjbzmc" column="pjbzmc" />
<result property="zgzrr" column="zgzrr" />
<result property="zgcs" column="zgcs" />
<result property="zgqx" column="zgqx" />
<result property="zgzt" column="zgzt" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="yl1" column="yl1" />
<result property="yl2" column="yl2" />
<result property="yl3" column="yl3" />
<result property="yl4" column="yl4" />
<result property="yl5" column="yl5" />
<result property="deptName" column="dept_name" />
<result property="deptLx" column="dept_lx" />
</resultMap>
<sql id="selectSjGfjsZsdwwtcjVo">
select id,
a.dept_id,
rq,
jcjb,
wtmc,
khnr,
khxd,
pjbzid,
pjbzmc,
zgzrr,
zgcs,
zgqx,
zgzt,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
remark,
yl1,
yl2,
a.yl3,
yl4,
yl5,
d.dept_name,
d.dept_lx,
c.dept_name as yl3name
from sj_gfjs_zsdwwtcj a
left join sys_dept d on a.dept_id=d.dept_id
left join sys_dept c on a.yl3=c.dept_id
</sql>
<select id="selectSjGfjsZsdwwtcjList" parameterType="SjGfjsZsdwwtcj" resultMap="SjGfjsZsdwwtcjResult">
<include refid="selectSjGfjsZsdwwtcjVo"/>
<where>
<if test="deptId != null ">and (a.dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors))</if>
<if test="rq != null and rq != ''"> and rq = #{rq}</if>
<if test="jcjb != null and jcjb != ''"> and jcjb = #{jcjb}</if>
<if test="wtmc != null and wtmc != ''"> and wtmc = #{wtmc}</if>
<if test="khnr != null and khnr != ''"> and khnr = #{khnr}</if>
<if test="khxd != null and khxd != ''"> and khxd = #{khxd}</if>
<if test="pjbzid != null and pjbzid != ''"> and pjbzid = #{pjbzid}</if>
<if test="pjbzmc != null and pjbzmc != ''"> and pjbzmc = #{pjbzmc}</if>
<if test="zgzrr != null and zgzrr != ''"> and zgzrr = #{zgzrr}</if>
<if test="zgcs != null and zgcs != ''"> and zgcs = #{zgcs}</if>
<if test="zgqx != null and zgqx != ''"> and zgqx = #{zgqx}</if>
<if test="zgzt != null and zgzt != ''"> and zgzt = #{zgzt}</if>
<if test="yl1 != null and yl1 != ''"> and yl1 = #{yl1}</if>
<if test="yl2 != null and yl2 != ''"> and yl2 = #{yl2}</if>
<if test="yl3 != null and yl3 != ''"> and yl3 = #{yl3}</if>
<if test="yl4 != null and yl4 != ''"> and yl4 = #{yl4}</if>
<if test="yl5 != null and yl5 != ''"> and yl5 = #{yl5}</if>
<if test="startRq != null and startRq != ''"> and rq >= #{startRq}</if>
<if test="endRq != null and endRq != ''"> and rq &lt;= #{endRq}</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
order by a.rq desc
</select>
<select id="selectSjGfjsZsdwwtcjById" parameterType="Long" resultMap="SjGfjsZsdwwtcjResult">
<include refid="selectSjGfjsZsdwwtcjVo"/>
where a.id = #{id}
</select>
<insert id="insertSjGfjsZsdwwtcj" parameterType="SjGfjsZsdwwtcj" useGeneratedKeys="true" keyProperty="id">
insert into sj_gfjs_zsdwwtcj
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deptId != null">dept_id,</if>
<if test="rq != null">rq,</if>
<if test="jcjb != null">jcjb,</if>
<if test="wtmc != null">wtmc,</if>
<if test="khnr != null">khnr,</if>
<if test="khxd != null">khxd,</if>
<if test="pjbzid != null">pjbzid,</if>
<if test="pjbzmc != null">pjbzmc,</if>
<if test="zgzrr != null">zgzrr,</if>
<if test="zgcs != null">zgcs,</if>
<if test="zgqx != null">zgqx,</if>
<if test="zgzt != null">zgzt,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="yl1 != null">yl1,</if>
<if test="yl2 != null">yl2,</if>
<if test="yl3 != null">yl3,</if>
<if test="yl4 != null">yl4,</if>
<if test="yl5 != null">yl5,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deptId != null">#{deptId},</if>
<if test="rq != null">#{rq},</if>
<if test="jcjb != null">#{jcjb},</if>
<if test="wtmc != null">#{wtmc},</if>
<if test="khnr != null">#{khnr},</if>
<if test="khxd != null">#{khxd},</if>
<if test="pjbzid != null">#{pjbzid},</if>
<if test="pjbzmc != null">#{pjbzmc},</if>
<if test="zgzrr != null">#{zgzrr},</if>
<if test="zgcs != null">#{zgcs},</if>
<if test="zgqx != null">#{zgqx},</if>
<if test="zgzt != null">#{zgzt},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="yl1 != null">#{yl1},</if>
<if test="yl2 != null">#{yl2},</if>
<if test="yl3 != null">#{yl3},</if>
<if test="yl4 != null">#{yl4},</if>
<if test="yl5 != null">#{yl5},</if>
</trim>
</insert>
<insert id="batchSave">
insert into sj_gfjs_zsdwwtcj( dept_id, rq, jcjb, wtmc, khnr, khxd, pjbzid, pjbzmc, zgzrr, zgcs, zgqx, zgzt,create_by,create_time,remark,yl1,yl2,yl3,yl4,yl5) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.deptId}, #{item.rq}, #{item.jcjb}, #{item.wtmc}, #{item.khnr}, #{item.khxd}, #{item.pjbzid}, #{item.pjbzmc}, #{item.zgzrr}, #{item.zgcs}, #{item.zgqx}, #{item.zgzt}
, #{item.createBy}, #{item.createTime}, #{item.remark},#{item.yl1}, #{item.yl2}, #{item.yl3}, #{item.yl4}, #{item.yl5})
</foreach>
</insert>
<update id="updateSjGfjsZsdwwtcj" parameterType="SjGfjsZsdwwtcj">
update sj_gfjs_zsdwwtcj
<trim prefix="SET" suffixOverrides=",">
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="rq != null">rq = #{rq},</if>
<if test="jcjb != null">jcjb = #{jcjb},</if>
<if test="wtmc != null">wtmc = #{wtmc},</if>
<if test="khnr != null">khnr = #{khnr},</if>
<if test="khxd != null">khxd = #{khxd},</if>
<if test="pjbzid != null">pjbzid = #{pjbzid},</if>
<if test="pjbzmc != null">pjbzmc = #{pjbzmc},</if>
<if test="zgzrr != null">zgzrr = #{zgzrr},</if>
<if test="zgcs != null">zgcs = #{zgcs},</if>
<if test="zgqx != null">zgqx = #{zgqx},</if>
<if test="zgzt != null">zgzt = #{zgzt},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="yl1 != null">yl1 = #{yl1},</if>
<if test="yl2 != null">yl2 = #{yl2},</if>
<if test="yl3 != null">yl3 = #{yl3},</if>
<if test="yl4 != null">yl4 = #{yl4},</if>
<if test="yl5 != null">yl5 = #{yl5},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSjGfjsZsdwwtcjById" parameterType="Long">
delete from sj_gfjs_zsdwwtcj where id = #{id}
</delete>
<delete id="deleteSjGfjsZsdwwtcjByIds" parameterType="String">
delete from sj_gfjs_zsdwwtcj where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
...@@ -208,7 +208,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -208,7 +208,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSjGfjsZsdwwtcjList" parameterType="SjGfjsZsdwwtcj" resultMap="SjGfjsZsdwwtcjResult"> <resultMap type="SjGfjsZsdwwtcj" id="SjGfjsZsdwwtcjResult2">
<result property="id" column="id" />
<result property="deptId" column="dept_id" />
<result property="rq" column="rq" />
<result property="jcjb" column="jcjb" />
<result property="wtmc" column="wtmc" />
<result property="khnr" column="khnr" />
<result property="khxd" column="khxd" />
<result property="pjbzid" column="pjbzid" />
<result property="pjbzmc" column="pjbzmc" />
<result property="zgzrr" column="zgzrr" />
<result property="zgcs" column="zgcs" />
<result property="zgqx" column="zgqx" />
<result property="zgzt" column="zgzt" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="yl1" column="yl1" />
<result property="yl2" column="yl2" />
<result property="yl3" column="yl3" />
<result property="yl4" column="yl4" />
<result property="yl5" column="yl5" />
<result property="deptName" column="dept_name" />
<result property="deptLx" column="dept_lx" />
</resultMap>
<select id="selectSjGfjsZsdwwtcjList" parameterType="SjGfjsZsdwwtcj" resultMap="SjGfjsZsdwwtcjResult2">
select id, select id,
a.dept_id, a.dept_id,
rq, rq,
......
<?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.qianhe.mapper.SjGfjsZsdwfjxcjMapper">
<resultMap type="SjGfjsZsdwfjxcj" id="SjGfjsZsdwfjxcjResult">
<result property="id" column="id" />
<result property="deptId" column="dept_id" />
<result property="rq" column="rq" />
<result property="flmc" column="flmc" />
<result property="pjbzid" column="pjbzid" />
<result property="pjbzmc" column="pjbzmc" />
<result property="wtmc" column="wtmc" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="yl1" column="yl1" />
<result property="yl2" column="yl2" />
<result property="yl3" column="yl3" />
<result property="yl4" column="yl4" />
<result property="yl5" column="yl5" />
<result property="deptName" column="dept_name" />
</resultMap>
<sql id="selectSjGfjsZsdwfjxcjVo">
select id,
a.dept_id,
rq,
flmc,
pjbzid,
pjbzmc,
wtmc,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.remark,
yl1,
yl2,
yl3,
yl4,
yl5,d.dept_name,
c.dept_name as yl3name
from sj_gfjs_zsdwfjxcj a
left join sys_dept d on a.dept_id=d.dept_id
left join sys_dept c on a.yl3=c.dept_id
</sql>
<select id="selectSjGfjsZsdwfjxcjList" parameterType="SjGfjsZsdwfjxcj" resultMap="SjGfjsZsdwfjxcjResult">
<include refid="selectSjGfjsZsdwfjxcjVo"/>
<where>
<if test="deptId != null ">and (a.dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors))</if>
<if test="rq != null and rq != ''"> and rq = #{rq}</if>
<if test="flmc != null and flmc != ''"> and flmc = #{flmc}</if>
<if test="pjbzid != null and pjbzid != ''"> and pjbzid = #{pjbzid}</if>
<if test="pjbzmc != null and pjbzmc != ''"> and pjbzmc = #{pjbzmc}</if>
<if test="wtmc != null and wtmc != ''"> and wtmc = #{wtmc}</if>
<if test="yl1 != null and yl1 != ''"> and yl1 = #{yl1}</if>
<if test="yl2 != null and yl2 != ''"> and yl2 = #{yl2}</if>
<if test="yl3 != null and yl3 != ''"> and yl3 = #{yl3}</if>
<if test="yl4 != null and yl4 != ''"> and yl4 = #{yl4}</if>
<if test="yl5 != null and yl5 != ''"> and yl5 = #{yl5}</if>
<if test="startRq != null and startRq != ''"> and rq >= #{startRq}</if>
<if test="endRq != null and endRq != ''"> and rq &lt;= #{endRq}</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
order by a.rq desc
</select>
<select id="selectSjGfjsZsdwfjxcjById" parameterType="Long" resultMap="SjGfjsZsdwfjxcjResult">
<include refid="selectSjGfjsZsdwfjxcjVo"/>
where id = #{id}
</select>
<insert id="insertSjGfjsZsdwfjxcj" parameterType="SjGfjsZsdwfjxcj" useGeneratedKeys="true" keyProperty="id">
insert into sj_gfjs_zsdwfjxcj
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deptId != null">dept_id,</if>
<if test="rq != null">rq,</if>
<if test="flmc != null">flmc,</if>
<if test="pjbzid != null">pjbzid,</if>
<if test="pjbzmc != null">pjbzmc,</if>
<if test="wtmc != null">wtmc,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="yl1 != null">yl1,</if>
<if test="yl2 != null">yl2,</if>
<if test="yl3 != null">yl3,</if>
<if test="yl4 != null">yl4,</if>
<if test="yl5 != null">yl5,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deptId != null">#{deptId},</if>
<if test="rq != null">#{rq},</if>
<if test="flmc != null">#{flmc},</if>
<if test="pjbzid != null">#{pjbzid},</if>
<if test="pjbzmc != null">#{pjbzmc},</if>
<if test="wtmc != null">#{wtmc},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="yl1 != null">#{yl1},</if>
<if test="yl2 != null">#{yl2},</if>
<if test="yl3 != null">#{yl3},</if>
<if test="yl4 != null">#{yl4},</if>
<if test="yl5 != null">#{yl5},</if>
</trim>
</insert>
<insert id="batchSave">
insert into sj_gfjs_zsdwfjxcj( id, dept_id, rq, flmc, pjbzid, pjbzmc, wtmc,create_by,create_time,remark,yl1,yl2,yl3,yl4,yl5) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.deptId}, #{item.rq}, #{item.flmc}, #{item.pjbzid}, #{item.pjbzmc}, #{item.wtmc}
, #{item.createBy}, #{item.createTime}, #{item.remark},#{item.yl1}, #{item.yl2}, #{item.yl3}, #{item.yl4}, #{item.yl5})
</foreach>
</insert>
<update id="updateSjGfjsZsdwfjxcj" parameterType="SjGfjsZsdwfjxcj">
update sj_gfjs_zsdwfjxcj
<trim prefix="SET" suffixOverrides=",">
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="rq != null">rq = #{rq},</if>
<if test="flmc != null">flmc = #{flmc},</if>
<if test="pjbzid != null">pjbzid = #{pjbzid},</if>
<if test="pjbzmc != null">pjbzmc = #{pjbzmc},</if>
<if test="wtmc != null">wtmc = #{wtmc},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="yl1 != null">yl1 = #{yl1},</if>
<if test="yl2 != null">yl2 = #{yl2},</if>
<if test="yl3 != null">yl3 = #{yl3},</if>
<if test="yl4 != null">yl4 = #{yl4},</if>
<if test="yl5 != null">yl5 = #{yl5},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSjGfjsZsdwfjxcjById" parameterType="Long">
delete from sj_gfjs_zsdwfjxcj where id = #{id}
</delete>
<delete id="deleteSjGfjsZsdwfjxcjByIds" parameterType="String">
delete from sj_gfjs_zsdwfjxcj where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?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.qianhe.mapper.SjGfjsZsdwkhpjfjxMapper">
<resultMap type="SjGfjsZsdwkhpjfjx" id="SjGfjsZsdwkhpjfjxResult">
<result property="id" column="id" />
<result property="zbId" column="zb_id" />
<result property="deptId" column="dept_id" />
<result property="nd" column="nd" />
<result property="zqfw" column="zqfw" />
<result property="zqlx" column="zqlx" />
<result property="jb" column="jb" />
<result property="flmc" column="flmc" />
<result property="pjbzid" column="pjbzid" />
<result property="pjbzmc" column="pjbzmc" />
<result property="sffs" column="sffs" />
<result property="wtms" column="wtms" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="yl1" column="yl1" />
<result property="yl2" column="yl2" />
<result property="yl3" column="yl3" />
<result property="yl4" column="yl4" />
<result property="yl5" column="yl5" />
<result property="deptName" column="dept_name" />
</resultMap>
<sql id="selectSjGfjsZsdwkhpjfjxVo">
select id,
zb_id,
a.dept_id,
nd,
zqfw,
zqlx,
jb,
flmc,
pjbzid,
pjbzmc,
sffs,
wtms,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
remark,
yl1,
yl2,
yl3,
yl4,
yl5,d.dept_name
from sj_gfjs_zsdwkhpjfjx a
left join sys_dept d on a.dept_id=d.dept_id
</sql>
<select id="selectSjGfjsZsdwkhpjfjxList" parameterType="SjGfjsZsdwkhpjfjx" resultMap="SjGfjsZsdwkhpjfjxResult">
<include refid="selectSjGfjsZsdwkhpjfjxVo"/>
<where>
<if test="zbId != null "> and zb_id = #{zbId}</if>
<if test="deptId != null "> and a.dept_id = #{deptId}</if>
<if test="nd != null and nd != ''"> and nd = #{nd}</if>
<if test="zqfw != null and zqfw != ''"> and zqfw = #{zqfw}</if>
<if test="zqlx != null and zqlx != ''"> and zqlx = #{zqlx}</if>
<if test="jb != null and jb != ''"> and jb = #{jb}</if>
<if test="flmc != null and flmc != ''"> and flmc = #{flmc}</if>
<if test="pjbzid != null and pjbzid != ''"> and pjbzid = #{pjbzid}</if>
<if test="pjbzmc != null and pjbzmc != ''"> and pjbzmc = #{pjbzmc}</if>
<if test="sffs != null and sffs != ''"> and sffs = #{sffs}</if>
<if test="wtms != null and wtms != ''"> and wtms = #{wtms}</if>
<if test="yl1 != null and yl1 != ''"> and yl1 = #{yl1}</if>
<if test="yl2 != null and yl2 != ''"> and yl2 = #{yl2}</if>
<if test="yl3 != null and yl3 != ''"> and yl3 = #{yl3}</if>
<if test="yl4 != null and yl4 != ''"> and yl4 = #{yl4}</if>
<if test="yl5 != null and yl5 != ''"> and yl5 = #{yl5}</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
order by yl1
</select>
<select id="selectSjGfjsZsdwkhpjfjxById" parameterType="Long" resultMap="SjGfjsZsdwkhpjfjxResult">
<include refid="selectSjGfjsZsdwkhpjfjxVo"/>
where id = #{id}
</select>
<insert id="insertSjGfjsZsdwkhpjfjx" parameterType="SjGfjsZsdwkhpjfjx" useGeneratedKeys="true" keyProperty="id">
insert into sj_gfjs_zsdwkhpjfjx
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="zbId != null">zb_id,</if>
<if test="deptId != null">dept_id,</if>
<if test="nd != null">nd,</if>
<if test="zqfw != null">zqfw,</if>
<if test="zqlx != null">zqlx,</if>
<if test="jb != null">jb,</if>
<if test="flmc != null">flmc,</if>
<if test="pjbzid != null">pjbzid,</if>
<if test="pjbzmc != null">pjbzmc,</if>
<if test="sffs != null">sffs,</if>
<if test="wtms != null">wtms,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="yl1 != null">yl1,</if>
<if test="yl2 != null">yl2,</if>
<if test="yl3 != null">yl3,</if>
<if test="yl4 != null">yl4,</if>
<if test="yl5 != null">yl5,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="zbId != null">#{zbId},</if>
<if test="deptId != null">#{deptId},</if>
<if test="nd != null">#{nd},</if>
<if test="zqfw != null">#{zqfw},</if>
<if test="zqlx != null">#{zqlx},</if>
<if test="jb != null">#{jb},</if>
<if test="flmc != null">#{flmc},</if>
<if test="pjbzid != null">#{pjbzid},</if>
<if test="pjbzmc != null">#{pjbzmc},</if>
<if test="sffs != null">#{sffs},</if>
<if test="wtms != null">#{wtms},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="yl1 != null">#{yl1},</if>
<if test="yl2 != null">#{yl2},</if>
<if test="yl3 != null">#{yl3},</if>
<if test="yl4 != null">#{yl4},</if>
<if test="yl5 != null">#{yl5},</if>
</trim>
</insert>
<insert id="batchSave">
insert into sj_gfjs_zsdwkhpjfjx( id, zb_id, dept_id, nd, zqfw, zqlx, jb, flmc, pjbzid, pjbzmc, sffs, wtms, remark, yl1, yl2, yl3, yl4, yl5) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.zbId}, #{item.deptId}, #{item.nd}, #{item.zqfw}, #{item.zqlx}, #{item.jb}, #{item.flmc}, #{item.pjbzid}, #{item.pjbzmc}, #{item.sffs}, #{item.wtms}, #{item.remark}, #{item.yl1}, #{item.yl2}, #{item.yl3}, #{item.yl4}, #{item.yl5})
</foreach>
</insert>
<update id="updateSjGfjsZsdwkhpjfjx" parameterType="SjGfjsZsdwkhpjfjx">
update sj_gfjs_zsdwkhpjfjx
<trim prefix="SET" suffixOverrides=",">
<if test="zbId != null">zb_id = #{zbId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="nd != null">nd = #{nd},</if>
<if test="zqfw != null">zqfw = #{zqfw},</if>
<if test="zqlx != null">zqlx = #{zqlx},</if>
<if test="jb != null">jb = #{jb},</if>
<if test="flmc != null">flmc = #{flmc},</if>
<if test="pjbzid != null">pjbzid = #{pjbzid},</if>
<if test="pjbzmc != null">pjbzmc = #{pjbzmc},</if>
<if test="sffs != null">sffs = #{sffs},</if>
<if test="wtms != null">wtms = #{wtms},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="yl1 != null">yl1 = #{yl1},</if>
<if test="yl2 != null">yl2 = #{yl2},</if>
<if test="yl3 != null">yl3 = #{yl3},</if>
<if test="yl4 != null">yl4 = #{yl4},</if>
<if test="yl5 != null">yl5 = #{yl5},</if>
</trim>
where id = #{id}
</update>
<update id="pledit">
<foreach collection="list" item="item" index="index" separator=";">
update sj_gfjs_zsdwkhpjfjx set sffs=#{item.sffs},wtms=#{item.wtms} where id =#{item.id}
</foreach>
</update>
<delete id="deleteSjGfjsZsdwkhpjfjxById" parameterType="Long">
delete from sj_gfjs_zsdwkhpjfjx where id = #{id}
</delete>
<delete id="deleteSjGfjsZsdwkhpjfjxByIds" parameterType="String">
delete from sj_gfjs_zsdwkhpjfjx where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment