【ADD】1.新增同步物料库存数据任务 2.增加刷新BOM数据功能代码
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.system.api; |
| | | |
| | | import com.aps.common.core.constant.SecurityConstants; |
| | | import com.aps.common.core.constant.ServiceNameConstants; |
| | | import com.aps.common.core.domain.R; |
| | | import com.aps.system.api.factory.RemoteCoreFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestHeader; |
| | | |
| | | /** |
| | | * ä»»å¡æå¡ |
| | | * |
| | | * @author hjy |
| | | */ |
| | | @FeignClient(contextId = "remoteCoreService", value = ServiceNameConstants.CORE_SERVICE, fallbackFactory = RemoteCoreFallbackFactory.class) |
| | | public interface RemoteCoreService |
| | | { |
| | | |
| | | /** |
| | | * å·æ°BOMæ°æ®å°Redis |
| | | * @param source |
| | | * @return |
| | | */ |
| | | @PostMapping("/ApsBomHeader/setBomDataToRedis") |
| | | R<Boolean> setBomDataToRedis(@RequestHeader(SecurityConstants.FROM_SOURCE) String source); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.system.api; |
| | | |
| | | import com.aps.common.core.constant.SecurityConstants; |
| | | import com.aps.common.core.constant.ServiceNameConstants; |
| | | import com.aps.common.core.domain.R; |
| | | import com.aps.system.api.factory.RemoteJobFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestHeader; |
| | | |
| | | /** |
| | | * ä»»å¡æå¡ |
| | | * |
| | | * @author hjy |
| | | */ |
| | | @FeignClient(contextId = "remoteJobService", value = ServiceNameConstants.JOB_SERVICE, fallbackFactory = RemoteJobFallbackFactory.class) |
| | | public interface RemoteJobService |
| | | { |
| | | |
| | | /** |
| | | * å·æ°BOMå
¨éæ°æ® |
| | | * @param source |
| | | * @return |
| | | */ |
| | | @PostMapping("/job/refreshBomData") |
| | | R<Boolean> refreshBomData(@RequestHeader(SecurityConstants.FROM_SOURCE) String source); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.system.api.factory; |
| | | |
| | | import com.aps.common.core.domain.R; |
| | | import com.aps.system.api.RemoteCoreService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * ç¨æ·æå¡é级å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public class RemoteCoreFallbackFactory implements FallbackFactory<RemoteCoreService> |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(RemoteCoreFallbackFactory.class); |
| | | |
| | | @Override |
| | | public RemoteCoreService create(Throwable throwable) |
| | | { |
| | | log.error("任塿å¡è°ç¨å¤±è´¥:{}", throwable.getMessage()); |
| | | return source -> R.fail("BOMæ°æ®åå¨å°Redisä¸å¤±è´¥:" + throwable.getMessage()); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.system.api.factory; |
| | | |
| | | import com.aps.common.core.domain.R; |
| | | import com.aps.system.api.RemoteJobService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * ç¨æ·æå¡é级å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public class RemoteJobFallbackFactory implements FallbackFactory<RemoteJobService> |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(RemoteJobFallbackFactory.class); |
| | | |
| | | @Override |
| | | public RemoteJobService create(Throwable throwable) |
| | | { |
| | | log.error("任塿å¡è°ç¨å¤±è´¥:{}", throwable.getMessage()); |
| | | return source -> R.fail("å·æ°BOMæ°æ®å¤±è´¥:" + throwable.getMessage()); |
| | | } |
| | | } |
| | |
| | | com.aps.system.api.factory.RemoteUserFallbackFactory |
| | | com.aps.system.api.factory.RemoteLogFallbackFactory |
| | | com.aps.system.api.factory.RemoteFileFallbackFactory |
| | | com.aps.system.api.factory.RemoteJobFallbackFactory |
| | | com.aps.system.api.factory.RemoteCoreFallbackFactory |
| | |
| | | * æä»¶æå¡çserviceid |
| | | */ |
| | | public static final String FILE_SERVICE = "aps-file"; |
| | | |
| | | /** |
| | | * apsæå¡çserviceid |
| | | */ |
| | | public static final String CORE_SERVICE = "aps-core"; |
| | | |
| | | /** |
| | | * 任塿å¡çserviceid |
| | | */ |
| | | public static final String JOB_SERVICE = "aps-job"; |
| | | } |
| | |
| | | /** |
| | | * æ¥è¯¢BOMæ°æ®ç®¡çå表 |
| | | */ |
| | | @RequiresPermissions("apsBom:list") |
| | | @RequiresPermissions("Aps:apsBom:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ApsBom apsBom) |
| | | { |
| | |
| | | /** |
| | | * 导åºBOMæ°æ®ç®¡çå表 |
| | | */ |
| | | @RequiresPermissions("apsBom:export") |
| | | @RequiresPermissions("Aps:apsBom:export") |
| | | @Log(title = "BOMæ°æ®ç®¡ç", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ApsBom apsBom) |
| | |
| | | /** |
| | | * è·åBOMæ°æ®ç®¡ç详ç»ä¿¡æ¯ |
| | | */ |
| | | @RequiresPermissions("apsBom:query") |
| | | @RequiresPermissions("Aps:apsBom:query") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | |
| | | /** |
| | | * æ°å¢BOMæ°æ®ç®¡ç |
| | | */ |
| | | @RequiresPermissions("apsBom:add") |
| | | @RequiresPermissions("Aps:apsBom:add") |
| | | @Log(title = "BOMæ°æ®ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ApsBom apsBom) |
| | |
| | | /** |
| | | * ä¿®æ¹BOMæ°æ®ç®¡ç |
| | | */ |
| | | @RequiresPermissions("apsBom:edit") |
| | | @RequiresPermissions("Aps:apsBom:edit") |
| | | @Log(title = "BOMæ°æ®ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ApsBom apsBom) |
| | |
| | | /** |
| | | * å é¤BOMæ°æ®ç®¡ç |
| | | */ |
| | | @RequiresPermissions("apsBom:remove") |
| | | @RequiresPermissions("Aps:apsBom:remove") |
| | | @Log(title = "BOMæ°æ®ç®¡ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | |
| | | package com.aps.core.controller.mainPlan; |
| | | |
| | | import com.aps.common.core.constant.SecurityConstants; |
| | | import com.aps.common.core.domain.R; |
| | | 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.security.annotation.RequiresPermissions; |
| | | import com.aps.core.domain.ApsBomHeader; |
| | | import com.aps.core.service.IApsBomHeaderService; |
| | | import com.aps.system.api.RemoteJobService; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @Autowired |
| | | private IApsBomHeaderService apsBomHeaderService; |
| | | |
| | | @Autowired |
| | | private RemoteJobService remoteJobService; |
| | | |
| | | /** |
| | | * æ¥è¯¢BOM Header æ°æ®ç®¡çå表 |
| | | */ |
| | | |
| | | @RequiresPermissions("aps:ApsBomHeader:list") |
| | | @RequiresPermissions("Aps:ApsBomHeader:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ApsBomHeader apsBomHeader) |
| | | { |
| | |
| | | return toAjax(apsBomHeaderService.deleteApsBomHeaderByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | * å·æ°å
¨éBOMæ°æ® |
| | | */ |
| | | @RequiresPermissions("Aps:ApsBomHeader:refreshBomData") |
| | | @PostMapping("/refreshBomData") |
| | | public void refreshBomData() |
| | | { |
| | | R<Boolean> res = remoteJobService.refreshBomData(SecurityConstants.INNER); |
| | | if (R.isSuccess(res)) |
| | | { |
| | | apsBomHeaderService.setBomDataToRedis(""); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/setBomDataToRedis") |
| | | public void setBomDataToRedis() |
| | | { |
| | | apsBomHeaderService.setBomDataToRedis(""); |
| | | } |
| | | |
| | | @PostMapping("/test") |
| | | public void test() |
| | | { |
| | |
| | | */ |
| | | |
| | | @Operation(summary = "æ¥è¯¢é£éæ åéæ±å¼å¸¸ä¿¡æ¯å表", description = "å页æ¥è¯¢") |
| | | //@RequiresPermissions("ApsPlateStandardRequireError:ApsPlateStandardRequireError:list") |
| | | @RequiresPermissions("Aps:ApsPlateStandardRequireError:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ApsPlateStandardRequireError apsPlateStandardRequireError) |
| | | { |
| | |
| | | * 导åºé£éæ åéæ±å¼å¸¸ä¿¡æ¯å表 |
| | | */ |
| | | @Operation(summary = "导åºé£éæ åéæ±å¼å¸¸ä¿¡æ¯å表", description = "导åº") |
| | | //@RequiresPermissions("ApsPlateStandardRequireError:ApsPlateStandardRequireError:export") |
| | | @RequiresPermissions("Aps:ApsPlateStandardRequireError:export") |
| | | @Log(title = "é£éæ åéæ±å¼å¸¸ä¿¡æ¯", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ApsPlateStandardRequireError apsPlateStandardRequireError) |
| | |
| | | * è·åé£éæ åéæ±å¼å¸¸ä¿¡æ¯è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "è·åé£éæ åéæ±å¼å¸¸ä¿¡æ¯è¯¦ç»ä¿¡æ¯", description = "æ ¹æ®idè·å") |
| | | //@RequiresPermissions("ApsPlateStandardRequireError:ApsPlateStandardRequireError:query") |
| | | @RequiresPermissions("Aps:ApsPlateStandardRequireError:query") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | |
| | | * æ°å¢é£éæ åéæ±å¼å¸¸ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "æ°å¢é£éæ åéæ±å¼å¸¸ä¿¡æ¯", description = "å个æ°å¢") |
| | | //@RequiresPermissions("ApsPlateStandardRequireError:ApsPlateStandardRequireError:add") |
| | | @RequiresPermissions("Aps:ApsPlateStandardRequireError:add") |
| | | @Log(title = "é£éæ åéæ±å¼å¸¸ä¿¡æ¯", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ApsPlateStandardRequireError apsPlateStandardRequireError) |
| | |
| | | * ä¿®æ¹é£éæ åéæ±å¼å¸¸ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹é£éæ åéæ±å¼å¸¸ä¿¡æ¯", description = "å个修æ¹") |
| | | //@RequiresPermissions("ApsPlateStandardRequireError:ApsPlateStandardRequireError:edit") |
| | | @RequiresPermissions("Aps:ApsPlateStandardRequireError:edit") |
| | | @Log(title = "é£éæ åéæ±å¼å¸¸ä¿¡æ¯", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ApsPlateStandardRequireError apsPlateStandardRequireError) |
| | |
| | | * å é¤é£éæ åéæ±å¼å¸¸ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "å é¤é£éæ åéæ±å¼å¸¸ä¿¡æ¯", description = "æ¹éå é¤") |
| | | // @RequiresPermissions("ApsPlateStandardRequireError:ApsPlateStandardRequireError:remove") |
| | | @RequiresPermissions("Aps:ApsPlateStandardRequireError:remove") |
| | | @Log(title = "é£éæ åéæ±å¼å¸¸ä¿¡æ¯", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | |
| | | * æ¥è¯¢æ åå·¥èºè·¯çº¿Headerå表 |
| | | */ |
| | | |
| | | @RequiresPermissions("aps:ApsStandardProcessRouteHeader:list") |
| | | @RequiresPermissions("Aps:ApsStandardProcessRouteHeader:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ApsStandardProcessRouteHeader apsStandardProcessRouteHeader) |
| | | { |
| | |
| | | * å¯¼åºæ åå·¥èºè·¯çº¿Headerå表 |
| | | */ |
| | | |
| | | @RequiresPermissions("aps:ApsStandardProcessRouteHeader:export") |
| | | @RequiresPermissions("Aps:ApsStandardProcessRouteHeader:export") |
| | | @Log(title = "æ åå·¥èºè·¯çº¿Header", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ApsStandardProcessRouteHeader apsStandardProcessRouteHeader) |
| | |
| | | /** |
| | | * è·åæ åå·¥èºè·¯çº¿Header详ç»ä¿¡æ¯ |
| | | */ |
| | | @RequiresPermissions("aps:ApsStandardProcessRouteHeader:query") |
| | | @RequiresPermissions("Aps:ApsStandardProcessRouteHeader:query") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | |
| | | /** |
| | | * æ°å¢æ åå·¥èºè·¯çº¿Header |
| | | */ |
| | | @RequiresPermissions("aps:ApsStandardProcessRouteHeader:add") |
| | | @RequiresPermissions("Aps:ApsStandardProcessRouteHeader:add") |
| | | @Log(title = "æ åå·¥èºè·¯çº¿Header", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ApsStandardProcessRouteHeader apsStandardProcessRouteHeader) |
| | |
| | | /** |
| | | * ä¿®æ¹æ åå·¥èºè·¯çº¿Header |
| | | */ |
| | | @RequiresPermissions("aps:ApsStandardProcessRouteHeader:edit") |
| | | @RequiresPermissions("Aps:ApsStandardProcessRouteHeader:edit") |
| | | @Log(title = "æ åå·¥èºè·¯çº¿Header", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ApsStandardProcessRouteHeader apsStandardProcessRouteHeader) |
| | |
| | | /** |
| | | * å 餿 åå·¥èºè·¯çº¿Header |
| | | */ |
| | | @RequiresPermissions("aps:ApsStandardProcessRouteHeader:remove") |
| | | @RequiresPermissions("Aps:ApsStandardProcessRouteHeader:remove") |
| | | @Log(title = "æ åå·¥èºè·¯çº¿Header", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | |
| | | /** |
| | | * æ¥è¯¢æ åå·¥èºè·¯çº¿Lineå表 |
| | | */ |
| | | @RequiresPermissions("ApsStandardProcessRouteLine:ApsStandardProcessRouteLine:list") |
| | | @RequiresPermissions("Aps:ApsStandardProcessRouteLine:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ApsStandardProcessRouteLine apsStandardProcessRouteLine) |
| | | { |
| | |
| | | /** |
| | | * å¯¼åºæ åå·¥èºè·¯çº¿Lineå表 |
| | | */ |
| | | @RequiresPermissions("ApsStandardProcessRouteLine:ApsStandardProcessRouteLine:export") |
| | | @RequiresPermissions("Aps:ApsStandardProcessRouteLine:export") |
| | | @Log(title = "æ åå·¥èºè·¯çº¿Line", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ApsStandardProcessRouteLine apsStandardProcessRouteLine) |
| | |
| | | /** |
| | | * è·åæ åå·¥èºè·¯çº¿Line详ç»ä¿¡æ¯ |
| | | */ |
| | | @RequiresPermissions("ApsStandardProcessRouteLine:ApsStandardProcessRouteLine:query") |
| | | @RequiresPermissions("Aps:ApsStandardProcessRouteLine:query") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | |
| | | /** |
| | | * æ°å¢æ åå·¥èºè·¯çº¿Line |
| | | */ |
| | | @RequiresPermissions("ApsStandardProcessRouteLine:ApsStandardProcessRouteLine:add") |
| | | @RequiresPermissions("Aps:ApsStandardProcessRouteLine:add") |
| | | @Log(title = "æ åå·¥èºè·¯çº¿Line", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ApsStandardProcessRouteLine apsStandardProcessRouteLine) |
| | |
| | | /** |
| | | * ä¿®æ¹æ åå·¥èºè·¯çº¿Line |
| | | */ |
| | | @RequiresPermissions("ApsStandardProcessRouteLine:ApsStandardProcessRouteLine:edit") |
| | | @RequiresPermissions("Aps:ApsStandardProcessRouteLine:edit") |
| | | @Log(title = "æ åå·¥èºè·¯çº¿Line", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ApsStandardProcessRouteLine apsStandardProcessRouteLine) |
| | |
| | | /** |
| | | * å 餿 åå·¥èºè·¯çº¿Line |
| | | */ |
| | | @RequiresPermissions("ApsStandardProcessRouteLine:ApsStandardProcessRouteLine:remove") |
| | | @RequiresPermissions("Aps:ApsStandardProcessRouteLine:remove") |
| | | @Log(title = "æ åå·¥èºè·¯çº¿Line", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | |
| | | private BigDecimal netRequirement; |
| | | |
| | | /** 计åå¼å·¥æ¥ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "计åå¼å·¥æ¥") |
| | | private Date startDate; |
| | | |
| | | /** 计åå®å·¥æ¥ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "计åå®å·¥æ¥") |
| | | private Date completeDate; |
| | | |
| | | /** éæ±æ¥æ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "éæ±æ¥æ") |
| | | private Date demandDate; |
| | | |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "å»ºè®®å®ææ¥æ", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date suggestedCompletionDate; |
| | | |
| | | /** å»¶è¿é£é©æ è¯ */ |
| | | private String hasDelayRisk; |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.aps.common.core.constant.Constants; |
| | | import com.aps.common.core.constant.SecurityConstants; |
| | | import com.aps.common.core.exception.job.TaskException; |
| | | import com.aps.common.core.utils.StringUtils; |
| | | import com.aps.common.core.utils.poi.ExcelUtil; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.job.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 org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * ç©æåºå管ç对象 aps_material_storage_management_job |
| | | * |
| | | * @author hjy |
| | | * @date 2025-05-08 |
| | | */ |
| | | @Schema(description = "ç©æåºå管çå®ä½ç±»") |
| | | public class ApsMaterialStorageManagementJob extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** id */ |
| | | @Schema(description = "id") |
| | | private Long id; |
| | | |
| | | /** æå· */ |
| | | @Excel(name = "æå·") |
| | | @Schema(description = "æå·") |
| | | private String itemNumber; |
| | | |
| | | /** æ°é */ |
| | | @Excel(name = "æ°é") |
| | | @Schema(description = "æ°é") |
| | | private BigDecimal num; |
| | | |
| | | /** éç¨å·¥å */ |
| | | @Excel(name = "éç¨å·¥å") |
| | | @Schema(description = "éç¨å·¥å") |
| | | private String applicableFactories; |
| | | |
| | | /** éææ¥æ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "éææ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | @Schema(description = "éææ¥æ") |
| | | private Date integrationDate; |
| | | |
| | | /** å·æ°æ¥æ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "å·æ°æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | @Schema(description = "å·æ°æ¥æ") |
| | | private Date refreshDate; |
| | | |
| | | /** å©ä½åºå */ |
| | | @Excel(name = "å©ä½åºå") |
| | | @Schema(description = "å©ä½åºå") |
| | | private BigDecimal remainderStock; |
| | | |
| | | /** ä¿®æ¹çæ¬ */ |
| | | @Excel(name = "ä¿®æ¹çæ¬") |
| | | @Schema(description = "ä¿®æ¹çæ¬") |
| | | private Double version; |
| | | |
| | | public void setId(Long id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getId() |
| | | { |
| | | return id; |
| | | } |
| | | |
| | | public void setItemNumber(String itemNumber) |
| | | { |
| | | this.itemNumber = itemNumber; |
| | | } |
| | | |
| | | public String getItemNumber() |
| | | { |
| | | return itemNumber; |
| | | } |
| | | |
| | | public void setNum(BigDecimal num) |
| | | { |
| | | this.num = num; |
| | | } |
| | | |
| | | public BigDecimal getNum() |
| | | { |
| | | return num; |
| | | } |
| | | |
| | | public void setApplicableFactories(String applicableFactories) |
| | | { |
| | | this.applicableFactories = applicableFactories; |
| | | } |
| | | |
| | | public String getApplicableFactories() |
| | | { |
| | | return applicableFactories; |
| | | } |
| | | |
| | | public void setIntegrationDate(Date integrationDate) |
| | | { |
| | | this.integrationDate = integrationDate; |
| | | } |
| | | |
| | | public Date getIntegrationDate() |
| | | { |
| | | return integrationDate; |
| | | } |
| | | |
| | | public void setRefreshDate(Date refreshDate) |
| | | { |
| | | this.refreshDate = refreshDate; |
| | | } |
| | | |
| | | public Date getRefreshDate() |
| | | { |
| | | return refreshDate; |
| | | } |
| | | |
| | | public void setRemainderStock(BigDecimal remainderStock) |
| | | { |
| | | this.remainderStock = remainderStock; |
| | | } |
| | | |
| | | public BigDecimal getRemainderStock() |
| | | { |
| | | return remainderStock; |
| | | } |
| | | |
| | | public void setVersion(Double version) |
| | | { |
| | | this.version = version; |
| | | } |
| | | |
| | | public Double getVersion() |
| | | { |
| | | return version; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("id", getId()) |
| | | .append("itemNumber", getItemNumber()) |
| | | .append("num", getNum()) |
| | | .append("applicableFactories", getApplicableFactories()) |
| | | .append("integrationDate", getIntegrationDate()) |
| | | .append("refreshDate", getRefreshDate()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remainderStock", getRemainderStock()) |
| | | .append("version", getVersion()) |
| | | .toString(); |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | public void deleteApsBomHeader(); |
| | | |
| | | /** |
| | | * å é¤ä¸é´è¡¨BOM Headeræ°æ® |
| | | */ |
| | | public void deleteApsBomHeaderJob(); |
| | | } |
| | |
| | | */ |
| | | public void deleteApsBomLine() ; |
| | | |
| | | /** |
| | | * å é¤ä¸é´è¡¨BOM Lineæ°æ® |
| | | */ |
| | | public void deleteApsBomLineJob() ; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.job.mapper; |
| | | |
| | | import com.aps.job.domain.ApsMaterialStorageManagementJob; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç©æåºå管çMapperæ¥å£ |
| | | * |
| | | * @author hjy |
| | | * @date 2025-05-08 |
| | | */ |
| | | public interface ApsMaterialStorageManagementJobMapper |
| | | { |
| | | /** |
| | | * æ¥è¯¢ç©æåºå管ç |
| | | * |
| | | * @param id ç©æåºå管çä¸»é® |
| | | * @return ç©æåºå管ç |
| | | */ |
| | | public ApsMaterialStorageManagementJob selectApsMaterialStorageManagementJobById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç©æåºå管çå表 |
| | | * |
| | | * @param apsMaterialStorageManagementJob ç©æåºå管ç |
| | | * @return ç©æåºå管çéå |
| | | */ |
| | | public List<ApsMaterialStorageManagementJob> selectApsMaterialStorageManagementJobList(ApsMaterialStorageManagementJob apsMaterialStorageManagementJob); |
| | | |
| | | /** |
| | | * æ°å¢ç©æåºå管ç |
| | | * |
| | | * @param apsMaterialStorageManagementJob ç©æåºå管ç |
| | | * @return ç»æ |
| | | */ |
| | | public int insertApsMaterialStorageManagementJob(ApsMaterialStorageManagementJob apsMaterialStorageManagementJob); |
| | | |
| | | /** |
| | | * ä¿®æ¹ç©æåºå管ç |
| | | * |
| | | * @param apsMaterialStorageManagementJob ç©æåºå管ç |
| | | * @return ç»æ |
| | | */ |
| | | public int updateApsMaterialStorageManagementJob(ApsMaterialStorageManagementJob apsMaterialStorageManagementJob); |
| | | |
| | | /** |
| | | * å é¤ç©æåºå管ç |
| | | * |
| | | * @param id ç©æåºå管çä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsMaterialStorageManagementJobById(Long id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ç©æåºå管ç |
| | | * |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsMaterialStorageManagementJobByIds(Long[] ids); |
| | | |
| | | /** |
| | | * æ¹éæå
¥ç©æåºåæ°æ® |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public int insertApsMaterialStorageBatch(@Param("list") List<ApsMaterialStorageManagementJob> list); |
| | | |
| | | /** |
| | | * æ¹éæå
¥ç©æåºåæ°æ®å°ä¸å¡è¡¨ |
| | | * @return |
| | | */ |
| | | public void insertIntoApsMaterialStorage(); |
| | | |
| | | /** |
| | | * å é¤ç©æåºåæ°æ® |
| | | * @return |
| | | */ |
| | | public void deleteApsMaterialStorage(); |
| | | |
| | | /** |
| | | * å é¤ä¸é´è¡¨ç©æåºåæ°æ® |
| | | */ |
| | | public void deleteApsMaterialStorageJob(); |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | public boolean syncBomData(Integer pageIndex, Integer pageSize, String orgCode, String itemCodeList); |
| | | |
| | | /** |
| | | * 忥bomæ°æ®å®æ¶ä»»å¡ |
| | | * @param pageIndex |
| | | * @param pageSize |
| | | * @param orgCode |
| | | * @param itemCodeList |
| | | * @return |
| | | */ |
| | | public boolean syncBomDataJob(Integer pageIndex, Integer pageSize, String orgCode, String itemCodeList); |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.job.service; |
| | | |
| | | import com.aps.job.domain.ApsMaterialStorageManagementJob; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç©æåºå管çServiceæ¥å£ |
| | | * |
| | | * @author hjy |
| | | * @date 2025-05-08 |
| | | */ |
| | | public interface IApsMaterialStorageManagementJobService |
| | | { |
| | | /** |
| | | * æ¥è¯¢ç©æåºå管ç |
| | | * |
| | | * @param id ç©æåºå管çä¸»é® |
| | | * @return ç©æåºå管ç |
| | | */ |
| | | public ApsMaterialStorageManagementJob selectApsMaterialStorageManagementJobById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç©æåºå管çå表 |
| | | * |
| | | * @param apsMaterialStorageManagementJob ç©æåºå管ç |
| | | * @return ç©æåºå管çéå |
| | | */ |
| | | public List<ApsMaterialStorageManagementJob> selectApsMaterialStorageManagementJobList(ApsMaterialStorageManagementJob apsMaterialStorageManagementJob); |
| | | |
| | | /** |
| | | * æ°å¢ç©æåºå管ç |
| | | * |
| | | * @param apsMaterialStorageManagementJob ç©æåºå管ç |
| | | * @return ç»æ |
| | | */ |
| | | public int insertApsMaterialStorageManagementJob(ApsMaterialStorageManagementJob apsMaterialStorageManagementJob); |
| | | |
| | | /** |
| | | * ä¿®æ¹ç©æåºå管ç |
| | | * |
| | | * @param apsMaterialStorageManagementJob ç©æåºå管ç |
| | | * @return ç»æ |
| | | */ |
| | | public int updateApsMaterialStorageManagementJob(ApsMaterialStorageManagementJob apsMaterialStorageManagementJob); |
| | | |
| | | /** |
| | | * æ¹éå é¤ç©æåºå管ç |
| | | * |
| | | * @param ids éè¦å é¤çç©æåºå管ç主é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsMaterialStorageManagementJobByIds(Long[] ids); |
| | | |
| | | /** |
| | | * å é¤ç©æåºå管çä¿¡æ¯ |
| | | * |
| | | * @param id ç©æåºå管çä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsMaterialStorageManagementJobById(Long id); |
| | | |
| | | /** |
| | | * åæ¥ç©æåºåæ°æ® |
| | | * @param pageIndex |
| | | * @param pageSize |
| | | * @param orgCode |
| | | * @param itemCodeList |
| | | * @return |
| | | */ |
| | | public boolean syncApsMaterialStorageData(int pageIndex, int pageSize, String orgCode, String itemCodeList); |
| | | |
| | | /** |
| | | * 忥å
¨éç©æåºåæ°æ®å®æ¶ä»»å¡ |
| | | * @param pageIndex |
| | | * @param pageSize |
| | | * @param orgCode |
| | | * @param itemCodeList |
| | | * @return |
| | | */ |
| | | public boolean syncApsMaterialStorageDataJob(int pageIndex, int pageSize, String orgCode, String itemCodeList); |
| | | } |
| | |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | @Autowired |
| | | private ApsBomLineJobMapper apsBomLineJobMapper; |
| | | |
| | | /** |
| | | * è·åè®¢åæ¥å£ |
| | | * */ |
| | | @Value("${u9.bomJobUrl}") |
| | | private String getBomUrl; |
| | | |
| | |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * å
¨é忥BOMæ°æ®å®æ¶ä»»å¡ |
| | | * @param pageIndex |
| | | * @param pageSize |
| | | * @param orgCode |
| | | * @param itemCodeList |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public boolean syncBomDataJob(Integer pageIndex, Integer pageSize, String orgCode, String itemCodeList){ |
| | | try { |
| | | apsBomHeaderJobMapper.deleteApsBomHeaderJob(); |
| | | apsBomLineJobMapper.deleteApsBomLineJob(); |
| | | boolean res = syncBomData(pageIndex, pageSize, orgCode, itemCodeList); |
| | | if(!res){ |
| | | return false; |
| | | } |
| | | apsBomHeaderJobMapper.deleteApsBomHeader(); |
| | | apsBomLineJobMapper.deleteApsBomLine(); |
| | | apsBomHeaderJobMapper.insertIntoApsBomHeader(); |
| | | apsBomLineJobMapper.insertIntoApsBomLine(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException(e); |
| | | } |
| | | return true; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.job.service.impl; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.aps.common.core.utils.DateUtils; |
| | | import com.aps.common.core.utils.StringUtils; |
| | | import com.aps.job.domain.ApsMaterialStorageManagementJob; |
| | | import com.aps.job.domain.ApsWorkOrderJobLog; |
| | | import com.aps.job.mapper.ApsMaterialStorageManagementJobMapper; |
| | | import com.aps.job.mapper.ApsWorkOrderJobLogMapper; |
| | | import com.aps.job.service.IApsMaterialStorageManagementJobService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç©æåºå管çServiceä¸å¡å±å¤ç |
| | | * |
| | | * @author hjy |
| | | * @date 2025-05-08 |
| | | */ |
| | | @Service |
| | | public class ApsMaterialStorageManagementJobServiceImpl implements IApsMaterialStorageManagementJobService |
| | | { |
| | | @Autowired |
| | | private ApsMaterialStorageManagementJobMapper apsMaterialStorageManagementJobMapper; |
| | | |
| | | @Value("${u9.materialStorageUrl}") |
| | | private String getMaterialStorageUrl; |
| | | |
| | | @Autowired |
| | | private ApsWorkOrderJobLogMapper jobLogMapper; |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç©æåºå管ç |
| | | * |
| | | * @param id ç©æåºå管çä¸»é® |
| | | * @return ç©æåºå管ç |
| | | */ |
| | | @Override |
| | | public ApsMaterialStorageManagementJob selectApsMaterialStorageManagementJobById(Long id) |
| | | { |
| | | return apsMaterialStorageManagementJobMapper.selectApsMaterialStorageManagementJobById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç©æåºå管çå表 |
| | | * |
| | | * @param apsMaterialStorageManagementJob ç©æåºå管ç |
| | | * @return ç©æåºå管ç |
| | | */ |
| | | @Override |
| | | public List<ApsMaterialStorageManagementJob> selectApsMaterialStorageManagementJobList(ApsMaterialStorageManagementJob apsMaterialStorageManagementJob) |
| | | { |
| | | return apsMaterialStorageManagementJobMapper.selectApsMaterialStorageManagementJobList(apsMaterialStorageManagementJob); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç©æåºå管ç |
| | | * |
| | | * @param apsMaterialStorageManagementJob ç©æåºå管ç |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertApsMaterialStorageManagementJob(ApsMaterialStorageManagementJob apsMaterialStorageManagementJob) |
| | | { |
| | | apsMaterialStorageManagementJob.setCreateTime(DateUtils.getNowDate()); |
| | | return apsMaterialStorageManagementJobMapper.insertApsMaterialStorageManagementJob(apsMaterialStorageManagementJob); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç©æåºå管ç |
| | | * |
| | | * @param apsMaterialStorageManagementJob ç©æåºå管ç |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateApsMaterialStorageManagementJob(ApsMaterialStorageManagementJob apsMaterialStorageManagementJob) |
| | | { |
| | | apsMaterialStorageManagementJob.setUpdateTime(DateUtils.getNowDate()); |
| | | return apsMaterialStorageManagementJobMapper.updateApsMaterialStorageManagementJob(apsMaterialStorageManagementJob); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ç©æåºå管ç |
| | | * |
| | | * @param ids éè¦å é¤çç©æåºå管çä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteApsMaterialStorageManagementJobByIds(Long[] ids) |
| | | { |
| | | return apsMaterialStorageManagementJobMapper.deleteApsMaterialStorageManagementJobByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç©æåºå管çä¿¡æ¯ |
| | | * |
| | | * @param id ç©æåºå管çä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteApsMaterialStorageManagementJobById(Long id) |
| | | { |
| | | return apsMaterialStorageManagementJobMapper.deleteApsMaterialStorageManagementJobById(id); |
| | | } |
| | | |
| | | @Override |
| | | public boolean syncApsMaterialStorageData(int pageIndex, int pageSize, String orgCode, String itemCodeList) { |
| | | JSONObject requestBody = new JSONObject(); |
| | | ResponseEntity<String> response = null; |
| | | ApsWorkOrderJobLog jobLog = new ApsWorkOrderJobLog(); |
| | | try { |
| | | // 设置请æ±å¤´ |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.APPLICATION_JSON); |
| | | // 设置请æ±ä½ |
| | | while (true) { |
| | | jobLog = new ApsWorkOrderJobLog(); |
| | | requestBody = new JSONObject(); |
| | | requestBody.put("PageIndex", pageIndex); |
| | | requestBody.put("PageSize", pageSize); |
| | | if(!StringUtils.isEmpty(orgCode)){ |
| | | requestBody.put("OrgCode", orgCode); |
| | | } |
| | | // å建HttpEntity对象 |
| | | HttpEntity<String> request = new HttpEntity<>(requestBody.toJSONString(), headers); |
| | | // åéPOSTè¯·æ± |
| | | response = restTemplate.postForEntity(getMaterialStorageUrl, request, String.class); |
| | | JSONObject responseBodyJson = JSONObject.parseObject(response.getBody()); |
| | | if (response.getStatusCode().is2xxSuccessful() && "200".equals(responseBodyJson.getString("status"))) { |
| | | JSONArray jsonArray = responseBodyJson.getJSONArray("data"); |
| | | if (!jsonArray.isEmpty()) { |
| | | List<ApsMaterialStorageManagementJob> storageList = new ArrayList<>(); |
| | | for (Object o : jsonArray) { |
| | | JSONObject storage = (JSONObject) o; |
| | | ApsMaterialStorageManagementJob materialStorage = new ApsMaterialStorageManagementJob(); |
| | | materialStorage.setId(IdUtil.getSnowflakeNextId()); |
| | | materialStorage.setItemNumber(storage.getString("ItemCode")); |
| | | materialStorage.setNum(storage.getBigDecimal("StoreQty")); |
| | | materialStorage.setApplicableFactories(storage.getString("OrgCode")); |
| | | storageList.add(materialStorage); |
| | | } |
| | | List<ApsMaterialStorageManagementJob> temp = new ArrayList<>(); |
| | | for(int i=0;i<storageList.size();i++){ |
| | | temp.add(storageList.get(i)); |
| | | if(temp.size()>=20){ |
| | | apsMaterialStorageManagementJobMapper.insertApsMaterialStorageBatch(temp); |
| | | temp = new ArrayList<>(); |
| | | } |
| | | } |
| | | jobLog.setRequestData(requestBody.toJSONString()); |
| | | jobLog.setPageNum(Long.valueOf(pageIndex)); |
| | | jobLog.setPageCount(Long.valueOf(pageSize)); |
| | | jobLog.setCreateTime(DateUtils.getNowDate()); |
| | | jobLog.setBizType("storage"); |
| | | jobLog.setResult("storage:"+storageList.size()); |
| | | jobLogMapper.insertApsWorkOrderJobLog(jobLog); |
| | | pageIndex++; |
| | | }else{ |
| | | break; |
| | | } |
| | | }else{ |
| | | jobLog.setRequestData(requestBody.toJSONString()); |
| | | jobLog.setResponseData(response.getBody()); |
| | | jobLog.setPageNum(Long.valueOf(pageIndex)); |
| | | jobLog.setPageCount(Long.valueOf(pageSize)); |
| | | jobLog.setCreateTime(DateUtils.getNowDate()); |
| | | jobLog.setBizType("storage"); |
| | | jobLog.setResult("error"); |
| | | jobLogMapper.insertApsWorkOrderJobLog(jobLog); |
| | | break; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | jobLog.setRequestData(requestBody.toJSONString()); |
| | | jobLog.setResponseData(response.getBody()); |
| | | jobLog.setPageNum(Long.valueOf(pageIndex)); |
| | | jobLog.setPageCount(Long.valueOf(pageSize)); |
| | | jobLog.setCreateTime(DateUtils.getNowDate()); |
| | | jobLog.setBizType("storage"); |
| | | jobLog.setResult("error"); |
| | | jobLogMapper.insertApsWorkOrderJobLog(jobLog); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public boolean syncApsMaterialStorageDataJob(int pageIndex, int pageSize, String orgCode, String itemCodeList) { |
| | | try { |
| | | apsMaterialStorageManagementJobMapper.deleteApsMaterialStorageJob(); |
| | | boolean res = syncApsMaterialStorageData(pageIndex, pageSize, orgCode, itemCodeList); |
| | | if(!res){ |
| | | return false; |
| | | } |
| | | apsMaterialStorageManagementJobMapper.deleteApsMaterialStorage(); |
| | | apsMaterialStorageManagementJobMapper.insertIntoApsMaterialStorage(); |
| | | return true; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | package com.aps.job.task; |
| | | |
| | | import com.aps.common.core.constant.SecurityConstants; |
| | | import com.aps.common.core.utils.StringUtils; |
| | | import com.aps.job.param.ApsWorkOrderJobParam; |
| | | import com.aps.job.service.IApsBomHeaderJobService; |
| | | import com.aps.job.service.IApsMaterialStorageManagementJobService; |
| | | import com.aps.job.service.IApsWorkOrderJobService; |
| | | import com.aps.job.service.IApsWorkOrderProcessService; |
| | | import com.aps.system.api.RemoteCoreService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IApsWorkOrderJobService iApsWorkOrderJobService; |
| | | |
| | | @Autowired |
| | | private IApsBomHeaderJobService iApsBomHeaderJobService; |
| | | |
| | | @Autowired |
| | | private RemoteCoreService remoteCoreService; |
| | | |
| | | @Autowired |
| | | private IApsMaterialStorageManagementJobService apsMaterialStorageManagementJobService; |
| | | |
| | | public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) |
| | | { |
| | |
| | | iApsWorkOrderJobService.syncGasPipingData(); |
| | | iApsWorkOrderProcessService.syncProcessRouteData(); |
| | | } |
| | | |
| | | /** |
| | | * 忥å
¨éBOMæ°æ®å®æ¶ä»»å¡ |
| | | */ |
| | | public void syncBomDataJob(Integer pageIndex, Integer pageSize, String orgCode, String itemCodeList) |
| | | { |
| | | boolean res = iApsBomHeaderJobService.syncBomDataJob(pageIndex, pageSize, orgCode, itemCodeList); |
| | | if(res){ |
| | | remoteCoreService.setBomDataToRedis(SecurityConstants.INNER); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 忥å
¨éåºåæ°æ®å®æ¶ä»»å¡ |
| | | */ |
| | | public void syncApsMaterialStorageDataJob(Integer pageIndex, Integer pageSize, String orgCode, String itemCodeList) |
| | | { |
| | | apsMaterialStorageManagementJobService.syncApsMaterialStorageDataJob(pageIndex, pageSize, orgCode, itemCodeList); |
| | | } |
| | | } |
| | |
| | | FROM aps_bom_header_job |
| | | </insert> |
| | | |
| | | <!-- å é¤ aps_process_route 表ä¸çæ°æ® --> |
| | | <!-- å é¤ aps_bom_header 表ä¸çæ°æ® --> |
| | | <delete id="deleteApsBomHeader"> |
| | | DELETE FROM aps_bom_header |
| | | </delete> |
| | | |
| | | <!-- å é¤ aps_bom_header_job 表ä¸çæ°æ® --> |
| | | <delete id="deleteApsBomHeaderJob"> |
| | | DELETE FROM aps_bom_header_job |
| | | </delete> |
| | | |
| | | </mapper> |
| | |
| | | FROM aps_bom_line_job |
| | | </insert> |
| | | |
| | | <!-- å é¤ aps_process_route 表ä¸çæ°æ® --> |
| | | <!-- å é¤ aps_bom_line 表ä¸çæ°æ® --> |
| | | <delete id="deleteApsBomLine"> |
| | | DELETE FROM aps_bom_line |
| | | </delete> |
| | | |
| | | <!-- å é¤ aps_bom_line_job 表ä¸çæ°æ® --> |
| | | <delete id="deleteApsBomLineJob"> |
| | | DELETE FROM aps_bom_line_job |
| | | </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.job.mapper.ApsMaterialStorageManagementJobMapper"> |
| | | |
| | | <resultMap type="ApsMaterialStorageManagementJob" id="ApsMaterialStorageManagementJobResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="itemNumber" column="item_number" /> |
| | | <result property="num" column="num" /> |
| | | <result property="applicableFactories" column="applicable_factories" /> |
| | | <result property="integrationDate" column="integration_date" /> |
| | | <result property="refreshDate" column="refresh_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="remainderStock" column="remainder_stock" /> |
| | | <result property="version" column="version" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectApsMaterialStorageManagementJobVo"> |
| | | select id, item_number, num, applicable_factories, integration_date, refresh_date, create_by, create_time, update_by, update_time, remainder_stock, version from aps_material_storage_management_job |
| | | </sql> |
| | | |
| | | <select id="selectApsMaterialStorageManagementJobList" parameterType="ApsMaterialStorageManagementJob" resultMap="ApsMaterialStorageManagementJobResult"> |
| | | <include refid="selectApsMaterialStorageManagementJobVo"/> |
| | | <where> |
| | | <if test="itemNumber != null and itemNumber != ''"> and item_number = #{itemNumber}</if> |
| | | <if test="num != null "> and num = #{num}</if> |
| | | <if test="applicableFactories != null and applicableFactories != ''"> and applicable_factories = #{applicableFactories}</if> |
| | | <if test="integrationDate != null "> and integration_date = #{integrationDate}</if> |
| | | <if test="refreshDate != null "> and refresh_date = #{refreshDate}</if> |
| | | <if test="remainderStock != null "> and remainder_stock = #{remainderStock}</if> |
| | | <if test="version != null "> and version = #{version}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectApsMaterialStorageManagementJobById" parameterType="Long" resultMap="ApsMaterialStorageManagementJobResult"> |
| | | <include refid="selectApsMaterialStorageManagementJobVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsMaterialStorageManagementJob" parameterType="ApsMaterialStorageManagementJob"> |
| | | insert into aps_material_storage_management_job |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="itemNumber != null">item_number,</if> |
| | | <if test="num != null">num,</if> |
| | | <if test="applicableFactories != null">applicable_factories,</if> |
| | | <if test="integrationDate != null">integration_date,</if> |
| | | <if test="refreshDate != null">refresh_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="remainderStock != null">remainder_stock,</if> |
| | | <if test="version != null">version,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="itemNumber != null">#{itemNumber},</if> |
| | | <if test="num != null">#{num},</if> |
| | | <if test="applicableFactories != null">#{applicableFactories},</if> |
| | | <if test="integrationDate != null">#{integrationDate},</if> |
| | | <if test="refreshDate != null">#{refreshDate},</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="remainderStock != null">#{remainderStock},</if> |
| | | <if test="version != null">#{version},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsMaterialStorageManagementJob" parameterType="ApsMaterialStorageManagementJob"> |
| | | update aps_material_storage_management_job |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="itemNumber != null">item_number = #{itemNumber},</if> |
| | | <if test="num != null">num = #{num},</if> |
| | | <if test="applicableFactories != null">applicable_factories = #{applicableFactories},</if> |
| | | <if test="integrationDate != null">integration_date = #{integrationDate},</if> |
| | | <if test="refreshDate != null">refresh_date = #{refreshDate},</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="remainderStock != null">remainder_stock = #{remainderStock},</if> |
| | | <if test="version != null">version = #{version},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteApsMaterialStorageManagementJobById" parameterType="Long"> |
| | | delete from aps_material_storage_management_job where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteApsMaterialStorageManagementJobByIds" parameterType="String"> |
| | | delete from aps_material_storage_management_job where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <insert id="insertApsMaterialStorageBatch"> |
| | | INSERT INTO aps_material_storage_management_job ( |
| | | id, |
| | | item_number, |
| | | num, |
| | | applicable_factories, |
| | | create_time |
| | | ) VALUES |
| | | <foreach collection="list" item="item" separator=","> |
| | | ( |
| | | #{item.id}, |
| | | #{item.itemNumber}, |
| | | #{item.num}, |
| | | #{item.applicableFactories}, |
| | | now() |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <!-- æå
¥æ°æ®å° aps_material_storage_management --> |
| | | <insert id="insertIntoApsMaterialStorage"> |
| | | INSERT INTO aps_material_storage_management ( |
| | | id, |
| | | item_number, |
| | | num, |
| | | applicable_factories, |
| | | create_time |
| | | ) |
| | | SELECT |
| | | id, |
| | | item_number, |
| | | num, |
| | | applicable_factories, |
| | | now() |
| | | FROM aps_material_storage_management_job |
| | | </insert> |
| | | |
| | | <!-- å é¤ aps_material_storage_management 表ä¸çæ°æ® --> |
| | | <delete id="deleteApsMaterialStorage"> |
| | | DELETE FROM aps_material_storage_management |
| | | </delete> |
| | | |
| | | <!-- å é¤ aps_material_storage_management_job 表ä¸çæ°æ® --> |
| | | <delete id="deleteApsMaterialStorageJob"> |
| | | DELETE FROM aps_material_storage_management_job |
| | | </delete> |
| | | |
| | | </mapper> |