From 0b343113e2fc93ae6679adadc075d92dbcf7f5c8 Mon Sep 17 00:00:00 2001
From: zhanghl <253316343@qq.com>
Date: 星期四, 22 五月 2025 14:56:17 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev
---
/dev/null | 0
aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsGasPipelineCapacityPlan.java | 16 ++++
aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsGasPipelineCapacityPlanController.java | 68 ++++++++++------
aps-modules/aps-core/src/main/resources/mapper/core/ApsGasPipelineCapacityPlanMapper.xml | 15 +++
aps-modules/aps-core/src/main/java/com/aps/core/service/IApsGasPipelineCapacityPlanService.java | 2
aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelineMoController.java | 7 +
aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelinePredictionController.java | 7 +
aps-modules/aps-job/src/main/java/com/aps/job/service/impl/ApsWeldSeamStandardJobServiceImpl.java | 14 ++-
aps-modules/aps-core/src/main/resources/templates/气体预测数据模板v1.0.xlsx | 0
aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipelineCapacityPlanServiceImpl.java | 92 +++++++++++++++++-----
aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsGasPipelineCapacityPlanMapper.java | 5 +
aps-modules/aps-core/src/main/resources/templates/气体工单数据模板v1.0.xlsx | 0
12 files changed, 166 insertions(+), 60 deletions(-)
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsGasPipelineCapacityPlanController.java b/aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsGasPipelineCapacityPlanController.java
index e2b1ddd..744750a 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsGasPipelineCapacityPlanController.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsGasPipelineCapacityPlanController.java
@@ -24,7 +24,7 @@
/**
* 姘斾綋绠¤矾浜ц兘瑙勫垝Controller
- *
+ *
* @author hjy
* @date 2025-04-24
*/
@@ -32,8 +32,7 @@
@Tag(name = "姘斾綋绠¤矾浜ц兘瑙勫垝", description = "姘斾綋绠¤矾浜ц兘瑙勫垝鎺ュ彛")
@RestController
@RequestMapping("/gasPipelineCapacityPlan")
-public class ApsGasPipelineCapacityPlanController extends BaseController
-{
+public class ApsGasPipelineCapacityPlanController extends BaseController {
@Autowired
private IApsGasPipelineCapacityPlanService apsGasPipelineCapacityPlanService;
@@ -46,43 +45,42 @@
@Operation(summary = "鏌ヨ姘斾綋绠¤矾浜ц兘瑙勫垝鍒楄〃", description = "鍒嗛〉鏌ヨ")
@RequiresPermissions("aps:gasPipelineCapacityPlan:list")
@GetMapping("/list")
- public TableDataInfo list(ApsGasPipelineCapacityPlan apsGasPipelineCapacityPlan)
- {
+ public TableDataInfo list(ApsGasPipelineCapacityPlan apsGasPipelineCapacityPlan) {
// startPage();
List<ApsGasPipelineCapacityPlan> list = apsGasPipelineCapacityPlanService.selectApsGasPipelineCapacityPlanList(apsGasPipelineCapacityPlan);
ApsStandardProcess apsStandardProcess = new ApsStandardProcess();
apsStandardProcess.setMajor(apsGasPipelineCapacityPlan.getMajor());
apsStandardProcess.setPlant(apsGasPipelineCapacityPlan.getOrgCode());
List<ApsStandardProcess> processList = apsStandardProcessService.selectApsStandardProcessListAll(apsStandardProcess);
- if(list.isEmpty()){
- for(ApsStandardProcess apsStandardProcessTemp : processList){
+ if (list.isEmpty()) {
+ for (ApsStandardProcess apsStandardProcessTemp : processList) {
ApsGasPipelineCapacityPlan apsGasPipelineCapacityPlanTemp = new ApsGasPipelineCapacityPlan();
apsGasPipelineCapacityPlanTemp.setProcessName(apsStandardProcessTemp.getProcessName());
apsGasPipelineCapacityPlanTemp.setOrgCode(apsStandardProcessTemp.getPlant());
list.add(apsGasPipelineCapacityPlanTemp);
}
}
- if(processList.size()>list.size()){
+ if (processList.size() > list.size()) {
List<String> newProcess = new ArrayList<>();
- for(ApsStandardProcess apsStandardProcessTemp : processList){
+ for (ApsStandardProcess apsStandardProcessTemp : processList) {
boolean flag = true;
- for(ApsGasPipelineCapacityPlan temp : list){
- if(apsStandardProcessTemp.getProcessName().equals(temp.getProcessName())){
+ for (ApsGasPipelineCapacityPlan temp : list) {
+ if (apsStandardProcessTemp.getProcessName().equals(temp.getProcessName())) {
flag = false;
break;
}
}
- if(flag){
+ if (flag) {
newProcess.add(apsStandardProcessTemp.getProcessName());
}
}
- for(String processName : newProcess){
+ for (String processName : newProcess) {
ApsGasPipelineCapacityPlan apsGasPipelineCapacityPlanTemp = new ApsGasPipelineCapacityPlan();
apsGasPipelineCapacityPlanTemp.setProcessName(processName);
list.add(apsGasPipelineCapacityPlanTemp);
}
}
- list.sort((a, b)->a.getProcessName().compareTo(b.getProcessName()));
+ list.sort((a, b) -> a.getProcessName().compareTo(b.getProcessName()));
return getDataTable(list);
}
@@ -93,11 +91,31 @@
@RequiresPermissions("aps:gasPipelineCapacityPlan:export")
@Log(title = "姘斾綋绠¤矾浜ц兘瑙勫垝", businessType = BusinessType.EXPORT)
@PostMapping("/export")
- public void export(HttpServletResponse response, ApsGasPipelineCapacityPlan apsGasPipelineCapacityPlan)
- {
+ public void export(HttpServletResponse response, ApsGasPipelineCapacityPlan apsGasPipelineCapacityPlan) {
List<ApsGasPipelineCapacityPlan> list = apsGasPipelineCapacityPlanService.selectApsGasPipelineCapacityPlanList(apsGasPipelineCapacityPlan);
ExcelUtil<ApsGasPipelineCapacityPlan> util = new ExcelUtil<ApsGasPipelineCapacityPlan>(ApsGasPipelineCapacityPlan.class);
util.exportExcel(response, list, "姘斾綋绠¤矾浜ц兘瑙勫垝鏁版嵁");
+ }
+
+
+ /**
+ * 澶嶅埗姘斾綋绠¤矾浜ц兘瑙勫垝
+ */
+ @Operation(summary = "澶嶅埗姘斾綋绠¤矾浜ц兘瑙勫垝", description = "澶嶅埗")
+// @RequiresPermissions("aps:gasPipelineCapacityPlan:copy")
+ @Log(title = "澶嶅埗姘斾綋绠¤矾浜ц兘瑙勫垝", businessType = BusinessType.INSERT)
+ @PutMapping("/copy")
+ public AjaxResult copy(
+ // 鏍煎紡锛歽yyy-MM
+ @RequestParam String date,
+ @RequestParam String factory,
+ @RequestParam String major,
+ // 鏍煎紡锛歽yyy-MM
+ @RequestParam String toStart,
+ // 鏍煎紡锛歽yyy-MM
+ @RequestParam String toEnd) {
+ apsGasPipelineCapacityPlanService.copyPlan(date, factory, major, toStart, toEnd);
+ return success();
}
/**
@@ -106,8 +124,7 @@
@Operation(summary = "鑾峰彇姘斾綋绠¤矾浜ц兘瑙勫垝璇︾粏淇℃伅", description = "鏍规嵁id鑾峰彇")
@RequiresPermissions("aps:gasPipelineCapacityPlan:query")
@GetMapping(value = "/{id}")
- public AjaxResult getInfo(@PathVariable("id") Long id)
- {
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(apsGasPipelineCapacityPlanService.selectApsGasPipelineCapacityPlanById(id));
}
@@ -118,14 +135,13 @@
@RequiresPermissions("aps:gasPipelineCapacityPlan:add")
@Log(title = "姘斾綋绠¤矾浜ц兘瑙勫垝", businessType = BusinessType.INSERT)
@PostMapping
- public AjaxResult add(@RequestBody List<ApsGasPipelineCapacityPlan> apsGasPipelineCapacityPlan)
- {
+ public AjaxResult add(@RequestBody List<ApsGasPipelineCapacityPlan> apsGasPipelineCapacityPlan) {
apsGasPipelineCapacityPlan.forEach(apsGasPipelineCapacityPlanTemp -> {
- if(apsGasPipelineCapacityPlanTemp.getId()==null){
+ if (apsGasPipelineCapacityPlanTemp.getId() == null) {
apsGasPipelineCapacityPlanTemp.setCreateBy(SecurityUtils.getUsername());
apsGasPipelineCapacityPlanTemp.setCreateTime(DateUtils.getNowDate());
apsGasPipelineCapacityPlanService.insertApsGasPipelineCapacityPlan(apsGasPipelineCapacityPlanTemp);
- }else{
+ } else {
apsGasPipelineCapacityPlanTemp.setUpdateBy(SecurityUtils.getUsername());
apsGasPipelineCapacityPlanTemp.setUpdateTime(DateUtils.getNowDate());
apsGasPipelineCapacityPlanService.updateApsGasPipelineCapacityPlan(apsGasPipelineCapacityPlanTemp);
@@ -141,8 +157,7 @@
@RequiresPermissions("aps:gasPipelineCapacityPlan:edit")
@Log(title = "姘斾綋绠¤矾浜ц兘瑙勫垝", businessType = BusinessType.UPDATE)
@PutMapping
- public AjaxResult edit(@RequestBody ApsGasPipelineCapacityPlan apsGasPipelineCapacityPlan)
- {
+ public AjaxResult edit(@RequestBody ApsGasPipelineCapacityPlan apsGasPipelineCapacityPlan) {
return toAjax(apsGasPipelineCapacityPlanService.updateApsGasPipelineCapacityPlan(apsGasPipelineCapacityPlan));
}
@@ -152,9 +167,8 @@
@Operation(summary = "鍒犻櫎姘斾綋绠¤矾浜ц兘瑙勫垝", description = "鎵归噺鍒犻櫎")
@RequiresPermissions("aps:gasPipelineCapacityPlan:remove")
@Log(title = "姘斾綋绠¤矾浜ц兘瑙勫垝", businessType = BusinessType.DELETE)
- @DeleteMapping("/{ids}")
- public AjaxResult remove(@PathVariable Long[] ids)
- {
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(apsGasPipelineCapacityPlanService.deleteApsGasPipelineCapacityPlanByIds(ids));
}
}
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelineMoController.java b/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelineMoController.java
index 28bdaa0..f99787f 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelineMoController.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelineMoController.java
@@ -130,13 +130,14 @@
*/
@SneakyThrows
@Operation(summary = "涓嬭浇姘斾綋宸ュ崟鏁版嵁瀵煎叆妯℃澘", description = "涓嬭浇姘斾綋宸ュ崟鏁版嵁瀵煎叆妯℃澘")
- @RequiresPermissions("gasPipeline:mo:template")
- @Log(title = "涓嬭浇姘斾綋宸ュ崟鏁版嵁瀵煎叆妯℃澘", businessType = BusinessType.EXPORT)
+// @RequiresPermissions("gasPipeline:mo:template")
+// @Log(title = "涓嬭浇姘斾綋宸ュ崟鏁版嵁瀵煎叆妯℃澘", businessType = BusinessType.EXPORT)
@GetMapping("/template")
public ResponseEntity<ByteArrayResource> exportTemplate() {
- byte[] file = IOUtils.resourceToByteArray("/templates/涓婁紶姘斾綋宸ュ崟鏁版嵁妯℃澘.xlsx");
+ byte[] file = IOUtils.resourceToByteArray("/templates/姘斾綋宸ュ崟鏁版嵁妯℃澘v1.0.xlsx");
ByteArrayResource resource = new ByteArrayResource(file);
return ResponseEntity.ok()
+ .header("Access-Control-Expose-Headers", HttpHeaders.CONTENT_DISPOSITION)
.header(HttpHeaders.CONTENT_DISPOSITION,
String.format("attachment;filename=%s", URLEncoder.encode("姘斾綋宸ュ崟鏁版嵁妯℃澘.xlsx", StandardCharsets.UTF_8)))
.header(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelinePredictionController.java b/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelinePredictionController.java
index 48d9042..faf5e0a 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelinePredictionController.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelinePredictionController.java
@@ -70,13 +70,14 @@
*/
@SneakyThrows
@Operation(summary = "涓嬭浇姘斾綋棰勬祴鏁版嵁瀵煎叆妯℃澘", description = "涓嬭浇姘斾綋棰勬祴鏁版嵁瀵煎叆妯℃澘")
- @RequiresPermissions("gasPipeline:prediction:template")
- @Log(title = "涓嬭浇姘斾綋棰勬祴鏁版嵁瀵煎叆妯℃澘", businessType = BusinessType.EXPORT)
+// @RequiresPermissions("gasPipeline:prediction:template")
+// @Log(title = "涓嬭浇姘斾綋棰勬祴鏁版嵁瀵煎叆妯℃澘", businessType = BusinessType.EXPORT)
@GetMapping("/template")
public ResponseEntity<ByteArrayResource> exportTemplate() {
- byte[] file = IOUtils.resourceToByteArray("/templates/涓婁紶姘斾綋棰勬祴鏁版嵁妯℃澘.xlsx");
+ byte[] file = IOUtils.resourceToByteArray("/templates/姘斾綋棰勬祴鏁版嵁妯℃澘v1.0.xlsx");
ByteArrayResource resource = new ByteArrayResource(file);
return ResponseEntity.ok()
+ .header("Access-Control-Expose-Headers", HttpHeaders.CONTENT_DISPOSITION)
.header(HttpHeaders.CONTENT_DISPOSITION,
String.format("attachment;filename=%s", URLEncoder.encode("姘斾綋棰勬祴鏁版嵁妯℃澘.xlsx", StandardCharsets.UTF_8)))
.header(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsGasPipelineCapacityPlan.java b/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsGasPipelineCapacityPlan.java
index 46eb05a..3751687 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsGasPipelineCapacityPlan.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsGasPipelineCapacityPlan.java
@@ -2,9 +2,14 @@
import com.aps.common.core.annotation.Excel;
import com.aps.common.core.web.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
+import org.springframework.data.annotation.Id;
import java.math.BigDecimal;
@@ -14,12 +19,16 @@
* @author hjy
* @date 2025-04-24
*/
+@Data
@Schema(description = "姘斾綋绠¤矾浜ц兘瑙勫垝瀹炰綋绫�")
public class ApsGasPipelineCapacityPlan extends BaseEntity
{
private static final long serialVersionUID = 1L;
+ @Id
+ @TableId(type = IdType.AUTO)
/** 涓婚敭id */
+ @JsonFormat(shape = JsonFormat.Shape.STRING)
@Schema(description = "涓婚敭id", type = "Long")
private Long id;
@@ -58,6 +67,7 @@
@Schema(description = "鏃ヤ骇鍑哄崟浣�", type = "String")
private String dayProduceUnit;
+
/** 浜哄憳鏁伴噺 */
@Excel(name = "浜哄憳鏁伴噺")
@Schema(description = "浜哄憳鏁伴噺", type = "BigDecimal")
@@ -83,6 +93,12 @@
@Schema(description = "宸ュ巶浠g爜", type = "String")
private String orgCode;
+
+ /** 杞﹂棿 */
+ @Excel(name = "杞﹂棿")
+ @Schema(description = "杞﹂棿", type = "String")
+ private String workshop;
+
public void setOrgCode(String orgCode)
{
this.orgCode = orgCode;
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsGasPipelineCapacityPlanMapper.java b/aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsGasPipelineCapacityPlanMapper.java
index 329bc9b..22ddc1c 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsGasPipelineCapacityPlanMapper.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsGasPipelineCapacityPlanMapper.java
@@ -1,6 +1,7 @@
package com.aps.core.mapper;
import com.aps.core.domain.ApsGasPipelineCapacityPlan;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@@ -12,7 +13,7 @@
* @date 2025-04-24
*/
@Mapper
-public interface ApsGasPipelineCapacityPlanMapper
+public interface ApsGasPipelineCapacityPlanMapper extends BaseMapper<ApsGasPipelineCapacityPlan>
{
/**
* 鏌ヨ姘斾綋绠¤矾浜ц兘瑙勫垝
@@ -61,4 +62,6 @@
* @return 缁撴灉
*/
public int deleteApsGasPipelineCapacityPlanByIds(Long[] ids);
+
+ void deleteByDateAndFactory(String year, String month, String factory, String major);
}
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsGasPipelineCapacityPlanService.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsGasPipelineCapacityPlanService.java
index cfb8e5b..722bb30 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsGasPipelineCapacityPlanService.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsGasPipelineCapacityPlanService.java
@@ -59,4 +59,6 @@
* @return 缁撴灉
*/
public int deleteApsGasPipelineCapacityPlanById(Long id);
+
+ void copyPlan(String date, String factory, String major, String toStart, String toEnd);
}
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipelineCapacityPlanServiceImpl.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipelineCapacityPlanServiceImpl.java
index f175d09..49a8da2 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipelineCapacityPlanServiceImpl.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipelineCapacityPlanServiceImpl.java
@@ -5,56 +5,59 @@
import com.aps.core.domain.ApsGasPipelineCapacityPlan;
import com.aps.core.mapper.ApsGasPipelineCapacityPlanMapper;
import com.aps.core.service.IApsGasPipelineCapacityPlanService;
+import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import java.sql.Timestamp;
+import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.util.Calendar;
+import java.util.Date;
import java.util.List;
/**
* 姘斾綋绠¤矾浜ц兘瑙勫垝Service涓氬姟灞傚鐞�
- *
+ *
* @author hjy
* @date 2025-04-24
*/
@Service
-public class ApsGasPipelineCapacityPlanServiceImpl implements IApsGasPipelineCapacityPlanService
-{
+public class ApsGasPipelineCapacityPlanServiceImpl implements IApsGasPipelineCapacityPlanService {
@Autowired
private ApsGasPipelineCapacityPlanMapper apsGasPipelineCapacityPlanMapper;
/**
* 鏌ヨ姘斾綋绠¤矾浜ц兘瑙勫垝
- *
+ *
* @param id 姘斾綋绠¤矾浜ц兘瑙勫垝涓婚敭
* @return 姘斾綋绠¤矾浜ц兘瑙勫垝
*/
@Override
- public ApsGasPipelineCapacityPlan selectApsGasPipelineCapacityPlanById(Long id)
- {
+ public ApsGasPipelineCapacityPlan selectApsGasPipelineCapacityPlanById(Long id) {
return apsGasPipelineCapacityPlanMapper.selectApsGasPipelineCapacityPlanById(id);
}
/**
* 鏌ヨ姘斾綋绠¤矾浜ц兘瑙勫垝鍒楄〃
- *
+ *
* @param apsGasPipelineCapacityPlan 姘斾綋绠¤矾浜ц兘瑙勫垝
* @return 姘斾綋绠¤矾浜ц兘瑙勫垝
*/
@Override
- public List<ApsGasPipelineCapacityPlan> selectApsGasPipelineCapacityPlanList(ApsGasPipelineCapacityPlan apsGasPipelineCapacityPlan)
- {
+ public List<ApsGasPipelineCapacityPlan> selectApsGasPipelineCapacityPlanList(ApsGasPipelineCapacityPlan apsGasPipelineCapacityPlan) {
return apsGasPipelineCapacityPlanMapper.selectApsGasPipelineCapacityPlanList(apsGasPipelineCapacityPlan);
}
/**
* 鏂板姘斾綋绠¤矾浜ц兘瑙勫垝
- *
+ *
* @param apsGasPipelineCapacityPlan 姘斾綋绠¤矾浜ц兘瑙勫垝
* @return 缁撴灉
*/
@Override
- public int insertApsGasPipelineCapacityPlan(ApsGasPipelineCapacityPlan apsGasPipelineCapacityPlan)
- {
+ public int insertApsGasPipelineCapacityPlan(ApsGasPipelineCapacityPlan apsGasPipelineCapacityPlan) {
apsGasPipelineCapacityPlan.setCreateTime(DateUtils.getNowDate());
apsGasPipelineCapacityPlan.setCreateBy(SecurityUtils.getUsername());
return apsGasPipelineCapacityPlanMapper.insertApsGasPipelineCapacityPlan(apsGasPipelineCapacityPlan);
@@ -62,13 +65,12 @@
/**
* 淇敼姘斾綋绠¤矾浜ц兘瑙勫垝
- *
+ *
* @param apsGasPipelineCapacityPlan 姘斾綋绠¤矾浜ц兘瑙勫垝
* @return 缁撴灉
*/
@Override
- public int updateApsGasPipelineCapacityPlan(ApsGasPipelineCapacityPlan apsGasPipelineCapacityPlan)
- {
+ public int updateApsGasPipelineCapacityPlan(ApsGasPipelineCapacityPlan apsGasPipelineCapacityPlan) {
apsGasPipelineCapacityPlan.setUpdateTime(DateUtils.getNowDate());
apsGasPipelineCapacityPlan.setUpdateBy(SecurityUtils.getUsername());
return apsGasPipelineCapacityPlanMapper.updateApsGasPipelineCapacityPlan(apsGasPipelineCapacityPlan);
@@ -76,25 +78,73 @@
/**
* 鎵归噺鍒犻櫎姘斾綋绠¤矾浜ц兘瑙勫垝
- *
+ *
* @param ids 闇�瑕佸垹闄ょ殑姘斾綋绠¤矾浜ц兘瑙勫垝涓婚敭
* @return 缁撴灉
*/
@Override
- public int deleteApsGasPipelineCapacityPlanByIds(Long[] ids)
- {
+ public int deleteApsGasPipelineCapacityPlanByIds(Long[] ids) {
return apsGasPipelineCapacityPlanMapper.deleteApsGasPipelineCapacityPlanByIds(ids);
}
/**
* 鍒犻櫎姘斾綋绠¤矾浜ц兘瑙勫垝淇℃伅
- *
+ *
* @param id 姘斾綋绠¤矾浜ц兘瑙勫垝涓婚敭
* @return 缁撴灉
*/
@Override
- public int deleteApsGasPipelineCapacityPlanById(Long id)
- {
+ public int deleteApsGasPipelineCapacityPlanById(Long id) {
return apsGasPipelineCapacityPlanMapper.deleteApsGasPipelineCapacityPlanById(id);
}
+
+ @SneakyThrows
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void copyPlan(String date, String factory, String major, String toStart, String toEnd) {
+
+ String[] dtSrc = date.split("-");
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+ Calendar dtStart = Calendar.getInstance();
+ dtStart.setTime(sdf.parse(toStart));
+ dtStart.set(Calendar.DAY_OF_MONTH, 1);
+ Calendar dtEnd = Calendar.getInstance();
+ dtEnd.setTime(sdf.parse(toEnd));
+ dtEnd.set(Calendar.DAY_OF_MONTH, 2);
+
+ ApsGasPipelineCapacityPlan plan = new ApsGasPipelineCapacityPlan();
+ plan.setYear(Integer.valueOf(dtSrc[0]).toString());
+ plan.setMonth(Integer.valueOf(dtSrc[1]).toString());
+ plan.setOrgCode(factory);
+ plan.setMajor(major);
+ List<ApsGasPipelineCapacityPlan> templatePlans = apsGasPipelineCapacityPlanMapper.selectApsGasPipelineCapacityPlanList(plan);
+ templatePlans.forEach(p -> {
+ p.setCreateBy(SecurityUtils.getUsername());
+ p.setCreateTime(new Date());
+ p.setUpdateBy(null);
+ p.setUpdateTime(null);
+// apsGasPipelineCapacityPlanMapper.insertApsGasPipelineCapacityPlan(p);
+ });
+
+ while (dtStart.before(dtEnd)) {
+ String year = dtStart.get(Calendar.YEAR) + "";
+ String month = (dtStart.get(Calendar.MONTH) + 1) + "";
+ apsGasPipelineCapacityPlanMapper.deleteByDateAndFactory(
+ year,
+ month,
+ factory,
+ major
+ );
+ templatePlans.forEach(p -> {
+ p.setId(null);
+ p.setYear(year);
+ p.setMonth(month);
+// apsGasPipelineCapacityPlanMapper.insertApsGasPipelineCapacityPlan(p);
+ });
+ apsGasPipelineCapacityPlanMapper.insert(templatePlans);
+
+ dtStart.add(Calendar.MONTH, 1);
+ }
+
+ }
}
diff --git a/aps-modules/aps-core/src/main/resources/mapper/core/ApsGasPipelineCapacityPlanMapper.xml b/aps-modules/aps-core/src/main/resources/mapper/core/ApsGasPipelineCapacityPlanMapper.xml
index 329ee58..5c16e41 100644
--- a/aps-modules/aps-core/src/main/resources/mapper/core/ApsGasPipelineCapacityPlanMapper.xml
+++ b/aps-modules/aps-core/src/main/resources/mapper/core/ApsGasPipelineCapacityPlanMapper.xml
@@ -10,6 +10,7 @@
<result property="year" column="year" />
<result property="month" column="month" />
<result property="major" column="major" />
+ <result property="workshop" column="workshop" />
<result property="dayProduceType" column="day_produce_type" />
<result property="dayProduceNum" column="day_produce_num" />
<result property="dayProduceUnit" column="day_produce_unit" />
@@ -26,7 +27,7 @@
</resultMap>
<sql id="selectApsGasPipelineCapacityPlanVo">
- select id, process_name, year, month, major, day_produce_type, day_produce_num, day_produce_unit, personnel_number, day_produce_all_num, days, month_produce_all_num, remark, create_by, create_time, update_by, update_time, org_code from aps_gas_pipeline_capacity_plan
+ select id, process_name, year, month, major, workshop, day_produce_type, day_produce_num, day_produce_unit, personnel_number, day_produce_all_num, days, month_produce_all_num, remark, create_by, create_time, update_by, update_time, org_code from aps_gas_pipeline_capacity_plan
</sql>
<select id="selectApsGasPipelineCapacityPlanList" parameterType="com.aps.core.domain.ApsGasPipelineCapacityPlan" resultMap="ApsGasPipelineCapacityPlanResult">
@@ -36,6 +37,7 @@
<if test="year != null and year != ''"> and year = #{year}</if>
<if test="month != null and month != ''"> and month = #{month}</if>
<if test="major != null and major != ''"> and major = #{major}</if>
+ <if test="workshop != null and workshop != ''"> and workshop = #{workshop}</if>
<if test="dayProduceType != null and dayProduceType != ''"> and day_produce_type = #{dayProduceType}</if>
<if test="dayProduceNum != null "> and day_produce_num = #{dayProduceNum}</if>
<if test="dayProduceUnit != null and dayProduceUnit != ''"> and day_produce_unit = #{dayProduceUnit}</if>
@@ -63,6 +65,7 @@
<if test="year != null">year,</if>
<if test="month != null">month,</if>
<if test="major != null">major,</if>
+ <if test="workshop != null">workshop,</if>
<if test="dayProduceType != null">day_produce_type,</if>
<if test="dayProduceNum != null">day_produce_num,</if>
<if test="dayProduceUnit != null">day_produce_unit,</if>
@@ -83,6 +86,7 @@
<if test="year != null">#{year},</if>
<if test="month != null">#{month},</if>
<if test="major != null">#{major},</if>
+ <if test="workshop != null">workshop,</if>
<if test="dayProduceType != null">#{dayProduceType},</if>
<if test="dayProduceNum != null">#{dayProduceNum},</if>
<if test="dayProduceUnit != null">#{dayProduceUnit},</if>
@@ -106,6 +110,7 @@
<if test="year != null">year = #{year},</if>
<if test="month != null">month = #{month},</if>
<if test="major != null">major = #{major},</if>
+ <if test="workshop != null">workshop,</if>
<if test="dayProduceType != null">day_produce_type = #{dayProduceType},</if>
<if test="dayProduceNum != null">day_produce_num = #{dayProduceNum},</if>
<if test="dayProduceUnit != null">day_produce_unit = #{dayProduceUnit},</if>
@@ -133,4 +138,12 @@
#{id}
</foreach>
</delete>
+
+ <delete id="deleteByDateAndFactory" >
+ delete from aps_gas_pipeline_capacity_plan
+ where year = #{year}
+ and month = #{month}
+ and org_code = #{factory}
+ and major = #{major}
+ </delete>
</mapper>
\ No newline at end of file
diff --git "a/aps-modules/aps-core/src/main/resources/templates/\344\270\212\344\274\240\346\260\224\344\275\223\345\267\245\345\215\225\346\225\260\346\215\256\346\250\241\346\235\277.xlsx" "b/aps-modules/aps-core/src/main/resources/templates/\344\270\212\344\274\240\346\260\224\344\275\223\345\267\245\345\215\225\346\225\260\346\215\256\346\250\241\346\235\277.xlsx"
deleted file mode 100644
index f3a4177..0000000
--- "a/aps-modules/aps-core/src/main/resources/templates/\344\270\212\344\274\240\346\260\224\344\275\223\345\267\245\345\215\225\346\225\260\346\215\256\346\250\241\346\235\277.xlsx"
+++ /dev/null
Binary files differ
diff --git "a/aps-modules/aps-core/src/main/resources/templates/\344\270\212\344\274\240\346\260\224\344\275\223\351\242\204\346\265\213\346\225\260\346\215\256\346\250\241\346\235\277.xlsx" "b/aps-modules/aps-core/src/main/resources/templates/\344\270\212\344\274\240\346\260\224\344\275\223\351\242\204\346\265\213\346\225\260\346\215\256\346\250\241\346\235\277.xlsx"
deleted file mode 100644
index 6a261c6..0000000
--- "a/aps-modules/aps-core/src/main/resources/templates/\344\270\212\344\274\240\346\260\224\344\275\223\351\242\204\346\265\213\346\225\260\346\215\256\346\250\241\346\235\277.xlsx"
+++ /dev/null
Binary files differ
diff --git "a/aps-modules/aps-core/src/main/resources/templates/\346\260\224\344\275\223\345\267\245\345\215\225\346\225\260\346\215\256\346\250\241\346\235\277v1.0.xlsx" "b/aps-modules/aps-core/src/main/resources/templates/\346\260\224\344\275\223\345\267\245\345\215\225\346\225\260\346\215\256\346\250\241\346\235\277v1.0.xlsx"
new file mode 100644
index 0000000..e67251f
--- /dev/null
+++ "b/aps-modules/aps-core/src/main/resources/templates/\346\260\224\344\275\223\345\267\245\345\215\225\346\225\260\346\215\256\346\250\241\346\235\277v1.0.xlsx"
Binary files differ
diff --git "a/aps-modules/aps-core/src/main/resources/templates/\346\260\224\344\275\223\351\242\204\346\265\213\346\225\260\346\215\256\346\250\241\346\235\277v1.0.xlsx" "b/aps-modules/aps-core/src/main/resources/templates/\346\260\224\344\275\223\351\242\204\346\265\213\346\225\260\346\215\256\346\250\241\346\235\277v1.0.xlsx"
new file mode 100644
index 0000000..50fb427
--- /dev/null
+++ "b/aps-modules/aps-core/src/main/resources/templates/\346\260\224\344\275\223\351\242\204\346\265\213\346\225\260\346\215\256\346\250\241\346\235\277v1.0.xlsx"
Binary files differ
diff --git a/aps-modules/aps-job/src/main/java/com/aps/job/service/impl/ApsWeldSeamStandardJobServiceImpl.java b/aps-modules/aps-job/src/main/java/com/aps/job/service/impl/ApsWeldSeamStandardJobServiceImpl.java
index 3e6c84b..49daf90 100644
--- a/aps-modules/aps-job/src/main/java/com/aps/job/service/impl/ApsWeldSeamStandardJobServiceImpl.java
+++ b/aps-modules/aps-job/src/main/java/com/aps/job/service/impl/ApsWeldSeamStandardJobServiceImpl.java
@@ -1,5 +1,6 @@
package com.aps.job.service.impl;
+import cn.hutool.core.collection.ListUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
@@ -179,11 +180,16 @@
deleteAllApsWeldSeamStandardJob();
// 鎵归噺鎻掑叆鏂版暟鎹�
- batchInsertApsWeldSeamStandardJob(jobList);
-
+ List<List<ApsWeldSeamStandardJob>> dataGroupInterface = ListUtil.split(jobList, 1000);
+ for (List<ApsWeldSeamStandardJob> data : dataGroupInterface) {
+ batchInsertApsWeldSeamStandardJob(data);
+ }
+
// 鍚屾鏁版嵁鍒颁笟鍔¤〃
- syncToBizTable(jobList);
-
+ List<List<ApsWeldSeamStandardJob>> dataGroup = ListUtil.split(jobList, 1000);
+ for (List<ApsWeldSeamStandardJob> data : dataGroup) {
+ syncToBizTable(data);
+ }
return true;
} catch (Exception e) {
log.error("鍚屾鐗╂枡鏍囧噯鐒婄紳鏁版嵁寮傚父", e);
--
Gitblit v1.9.3