国网模版
This commit is contained in:
parent
1a14dbe747
commit
1370bdd1dd
|
|
@ -0,0 +1,121 @@
|
|||
package com.bonus.tool.controller.search;
|
||||
|
||||
import com.bonus.common.core.controller.BaseController;
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.common.core.page.TableDataInfo;
|
||||
import com.bonus.common.utils.poi.ExcelUtil;
|
||||
import com.bonus.tool.dto.*;
|
||||
import com.bonus.tool.service.StateGridService;
|
||||
import com.bonus.tool.service.TbSubPerfService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 国网模版
|
||||
* @author fly
|
||||
* @date 2025/4/24
|
||||
*/
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/stateGrid")
|
||||
public class StateGridController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private StateGridService service;
|
||||
|
||||
/**
|
||||
*国网模版列表查询
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "国网模版列表查询")
|
||||
// @PreAuthorize("@ss.hasPermi('key:people:list')")
|
||||
@GetMapping("/getStateGridList")
|
||||
public TableDataInfo getStateGridList(TbGwModelDto bean) {
|
||||
try {
|
||||
startPage();
|
||||
List<TbGwModelVo> list = service.getStateGridList(bean);
|
||||
return getDataTable(list);
|
||||
}catch (Exception e){
|
||||
log.info("国网模版列表失败{}",e.getMessage());
|
||||
return getDataTableError(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 国网模版新增
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "国网模版新增")
|
||||
// @PreAuthorize("@ss.hasPermi('key:people:list')")
|
||||
@PostMapping("/addStateGridTemp")
|
||||
public AjaxResult addStateGridTemp(@RequestBody TbGwModelDto o) {
|
||||
try {
|
||||
return service.addStateGridTemp(o);
|
||||
}catch (Exception e){
|
||||
log.info("国网模版新增失败{}",e.getMessage());
|
||||
return error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 国网模版详情
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "国网模版详情")
|
||||
// @PreAuthorize("@ss.hasPermi('key:people:query')")
|
||||
@PostMapping("/getStateGridTempById")
|
||||
public AjaxResult getStateGridTempById(@RequestBody TbGwModelDto o) {
|
||||
try {
|
||||
TbGwModelVo bean = service.getStateGridTempById(o);
|
||||
return success(bean);
|
||||
}catch (Exception e){
|
||||
log.info("公司业绩管理详情失败{}",e.getMessage());
|
||||
return error("公司业绩管理详情失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 国网模版删除
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "国网模版删除")
|
||||
// @PreAuthorize("@ss.hasPermi('key:people:add')")
|
||||
@PostMapping("/delStateGridTemp")
|
||||
public AjaxResult delStateGridTemp(@RequestBody TbGwModelDto o) {
|
||||
try {
|
||||
return service.delStateGridTemp(o);
|
||||
}catch (Exception e){
|
||||
log.info("国网模版删除失败{}",e.getMessage());
|
||||
return error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 国网模版修改
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "国网模版修改")
|
||||
// @PreAuthorize("@ss.hasPermi('key:people:add')")
|
||||
@PostMapping("/updateStateGridTemp")
|
||||
public AjaxResult updateStateGridTemp(@RequestBody TbGwModelDto o) {
|
||||
try {
|
||||
return service.updateStateGridTemp(o);
|
||||
}catch (Exception e){
|
||||
log.info("国网模版修改失败{}",e.getMessage());
|
||||
return error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.bonus.tool.dto;
|
||||
|
||||
import com.bonus.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author fly
|
||||
* @date 2025/4/21
|
||||
*/
|
||||
@Data
|
||||
public class ComCorePersonBean {
|
||||
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 身份证
|
||||
*/
|
||||
private String idCard;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 职称
|
||||
*/
|
||||
private String title;
|
||||
|
||||
|
||||
/**
|
||||
* 资格证书
|
||||
*/
|
||||
private String diploma;
|
||||
|
||||
|
||||
/**
|
||||
* 在本施工队伍中的职责分工
|
||||
*/
|
||||
private String postName;
|
||||
|
||||
/**
|
||||
* 入场时间
|
||||
*/
|
||||
private String einDate;
|
||||
|
||||
/**
|
||||
* 出场时间
|
||||
*/
|
||||
private String exitDate;
|
||||
|
||||
/**
|
||||
* 同类工程业绩
|
||||
*/
|
||||
private String proPerf;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.bonus.tool.dto;
|
||||
|
||||
import com.bonus.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author fly
|
||||
* @date 2025/4/21
|
||||
*/
|
||||
@Data
|
||||
public class ComOtherPersonBean {
|
||||
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 在本施工队伍中的职责分工
|
||||
*/
|
||||
private String postName;
|
||||
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 职称
|
||||
*/
|
||||
private String title;
|
||||
|
||||
|
||||
/**
|
||||
* 资格证书
|
||||
*/
|
||||
private String diploma;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
private String major;
|
||||
|
||||
/**
|
||||
* 证书编号
|
||||
*/
|
||||
private String diplomaNum;
|
||||
|
||||
/**
|
||||
* 级别
|
||||
*/
|
||||
private String level;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.bonus.tool.dto;
|
||||
|
||||
import com.bonus.common.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author fly
|
||||
* @date 2025/4/22
|
||||
* 国网模版-公司业绩
|
||||
*/
|
||||
@Data
|
||||
public class ComPerformanceBean {
|
||||
|
||||
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
private String proName;
|
||||
|
||||
/**
|
||||
* 电压等级
|
||||
*/
|
||||
private String voltage;
|
||||
|
||||
/**
|
||||
* 竣工日期
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private String stopTime;
|
||||
|
||||
/**
|
||||
* 变电站座数
|
||||
*/
|
||||
private String stationNum;
|
||||
|
||||
/**
|
||||
* 线路建设规模
|
||||
*/
|
||||
private String lineScale;
|
||||
|
||||
/**
|
||||
* 承包范围
|
||||
*/
|
||||
@Excel(name = "承包范围", sort = 8)
|
||||
private String contractRang;
|
||||
|
||||
/**
|
||||
* 业主单位
|
||||
*/
|
||||
private String ownerUnit;
|
||||
|
||||
/**
|
||||
* 业主联系方式
|
||||
*/
|
||||
private String ownerPhone;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.bonus.tool.dto;
|
||||
|
||||
import com.bonus.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author fly
|
||||
* @date 2025/4/23
|
||||
* 分包商
|
||||
*/
|
||||
@Data
|
||||
public class SubBean {
|
||||
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 分包商名称
|
||||
*/
|
||||
private String subName;
|
||||
|
||||
/***
|
||||
* 分包业绩
|
||||
*/
|
||||
private List<SubPerformanceBean> subPerfList;
|
||||
|
||||
/***
|
||||
* 分包人员
|
||||
*/
|
||||
private List<SubOtherPeopleBean> subPersonList;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.bonus.tool.dto;
|
||||
|
||||
import com.bonus.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author fly
|
||||
* @date 2025/4/22
|
||||
*/
|
||||
@Data
|
||||
public class SubOtherPeopleBean {
|
||||
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long subId;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 身份证
|
||||
*/
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 资格证书
|
||||
*/
|
||||
private String diploma;
|
||||
|
||||
/**
|
||||
* 职称
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 在本施工队伍中的职责分工
|
||||
*/
|
||||
private String postName;
|
||||
|
||||
/**
|
||||
* 同类工程业绩
|
||||
*/
|
||||
private String proPerf;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.bonus.tool.dto;
|
||||
|
||||
import com.bonus.common.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author fly
|
||||
* @date 2025/4/22
|
||||
* 国网模版-分包商业绩
|
||||
*/
|
||||
@Data
|
||||
public class SubPerformanceBean {
|
||||
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 分包商id
|
||||
*/
|
||||
private Long subId;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String proName;
|
||||
|
||||
/**
|
||||
* 电压等级
|
||||
*/
|
||||
private String voltage;
|
||||
|
||||
/**
|
||||
* 建设单位
|
||||
*/
|
||||
private String consUnit;
|
||||
|
||||
/**
|
||||
* 分包合同金额(万元)
|
||||
*/
|
||||
private BigDecimal money;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private String startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 合同身份
|
||||
*/
|
||||
private String htRemark;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.bonus.tool.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 国网模板表
|
||||
*
|
||||
* @author fly
|
||||
* @email fltoo@qq.com
|
||||
*/
|
||||
@Data
|
||||
public class TbGwModelDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 标书名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createUser;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String updateTime;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String updateUser;
|
||||
|
||||
//子项数据
|
||||
/**
|
||||
* 公司业绩
|
||||
*/
|
||||
private List<ComPerformanceBean> comPerfList;
|
||||
|
||||
/**
|
||||
* 公司关键人员id
|
||||
*/
|
||||
private List<ComCorePersonBean> comCoreList;
|
||||
|
||||
/**
|
||||
* 公司关键人员id
|
||||
*/
|
||||
private List<ComOtherPersonBean> comOtherList;
|
||||
|
||||
/**
|
||||
* 分包列表
|
||||
*/
|
||||
private List<SubBean> subList;
|
||||
|
||||
|
||||
//查询字段
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private String startDate;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private String endDate;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.bonus.tool.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 国网模板表
|
||||
*
|
||||
* @author fly
|
||||
* @email fltoo@qq.com
|
||||
*/
|
||||
@Data
|
||||
public class TbGwModelVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 标书名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createUser;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String updateTime;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String updateUser;
|
||||
|
||||
//子项数据
|
||||
/**
|
||||
* 公司业绩
|
||||
*/
|
||||
private List<ComPerformanceBean> comPerfList;
|
||||
|
||||
/**
|
||||
* 公司关键人员id
|
||||
*/
|
||||
private List<ComCorePersonBean> comCoreList;
|
||||
|
||||
/**
|
||||
* 公司关键人员id
|
||||
*/
|
||||
private List<ComOtherPersonBean> comOtherList;
|
||||
|
||||
/**
|
||||
* 分包列表
|
||||
*/
|
||||
private List<SubBean> subList;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
package com.bonus.tool.mapper;
|
||||
|
||||
import com.bonus.tool.dto.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface StateGridMapper {
|
||||
/**
|
||||
* 国网模版列表查询
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
List<TbGwModelVo> getStateGridList(TbGwModelDto bean);
|
||||
|
||||
/**
|
||||
* 国网模版新增
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
int addStateGridTemp(TbGwModelDto o);
|
||||
|
||||
/**
|
||||
* 国网模版新增-公司业绩
|
||||
* @param comPerfList
|
||||
* @return
|
||||
*/
|
||||
int insertComPerf(List<ComPerformanceBean> comPerfList);
|
||||
/**
|
||||
* 国网模版新增-公司关键人员
|
||||
* @param comCoreList
|
||||
* @return
|
||||
*/
|
||||
int insertComCore(List<ComCorePersonBean> comCoreList);
|
||||
/**
|
||||
* 国网模版新增-公司其他人员
|
||||
* @param comOtherList
|
||||
* @return
|
||||
*/
|
||||
int insertComOther(List<ComOtherPersonBean> comOtherList);
|
||||
/**
|
||||
* 国网模版新增-分包商列表
|
||||
* @param subList
|
||||
* @return
|
||||
*/
|
||||
int insertSub(List<SubBean> subList);
|
||||
/**
|
||||
* 国网模版新增-分包商业绩
|
||||
* @param subPerfList
|
||||
* @return
|
||||
*/
|
||||
int insertSubPerf(List<SubPerformanceBean> subPerfList);
|
||||
/**
|
||||
* 国网模版新增-分包商拟派人员
|
||||
* @param subPersonList
|
||||
* @return
|
||||
*/
|
||||
int insertSubPerson(List<SubOtherPeopleBean> subPersonList);
|
||||
|
||||
/**
|
||||
* 国网模版详情
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
TbGwModelVo getStateGridTempById(TbGwModelDto o);
|
||||
|
||||
/**
|
||||
* 国网模版详情-公司业绩
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<ComPerformanceBean> selectComPerfList(Long id);
|
||||
|
||||
/**
|
||||
* 国网模版详情-公司关键人员
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<ComCorePersonBean> selectComCoreList(Long id);
|
||||
|
||||
/**
|
||||
* 国网模版详情-公司其他人员
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<ComOtherPersonBean> selectComOtherList(Long id);
|
||||
|
||||
/**
|
||||
* 国网模版详情-分包商列表
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<SubBean> selectSubList(Long id);
|
||||
|
||||
/**
|
||||
* 国网模版详情-分包商业绩
|
||||
* @param gwId
|
||||
* @param subId
|
||||
* @return
|
||||
*/
|
||||
List<SubPerformanceBean> selectSubPerfList(@Param("gwId") Long gwId, @Param("subId")Long subId);
|
||||
|
||||
List<SubOtherPeopleBean> selectSubOtherList(@Param("gwId") Long gwId, @Param("subId")Long subId);
|
||||
|
||||
/**
|
||||
* 国网模版删除
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
int delStateGridTemp(Long id);
|
||||
|
||||
/**
|
||||
* 国网模版关联数据删除
|
||||
* @param o
|
||||
*/
|
||||
void delAssociatedData(TbGwModelDto o);
|
||||
|
||||
/**
|
||||
* 国网模版修改
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
int updateStateGridTemp(TbGwModelDto o);
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.bonus.tool.service;
|
||||
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.tool.dto.TbCompanyPerfVo;
|
||||
import com.bonus.tool.dto.TbGwModelDto;
|
||||
import com.bonus.tool.dto.TbGwModelVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface StateGridService {
|
||||
/**
|
||||
* 国网模版列表查询
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
List<TbGwModelVo> getStateGridList(TbGwModelDto bean);
|
||||
|
||||
/**
|
||||
* 国网模版新增
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
AjaxResult addStateGridTemp(TbGwModelDto o);
|
||||
|
||||
/**
|
||||
* 国网模版详情
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
TbGwModelVo getStateGridTempById(TbGwModelDto o);
|
||||
|
||||
/**
|
||||
* 国网模版删除
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
AjaxResult delStateGridTemp(TbGwModelDto o);
|
||||
|
||||
/**
|
||||
* 国网模版修改
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
AjaxResult updateStateGridTemp(TbGwModelDto o);
|
||||
}
|
||||
|
|
@ -0,0 +1,196 @@
|
|||
package com.bonus.tool.service.impl;
|
||||
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.common.utils.SecurityUtils;
|
||||
import com.bonus.tool.dto.*;
|
||||
import com.bonus.tool.mapper.StateGridMapper;
|
||||
import com.bonus.tool.service.StateGridService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author fly
|
||||
* @date 2025/4/24
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class StateGridServiceImpl implements StateGridService {
|
||||
|
||||
@Resource
|
||||
private StateGridMapper mapper;
|
||||
|
||||
/**
|
||||
* 国网模版列表查询
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<TbGwModelVo> getStateGridList(TbGwModelDto bean) {
|
||||
//获取公司业绩列表
|
||||
return mapper.getStateGridList(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 国网模版新增
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult addStateGridTemp(TbGwModelDto o) {
|
||||
String userName = SecurityUtils.getLoginUser().getUsername();
|
||||
o.setCreateUser(userName);
|
||||
//1.新增模板主表
|
||||
int i = mapper.addStateGridTemp(o);
|
||||
if (i > 0) {
|
||||
//新增关联数据
|
||||
addAssociatedData(o);
|
||||
}
|
||||
return i > 0 ? AjaxResult.success() : AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增关联数据
|
||||
*
|
||||
* @param o
|
||||
*/
|
||||
private void addAssociatedData(TbGwModelDto o) {
|
||||
//2.1公司业绩
|
||||
List<ComPerformanceBean> comPerfList = o.getComPerfList();
|
||||
if (comPerfList != null && !comPerfList.isEmpty()) {
|
||||
comPerfList.forEach(item -> {
|
||||
item.setParentId(o.getId());
|
||||
});
|
||||
int x = mapper.insertComPerf(comPerfList);
|
||||
}
|
||||
//2.2公司关键人员
|
||||
List<ComCorePersonBean> comCoreList = o.getComCoreList();
|
||||
if (comCoreList != null && !comCoreList.isEmpty()) {
|
||||
comCoreList.forEach(item -> {
|
||||
item.setParentId(o.getId());
|
||||
});
|
||||
int y = mapper.insertComCore(comCoreList);
|
||||
}
|
||||
//2.3公司其他人员
|
||||
List<ComOtherPersonBean> comOtherList = o.getComOtherList();
|
||||
if (comOtherList != null && !comOtherList.isEmpty()) {
|
||||
comOtherList.forEach(item -> {
|
||||
item.setParentId(o.getId());
|
||||
});
|
||||
int z = mapper.insertComOther(comOtherList);
|
||||
}
|
||||
//2.4分包商基础数据
|
||||
List<SubBean> subList = o.getSubList();
|
||||
if (subList != null && !subList.isEmpty()) {
|
||||
subList.forEach(item -> {
|
||||
item.setParentId(o.getId());
|
||||
});
|
||||
int m = mapper.insertSub(subList);
|
||||
subList.forEach(item -> {
|
||||
//2.4.1 分包商业绩
|
||||
List<SubPerformanceBean> subPerfList = item.getSubPerfList();
|
||||
if (subPerfList != null && !subPerfList.isEmpty()) {
|
||||
subPerfList.forEach(subPerf -> {
|
||||
subPerf.setParentId(o.getId());
|
||||
});
|
||||
int z = mapper.insertSubPerf(subPerfList);
|
||||
}
|
||||
//2.4.2 分包商 拟派人员
|
||||
List<SubOtherPeopleBean> subPersonList = item.getSubPersonList();
|
||||
if (subPersonList != null && !subPersonList.isEmpty()) {
|
||||
subPersonList.forEach(subPerson -> {
|
||||
subPerson.setParentId(o.getId());
|
||||
subPerson.setSubId(item.getId());
|
||||
});
|
||||
int z = mapper.insertSubPerson(subPersonList);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 国网模版详情
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public TbGwModelVo getStateGridTempById(TbGwModelDto o) {
|
||||
try {
|
||||
//1.0获取国网模版详情
|
||||
TbGwModelVo bean = mapper.getStateGridTempById(o);
|
||||
//2.1获取公司业绩
|
||||
List<ComPerformanceBean> comPerfList = mapper.selectComPerfList(o.getId());
|
||||
bean.setComPerfList(comPerfList);
|
||||
//2.2获取公司核心人员
|
||||
List<ComCorePersonBean> comCoreList = mapper.selectComCoreList(o.getId());
|
||||
bean.setComCoreList(comCoreList);
|
||||
//2.2获取公司其他人员
|
||||
List<ComOtherPersonBean> comOtherList = mapper.selectComOtherList(o.getId());
|
||||
bean.setComOtherList(comOtherList);
|
||||
//3.1获取分包商列表
|
||||
List<SubBean> subList = mapper.selectSubList(o.getId());
|
||||
bean.setSubList(subList);
|
||||
subList.forEach(item -> {
|
||||
//3.2获取分包商业绩
|
||||
List<SubPerformanceBean> subPerfList = mapper.selectSubPerfList(o.getId(), item.getId());
|
||||
item.setSubPerfList(subPerfList);
|
||||
//3.3获取分包商拟派人员
|
||||
List<SubOtherPeopleBean> subOtherList = mapper.selectSubOtherList(o.getId(), item.getId());
|
||||
item.setSubPersonList(subOtherList);
|
||||
});
|
||||
return bean;
|
||||
} catch (Exception e) {
|
||||
log.info("国网模版详情失败{}", e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 国网模版删除
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult delStateGridTemp(TbGwModelDto o) {
|
||||
int i = mapper.delStateGridTemp(o.getId());
|
||||
if (i > 0) {
|
||||
delAssociatedData(o);
|
||||
}
|
||||
return i > 0 ? AjaxResult.success("国网模板删除成功") : AjaxResult.error("国网模板删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 国网模版修改
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public AjaxResult updateStateGridTemp(TbGwModelDto o) {
|
||||
String userName = SecurityUtils.getLoginUser().getUsername();
|
||||
o.setUpdateUser(userName);
|
||||
int i = mapper.updateStateGridTemp(o);
|
||||
delAssociatedData(o);
|
||||
addAssociatedData(o);
|
||||
return AjaxResult.success("国网模板修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除国网模版关联数据
|
||||
*
|
||||
* @param o
|
||||
*/
|
||||
private void delAssociatedData(TbGwModelDto o) {
|
||||
mapper.delAssociatedData(o);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,240 @@
|
|||
<?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.bonus.tool.mapper.StateGridMapper">
|
||||
|
||||
<insert id="addStateGridTemp" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
insert into tb_gw_model(name,
|
||||
create_user)
|
||||
values (#{name},
|
||||
#{createUser})
|
||||
</insert>
|
||||
<insert id="insertComPerf">
|
||||
insert into tb_gw_perf_rel(
|
||||
gw_id,
|
||||
perf_id
|
||||
) values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.parentId},
|
||||
#{item.id}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertComCore">
|
||||
insert into tb_gw_key_user(
|
||||
gw_id,
|
||||
key_id,
|
||||
position,
|
||||
in_time,
|
||||
out_time,
|
||||
pro_perf
|
||||
)values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.parentId},
|
||||
#{item.id},
|
||||
#{item.postName},
|
||||
#{item.einDate},
|
||||
#{item.exitDate},
|
||||
#{item.proPerf}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertComOther">
|
||||
insert into tb_gw_other_user(
|
||||
gw_id,
|
||||
other_id,
|
||||
position
|
||||
)values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.parentId},
|
||||
#{item.id},
|
||||
#{item.postName}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertSub">
|
||||
insert into tb_gw_model_sub(
|
||||
gw_id,
|
||||
sub_id
|
||||
)values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.parentId},
|
||||
#{item.id}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertSubPerf">
|
||||
insert into tb_gw_sub_rel(
|
||||
gw_id,
|
||||
sub_id,
|
||||
perf_id
|
||||
)values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.parentId},
|
||||
#{item.subId},
|
||||
#{item.id}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertSubPerson">
|
||||
insert into tb_gw_sub_user(
|
||||
gw_id,
|
||||
sub_id,
|
||||
people_id,
|
||||
position,
|
||||
pro_perf
|
||||
)values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.parentId},
|
||||
#{item.subId},
|
||||
#{item.id},
|
||||
#{item.postName},
|
||||
#{item.proPerf}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateStateGridTemp">
|
||||
update tb_gw_model
|
||||
set
|
||||
name = #{name},
|
||||
update_user = #{updateUser}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="delStateGridTemp">
|
||||
update tb_gw_model
|
||||
set del_flag = 1
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="delAssociatedData">
|
||||
delete
|
||||
from tb_gw_perf_rel
|
||||
where gw_id = #{id};
|
||||
delete
|
||||
from tb_gw_key_user
|
||||
where gw_id = #{id};
|
||||
delete
|
||||
from tb_gw_other_user
|
||||
where gw_id = #{id};
|
||||
delete
|
||||
from tb_gw_model_sub
|
||||
where gw_id = #{id};
|
||||
delete
|
||||
from tb_gw_sub_rel
|
||||
where gw_id = #{id};
|
||||
delete
|
||||
from tb_gw_sub_user
|
||||
where gw_id = #{id};
|
||||
</delete>
|
||||
|
||||
<select id="getStateGridList" resultType="com.bonus.tool.dto.TbGwModelVo">
|
||||
select
|
||||
id,
|
||||
name,
|
||||
create_user as createUser,
|
||||
create_time,
|
||||
update_time
|
||||
from
|
||||
tb_gw_model where del_flag =0
|
||||
<if test="name != '' and name != null">
|
||||
and name = #{name}
|
||||
</if>
|
||||
<if test="startDate != null and startDate != null and endDate != null and endDate != null">
|
||||
and STR_TO_DATE(create_time, '%Y-%m-%d') between #{startDate} and #{endDate}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getStateGridTempById" resultType="com.bonus.tool.dto.TbGwModelVo">
|
||||
select id,
|
||||
name
|
||||
from tb_gw_model
|
||||
where del_flag = 0
|
||||
and id = #{id}
|
||||
</select>
|
||||
<select id="selectComPerfList" resultType="com.bonus.tool.dto.ComPerformanceBean">
|
||||
SELECT id,
|
||||
pro_name,
|
||||
voltage,
|
||||
station_num,
|
||||
line_scale,
|
||||
stop_time,
|
||||
contract_rang,
|
||||
owner_unit,
|
||||
owner_phone
|
||||
FROM tb_gw_perf_rel tgpr
|
||||
LEFT JOIN tb_company_perf tcp ON tgpr.perf_id = tcp.id
|
||||
WHERE tgpr.gw_id = #{id}
|
||||
</select>
|
||||
<select id="selectComCoreList" resultType="com.bonus.tool.dto.ComCorePersonBean">
|
||||
SELECT tgku.id,
|
||||
tkp.user_name,
|
||||
tkp.id_card,
|
||||
tkp.title,
|
||||
tkp.diploma,
|
||||
tgku.position as post_name,
|
||||
tgku.in_time as ein_date,
|
||||
tgku.out_time as exit_date,
|
||||
tgku.pro_perf
|
||||
FROM tb_gw_key_user tgku
|
||||
LEFT JOIN tb_key_people tkp ON tgku.key_id = tkp.id
|
||||
WHERE tgku.gw_id = #{id}
|
||||
</select>
|
||||
<select id="selectComOtherList" resultType="com.bonus.tool.dto.ComOtherPersonBean">
|
||||
SELECT tgou.id,
|
||||
tkp.user_name,
|
||||
tkp.id_card,
|
||||
tkp.title,
|
||||
tkp.diploma,
|
||||
tkp.diploma_num,
|
||||
tkp.major,
|
||||
tkp.`level`,
|
||||
tgou.position as post_name
|
||||
FROM tb_gw_other_user tgou
|
||||
LEFT JOIN tb_other_people tkp ON tgou.other_id = tkp.id
|
||||
WHERE tgou.gw_id = #{id}
|
||||
</select>
|
||||
<select id="selectSubList" resultType="com.bonus.tool.dto.SubBean">
|
||||
SELECT ts.id,
|
||||
ts.sub_name
|
||||
FROM tb_gw_model_sub tgms
|
||||
LEFT JOIN tb_sub ts ON tgms.sub_id = ts.id
|
||||
WHERE tgms.gw_id = #{id}
|
||||
</select>
|
||||
<select id="selectSubPerfList" resultType="com.bonus.tool.dto.SubPerformanceBean">
|
||||
SELECT tbsr.id,
|
||||
tbsr.gw_id,
|
||||
tbsr.sub_id,
|
||||
tsp.pro_name,
|
||||
tsp.voltage,
|
||||
tsp.cons_unit,
|
||||
tsp.start_time,
|
||||
tsp.end_time,
|
||||
tsp.money,
|
||||
tsp.ht_remark
|
||||
FROM tb_gw_sub_rel tbsr
|
||||
LEFT JOIN tb_sub_perf tsp ON tbsr.perf_id = tsp.id
|
||||
WHERE tbsr.gw_id = #{gwId}
|
||||
and tbsr.sub_id = #{subId}
|
||||
</select>
|
||||
<select id="selectSubOtherList" resultType="com.bonus.tool.dto.SubOtherPeopleBean">
|
||||
SELECT tgsu.id,
|
||||
tkp.user_name,
|
||||
tkp.id_card,
|
||||
tkp.title,
|
||||
tkp.diploma,
|
||||
tgsu.position AS post_name,
|
||||
tgsu.pro_perf
|
||||
FROM tb_gw_sub_user tgsu
|
||||
LEFT JOIN tb_sub_people tkp ON tgsu.people_id = tkp.id
|
||||
WHERE tgsu.gw_id = #{gwId}
|
||||
AND tgsu.sub_id = #{subId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue