| | |
| | | |
| | | |
| | | /** |
| | | * 夿æ¯å¦åå¨é |
| | | * */ |
| | | public boolean existLock(String key,String value){ |
| | | return this.redisTemplate.opsForValue().get(key).equals(value); |
| | | } |
| | | |
| | | /** |
| | | * å é |
| | | **/ |
| | | public Boolean getLock(String key,String value,Long timeoutSeconds){ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.controller.mainPlan; |
| | | |
| | | import com.aps.common.core.utils.poi.ExcelUtil; |
| | | import com.aps.common.core.web.controller.BaseController; |
| | | import com.aps.common.core.web.domain.AjaxResult; |
| | | import com.aps.common.core.web.page.TableDataInfo; |
| | | import com.aps.common.log.annotation.Log; |
| | | import com.aps.common.log.enums.BusinessType; |
| | | import com.aps.common.security.annotation.RequiresPermissions; |
| | | import com.aps.core.domain.ApsGasPipelineMo; |
| | | import com.aps.core.service.IApsGasPipelineMoService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 管路æå·¥æ°ä½å·¥åæ°æ®Controller |
| | | * |
| | | * @author sfd |
| | | * @date 2025-05-19 |
| | | */ |
| | | |
| | | @Tag(name = "管路æå·¥æ°ä½å·¥åæ°æ®", description = "管路æå·¥æ°ä½å·¥åæ°æ®æ¥å£") |
| | | @RestController |
| | | @RequestMapping("/gasPipelineMo") |
| | | public class ApsGasPipelineMoController extends BaseController |
| | | { |
| | | @Autowired |
| | | private IApsGasPipelineMoService apsGasPipelineMoService; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ®å表 |
| | | */ |
| | | @Operation(summary = "æ¥è¯¢ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ®å表", description = "å页æ¥è¯¢") |
| | | @RequiresPermissions("gasPipeline:mo:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ApsGasPipelineMo apsGasPipelineMo) |
| | | { |
| | | startPage(); |
| | | List<ApsGasPipelineMo> list = apsGasPipelineMoService.selectApsGasPipelineMoList(apsGasPipelineMo); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "导å
¥ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ®", description = "æ¹é导å
¥") |
| | | @Log(title = "导å
¥ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ®", businessType = BusinessType.IMPORT) |
| | | @RequiresPermissions("gasPipeline:mo:import") |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file) throws Exception { |
| | | |
| | | int i = apsGasPipelineMoService.batchInsertGasPipelineMo(file); |
| | | return toAjax(i); |
| | | } |
| | | |
| | | /** |
| | | * 导åºç®¡è·¯æå·¥æ°ä½å·¥åæ°æ®å表 |
| | | */ |
| | | @Operation(summary = "导åºç®¡è·¯æå·¥æ°ä½å·¥åæ°æ®å表", description = "导åº") |
| | | @RequiresPermissions("gasPipeline:mo:export") |
| | | @Log(title = "管路æå·¥æ°ä½å·¥åæ°æ®", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ApsGasPipelineMo apsGasPipelineMo) |
| | | { |
| | | List<ApsGasPipelineMo> list = apsGasPipelineMoService.selectApsGasPipelineMoList(apsGasPipelineMo); |
| | | ExcelUtil<ApsGasPipelineMo> util = new ExcelUtil<ApsGasPipelineMo>(ApsGasPipelineMo.class); |
| | | util.exportExcel(response, list, "管路æå·¥æ°ä½å·¥åæ°æ®æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * è·å管路æå·¥æ°ä½å·¥åæ°æ®è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "è·å管路æå·¥æ°ä½å·¥åæ°æ®è¯¦ç»ä¿¡æ¯", description = "æ ¹æ®idè·å") |
| | | @RequiresPermissions("gasPipeline:mo:query") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | return success(apsGasPipelineMoService.selectApsGasPipelineMoById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ® |
| | | */ |
| | | @Operation(summary = "æ°å¢ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ®", description = "å个æ°å¢") |
| | | @RequiresPermissions("gasPipeline:mo:add") |
| | | @Log(title = "管路æå·¥æ°ä½å·¥åæ°æ®", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ApsGasPipelineMo apsGasPipelineMo) |
| | | { |
| | | return toAjax(apsGasPipelineMoService.insertApsGasPipelineMo(apsGasPipelineMo)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ® |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ®", description = "å个修æ¹") |
| | | @RequiresPermissions("gasPipeline:mo:edit") |
| | | @Log(title = "管路æå·¥æ°ä½å·¥åæ°æ®", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ApsGasPipelineMo apsGasPipelineMo) |
| | | { |
| | | return toAjax(apsGasPipelineMoService.updateApsGasPipelineMo(apsGasPipelineMo)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ® |
| | | */ |
| | | @Operation(summary = "å é¤ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ®", description = "æ¹éå é¤") |
| | | @RequiresPermissions("gasPipeline:mo:remove") |
| | | @Log(title = "管路æå·¥æ°ä½å·¥åæ°æ®", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(apsGasPipelineMoService.deleteApsGasPipelineMoByIds(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.controller.mainPlan; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.aps.common.core.web.page.TableDataInfo; |
| | | import com.aps.core.domain.ApsGasPipelineMo; |
| | | import com.aps.core.domain.ApsGasPipelinePrediction; |
| | | import com.aps.core.service.IApsGasPipelinePredictionService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.aps.common.log.annotation.Log; |
| | | import com.aps.common.log.enums.BusinessType; |
| | | import com.aps.common.security.annotation.RequiresPermissions; |
| | | import com.aps.common.core.web.controller.BaseController; |
| | | import com.aps.common.core.web.domain.AjaxResult; |
| | | import com.aps.common.core.utils.poi.ExcelUtil; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * 管路æå·¥æ°ä½é¢æµæ°æ®Controller |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-19 |
| | | */ |
| | | |
| | | @Tag(name = "管路æå·¥æ°ä½é¢æµæ°æ®", description = "管路æå·¥æ°ä½é¢æµæ°æ®æ¥å£") |
| | | @RestController |
| | | @RequestMapping("/gasPipelinePrediction") |
| | | public class ApsGasPipelinePredictionController extends BaseController |
| | | { |
| | | @Autowired |
| | | private IApsGasPipelinePredictionService apsGasPipelinePredictionService; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ®å表 |
| | | */ |
| | | @Operation(summary = "æ¥è¯¢ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ®å表", description = "å页æ¥è¯¢") |
| | | @RequiresPermissions("gasPipeline:prediction:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ApsGasPipelinePrediction apsGasPipelineMo) |
| | | { |
| | | startPage(); |
| | | List<ApsGasPipelinePrediction> list = apsGasPipelinePredictionService.selectApsGasPipelinePredictionList(apsGasPipelineMo); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "导å
¥æå·¥æ°ä½é¢æµæ°æ®", description = "æ¹é导å
¥") |
| | | @Log(title = "导å
¥æå·¥æ°ä½é¢æµæ°æ®", businessType = BusinessType.IMPORT) |
| | | @RequiresPermissions("gasPipeline:prediction:import") |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file) throws Exception { |
| | | |
| | | int i = apsGasPipelinePredictionService.batchInsertApsGasPipelinePrediction(file); |
| | | return toAjax(i); |
| | | } |
| | | /** |
| | | * 导åºç®¡è·¯æå·¥æ°ä½é¢æµæ°æ®å表 |
| | | */ |
| | | @Operation(summary = "导åºç®¡è·¯æå·¥æ°ä½é¢æµæ°æ®å表", description = "导åº") |
| | | @RequiresPermissions("gasPipeline:prediction:export") |
| | | @Log(title = "管路æå·¥æ°ä½é¢æµæ°æ®", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ApsGasPipelinePrediction apsGasPipelinePrediction) |
| | | { |
| | | List<ApsGasPipelinePrediction> list = apsGasPipelinePredictionService.selectApsGasPipelinePredictionList(apsGasPipelinePrediction); |
| | | ExcelUtil<ApsGasPipelinePrediction> util = new ExcelUtil<ApsGasPipelinePrediction>(ApsGasPipelinePrediction.class); |
| | | util.exportExcel(response, list, "管路æå·¥æ°ä½é¢æµæ°æ®æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * è·å管路æå·¥æ°ä½é¢æµæ°æ®è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "è·å管路æå·¥æ°ä½é¢æµæ°æ®è¯¦ç»ä¿¡æ¯", description = "æ ¹æ®idè·å") |
| | | @RequiresPermissions("gasPipeline:prediction:query") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | return success(apsGasPipelinePredictionService.selectApsGasPipelinePredictionById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ® |
| | | */ |
| | | @Operation(summary = "æ°å¢ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ®", description = "å个æ°å¢") |
| | | @RequiresPermissions("gasPipeline:prediction:add") |
| | | @Log(title = "管路æå·¥æ°ä½é¢æµæ°æ®", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ApsGasPipelinePrediction apsGasPipelinePrediction) |
| | | { |
| | | return toAjax(apsGasPipelinePredictionService.insertApsGasPipelinePrediction(apsGasPipelinePrediction)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ® |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ®", description = "å个修æ¹") |
| | | @RequiresPermissions("gasPipeline:prediction:edit") |
| | | @Log(title = "管路æå·¥æ°ä½é¢æµæ°æ®", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ApsGasPipelinePrediction apsGasPipelinePrediction) |
| | | { |
| | | return toAjax(apsGasPipelinePredictionService.updateApsGasPipelinePrediction(apsGasPipelinePrediction)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ® |
| | | */ |
| | | @Operation(summary = "å é¤ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ®", description = "æ¹éå é¤") |
| | | @RequiresPermissions("gasPipeline:prediction:remove") |
| | | @Log(title = "管路æå·¥æ°ä½é¢æµæ°æ®", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(apsGasPipelinePredictionService.deleteApsGasPipelinePredictionByIds(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.controller.mainPlan; |
| | | |
| | | import com.aps.common.core.utils.poi.ExcelUtil; |
| | | import com.aps.common.core.web.controller.BaseController; |
| | | import com.aps.common.core.web.domain.AjaxResult; |
| | | import com.aps.common.core.web.page.TableDataInfo; |
| | | import com.aps.common.log.annotation.Log; |
| | | import com.aps.common.log.enums.BusinessType; |
| | | import com.aps.common.security.annotation.RequiresPermissions; |
| | | import com.aps.core.domain.ApsMaterialProductGroupManagement; |
| | | import com.aps.core.service.IApsMaterialProductGroupManagementService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç©æäº§åç»æ°æ®ç®¡çController |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-19 |
| | | */ |
| | | |
| | | @Tag(name = "ç©æäº§åç»æ°æ®ç®¡ç", description = "ç©æäº§åç»æ°æ®ç®¡çæ¥å£") |
| | | @RestController |
| | | @RequestMapping("/materialProductGroupManagement") |
| | | public class ApsMaterialProductGroupManagementController extends BaseController |
| | | { |
| | | @Autowired |
| | | private IApsMaterialProductGroupManagementService apsMaterialProductGroupManagementService; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç©æäº§åç»æ°æ®ç®¡çå表 |
| | | */ |
| | | @Operation(summary = "æ¥è¯¢ç©æäº§åç»æ°æ®ç®¡çå表", description = "å页æ¥è¯¢") |
| | | @RequiresPermissions("materialProductGroup:management:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ApsMaterialProductGroupManagement apsGasPipelineMo) |
| | | { |
| | | startPage(); |
| | | List<ApsMaterialProductGroupManagement> list = apsMaterialProductGroupManagementService.selectApsMaterialProductGroupManagementList(apsGasPipelineMo); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "导å
¥äº§åç»æ°æ®", description = "æ¹é导å
¥") |
| | | @Log(title = "导å
¥äº§åç»æ°æ®", businessType = BusinessType.IMPORT) |
| | | @RequiresPermissions("materialProductGroup:management:import") |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file) throws Exception { |
| | | |
| | | int i = apsMaterialProductGroupManagementService.batchInsertApsMaterialProductGroupManagement(file); |
| | | return toAjax(i); |
| | | } |
| | | /** |
| | | * 导åºç©æäº§åç»æ°æ®ç®¡çå表 |
| | | */ |
| | | @Operation(summary = "导åºç©æäº§åç»æ°æ®ç®¡çå表", description = "导åº") |
| | | @RequiresPermissions("materialProductGroup:management:export") |
| | | @Log(title = "ç©æäº§åç»æ°æ®ç®¡ç", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ApsMaterialProductGroupManagement apsMaterialProductGroupManagement) |
| | | { |
| | | List<ApsMaterialProductGroupManagement> list = apsMaterialProductGroupManagementService.selectApsMaterialProductGroupManagementList(apsMaterialProductGroupManagement); |
| | | ExcelUtil<ApsMaterialProductGroupManagement> util = new ExcelUtil<ApsMaterialProductGroupManagement>(ApsMaterialProductGroupManagement.class); |
| | | util.exportExcel(response, list, "ç©æäº§åç»æ°æ®ç®¡çæ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * è·åç©æäº§åç»æ°æ®ç®¡ç详ç»ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "è·åç©æäº§åç»æ°æ®ç®¡ç详ç»ä¿¡æ¯", description = "æ ¹æ®idè·å") |
| | | @RequiresPermissions("materialProductGroup:management:query") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | return success(apsMaterialProductGroupManagementService.selectApsMaterialProductGroupManagementById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç©æäº§åç»æ°æ®ç®¡ç |
| | | */ |
| | | @Operation(summary = "æ°å¢ç©æäº§åç»æ°æ®ç®¡ç", description = "å个æ°å¢") |
| | | @RequiresPermissions("materialProductGroup:management:add") |
| | | @Log(title = "ç©æäº§åç»æ°æ®ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ApsMaterialProductGroupManagement apsMaterialProductGroupManagement) |
| | | { |
| | | return toAjax(apsMaterialProductGroupManagementService.insertApsMaterialProductGroupManagement(apsMaterialProductGroupManagement)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç©æäº§åç»æ°æ®ç®¡ç |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹ç©æäº§åç»æ°æ®ç®¡ç", description = "å个修æ¹") |
| | | @RequiresPermissions("materialProductGroup:management:edit") |
| | | @Log(title = "ä¿®æ¹ç©æäº§åç»æ°æ®ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ApsMaterialProductGroupManagement apsMaterialProductGroupManagement) |
| | | { |
| | | return toAjax(apsMaterialProductGroupManagementService.updateApsMaterialProductGroupManagement(apsMaterialProductGroupManagement)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç©æäº§åç»æ°æ®ç®¡ç |
| | | */ |
| | | @Operation(summary = "å é¤ç©æäº§åç»æ°æ®ç®¡ç", description = "æ¹éå é¤") |
| | | @RequiresPermissions("materialProductGroup:management:remove") |
| | | @Log(title = "ç©æäº§åç»æ°æ®ç®¡ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(apsMaterialProductGroupManagementService.deleteApsMaterialProductGroupManagementByIds(ids)); |
| | | } |
| | | } |
| | |
| | | import com.aps.core.domain.ApsPlanTask; |
| | | import com.aps.core.service.ApsPlanTaskService; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | /** |
| | | * 计åä»»å¡ç®¡ç |
| | | * */ |
| | | @Tag(name = "计åä»»å¡ç®¡ç", description = "计åä»»å¡ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/planTask") |
| | | public class ApsPlanTaskController extends BaseController { |
| | |
| | | @Autowired |
| | | private ApsPlanTaskService apsPlanTaskService; |
| | | |
| | | @Operation(summary = "计åä»»å¡ç®¡çå表", description = "å页æ¥è¯¢") |
| | | @RequiresPermissions("planTask:list") |
| | | @GetMapping("/list") |
| | | public Page<ApsPlanTask> list(ApsPlanTask task){ |
| | |
| | | import com.aps.common.security.utils.DictUtils; |
| | | import com.aps.core.domain.ApsPlate.ApsPlatePlan; |
| | | import com.aps.core.domain.ApsPlate.ApsPlatePlanTemp; |
| | | import com.aps.core.domain.ApsPlate.ApsPlateRequireDate; |
| | | import com.aps.core.domain.export.ApsPlatePlanExport; |
| | | import com.aps.core.service.ApsPlate.ApsPlateRequireDateService; |
| | | import com.aps.core.service.ApsPlate.IApsPlatePlanService; |
| | | import com.aps.core.service.ApsPlate.IApsPlatePlanTempService; |
| | | import com.aps.system.api.domain.SysDictData; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | * @author ruoyi |
| | | * @date 2025-04-08 |
| | | */ |
| | | @Tag(name = "é£é计åå表", description = "é£é计åå表") |
| | | @RestController |
| | | @RequestMapping("/apsPlatePlan") |
| | | public class ApsPlatePlanController extends BaseController { |
| | |
| | | private IApsPlatePlanService apsPlatePlanService; |
| | | @Autowired |
| | | private IApsPlatePlanTempService apsPlatePlanTempService; |
| | | @Resource |
| | | private ApsPlateRequireDateService apsPlateRequireDateService; |
| | | |
| | | /** |
| | | * æ¥è¯¢é£é计å管çå表 |
| | | */ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.controller.mainPlan.ApsPlate; |
| | | |
| | | |
| | | import com.aps.common.core.utils.poi.ExcelUtil; |
| | | import com.aps.common.core.web.domain.AjaxResult; |
| | | import com.aps.common.log.annotation.Log; |
| | | import com.aps.common.log.enums.BusinessType; |
| | | import com.aps.common.security.annotation.RequiresPermissions; |
| | | import com.aps.core.domain.ApsPlate.ApsPlateRequireDate; |
| | | import com.aps.core.service.ApsPlate.ApsPlateRequireDateService; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Tag(name = "é£éå·¥åéæ±æ¥æç®¡ç", description = "é£éå·¥åéæ±æ¥æç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/plateRequireDate") |
| | | public class ApsPlateRequireDateController { |
| | | |
| | | @Resource |
| | | private ApsPlateRequireDateService apsPlateRequireDateService; |
| | | |
| | | @RequiresPermissions("plateRequireDate:list") |
| | | @GetMapping("/list") |
| | | @Tag(name = "æ¥è¯¢å表") |
| | | public Page<ApsPlateRequireDate> list(Page<ApsPlateRequireDate> page,ApsPlateRequireDate apsPlateRequireDate){ |
| | | return apsPlateRequireDateService.pagingList(page, apsPlateRequireDate); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导å
¥Excelæ°æ® |
| | | * @param file |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Operation(summary = "导å
¥å·¥åéæ±æ¥æ", description = "导å
¥å·¥åéæ±æ¥æ") |
| | | @RequiresPermissions("plateRequireDate:import") |
| | | @Log(title = "导å
¥å·¥åéæ±æ¥æ", businessType = BusinessType.IMPORT) |
| | | @PostMapping("/importRequireDate") |
| | | public AjaxResult importRequireDate(MultipartFile file) throws Exception { |
| | | ExcelUtil<ApsPlateRequireDate> util = new ExcelUtil<ApsPlateRequireDate>(ApsPlateRequireDate.class); |
| | | List<ApsPlateRequireDate> plateRequireDateList = util.importExcel(file.getInputStream()); |
| | | if (!plateRequireDateList.isEmpty()) { |
| | | try { |
| | | apsPlateRequireDateService.batchSave(plateRequireDateList); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } else { |
| | | return AjaxResult.error("模æ¿å
容为空"); |
| | | } |
| | | return AjaxResult.success("导å
¥æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®idå é¤å·¥åéæ±æ¥æ |
| | | * */ |
| | | @Operation(summary = "å é¤éæ±æ¥æ", description = "å é¤éæ±æ¥æ") |
| | | @Log(title = "å é¤éæ±æ¥æ", businessType = BusinessType.DELETE) |
| | | @PostMapping("/deleteRequireDate") |
| | | @RequiresPermissions("plateRequireDate:delete") |
| | | public AjaxResult deleteRequireDate(@RequestBody List<Long> idList) { |
| | | apsPlateRequireDateService.batchDelete(idList); |
| | | return AjaxResult.success("å 餿åï¼"); |
| | | } |
| | | |
| | | } |
| | |
| | | /** |
| | | * çæé£é计å |
| | | * */ |
| | | |
| | | @PostMapping("/generatorPlan") |
| | | public AjaxResult generatorPlan() |
| | | { |
| | | String batchNum= requireBatchService.getNewBatchNumber(); |
| | | planTaskService.savePlanTask(batchNum); |
| | | apsPlateStandardRequireService.generatorPlan(batchNum); |
| | | planTaskService.updateTaskStatus(batchNum, PLAN_TASK_STATUS.FINISHED); |
| | | return success(); |
| | | return planTaskService.generatorPlan(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.controller.mainPlan; |
| | | |
| | | import com.aps.common.core.utils.poi.ExcelUtil; |
| | | import com.aps.common.core.web.controller.BaseController; |
| | | import com.aps.common.core.web.domain.AjaxResult; |
| | | import com.aps.common.core.web.page.TableDataInfo; |
| | | import com.aps.common.log.annotation.Log; |
| | | import com.aps.common.log.enums.BusinessType; |
| | | import com.aps.common.security.annotation.RequiresPermissions; |
| | | import com.aps.common.security.utils.SecurityUtils; |
| | | import com.aps.core.domain.mainPlan.ApsWeldSeamStatisticsV2; |
| | | import com.aps.core.service.mainPlan.IApsWeldSeamStatisticsV2Service; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * çç¼ç»è®¡v2Controller |
| | | * |
| | | * @author wwj |
| | | * @date 2025-04-09 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/weldSeamStatisticsV2") |
| | | public class ApsWeldSeamStatisticsV2Controller extends BaseController { |
| | | |
| | | @Autowired |
| | | private IApsWeldSeamStatisticsV2Service apsWeldSeamStatisticsV2Service; |
| | | |
| | | /** |
| | | * æ¥è¯¢çç¼ç»è®¡è¡¨V2å表 |
| | | */ |
| | | @RequiresPermissions("weldSeamStatistics:weldSeamStatisticsV2:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ApsWeldSeamStatisticsV2 apsWeldSeamStatisticsV2) |
| | | { |
| | | // ä¸éè¦å页 |
| | | // startPage(); |
| | | List<ApsWeldSeamStatisticsV2> list = apsWeldSeamStatisticsV2Service.selectApsWeldSeamStatisticsV2List(apsWeldSeamStatisticsV2); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导åºçç¼ç»è®¡è¡¨V2å表 |
| | | */ |
| | | @RequiresPermissions("weldSeamStatistics:weldSeamStatisticsV2:export") |
| | | @Log(title = "çç¼ç»è®¡è¡¨V2", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ApsWeldSeamStatisticsV2 apsWeldSeamStatisticsV2) |
| | | { |
| | | List<ApsWeldSeamStatisticsV2> list = apsWeldSeamStatisticsV2Service.selectApsWeldSeamStatisticsV2List(apsWeldSeamStatisticsV2); |
| | | ExcelUtil<ApsWeldSeamStatisticsV2> util = new ExcelUtil<ApsWeldSeamStatisticsV2>(ApsWeldSeamStatisticsV2.class); |
| | | util.exportExcel(response, list, "çç¼ç»è®¡è¡¨V2æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹çç¼ç»è®¡è¡¨V2 |
| | | */ |
| | | @RequiresPermissions("weldSeamStatistics:weldSeamStatisticsV2:edit") |
| | | @Log(title = "çç¼ç»è®¡è¡¨V2", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/update") |
| | | public AjaxResult edit(@RequestBody ApsWeldSeamStatisticsV2 apsWeldSeamStatisticsV2) |
| | | { |
| | | ApsWeldSeamStatisticsV2 updatedRecord = apsWeldSeamStatisticsV2Service.updateApsWeldSeamStatisticsV2(apsWeldSeamStatisticsV2); |
| | | return AjaxResult.success("ä¿®æ¹æå", updatedRecord); |
| | | } |
| | | |
| | | /** |
| | | * å·æ°çç¼ç»è®¡è¡¨V2æ°æ® |
| | | */ |
| | | @RequiresPermissions("weldSeamStatistics:weldSeamStatisticsV2:refresh") |
| | | @Log(title = "çç¼ç»è®¡è¡¨V2", businessType = BusinessType.OTHER) |
| | | @PostMapping("/refresh") |
| | | public AjaxResult refreshStatistics() { |
| | | String username = SecurityUtils.getUsername(); |
| | | int count = apsWeldSeamStatisticsV2Service.refreshWeldSeamStatistics(username); |
| | | return success("å·æ°çç¼ç»è®¡è¡¨æåï¼å
±æ´æ° " + count + " æ¡è®°å½"); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.domain; |
| | | |
| | | import com.aps.common.core.web.domain.BaseEntity; |
| | | 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 com.aps.common.core.annotation.Excel; |
| | | import org.springframework.data.annotation.Id; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 管路æå·¥æ°ä½å·¥åæ°æ®å¯¹è±¡ aps_gas_pipeline_mo |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-19 |
| | | */ |
| | | @Schema(description = "管路æå·¥æ°ä½å·¥åæ°æ®å®ä½ç±»") |
| | | @Data |
| | | public class ApsGasPipelineMo extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Id |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING) |
| | | /** ID */ |
| | | @Schema(description = "ID") |
| | | private Long id; |
| | | |
| | | /** å·¥åå· */ |
| | | @Excel(name = "å·¥åå·") |
| | | @Schema(description = "å·¥åå·") |
| | | private String mo; |
| | | |
| | | /** ç产åºå° */ |
| | | @Excel(name = "ç产åºå°") |
| | | @Schema(description = "ç产åºå°") |
| | | private String factory; |
| | | |
| | | /** æå· */ |
| | | @Excel(name = "æå·") |
| | | @Schema(description = "æå·") |
| | | private String materialCode; |
| | | |
| | | /** 计åå®å·¥æ¥æ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "计åå®å·¥æ¥æ", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | @Schema(description = "计åå®å·¥æ¥æ") |
| | | private Timestamp planEnd; |
| | | |
| | | /** æ°é */ |
| | | @Excel(name = "æ°é") |
| | | @Schema(description = "æ°é") |
| | | private BigDecimal quantity; |
| | | |
| | | public void setId(Long id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getId() |
| | | { |
| | | return id; |
| | | } |
| | | |
| | | public void setMo(String mo) |
| | | { |
| | | this.mo = mo; |
| | | } |
| | | |
| | | public String getMo() |
| | | { |
| | | return mo; |
| | | } |
| | | |
| | | public void setFactory(String factory) |
| | | { |
| | | this.factory = factory; |
| | | } |
| | | |
| | | public String getFactory() |
| | | { |
| | | return factory; |
| | | } |
| | | |
| | | public void setMaterialCode(String materialCode) |
| | | { |
| | | this.materialCode = materialCode; |
| | | } |
| | | |
| | | public String getMaterialCode() |
| | | { |
| | | return materialCode; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("id", getId()) |
| | | .append("mo", getMo()) |
| | | .append("factory", getFactory()) |
| | | .append("materialCode", getMaterialCode()) |
| | | .append("planEnd", getPlanEnd()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.domain; |
| | | |
| | | import com.aps.common.core.annotation.Excel; |
| | | import com.aps.common.core.web.domain.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.data.annotation.Id; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 管路æå·¥æ°ä½é¢æµæ°æ®å¯¹è±¡ aps_gas_pipeline_prediction |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-19 |
| | | */ |
| | | @Data |
| | | @Schema(description = "管路æå·¥æ°ä½é¢æµæ°æ®å®ä½ç±»") |
| | | public class ApsGasPipelinePrediction extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Id |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING) |
| | | /** ID */ |
| | | @Schema(description = "ID") |
| | | private Long id; |
| | | |
| | | /** ç产åºå° */ |
| | | @Excel(name = "ç产åºå°") |
| | | @Schema(description = "ç产åºå°") |
| | | private String factory; |
| | | |
| | | /** æå· */ |
| | | @Excel(name = "æå·") |
| | | @Schema(description = "æå·") |
| | | private String materialCode; |
| | | |
| | | /** 颿µæ¥æ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "颿µæ¥æ", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | @Schema(description = "颿µæ¥æ") |
| | | private Timestamp predictDate; |
| | | |
| | | /** æ°é */ |
| | | @Excel(name = "æ°é") |
| | | @Schema(description = "æ°é") |
| | | private BigDecimal predictQuantity; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.domain; |
| | | |
| | | import com.aps.common.core.web.domain.BaseEntity; |
| | | 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 com.aps.common.core.annotation.Excel; |
| | | import org.springframework.data.annotation.Id; |
| | | |
| | | /** |
| | | * ç©æäº§åç»æ°æ®ç®¡ç对象 aps_material_product_group_management |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-19 |
| | | */ |
| | | @Schema(description = "ç©æäº§åç»æ°æ®ç®¡çå®ä½ç±»") |
| | | @Data |
| | | public class ApsMaterialProductGroupManagement extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Id |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING) |
| | | /** ID */ |
| | | @Schema(description = "ID") |
| | | private Long id; |
| | | |
| | | /** éç¨å·¥å åè aps_factory */ |
| | | @Excel(name = "éç¨å·¥å åè aps_factory") |
| | | @Schema(description = "éç¨å·¥å åè aps_factory") |
| | | private String factory; |
| | | |
| | | /** æå· */ |
| | | @Excel(name = "æå·") |
| | | @Schema(description = "æå·") |
| | | private String materialCode; |
| | | |
| | | /** ä¸ä¸ åè aps_domain */ |
| | | @Excel(name = "ä¸ä¸ åè aps_domain") |
| | | @Schema(description = "ä¸ä¸ åè aps_domain") |
| | | private String domain; |
| | | |
| | | /** æ¯å¦ä¸ºä¸»é¶ æ¯/å¦ */ |
| | | @Excel(name = "æ¯å¦ä¸ºä¸»é¶ æ¯/å¦") |
| | | @Schema(description = "æ¯å¦ä¸ºä¸»é¶ æ¯/å¦") |
| | | private String isMain; |
| | | |
| | | /** æå·ç±»å« å¶é ä»¶/éè´ä»¶ */ |
| | | @Excel(name = "æå·ç±»å« å¶é ä»¶/éè´ä»¶") |
| | | @Schema(description = "æå·ç±»å« å¶é ä»¶/éè´ä»¶") |
| | | private String materialType; |
| | | |
| | | public void setId(Long id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getId() |
| | | { |
| | | return id; |
| | | } |
| | | |
| | | public void setFactory(String factory) |
| | | { |
| | | this.factory = factory; |
| | | } |
| | | |
| | | public String getFactory() |
| | | { |
| | | return factory; |
| | | } |
| | | |
| | | public void setMaterialCode(String materialCode) |
| | | { |
| | | this.materialCode = materialCode; |
| | | } |
| | | |
| | | public String getMaterialCode() |
| | | { |
| | | return materialCode; |
| | | } |
| | | |
| | | public void setDomain(String domain) |
| | | { |
| | | this.domain = domain; |
| | | } |
| | | |
| | | public String getDomain() |
| | | { |
| | | return domain; |
| | | } |
| | | |
| | | public void setIsMain(String isMain) |
| | | { |
| | | this.isMain = isMain; |
| | | } |
| | | |
| | | public String getIsMain() |
| | | { |
| | | return isMain; |
| | | } |
| | | |
| | | public void setMaterialType(String materialType) |
| | | { |
| | | this.materialType = materialType; |
| | | } |
| | | |
| | | public String getMaterialType() |
| | | { |
| | | return materialType; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("id", getId()) |
| | | .append("factory", getFactory()) |
| | | .append("materialCode", getMaterialCode()) |
| | | .append("domain", getDomain()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("isMain", getIsMain()) |
| | | .append("materialType", getMaterialType()) |
| | | .toString(); |
| | | } |
| | | } |
| | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | |
| | | @TableName(value ="aps_plan_task") |
| | | @Data |
| | | @Builder |
| | | @Schema(description = "计åä»»å¡") |
| | | public class ApsPlanTask extends BaseEntity implements Serializable { |
| | | |
| | | @TableField(exist = false) |
| | |
| | | */ |
| | | @TableField(value = "id") |
| | | @TableId(type = IdType.INPUT) |
| | | @Schema(description = "主é®ID") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 任塿¹æ¬¡å· |
| | | */ |
| | | @Schema(description = "任塿¹æ¬¡å·") |
| | | @TableField(value = "batch_num") |
| | | private String batchNum; |
| | | |
| | | /** |
| | | * ä»»å¡ç±»å |
| | | */ |
| | | @Schema(description = "ä»»å¡ç±»å") |
| | | @TableField(value = "task_type") |
| | | private String taskType; |
| | | |
| | | /** |
| | | * ä»»å¡ç¶æ |
| | | */ |
| | | @Schema(description = "ä»»å¡ç¶æ") |
| | | @TableField(value = "task_status") |
| | | private String taskStatus; |
| | | |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @Schema(description = "å建人") |
| | | @TableField(value = "create_by") |
| | | private String createBy; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @Schema(description = "å建æ¶é´") |
| | | @TableField(value = "create_time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * æ´æ°äºº |
| | | */ |
| | | @Schema(description = "æ´æ°äºº") |
| | | @TableField(value = "update_by") |
| | | private String updateBy; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @Schema(description = "æ´æ°æ¶é´") |
| | | @TableField(value = "update_time") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * å 餿 è®°(0,1) |
| | | */ |
| | | @Schema(description = "å 餿 è®°(0,1)") |
| | | @TableField(value = "del_flag") |
| | | private Integer delFlag; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.domain.ApsPlate; |
| | | |
| | | import com.aps.common.core.annotation.Excel; |
| | | import com.aps.common.core.web.domain.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * å·¥å计åéæ±æ¥æè¡¨ |
| | | * @TableName aps_plate_require_date |
| | | */ |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName(value ="aps_plate_require_date") |
| | | @Data |
| | | public class ApsPlateRequireDate extends BaseEntity implements Serializable { |
| | | /** |
| | | * 主é®ID |
| | | */ |
| | | @TableId(value = "id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * å·¥åId |
| | | */ |
| | | @TableField(value = "plan_id") |
| | | private Long planId; |
| | | |
| | | /** |
| | | * 订åå· |
| | | */ |
| | | @Excel(name = "å·¥åå·") |
| | | @TableField(value = "doc_no") |
| | | private String docNo; |
| | | |
| | | /** |
| | | * å·¥åéæ±æ¶é´ |
| | | */ |
| | | @Excel(name = "éæ±æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField(value = "require_date") |
| | | private Date requireDate; |
| | | |
| | | /** |
| | | * æ¯å¦å é¤ 0å¦ 1æ¯ |
| | | */ |
| | | @TableField(value = "del_flag") |
| | | private Integer delFlag; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "create_by") |
| | | private String createBy; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "create_time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "update_by") |
| | | private String updateBy; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "update_time") |
| | | private Date updateTime; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.domain.mainPlan; |
| | | |
| | | import com.aps.common.core.annotation.Excel; |
| | | import com.aps.common.core.web.domain.BaseEntity; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * çç¼ç»è®¡è¡¨V2对象 aps_weld_seam_statistics_v2 |
| | | * |
| | | * @date 2023-08-01 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class ApsWeldSeamStatisticsV2 extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ID */ |
| | | private String id; |
| | | |
| | | /** 年份 */ |
| | | @Excel(name = "年份") |
| | | private Integer year; |
| | | |
| | | /** æä»½ */ |
| | | @Excel(name = "æä»½") |
| | | private Integer month; |
| | | |
| | | /** ç产åºå° */ |
| | | @Excel(name = "ç产åºå°") |
| | | private String productionBase; |
| | | |
| | | /** 管路订åéæ± */ |
| | | @Excel(name = "管路订åéæ±") |
| | | private BigDecimal pipingOrderRequirement; |
| | | |
| | | /** æ°æè®¢åéæ± */ |
| | | @Excel(name = "æ°æè®¢åéæ±") |
| | | private BigDecimal gasOrderRequirement; |
| | | |
| | | /** ç®¡è·¯é¢æµéæ± */ |
| | | @Excel(name = "ç®¡è·¯é¢æµéæ±") |
| | | private BigDecimal pipingPredictionRequirement; |
| | | |
| | | /** æ°æé¢æµéæ± */ |
| | | @Excel(name = "æ°æé¢æµéæ±") |
| | | private BigDecimal gasPredictionRequirement; |
| | | |
| | | /** é¢çç´§æ¥è®¢åäº§åº */ |
| | | @Excel(name = "é¢çç´§æ¥è®¢å产åº") |
| | | private BigDecimal reserveEmergencyOrderOutput; |
| | | |
| | | /** å计 */ |
| | | @Excel(name = "å计") |
| | | private BigDecimal total; |
| | | |
| | | /** å¤©æ° */ |
| | | @Excel(name = "天æ°") |
| | | private BigDecimal days; |
| | | |
| | | /** éæ±æ¥çç¼ */ |
| | | @Excel(name = "éæ±æ¥çç¼") |
| | | private BigDecimal requirementDayWeldSeam; |
| | | |
| | | /** ç产æ¥çç¼ */ |
| | | @Excel(name = "ç产æ¥çç¼") |
| | | private BigDecimal productionDayWeldSeam; |
| | | |
| | | /** æ¯å¦æ»¡è¶³ */ |
| | | @Excel(name = "æ¯å¦æ»¡è¶³") |
| | | private String isSatisfy; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.enums; |
| | | |
| | | public enum REDIS_LOCK_KEY { |
| | | |
| | | /*é£éå·¥å计åä»»å¡*/ |
| | | PLATE_ORDER_PLAN("PLAN_TASK:PLATE_ORDER_PLAN"); |
| | | |
| | | private String key; |
| | | |
| | | public String getKey() { |
| | | return key; |
| | | } |
| | | |
| | | REDIS_LOCK_KEY(String key) { |
| | | this.key = key; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.mapper; |
| | | |
| | | import com.aps.core.domain.ApsGasPipelineMo; |
| | | import com.aps.core.domain.ApsPlanCycle; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 管路æå·¥æ°ä½å·¥åæ°æ®Mapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-19 |
| | | */ |
| | | @Mapper |
| | | public interface ApsGasPipelineMoMapper extends BaseMapper<ApsGasPipelineMo> |
| | | { |
| | | /** |
| | | * æ¥è¯¢ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ® |
| | | * |
| | | * @param id 管路æå·¥æ°ä½å·¥åæ°æ®ä¸»é® |
| | | * @return 管路æå·¥æ°ä½å·¥åæ°æ® |
| | | */ |
| | | public ApsGasPipelineMo selectApsGasPipelineMoById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ®å表 |
| | | * |
| | | * @param apsGasPipelineMo 管路æå·¥æ°ä½å·¥åæ°æ® |
| | | * @return 管路æå·¥æ°ä½å·¥åæ°æ®éå |
| | | */ |
| | | public List<ApsGasPipelineMo> selectApsGasPipelineMoList(ApsGasPipelineMo apsGasPipelineMo); |
| | | |
| | | /** |
| | | * æ°å¢ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ® |
| | | * |
| | | * @param apsGasPipelineMo 管路æå·¥æ°ä½å·¥åæ°æ® |
| | | * @return ç»æ |
| | | */ |
| | | public int insertApsGasPipelineMo(ApsGasPipelineMo apsGasPipelineMo); |
| | | |
| | | /** |
| | | * ä¿®æ¹ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ® |
| | | * |
| | | * @param apsGasPipelineMo 管路æå·¥æ°ä½å·¥åæ°æ® |
| | | * @return ç»æ |
| | | */ |
| | | public int updateApsGasPipelineMo(ApsGasPipelineMo apsGasPipelineMo); |
| | | |
| | | /** |
| | | * å é¤ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ® |
| | | * |
| | | * @param id 管路æå·¥æ°ä½å·¥åæ°æ®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsGasPipelineMoById(Long id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ® |
| | | * |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsGasPipelineMoByIds(Long[] ids); |
| | | |
| | | void deleteAll(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.mapper; |
| | | |
| | | import com.aps.core.domain.ApsGasPipelinePrediction; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 管路æå·¥æ°ä½é¢æµæ°æ®Mapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-19 |
| | | */ |
| | | public interface ApsGasPipelinePredictionMapper extends BaseMapper<ApsGasPipelinePrediction> |
| | | { |
| | | /** |
| | | * æ¥è¯¢ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ® |
| | | * |
| | | * @param id 管路æå·¥æ°ä½é¢æµæ°æ®ä¸»é® |
| | | * @return 管路æå·¥æ°ä½é¢æµæ°æ® |
| | | */ |
| | | public ApsGasPipelinePrediction selectApsGasPipelinePredictionById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ®å表 |
| | | * |
| | | * @param apsGasPipelinePrediction 管路æå·¥æ°ä½é¢æµæ°æ® |
| | | * @return 管路æå·¥æ°ä½é¢æµæ°æ®éå |
| | | */ |
| | | public List<ApsGasPipelinePrediction> selectApsGasPipelinePredictionList(ApsGasPipelinePrediction apsGasPipelinePrediction); |
| | | |
| | | /** |
| | | * æ°å¢ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ® |
| | | * |
| | | * @param apsGasPipelinePrediction 管路æå·¥æ°ä½é¢æµæ°æ® |
| | | * @return ç»æ |
| | | */ |
| | | public int insertApsGasPipelinePrediction(ApsGasPipelinePrediction apsGasPipelinePrediction); |
| | | |
| | | /** |
| | | * ä¿®æ¹ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ® |
| | | * |
| | | * @param apsGasPipelinePrediction 管路æå·¥æ°ä½é¢æµæ°æ® |
| | | * @return ç»æ |
| | | */ |
| | | public int updateApsGasPipelinePrediction(ApsGasPipelinePrediction apsGasPipelinePrediction); |
| | | |
| | | /** |
| | | * å é¤ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ® |
| | | * |
| | | * @param id 管路æå·¥æ°ä½é¢æµæ°æ®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsGasPipelinePredictionById(Long id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ® |
| | | * |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsGasPipelinePredictionByIds(Long[] ids); |
| | | |
| | | void deleteAll(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.mapper; |
| | | |
| | | import com.aps.core.domain.ApsMaterialProductGroupManagement; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç©æäº§åç»æ°æ®ç®¡çMapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-19 |
| | | */ |
| | | public interface ApsMaterialProductGroupManagementMapper extends BaseMapper<ApsMaterialProductGroupManagement> |
| | | { |
| | | /** |
| | | * æ¥è¯¢ç©æäº§åç»æ°æ®ç®¡ç |
| | | * |
| | | * @param id ç©æäº§åç»æ°æ®ç®¡çä¸»é® |
| | | * @return ç©æäº§åç»æ°æ®ç®¡ç |
| | | */ |
| | | public ApsMaterialProductGroupManagement selectApsMaterialProductGroupManagementById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç©æäº§åç»æ°æ®ç®¡çå表 |
| | | * |
| | | * @param apsMaterialProductGroupManagement ç©æäº§åç»æ°æ®ç®¡ç |
| | | * @return ç©æäº§åç»æ°æ®ç®¡çéå |
| | | */ |
| | | public List<ApsMaterialProductGroupManagement> selectApsMaterialProductGroupManagementList(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement); |
| | | |
| | | /** |
| | | * æ°å¢ç©æäº§åç»æ°æ®ç®¡ç |
| | | * |
| | | * @param apsMaterialProductGroupManagement ç©æäº§åç»æ°æ®ç®¡ç |
| | | * @return ç»æ |
| | | */ |
| | | public int insertApsMaterialProductGroupManagement(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement); |
| | | |
| | | /** |
| | | * ä¿®æ¹ç©æäº§åç»æ°æ®ç®¡ç |
| | | * |
| | | * @param apsMaterialProductGroupManagement ç©æäº§åç»æ°æ®ç®¡ç |
| | | * @return ç»æ |
| | | */ |
| | | public int updateApsMaterialProductGroupManagement(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement); |
| | | |
| | | /** |
| | | * å é¤ç©æäº§åç»æ°æ®ç®¡ç |
| | | * |
| | | * @param id ç©æäº§åç»æ°æ®ç®¡çä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsMaterialProductGroupManagementById(Long id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ç©æäº§åç»æ°æ®ç®¡ç |
| | | * |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsMaterialProductGroupManagementByIds(Long[] ids); |
| | | |
| | | void deleteAll(); |
| | | } |
| | |
| | | */ |
| | | public List<ApsPlatePlan> selectPlateRedundantOrderList(ApsPlatePlan apsPlatePlan); |
| | | |
| | | List<ApsPlatePlan> selectPlatePlanByPlantMajor(String plant,String professionalAffiliation); |
| | | List<ApsPlatePlan> selectPlatePlanByPlantMajor(String plant); |
| | | |
| | | /** |
| | | * è·å䏿¡æªå¹é
çå计å |
| | |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsPlateProcessStatByIds(String[] ids); |
| | | /**ç»è®¡ä¸´æ¶æ°æ®*/ |
| | | /**ç»è®¡ä¸´æ¶æ°æ® |
| | | * æ¹é设置ç计åå®å·¥æ¥æ> 导å
¥çéæ±æ¥æ> å·¥åèªèº«ç计åå®å·¥æ¥æ |
| | | * */ |
| | | List<ApsPlateProcessStat> queryTempStat(); |
| | | |
| | | /** |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.mapper; |
| | | |
| | | import com.aps.core.domain.ApsPlate.ApsPlateRequireDate; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhl |
| | | * @description é对表ãaps_plate_require_date(å·¥å计åéæ±æ¥æè¡¨)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2025-05-19 16:51:36 |
| | | * @Entity com.aps.core.domain.ApsPlate.ApsPlateRequireDate |
| | | */ |
| | | public interface ApsPlateRequireDateMapper extends BaseMapper<ApsPlateRequireDate> { |
| | | |
| | | int deleteByDocNoList(List<String> list,String updateBy); |
| | | |
| | | int batchInsert(List<ApsPlateRequireDate> list); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | package com.aps.core.mapper; |
| | | |
| | | import com.aps.core.domain.ApsPlate.ApsPlateOrderPlanDate; |
| | | import com.aps.core.domain.ApsPlate.ApsPlateStandardRequireOrderEndDay; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | public interface ApsPlateStandardRequireOrderEndDayMapper extends BaseMapper<ApsPlateStandardRequireOrderEndDay> { |
| | | |
| | | Integer batchInsert(List<Long> planIds,String createBy); |
| | | Integer batchRemove(List<Long> planIds); |
| | | |
| | | |
| | | Integer batchRemoveByPlanId(List<Long> planIds); |
| | | Integer batchRemove(); |
| | | } |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.mapper.mainPlan; |
| | | |
| | | import com.aps.core.domain.mainPlan.ApsWeldSeamStatisticsV2; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * çç¼ç»è®¡è¡¨V2Mapperæ¥å£ |
| | | * |
| | | * @date 2023-08-01 |
| | | */ |
| | | @Mapper |
| | | public interface ApsWeldSeamStatisticsV2Mapper { |
| | | |
| | | /** |
| | | * æ¥è¯¢çç¼ç»è®¡è¡¨V2 |
| | | * |
| | | * @param id çç¼ç»è®¡è¡¨V2ä¸»é® |
| | | * @return çç¼ç»è®¡è¡¨V2 |
| | | */ |
| | | public ApsWeldSeamStatisticsV2 selectApsWeldSeamStatisticsV2ById(String id); |
| | | |
| | | /** |
| | | * æ¥è¯¢çç¼ç»è®¡è¡¨V2å表 |
| | | * |
| | | * @param apsWeldSeamStatisticsV2 çç¼ç»è®¡è¡¨V2 |
| | | * @return çç¼ç»è®¡è¡¨V2éå |
| | | */ |
| | | public List<ApsWeldSeamStatisticsV2> selectApsWeldSeamStatisticsV2List(ApsWeldSeamStatisticsV2 apsWeldSeamStatisticsV2); |
| | | |
| | | /** |
| | | * æ°å¢çç¼ç»è®¡è¡¨V2 |
| | | * |
| | | * @param apsWeldSeamStatisticsV2 çç¼ç»è®¡è¡¨V2 |
| | | * @return ç»æ |
| | | */ |
| | | public int insertApsWeldSeamStatisticsV2(ApsWeldSeamStatisticsV2 apsWeldSeamStatisticsV2); |
| | | |
| | | /** |
| | | * ä¿®æ¹çç¼ç»è®¡è¡¨V2 |
| | | * |
| | | * @param apsWeldSeamStatisticsV2 çç¼ç»è®¡è¡¨V2 |
| | | * @return ç»æ |
| | | */ |
| | | public int updateApsWeldSeamStatisticsV2(ApsWeldSeamStatisticsV2 apsWeldSeamStatisticsV2); |
| | | |
| | | /** |
| | | * å é¤çç¼ç»è®¡è¡¨V2 |
| | | * |
| | | * @param id çç¼ç»è®¡è¡¨V2ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsWeldSeamStatisticsV2ById(String id); |
| | | |
| | | /** |
| | | * æ¹éå é¤çç¼ç»è®¡è¡¨V2 |
| | | * |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsWeldSeamStatisticsV2ByIds(String[] ids); |
| | | |
| | | /** |
| | | * æ¸
空ç»è®¡è¡¨ |
| | | */ |
| | | public void truncateTable(); |
| | | |
| | | /** |
| | | * æ¹éæå
¥æ°æ® |
| | | * |
| | | * @param list æ°æ®å表 |
| | | * @return ç»æ |
| | | */ |
| | | public int batchInsert(@Param("list") List<ApsWeldSeamStatisticsV2> list); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç»è®¡æ°æ® |
| | | * |
| | | * @return ç»è®¡æ°æ®å表 |
| | | */ |
| | | public List<ApsWeldSeamStatisticsV2> queryWeldSeamStatistics(); |
| | | } |
| | |
| | | package com.aps.core.service; |
| | | |
| | | import com.aps.common.core.web.domain.AjaxResult; |
| | | import com.aps.core.domain.ApsPlanTask; |
| | | import com.aps.core.enums.PLAN_TASK_STATUS; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | void savePlanTask(String batchNum); |
| | | |
| | | void updateTaskStatus(String batchNum, PLAN_TASK_STATUS status); |
| | | |
| | | AjaxResult generatorPlan(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.service.ApsPlate; |
| | | |
| | | import com.aps.common.core.web.domain.AjaxResult; |
| | | import com.aps.core.domain.ApsPlate.ApsPlateRequireDate; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhl |
| | | * @description é对表ãaps_plate_require_date(å·¥å计åéæ±æ¥æè¡¨)ãçæ°æ®åºæä½Service |
| | | * @createDate 2025-05-19 16:51:36 |
| | | */ |
| | | public interface ApsPlateRequireDateService extends IService<ApsPlateRequireDate> { |
| | | |
| | | @Transactional |
| | | void batchSave(List<ApsPlateRequireDate> list); |
| | | |
| | | |
| | | int batchDelete(List<Long> idList); |
| | | |
| | | Page<ApsPlateRequireDate> pagingList(Page<ApsPlateRequireDate> page, ApsPlateRequireDate requireDate); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.service; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.aps.core.domain.ApsGasPipelineMo; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * 管路æå·¥æ°ä½å·¥åæ°æ®Serviceæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-19 |
| | | */ |
| | | public interface IApsGasPipelineMoService |
| | | { |
| | | /** |
| | | * æ¥è¯¢ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ® |
| | | * |
| | | * @param id 管路æå·¥æ°ä½å·¥åæ°æ®ä¸»é® |
| | | * @return 管路æå·¥æ°ä½å·¥åæ°æ® |
| | | */ |
| | | public ApsGasPipelineMo selectApsGasPipelineMoById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ®å表 |
| | | * |
| | | * @param apsGasPipelineMo 管路æå·¥æ°ä½å·¥åæ°æ® |
| | | * @return 管路æå·¥æ°ä½å·¥åæ°æ®éå |
| | | */ |
| | | public List<ApsGasPipelineMo> selectApsGasPipelineMoList(ApsGasPipelineMo apsGasPipelineMo); |
| | | |
| | | /** |
| | | * æ°å¢ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ® |
| | | * |
| | | * @param apsGasPipelineMo 管路æå·¥æ°ä½å·¥åæ°æ® |
| | | * @return ç»æ |
| | | */ |
| | | public int insertApsGasPipelineMo(ApsGasPipelineMo apsGasPipelineMo); |
| | | |
| | | /** |
| | | * ä¿®æ¹ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ® |
| | | * |
| | | * @param apsGasPipelineMo 管路æå·¥æ°ä½å·¥åæ°æ® |
| | | * @return ç»æ |
| | | */ |
| | | public int updateApsGasPipelineMo(ApsGasPipelineMo apsGasPipelineMo); |
| | | |
| | | /** |
| | | * æ¹éå é¤ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ® |
| | | * |
| | | * @param ids éè¦å é¤ç管路æå·¥æ°ä½å·¥åæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsGasPipelineMoByIds(Long[] ids); |
| | | |
| | | /** |
| | | * å é¤ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ®ä¿¡æ¯ |
| | | * |
| | | * @param id 管路æå·¥æ°ä½å·¥åæ°æ®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsGasPipelineMoById(Long id); |
| | | |
| | | /** |
| | | * æå
¥ ç®¡è·¯å·¥åæ°æ® |
| | | * @param file |
| | | * @return |
| | | */ |
| | | int batchInsertGasPipelineMo(MultipartFile file); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.service; |
| | | |
| | | import java.util.List; |
| | | import com.aps.core.domain.ApsGasPipelinePrediction; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * 管路æå·¥æ°ä½é¢æµæ°æ®Serviceæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-19 |
| | | */ |
| | | public interface IApsGasPipelinePredictionService |
| | | { |
| | | /** |
| | | * æ¥è¯¢ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ® |
| | | * |
| | | * @param id 管路æå·¥æ°ä½é¢æµæ°æ®ä¸»é® |
| | | * @return 管路æå·¥æ°ä½é¢æµæ°æ® |
| | | */ |
| | | public ApsGasPipelinePrediction selectApsGasPipelinePredictionById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ®å表 |
| | | * |
| | | * @param apsGasPipelinePrediction 管路æå·¥æ°ä½é¢æµæ°æ® |
| | | * @return 管路æå·¥æ°ä½é¢æµæ°æ®éå |
| | | */ |
| | | public List<ApsGasPipelinePrediction> selectApsGasPipelinePredictionList(ApsGasPipelinePrediction apsGasPipelinePrediction); |
| | | |
| | | /** |
| | | * æ°å¢ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ® |
| | | * |
| | | * @param apsGasPipelinePrediction 管路æå·¥æ°ä½é¢æµæ°æ® |
| | | * @return ç»æ |
| | | */ |
| | | public int insertApsGasPipelinePrediction(ApsGasPipelinePrediction apsGasPipelinePrediction); |
| | | |
| | | /** |
| | | * ä¿®æ¹ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ® |
| | | * |
| | | * @param apsGasPipelinePrediction 管路æå·¥æ°ä½é¢æµæ°æ® |
| | | * @return ç»æ |
| | | */ |
| | | public int updateApsGasPipelinePrediction(ApsGasPipelinePrediction apsGasPipelinePrediction); |
| | | |
| | | /** |
| | | * æ¹éå é¤ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ® |
| | | * |
| | | * @param ids éè¦å é¤ç管路æå·¥æ°ä½é¢æµæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsGasPipelinePredictionByIds(Long[] ids); |
| | | |
| | | /** |
| | | * å é¤ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ®ä¿¡æ¯ |
| | | * |
| | | * @param id 管路æå·¥æ°ä½é¢æµæ°æ®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsGasPipelinePredictionById(Long id); |
| | | |
| | | int batchInsertApsGasPipelinePrediction(MultipartFile file); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.service; |
| | | |
| | | import com.aps.core.domain.ApsMaterialProductGroupManagement; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç©æäº§åç»æ°æ®ç®¡çServiceæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-19 |
| | | */ |
| | | public interface IApsMaterialProductGroupManagementService |
| | | { |
| | | /** |
| | | * æ¥è¯¢ç©æäº§åç»æ°æ®ç®¡ç |
| | | * |
| | | * @param id ç©æäº§åç»æ°æ®ç®¡çä¸»é® |
| | | * @return ç©æäº§åç»æ°æ®ç®¡ç |
| | | */ |
| | | public ApsMaterialProductGroupManagement selectApsMaterialProductGroupManagementById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç©æäº§åç»æ°æ®ç®¡çå表 |
| | | * |
| | | * @param apsMaterialProductGroupManagement ç©æäº§åç»æ°æ®ç®¡ç |
| | | * @return ç©æäº§åç»æ°æ®ç®¡çéå |
| | | */ |
| | | public List<ApsMaterialProductGroupManagement> selectApsMaterialProductGroupManagementList(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement); |
| | | |
| | | /** |
| | | * æ°å¢ç©æäº§åç»æ°æ®ç®¡ç |
| | | * |
| | | * @param apsMaterialProductGroupManagement ç©æäº§åç»æ°æ®ç®¡ç |
| | | * @return ç»æ |
| | | */ |
| | | public int insertApsMaterialProductGroupManagement(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement); |
| | | |
| | | /** |
| | | * ä¿®æ¹ç©æäº§åç»æ°æ®ç®¡ç |
| | | * |
| | | * @param apsMaterialProductGroupManagement ç©æäº§åç»æ°æ®ç®¡ç |
| | | * @return ç»æ |
| | | */ |
| | | public int updateApsMaterialProductGroupManagement(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement); |
| | | |
| | | /** |
| | | * æ¹éå é¤ç©æäº§åç»æ°æ®ç®¡ç |
| | | * |
| | | * @param ids éè¦å é¤çç©æäº§åç»æ°æ®ç®¡ç主é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsMaterialProductGroupManagementByIds(Long[] ids); |
| | | |
| | | /** |
| | | * å é¤ç©æäº§åç»æ°æ®ç®¡çä¿¡æ¯ |
| | | * |
| | | * @param id ç©æäº§åç»æ°æ®ç®¡çä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsMaterialProductGroupManagementById(Long id); |
| | | |
| | | int batchInsertApsMaterialProductGroupManagement(MultipartFile file); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.service.impl; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.aps.common.core.utils.DateUtils; |
| | | import com.aps.common.security.utils.SecurityUtils; |
| | | import com.aps.core.domain.ApsGasPipelineMo; |
| | | import com.aps.core.mapper.ApsGasPipelineMoMapper; |
| | | import com.aps.core.service.IApsGasPipelineMoService; |
| | | import io.micrometer.common.util.StringUtils; |
| | | import lombok.SneakyThrows; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.ss.usermodel.WorkbookFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.sql.Timestamp; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 管路æå·¥æ°ä½å·¥åæ°æ®Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-19 |
| | | */ |
| | | @Service |
| | | public class ApsGasPipelineMoServiceImpl implements IApsGasPipelineMoService { |
| | | @Autowired |
| | | private ApsGasPipelineMoMapper apsGasPipelineMoMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ® |
| | | * |
| | | * @param id 管路æå·¥æ°ä½å·¥åæ°æ®ä¸»é® |
| | | * @return 管路æå·¥æ°ä½å·¥åæ°æ® |
| | | */ |
| | | @Override |
| | | public ApsGasPipelineMo selectApsGasPipelineMoById(Long id) { |
| | | return apsGasPipelineMoMapper.selectApsGasPipelineMoById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ®å表 |
| | | * |
| | | * @param apsGasPipelineMo 管路æå·¥æ°ä½å·¥åæ°æ® |
| | | * @return 管路æå·¥æ°ä½å·¥åæ°æ® |
| | | */ |
| | | @Override |
| | | public List<ApsGasPipelineMo> selectApsGasPipelineMoList(ApsGasPipelineMo apsGasPipelineMo) { |
| | | return apsGasPipelineMoMapper.selectApsGasPipelineMoList(apsGasPipelineMo); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ® |
| | | * |
| | | * @param apsGasPipelineMo 管路æå·¥æ°ä½å·¥åæ°æ® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertApsGasPipelineMo(ApsGasPipelineMo apsGasPipelineMo) { |
| | | apsGasPipelineMo.setCreateTime(DateUtils.getNowDate()); |
| | | apsGasPipelineMo.setId(IdUtil.getSnowflakeNextId()); |
| | | apsGasPipelineMo.setCreateBy(SecurityUtils.getUsername()); |
| | | return apsGasPipelineMoMapper.insertApsGasPipelineMo(apsGasPipelineMo); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ® |
| | | * |
| | | * @param apsGasPipelineMo 管路æå·¥æ°ä½å·¥åæ°æ® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateApsGasPipelineMo(ApsGasPipelineMo apsGasPipelineMo) { |
| | | apsGasPipelineMo.setUpdateTime(DateUtils.getNowDate()); |
| | | return apsGasPipelineMoMapper.updateApsGasPipelineMo(apsGasPipelineMo); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ® |
| | | * |
| | | * @param ids éè¦å é¤ç管路æå·¥æ°ä½å·¥åæ°æ®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteApsGasPipelineMoByIds(Long[] ids) { |
| | | return apsGasPipelineMoMapper.deleteApsGasPipelineMoByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç®¡è·¯æå·¥æ°ä½å·¥åæ°æ®ä¿¡æ¯ |
| | | * |
| | | * @param id 管路æå·¥æ°ä½å·¥åæ°æ®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteApsGasPipelineMoById(Long id) { |
| | | return apsGasPipelineMoMapper.deleteApsGasPipelineMoById(id); |
| | | } |
| | | |
| | | @SneakyThrows |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public int batchInsertGasPipelineMo(MultipartFile file) { |
| | | Workbook workbook = WorkbookFactory.create(file.getInputStream()); |
| | | |
| | | Sheet sheet = workbook.getSheetAt(0); |
| | | int rows = sheet.getLastRowNum(); |
| | | if (rows > 0) { |
| | | List<ApsGasPipelineMo> list = new ArrayList<>(); |
| | | |
| | | /*æ°æ®åä»1å¼å§*/ |
| | | for (int i = 1; i <= rows; i++) { |
| | | Row row = sheet.getRow(i); |
| | | if (row.getCell(0) == null){ |
| | | continue; |
| | | } |
| | | String mo = row.getCell(0).getStringCellValue(); |
| | | if (StringUtils.isEmpty(mo)){ |
| | | continue; |
| | | } |
| | | String factory = row.getCell(1).getStringCellValue(); |
| | | String materialNum = row.getCell(2).getStringCellValue(); |
| | | double quantity = row.getCell(3).getNumericCellValue(); |
| | | Date planEnd = row.getCell(4).getDateCellValue(); |
| | | if (StringUtils.isNotBlank(factory) && |
| | | StringUtils.isNotBlank(materialNum) && |
| | | planEnd != null) { |
| | | ApsGasPipelineMo apsGasPipelineMo = new ApsGasPipelineMo(); |
| | | apsGasPipelineMo.setMo(mo); |
| | | apsGasPipelineMo.setId(IdUtil.getSnowflakeNextId()); |
| | | apsGasPipelineMo.setFactory(factory); |
| | | apsGasPipelineMo.setCreateBy(SecurityUtils.getUsername()); |
| | | apsGasPipelineMo.setCreateTime(DateUtils.getNowDate()); |
| | | apsGasPipelineMo.setQuantity(new BigDecimal(quantity)); |
| | | apsGasPipelineMo.setPlanEnd(new Timestamp(planEnd.getTime())); |
| | | list.add(apsGasPipelineMo); |
| | | } |
| | | } |
| | | if (!list.isEmpty()) { |
| | | apsGasPipelineMoMapper.deleteAll(); |
| | | apsGasPipelineMoMapper.insert(list); |
| | | } |
| | | return list.size(); |
| | | } |
| | | return 0; |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.service.impl; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.aps.common.core.utils.DateUtils; |
| | | import com.aps.common.security.utils.SecurityUtils; |
| | | import com.aps.core.domain.ApsGasPipelinePrediction; |
| | | import com.aps.core.mapper.ApsGasPipelinePredictionMapper; |
| | | import com.aps.core.service.IApsGasPipelinePredictionService; |
| | | import io.micrometer.common.util.StringUtils; |
| | | import lombok.SneakyThrows; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.ss.usermodel.WorkbookFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.sql.Timestamp; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 管路æå·¥æ°ä½é¢æµæ°æ®Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-19 |
| | | */ |
| | | @Service |
| | | public class ApsGasPipelinePredictionServiceImpl implements IApsGasPipelinePredictionService |
| | | { |
| | | @Autowired |
| | | private ApsGasPipelinePredictionMapper apsGasPipelinePredictionMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ® |
| | | * |
| | | * @param id 管路æå·¥æ°ä½é¢æµæ°æ®ä¸»é® |
| | | * @return 管路æå·¥æ°ä½é¢æµæ°æ® |
| | | */ |
| | | @Override |
| | | public ApsGasPipelinePrediction selectApsGasPipelinePredictionById(Long id) |
| | | { |
| | | return apsGasPipelinePredictionMapper.selectApsGasPipelinePredictionById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ®å表 |
| | | * |
| | | * @param apsGasPipelinePrediction 管路æå·¥æ°ä½é¢æµæ°æ® |
| | | * @return 管路æå·¥æ°ä½é¢æµæ°æ® |
| | | */ |
| | | @Override |
| | | public List<ApsGasPipelinePrediction> selectApsGasPipelinePredictionList(ApsGasPipelinePrediction apsGasPipelinePrediction) |
| | | { |
| | | return apsGasPipelinePredictionMapper.selectApsGasPipelinePredictionList(apsGasPipelinePrediction); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ® |
| | | * |
| | | * @param apsGasPipelinePrediction 管路æå·¥æ°ä½é¢æµæ°æ® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertApsGasPipelinePrediction(ApsGasPipelinePrediction apsGasPipelinePrediction) |
| | | { |
| | | apsGasPipelinePrediction.setCreateTime(DateUtils.getNowDate()); |
| | | return apsGasPipelinePredictionMapper.insertApsGasPipelinePrediction(apsGasPipelinePrediction); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ® |
| | | * |
| | | * @param apsGasPipelinePrediction 管路æå·¥æ°ä½é¢æµæ°æ® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateApsGasPipelinePrediction(ApsGasPipelinePrediction apsGasPipelinePrediction) |
| | | { |
| | | apsGasPipelinePrediction.setUpdateTime(DateUtils.getNowDate()); |
| | | return apsGasPipelinePredictionMapper.updateApsGasPipelinePrediction(apsGasPipelinePrediction); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ® |
| | | * |
| | | * @param ids éè¦å é¤ç管路æå·¥æ°ä½é¢æµæ°æ®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteApsGasPipelinePredictionByIds(Long[] ids) |
| | | { |
| | | return apsGasPipelinePredictionMapper.deleteApsGasPipelinePredictionByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç®¡è·¯æå·¥æ°ä½é¢æµæ°æ®ä¿¡æ¯ |
| | | * |
| | | * @param id 管路æå·¥æ°ä½é¢æµæ°æ®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteApsGasPipelinePredictionById(Long id) |
| | | { |
| | | return apsGasPipelinePredictionMapper.deleteApsGasPipelinePredictionById(id); |
| | | } |
| | | |
| | | @SneakyThrows |
| | | @Override |
| | | public int batchInsertApsGasPipelinePrediction(MultipartFile file) { |
| | | Workbook workbook = WorkbookFactory.create(file.getInputStream()); |
| | | |
| | | Sheet sheet = workbook.getSheetAt(0); |
| | | int rows = sheet.getLastRowNum(); |
| | | if (rows > 0) { |
| | | List<ApsGasPipelinePrediction> list = new ArrayList<>(); |
| | | |
| | | /*æ°æ®åä»1å¼å§*/ |
| | | for (int i = 1; i <= rows; i++) { |
| | | Row row = sheet.getRow(i); |
| | | if (row.getCell(0) == null){ |
| | | continue; |
| | | } |
| | | |
| | | String materialCode = row.getCell(0).getStringCellValue(); |
| | | if (StringUtils.isEmpty(materialCode)){ |
| | | continue; |
| | | } |
| | | String factory = row.getCell(1).getStringCellValue(); |
| | | double quantity = row.getCell(2).getNumericCellValue(); |
| | | Date date = row.getCell(3).getDateCellValue(); |
| | | if (StringUtils.isNotBlank(factory) && |
| | | date != null) { |
| | | ApsGasPipelinePrediction item = new ApsGasPipelinePrediction(); |
| | | item.setId(IdUtil.getSnowflakeNextId()); |
| | | item.setFactory(factory); |
| | | item.setMaterialCode(materialCode); |
| | | item.setCreateBy(SecurityUtils.getUsername()); |
| | | item.setCreateTime(DateUtils.getNowDate()); |
| | | item.setPredictQuantity(new BigDecimal(quantity)); |
| | | item.setPredictDate(new Timestamp(date.getTime())); |
| | | list.add(item); |
| | | } |
| | | } |
| | | if (!list.isEmpty()) { |
| | | apsGasPipelinePredictionMapper.deleteAll(); |
| | | apsGasPipelinePredictionMapper.insert(list); |
| | | } |
| | | return list.size(); |
| | | } |
| | | return 0; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.service.impl; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.sql.Timestamp; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.aps.common.core.utils.DateUtils; |
| | | import com.aps.common.security.utils.SecurityUtils; |
| | | import com.aps.core.domain.ApsGasPipelinePrediction; |
| | | import com.aps.core.domain.ApsMaterialProductGroupManagement; |
| | | import com.aps.core.mapper.ApsMaterialProductGroupManagementMapper; |
| | | import com.aps.core.service.IApsMaterialProductGroupManagementService; |
| | | import io.micrometer.common.util.StringUtils; |
| | | import lombok.SneakyThrows; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.ss.usermodel.WorkbookFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * ç©æäº§åç»æ°æ®ç®¡çServiceä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-19 |
| | | */ |
| | | @Service |
| | | public class ApsMaterialProductGroupManagementServiceImpl implements IApsMaterialProductGroupManagementService |
| | | { |
| | | @Autowired |
| | | private ApsMaterialProductGroupManagementMapper apsMaterialProductGroupManagementMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç©æäº§åç»æ°æ®ç®¡ç |
| | | * |
| | | * @param id ç©æäº§åç»æ°æ®ç®¡çä¸»é® |
| | | * @return ç©æäº§åç»æ°æ®ç®¡ç |
| | | */ |
| | | @Override |
| | | public ApsMaterialProductGroupManagement selectApsMaterialProductGroupManagementById(Long id) |
| | | { |
| | | return apsMaterialProductGroupManagementMapper.selectApsMaterialProductGroupManagementById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç©æäº§åç»æ°æ®ç®¡çå表 |
| | | * |
| | | * @param apsMaterialProductGroupManagement ç©æäº§åç»æ°æ®ç®¡ç |
| | | * @return ç©æäº§åç»æ°æ®ç®¡ç |
| | | */ |
| | | @Override |
| | | public List<ApsMaterialProductGroupManagement> selectApsMaterialProductGroupManagementList(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement) |
| | | { |
| | | return apsMaterialProductGroupManagementMapper.selectApsMaterialProductGroupManagementList(apsMaterialProductGroupManagement); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç©æäº§åç»æ°æ®ç®¡ç |
| | | * |
| | | * @param apsMaterialProductGroupManagement ç©æäº§åç»æ°æ®ç®¡ç |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertApsMaterialProductGroupManagement(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement) |
| | | { |
| | | apsMaterialProductGroupManagement.setCreateTime(DateUtils.getNowDate()); |
| | | return apsMaterialProductGroupManagementMapper.insertApsMaterialProductGroupManagement(apsMaterialProductGroupManagement); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç©æäº§åç»æ°æ®ç®¡ç |
| | | * |
| | | * @param apsMaterialProductGroupManagement ç©æäº§åç»æ°æ®ç®¡ç |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateApsMaterialProductGroupManagement(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement) |
| | | { |
| | | apsMaterialProductGroupManagement.setUpdateTime(DateUtils.getNowDate()); |
| | | return apsMaterialProductGroupManagementMapper.updateApsMaterialProductGroupManagement(apsMaterialProductGroupManagement); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ç©æäº§åç»æ°æ®ç®¡ç |
| | | * |
| | | * @param ids éè¦å é¤çç©æäº§åç»æ°æ®ç®¡çä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteApsMaterialProductGroupManagementByIds(Long[] ids) |
| | | { |
| | | return apsMaterialProductGroupManagementMapper.deleteApsMaterialProductGroupManagementByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç©æäº§åç»æ°æ®ç®¡çä¿¡æ¯ |
| | | * |
| | | * @param id ç©æäº§åç»æ°æ®ç®¡çä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteApsMaterialProductGroupManagementById(Long id) |
| | | { |
| | | return apsMaterialProductGroupManagementMapper.deleteApsMaterialProductGroupManagementById(id); |
| | | } |
| | | |
| | | @SneakyThrows |
| | | @Override |
| | | public int batchInsertApsMaterialProductGroupManagement(MultipartFile file) { |
| | | Workbook workbook = WorkbookFactory.create(file.getInputStream()); |
| | | |
| | | Sheet sheet = workbook.getSheetAt(0); |
| | | int rows = sheet.getLastRowNum(); |
| | | if (rows > 0) { |
| | | List<ApsMaterialProductGroupManagement> list = new ArrayList<>(); |
| | | |
| | | /*æ°æ®åä»1å¼å§*/ |
| | | for (int i = 1; i <= rows; i++) { |
| | | Row row = sheet.getRow(i); |
| | | if (row.getCell(0) == null) { |
| | | continue; |
| | | } |
| | | String materialCode = row.getCell(0).getStringCellValue(); |
| | | if (StringUtils.isEmpty(materialCode)){ |
| | | continue; |
| | | } |
| | | String materialType = row.getCell(1).getStringCellValue(); |
| | | String domain = row.getCell(2).getStringCellValue(); |
| | | String isMain = row.getCell(3).getStringCellValue(); |
| | | String factory = row.getCell(4).getStringCellValue(); |
| | | if (StringUtils.isNotBlank(materialType) && |
| | | StringUtils.isNotBlank(domain) && |
| | | StringUtils.isNotBlank(isMain) && |
| | | StringUtils.isNotBlank(factory)) { |
| | | ApsMaterialProductGroupManagement item = new ApsMaterialProductGroupManagement(); |
| | | item.setId(IdUtil.getSnowflakeNextId()); |
| | | item.setFactory(factory); |
| | | item.setDomain(domain); |
| | | item.setMaterialType(materialType); |
| | | item.setMaterialCode(materialCode); |
| | | item.setIsMain(isMain); |
| | | item.setCreateBy(SecurityUtils.getUsername()); |
| | | item.setCreateTime(DateUtils.getNowDate()); |
| | | list.add(item); |
| | | } |
| | | } |
| | | if (!list.isEmpty()) { |
| | | apsMaterialProductGroupManagementMapper.insert(list); |
| | | } |
| | | return list.size(); |
| | | } |
| | | return 0; |
| | | } |
| | | } |
| | |
| | | package com.aps.core.service.impl; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.aps.common.core.domain.R; |
| | | import com.aps.common.core.utils.DateUtils; |
| | | import com.aps.common.core.web.domain.AjaxResult; |
| | | import com.aps.common.redis.service.RedisLockUtils; |
| | | import com.aps.common.security.utils.SecurityUtils; |
| | | import com.aps.core.enums.PLAN_TASK_STATUS; |
| | | import com.aps.core.enums.PLAN_TASK_TYPE; |
| | | import com.aps.core.enums.REDIS_LOCK_KEY; |
| | | import com.aps.core.mapper.ApsPlateStandardRequireOrderEndDayMapper; |
| | | import com.aps.core.service.ApsPlate.IApsPlateStandardRequireBatchService; |
| | | import com.aps.core.service.ApsPlate.IApsPlateStandardRequireService; |
| | | import com.aps.core.service.ApsPlateStandardRequireOrderEndDayService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.aps.core.domain.ApsPlanTask; |
| | | import com.aps.core.service.ApsPlanTaskService; |
| | | import com.aps.core.mapper.ApsPlanTaskMapper; |
| | | import jakarta.annotation.Resource; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import static com.aps.common.core.web.domain.AjaxResult.success; |
| | | import static com.aps.core.enums.REDIS_LOCK_KEY.PLATE_ORDER_PLAN; |
| | | |
| | | /** |
| | | * @author zhl |
| | | * @description é对表ãaps_plan_task(计åçææ¥å¿è¡¨)ãçæ°æ®åºæä½Serviceå®ç° |
| | | * @createDate 2025-05-16 14:41:49 |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class ApsPlanTaskServiceImpl extends ServiceImpl<ApsPlanTaskMapper, ApsPlanTask> implements ApsPlanTaskService{ |
| | | |
| | | |
| | | @Autowired |
| | | ApsPlanTaskMapper mapper; |
| | | @Autowired |
| | | private IApsPlateStandardRequireService apsPlateStandardRequireService; |
| | | @Resource |
| | | IApsPlateStandardRequireBatchService requireBatchService; |
| | | |
| | | @Resource |
| | | RedisLockUtils redisLockUtils; |
| | | |
| | | @Resource |
| | | ApsPlateStandardRequireOrderEndDayMapper orderEndDayMapper; |
| | | |
| | | @Override |
| | | public Page<ApsPlanTask> pagingList(Page<ApsPlanTask> page ,ApsPlanTask task){ |
| | | LambdaQueryWrapper<ApsPlanTask> queryWrapper=new LambdaQueryWrapper<>(); |
| | | queryWrapper.like( !task.getTaskType().isEmpty(), ApsPlanTask::getTaskType,task.getTaskType()); |
| | | queryWrapper.like( null!=task.getTaskType(), ApsPlanTask::getTaskType,task.getTaskType()); |
| | | return mapper.selectPage(page, queryWrapper); |
| | | } |
| | | |
| | |
| | | .build(); |
| | | baseMapper.update(task,queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult generatorPlan() |
| | | { |
| | | String plateOrderPlanKey = PLATE_ORDER_PLAN.getKey(); |
| | | boolean existsLock = redisLockUtils.existLock(plateOrderPlanKey, PLAN_TASK_TYPE.PLATE_PLAN.getCode()); |
| | | if (existsLock){ |
| | | return AjaxResult.warn("é£éå·¥å计å任塿£å¨æ§è¡ä¸!"); |
| | | } |
| | | LambdaQueryWrapper<ApsPlanTask> queryWrapper=new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(ApsPlanTask::getTaskType,PLAN_TASK_TYPE.PLATE_PLAN.getCode()); |
| | | queryWrapper.eq(ApsPlanTask::getTaskStatus,PLAN_TASK_STATUS.IN_PROCESS.getCode()); |
| | | boolean existsDbTask = mapper.exists(queryWrapper); |
| | | if (existsDbTask){ |
| | | return AjaxResult.warn("é£éå·¥å计å任塿£å¨æ§è¡ä¸!!"); |
| | | } |
| | | try { |
| | | redisLockUtils.getLock(plateOrderPlanKey,PLAN_TASK_TYPE.PLATE_PLAN.getCode(), 3*60L); |
| | | String batchNum= requireBatchService.getNewBatchNumber(); |
| | | this.savePlanTask(batchNum); |
| | | apsPlateStandardRequireService.generatorPlan(batchNum); |
| | | this.updateTaskStatus(batchNum, PLAN_TASK_STATUS.FINISHED); |
| | | /*æ¸
é¤å·²ç»åå¨ç å·¥å计åå®å·¥æ¶é´*/ |
| | | orderEndDayMapper.batchRemove(); |
| | | log.info("计å任塿§è¡å®æ!"+batchNum); |
| | | return success(); |
| | | }catch (Exception e){ |
| | | redisLockUtils.releaseLock(plateOrderPlanKey,PLAN_TASK_TYPE.PLATE_PLAN.getCode()); |
| | | log.error("计å任塿§è¡å¤±è´¥!"+e.getMessage()); |
| | | return AjaxResult.error("计å任塿§è¡å¤±è´¥!"+e.getMessage()); |
| | | }finally { |
| | | redisLockUtils.releaseLock(plateOrderPlanKey,PLAN_TASK_TYPE.PLATE_PLAN.getCode()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.service.impl.ApsPlate; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.aps.common.security.utils.SecurityUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.aps.core.domain.ApsPlate.ApsPlateRequireDate; |
| | | import com.aps.core.service.ApsPlate.ApsPlateRequireDateService; |
| | | import com.aps.core.mapper.ApsPlateRequireDateMapper; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhl |
| | | * @description é对表ãaps_plate_require_date(å·¥å计åéæ±æ¥æè¡¨)ãçæ°æ®åºæä½Serviceå®ç° |
| | | * @createDate 2025-05-19 16:51:36 |
| | | */ |
| | | @Service |
| | | public class ApsPlateRequireDateServiceImpl extends ServiceImpl<ApsPlateRequireDateMapper, ApsPlateRequireDate> |
| | | implements ApsPlateRequireDateService { |
| | | |
| | | @Resource |
| | | private ApsPlateRequireDateMapper apsPlateRequireDateMapper; |
| | | |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void batchSave(List<ApsPlateRequireDate> list) { |
| | | if (!list.isEmpty()) { |
| | | list.forEach(apsPlateRequireDate -> { |
| | | apsPlateRequireDate.setId(IdUtil.getSnowflakeNextId()); |
| | | apsPlateRequireDate.setCreateBy(SecurityUtils.getUsername()); |
| | | }); |
| | | int batchSize = 1000; |
| | | for (int i = 0; i < list.size(); i += batchSize) { |
| | | int end = Math.min(i + batchSize, list.size()); |
| | | List<ApsPlateRequireDate> batch = list.subList(i, end); |
| | | List<String> docNoList = batch.stream().map(ApsPlateRequireDate::getDocNo).distinct().toList(); |
| | | apsPlateRequireDateMapper.deleteByDocNoList(docNoList, SecurityUtils.getUsername()); |
| | | apsPlateRequireDateMapper.batchInsert(batch); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public int batchDelete(List<Long> idList){ |
| | | //TODO: æ ¹æ®idListæ¹éå é¤ |
| | | LambdaUpdateWrapper<ApsPlateRequireDate> queryWrapper = new LambdaUpdateWrapper<>(); |
| | | queryWrapper.in(ApsPlateRequireDate::getId, idList); |
| | | queryWrapper.set(ApsPlateRequireDate::getDelFlag, 0); |
| | | return apsPlateRequireDateMapper.update(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public Page<ApsPlateRequireDate> pagingList(Page<ApsPlateRequireDate> page, ApsPlateRequireDate requireDate){ |
| | | LambdaQueryWrapper<ApsPlateRequireDate> queryWrapper=new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(ApsPlateRequireDate::getDelFlag,0); |
| | | queryWrapper.like( null!=requireDate.getDocNo(), ApsPlateRequireDate::getDocNo,requireDate.getDocNo()); |
| | | return apsPlateRequireDateMapper.selectPage(page, queryWrapper); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @Override |
| | | public int saveBatch(List<Long> planIds) |
| | | { |
| | | mapper.batchRemove(planIds); |
| | | mapper.batchRemoveByPlanId(planIds); |
| | | return mapper.batchInsert(planIds, SecurityUtils.getUsername()); |
| | | } |
| | | } |
| | |
| | | requireBatchService.initRequireBatch(); |
| | | /*å®ä¹å·¥å为åé */ |
| | | String plantCode="FORTUNA"; |
| | | /*å®ä¹ä¸»åç±»å为é£é主å*/ |
| | | String mainOrderType = "main"; |
| | | /*è·åé£é主åä¿¡æ¯*/ |
| | | List<ApsPlatePlan> mainPlans = platePlanMapper.selectPlatePlanByPlantMajor(plantCode,mainOrderType); |
| | | List<ApsPlatePlan> mainPlans = platePlanMapper.selectPlatePlanByPlantMajor(plantCode); |
| | | Hashtable<String, ApsMaterialStorageManagement> usedStorage = new Hashtable<>(); |
| | | /*å
åä¸åå¨åä»¶å·¥å*/ |
| | | Hashtable<String, List<ApsPlatePlan>> subPlans = new Hashtable<>(); |
| | |
| | | for (ApsPlatePlan mainPlan : mainPlans) { |
| | | String itemNumber = mainPlan.getItemNumber(); |
| | | /*æ ¹æ®æå· è·åBOM Header */ |
| | | |
| | | |
| | | List<ApsPlateStandardRequire> requiresList=new ArrayList<>(); |
| | | List<ApsPlateStandardRequireBomStockDetail> stockDetailsList=new ArrayList<>(); |
| | | List<ApsPlateStandardRequireBomOrderDetail> orderDetailsList=new ArrayList<>(); |
| | | |
| | | |
| | | log.info("å¼å§çæéæ±ï¼å·¥åå·ï¼"+mainPlan.getDocumentNumber()); |
| | | /*å½åBomèç¹å¤ç宿åï¼å¤çä¸çº§BOM*/ |
| | | getBomRequires(plantCode, "0","0",itemNumber,BigDecimal.ONE, batchNum, null |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.service.mainPlan; |
| | | |
| | | import com.aps.core.domain.mainPlan.ApsWeldSeamStatisticsV2; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * çç¼ç»è®¡è¡¨V2æå¡æ¥å£ |
| | | * |
| | | * @date 2023-08-01 |
| | | */ |
| | | public interface IApsWeldSeamStatisticsV2Service { |
| | | /** |
| | | * æ¥è¯¢çç¼ç»è®¡è¡¨V2å表 |
| | | * |
| | | * @param apsWeldSeamStatisticsV2 çç¼ç»è®¡è¡¨V2 |
| | | * @return çç¼ç»è®¡è¡¨V2éå |
| | | */ |
| | | public List<ApsWeldSeamStatisticsV2> selectApsWeldSeamStatisticsV2List(ApsWeldSeamStatisticsV2 apsWeldSeamStatisticsV2); |
| | | |
| | | /** |
| | | * ä¿®æ¹çç¼ç»è®¡è¡¨V2 |
| | | * |
| | | * @param apsWeldSeamStatisticsV2 çç¼ç»è®¡è¡¨V2 |
| | | * @return æ´æ°åçè®°å½ |
| | | */ |
| | | public ApsWeldSeamStatisticsV2 updateApsWeldSeamStatisticsV2(ApsWeldSeamStatisticsV2 apsWeldSeamStatisticsV2); |
| | | |
| | | /** |
| | | * å·æ°çç¼ç»è®¡è¡¨æ°æ® |
| | | * |
| | | * @param username æä½ç¨æ· |
| | | * @return åå½±åçè®°å½æ° |
| | | */ |
| | | public int refreshWeldSeamStatistics(String username); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.service.mainPlan.impl; |
| | | |
| | | import com.aps.common.core.utils.DateUtils; |
| | | import com.aps.common.core.utils.uuid.IdUtils; |
| | | import com.aps.common.core.web.page.TableDataInfo; |
| | | import com.aps.common.security.utils.SecurityUtils; |
| | | import com.aps.core.controller.basicData.ApsGasPipelineCapacityPlanController; |
| | | import com.aps.core.domain.ApsGasPipelineCapacityPlan; |
| | | import com.aps.core.domain.mainPlan.ApsWeldSeamStatisticsV2; |
| | | import com.aps.core.mapper.mainPlan.ApsWeldSeamStatisticsV2Mapper; |
| | | import com.aps.core.service.IApsGasPipelineCapacityPlanService; |
| | | import com.aps.core.service.mainPlan.IApsWeldSeamStatisticsV2Service; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * çç¼ç»è®¡è¡¨V2Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @date 2023-08-01 |
| | | */ |
| | | @Service |
| | | public class ApsWeldSeamStatisticsV2ServiceImpl implements IApsWeldSeamStatisticsV2Service { |
| | | @Autowired |
| | | private ApsWeldSeamStatisticsV2Mapper apsWeldSeamStatisticsV2Mapper; |
| | | |
| | | @Autowired |
| | | private ApsGasPipelineCapacityPlanController apsGasPipelineCapacityPlanController; |
| | | |
| | | /** |
| | | * æ¥è¯¢çç¼ç»è®¡è¡¨V2å表 |
| | | * |
| | | * @param apsWeldSeamStatisticsV2 çç¼ç»è®¡è¡¨V2 |
| | | * @return çç¼ç»è®¡è¡¨V2 |
| | | */ |
| | | @Override |
| | | public List<ApsWeldSeamStatisticsV2> selectApsWeldSeamStatisticsV2List(ApsWeldSeamStatisticsV2 apsWeldSeamStatisticsV2) { |
| | | return apsWeldSeamStatisticsV2Mapper.selectApsWeldSeamStatisticsV2List(apsWeldSeamStatisticsV2); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹çç¼ç»è®¡è¡¨V2 |
| | | * |
| | | * @param apsWeldSeamStatisticsV2 çç¼ç»è®¡è¡¨V2 |
| | | * @return æ´æ°åçè®°å½ |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ApsWeldSeamStatisticsV2 updateApsWeldSeamStatisticsV2(ApsWeldSeamStatisticsV2 apsWeldSeamStatisticsV2) |
| | | { |
| | | // è®¾ç½®æ´æ°æ¶é´ |
| | | apsWeldSeamStatisticsV2.setUpdateTime(DateUtils.getNowDate()); |
| | | apsWeldSeamStatisticsV2.setUpdateBy(SecurityUtils.getUsername()); |
| | | |
| | | // 1. 仿°æ®åºè·ååå§è®°å½ï¼ä»¥ä¿çå
¶ä»å段ä¸å |
| | | ApsWeldSeamStatisticsV2 originalData = apsWeldSeamStatisticsV2Mapper.selectApsWeldSeamStatisticsV2ById(apsWeldSeamStatisticsV2.getId()); |
| | | if (originalData == null) { |
| | | throw new RuntimeException("è®°å½ä¸åå¨ï¼ID: " + apsWeldSeamStatisticsV2.getId()); |
| | | } |
| | | |
| | | // 2. åªæ´æ°reserveEmergencyOrderOutputådaysä¸¤ä¸ªåæ®µ |
| | | originalData.setReserveEmergencyOrderOutput(apsWeldSeamStatisticsV2.getReserveEmergencyOrderOutput()); |
| | | originalData.setDays(apsWeldSeamStatisticsV2.getDays()); |
| | | originalData.setUpdateTime(apsWeldSeamStatisticsV2.getUpdateTime()); |
| | | originalData.setUpdateBy(apsWeldSeamStatisticsV2.getUpdateBy()); |
| | | |
| | | // 3. ç¡®ä¿ææç¨äºè®¡ç®çBigDecimalåæ®µä¸ä¸ºnull |
| | | java.math.BigDecimal pipingOrderReq = (originalData.getPipingOrderRequirement() != null) |
| | | ? originalData.getPipingOrderRequirement() : java.math.BigDecimal.ZERO; |
| | | |
| | | java.math.BigDecimal pipingPredictionReq = (originalData.getPipingPredictionRequirement() != null) |
| | | ? originalData.getPipingPredictionRequirement() : java.math.BigDecimal.ZERO; |
| | | |
| | | java.math.BigDecimal gasOrderReq = (originalData.getGasOrderRequirement() != null) |
| | | ? originalData.getGasOrderRequirement() : java.math.BigDecimal.ZERO; |
| | | |
| | | java.math.BigDecimal gasPredictionReq = (originalData.getGasPredictionRequirement() != null) |
| | | ? originalData.getGasPredictionRequirement() : java.math.BigDecimal.ZERO; |
| | | |
| | | java.math.BigDecimal reserveEmergencyOutput = (originalData.getReserveEmergencyOrderOutput() != null) |
| | | ? originalData.getReserveEmergencyOrderOutput() : java.math.BigDecimal.ZERO; |
| | | |
| | | // 4. 屿§1ï¼éæ°è®¡ç®totalï¼åè®¡ï¼ |
| | | java.math.BigDecimal total = pipingOrderReq |
| | | .add(pipingPredictionReq) |
| | | .add(gasOrderReq) |
| | | .add(gasPredictionReq) |
| | | .add(reserveEmergencyOutput); |
| | | |
| | | originalData.setTotal(total); |
| | | |
| | | // 5. 妿daysä¸ä¸ºç©ºä¸å¤§äº0ï¼éæ°è®¡ç®requirementDayWeldSeamåisSatisfy |
| | | if(originalData.getDays() != null && originalData.getDays().doubleValue() > 0) { |
| | | // 屿§2ï¼è®¡ç®éæ±æ¥çç¼ = å计/天æ°ï¼åèäºå
¥ |
| | | double result = total.doubleValue() / originalData.getDays().doubleValue(); |
| | | java.math.BigDecimal requirementDayWeldSeam = new java.math.BigDecimal(result).setScale(0, java.math.RoundingMode.HALF_UP); |
| | | originalData.setRequirementDayWeldSeam(requirementDayWeldSeam); |
| | | |
| | | // 屿§3ï¼å¤ææ¯å¦æ»¡è¶³ |
| | | if(originalData.getProductionDayWeldSeam() != null) { |
| | | if(originalData.getProductionDayWeldSeam().compareTo(requirementDayWeldSeam) >= 0) { |
| | | originalData.setIsSatisfy("1"); // 满足 |
| | | } else { |
| | | originalData.setIsSatisfy("0"); // 䏿»¡è¶³ |
| | | } |
| | | } else { |
| | | originalData.setIsSatisfy("0"); // é»è®¤ä¸æ»¡è¶³ |
| | | } |
| | | } else { |
| | | // 妿天æ°ä¸ºç©ºæä¸º0ï¼è®¾ç½®ä¸ºä¸æ»¡è¶³ |
| | | originalData.setIsSatisfy("0"); |
| | | } |
| | | |
| | | // 6. æ´æ°æ°æ®åº |
| | | apsWeldSeamStatisticsV2Mapper.updateApsWeldSeamStatisticsV2(originalData); |
| | | |
| | | // 7. è¿åæ´æ°åç宿´è®°å½ |
| | | return originalData; |
| | | } |
| | | |
| | | /** |
| | | * å·æ°çç¼ç»è®¡è¡¨æ°æ® |
| | | * |
| | | * @param username æä½ç¨æ· |
| | | * @return åå½±åçè®°å½æ° |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int refreshWeldSeamStatistics(String username) { |
| | | // 1. æ¸
空ç»è®¡è¡¨ |
| | | apsWeldSeamStatisticsV2Mapper.truncateTable(); |
| | | |
| | | // 2. è·åææ°çç»è®¡æ°æ® |
| | | List<ApsWeldSeamStatisticsV2> statisticsList = apsWeldSeamStatisticsV2Mapper.queryWeldSeamStatistics(); |
| | | |
| | | // 3. 设置å建信æ¯åIDï¼å¹¶è·åç产æ¥çç¼æ°æ® |
| | | Date now = new Date(); |
| | | for (ApsWeldSeamStatisticsV2 statistics : statisticsList) { |
| | | // 使ç¨UUIDä½ä¸ºID |
| | | statistics.setId(IdUtils.fastUUID()); |
| | | statistics.setCreateBy(username); |
| | | statistics.setCreateTime(now); |
| | | |
| | | // å
计ç®éæ±æ¥çç¼(requirementDayWeldSeam) |
| | | if(statistics.getDays() != null && statistics.getDays().doubleValue() > 0 && statistics.getTotal() != null) { |
| | | // 计ç®éæ±æ¥çç¼ = å计/天æ°ï¼åèäºå
¥ |
| | | double result = statistics.getTotal().doubleValue() / statistics.getDays().doubleValue(); |
| | | BigDecimal requirementDayWeldSeam = new BigDecimal(result).setScale(0, java.math.RoundingMode.HALF_UP); |
| | | statistics.setRequirementDayWeldSeam(requirementDayWeldSeam); |
| | | } else if (statistics.getRequirementDayWeldSeam() == null) { |
| | | // å¦ææ æ³è®¡ç®ä¸ä¹å没æå¼ï¼è®¾ç½®é»è®¤å¼ |
| | | statistics.setRequirementDayWeldSeam(BigDecimal.ZERO); |
| | | } |
| | | |
| | | // 设置ç产æ¥çç¼(productionDayWeldSeam) |
| | | // æ ¹æ®yearãmonthãproductionBaseæ¥è¯¢å¯¹åºçç产æ¥çç¼æ°æ® |
| | | if (statistics.getYear() != null && statistics.getMonth() != null && statistics.getProductionBase() != null) { |
| | | // å建æ¥è¯¢æ¡ä»¶ |
| | | ApsGasPipelineCapacityPlan queryParam = new ApsGasPipelineCapacityPlan(); |
| | | queryParam.setYear(statistics.getYear().toString()); |
| | | queryParam.setMonth(statistics.getMonth().toString()); |
| | | queryParam.setOrgCode(statistics.getProductionBase()); |
| | | |
| | | // ç´æ¥è°ç¨Controllerçlistæ¹æ³è·åæ°æ® |
| | | TableDataInfo tableDataInfo = apsGasPipelineCapacityPlanController.list(queryParam); |
| | | List<ApsGasPipelineCapacityPlan> capacityPlans = (List<ApsGasPipelineCapacityPlan>) tableDataInfo.getRows(); |
| | | |
| | | // éåæ¾å°processName为"æ°ä½ç®¡è·¯è½¨éçæ¥ç»"çè®°å½ |
| | | for (ApsGasPipelineCapacityPlan plan : capacityPlans) { |
| | | if ("æ°ä½ç®¡è·¯è½¨éçæ¥ç»".equals(plan.getProcessName()) && plan.getDayProduceAllNum() != null) { |
| | | // 设置ç产æ¥çç¼å¼ |
| | | statistics.setProductionDayWeldSeam(plan.getDayProduceAllNum()); |
| | | break; // æ¾å°å¹é
è®°å½åéåºå¾ªç¯ |
| | | } |
| | | } |
| | | } |
| | | |
| | | // å¦ææ²¡ææ¾å°å¹é
ç产è½è§åæ°æ®ï¼è®¾ç½®é»è®¤ç¶æ |
| | | if (statistics.getProductionDayWeldSeam() == null) { |
| | | statistics.setProductionDayWeldSeam(BigDecimal.ZERO); |
| | | } |
| | | |
| | | // æåç»ä¸è®¡ç®isSatisfyï¼æ¯å¦æ»¡è¶³ï¼ |
| | | // å½ç产æ¥çç¼ >= éæ±æ¥çç¼æ¶ä¸ºæ»¡è¶³ï¼å¦åä¸ºä¸æ»¡è¶³ |
| | | if (statistics.getRequirementDayWeldSeam() != null && |
| | | statistics.getProductionDayWeldSeam() != null && |
| | | statistics.getProductionDayWeldSeam().compareTo(statistics.getRequirementDayWeldSeam()) >= 0) { |
| | | statistics.setIsSatisfy("1"); // 满足 |
| | | } else { |
| | | statistics.setIsSatisfy("0"); // 䏿»¡è¶³ |
| | | } |
| | | } |
| | | |
| | | // 4. æ¹éæå
¥æ°æ® |
| | | int count = 0; |
| | | if (!statisticsList.isEmpty()) { |
| | | count = apsWeldSeamStatisticsV2Mapper.batchInsert(statisticsList); |
| | | } |
| | | |
| | | return count; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.aps.core.mapper.ApsGasPipelineMoMapper"> |
| | | |
| | | <resultMap type="com.aps.core.domain.ApsGasPipelineMo" id="ApsGasPipelineMoResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="mo" column="mo" /> |
| | | <result property="factory" column="factory" /> |
| | | <result property="materialCode" column="material_code" /> |
| | | <result property="planEnd" column="plan_end" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="quantity" column="quantity" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectApsGasPipelineMoVo"> |
| | | select id, mo, factory, material_code, plan_end, create_by, create_time, update_by, update_time, quantity from aps_gas_pipeline_mo |
| | | </sql> |
| | | |
| | | <select id="selectApsGasPipelineMoList" parameterType="ApsGasPipelineMo" resultMap="ApsGasPipelineMoResult"> |
| | | <include refid="selectApsGasPipelineMoVo"/> |
| | | <where> |
| | | <if test="mo != null and mo != ''"> and mo = #{mo}</if> |
| | | <if test="factory != null and factory != ''"> and factory = #{factory}</if> |
| | | <if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if> |
| | | <if test="planEnd != null and planEnd != ''"> and plan_end = #{planEnd}</if> |
| | | <if test="quantity != null and quantity != ''"> and quantity = #{quantity}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectApsGasPipelineMoById" parameterType="Long" resultMap="ApsGasPipelineMoResult"> |
| | | </select> |
| | | |
| | | <insert id="insertApsGasPipelineMo" parameterType="ApsGasPipelineMo"> |
| | | insert into aps_gas_pipeline_mo |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="mo != null">mo,</if> |
| | | <if test="factory != null">factory,</if> |
| | | <if test="materialCode != null">material_code,</if> |
| | | <if test="planEnd != null">plan_end,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="quantity != null">quantity,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="mo != null">#{mo},</if> |
| | | <if test="factory != null">#{factory},</if> |
| | | <if test="materialCode != null">#{materialCode},</if> |
| | | <if test="planEnd != null">#{planEnd},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="quantity != null">#{quantity},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsGasPipelineMo" parameterType="ApsGasPipelineMo"> |
| | | update aps_gas_pipeline_mo |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="mo != null">mo = #{mo},</if> |
| | | <if test="factory != null">factory = #{factory},</if> |
| | | <if test="materialCode != null">material_code = #{materialCode},</if> |
| | | <if test="planEnd != null">plan_end = #{planEnd},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="quantity != null">quantity = #{quantity},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteApsGasPipelineMoById" parameterType="Long"> |
| | | delete from aps_gas_pipeline_mo where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteAll"> |
| | | delete from aps_gas_pipeline_mo |
| | | </delete> |
| | | |
| | | <delete id="deleteApsGasPipelineMoByIds" parameterType="String"> |
| | | delete from aps_gas_pipeline_mo where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.aps.core.mapper.ApsGasPipelinePredictionMapper"> |
| | | |
| | | <resultMap type="com.aps.core.domain.ApsGasPipelinePrediction" id="ApsGasPipelinePredictionResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="factory" column="factory" /> |
| | | <result property="materialCode" column="material_code" /> |
| | | <result property="predictDate" column="predict_date" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="predictQuantity" column="predict_quantity" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectApsGasPipelinePredictionVo"> |
| | | select id, factory, material_code, predict_date, create_by, create_time, update_by, update_time, predict_quantity from aps_gas_pipeline_prediction |
| | | </sql> |
| | | |
| | | <select id="selectApsGasPipelinePredictionList" parameterType="ApsGasPipelinePrediction" resultMap="ApsGasPipelinePredictionResult"> |
| | | <include refid="selectApsGasPipelinePredictionVo"/> |
| | | <where> |
| | | <if test="factory != null and factory != ''"> and factory = #{factory}</if> |
| | | <if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if> |
| | | <if test="predictDate != null and predictDate != ''"> and predict_date = #{predictDate}</if> |
| | | <if test="predictQuantity != null and predictQuantity != ''"> and predict_quantity = #{predictQuantity}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectApsGasPipelinePredictionById" parameterType="Long" resultMap="ApsGasPipelinePredictionResult"> |
| | | </select> |
| | | |
| | | <insert id="insertApsGasPipelinePrediction" parameterType="ApsGasPipelinePrediction"> |
| | | insert into aps_gas_pipeline_prediction |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="factory != null">factory,</if> |
| | | <if test="materialCode != null">material_code,</if> |
| | | <if test="predictDate != null">predict_date,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="predictQuantity != null">predict_quantity,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="factory != null">#{factory},</if> |
| | | <if test="materialCode != null">#{materialCode},</if> |
| | | <if test="predictDate != null">#{predictDate},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="predictQuantity != null">#{predictQuantity},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsGasPipelinePrediction" parameterType="ApsGasPipelinePrediction"> |
| | | update aps_gas_pipeline_prediction |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="factory != null">factory = #{factory},</if> |
| | | <if test="materialCode != null">material_code = #{materialCode},</if> |
| | | <if test="predictDate != null">predict_date = #{predictDate},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="predictQuantity != null">predict_quantity = #{predictQuantity},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteApsGasPipelinePredictionById" parameterType="Long"> |
| | | delete from aps_gas_pipeline_prediction where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteApsGasPipelinePredictionByIds" parameterType="String"> |
| | | delete from aps_gas_pipeline_prediction where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <delete id="deleteAll" > |
| | | delete from aps_gas_pipeline_prediction |
| | | </delete> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.aps.core.mapper.ApsMaterialProductGroupManagementMapper"> |
| | | |
| | | <resultMap type="com.aps.core.domain.ApsMaterialProductGroupManagement" id="ApsMaterialProductGroupManagementResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="factory" column="factory" /> |
| | | <result property="materialCode" column="material_code" /> |
| | | <result property="domain" column="domain" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="isMain" column="is_main" /> |
| | | <result property="materialType" column="material_type" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectApsMaterialProductGroupManagementVo"> |
| | | select id, factory, material_code, domain, create_by, create_time, update_by, update_time, is_main, material_type from aps_material_product_group_management |
| | | </sql> |
| | | |
| | | <select id="selectApsMaterialProductGroupManagementList" parameterType="ApsMaterialProductGroupManagement" resultMap="ApsMaterialProductGroupManagementResult"> |
| | | <include refid="selectApsMaterialProductGroupManagementVo"/> |
| | | <where> |
| | | <if test="factory != null and factory != ''"> and factory = #{factory}</if> |
| | | <if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if> |
| | | <if test="domain != null and domain != ''"> and domain = #{domain}</if> |
| | | <if test="isMain != null and isMain != ''"> and is_main = #{isMain}</if> |
| | | <if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectApsMaterialProductGroupManagementById" parameterType="Long" resultMap="ApsMaterialProductGroupManagementResult"> |
| | | </select> |
| | | |
| | | <insert id="insertApsMaterialProductGroupManagement" parameterType="ApsMaterialProductGroupManagement"> |
| | | insert into aps_material_product_group_management |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="factory != null">factory,</if> |
| | | <if test="materialCode != null">material_code,</if> |
| | | <if test="domain != null">domain,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="isMain != null">is_main,</if> |
| | | <if test="materialType != null">material_type,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="factory != null">#{factory},</if> |
| | | <if test="materialCode != null">#{materialCode},</if> |
| | | <if test="domain != null">#{domain},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="isMain != null">#{isMain},</if> |
| | | <if test="materialType != null">#{materialType},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsMaterialProductGroupManagement" parameterType="ApsMaterialProductGroupManagement"> |
| | | update aps_material_product_group_management |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="factory != null">factory = #{factory},</if> |
| | | <if test="materialCode != null">material_code = #{materialCode},</if> |
| | | <if test="domain != null">domain = #{domain},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="isMain != null">is_main = #{isMain},</if> |
| | | <if test="materialType != null">material_type = #{materialType},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteApsMaterialProductGroupManagementById" parameterType="Long"> |
| | | delete from aps_material_product_group_management where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteApsMaterialProductGroupManagementByIds" parameterType="String"> |
| | | delete from aps_material_product_group_management where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <delete id="deleteAll" parameterType="String"> |
| | | delete from aps_material_product_group_management |
| | | </delete> |
| | | </mapper> |
| | |
| | | </update> |
| | | |
| | | <select id="selectPlatePlanByPlantMajor" parameterType="com.aps.core.domain.ApsPlate.ApsPlatePlan" resultMap="ApsPlatePlanResult"> |
| | | select id,document_number,main_part_number,item_number,plant,professional_affiliation,production_quantity,require_id, |
| | | unmatched_quantity,version, production_base,plan_end_day,order_create_time,low_order_code |
| | | from aps_plate_plan |
| | | <where> |
| | | <if test="plant != null "> and plant = #{plant} </if> |
| | | <if test="professionalAffiliation != null "> and professional_affiliation = 'main' </if> |
| | | and del_flag='0' |
| | | </where> |
| | | order by document_number asc,id asc |
| | | with rd as ( |
| | | select doc_no,require_date from aps_plate_require_date where del_flag=0 |
| | | ) |
| | | select |
| | | app.id,app.document_number,app.main_part_number,app.item_number,app.plant,app.professional_affiliation,app.production_quantity,app.require_id, |
| | | app.unmatched_quantity,app.version, app.production_base,app.order_create_time,app.low_order_code, |
| | | app.plan_end_day as orign_end_day, |
| | | COALESCE(rd.require_date,app.plan_end_day) as plan_end_day |
| | | from aps_plate_plan as app |
| | | left join rd on app.document_number=rd.doc_no |
| | | where app.del_flag='0' and app.professional_affiliation = 'main' |
| | | <if test="plant != null "> and plant = #{plant} </if> |
| | | order by document_number ,id |
| | | </select> |
| | | |
| | | <select id="selectUnMatchPlateSubPlan" parameterType="com.aps.core.domain.ApsPlate.ApsPlatePlan" resultMap="ApsPlatePlanResult"> |
| | |
| | | </delete> |
| | | |
| | | <select id="queryTempStat" resultMap="ApsPlateProcessStatResult"> |
| | | with dt as ( select doc_no,require_date from aps_plate_require_date where del_flag=0), |
| | | rd as ( select doc_no,plan_end_day from aps_plate_standard_require_order_end_day where del_flag=0) |
| | | select row_number() over (partition by rt.work_order_no order by rt.process_number desc ) as num, |
| | | rt.work_order_no, |
| | | rt.work_order_no, |
| | | rt.process_name, |
| | | cast(rt.process_number as numeric(18, 2)) as route_process_number, |
| | | cast(pl.process_number as numeric(18, 2)) as current_process_number, |
| | |
| | | rt.process_plan_start_day, |
| | | rt.process_plan_end_day, |
| | | pl.plan_end_day, |
| | | COALESCE(rd.plan_end_day,pl.plan_end_day) as order_plan_end_day |
| | | rd.plan_end_day as modify_day, |
| | | dt.require_date, |
| | | COALESCE(rd.plan_end_day, COALESCE(dt.require_date, pl.plan_end_day) ) as order_plan_end_day |
| | | from aps_plate_plan as pl |
| | | left join aps_process_route as rt on pl.document_number = rt.work_order_no |
| | | left join aps_plate_standard_require_order_end_day as rd on pl.document_number = rd.doc_no and rd.del_flag =0 |
| | | where pl.document_number is not null and rt.work_order_no is not null and |
| | | (pl.plan_end_day is not null or rd.plan_end_day is not null ) |
| | | order by rt.work_order_no asc, rt.process_number desc |
| | | left join rd on pl.document_number = rd.doc_no |
| | | left join dt on pl.document_number=dt.doc_no |
| | | where pl.document_number is not null |
| | | and rt.work_order_no is not null |
| | | order by rt.work_order_no, rt.process_number desc |
| | | </select> |
| | | <update id="removeOtherStat" parameterType="String"> |
| | | delete from aps_plate_process_stat where batch_number != #{batchNumber} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.aps.core.mapper.ApsPlateRequireDateMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.aps.core.domain.ApsPlate.ApsPlateRequireDate"> |
| | | <id property="id" column="id" /> |
| | | <result property="planId" column="plan_id" /> |
| | | <result property="docNo" column="doc_no" /> |
| | | <result property="requireDate" column="require_date" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,plan_id,doc_no,require_date,del_flag,create_by, |
| | | create_time,update_by,update_time |
| | | </sql> |
| | | |
| | | <update id="deleteByDocNoList" parameterType="String"> |
| | | update aps_plate_require_date |
| | | set del_flag = 1, update_time = now(),update_by=#{updateBy} |
| | | where doc_no in |
| | | <foreach collection="list" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </update> |
| | | |
| | | <insert id="batchInsert" parameterType="com.aps.core.domain.ApsPlate.ApsPlateRequireDate"> |
| | | insert into aps_plate_require_date |
| | | (id,plan_id,doc_no,require_date,del_flag,create_by,create_time) |
| | | values |
| | | <foreach item="item" collection="list" separator="," index="index"> |
| | | (#{item.id},#{item.planId},#{item.docNo},#{item.requireDate},0,#{item.createBy},now()) |
| | | </foreach> |
| | | </insert> |
| | | </mapper> |
| | |
| | | from a |
| | | |
| | | </insert> |
| | | <update id="batchRemove" parameterType="Long"> |
| | | <update id="batchRemoveByPlanId" parameterType="Long"> |
| | | update aps_plate_standard_require_order_end_day |
| | | set del_flag=1 |
| | | where plan_id in |
| | |
| | | #{planId} |
| | | </foreach> |
| | | </update> |
| | | <update id="batchRemove" > |
| | | update aps_plate_standard_require_order_end_day |
| | | set del_flag=1 |
| | | where del_flag=0 |
| | | </update> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.aps.core.mapper.mainPlan.ApsWeldSeamStatisticsV2Mapper"> |
| | | |
| | | <resultMap type="com.aps.core.domain.mainPlan.ApsWeldSeamStatisticsV2" id="ApsWeldSeamStatisticsV2Result"> |
| | | <id property="id" column="id"/> |
| | | <result property="year" column="year"/> |
| | | <result property="month" column="month"/> |
| | | <result property="productionBase" column="production_base"/> |
| | | <result property="pipingOrderRequirement" column="piping_order_requirement"/> |
| | | <result property="gasOrderRequirement" column="gas_order_requirement"/> |
| | | <result property="pipingPredictionRequirement" column="piping_prediction_requirement"/> |
| | | <result property="gasPredictionRequirement" column="gas_prediction_requirement"/> |
| | | <result property="reserveEmergencyOrderOutput" column="reserve_emergency_order_output"/> |
| | | <result property="total" column="total"/> |
| | | <result property="days" column="days"/> |
| | | <result property="requirementDayWeldSeam" column="requirement_day_weld_seam"/> |
| | | <result property="productionDayWeldSeam" column="production_day_weld_seam"/> |
| | | <result property="isSatisfy" column="is_satisfy"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectApsWeldSeamStatisticsV2Vo"> |
| | | select id, year, month, production_base, piping_order_requirement, gas_order_requirement, |
| | | piping_prediction_requirement, gas_prediction_requirement, reserve_emergency_order_output, |
| | | total, days, requirement_day_weld_seam, production_day_weld_seam, is_satisfy, |
| | | create_by, create_time, update_by, update_time |
| | | from aps_weld_seam_statistics_v2 |
| | | </sql> |
| | | |
| | | <select id="selectApsWeldSeamStatisticsV2ById" parameterType="String" resultMap="ApsWeldSeamStatisticsV2Result"> |
| | | <include refid="selectApsWeldSeamStatisticsV2Vo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectApsWeldSeamStatisticsV2List" parameterType="com.aps.core.domain.mainPlan.ApsWeldSeamStatisticsV2" resultMap="ApsWeldSeamStatisticsV2Result"> |
| | | <include refid="selectApsWeldSeamStatisticsV2Vo"/> |
| | | <where> |
| | | <if test="params.beginYear != null and params.beginYear != '' and params.endYear != null and params.endYear != ''"> and year between #{params.beginYear} and #{params.endYear}</if> |
| | | <if test="params.beginMonth != null and params.beginMonth != '' and params.endMonth != null and params.endMonth != ''"> and month between #{params.beginMonth} and #{params.endMonth}</if> |
| | | <if test="productionBase != null and productionBase != ''"> and production_base like '%'|| #{productionBase}|| '%'</if> |
| | | </where> |
| | | order by year, month, production_base |
| | | </select> |
| | | |
| | | <insert id="insertApsWeldSeamStatisticsV2" parameterType="com.aps.core.domain.mainPlan.ApsWeldSeamStatisticsV2"> |
| | | insert into aps_weld_seam_statistics_v2 |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="year != null">year,</if> |
| | | <if test="month != null">month,</if> |
| | | <if test="productionBase != null">production_base,</if> |
| | | <if test="pipingOrderRequirement != null">piping_order_requirement,</if> |
| | | <if test="gasOrderRequirement != null">gas_order_requirement,</if> |
| | | <if test="pipingPredictionRequirement != null">piping_prediction_requirement,</if> |
| | | <if test="gasPredictionRequirement != null">gas_prediction_requirement,</if> |
| | | <if test="reserveEmergencyOrderOutput != null">reserve_emergency_order_output,</if> |
| | | <if test="total != null">total,</if> |
| | | <if test="days != null">days,</if> |
| | | <if test="requirementDayWeldSeam != null">requirement_day_weld_seam,</if> |
| | | <if test="productionDayWeldSeam != null">production_day_weld_seam,</if> |
| | | <if test="isSatisfy != null">is_satisfy,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="year != null">#{year},</if> |
| | | <if test="month != null">#{month},</if> |
| | | <if test="productionBase != null">#{productionBase},</if> |
| | | <if test="pipingOrderRequirement != null">#{pipingOrderRequirement},</if> |
| | | <if test="gasOrderRequirement != null">#{gasOrderRequirement},</if> |
| | | <if test="pipingPredictionRequirement != null">#{pipingPredictionRequirement},</if> |
| | | <if test="gasPredictionRequirement != null">#{gasPredictionRequirement},</if> |
| | | <if test="reserveEmergencyOrderOutput != null">#{reserveEmergencyOrderOutput},</if> |
| | | <if test="total != null">#{total},</if> |
| | | <if test="days != null">#{days},</if> |
| | | <if test="requirementDayWeldSeam != null">#{requirementDayWeldSeam},</if> |
| | | <if test="productionDayWeldSeam != null">#{productionDayWeldSeam},</if> |
| | | <if test="isSatisfy != null">#{isSatisfy},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsWeldSeamStatisticsV2" parameterType="com.aps.core.domain.mainPlan.ApsWeldSeamStatisticsV2"> |
| | | update aps_weld_seam_statistics_v2 |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="year != null">year = #{year},</if> |
| | | <if test="month != null">month = #{month},</if> |
| | | <if test="productionBase != null">production_base = #{productionBase},</if> |
| | | <if test="pipingOrderRequirement != null">piping_order_requirement = #{pipingOrderRequirement},</if> |
| | | <if test="gasOrderRequirement != null">gas_order_requirement = #{gasOrderRequirement},</if> |
| | | <if test="pipingPredictionRequirement != null">piping_prediction_requirement = #{pipingPredictionRequirement},</if> |
| | | <if test="gasPredictionRequirement != null">gas_prediction_requirement = #{gasPredictionRequirement},</if> |
| | | <if test="reserveEmergencyOrderOutput != null">reserve_emergency_order_output = #{reserveEmergencyOrderOutput},</if> |
| | | <if test="total != null">total = #{total},</if> |
| | | <if test="days != null">days = #{days},</if> |
| | | <if test="requirementDayWeldSeam != null">requirement_day_weld_seam = #{requirementDayWeldSeam},</if> |
| | | <if test="productionDayWeldSeam != null">production_day_weld_seam = #{productionDayWeldSeam},</if> |
| | | <if test="isSatisfy != null">is_satisfy = #{isSatisfy},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteApsWeldSeamStatisticsV2ById" parameterType="String"> |
| | | delete from aps_weld_seam_statistics_v2 where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteApsWeldSeamStatisticsV2ByIds" parameterType="String"> |
| | | delete from aps_weld_seam_statistics_v2 where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <update id="truncateTable"> |
| | | TRUNCATE TABLE aps_weld_seam_statistics_v2 |
| | | </update> |
| | | |
| | | <insert id="batchInsert" parameterType="java.util.List"> |
| | | INSERT INTO aps_weld_seam_statistics_v2 ( |
| | | id, year, month, production_base, |
| | | piping_order_requirement, gas_order_requirement, |
| | | piping_prediction_requirement, gas_prediction_requirement, |
| | | reserve_emergency_order_output, total, days, |
| | | requirement_day_weld_seam, production_day_weld_seam, |
| | | is_satisfy, create_by, create_time |
| | | ) VALUES |
| | | <foreach collection="list" item="item" separator=","> |
| | | ( |
| | | #{item.id}, #{item.year}, #{item.month}, #{item.productionBase}, |
| | | #{item.pipingOrderRequirement}, #{item.gasOrderRequirement}, |
| | | #{item.pipingPredictionRequirement}, #{item.gasPredictionRequirement}, |
| | | #{item.reserveEmergencyOrderOutput}, #{item.total}, #{item.days}, |
| | | #{item.requirementDayWeldSeam}, #{item.productionDayWeldSeam}, |
| | | #{item.isSatisfy}, #{item.createBy}, #{item.createTime} |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <select id="queryWeldSeamStatistics" resultMap="ApsWeldSeamStatisticsV2Result"> |
| | | WITH å·¥åçç¼è®¡ç® AS ( |
| | | -- 计ç®å·¥åççç¼æ°é |
| | | SELECT |
| | | mo.factory as ç产åºå°, |
| | | mo.material_code as æå·, |
| | | EXTRACT(YEAR FROM mo.plan_end) as 年份, |
| | | EXTRACT(MONTH FROM mo.plan_end) as æä»½, |
| | | mo.quantity * COALESCE(ws.hup_qty, 0) as å·¥åçç¼æ°, |
| | | mgm.domain as ä¸ä¸ |
| | | FROM aps_gas_pipeline_mo mo |
| | | LEFT JOIN aps_weld_seam_standard ws ON mo.material_code = ws.item_code AND ws.del_flag = 0 |
| | | LEFT JOIN aps_material_product_group_management mgm ON mo.material_code = mgm.material_code |
| | | ), |
| | | 颿µçç¼è®¡ç® AS ( |
| | | -- 计ç®é¢æµççç¼æ°é |
| | | SELECT |
| | | gp.factory as ç产åºå°, |
| | | gp.material_code as æå·, |
| | | EXTRACT(YEAR FROM gp.predict_date) as 年份, |
| | | EXTRACT(MONTH FROM gp.predict_date) as æä»½, |
| | | gp.predict_quantity * COALESCE(ws.hup_qty, 0) as 颿µçç¼æ°, |
| | | mgm.domain as ä¸ä¸ |
| | | FROM aps_gas_pipeline_prediction gp |
| | | LEFT JOIN aps_weld_seam_standard ws ON gp.material_code = ws.item_code AND ws.del_flag = 0 |
| | | LEFT JOIN aps_material_product_group_management mgm ON gp.material_code = mgm.material_code |
| | | ), |
| | | æ±æ»æ°æ® AS ( |
| | | SELECT |
| | | 年份, |
| | | æä»½, |
| | | ç产åºå°, |
| | | -- 管路订åéæ± |
| | | COALESCE(SUM(CASE |
| | | WHEN ä¸ä¸ = 'GL' AND ç±»å = 'å·¥å' |
| | | THEN çç¼æ° ELSE 0 |
| | | END), 0) as 管路订åéæ±, |
| | | -- æ°æè®¢åéæ± |
| | | COALESCE(SUM(CASE |
| | | WHEN ä¸ä¸ = 'QG' AND ç±»å = 'å·¥å' |
| | | THEN çç¼æ° ELSE 0 |
| | | END), 0) as æ°æè®¢åéæ±, |
| | | -- ç®¡è·¯é¢æµéæ± |
| | | COALESCE(SUM(CASE |
| | | WHEN ä¸ä¸ = 'GL' AND ç±»å = '颿µ' |
| | | THEN çç¼æ° ELSE 0 |
| | | END), 0) as ç®¡è·¯é¢æµéæ±, |
| | | -- æ°æé¢æµéæ± |
| | | COALESCE(SUM(CASE |
| | | WHEN ä¸ä¸ = 'QG' AND ç±»å = '颿µ' |
| | | THEN çç¼æ° ELSE 0 |
| | | END), 0) as æ°æé¢æµéæ± |
| | | FROM ( |
| | | SELECT |
| | | 年份, |
| | | æä»½, |
| | | ç产åºå°, |
| | | å·¥åçç¼æ° as çç¼æ°, |
| | | 'å·¥å' as ç±»å, |
| | | ä¸ä¸ |
| | | FROM å·¥åçç¼è®¡ç® |
| | | UNION ALL |
| | | SELECT |
| | | 年份, |
| | | æä»½, |
| | | ç产åºå°, |
| | | 颿µçç¼æ° as çç¼æ°, |
| | | '颿µ' as ç±»å, |
| | | ä¸ä¸ |
| | | FROM 颿µçç¼è®¡ç® |
| | | ) åå¹¶æ°æ® |
| | | GROUP BY 年份, æä»½, ç产åºå° |
| | | ) |
| | | SELECT |
| | | s.年份 as "year", |
| | | s.æä»½ as "month", |
| | | s.ç产åºå° as "production_base", |
| | | ROUND(s.管路订åéæ±, 4) as "piping_order_requirement", |
| | | ROUND(s.æ°æè®¢åéæ±, 4) as "gas_order_requirement", |
| | | ROUND(s.ç®¡è·¯é¢æµéæ±, 4) as "piping_prediction_requirement", |
| | | ROUND(s.æ°æé¢æµéæ±, 4) as "gas_prediction_requirement", |
| | | 0 as "reserve_emergency_order_output", |
| | | ROUND(s.管路订åéæ± + s.æ°æè®¢åéæ± + s.ç®¡è·¯é¢æµéæ± + s.æ°æé¢æµéæ±, 4) as "total", |
| | | 0 as "days", |
| | | 0 as "requirement_day_weld_seam", |
| | | 0 as "production_day_weld_seam", |
| | | '0' as "is_satisfy", |
| | | 'system' as "create_by", |
| | | CURRENT_TIMESTAMP as "create_time" |
| | | FROM æ±æ»æ°æ® s |
| | | ORDER BY s.年份, s.æä»½, s.ç产åºå° |
| | | </select> |
| | | </mapper> |