Merge branch 'dev-nw' of http://192.168.0.56:3000/bonus/devicesmgt into dev-nw

This commit is contained in:
BianLzhaoMin 2024-06-21 14:31:28 +08:00
commit 684f41e399
6 changed files with 321 additions and 7 deletions

View File

@ -1,6 +1,7 @@
package com.bonus.sgzb.base.controller;
import com.bonus.sgzb.base.domain.BmProjectLot;
import com.bonus.sgzb.base.domain.vo.BmProjectLotImport;
import com.bonus.sgzb.base.service.BmProjectLotService;
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
import com.bonus.sgzb.common.core.web.controller.BaseController;
@ -8,13 +9,15 @@ import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import com.bonus.sgzb.common.security.annotation.RequiresPermissions;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@ -28,7 +31,7 @@ import java.util.List;
@RequestMapping("/bmProjectLot")
public class BmProjectLotController extends BaseController {
@Autowired
@Resource
private BmProjectLotService bmProjectLotService;
/**
@ -87,5 +90,15 @@ public class BmProjectLotController extends BaseController {
return bmProjectLotService.updateBmProjectLot(bmProjectLot);
}
@Log(title = "项目管理导入", businessType = BusinessType.IMPORT)
@RequiresPermissions("system:user:import")
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file) throws Exception
{
ExcelUtil<BmProjectLotImport> util = new ExcelUtil<>(BmProjectLotImport.class);
List<BmProjectLotImport> bmProjectLotList = util.importExcel(file.getInputStream());
String message = bmProjectLotService.importBmProjectLot(bmProjectLotList);
return success(message);
}
}

View File

@ -0,0 +1,206 @@
package com.bonus.sgzb.base.domain.vo;
import com.bonus.sgzb.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.sql.Timestamp;
@Data
public class BmProjectLotImport {
/**
* 状态
*/
@Excel(name = "状态")
private String examineStatus;
/**
* 创建时间
*/
@Excel(name = "提交时间")
private String createTime;
/**
*项目类别
*/
@Excel(name = "项目类别")
private String projectCategory;
/**
* 标段工程项目名称
*/
@Excel(name = "项目名称")
private String lotName;
/**
* 标段工程项目编号
*/
@Excel(name = "项目编号")
private String lotCode;
/**
* 是否框架项目
*/
@Excel(name = "是否框架项目")
private String isFrameworkProject;
/**
* 是否子项目
*/
@Excel(name = "是否子项目")
private String isSubProject;
/**
* 所属工程
*/
@Excel(name = "父项目名称")
private String ownPro;
/**
* 父项目编号
*/
@Excel(name = "父项目编号")
private String ownProId;
/**
* 项目状态
*/
@Excel(name = "项目状态")
private String projectStatus;
/**
* 业务来源
*/
@Excel(name = "业务来源")
private String businessSource;
/**
* 电压等级
*/
@Excel(name = "电压等级")
private String voltageLevel;
/**
* 联系人
*/
@Excel(name = "提交人名称")
private String linkMan;
/**
* 建设单位
*/
@Excel(name = "建设单位")
private String constructionUnit;
/**
* 实施单位
*/
@Excel(name = "实施单位")
private String implementationUnit;
/**
* 部门
*/
@Excel(name = "部门")
private String department;
/**
* 创建者公司
*/
@Excel(name = "创建者公司")
private String creatorCompany;
/**
* 设计单位
*/
@Excel(name = "设计单位")
private String designUnit;
/**
* 监理单位
*/
@Excel(name = "监理单位")
private String constructionControlUnit;
/**
* 计划开工日期
*/
@Excel(name = "计划开工日期")
private String plannedStartDate;
/**
* 计划竣工日期
*/
@Excel(name = "计划竣工日期")
private String plannedCompletionDate;
/**
* 项目类别ID
*/
@Excel(name = "项目类别ID")
private String projectCategoryId;
/**
* 建设单位ID
*/
@Excel(name = "建设单位ID")
private String constructionUnitId;
/**
* 实施单位ID
*/
@Excel(name = "实施单位ID")
private String implementationUnitId;
/**
* 设计单位ID
*/
@Excel(name = "设计单位ID")
private String designUnitId;
/**
* 监理单位ID
*/
@Excel(name = "监理单位ID")
private String constructionControlUnitId;
/**
* 工程地点
*/
@Excel(name = "工程地点")
private String projectLocation;
/**
* 工程所在省
*/
@Excel(name = "工程所在省")
private String projectLocationProvince;
/**
* 工程所在市
*/
@Excel(name = "工程所在市")
private String projectLocationCity;
/**
* 结束时间
*/
@Excel(name = "结束时间")
private String endTime;
/**
* 建设单位类型
*/
@Excel(name = "建设单位类型")
private String constructionUnitType;
/**
* 建设单位统一社会信用代码
*/
@Excel(name = "建设单位统一社会信用代码")
private String constructionUnitCode;
}

View File

@ -1,7 +1,7 @@
package com.bonus.sgzb.base.mapper;
import com.bonus.sgzb.base.domain.BmProjectInfo;
import com.bonus.sgzb.base.domain.BmProjectLot;
import com.bonus.sgzb.base.domain.vo.BmProjectLotImport;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@ -21,4 +21,6 @@ public interface BmProjectLotMapper {
public int deleteProjectLotById(Long lotId);
BmProjectLot selectByName(String lotName);
void projectLotImport(BmProjectLotImport bmProjectLotImport);
}

View File

@ -2,6 +2,7 @@ package com.bonus.sgzb.base.service;
import com.bonus.sgzb.base.domain.BmProjectLot;
import com.bonus.sgzb.base.domain.vo.BmProjectLotImport;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import java.util.List;
@ -19,4 +20,5 @@ public interface BmProjectLotService {
public int deleteProjectLotById(Long lotId);
String importBmProjectLot(List<BmProjectLotImport> bmProjectLotImportList);
}

View File

@ -1,20 +1,24 @@
package com.bonus.sgzb.base.service.impl;
import com.bonus.sgzb.base.domain.BmProjectLot;
import com.bonus.sgzb.base.domain.vo.BmProjectLotImport;
import com.bonus.sgzb.base.mapper.BmProjectLotMapper;
import com.bonus.sgzb.base.service.BmProjectLotService;
import com.bonus.sgzb.common.core.exception.ServiceException;
import com.bonus.sgzb.common.core.utils.StringUtils;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
@Service
@Slf4j
public class BmProjectLotServiceImpl implements BmProjectLotService {
@Autowired
@Resource
private BmProjectLotMapper bmProjectLotMapper;
@Override
@ -59,5 +63,21 @@ public class BmProjectLotServiceImpl implements BmProjectLotService {
return bmProjectLotMapper.deleteProjectLotById(lotId);
}
@Override
@Transactional
public String importBmProjectLot(List<BmProjectLotImport> bmProjectLotImportList) {
log.info("BmProjectLotServiceImpl importBmProjectLot 导入开始------");
if (StringUtils.isNull(bmProjectLotImportList) || bmProjectLotImportList.size() == 0)
{
throw new ServiceException("导入项目管理数据不能为空!");
}
//保存项目管理
for (BmProjectLotImport bmProjectLotImport: bmProjectLotImportList) {
bmProjectLotMapper.projectLotImport(bmProjectLotImport);
}
log.info("BmProjectLotServiceImpl importBmProjectLot 导入结束------");
return "导入成功";
}
}

View File

@ -133,7 +133,78 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sysdate()
)
</insert>
<insert id="projectLotImport">
insert into bm_project_lot (
<if test="examineStatus != null and examineStatus != '' ">examine_status,</if>
<if test="createTime != null and createTime != '' ">create_time,</if>
<if test="projectCategory != null and projectCategory != '' ">project_category,</if>
<if test="lotName != null and lotName != '' ">lot_name,</if>
<if test="lotCode != null and lotCode != '' ">lot_code,</if>
<if test="isFrameworkProject != null and isFrameworkProject != '' ">is_framework_project,</if>
<if test="isSubProject != null and isSubProject != ''">is_sub_project,</if>
<if test="ownPro != null and ownPro != ''">own_pro,</if>
<if test="ownProId != null and ownProId != ''">own_pro_Id,</if>
<if test="projectStatus != null and projectStatus != ''">project_status,</if>
<if test="businessSource != null and businessSource != ''">business_source,</if>
<if test="voltageLevel != null and voltageLevel != ''">voltage_level,</if>
<if test="linkMan != null and linkMan != ''">link_man,</if>
<if test="constructionUnit != null and constructionUnit != ''">construction_unit,</if>
<if test="implementationUnit != null and implementationUnit != ''">implementation_unit,</if>
<if test="department != null and department != ''">department,</if>
<if test="creatorCompany != null and creatorCompany != ''">creator_company,</if>
<if test="designUnit != null and designUnit != ''">design_unit,</if>
<if test="constructionControlUnit != null and constructionControlUnit != ''">construction_control_unit,</if>
<if test="plannedStartDate != null and plannedStartDate != ''">planned_start_date,</if>
<if test="plannedCompletionDate != null and plannedCompletionDate != ''">planned_completion_date,</if>
<if test="projectCategoryId != null and projectCategoryId != ''">project_category_id,</if>
<if test="constructionUnitId != null and constructionUnitId != ''">construction_unit_id,</if>
<if test="implementationUnitId != null and implementationUnitId != ''">implementation_unit_id,</if>
<if test="designUnitId != null and designUnitId != ''">design_unit_id,</if>
<if test="constructionControlUnitId != null and constructionControlUnitId != ''">construction_control_unit_id,</if>
<if test="projectLocation != null and projectLocation != ''">project_location,</if>
<if test="projectLocationProvince != null and projectLocationProvince != ''">project_location_province,</if>
<if test="projectLocationCity != null and projectLocationCity != ''">project_location_city,</if>
<if test="endTime != null and endTime != ''">end_time,</if>
<if test="constructionUnitType != null and constructionUnitType != ''">construction_unit_type,</if>
<if test="constructionUnitCode != null and constructionUnitCode != ''">construction_unit_code</if>
) VALUES (
<if test="examineStatus != null and examineStatus != '' ">#{examineStatus},</if>
<if test="createTime != null and createTime != '' ">#{createTime},</if>
<if test="projectCategory != null and projectCategory != '' ">#{projectCategory},</if>
<if test="lotName != null and lotName != '' ">#{lotName},</if>
<if test="lotCode != null and lotCode != '' ">#{lotCode},</if>
<if test="isFrameworkProject != null and isFrameworkProject != '' ">#{isFrameworkProject},</if>
<if test="isSubProject != null and isSubProject != ''">#{isSubProject},</if>
<if test="ownPro != null and ownPro != ''">#{ownPro},</if>
<if test="ownProId != null and ownProId != ''">#{ownProId},</if>
<if test="projectStatus != null and projectStatus != ''">#{projectStatus},</if>
<if test="businessSource != null and businessSource != ''">#{businessSource},</if>
<if test="voltageLevel != null and voltageLevel != ''">#{voltageLevel},</if>
<if test="linkMan != null and linkMan != ''">#{linkMan},</if>
<if test="constructionUnit != null and constructionUnit != ''">#{constructionUnit},</if>
<if test="implementationUnit != null and implementationUnit != ''">#{implementationUnit},</if>
<if test="department != null and department != ''">#{department},</if>
<if test="creatorCompany != null and creatorCompany != ''">#{creatorCompany},</if>
<if test="designUnit != null and designUnit != ''">#{designUnit},</if>
<if test="constructionControlUnit != null and constructionControlUnit != ''">#{constructionControlUnit},</if>
<if test="plannedStartDate != null and plannedStartDate != ''">#{plannedStartDate},</if>
<if test="plannedCompletionDate != null and plannedCompletionDate != ''">#{plannedCompletionDate},</if>
<if test="projectCategoryId != null and projectCategoryId != ''">#{projectCategoryId},</if>
<if test="constructionUnitId != null and constructionUnitId != ''">#{constructionUnitId},</if>
<if test="implementationUnitId != null and implementationUnitId != ''">#{implementationUnitId},</if>
<if test="designUnitId != null and designUnitId != ''">#{designUnitId},</if>
<if test="constructionControlUnitId != null and constructionControlUnitId != ''">#{constructionControlUnitId},</if>
<if test="projectLocation != null and projectLocation != ''">#{projectLocation},</if>
<if test="projectLocationProvince != null and projectLocationProvince != ''">#{projectLocationProvince},</if>
<if test="projectLocationCity != null and projectLocationCity != ''">#{projectLocationCity},</if>
<if test="endTime != null and endTime != ''">#{endTime},</if>
<if test="constructionUnitType != null and constructionUnitType != ''">#{constructionUnitType},</if>
<if test="constructionUnitCode != null and constructionUnitCode != ''">#{constructionUnitCode}</if>
)
</insert>
<update id="updateBmProjectLot" parameterType="com.bonus.sgzb.base.domain.BmProjectLot">
update bm_project_lot
<set>