From fc12738b8f901d49723a913cb34bc850a8dac9ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E5=AE=9D=E9=BE=99?= Date: Fri, 3 Jul 2026 16:59:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constant/enums/ModelTemplateTypeEnum.java | 2 + ...mandMonitorIndustryIncreaseController.java | 104 +++++++++ .../domain/ModelDemandMonitorEmployment.java | 9 +- .../ModelDemandMonitorIndustryIncrease.java | 54 +++++ ...elDemandMonitorIndustryIncreaseMapper.java | 64 ++++++ ...lDemandMonitorIndustryIncreaseService.java | 75 +++++++ .../service/impl/ModelCommonServiceImpl.java | 7 + ...delDemandMonitorEmploymentServiceImpl.java | 8 +- ...andMonitorIndustryIncreaseServiceImpl.java | 209 ++++++++++++++++++ ...delDemandMonitorIndustryIncreaseMapper.xml | 75 +++++++ ...动力动态监测系统-劳动力需求产业增加值.xlsx | Bin 0 -> 10331 bytes sql/datadashboard/table.sql | 47 +++- 12 files changed, 641 insertions(+), 13 deletions(-) create mode 100644 ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/ModelDemandMonitorIndustryIncreaseController.java create mode 100644 ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/ModelDemandMonitorIndustryIncrease.java create mode 100644 ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ModelDemandMonitorIndustryIncreaseMapper.java create mode 100644 ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/ModelDemandMonitorIndustryIncreaseService.java create mode 100644 ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelDemandMonitorIndustryIncreaseServiceImpl.java create mode 100644 ruoyi-bussiness/src/main/resources/mapper/ModelDemandMonitorIndustryIncreaseMapper.xml create mode 100644 ruoyi-bussiness/src/main/resources/template/劳动力动态监测系统-劳动力需求产业增加值.xlsx diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/constant/enums/ModelTemplateTypeEnum.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/constant/enums/ModelTemplateTypeEnum.java index 9147ce2..6ce90ea 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/constant/enums/ModelTemplateTypeEnum.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/constant/enums/ModelTemplateTypeEnum.java @@ -32,6 +32,8 @@ public enum ModelTemplateTypeEnum { MODEL_SUPPLY_MONITOR_OCCUPATION_POPULATION_RESULT("劳动力动态监测系统-劳动力供给结果分职业劳动力人口"), MODEL_DEMAND_MONITOR_EMPLOYMENT("劳动力动态监测系统-劳动力需求就业人数"), + + MODEL_DEMAND_MONITOR_INDUSTRY_INCREASE("劳动力动态监测系统-劳动力需求产业增加值"), ; private final String desc; } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/ModelDemandMonitorIndustryIncreaseController.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/ModelDemandMonitorIndustryIncreaseController.java new file mode 100644 index 0000000..a11a8ad --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/ModelDemandMonitorIndustryIncreaseController.java @@ -0,0 +1,104 @@ +package com.ruoyi.cms.controller; + +import com.ruoyi.cms.domain.ModelDemandMonitorIndustryIncrease; +import com.ruoyi.cms.service.ModelDemandMonitorIndustryIncreaseService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; +import java.util.List; + +/** + * 劳动力需求产业增加值 + * + * @author 马宝龙 + * @date 2026/7/3 + */ +@RestController +@RequestMapping("/model/demandMonitorIndustryIncrease") +@RequiredArgsConstructor +public class ModelDemandMonitorIndustryIncreaseController extends BaseController { + + private final ModelDemandMonitorIndustryIncreaseService modelDemandMonitorIndustryIncreaseService; + + /** + * 创建 + * + * @param modelDemandMonitorIndustryIncrease 劳动力需求产业增加值 + * @return 创建结果 + */ + @PostMapping("/create") + public AjaxResult create(@Valid @RequestBody ModelDemandMonitorIndustryIncrease modelDemandMonitorIndustryIncrease) { + modelDemandMonitorIndustryIncreaseService.create(modelDemandMonitorIndustryIncrease); + return AjaxResult.success(); + } + + /** + * 更新 + * + * @param modelDemandMonitorIndustryIncrease 劳动力需求产业增加值 + * @return 更新结果 + */ + @PutMapping("/update") + public AjaxResult update(@Valid @RequestBody ModelDemandMonitorIndustryIncrease modelDemandMonitorIndustryIncrease) { + modelDemandMonitorIndustryIncreaseService.update(modelDemandMonitorIndustryIncrease); + return AjaxResult.success(); + } + + /** + * 删除 + * + * @param id ID + * @return 删除结果 + */ + @DeleteMapping("/delete") + public AjaxResult delete(@RequestParam Long id) { + modelDemandMonitorIndustryIncreaseService.delete(id); + return AjaxResult.success(); + } + + /** + * 清空 + * + * @return 清空结果 + */ + @DeleteMapping("/clear") + public AjaxResult clear() { + modelDemandMonitorIndustryIncreaseService.clear(); + return AjaxResult.success(); + } + + /** + * 查询详情 + * + * @param id ID + * @return 劳动力需求产业增加值 + */ + @GetMapping("/detail") + public AjaxResult detail(@RequestParam Long id) { + ModelDemandMonitorIndustryIncrease data = modelDemandMonitorIndustryIncreaseService.detail(id); + return AjaxResult.success(data); + } + + /** + * 查询列表 + * + * @param modelDemandMonitorIndustryIncrease 劳动力需求产业增加值 + * @return 列表 + */ + @PostMapping("/list") + public AjaxResult list(@RequestBody ModelDemandMonitorIndustryIncrease modelDemandMonitorIndustryIncrease) { + List list = + modelDemandMonitorIndustryIncreaseService.list(modelDemandMonitorIndustryIncrease); + return AjaxResult.success(list); + } +} \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/ModelDemandMonitorEmployment.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/ModelDemandMonitorEmployment.java index 7f69054..459d3f4 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/ModelDemandMonitorEmployment.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/ModelDemandMonitorEmployment.java @@ -7,6 +7,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; +import java.math.BigDecimal; /** * 劳动力需求就业人数 @@ -34,20 +35,20 @@ public class ModelDemandMonitorEmployment implements Serializable { * 总就业人数(万人) */ @Excel(name = "总就业人数(万人)") - private Integer totalCount; + private BigDecimal totalCount; /** * 第一产业就业人数(万人) */ @Excel(name = "第一产业就业人数(万人)") - private Integer firstIndustryCount; + private BigDecimal firstIndustryCount; /** * 第二产业就业人数(万人) */ @Excel(name = "第二产业就业人数(万人)") - private Integer secondIndustryCount; + private BigDecimal secondIndustryCount; /** * 第三产业就业人数(万人) */ @Excel(name = "第三产业就业人数(万人)") - private Integer thirdIndustryCount; + private BigDecimal thirdIndustryCount; } \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/ModelDemandMonitorIndustryIncrease.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/ModelDemandMonitorIndustryIncrease.java new file mode 100644 index 0000000..b0d5a0d --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/ModelDemandMonitorIndustryIncrease.java @@ -0,0 +1,54 @@ +package com.ruoyi.cms.domain; + +import com.ruoyi.common.annotation.Excel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 劳动力需求产业增加值 + * + * @author 马宝龙 + * @date 2026/7/3 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ModelDemandMonitorIndustryIncrease implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private Long id; + /** + * 年份 + */ + @Excel(name = "年份") + private Integer year; + /** + * 生产总值(亿元) + */ + @Excel(name = "生产总值(亿元)") + private BigDecimal totalAmount; + /** + * 第一产业增加值(亿元) + */ + @Excel(name = "第一产业增加值(亿元)") + private BigDecimal firstIndustryAmount; + /** + * 第二产业增加值(亿元) + */ + @Excel(name = "第二产业增加值(亿元)") + private BigDecimal secondIndustryAmount; + /** + * 第三产业增加值(亿元) + */ + @Excel(name = "第三产业增加值(亿元)") + private BigDecimal thirdIndustryAmount; +} \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ModelDemandMonitorIndustryIncreaseMapper.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ModelDemandMonitorIndustryIncreaseMapper.java new file mode 100644 index 0000000..12bbe69 --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ModelDemandMonitorIndustryIncreaseMapper.java @@ -0,0 +1,64 @@ +package com.ruoyi.cms.mapper; + +import com.ruoyi.cms.domain.ModelDemandMonitorIndustryIncrease; + +import java.util.List; + +/** + * 劳动力需求产业增加值 + * + * @author 马宝龙 + * @date 2026/7/3 + */ +public interface ModelDemandMonitorIndustryIncreaseMapper { + + /** + * 新增 + * + * @param modelDemandMonitorIndustryIncrease 劳动力需求产业增加值 + */ + void insert(ModelDemandMonitorIndustryIncrease modelDemandMonitorIndustryIncrease); + + /** + * 修改 + * + * @param modelDemandMonitorIndustryIncrease 劳动力需求产业增加值 + */ + void update(ModelDemandMonitorIndustryIncrease modelDemandMonitorIndustryIncrease); + + /** + * 通过ID删除 + * + * @param id ID + */ + void deleteById(Long id); + + /** + * 清空 + */ + void clear(); + + /** + * 通过ID查询 + * + * @param id ID + * @return 劳动力需求产业增加值 + */ + ModelDemandMonitorIndustryIncrease selectById(Long id); + + /** + * 查询唯一(按年份) + * + * @param modelDemandMonitorIndustryIncrease 劳动力需求产业增加值 + * @return 劳动力需求产业增加值 + */ + ModelDemandMonitorIndustryIncrease findUnique(ModelDemandMonitorIndustryIncrease modelDemandMonitorIndustryIncrease); + + /** + * 查询列表 + * + * @param modelDemandMonitorIndustryIncrease 劳动力需求产业增加值 + * @return 列表 + */ + List list(ModelDemandMonitorIndustryIncrease modelDemandMonitorIndustryIncrease); +} \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/ModelDemandMonitorIndustryIncreaseService.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/ModelDemandMonitorIndustryIncreaseService.java new file mode 100644 index 0000000..ec7fd65 --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/ModelDemandMonitorIndustryIncreaseService.java @@ -0,0 +1,75 @@ +package com.ruoyi.cms.service; + +import com.ruoyi.cms.domain.ModelDemandMonitorIndustryIncrease; +import com.ruoyi.cms.domain.dto.ModelExportParamDto; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 劳动力需求产业增加值 + * + * @author 马宝龙 + * @date 2026/7/3 + */ +public interface ModelDemandMonitorIndustryIncreaseService { + + /** + * 创建 + * + * @param modelDemandMonitorIndustryIncrease 劳动力需求产业增加值 + */ + void create(ModelDemandMonitorIndustryIncrease modelDemandMonitorIndustryIncrease); + + /** + * 更新 + * + * @param modelDemandMonitorIndustryIncrease 劳动力需求产业增加值 + */ + void update(ModelDemandMonitorIndustryIncrease modelDemandMonitorIndustryIncrease); + + /** + * 删除 + * + * @param id ID + */ + void delete(Long id); + + /** + * 清空 + */ + void clear(); + + /** + * 查询详情 + * + * @param id ID + * @return 劳动力需求产业增加值 + */ + ModelDemandMonitorIndustryIncrease detail(Long id); + + /** + * 查询列表 + * + * @param modelDemandMonitorIndustryIncrease 劳动力需求产业增加值 + * @return 列表 + */ + List list(ModelDemandMonitorIndustryIncrease modelDemandMonitorIndustryIncrease); + + /** + * 导入数据 + * + * @param file 文件 + * @return 导入结果 + */ + String importExcel(MultipartFile file); + + /** + * 导出数据 + * + * @param response 响应体 + * @param dto 导出参数 + */ + void exportExcel(HttpServletResponse response, ModelExportParamDto dto); +} \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelCommonServiceImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelCommonServiceImpl.java index 9eb529c..5e59e69 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelCommonServiceImpl.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelCommonServiceImpl.java @@ -4,6 +4,7 @@ import com.ruoyi.cms.constant.enums.ModelTemplateTypeEnum; import com.ruoyi.cms.domain.dto.ModelExportParamDto; import com.ruoyi.cms.service.ModelCommonService; import com.ruoyi.cms.service.ModelDemandMonitorEmploymentService; +import com.ruoyi.cms.service.ModelDemandMonitorIndustryIncreaseService; import com.ruoyi.cms.service.ModelSupplyMonitorIndustryPopulationService; import com.ruoyi.cms.service.ModelSupplyMonitorLaborJoinRateService; import com.ruoyi.cms.service.ModelSupplyMonitorOccupationPopulationService; @@ -46,6 +47,7 @@ public class ModelCommonServiceImpl implements ModelCommonService { private final ModelSupplyMonitorIndustryPopulationService modelSupplyMonitorIndustryPopulationService; private final ModelSupplyMonitorOccupationPopulationService modelSupplyMonitorOccupationPopulationService; private final ModelDemandMonitorEmploymentService modelDemandMonitorEmploymentService; + private final ModelDemandMonitorIndustryIncreaseService modelDemandMonitorIndustryIncreaseService; @Override public void template(HttpServletResponse response, @@ -103,6 +105,8 @@ public class ModelCommonServiceImpl implements ModelCommonService { return modelSupplyMonitorOccupationPopulationService.importExcel(file); case MODEL_DEMAND_MONITOR_EMPLOYMENT: return modelDemandMonitorEmploymentService.importExcel(file); + case MODEL_DEMAND_MONITOR_INDUSTRY_INCREASE: + return modelDemandMonitorIndustryIncreaseService.importExcel(file); default: throw new ServiceException("模板类型错误"); } @@ -139,6 +143,9 @@ public class ModelCommonServiceImpl implements ModelCommonService { case MODEL_DEMAND_MONITOR_EMPLOYMENT: modelDemandMonitorEmploymentService.exportExcel(response, dto); break; + case MODEL_DEMAND_MONITOR_INDUSTRY_INCREASE: + modelDemandMonitorIndustryIncreaseService.exportExcel(response, dto); + break; default: throw new ServiceException("模板类型错误"); } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelDemandMonitorEmploymentServiceImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelDemandMonitorEmploymentServiceImpl.java index 1e8a04a..1b165aa 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelDemandMonitorEmploymentServiceImpl.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelDemandMonitorEmploymentServiceImpl.java @@ -74,10 +74,10 @@ public class ModelDemandMonitorEmploymentServiceImpl implements ModelDemandMonit if (Objects.isNull(modelDemandMonitorEmployment.getThirdIndustryCount())) { throw new ServiceException("第三产业就业人数不能为空"); } - if (modelDemandMonitorEmployment.getTotalCount() != - (modelDemandMonitorEmployment.getFirstIndustryCount() + - modelDemandMonitorEmployment.getSecondIndustryCount() + - modelDemandMonitorEmployment.getThirdIndustryCount())) { + if (modelDemandMonitorEmployment.getTotalCount().compareTo( + (modelDemandMonitorEmployment.getFirstIndustryCount() + .add(modelDemandMonitorEmployment.getSecondIndustryCount()) + .add(modelDemandMonitorEmployment.getThirdIndustryCount()))) != 0) { throw new ServiceException("总就业人数和第一产业就业人数、第二产业就业人数、第三产业就业人数不相等"); } } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelDemandMonitorIndustryIncreaseServiceImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelDemandMonitorIndustryIncreaseServiceImpl.java new file mode 100644 index 0000000..5b9f4dc --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelDemandMonitorIndustryIncreaseServiceImpl.java @@ -0,0 +1,209 @@ +package com.ruoyi.cms.service.impl; + +import com.ruoyi.cms.constant.enums.ModelTemplateTypeEnum; +import com.ruoyi.cms.domain.ModelDemandMonitorIndustryIncrease; +import com.ruoyi.cms.domain.dto.ModelExportParamDto; +import com.ruoyi.cms.mapper.ModelDemandMonitorIndustryIncreaseMapper; +import com.ruoyi.cms.service.ModelDemandMonitorIndustryIncreaseService; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.bean.BeanValidators; +import com.ruoyi.common.utils.poi.ExcelUtil; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import javax.validation.Validator; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +/** + * 劳动力需求产业增加值 + * + * @author 马宝龙 + * @date 2026/7/3 + */ +@Slf4j +@Service +@Validated +@RequiredArgsConstructor +public class ModelDemandMonitorIndustryIncreaseServiceImpl implements ModelDemandMonitorIndustryIncreaseService { + + private final ModelDemandMonitorIndustryIncreaseMapper modelDemandMonitorIndustryIncreaseMapper; + private final Validator validator; + + @Override + public void create(ModelDemandMonitorIndustryIncrease modelDemandMonitorIndustryIncrease) { + + check(modelDemandMonitorIndustryIncrease); + + // 查询唯一(按年份) + Optional optional = findUnique(modelDemandMonitorIndustryIncrease); + if (optional.isPresent()) { + // 更新 + ModelDemandMonitorIndustryIncrease exists = optional.get(); + modelDemandMonitorIndustryIncrease.setId(exists.getId()); + modelDemandMonitorIndustryIncreaseMapper.update(modelDemandMonitorIndustryIncrease); + } else { + // 新增 + modelDemandMonitorIndustryIncreaseMapper.insert(modelDemandMonitorIndustryIncrease); + } + } + + /** + * 检查 + * + * @param modelDemandMonitorIndustryIncrease 劳动力需求产业增加值 + */ + void check(ModelDemandMonitorIndustryIncrease modelDemandMonitorIndustryIncrease) { + if (Objects.isNull(modelDemandMonitorIndustryIncrease.getYear())) { + throw new ServiceException("年份不能为空"); + } + if (Objects.isNull(modelDemandMonitorIndustryIncrease.getTotalAmount())) { + throw new ServiceException("生产总值不能为空"); + } + if (Objects.isNull(modelDemandMonitorIndustryIncrease.getFirstIndustryAmount())) { + throw new ServiceException("第一产业增加值不能为空"); + } + if (Objects.isNull(modelDemandMonitorIndustryIncrease.getSecondIndustryAmount())) { + throw new ServiceException("第二产业增加值不能为空"); + } + if (Objects.isNull(modelDemandMonitorIndustryIncrease.getThirdIndustryAmount())) { + throw new ServiceException("第三产业增加值不能为空"); + } + if (modelDemandMonitorIndustryIncrease.getTotalAmount().compareTo( + (modelDemandMonitorIndustryIncrease.getFirstIndustryAmount() + .add(modelDemandMonitorIndustryIncrease.getSecondIndustryAmount()) + .add(modelDemandMonitorIndustryIncrease.getThirdIndustryAmount()))) != 0) { + throw new ServiceException("生产总值和第一产业增加值、第二产业增加值、第三产业增加值之和不相等"); + } + } + + @Override + public void update(ModelDemandMonitorIndustryIncrease modelDemandMonitorIndustryIncrease) { + + check(modelDemandMonitorIndustryIncrease); + + if (Objects.isNull(modelDemandMonitorIndustryIncrease.getId())) { + throw new ServiceException("id不能为空"); + } + Optional unique = findUnique(modelDemandMonitorIndustryIncrease); + if (!unique.isPresent()) { + modelDemandMonitorIndustryIncreaseMapper.update(modelDemandMonitorIndustryIncrease); + return; + } + ModelDemandMonitorIndustryIncrease exists = unique.get(); + if (!exists.getId().equals(modelDemandMonitorIndustryIncrease.getId())) { + throw new ServiceException("数据已存在"); + } + modelDemandMonitorIndustryIncreaseMapper.update(modelDemandMonitorIndustryIncrease); + } + + @Override + public void delete(Long id) { + if (Objects.isNull(id)) { + throw new ServiceException("id不能为空"); + } + modelDemandMonitorIndustryIncreaseMapper.deleteById(id); + } + + @Override + public void clear() { + modelDemandMonitorIndustryIncreaseMapper.clear(); + } + + @Override + public ModelDemandMonitorIndustryIncrease detail(Long id) { + if (Objects.isNull(id)) { + throw new ServiceException("id不能为空"); + } + return modelDemandMonitorIndustryIncreaseMapper.selectById(id); + } + + /** + * 查询唯一 + * + * @param modelDemandMonitorIndustryIncrease 劳动力需求产业增加值 + * @return 劳动力需求产业增加值 + */ + private Optional findUnique(ModelDemandMonitorIndustryIncrease modelDemandMonitorIndustryIncrease) { + ModelDemandMonitorIndustryIncrease unique = + modelDemandMonitorIndustryIncreaseMapper.findUnique(modelDemandMonitorIndustryIncrease); + return Optional.ofNullable(unique); + } + + @Override + public List list(ModelDemandMonitorIndustryIncrease modelDemandMonitorIndustryIncrease) { + return modelDemandMonitorIndustryIncreaseMapper.list(modelDemandMonitorIndustryIncrease); + } + + @Override + public String importExcel(MultipartFile file) { + try { + ExcelUtil util = new ExcelUtil<>(ModelDemandMonitorIndustryIncrease.class); + List list = util.importExcel(file.getInputStream()); + + ModelDemandMonitorIndustryIncrease exists; + int successNum = 0; + int failureNum = 0; + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + for (ModelDemandMonitorIndustryIncrease item : list) { + try { + check(item); + exists = modelDemandMonitorIndustryIncreaseMapper.findUnique(item); + if (exists == null) { + BeanValidators.validateWithException(validator, item); + modelDemandMonitorIndustryIncreaseMapper.insert(item); + successNum++; + String msg = + "
" + successNum + "、" + "年份:" + item.getYear() + "数据导入成功。"; + successMsg.append(msg); + } else { + item.setId(exists.getId()); + BeanValidators.validateWithException(validator, item); + modelDemandMonitorIndustryIncreaseMapper.update(item); + successNum++; + String msg = + "
" + successNum + "、" + "年份:" + item.getYear() + "数据更新成功。"; + successMsg.append(msg); + } + } catch (Exception e) { + failureNum++; + String msg = "
" + failureNum + "、" + "年份:" + item.getYear() + "数据导入失败:"; + failureMsg.append(msg).append(e.getMessage()); + log.error(msg, e); + } + } + if (failureNum > 0) { + failureMsg.insert(0, "导入失败!共 " + failureNum + " 条数据出现问题,错误如下:"); + throw new ServiceException(failureMsg.toString()); + } else { + successMsg.insert(0, "数据已全部导入成功!共 " + successNum + " 条:"); + } + return successMsg.toString(); + } catch (Exception e) { + log.error("数据导入失败", e); + throw new ServiceException("数据导入失败"); + } + } + + @Override + public void exportExcel(HttpServletResponse response, ModelExportParamDto dto) { + try { + + List list = list(ModelDemandMonitorIndustryIncrease.builder() + .year(dto.getYear()) + .build()); + ExcelUtil util = new ExcelUtil<>(ModelDemandMonitorIndustryIncrease.class); + util.exportExcel(response, list, ModelTemplateTypeEnum.MODEL_DEMAND_MONITOR_INDUSTRY_INCREASE.getDesc()); + + } catch (Exception e) { + log.error("数据导出失败", e); + throw new ServiceException("数据导出失败"); + } + } +} \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/resources/mapper/ModelDemandMonitorIndustryIncreaseMapper.xml b/ruoyi-bussiness/src/main/resources/mapper/ModelDemandMonitorIndustryIncreaseMapper.xml new file mode 100644 index 0000000..d7888d3 --- /dev/null +++ b/ruoyi-bussiness/src/main/resources/mapper/ModelDemandMonitorIndustryIncreaseMapper.xml @@ -0,0 +1,75 @@ + + + + + + INSERT INTO model_demand_monitor_industry_increase (year, total_amount, first_industry_amount, second_industry_amount, third_industry_amount) + VALUES (#{year}, #{totalAmount}, #{firstIndustryAmount}, #{secondIndustryAmount}, #{thirdIndustryAmount}) + + + + UPDATE model_demand_monitor_industry_increase + SET year = #{year}, + total_amount = #{totalAmount}, + first_industry_amount = #{firstIndustryAmount}, + second_industry_amount = #{secondIndustryAmount}, + third_industry_amount = #{thirdIndustryAmount} + WHERE id = #{id} + + + + DELETE + FROM model_demand_monitor_industry_increase + WHERE id = #{id} + + + + DELETE FROM model_demand_monitor_industry_increase + WHERE id IS NOT NULL; + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/resources/template/劳动力动态监测系统-劳动力需求产业增加值.xlsx b/ruoyi-bussiness/src/main/resources/template/劳动力动态监测系统-劳动力需求产业增加值.xlsx new file mode 100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