Merge branch 'dev' of http://192.168.50.149:8085/r/aps-backend into dev
| | |
| | | package com.aps.core.controller; |
| | | |
| | | import com.aps.common.core.domain.R; |
| | | import com.aps.common.core.utils.file.FileUtils; |
| | | import com.aps.common.core.web.domain.AjaxResult; |
| | | import com.aps.core.service.IApsBomHeaderService; |
| | | import com.aps.core.service.IApsMaterialStorageManagementService; |
| | | import com.aps.core.service.IApsStandardProcessRouteHeaderService; |
| | | import com.aps.core.service.ICoreService; |
| | | import com.aps.system.api.domain.SysFile; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.aps.common.core.domain.R; |
| | | import com.aps.common.core.utils.file.FileUtils; |
| | | import com.aps.system.api.domain.SysFile; |
| | | |
| | | /** |
| | | * 文件请求处理 |
| | |
| | | |
| | | @Autowired |
| | | private ICoreService coreService; |
| | | |
| | | @Autowired |
| | | private IApsBomHeaderService apsBomHeaderService; |
| | | |
| | | @Autowired |
| | | private IApsStandardProcessRouteHeaderService apsStandardProcessRouteHeaderService; |
| | | |
| | | @Autowired |
| | | private IApsMaterialStorageManagementService apsMaterialStorageManagementService; |
| | | |
| | | /** |
| | | * 文件上传请求 |
| | |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 刷新BOM和工艺路线和库存缓存 |
| | | * @param orgCode |
| | | * @return |
| | | */ |
| | | @PostMapping("refreshBomPrcessrouteStorageData") |
| | | public AjaxResult refreshBomRouteStorageData(String orgCode) |
| | | { |
| | | try { |
| | | apsBomHeaderService.setBomDataToRedis(orgCode); |
| | | apsStandardProcessRouteHeaderService.setProcessRouteDataToRedis(orgCode); |
| | | apsMaterialStorageManagementService.setStorageDataToRedis(orgCode); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
| | |
| | | return AjaxResult.error("模板内容为空"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据车间查询标准工序列表 |
| | | */ |
| | | @Operation(summary = "根据车间查询标准工序列表", description = "全量查询") |
| | | @RequiresPermissions("aps:standardProcess:listByWorkShop") |
| | | @GetMapping("/listByWorkShop") |
| | | public TableDataInfo listByWorkShop(ApsStandardProcess apsStandardProcess) |
| | | { |
| | | List<ApsStandardProcess> list = apsStandardProcessService.selectApsStandardProcessList(apsStandardProcess); |
| | | return getDataTable(list); |
| | | } |
| | | } |
| | |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ApsWorkCalendar apsWorkCalendar) |
| | | { |
| | | try { |
| | | ApsWorkCalendar tempCheck = new ApsWorkCalendar(); |
| | | tempCheck.setEffectiveDate(apsWorkCalendar.getEffectiveDate()); |
| | | tempCheck.setExpiringDate(apsWorkCalendar.getExpiringDate()); |
| | | tempCheck.setApplicableFactory(apsWorkCalendar.getApplicableFactory()); |
| | | tempCheck.setType(apsWorkCalendar.getType()); |
| | | List<ApsWorkCalendar> list = apsWorkCalendarService.selectApsWorkCalendarList(tempCheck); |
| | | if(!list.isEmpty()){ |
| | | return AjaxResult.error("该时间段日历已存在", list); |
| | | }else{ |
| | | return toAjax(apsWorkCalendarService.insertApsWorkCalendar(apsWorkCalendar)); |
| | | apsWorkCalendarService.insertApsWorkCalendar(apsWorkCalendar); |
| | | return success(); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return error(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 修改日历管理 |
| | | */ |
| | | @RequiresPermissions("aps:calendar:edit") |
| | | // @RequiresPermissions("aps:calendar:edit") |
| | | @Log(title = "日历管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ApsWorkCalendar apsWorkCalendar) |
| | | { |
| | | ApsWorkCalendar tempCheck = new ApsWorkCalendar(); |
| | | tempCheck.setEffectiveDate(apsWorkCalendar.getEffectiveDate()); |
| | | tempCheck.setExpiringDate(apsWorkCalendar.getExpiringDate()); |
| | | tempCheck.setApplicableFactory(apsWorkCalendar.getApplicableFactory()); |
| | | List<ApsWorkCalendar> list = apsWorkCalendarService.selectApsWorkCalendarList(tempCheck); |
| | | if(!list.isEmpty()){ |
| | | return AjaxResult.error("该时间段日历已存在", list); |
| | | }else{ |
| | | return toAjax(apsWorkCalendarService.updateApsWorkCalendar(apsWorkCalendar)); |
| | | try { |
| | | // ApsWorkCalendar tempCheck = new ApsWorkCalendar(); |
| | | // tempCheck.setEffectiveDate(apsWorkCalendar.getEffectiveDate()); |
| | | // tempCheck.setExpiringDate(apsWorkCalendar.getExpiringDate()); |
| | | // tempCheck.setApplicableFactory(apsWorkCalendar.getApplicableFactory()); |
| | | // tempCheck.setType(apsWorkCalendar.getType()); |
| | | // List<ApsWorkCalendar> list = apsWorkCalendarService.selectApsWorkCalendarList(tempCheck); |
| | | // if(!list.isEmpty()){ |
| | | // return AjaxResult.error("该时间段日历已存在", list); |
| | | // }else{ |
| | | apsWorkCalendarService.updateApsWorkCalendar(apsWorkCalendar); |
| | | return success(); |
| | | // } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return error(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除日历管理 |
| | | */ |
| | | @RequiresPermissions("aps:calendar:delete") |
| | | @Log(title = "删除日历管理", businessType = BusinessType.DELETE) |
| | | @PostMapping("/deleteApsWorkCalendar") |
| | | public AjaxResult deleteApsWorkCalendar(@RequestBody ApsWorkCalendar apsWorkCalendar) |
| | | { |
| | | return toAjax(apsWorkCalendarService.deleteApsWorkCalendar(apsWorkCalendar)); |
| | | } |
| | | |
| | | /** |
| | | * 查询日历管理列表 |
| | | */ |
| | | @RequiresPermissions("aps:calendar:list") |
| | |
| | | R<Boolean> res = remoteJobService.refreshBomData(SecurityConstants.INNER); |
| | | if (R.isSuccess(res)) |
| | | { |
| | | apsBomHeaderService.setBomDataToRedis(""); |
| | | apsBomHeaderService.setBomDataToRedis("FORTUNA"); |
| | | return success(); |
| | | } |
| | | return error(); |
| | |
| | | /** |
| | | * 查询钣金工单计划 |
| | | */ |
| | | @RequiresPermissions("ApsPlatOrderPlanManager:list") |
| | | /*@RequiresPermissions("ApsPlatOrderPlanManager:list")*/ |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ApsPlateOrderPlanManager apsPlateOrderPlanManager) |
| | | { |
| | |
| | | |
| | | /** 总数量 */ |
| | | @Excel(name = "总数量") |
| | | private BigDecimal total_num; |
| | | private BigDecimal totalNum; |
| | | |
| | | /** 准备工时 */ |
| | | @Excel(name = "准备工时") |
| | |
| | | @Excel(name = "批次号") |
| | | private String batchNumber; |
| | | |
| | | /** 工厂 */ |
| | | private String plant; |
| | | |
| | | @Transient |
| | | private String searchStartDate; |
| | | |
| | |
| | | @Excel(name = "下一工序名称") |
| | | private String nextOpName; |
| | | |
| | | public BigDecimal getUnmatchedQuantity() { |
| | | return unmatchedQuantity; |
| | | } |
| | | |
| | | public void setUnmatchedQuantity(BigDecimal unmatchedQuantity) { |
| | | this.unmatchedQuantity = unmatchedQuantity; |
| | | } |
| | | |
| | | public String getProfessionalAffiliation() { |
| | | return professionalAffiliation; |
| | | } |
| | | |
| | | public void setProfessionalAffiliation(String professionalAffiliation) { |
| | | this.professionalAffiliation = professionalAffiliation; |
| | | } |
| | | |
| | | /** 未匹配的生产数量*/ |
| | | private BigDecimal unmatchedQuantity; |
| | | /** 专业归属*/ |
| | | private String professionalAffiliation; |
| | | |
| | | public String getOpStatus() { |
| | | return opStatus; |
| | |
| | | |
| | | /** 需求ID */ |
| | | @Excel(name = "需求ID") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING) |
| | | private Long requireId; |
| | | |
| | | /** 需求追溯ID */ |
| | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | |
| | | import java.io.Serial; |
| | | import java.math.BigDecimal; |
| | |
| | | private Long id; |
| | | |
| | | /** 主计划员 */ |
| | | @Excel(name = "主计划") |
| | | // @Excel(name = "主计划") |
| | | private String masterPlanner; |
| | | |
| | | /** 周日 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "周日", width = 30, dateFormat = "yyyy-MM-dd") |
| | | // @Excel(name = "周日", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date weekDay; |
| | | |
| | | /** 周度 */ |
| | | @Excel(name = "周度") |
| | | // @Excel(name = "周度") |
| | | private String weekCycle; |
| | | |
| | | /** 主件料号 */ |
| | |
| | | private String mainPartNumber; |
| | | |
| | | /** 主件图号 */ |
| | | @Excel(name = "主件图号") |
| | | // @Excel(name = "主件图号") |
| | | private String mainPartDrawingNumber; |
| | | |
| | | /** 客户名称 */ |
| | |
| | | private String drawingNo; |
| | | |
| | | /** 版本号 */ |
| | | @Excel(name = "版本号") |
| | | // @Excel(name = "版本号") |
| | | private String versionNumber; |
| | | |
| | | /** 生产数量 */ |
| | |
| | | private BigDecimal productionQuantity; |
| | | |
| | | /** 良品数量 */ |
| | | @Excel(name = "良品数量") |
| | | // @Excel(name = "良品数量") |
| | | private BigDecimal goodProductsQuantity; |
| | | |
| | | /** 工序号 */ |
| | |
| | | private String workCenter; |
| | | |
| | | /** 所属部门 */ |
| | | @Excel(name = "所属部门") |
| | | // @Excel(name = "所属部门") |
| | | private String department; |
| | | |
| | | /** 计划开工日 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "计划开工日", width = 30, dateFormat = "yyyy-MM-dd") |
| | | // @Excel(name = "计划开工日", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date planStartDay; |
| | | |
| | | /** 计划完工日 */ |
| | |
| | | private Date planEndDay; |
| | | |
| | | /** 备料料号 */ |
| | | @Excel(name = "备料料号") |
| | | // @Excel(name = "备料料号") |
| | | private String standbyNumber; |
| | | |
| | | /** 备料名称 */ |
| | | @Excel(name = "备料名称") |
| | | // @Excel(name = "备料名称") |
| | | private String standbyName; |
| | | |
| | | /** 备料库存 */ |
| | | @Excel(name = "备料库存") |
| | | // @Excel(name = "备料库存") |
| | | private Integer standbyStock; |
| | | |
| | | /** 下道工序所属部门 */ |
| | | @Excel(name = "下道工序所属部门") |
| | | // @Excel(name = "下道工序所属部门") |
| | | private String nextProcessDeparment; |
| | | |
| | | /** 是否挂起 */ |
| | | @Excel(name = "是否挂起") |
| | | // @Excel(name = "是否挂起") |
| | | private String isSuspended; |
| | | |
| | | /** 外协标识 */ |
| | | @Excel(name = "外协标识") |
| | | // @Excel(name = "外协标识") |
| | | private String isOutsourcing; |
| | | |
| | | /** 账套 */ |
| | |
| | | private String account; |
| | | |
| | | /** 上阶物料 */ |
| | | @Excel(name = "上阶物料") |
| | | // @Excel(name = "上阶物料") |
| | | private String advancedMaterials; |
| | | |
| | | /** 上阶单据号 */ |
| | | @Excel(name = "上阶单据号") |
| | | // @Excel(name = "上阶单据号") |
| | | private String advancedDocumentNumber; |
| | | |
| | | /** 上阶需求日期 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "上阶需求日期", width = 30, dateFormat = "yyyy-MM-dd") |
| | | // @Excel(name = "上阶需求日期", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date advancedRequirementDay; |
| | | |
| | | /** 计划齐套 */ |
| | | @Excel(name = "计划齐套") |
| | | // @Excel(name = "计划齐套") |
| | | private Integer isPlanComplete; |
| | | |
| | | /** 库存齐套 */ |
| | | @Excel(name = "库存齐套") |
| | | // @Excel(name = "库存齐套") |
| | | private Integer isStockComplete; |
| | | |
| | | /** 是否有折返工序 */ |
| | | @Excel(name = "是否有折返工序") |
| | | // @Excel(name = "是否有折返工序") |
| | | private Integer hasTurnback; |
| | | |
| | | /** 风险标识 */ |
| | | @Excel(name = "风险标识") |
| | | // @Excel(name = "风险标识") |
| | | private Integer hasRisk; |
| | | |
| | | /** 作业(工序名称) */ |
| | | @Excel(name = "作业") |
| | | // @Excel(name = "作业") |
| | | private String stdOp; |
| | | |
| | | /** 工厂 */ |
| | |
| | | private String plant; |
| | | |
| | | /** 当前工序状态 */ |
| | | @Excel(name = "当前工序状态") |
| | | // @Excel(name = "当前工序状态") |
| | | private String opStatus; |
| | | |
| | | /** 下一工序名称 */ |
| | | @Excel(name = "下一工序名称") |
| | | // @Excel(name = "下一工序名称") |
| | | private String nextOpName; |
| | | |
| | | /** 工单创建时间 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "工单创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | // @Excel(name = "工单创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date orderCreateTime; |
| | | |
| | | /** 自定义时间 */ |
| | |
| | | // private Date customTime; |
| | | |
| | | /** 生产基地 */ |
| | | @Excel(name = "生产基地") |
| | | // @Excel(name = "生产基地") |
| | | private String productionBase; |
| | | |
| | | /** 工单审核时间 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | // @Excel(name = "工单审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date approveOn; |
| | | |
| | | /** 工单开工时间 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | // @Excel(name = "工单开工时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date startWorkDate; |
| | | |
| | | /** 未匹配的生产数量*/ |
| | | private BigDecimal unmatchedQuantity; |
| | |
| | | private String requireId; |
| | | |
| | | private Integer version; |
| | | |
| | | /** 低阶码*/ |
| | | private String lowOrderCode; |
| | | /* |
| | | public String getOpStatus() { |
| | | return opStatus; |
| | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.math.BigInteger; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | @Excel(name = "主件料号") |
| | | private String mainPartNumber; |
| | | |
| | | /** 主件客户 */ |
| | | @Schema(description = "主件客户,来自ERP", type = "String") |
| | | @Excel(name = "主件客户") |
| | | private String customer; |
| | | |
| | | /** 主件订单交期 */ |
| | | @Schema(description = "主件订单交期,来自ERP", type = "String") |
| | | @Excel(name = "主件订单交期") |
| | | private BigInteger mainOrderDelivery; |
| | | |
| | | /** 业务类型 */ |
| | | @Schema(description = "业务类型", type = "String") |
| | | @Excel(name = "业务类型") |
| | | private String businessType; |
| | | |
| | | /** 番号 */ |
| | | @Schema(description = "需求追溯号,由APS产生", type = "String") |
| | | @Excel(name = "番号") |
| | | private String designation; |
| | | |
| | | /** 单据号 */ |
| | | @Schema(description = "单据号", type = "String") |
| | |
| | | @Excel(name = "生产数量") |
| | | private BigDecimal productionQuantity; |
| | | |
| | | /** 工单创建时间 */ |
| | | @Schema(description = "工单创建时间,来自ERP", type = "String") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "工单创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date orderCreateTime; |
| | | |
| | | /** 工单审核时间 */ |
| | | @Schema(description = "工单审核时间,来自ERP", type = "String") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "工单审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date approveOn; |
| | | |
| | | /** 工单开工时间 */ |
| | | @Schema(description = "工单开工时间,来自ERP", type = "String") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "工单开工时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date startWorkDate; |
| | | |
| | | /** 再次确认完工时间 */ |
| | | @Schema(description = "再次确认完工时间,来自APS", type = "String") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "再次确认完工时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date workOrderConfirmTime; |
| | | |
| | | /** 计划完工日 */ |
| | | @Schema(description = "计划完工日", type = "String") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "计划完工日", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date planEndDay; |
| | | |
| | | /** 版本号 */ |
| | | @Schema(description = "生产工厂,来自ERP", type = "String") |
| | | @Excel(name = "生产工厂") |
| | | private String productionBase; |
| | | |
| | | /** 版本号 */ |
| | | @Schema(description = "齐套状况,来自ERP", type = "String") |
| | | @Excel(name = "齐套状况") |
| | | private String kittingCondition; |
| | | |
| | | /** 计划齐套时间 */ |
| | | @Schema(description = "计划齐套时间,来自ERP", type = "String") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "计划齐套时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date planKittingTime; |
| | | |
| | | /** 工序号 */ |
| | | @Excel(name = "工序号") |
| | |
| | | @Excel(name = "下一工序名称") |
| | | private String nextOpName; |
| | | |
| | | /** 低阶码*/ |
| | | @Excel(name = "低阶码") |
| | | private String lowOrderCode; |
| | | |
| | | private List<ApsPlateProcessShopStat> deptPlans=new ArrayList<>(); |
| | | } |
| | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.aps.common.core.annotation.Excel; |
| | |
| | | * @author zhl |
| | | * @date 2025-04-15 |
| | | */ |
| | | @Data |
| | | public class ApsPlateProcessStat extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date computePlanEndDay; |
| | | |
| | | @Excel(name = "异常状态", width = 50) |
| | | private String exceptionStatus; |
| | | |
| | | /** 设计工时 */ |
| | | |
| | | private Long designTimes; |
| | |
| | | |
| | | private Boolean warning; |
| | | |
| | | public void setId(String id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getId() |
| | | { |
| | | return id; |
| | | } |
| | | |
| | | public void setWorkOrderNo(String workOrderNo) |
| | | { |
| | | this.workOrderNo = workOrderNo; |
| | | } |
| | | |
| | | public String getWorkOrderNo() |
| | | { |
| | | return workOrderNo; |
| | | } |
| | | |
| | | public void setProcessName(String processName) |
| | | { |
| | | this.processName = processName; |
| | | } |
| | | |
| | | public String getProcessName() |
| | | { |
| | | return processName; |
| | | } |
| | | |
| | | public void setNum(Integer num) |
| | | { |
| | | this.num = num; |
| | | } |
| | | |
| | | public Integer getNum() |
| | | { |
| | | return num; |
| | | } |
| | | |
| | | public void setRouteProcessNumber(BigDecimal routeProcessNumber) |
| | | { |
| | | this.routeProcessNumber = routeProcessNumber; |
| | | } |
| | | |
| | | public BigDecimal getRouteProcessNumber() |
| | | { |
| | | return routeProcessNumber; |
| | | } |
| | | |
| | | public void setCurrentProcessNumber(BigDecimal currentProcessNumber) |
| | | { |
| | | this.currentProcessNumber = currentProcessNumber; |
| | | } |
| | | |
| | | public BigDecimal getCurrentProcessNumber() |
| | | { |
| | | return currentProcessNumber; |
| | | } |
| | | |
| | | public void setProductionQuantity(BigDecimal productionQuantity) |
| | | { |
| | | this.productionQuantity = productionQuantity; |
| | | } |
| | | |
| | | public BigDecimal getProductionQuantity() |
| | | { |
| | | return productionQuantity; |
| | | } |
| | | |
| | | public void setStandardTime(BigDecimal standardTime) |
| | | { |
| | | this.standardTime = standardTime; |
| | | } |
| | | |
| | | public BigDecimal getStandardTime() |
| | | { |
| | | return standardTime; |
| | | } |
| | | |
| | | public void setProcessTotalTime(BigDecimal processTotalTime) |
| | | { |
| | | this.processTotalTime = processTotalTime; |
| | | } |
| | | |
| | | public BigDecimal getProcessTotalTime() |
| | | { |
| | | return processTotalTime; |
| | | } |
| | | |
| | | public void setProcessPlanEndDay(Date processPlanEndDay) |
| | | { |
| | | this.processPlanEndDay = processPlanEndDay; |
| | | } |
| | | |
| | | public Date getProcessPlanEndDay() |
| | | { |
| | | return processPlanEndDay; |
| | | } |
| | | |
| | | public void setComputePlanEndDay(Date computePlanEndDay) |
| | | { |
| | | this.computePlanEndDay = computePlanEndDay; |
| | | } |
| | | |
| | | public Date getComputePlanEndDay() |
| | | { |
| | | return computePlanEndDay; |
| | | } |
| | | |
| | | public void setDesignTimes(Long designTimes) |
| | | { |
| | | this.designTimes = designTimes; |
| | | } |
| | | |
| | | public Long getDesignTimes() |
| | | { |
| | | return designTimes; |
| | | } |
| | | |
| | | public void setBatchNumber(String batchNumber) |
| | | { |
| | | this.batchNumber = batchNumber; |
| | | } |
| | | |
| | | public String getBatchNumber() |
| | | { |
| | | return batchNumber; |
| | | } |
| | | public Date getProcessPlanStartDay() { |
| | | return processPlanStartDay; |
| | | } |
| | | |
| | | public void setProcessPlanStartDay(Date processPlanStartDay) { |
| | | this.processPlanStartDay = processPlanStartDay; |
| | | } |
| | | |
| | | public Date getOrderPlanEndDay() { |
| | | return orderPlanEndDay; |
| | | } |
| | | |
| | | public void setOrderPlanEndDay(Date orderPlanEndDay) { |
| | | this.orderPlanEndDay = orderPlanEndDay; |
| | | } |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | public Boolean getWarning() { |
| | | return warning; |
| | | } |
| | | |
| | | public void setWarning(Boolean warning) { |
| | | this.warning = warning; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("id", getId()) |
| | | .append("workOrderNo", getWorkOrderNo()) |
| | | .append("processName", getProcessName()) |
| | | .append("num", getNum()) |
| | | .append("routeProcessNumber", getRouteProcessNumber()) |
| | | .append("currentProcessNumber", getCurrentProcessNumber()) |
| | | .append("productionQuantity", getProductionQuantity()) |
| | | .append("standardTime", getStandardTime()) |
| | | .append("processTotalTime", getProcessTotalTime()) |
| | | .append("processPlanEndDay", getProcessPlanEndDay()) |
| | | .append("computePlanEndDay", getComputePlanEndDay()) |
| | | .append("designTimes", getDesignTimes()) |
| | | .append("batchNumber", getBatchNumber()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("delFlag", getDelFlag()) |
| | | .toString(); |
| | | } |
| | | // public void setId(String id) |
| | | // { |
| | | // this.id = id; |
| | | // } |
| | | // |
| | | // public String getId() |
| | | // { |
| | | // return id; |
| | | // } |
| | | // |
| | | // public void setWorkOrderNo(String workOrderNo) |
| | | // { |
| | | // this.workOrderNo = workOrderNo; |
| | | // } |
| | | // |
| | | // public String getWorkOrderNo() |
| | | // { |
| | | // return workOrderNo; |
| | | // } |
| | | // |
| | | // public void setProcessName(String processName) |
| | | // { |
| | | // this.processName = processName; |
| | | // } |
| | | // |
| | | // public String getProcessName() |
| | | // { |
| | | // return processName; |
| | | // } |
| | | // |
| | | // public void setNum(Integer num) |
| | | // { |
| | | // this.num = num; |
| | | // } |
| | | // |
| | | // public Integer getNum() |
| | | // { |
| | | // return num; |
| | | // } |
| | | // |
| | | // public void setRouteProcessNumber(BigDecimal routeProcessNumber) |
| | | // { |
| | | // this.routeProcessNumber = routeProcessNumber; |
| | | // } |
| | | // |
| | | // public BigDecimal getRouteProcessNumber() |
| | | // { |
| | | // return routeProcessNumber; |
| | | // } |
| | | // |
| | | // public void setCurrentProcessNumber(BigDecimal currentProcessNumber) |
| | | // { |
| | | // this.currentProcessNumber = currentProcessNumber; |
| | | // } |
| | | // |
| | | // public BigDecimal getCurrentProcessNumber() |
| | | // { |
| | | // return currentProcessNumber; |
| | | // } |
| | | // |
| | | // public void setProductionQuantity(BigDecimal productionQuantity) |
| | | // { |
| | | // this.productionQuantity = productionQuantity; |
| | | // } |
| | | // |
| | | // public BigDecimal getProductionQuantity() |
| | | // { |
| | | // return productionQuantity; |
| | | // } |
| | | // |
| | | // public void setStandardTime(BigDecimal standardTime) |
| | | // { |
| | | // this.standardTime = standardTime; |
| | | // } |
| | | // |
| | | // public BigDecimal getStandardTime() |
| | | // { |
| | | // return standardTime; |
| | | // } |
| | | // |
| | | // public void setProcessTotalTime(BigDecimal processTotalTime) |
| | | // { |
| | | // this.processTotalTime = processTotalTime; |
| | | // } |
| | | // |
| | | // public BigDecimal getProcessTotalTime() |
| | | // { |
| | | // return processTotalTime; |
| | | // } |
| | | // |
| | | // public void setProcessPlanEndDay(Date processPlanEndDay) |
| | | // { |
| | | // this.processPlanEndDay = processPlanEndDay; |
| | | // } |
| | | // |
| | | // public Date getProcessPlanEndDay() |
| | | // { |
| | | // return processPlanEndDay; |
| | | // } |
| | | // |
| | | // public void setComputePlanEndDay(Date computePlanEndDay) |
| | | // { |
| | | // this.computePlanEndDay = computePlanEndDay; |
| | | // } |
| | | // |
| | | // public Date getComputePlanEndDay() |
| | | // { |
| | | // return computePlanEndDay; |
| | | // } |
| | | // |
| | | // public void setDesignTimes(Long designTimes) |
| | | // { |
| | | // this.designTimes = designTimes; |
| | | // } |
| | | // |
| | | // public Long getDesignTimes() |
| | | // { |
| | | // return designTimes; |
| | | // } |
| | | // |
| | | // public void setBatchNumber(String batchNumber) |
| | | // { |
| | | // this.batchNumber = batchNumber; |
| | | // } |
| | | // |
| | | // public String getBatchNumber() |
| | | // { |
| | | // return batchNumber; |
| | | // } |
| | | // public Date getProcessPlanStartDay() { |
| | | // return processPlanStartDay; |
| | | // } |
| | | // |
| | | // public void setProcessPlanStartDay(Date processPlanStartDay) { |
| | | // this.processPlanStartDay = processPlanStartDay; |
| | | // } |
| | | // |
| | | // public Date getOrderPlanEndDay() { |
| | | // return orderPlanEndDay; |
| | | // } |
| | | // |
| | | // public void setOrderPlanEndDay(Date orderPlanEndDay) { |
| | | // this.orderPlanEndDay = orderPlanEndDay; |
| | | // } |
| | | // public void setDelFlag(String delFlag) |
| | | // { |
| | | // this.delFlag = delFlag; |
| | | // } |
| | | // |
| | | // public String getDelFlag() |
| | | // { |
| | | // return delFlag; |
| | | // } |
| | | // public Boolean getWarning() { |
| | | // return warning; |
| | | // } |
| | | // |
| | | // public void setWarning(Boolean warning) { |
| | | // this.warning = warning; |
| | | // } |
| | | // |
| | | // public String getExceptionStatus() { |
| | | // return exceptionStatus; |
| | | // } |
| | | // |
| | | // public void setExceptionStatus(String exceptionStatus) { |
| | | // this.exceptionStatus = exceptionStatus; |
| | | // } |
| | | // |
| | | // @Override |
| | | // public String toString() { |
| | | // return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | // .append("id", getId()) |
| | | // .append("workOrderNo", getWorkOrderNo()) |
| | | // .append("processName", getProcessName()) |
| | | // .append("num", getNum()) |
| | | // .append("routeProcessNumber", getRouteProcessNumber()) |
| | | // .append("currentProcessNumber", getCurrentProcessNumber()) |
| | | // .append("productionQuantity", getProductionQuantity()) |
| | | // .append("standardTime", getStandardTime()) |
| | | // .append("processTotalTime", getProcessTotalTime()) |
| | | // .append("processPlanEndDay", getProcessPlanEndDay()) |
| | | // .append("computePlanEndDay", getComputePlanEndDay()) |
| | | // .append("designTimes", getDesignTimes()) |
| | | // .append("batchNumber", getBatchNumber()) |
| | | // .append("createBy", getCreateBy()) |
| | | // .append("delFlag", getDelFlag()) |
| | | // .toString(); |
| | | // } |
| | | } |
| | |
| | | private String bomLineCode; |
| | | |
| | | /** BOM低阶码 */ |
| | | @Excel(name = "BOM低阶码") |
| | | // @Excel(name = "低阶码") |
| | | private Long bomLineLevel; |
| | | |
| | | /** BOM用量 */ |
| | |
| | | |
| | | /** 计划开工日 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "计划开工日") |
| | | @Excel(name = "计划开工日", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date startDate; |
| | | |
| | | /** 计划完工日 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "计划完工日") |
| | | @Excel(name = "计划完工日", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date completeDate; |
| | | |
| | | /** 需求日期 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "需求日期") |
| | | @Excel(name = "需求日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date demandDate; |
| | | |
| | | /** 适用工厂 */ |
| | |
| | | private String productionBase; |
| | | |
| | | /** 匹配状态 */ |
| | | @Excel(name = "匹配状态") |
| | | // @Excel(name = "匹配状态") |
| | | private String matchState; |
| | | |
| | | /** 匹配模式 */ |
| | | @Excel(name = "匹配模式") |
| | | // @Excel(name = "匹配模式") |
| | | private String matchMode; |
| | | |
| | | /** 未匹配需求数量 */ |
| | |
| | | private Date suggestedCompletionDate; |
| | | |
| | | /** 延迟风险标识 */ |
| | | @Excel(name = "延迟风险标识") |
| | | private String hasDelayRisk; |
| | | |
| | | private String batchNumber; |
| | |
| | | this.resourceGroupName = resourceGroupName; |
| | | } |
| | | |
| | | public String getPlant() { |
| | | return plant; |
| | | } |
| | | |
| | | public void setPlant(String plant) { |
| | | this.plant = plant; |
| | | } |
| | | |
| | | private LocalDate planDay; |
| | | private String resourceName; |
| | | private BigDecimal requireTimes; |
| | | private BigDecimal designTimes; |
| | | private BigDecimal capacityLoad; |
| | | private String resourceGroupName; |
| | | private String plant; |
| | | } |
| | |
| | | @Excel(name = "适用工序") |
| | | private String applicableProcess; |
| | | |
| | | /** 节假日 */ |
| | | private Object holidays; |
| | | |
| | | /** 适用工厂/车间/工序数组 */ |
| | | private Object applicable; |
| | | |
| | | /** 适用工厂/车间/工序数组 回显 */ |
| | | private String applicableTranslate; |
| | | |
| | | public String getApplicableTranslate() { |
| | | return applicableTranslate; |
| | | } |
| | | |
| | | public void setApplicableTranslate(String applicableTranslate) { |
| | | this.applicableTranslate = applicableTranslate; |
| | | } |
| | | |
| | | public Object getHolidays() { |
| | | return holidays; |
| | | } |
| | | |
| | | public void setHolidays(Object holidays) { |
| | | this.holidays = holidays; |
| | | } |
| | | |
| | | public Object getApplicable() { |
| | | return applicable; |
| | | } |
| | | |
| | | public void setApplicable(Object applicable) { |
| | | this.applicable = applicable; |
| | | } |
| | | |
| | | public void setId(Long id) |
| | | { |
| | | this.id = id; |
| | |
| | | private String documentNumber; |
| | | |
| | | /** 子件料号 */ |
| | | @Excel(name = "子件料号", sort = 2) |
| | | @Excel(name = "料号", sort = 2) |
| | | private String itemNumber; |
| | | |
| | | /** 生产数量 */ |
| | |
| | | * @return 结果 |
| | | */ |
| | | public int deleteApsWorkCalendarByIds(Long[] ids); |
| | | |
| | | /** |
| | | * 删除日历管理 |
| | | * |
| | | * @param ids 需要删除的数据主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteApsWorkCalendar(ApsWorkCalendar apsWorkCalendar); |
| | | } |
| | |
| | | */ |
| | | public List<ApsPlateStandardRequire> selectPlateSupplyGapList(ApsPlateStandardRequire apsPlateStandardRequire); |
| | | |
| | | @Transactional |
| | | |
| | | void generatorPlan(); |
| | | } |
| | |
| | | * @return JSONArray |
| | | */ |
| | | JSONArray selectCalendarView(ApsWorkCalendar apsWorkCalendar); |
| | | |
| | | /** |
| | | * 删除日历数据 |
| | | * @param apsWorkCalendar |
| | | * @return |
| | | */ |
| | | public int deleteApsWorkCalendar(ApsWorkCalendar apsWorkCalendar); |
| | | } |
| | |
| | | import java.time.*; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static java.util.stream.Collectors.groupingBy; |
| | | |
| | |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public JSONObject getCapacityPlanData(ApsGasPipingRouteStat apsGasPipingRouteStat) { |
| | | public JSONObject getCapacityPlanDataBackup(ApsGasPipingRouteStat apsGasPipingRouteStat) { |
| | | JSONObject result = new JSONObject(); |
| | | YearMonth yearMonth = YearMonth.parse(apsGasPipingRouteStat.getSearchEndDate()); |
| | | int daysInMonth = yearMonth.lengthOfMonth(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public JSONObject getCapacityPlanData(ApsGasPipingRouteStat apsGasPipingRouteStat) { |
| | | JSONObject result = new JSONObject(); |
| | | YearMonth yearMonth = YearMonth.parse(apsGasPipingRouteStat.getSearchEndDate()); |
| | | int daysInMonth = yearMonth.lengthOfMonth(); |
| | | LinkedHashSet<String> startPlanTimeSet = new LinkedHashSet<>(); |
| | | //工序分组统计 |
| | | LinkedHashMap<String, List<ApsResourceDateStat>> processMap = new LinkedHashMap<>(); |
| | | List<HashMap<String, List<ApsResourceDateStat>>> processList = new ArrayList<>(); |
| | | try { |
| | | //获取标准工序名称 |
| | | ApsStandardProcess apsStandardProcess = new ApsStandardProcess(); |
| | | apsStandardProcess.setMajor(apsGasPipingRouteStat.getMajor().equals("gas")?"气柜":"管路"); |
| | | List<ApsStandardProcess> apsStandardProcessList = apsStandardProcessService.selectApsStandardProcessList(apsStandardProcess); |
| | | apsStandardProcessList.sort((a, b)->a.getProcessName().compareTo(b.getProcessName())); |
| | | for(ApsStandardProcess temp:apsStandardProcessList){ |
| | | processMap.put(temp.getProcessName(), new ArrayList<ApsResourceDateStat>()); |
| | | } |
| | | //获取工序计划产能数据 |
| | | HashMap<String, ApsGasPipelineCapacityPlan> apsGasPipingPlanMap = new HashMap<>(); |
| | | ApsGasPipelineCapacityPlan searchCapacityPlan = new ApsGasPipelineCapacityPlan(); |
| | | searchCapacityPlan.setMajor(apsGasPipingRouteStat.getMajor().equals("gas")?"气柜":"管路"); |
| | | if("day".equals(apsGasPipingRouteStat.getSearchType())){ |
| | | searchCapacityPlan.setYear(yearMonth.getYear()+""); |
| | | searchCapacityPlan.setMonth(yearMonth.getMonthValue()+""); |
| | | for(int i=1;i<=daysInMonth;i++){ |
| | | startPlanTimeSet.add(yearMonth +"-"+ (i<10?"0"+i:i)); |
| | | } |
| | | }else if("month".equals(apsGasPipingRouteStat.getSearchType())){ |
| | | searchCapacityPlan.setYear(yearMonth.getYear()+""); |
| | | YearMonth start = YearMonth.of(Integer.parseInt(apsGasPipingRouteStat.getSearchStartDate().split("-")[0]), Integer.parseInt(apsGasPipingRouteStat.getSearchStartDate().split("-")[1])); |
| | | YearMonth end = YearMonth.of(Integer.parseInt(apsGasPipingRouteStat.getSearchEndDate().split("-")[0]), Integer.parseInt(apsGasPipingRouteStat.getSearchEndDate().split("-")[1])); |
| | | List<String> yearMonths = getYearMonthsInRange(start, end); |
| | | startPlanTimeSet.addAll(yearMonths); |
| | | } |
| | | List<ApsGasPipelineCapacityPlan> apsGasPipelineCapacityPlanList = apsGasPipelineCapacityPlanMapper.selectApsGasPipelineCapacityPlanList(searchCapacityPlan); |
| | | apsGasPipelineCapacityPlanList.forEach(apsGasPipelineCapacityPlan -> { |
| | | String key = apsGasPipelineCapacityPlan.getProcessName() + "-" + apsGasPipelineCapacityPlan.getOrgCode() + "-" + apsGasPipelineCapacityPlan.getYear() + "-" + (Integer.parseInt(apsGasPipelineCapacityPlan.getMonth())<10?"0"+apsGasPipelineCapacityPlan.getMonth():apsGasPipelineCapacityPlan.getMonth()); |
| | | apsGasPipingPlanMap.put(key, apsGasPipelineCapacityPlan); |
| | | }); |
| | | //计算日产能数据 |
| | | DateTimeFormatter formatter = null; |
| | | List<ApsGasPipingRouteStat> apsGasPipingRouteStats; |
| | | SimpleDateFormat simpleDateFormat = null; |
| | | apsGasPipingRouteStat.setSearchStartDate(apsGasPipingRouteStat.getSearchStartDate()+"-01 00:00:00"); |
| | | apsGasPipingRouteStat.setSearchEndDate(apsGasPipingRouteStat.getSearchEndDate()+"-"+ daysInMonth +" 23:59:59"); |
| | | if("day".equals(apsGasPipingRouteStat.getSearchType())){ |
| | | formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | }else if("month".equals(apsGasPipingRouteStat.getSearchType())){ |
| | | formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | simpleDateFormat = new SimpleDateFormat("yyyy-MM"); |
| | | } |
| | | ApsGasPipingRouteStat queryStatParam = new ApsGasPipingRouteStat(); |
| | | BeanUtils.copyProperties(apsGasPipingRouteStat,queryStatParam); |
| | | queryStatParam.setMajor(""); |
| | | apsGasPipingRouteStats = apsGasPipingRouteStatMapper.selectApsGasPipingRouteStatList(queryStatParam); |
| | | //根据开工日进行升序排序 |
| | | apsGasPipingRouteStats.sort((a, b)->a.getProcessPlanStartDay().compareTo(b.getProcessPlanStartDay())); |
| | | //工序开工日期 |
| | | String planStartDate = ""; |
| | | //统计所有工序对应的开工时间 |
| | | for (ApsGasPipingRouteStat apsGasPipingRouteStatTemp : apsGasPipingRouteStats) { |
| | | if(processMap.containsKey(apsGasPipingRouteStatTemp.getProcessName())){ |
| | | planStartDate = simpleDateFormat.format(apsGasPipingRouteStatTemp.getProcessPlanStartDay()); |
| | | if("month".equals(apsGasPipingRouteStat.getSearchType())){ |
| | | planStartDate = planStartDate+"-01"; |
| | | } |
| | | ApsResourceDateStat apsResourceDateStat = new ApsResourceDateStat(); |
| | | apsResourceDateStat.setPlanDay(LocalDate.parse(planStartDate, formatter)); |
| | | apsResourceDateStat.setResourceName(apsGasPipingRouteStatTemp.getProcessName()); |
| | | apsResourceDateStat.setPlant(apsGasPipingRouteStatTemp.getPlant()); |
| | | //查询气柜管路产能规划表 |
| | | String capacityKey = apsGasPipingRouteStatTemp.getProcessName() + "-" + apsGasPipingRouteStatTemp.getPlant() + "-" + planStartDate.substring(0, 7); |
| | | apsResourceDateStat.setDesignTimes(apsGasPipingPlanMap.get(capacityKey)!=null?apsGasPipingPlanMap.get(capacityKey).getDayProduceAllNum():new BigDecimal(0)); |
| | | //查询料号工序产能表 |
| | | apsResourceDateStat.setRequireTimes(apsGasPipingRouteStatTemp.getProcessTotalTime()); |
| | | if(apsResourceDateStat.getDesignTimes().compareTo(BigDecimal.ZERO)>0){ |
| | | apsResourceDateStat.setCapacityLoad(apsResourceDateStat.getRequireTimes() |
| | | .divide(apsResourceDateStat.getDesignTimes(), 2, RoundingMode.HALF_UP) |
| | | .multiply(new BigDecimal(100))); |
| | | }else{ |
| | | apsResourceDateStat.setCapacityLoad(BigDecimal.valueOf(0)); |
| | | } |
| | | |
| | | List<ApsResourceDateStat> apsResourceDateStatList = processMap.get(apsGasPipingRouteStatTemp.getProcessName()); |
| | | apsResourceDateStatList.add(apsResourceDateStat); |
| | | processMap.put(apsGasPipingRouteStatTemp.getProcessName(), apsResourceDateStatList); |
| | | } |
| | | } |
| | | //聚合每道工序的开工时间和产能 |
| | | for (Map.Entry<String, List<ApsResourceDateStat>> entry : processMap.entrySet()) { |
| | | String processName = entry.getKey(); |
| | | List<ApsResourceDateStat> apsResourceDateStatList = entry.getValue(); |
| | | |
| | | if("day".equals(apsGasPipingRouteStat.getSearchType())) { |
| | | // 按天统计时保持原有逻辑,不按工厂分组 |
| | | LinkedHashMap<String, ApsResourceDateStat> dayMap = new LinkedHashMap<>(); |
| | | |
| | | // 首先,为所有日期创建初始记录 |
| | | for(String date : startPlanTimeSet) { |
| | | ApsResourceDateStat initStat = new ApsResourceDateStat(); |
| | | initStat.setPlanDay(LocalDate.parse(date, formatter)); |
| | | initStat.setResourceName(processName); |
| | | initStat.setResourceGroupName(processName); |
| | | initStat.setRequireTimes(new BigDecimal(0)); |
| | | String capacityKey = processName + "-" + date.substring(0,7); |
| | | initStat.setDesignTimes(apsGasPipingPlanMap.get(capacityKey)!=null?apsGasPipingPlanMap.get(capacityKey).getDayProduceAllNum():new BigDecimal(0)); |
| | | initStat.setCapacityLoad(new BigDecimal(0)); |
| | | dayMap.put(date, initStat); |
| | | } |
| | | |
| | | // 然后处理实际数据 |
| | | for (ApsResourceDateStat apsResourceDateStat : apsResourceDateStatList) { |
| | | String dateKey = apsResourceDateStat.getPlanDay().toString(); |
| | | if(dayMap.containsKey(dateKey)){ |
| | | ApsResourceDateStat apsResourceDateStatTemp = dayMap.get(dateKey); |
| | | String capacityKey = processName + "-" + dateKey.substring(0,7); |
| | | apsResourceDateStatTemp.setDesignTimes(apsGasPipingPlanMap.get(capacityKey)!=null?apsGasPipingPlanMap.get(capacityKey).getDayProduceAllNum():new BigDecimal(0)); |
| | | apsResourceDateStatTemp.setRequireTimes(apsResourceDateStatTemp.getRequireTimes().add(apsResourceDateStat.getRequireTimes())); |
| | | if(apsResourceDateStatTemp.getDesignTimes().compareTo(BigDecimal.ZERO) > 0){ |
| | | apsResourceDateStatTemp.setCapacityLoad(apsResourceDateStatTemp.getRequireTimes() |
| | | .divide(apsResourceDateStatTemp.getDesignTimes(), 2, RoundingMode.HALF_UP) |
| | | .multiply(new BigDecimal(100))); |
| | | }else{ |
| | | apsResourceDateStatTemp.setCapacityLoad(new BigDecimal(0)); |
| | | } |
| | | apsResourceDateStatTemp.setResourceGroupName(processName); |
| | | apsResourceDateStatTemp.setPlanDay(apsResourceDateStat.getPlanDay()); |
| | | dayMap.put(dateKey, apsResourceDateStatTemp); |
| | | } |
| | | } |
| | | |
| | | List<ApsResourceDateStat> tempList = new ArrayList<>(dayMap.values()); |
| | | HashMap<String, List<ApsResourceDateStat>> temp = new HashMap<>(); |
| | | temp.put(processName, tempList); |
| | | processList.add(temp); |
| | | } else { |
| | | // 按月统计时才按工厂分组 |
| | | if (apsResourceDateStatList.isEmpty()) { |
| | | // 从产能规划数据中获取所有的工厂 |
| | | Set<String> plants = apsGasPipelineCapacityPlanList.stream() |
| | | .filter(plan -> plan.getProcessName().equals(processName)) |
| | | .map(ApsGasPipelineCapacityPlan::getOrgCode) |
| | | .filter(orgCode -> orgCode != null && !orgCode.trim().isEmpty()) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | // 如果没有找到任何有效工厂,跳过这个工序 |
| | | if (plants.isEmpty()) { |
| | | continue; |
| | | } |
| | | |
| | | // 为每个工厂创建空记录 |
| | | for (String plant : plants) { |
| | | LinkedHashMap<String, ApsResourceDateStat> dayMap = new LinkedHashMap<>(); |
| | | // 为每个月份创建记录 |
| | | for(String monthDate : startPlanTimeSet) { |
| | | String tempTime = monthDate + "-01"; |
| | | ApsResourceDateStat apsResourceDateStat = new ApsResourceDateStat(); |
| | | apsResourceDateStat.setPlanDay(LocalDate.parse(tempTime, formatter)); |
| | | apsResourceDateStat.setResourceName(processName); |
| | | apsResourceDateStat.setResourceGroupName(processName + "-" + plant); |
| | | apsResourceDateStat.setPlant(plant); |
| | | apsResourceDateStat.setRequireTimes(new BigDecimal(0)); |
| | | String capacityKey = processName + "-" + plant + "-" + monthDate; |
| | | apsResourceDateStat.setDesignTimes(apsGasPipingPlanMap.get(capacityKey)!=null?apsGasPipingPlanMap.get(capacityKey).getMonthProduceAllNum():new BigDecimal(0)); |
| | | apsResourceDateStat.setCapacityLoad(new BigDecimal(0)); |
| | | dayMap.put(monthDate, apsResourceDateStat); |
| | | } |
| | | List<ApsResourceDateStat> tempList = new ArrayList<>(dayMap.values()); |
| | | HashMap<String, List<ApsResourceDateStat>> temp = new HashMap<>(); |
| | | temp.put(processName + "-" + plant, tempList); |
| | | processList.add(temp); |
| | | } |
| | | } else { |
| | | // 按工厂分组,并过滤掉plant为null或空字符串的记录 |
| | | Map<String, List<ApsResourceDateStat>> plantGroups = apsResourceDateStatList.stream() |
| | | .filter(stat -> stat.getPlant() != null && !stat.getPlant().trim().isEmpty()) |
| | | .collect(groupingBy(ApsResourceDateStat::getPlant)); |
| | | |
| | | // 如果过滤后没有有效的工厂数据,跳过这个工序 |
| | | if (plantGroups.isEmpty()) { |
| | | continue; |
| | | } |
| | | |
| | | // 对每个工厂的数据进行处理 |
| | | for (Map.Entry<String, List<ApsResourceDateStat>> plantEntry : plantGroups.entrySet()) { |
| | | String plant = plantEntry.getKey(); |
| | | // 再次确认plant不为空 |
| | | if (plant == null || plant.trim().isEmpty()) { |
| | | continue; |
| | | } |
| | | List<ApsResourceDateStat> plantStats = plantEntry.getValue(); |
| | | LinkedHashMap<String, ApsResourceDateStat> dayMap = new LinkedHashMap<>(); |
| | | |
| | | // 首先为所有月份创建初始记录 |
| | | for(String monthDate : startPlanTimeSet) { |
| | | String tempTime = monthDate + "-01"; |
| | | ApsResourceDateStat initStat = new ApsResourceDateStat(); |
| | | initStat.setPlanDay(LocalDate.parse(tempTime, formatter)); |
| | | initStat.setResourceName(processName); |
| | | initStat.setResourceGroupName(processName + "-" + plant); |
| | | initStat.setPlant(plant); |
| | | initStat.setRequireTimes(new BigDecimal(0)); |
| | | String capacityKey = processName + "-" + plant + "-" + monthDate; |
| | | initStat.setDesignTimes(apsGasPipingPlanMap.get(capacityKey)!=null?apsGasPipingPlanMap.get(capacityKey).getMonthProduceAllNum():new BigDecimal(0)); |
| | | initStat.setCapacityLoad(new BigDecimal(0)); |
| | | dayMap.put(monthDate, initStat); |
| | | } |
| | | |
| | | // 然后处理实际数据 |
| | | for (ApsResourceDateStat stat : plantStats) { |
| | | String monthKey = stat.getPlanDay().toString().substring(0, 7); |
| | | if (dayMap.containsKey(monthKey)) { |
| | | ApsResourceDateStat existingStat = dayMap.get(monthKey); |
| | | String capacityKey = processName + "-" + plant + "-" + monthKey; |
| | | existingStat.setDesignTimes(apsGasPipingPlanMap.get(capacityKey)!=null?apsGasPipingPlanMap.get(capacityKey).getMonthProduceAllNum():new BigDecimal(0)); |
| | | existingStat.setRequireTimes(existingStat.getRequireTimes().add(stat.getRequireTimes())); |
| | | if(existingStat.getDesignTimes().compareTo(BigDecimal.ZERO) > 0){ |
| | | existingStat.setCapacityLoad(existingStat.getRequireTimes() |
| | | .divide(existingStat.getDesignTimes(), 2, RoundingMode.HALF_UP) |
| | | .multiply(new BigDecimal(100))); |
| | | } |
| | | } |
| | | } |
| | | |
| | | List<ApsResourceDateStat> tempList = new ArrayList<>(dayMap.values()); |
| | | HashMap<String, List<ApsResourceDateStat>> temp = new HashMap<>(); |
| | | temp.put(processName + "_" + plant, tempList); |
| | | processList.add(temp); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //排序时间标题 |
| | | List<String> sortedStartPlanTimeList = new ArrayList<>(startPlanTimeSet); |
| | | Collections.sort(sortedStartPlanTimeList); |
| | | for (int i=0;i<processList.size();i++){ |
| | | HashMap<String, List<ApsResourceDateStat>> temp = processList.get(i); |
| | | for (Map.Entry<String, List<ApsResourceDateStat>> entry : temp.entrySet()){ |
| | | List<ApsResourceDateStat> apsResourceDateStatList = entry.getValue(); |
| | | String key = entry.getKey(); |
| | | List<ApsResourceDateStat> crtList = new ArrayList<>(); |
| | | for(String tempTime:sortedStartPlanTimeList) { |
| | | if("month".equals(apsGasPipingRouteStat.getSearchType())){ |
| | | tempTime += "-01"; |
| | | } |
| | | LocalDate crtDate = LocalDate.parse(tempTime, formatter); |
| | | Optional<ApsResourceDateStat> first = apsResourceDateStatList.stream().filter(x -> x.getPlanDay().equals(crtDate)).findFirst(); |
| | | if (first.isPresent()) { |
| | | ApsResourceDateStat apsResourceDateStat = first.get(); |
| | | crtList.add(apsResourceDateStat); |
| | | } else { |
| | | ApsResourceDateStat apsResourceDateStat = new ApsResourceDateStat(); |
| | | apsResourceDateStat.setPlanDay(LocalDate.parse(tempTime, formatter)); |
| | | String[] keyParts = key.split("-"); |
| | | String processNamePart = keyParts[0]; |
| | | String plantPart = keyParts[1]; |
| | | String capacityKey = processNamePart + "-" + plantPart + "-" + tempTime.substring(0,7); |
| | | if ("month".equals(apsGasPipingRouteStat.getSearchType())) { |
| | | apsResourceDateStat.setDesignTimes(apsGasPipingPlanMap.get(capacityKey) != null ? apsGasPipingPlanMap.get(capacityKey).getMonthProduceAllNum() : new BigDecimal(0)); |
| | | } else { |
| | | apsResourceDateStat.setDesignTimes(apsGasPipingPlanMap.get(capacityKey) != null ? apsGasPipingPlanMap.get(capacityKey).getDayProduceAllNum() : new BigDecimal(0)); |
| | | } |
| | | apsResourceDateStat.setRequireTimes(new BigDecimal(0)); |
| | | apsResourceDateStat.setCapacityLoad(new BigDecimal(0)); |
| | | apsResourceDateStat.setResourceName(processNamePart); |
| | | apsResourceDateStat.setResourceGroupName(key); |
| | | apsResourceDateStat.setPlant(plantPart); |
| | | apsResourceDateStatList.add(apsResourceDateStat); |
| | | crtList.add(apsResourceDateStat); |
| | | } |
| | | temp.put(entry.getKey(), crtList); |
| | | processList.set(i, temp); |
| | | } |
| | | } |
| | | } |
| | | result.put("planTable", processList); |
| | | result.put("planTitle", sortedStartPlanTimeList); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public void exportExcel(HttpServletResponse response, ApsGasPipingRouteStat apsGasPipingRouteStat) { |
| | | SXSSFWorkbook wb = new SXSSFWorkbook(500); |
| | | wb.createSheet(); |
| | |
| | | String batchNum= requireBatchService.getNewBatchNumber(); |
| | | /*获取钣金主单信息*/ |
| | | List<ApsPlatePlan> mainPlans = platePlanMapper.selectPlatePlanByPlantMajor(plantCode,mainOrderType); |
| | | Hashtable<String, ApsMaterialStorageManagement> usedStorage = new Hashtable<>(); |
| | | Hashtable<String, BigDecimal> usedStorage = new Hashtable<>(); |
| | | log.info("开始生成需求:"); |
| | | for (ApsPlatePlan mainPlan : mainPlans) { |
| | | String itemNumber = mainPlan.getItemNumber(); |
| | |
| | | }*/ |
| | | |
| | | } |
| | | usedStorage.forEach((key,value)->{ |
| | | log.info("料号:"+key+",库存:"+value); |
| | | }); |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | List<ApsPlateStandardRequire> allRequires, |
| | | Long level,List<ApsPlateStandardRequireBomStockDetail> stockDetailsList, |
| | | List<ApsPlateStandardRequireBomOrderDetail> orderDetailsList, |
| | | Hashtable<String, ApsMaterialStorageManagement> usedStorage |
| | | Hashtable<String, BigDecimal> usedStorage |
| | | ) { |
| | | /*构建需求信息*/ |
| | | ApsPlateStandardRequire require = new ApsPlateStandardRequire(); |
| | |
| | | , afterStockAmount, require.getId(), stockDetailsList |
| | | ); |
| | | /*更新内存中的库存使用信息*/ |
| | | // usedStorage.put(itemCode, storage); |
| | | usedStorage.put(itemCode, afterStockAmount); |
| | | } |
| | | } |
| | | /*未匹配数量,默认为净需求*/ |
| | |
| | | List<ApsWorkCalendar> list = apsWorkCalendarMapper.selectApsWorkCalendarList(apsWorkCalendar); |
| | | for (ApsWorkCalendar apsWorkCalendarTemp : list) { |
| | | //工作日 |
| | | if("1".equals(apsWorkCalendarTemp.getType())){ |
| | | //获取日历规则 |
| | | org.postgresql.util.PGobject pgObject = (org.postgresql.util.PGobject) apsWorkCalendarTemp.getContent(); |
| | | JSONArray weekdays = (JSON.parseObject(pgObject.getValue())).getJSONArray("weekdays"); |
| | | org.postgresql.util.PGobject pgObjectWeekdays = (org.postgresql.util.PGobject) apsWorkCalendarTemp.getContent(); |
| | | JSONArray weekdays = (JSON.parseObject(pgObjectWeekdays.getValue())).getJSONArray("weekdays"); |
| | | HashMap<String, String> weekdaysMap = new HashMap<>(); |
| | | for (int i = 0; i < weekdays.size(); i++) { |
| | | weekdaysMap.put(weekdays.getJSONObject(i).getString("day"), weekdays.getJSONObject(i).getString("work")); |
| | | } |
| | | //根据effectiveDate和expiringDate算出日期范围内的每一天 |
| | | List<LocalDate> datesTemp = getDatesBetween(apsWorkCalendarTemp.getEffectiveDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), apsWorkCalendarTemp.getExpiringDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate()); |
| | | for (LocalDate dateTemp: datesTemp) { |
| | | List<LocalDate> datesTempWeekdays = getDatesBetween(apsWorkCalendarTemp.getEffectiveDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), apsWorkCalendarTemp.getExpiringDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate()); |
| | | for (LocalDate dateTemp: datesTempWeekdays) { |
| | | if(baseCalendar.containsKey(dateTemp+"")){ |
| | | if ("y".equals(weekdaysMap.get(dateTemp.getDayOfWeek().getDisplayName(java.time.format.TextStyle.FULL, Locale.ENGLISH)))) { |
| | | baseCalendar.put(dateTemp+"", "工作日"); |
| | |
| | | } |
| | | } |
| | | } |
| | | }else if("2".equals(apsWorkCalendarTemp.getType())){ |
| | | //休息日 |
| | | org.postgresql.util.PGobject pgObject = (org.postgresql.util.PGobject) apsWorkCalendarTemp.getContent(); |
| | | JSONObject holidays = (JSON.parseObject(pgObject.getValue())).getJSONObject("holidays"); |
| | | List<LocalDate> datesTemp = getDatesBetween(holidays.getObject("startdate", LocalDate.class), holidays.getObject("enddate", LocalDate.class)); |
| | | for (LocalDate dateTemp: datesTemp) { |
| | | org.postgresql.util.PGobject pgObjectHolidays = (org.postgresql.util.PGobject) apsWorkCalendarTemp.getHolidays(); |
| | | if(pgObjectHolidays!=null){ |
| | | JSONArray holidays = (JSON.parseObject(pgObjectHolidays.getValue())).getJSONArray("holidays"); |
| | | for (int i = 0; i < holidays.size(); i++){ |
| | | JSONObject h = holidays.getJSONObject(i); |
| | | List<LocalDate> datesTempHolidays = getDatesBetween(h.getObject("startdate", LocalDate.class), h.getObject("enddate", LocalDate.class)); |
| | | for (LocalDate dateTemp: datesTempHolidays) { |
| | | if(baseCalendar.containsKey(dateTemp+"")){ |
| | | baseCalendar.put(dateTemp+"", "节假日"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | return res; |
| | | } |
| | | |
| | | @Override |
| | | public int deleteApsWorkCalendar(ApsWorkCalendar apsWorkCalendar){ |
| | | return apsWorkCalendarMapper.deleteApsWorkCalendar(apsWorkCalendar); |
| | | } |
| | | |
| | | private List<LocalDate> getCalendarData(int year, int month) { |
| | | // 获取4月1号的当周的周日 |
| | | LocalDate startDate = LocalDate.of(year, month, 1) |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsBomHeaderMapper"> |
| | | |
| | | <resultMap type="ApsBomHeader" id="ApsBomHeaderResult"> |
| | | <resultMap type="com.aps.core.domain.ApsBomHeader" id="ApsBomHeaderResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="bomHeaderId" column="bom_header_id" /> |
| | | <result property="itemCode" column="item_code" /> |
| | |
| | | from aps_bom_header |
| | | </sql> |
| | | |
| | | <select id="selectApsBomHeaderList" parameterType="ApsBomHeader" resultMap="ApsBomHeaderResult"> |
| | | <select id="selectApsBomHeaderList" parameterType="com.aps.core.domain.ApsBomHeader" resultMap="ApsBomHeaderResult"> |
| | | <include refid="selectApsBomHeaderVo"/> |
| | | <where> |
| | | <if test="bomHeaderId != null and bomHeaderId != ''"> and bom_header_id = #{bomHeaderId}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsBomHeader" parameterType="ApsBomHeader"> |
| | | <insert id="insertApsBomHeader" parameterType="com.aps.core.domain.ApsBomHeader"> |
| | | insert into aps_bom_header |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsBomHeader" parameterType="ApsBomHeader"> |
| | | <update id="updateApsBomHeader" parameterType="com.aps.core.domain.ApsBomHeader"> |
| | | update aps_bom_header |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="bomHeaderId != null">bom_header_id = #{bomHeaderId},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsBomMapper"> |
| | | |
| | | <resultMap type="ApsBom" id="ApsBomResult"> |
| | | <resultMap type="com.aps.core.domain.ApsBom" id="ApsBomResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="bomLineId" column="bom_line_id" /> |
| | | <result property="bomHeaderId" column="bom_header_id" /> |
| | |
| | | from aps_bom_line |
| | | </sql> |
| | | |
| | | <select id="selectApsBomList" parameterType="ApsBom" resultMap="ApsBomResult"> |
| | | <select id="selectApsBomList" parameterType="com.aps.core.domain.ApsBom" resultMap="ApsBomResult"> |
| | | <include refid="selectApsBomVo"/> |
| | | <where> |
| | | <if test="bomLineId != null and bomLineId != ''"> and bom_line_id = #{bomLineId}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsBom" parameterType="ApsBom" useGeneratedKeys="true" keyProperty="id"> |
| | | <insert id="insertApsBom" parameterType="com.aps.core.domain.ApsBom" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into aps_bom_line |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="bomLineId != null">bom_line_id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsBom" parameterType="ApsBom"> |
| | | <update id="updateApsBom" parameterType="com.aps.core.domain.ApsBom"> |
| | | update aps_bom_line |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="bomLineId != null">bom_line_id = #{bomLineId},</if> |
| | |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <resultMap type="ApsBom" id="ApsBomLineResult"> |
| | | <resultMap type="com.aps.core.domain.ApsBom" id="ApsBomLineResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="bomLineId" column="bom_line_id" /> |
| | | <result property="itemCode" column="item_code" /> |
| | |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsGasMaterialUsageMapper"> |
| | | <resultMap type="ApsGasMaterialUsage" id="ApsGasMaterialUsageResult"> |
| | | <resultMap type="com.aps.core.domain.ApsGasMaterialUsage" id="ApsGasMaterialUsageResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="itemNumber" column="item_number" /> |
| | | <result property="drawingNo" column="drawing_no" /> |
| | |
| | | select id, item_number, drawing_no, version, process_name, standard_amount, org_code, create_by, create_time, del_flag from aps_gas_material_usage |
| | | </sql> |
| | | |
| | | <select id="selectApsGasMaterialUsageList" parameterType="ApsGasMaterialUsage" resultMap="ApsGasMaterialUsageResult"> |
| | | <select id="selectApsGasMaterialUsageList" parameterType="com.aps.core.domain.ApsGasMaterialUsage" resultMap="ApsGasMaterialUsageResult"> |
| | | <include refid="selectApsGasMaterialUsageVo"/> |
| | | <where> |
| | | <if test="itemNumber != null and itemNumber != ''"> and item_number = #{itemNumber}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsGasMaterialUsage" parameterType="ApsGasMaterialUsage" useGeneratedKeys="true" keyProperty="id"> |
| | | <insert id="insertApsGasMaterialUsage" parameterType="com.aps.core.domain.ApsGasMaterialUsage" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into aps_gas_material_usage |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="itemNumber != null">item_number,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsGasMaterialUsage" parameterType="ApsGasMaterialUsage"> |
| | | <update id="updateApsGasMaterialUsage" parameterType="com.aps.core.domain.ApsGasMaterialUsage"> |
| | | update aps_gas_material_usage |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="itemNumber != null">item_number = #{itemNumber},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsGasPipelineCapacityPlanMapper"> |
| | | |
| | | <resultMap type="ApsGasPipelineCapacityPlan" id="ApsGasPipelineCapacityPlanResult"> |
| | | <resultMap type="com.aps.core.domain.ApsGasPipelineCapacityPlan" id="ApsGasPipelineCapacityPlanResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="processName" column="process_name" /> |
| | | <result property="year" column="year" /> |
| | |
| | | select id, process_name, year, month, major, day_produce_type, day_produce_num, day_produce_unit, personnel_number, day_produce_all_num, days, month_produce_all_num, remark, create_by, create_time, update_by, update_time, org_code from aps_gas_pipeline_capacity_plan |
| | | </sql> |
| | | |
| | | <select id="selectApsGasPipelineCapacityPlanList" parameterType="ApsGasPipelineCapacityPlan" resultMap="ApsGasPipelineCapacityPlanResult"> |
| | | <select id="selectApsGasPipelineCapacityPlanList" parameterType="com.aps.core.domain.ApsGasPipelineCapacityPlan" resultMap="ApsGasPipelineCapacityPlanResult"> |
| | | <include refid="selectApsGasPipelineCapacityPlanVo"/> |
| | | <where> |
| | | <if test="processName != null and processName != ''"> and process_name like concat('%', #{processName}, '%')</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsGasPipelineCapacityPlan" parameterType="ApsGasPipelineCapacityPlan"> |
| | | <insert id="insertApsGasPipelineCapacityPlan" parameterType="com.aps.core.domain.ApsGasPipelineCapacityPlan"> |
| | | insert into aps_gas_pipeline_capacity_plan |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsGasPipelineCapacityPlan" parameterType="ApsGasPipelineCapacityPlan"> |
| | | <update id="updateApsGasPipelineCapacityPlan" parameterType="com.aps.core.domain.ApsGasPipelineCapacityPlan"> |
| | | update aps_gas_pipeline_capacity_plan |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="processName != null">process_name = #{processName},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsGasPipingPlanMapper"> |
| | | |
| | | <resultMap type="ApsGasPipingPlan" id="ApsGasPipingPlanResult"> |
| | | <resultMap type="com.aps.core.domain.ApsGasPipingPlan" id="ApsGasPipingPlanResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="masterPlanner" column="master_planner" /> |
| | | <result property="weekDay" column="week_day" /> |
| | |
| | | <!-- </collection>--> |
| | | </resultMap> |
| | | |
| | | <resultMap type="ApsGasPipingPlan" id="ApsGasPipingPlanResultWithProcess"> |
| | | <resultMap type="com.aps.core.domain.ApsGasPipingPlan" id="ApsGasPipingPlanResultWithProcess"> |
| | | <result property="documentNumber" column="document_number" /> |
| | | <result property="itemNumber" column="item_number" /> |
| | | <result property="productionQuantity" column="production_quantity" /> |
| | |
| | | from aps_gas_piping_plan |
| | | </sql> |
| | | |
| | | <select id="selectApsGasPipingPlanList" parameterType="ApsGasPipingPlan" resultMap="ApsGasPipingPlanResult"> |
| | | <select id="selectApsGasPipingPlanList" parameterType="com.aps.core.domain.ApsGasPipingPlan" resultMap="ApsGasPipingPlanResult"> |
| | | <include refid="selectApsGasPipingPlanVo"/> |
| | | <where> |
| | | <if test="masterPlanner != null and masterPlanner != ''"> and master_planner like concat('%', #{masterPlanner}, '%')</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsGasPipingPlan" parameterType="ApsGasPipingPlan"> |
| | | <insert id="insertApsGasPipingPlan" parameterType="com.aps.core.domain.ApsGasPipingPlan"> |
| | | insert into aps_gas_piping_plan |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null and id != ''">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsGasPipingPlan" parameterType="ApsGasPipingPlan"> |
| | | <update id="updateApsGasPipingPlan" parameterType="com.aps.core.domain.ApsGasPipingPlan"> |
| | | update aps_gas_piping_plan |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="masterPlanner != null">master_planner = #{masterPlanner},</if> |
| | |
| | | update aps_gas_piping_plan set del_flag='1' where del_flag ='0' |
| | | </update> |
| | | |
| | | <select id="selectApsGasPipingPlanWithProcess" parameterType="ApsGasPipingPlan" resultMap="ApsGasPipingPlanResultWithProcess"> |
| | | <select id="selectApsGasPipingPlanWithProcess" parameterType="com.aps.core.domain.ApsGasPipingPlan" resultMap="ApsGasPipingPlanResultWithProcess"> |
| | | select c.* from (select a.document_number,a.item_number,a.process_number,a.production_quantity,a.plan_type,a.plan_end_day,a.std_op,b.process_name,b.process_number as process_number_sub,b.standard_time,b.process_plan_start_day,b.process_plan_end_day from aps_gas_piping_plan a |
| | | left join aps_process_route b on a.document_number = b.work_order_no |
| | | where a.document_status in ('0','1','2','4') and a.op_status!='完工' and b.process_plan_start_day is not null and b.process_name in(select process_name from aps_standard_process where major='气柜' or major='管路') ORDER BY a.document_number,b.process_number) c GROUP BY c.document_number,c.item_number,c.process_number,c.production_quantity,c.process_name,c.process_number_sub,c.standard_time,c.process_plan_start_day,c.plan_type,c.process_plan_end_day,c.plan_end_day,c.std_op |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsGasPipingPlanTempMapper"> |
| | | |
| | | <resultMap type="ApsGasPipingPlanTemp" id="ApsGasPipingPlanTempResult"> |
| | | <resultMap type="com.aps.core.domain.ApsGasPipingPlanTemp" id="ApsGasPipingPlanTempResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="masterPlanner" column="master_planner" /> |
| | | <result property="weekDay" column="week_day" /> |
| | |
| | | select id, master_planner, week_day, week_cycle, main_part_number, main_part_drawing_number, customer, business_type, document_number, requirement_type, document_status, item_number, drawing_no, version_number, production_quantity, good_products_quantity, process_number, work_center, department, plan_start_day, plan_end_day, standby_number, standby_name, standby_stock, next_process_deparment, is_suspended, is_outsourcing, account, advanced_materials, advanced_document_number, advanced_requirement_day, is_plan_complete, is_stock_complete, has_turnback, has_risk, batch_number from aps_gas_piping_plan_temp |
| | | </sql> |
| | | |
| | | <select id="selectApsGasPipingPlanTempList" parameterType="ApsGasPipingPlanTemp" resultMap="ApsGasPipingPlanTempResult"> |
| | | <select id="selectApsGasPipingPlanTempList" parameterType="com.aps.core.domain.ApsGasPipingPlanTemp" resultMap="ApsGasPipingPlanTempResult"> |
| | | <include refid="selectApsGasPipingPlanTempVo"/> |
| | | <where> |
| | | <if test="batchNumber != null and batchNumber != ''"> and batch_number = #{batchNumber}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsGasPipingPlanTemp" parameterType="ApsGasPipingPlanTemp"> |
| | | <insert id="insertApsGasPipingPlanTemp" parameterType="com.aps.core.domain.ApsGasPipingPlanTemp"> |
| | | insert into aps_gas_piping_plan_temp |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null and id != ''">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsGasPipingPlanTemp" parameterType="ApsGasPipingPlanTemp"> |
| | | <update id="updateApsGasPipingPlanTemp" parameterType="com.aps.core.domain.ApsGasPipingPlanTemp"> |
| | | update aps_gas_piping_plan_temp |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="masterPlanner != null">master_planner = #{masterPlanner},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsGasPipingRouteStatMapper"> |
| | | |
| | | <resultMap type="ApsGasPipingRouteStat" id="ApsGasPipingRouteStatResult"> |
| | | <resultMap type="com.aps.core.domain.ApsGasPipingRouteStat" id="ApsGasPipingRouteStatResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="workOrderNo" column="work_order_no" /> |
| | | <result property="roadProcessNumber" column="road_process_number" /> |
| | |
| | | process_plan_start_day, design_times, del_flag, create_by, |
| | | process_name, create_time, item_number, standard_dosage, |
| | | process_total_dosage, design_capacity, major, plan_start_year, |
| | | plan_start_month, plan_start_day , warning |
| | | plan_start_month, plan_start_day , warning, plant |
| | | from aps_gas_piping_route_stat |
| | | </sql> |
| | | |
| | | <select id="selectApsGasPipingRouteStatList" parameterType="ApsGasPipingRouteStat" resultMap="ApsGasPipingRouteStatResult"> |
| | | <select id="selectApsGasPipingRouteStatList" parameterType="com.aps.core.domain.ApsGasPipingRouteStat" resultMap="ApsGasPipingRouteStatResult"> |
| | | <include refid="selectApsGasPipingRouteStatVo"/> |
| | | <where> |
| | | <if test="workOrderNo != null and workOrderNo != ''"> and work_order_no = #{workOrderNo}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsGasPipingRouteStat" parameterType="ApsGasPipingRouteStat"> |
| | | <insert id="insertApsGasPipingRouteStat" parameterType="com.aps.core.domain.ApsGasPipingRouteStat"> |
| | | insert into aps_gas_piping_route_stat |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsGasPipingRouteStat" parameterType="ApsGasPipingRouteStat"> |
| | | <update id="updateApsGasPipingRouteStat" parameterType="com.aps.core.domain.ApsGasPipingRouteStat"> |
| | | update aps_gas_piping_route_stat |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="workOrderNo != null">work_order_no = #{workOrderNo},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsMaterialManagementMapper"> |
| | | |
| | | <resultMap type="ApsMaterialManagement" id="ApsMaterialManagementResult"> |
| | | <resultMap type="com.aps.core.domain.ApsMaterialManagement" id="ApsMaterialManagementResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="itemNumber" column="item_number" /> |
| | | <result property="materialDescription" column="material_description" /> |
| | |
| | | select id, item_number, material_description, material_status, material_type, professional_affiliation, drawing_no, version_number, advance_production_days, split_batch, self_made, applicable_factories, applicable_workshop, effective_date, expiring_date, integration_date, create_by, create_time, update_by, update_time from aps_material_management |
| | | </sql> |
| | | |
| | | <select id="selectApsMaterialManagementList" parameterType="ApsMaterialManagement" resultMap="ApsMaterialManagementResult"> |
| | | <select id="selectApsMaterialManagementList" parameterType="com.aps.core.domain.ApsMaterialManagement" resultMap="ApsMaterialManagementResult"> |
| | | <include refid="selectApsMaterialManagementVo"/> |
| | | <where> |
| | | <if test="itemNumber != null "> and item_number = #{itemNumber}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsMaterialManagement" parameterType="ApsMaterialManagement"> |
| | | <insert id="insertApsMaterialManagement" parameterType="com.aps.core.domain.ApsMaterialManagement"> |
| | | insert into aps_material_management |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsMaterialManagement" parameterType="ApsMaterialManagement"> |
| | | <update id="updateApsMaterialManagement" parameterType="com.aps.core.domain.ApsMaterialManagement"> |
| | | update aps_material_management |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="itemNumber != null">item_number = #{itemNumber},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsMaterialStorageManagementMapper"> |
| | | |
| | | <resultMap type="ApsMaterialStorageManagement" id="ApsMaterialStorageManagementResult"> |
| | | <resultMap type="com.aps.core.domain.ApsMaterialStorageManagement" id="ApsMaterialStorageManagementResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="itemNumber" column="item_number" /> |
| | | <result property="num" column="num" /> |
| | |
| | | from aps_material_storage_management |
| | | </sql> |
| | | |
| | | <select id="selectApsMaterialStorageManagementList" parameterType="ApsMaterialStorageManagement" resultMap="ApsMaterialStorageManagementResult"> |
| | | <select id="selectApsMaterialStorageManagementList" parameterType="com.aps.core.domain.ApsMaterialStorageManagement" resultMap="ApsMaterialStorageManagementResult"> |
| | | <include refid="selectApsMaterialStorageManagementVo"/> |
| | | <where> |
| | | <if test="itemNumber != null and itemNumber != ''"> and item_number = #{itemNumber}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsMaterialStorageManagement" parameterType="ApsMaterialStorageManagement"> |
| | | <insert id="insertApsMaterialStorageManagement" parameterType="com.aps.core.domain.ApsMaterialStorageManagement"> |
| | | insert into aps_material_storage_management |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsMaterialStorageManagement" parameterType="ApsMaterialStorageManagement"> |
| | | <update id="updateApsMaterialStorageManagement" parameterType="com.aps.core.domain.ApsMaterialStorageManagement"> |
| | | update aps_material_storage_management |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="itemNumber != null">item_number = #{itemNumber},</if> |
| | |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | <update id="updateMaterialStorageByVersion" parameterType="ApsMaterialStorageManagement"> |
| | | <update id="updateMaterialStorageByVersion" parameterType="com.aps.core.domain.ApsMaterialStorageManagement"> |
| | | update aps_material_storage_management |
| | | set remainder_stock=#{remainderStock},version=version+1 |
| | | where id=#{id} and version=#{version} |
| | |
| | | where 1=1 |
| | | </update> |
| | | |
| | | <update id="updateRemainderStock" parameterType="ApsMaterialStorageManagement"> |
| | | <update id="updateRemainderStock" parameterType="com.aps.core.domain.ApsMaterialStorageManagement"> |
| | | update aps_material_storage_management |
| | | set remainder_stock=#{remainderStock},version=#{version} |
| | | where id=#{id} |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsPartRouteStatMapper"> |
| | | |
| | | <resultMap type="ApsPartRouteStat" id="ApsPartRouteStatResult"> |
| | | <resultMap type="com.aps.core.domain.ApsPartRouteStat" id="ApsPartRouteStatResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="workOrderNo" column="work_order_no" /> |
| | | <result property="roadProcessNumber" column="road_process_number" /> |
| | |
| | | select id, work_order_no, road_process_number, current_process_number, production_quantity, standard_time, process_total_time, process_plan_start_day, design_times, del_flag, create_by, batch_number ,resource_group_name from aps_part_route_stat |
| | | </sql> |
| | | |
| | | <select id="selectApsPartRouteStatList" parameterType="ApsPartRouteStat" resultMap="ApsPartRouteStatResult"> |
| | | <select id="selectApsPartRouteStatList" parameterType="com.aps.core.domain.ApsPartRouteStat" resultMap="ApsPartRouteStatResult"> |
| | | <include refid="selectApsPartRouteStatVo"/> |
| | | <where> |
| | | <if test="workOrderNo != null and workOrderNo != ''"> and work_order_no = #{workOrderNo}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsPartRouteStat" parameterType="ApsPartRouteStat"> |
| | | <insert id="insertApsPartRouteStat" parameterType="com.aps.core.domain.ApsPartRouteStat"> |
| | | insert into aps_part_route_stat |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsPartRouteStat" parameterType="ApsPartRouteStat"> |
| | | <update id="updateApsPartRouteStat" parameterType="com.aps.core.domain.ApsPartRouteStat"> |
| | | update aps_part_route_stat |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="workOrderNo != null">work_order_no = #{workOrderNo},</if> |
| | |
| | | order by rt.work_order_no,process_plan_start_day |
| | | </select> |
| | | |
| | | <resultMap type="ApsResourceDateStat" id="ApsResourceDateStatResult"> |
| | | <resultMap type="com.aps.core.domain.ApsResourceDateStat" id="ApsResourceDateStatResult"> |
| | | <result property="planDay" column="plan_day" /> |
| | | <result property="resourceName" column="resource_name" /> |
| | | <result property="requireTimes" column="require_times" /> |
| | |
| | | select id, plant_name, plant_code, status, create_by, create_time, update_by, update_time from aps_plant |
| | | </sql> |
| | | |
| | | <select id="selectApsPlantList" parameterType="ApsPlant" resultMap="ApsPlantResult"> |
| | | <select id="selectApsPlantList" parameterType="com.aps.core.domain.ApsPlant" resultMap="ApsPlantResult"> |
| | | <include refid="selectApsPlantVo"/> |
| | | <where> |
| | | <if test="plantName != null and plantName != ''"> and plant_name = #{plantName}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsPlant" parameterType="ApsPlant" useGeneratedKeys="true" keyProperty="id"> |
| | | <insert id="insertApsPlant" parameterType="com.aps.core.domain.ApsPlant" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into aps_plant |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null and id != ''" >id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsPlant" parameterType="ApsPlant"> |
| | | <update id="updateApsPlant" parameterType="com.aps.core.domain.ApsPlant"> |
| | | update aps_plant |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="plantName != null">plant_name = #{plantName},</if> |
| | |
| | | <result property="professionalAffiliation" column="professional_affiliation" /> |
| | | <result property="requireId" column="require_id" /> |
| | | <result property="version" column="version" /> |
| | | <result property="approveOn" column="approve_on" /> |
| | | <result property="startWorkDate" column="start_work_date" /> |
| | | <result property="lowOrderCode" column="low_order_code" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectApsPlatePlanVo"> |
| | |
| | | standby_stock, next_process_deparment, is_suspended, is_outsourcing, account, advanced_materials, |
| | | advanced_document_number, advanced_requirement_day, is_plan_complete, is_stock_complete, |
| | | has_turnback, has_risk, std_op, op_status, next_op_name ,unmatched_quantity,professional_affiliation, |
| | | require_id, version,production_base, order_create_time |
| | | require_id, version,production_base, order_create_time, approve_on, start_work_date, low_order_code |
| | | from aps_plate_plan |
| | | </sql> |
| | | |
| | |
| | | <if test="stdOp != null "> and std_op = #{stdOp}</if> |
| | | <if test="opStatus != null and opStatus != ''"> and op_status = #{opStatus}</if> |
| | | <if test="nextOpName != null and nextOpName != ''"> and next_op_name = #{nextOpName}</if> |
| | | <if test="lowOrderCode != null and lowOrderCode != ''"> and low_order_code = #{lowOrderCode}</if> |
| | | and del_flag='0' |
| | | </where> |
| | | </select> |
| | |
| | | <if test="opStatus != null">op_status,</if> |
| | | <if test="nextOpName != null">next_op_name,</if> |
| | | <if test="unmatchedQuantity != null">unmatched_quantity,</if> |
| | | <if test="lowOrderCode != null">low_order_code,</if> |
| | | create_time, |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="opStatus != null">#{opStatus},</if> |
| | | <if test="nextOpName != null">#{nextOpName},</if> |
| | | <if test="unmatchedQuantity != null">#{unmatchedQuantity},</if> |
| | | <if test="lowOrderCode != null">#{lowOrderCode},</if> |
| | | #{createTime}, |
| | | </trim> |
| | | </insert> |
| | |
| | | <if test="opStatus != null"> op_status= #{opStatus},</if> |
| | | <if test="nextOpName != null"> next_op_name= #{nextOpName},</if> |
| | | <if test="unmatchedQuantity != null"> unmatched_quantity = #{unmatchedQuantity},</if> |
| | | <if test="lowOrderCode != null"> low_order_code = #{lowOrderCode},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | |
| | | <select id="selectPlatePlanByPlantMajor" parameterType="com.aps.core.domain.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 |
| | | 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> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsPlatePlanTempMapper"> |
| | | |
| | | <resultMap type="ApsPlatePlanTemp" id="ApsPlatePlanTempResult"> |
| | | <resultMap type="com.aps.core.domain.ApsPlatePlanTemp" id="ApsPlatePlanTempResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="masterPlanner" column="master_planner" /> |
| | | <result property="weekDay" column="week_day" /> |
| | |
| | | select id, master_planner, week_day, week_cycle, main_part_number, main_part_drawing_number, customer, business_type, document_number, requirement_type, document_status, item_number, drawing_no, version_number, production_quantity, good_products_quantity, process_number, work_center, department, plan_start_day, plan_end_day, standby_number, standby_name, standby_stock, next_process_deparment, is_suspended, is_outsourcing, account, advanced_materials, advanced_document_number, advanced_requirement_day, is_plan_complete, is_stock_complete, has_turnback, has_risk, batch_number from aps_plate_plan_temp |
| | | </sql> |
| | | |
| | | <select id="selectApsPlatePlanTempList" parameterType="ApsPlatePlanTemp" resultMap="ApsPlatePlanTempResult"> |
| | | <select id="selectApsPlatePlanTempList" parameterType="com.aps.core.domain.ApsPlatePlanTemp" resultMap="ApsPlatePlanTempResult"> |
| | | <include refid="selectApsPlatePlanTempVo"/> |
| | | <where> |
| | | <if test="nextProcessDeparment != null and nextProcessDeparment != ''"> and next_process_deparment = #{nextProcessDeparment}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsPlatePlanTemp" parameterType="ApsPlatePlanTemp"> |
| | | <insert id="insertApsPlatePlanTemp" parameterType="com.aps.core.domain.ApsPlatePlanTemp"> |
| | | insert into aps_plate_plan_temp |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null and id != ''">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsPlatePlanTemp" parameterType="ApsPlatePlanTemp"> |
| | | <update id="updateApsPlatePlanTemp" parameterType="com.aps.core.domain.ApsPlatePlanTemp"> |
| | | update aps_plate_plan_temp |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="masterPlanner != null">master_planner = #{masterPlanner},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsPlateProcessShopStatMapper"> |
| | | |
| | | <resultMap type="ApsPlateProcessShopStat" id="ApsPlateProcessShopStatResult"> |
| | | <resultMap type="com.aps.core.domain.ApsPlateProcessShopStat" id="ApsPlateProcessShopStatResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="docNo" column="doc_no" /> |
| | | <result property="shopCode" column="shop_code" /> |
| | |
| | | from aps_plate_process_shop_stat |
| | | </sql> |
| | | |
| | | <select id="selectApsPlateProcessShopStatList" parameterType="ApsPlateProcessShopStat" resultMap="ApsPlateProcessShopStatResult"> |
| | | <select id="selectApsPlateProcessShopStatList" parameterType="com.aps.core.domain.ApsPlateProcessShopStat" resultMap="ApsPlateProcessShopStatResult"> |
| | | <include refid="selectApsPlateProcessShopStatVo"/> |
| | | <where> |
| | | <if test="docNo != null and docNo != ''"> and doc_no = #{docNo}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsPlateProcessShopStat" parameterType="ApsPlateProcessShopStat" useGeneratedKeys="true" keyProperty="id"> |
| | | <insert id="insertApsPlateProcessShopStat" parameterType="com.aps.core.domain.ApsPlateProcessShopStat" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into aps_plate_process_shop_stat |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="docNo != null">doc_no,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsPlateProcessShopStat" parameterType="ApsPlateProcessShopStat"> |
| | | <update id="updateApsPlateProcessShopStat" parameterType="com.aps.core.domain.ApsPlateProcessShopStat"> |
| | | update aps_plate_process_shop_stat |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="docNo != null">doc_no = #{docNo},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsPlateProcessStatMapper"> |
| | | |
| | | <resultMap type="ApsPlateProcessStat" id="ApsPlateProcessStatResult"> |
| | | <resultMap type="com.aps.core.domain.ApsPlateProcessStat" id="ApsPlateProcessStatResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="workOrderNo" column="work_order_no" /> |
| | | <result property="processName" column="process_name" /> |
| | |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | | <result property="warning" column="warning" /> |
| | | <result property="exceptionStatus" column="exception_status" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectApsPlateProcessStatVo"> |
| | | select id, work_order_no, process_name, num, route_process_number, current_process_number, production_quantity, |
| | | standard_time, process_total_time, process_plan_end_day,process_plan_start_day, order_plan_end_day, design_times, |
| | | batch_number, create_by, del_flag, warning |
| | | batch_number, create_by, del_flag, warning, |
| | | CASE WHEN <![CDATA[ process_plan_start_day <= NOW() OR process_plan_end_day <= NOW() ]]> THEN '是' ELSE '否' END as exception_status |
| | | from aps_plate_process_stat |
| | | </sql> |
| | | |
| | | <select id="selectApsPlateProcessStatList" parameterType="ApsPlateProcessStat" resultMap="ApsPlateProcessStatResult"> |
| | | <select id="selectApsPlateProcessStatList" parameterType="com.aps.core.domain.ApsPlateProcessStat" resultMap="ApsPlateProcessStatResult"> |
| | | <include refid="selectApsPlateProcessStatVo"/> |
| | | <where> |
| | | <if test="workOrderNo != null and workOrderNo != ''"> and work_order_no = #{workOrderNo}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsPlateProcessStat" parameterType="ApsPlateProcessStat"> |
| | | <insert id="insertApsPlateProcessStat" parameterType="com.aps.core.domain.ApsPlateProcessStat"> |
| | | insert into aps_plate_process_stat |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsPlateProcessStat" parameterType="ApsPlateProcessStat"> |
| | | <update id="updateApsPlateProcessStat" parameterType="com.aps.core.domain.ApsPlateProcessStat"> |
| | | update aps_plate_process_stat |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="workOrderNo != null">work_order_no = #{workOrderNo},</if> |
| | |
| | | delete from aps_plate_process_stat where batch_number != #{batchNumber} |
| | | </update> |
| | | |
| | | <insert id="batchInsertPlateStat" parameterType="ApsPlateProcessStat"> |
| | | <insert id="batchInsertPlateStat" parameterType="com.aps.core.domain.ApsPlateProcessStat"> |
| | | insert into aps_plate_process_stat |
| | | ( |
| | | id, |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsPlateStandardRequireBatchMapper"> |
| | | |
| | | <resultMap type="ApsPlateStandardRequireBatch" id="ApsPlateStandardRequireBatchResult"> |
| | | <resultMap type="com.aps.core.domain.ApsPlateStandardRequireBatch" id="ApsPlateStandardRequireBatchResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="batchNumber" column="batch_number" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | |
| | | select id, batch_number, del_flag, create_time, create_by, update_by, update_time from aps_plate_standard_require_batch |
| | | </sql> |
| | | |
| | | <select id="selectApsPlateStandardRequireBatchList" parameterType="ApsPlateStandardRequireBatch" resultMap="ApsPlateStandardRequireBatchResult"> |
| | | <select id="selectApsPlateStandardRequireBatchList" parameterType="com.aps.core.domain.ApsPlateStandardRequireBatch" resultMap="ApsPlateStandardRequireBatchResult"> |
| | | <include refid="selectApsPlateStandardRequireBatchVo"/> |
| | | <where> |
| | | <if test="batchNumber != null and batchNumber != ''"> and batch_number = #{batchNumber}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsPlateStandardRequireBatch" parameterType="ApsPlateStandardRequireBatch"> |
| | | <insert id="insertApsPlateStandardRequireBatch" parameterType="com.aps.core.domain.ApsPlateStandardRequireBatch"> |
| | | insert into aps_plate_standard_require_batch |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsPlateStandardRequireBatch" parameterType="ApsPlateStandardRequireBatch"> |
| | | <update id="updateApsPlateStandardRequireBatch" parameterType="com.aps.core.domain.ApsPlateStandardRequireBatch"> |
| | | update aps_plate_standard_require_batch |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="batchNumber != null">batch_number = #{batchNumber},</if> |
| | |
| | | ) |
| | | select * |
| | | from cp |
| | | -- where require_level is not null |
| | | where requirement_type is not null and doc_no is not null |
| | | order by bom_line_level; |
| | | </select> |
| | | </mapper> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsPlateStandardRequireBomStockDetailMapper"> |
| | | |
| | | <resultMap type="ApsPlateStandardRequireBomStockDetail" id="ApsPlateStandardRequireBomStockDetailResult"> |
| | | <resultMap type="com.aps.core.domain.ApsPlateStandardRequireBomStockDetail" id="ApsPlateStandardRequireBomStockDetailResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="requireId" column="require_id" /> |
| | | <result property="requireTrackId" column="require_track_id" /> |
| | |
| | | from aps_plate_standard_require_bom_stock_detail |
| | | </sql> |
| | | |
| | | <select id="selectApsPlateStandardRequireBomStockDetailList" parameterType="ApsPlateStandardRequireBomStockDetail" resultMap="ApsPlateStandardRequireBomStockDetailResult"> |
| | | <select id="selectApsPlateStandardRequireBomStockDetailList" parameterType="com.aps.core.domain.ApsPlateStandardRequireBomStockDetail" resultMap="ApsPlateStandardRequireBomStockDetailResult"> |
| | | <include refid="selectApsPlateStandardRequireBomStockDetailVo"/> |
| | | <where> |
| | | <if test="requireId != null and requireId != ''"> and require_id = #{requireId}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsPlateStandardRequireBomStockDetail" parameterType="ApsPlateStandardRequireBomStockDetail"> |
| | | <insert id="insertApsPlateStandardRequireBomStockDetail" parameterType="com.aps.core.domain.ApsPlateStandardRequireBomStockDetail"> |
| | | insert into aps_plate_standard_require_bom_stock_detail |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsPlateStandardRequireBomStockDetail" parameterType="ApsPlateStandardRequireBomStockDetail"> |
| | | <update id="updateApsPlateStandardRequireBomStockDetail" parameterType="com.aps.core.domain.ApsPlateStandardRequireBomStockDetail"> |
| | | update aps_plate_standard_require_bom_stock_detail |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="requireId != null">require_id = #{requireId},</if> |
| | |
| | | update aps_plate_standard_require_bom_stock_detail set del_flag = '1' where batch_number = #{batchNumber} |
| | | </update> |
| | | |
| | | <insert id="batchInsert" parameterType="ApsPlateStandardRequireBomStockDetail"> |
| | | <insert id="batchInsert" parameterType="com.aps.core.domain.ApsPlateStandardRequireBomStockDetail"> |
| | | insert into aps_plate_standard_require_bom_stock_detail |
| | | (id,require_id, require_track_id, bom_line_id, bom_line_code, before_stock_amount, deduction_amount |
| | | , after_stock_amount, org_code, batch_number, del_flag, create_time, create_by) |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsProcessCapacityManagementMapper"> |
| | | |
| | | <resultMap type="ApsProcessCapacityManagement" id="ApsProcessCapacityManagementResult"> |
| | | <resultMap type="com.aps.core.domain.ApsProcessCapacityManagement" id="ApsProcessCapacityManagementResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="itemNumber" column="item_number" /> |
| | | <result property="capacityType" column="capacity_type" /> |
| | |
| | | select id, item_number, capacity_type, process_number, process_name, process_route_id, work_time, effective_date, expiring_date, integration_date, create_by, create_time, update_by, update_time from aps_process_capacity_management |
| | | </sql> |
| | | |
| | | <select id="selectApsProcessCapacityManagementList" parameterType="ApsProcessCapacityManagement" resultMap="ApsProcessCapacityManagementResult"> |
| | | <select id="selectApsProcessCapacityManagementList" parameterType="com.aps.core.domain.ApsProcessCapacityManagement" resultMap="ApsProcessCapacityManagementResult"> |
| | | <include refid="selectApsProcessCapacityManagementVo"/> |
| | | <where> |
| | | <if test="itemNumber != null and itemNumber != ''"> and item_number = #{itemNumber}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsProcessCapacityManagement" parameterType="ApsProcessCapacityManagement"> |
| | | <insert id="insertApsProcessCapacityManagement" parameterType="com.aps.core.domain.ApsProcessCapacityManagement"> |
| | | insert into aps_process_capacity_management |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsProcessCapacityManagement" parameterType="ApsProcessCapacityManagement"> |
| | | <update id="updateApsProcessCapacityManagement" parameterType="com.aps.core.domain.ApsProcessCapacityManagement"> |
| | | update aps_process_capacity_management |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="itemNumber != null and itemNumber != ''">item_number = #{itemNumber},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsProcessRouteMapper"> |
| | | |
| | | <resultMap type="ApsProcessRoute" id="ApsProcessRouteResult"> |
| | | <resultMap type="com.aps.core.domain.ApsProcessRoute" id="ApsProcessRouteResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="itemNo" column="item_no" /> |
| | | <result property="workOrderNo" column="work_order_no" /> |
| | |
| | | select id, item_no, work_order_no, process_number, process_name, process_plan_start_day, process_plan_end_day, not_start_work_count, completed_count, discard_count, integration_day, plant, del_flag, create_by, create_time, update_by, update_time,standard_time,process_order,work_center from aps_process_route |
| | | </sql> |
| | | |
| | | <select id="selectApsProcessRouteList" parameterType="ApsProcessRoute" resultMap="ApsProcessRouteResult"> |
| | | <select id="selectApsProcessRouteList" parameterType="com.aps.core.domain.ApsProcessRoute" resultMap="ApsProcessRouteResult"> |
| | | <include refid="selectApsProcessRouteVo"/> |
| | | <where> |
| | | <if test="itemNo != null and itemNo != ''"> and item_no like '%' || #{itemNo} || '%' </if> |
| | |
| | | <select id="selectApsProcessRouteById" parameterType="String" resultMap="ApsProcessRouteResult"> |
| | | </select> |
| | | |
| | | <insert id="insertApsProcessRoute" parameterType="ApsProcessRoute"> |
| | | <insert id="insertApsProcessRoute" parameterType="com.aps.core.domain.ApsProcessRoute"> |
| | | insert into aps_process_route |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsProcessRoute" parameterType="ApsProcessRoute"> |
| | | <update id="updateApsProcessRoute" parameterType="com.aps.core.domain.ApsProcessRoute"> |
| | | update aps_process_route |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="itemNo != null">item_no = #{itemNo},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsProcessRouteTempMapper"> |
| | | |
| | | <resultMap type="ApsProcessRouteTemp" id="ApsProcessRouteTempResult"> |
| | | <resultMap type="com.aps.core.domain.ApsProcessRouteTemp" id="ApsProcessRouteTempResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="itemNo" column="item_no" /> |
| | | <result property="workOrderNo" column="work_order_no" /> |
| | |
| | | select id, item_no, work_order_no, process_number, process_name, process_plan_start_day, process_plan_end_day, not_start_work_count, completed_count, discard_count, integration_day, batch_number, plant, del_flag, create_by, create_time, update_by, update_time,standard_time,process_order from aps_process_route_temp |
| | | </sql> |
| | | |
| | | <select id="selectApsProcessRouteTempList" parameterType="ApsProcessRouteTemp" resultMap="ApsProcessRouteTempResult"> |
| | | <select id="selectApsProcessRouteTempList" parameterType="com.aps.core.domain.ApsProcessRouteTemp" resultMap="ApsProcessRouteTempResult"> |
| | | <include refid="selectApsProcessRouteTempVo"/> |
| | | <where> |
| | | <if test="itemNo != null and itemNo != ''"> and item_no = #{itemNo}</if> |
| | |
| | | <select id="selectApsProcessRouteTempById" parameterType="String" resultMap="ApsProcessRouteTempResult"> |
| | | </select> |
| | | |
| | | <insert id="insertApsProcessRouteTemp" parameterType="ApsProcessRouteTemp"> |
| | | <insert id="insertApsProcessRouteTemp" parameterType="com.aps.core.domain.ApsProcessRouteTemp"> |
| | | insert into aps_process_route_temp |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsProcessRouteTemp" parameterType="ApsProcessRouteTemp"> |
| | | <update id="updateApsProcessRouteTemp" parameterType="com.aps.core.domain.ApsProcessRouteTemp"> |
| | | update aps_process_route_temp |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="itemNo != null">item_no = #{itemNo},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsProfessionalFixedCycleManagementMapper"> |
| | | |
| | | <resultMap type="ApsProfessionalFixedCycleManagement" id="ApsProfessionalFixedCycleManagementResult"> |
| | | <resultMap type="com.aps.core.domain.ApsProfessionalFixedCycleManagement" id="ApsProfessionalFixedCycleManagementResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="itemNumber" column="item_number" /> |
| | | <result property="professionalDescription" column="professional_description" /> |
| | |
| | | select id, item_number, professional_description, professional, professional_fixed_cycle, integration_date, applicable_factories, create_by, create_time, update_by, update_time from aps_professional_fixed_cycle_management |
| | | </sql> |
| | | |
| | | <select id="selectApsProfessionalFixedCycleManagementList" parameterType="ApsProfessionalFixedCycleManagement" resultMap="ApsProfessionalFixedCycleManagementResult"> |
| | | <select id="selectApsProfessionalFixedCycleManagementList" parameterType="com.aps.core.domain.ApsProfessionalFixedCycleManagement" resultMap="ApsProfessionalFixedCycleManagementResult"> |
| | | <include refid="selectApsProfessionalFixedCycleManagementVo"/> |
| | | <where> |
| | | <if test="itemNumber != null and itemNumber != ''"> and item_number = #{itemNumber}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsProfessionalFixedCycleManagement" parameterType="ApsProfessionalFixedCycleManagement"> |
| | | <insert id="insertApsProfessionalFixedCycleManagement" parameterType="com.aps.core.domain.ApsProfessionalFixedCycleManagement"> |
| | | insert into aps_professional_fixed_cycle_management |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsProfessionalFixedCycleManagement" parameterType="ApsProfessionalFixedCycleManagement"> |
| | | <update id="updateApsProfessionalFixedCycleManagement" parameterType="com.aps.core.domain.ApsProfessionalFixedCycleManagement"> |
| | | update aps_professional_fixed_cycle_management |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="itemNumber != null">item_number = #{itemNumber},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsResourceGroupMapper"> |
| | | |
| | | <resultMap type="ApsResourceGroup" id="ApsResourceGroupResult"> |
| | | <resultMap type="com.aps.core.domain.ApsResourceGroup" id="ApsResourceGroupResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="resourceGroupName" column="resource_group_name" /> |
| | | <result property="devicesQuantity" column="devices_quantity" /> |
| | |
| | | select id, resource_group_name, devices_quantity, theory_hours, rest_days, theory_capacity, request_date, del_flag, create_by, create_time, update_by, update_time, plant from aps_resource_group |
| | | </sql> |
| | | |
| | | <select id="selectApsResourceGroupList" parameterType="ApsResourceGroup" resultMap="ApsResourceGroupResult"> |
| | | <select id="selectApsResourceGroupList" parameterType="com.aps.core.domain.ApsResourceGroup" resultMap="ApsResourceGroupResult"> |
| | | <include refid="selectApsResourceGroupVo"/> |
| | | <where> |
| | | <if test="resourceGroupName != null and resourceGroupName != ''"> and resource_group_name like '%' || #{resourceGroupName}|| '%'</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsResourceGroup" parameterType="ApsResourceGroup"> |
| | | <insert id="insertApsResourceGroup" parameterType="com.aps.core.domain.ApsResourceGroup"> |
| | | insert into aps_resource_group |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsResourceGroup" parameterType="ApsResourceGroup"> |
| | | <update id="updateApsResourceGroup" parameterType="com.aps.core.domain.ApsResourceGroup"> |
| | | update aps_resource_group |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="resourceGroupName != null">resource_group_name = #{resourceGroupName},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsResourceGroupTempMapper"> |
| | | |
| | | <resultMap type="ApsResourceGroupTemp" id="ApsResourceGroupTempResult"> |
| | | <resultMap type="com.aps.core.domain.ApsResourceGroupTemp" id="ApsResourceGroupTempResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="resourceGroupName" column="resource_group_name" /> |
| | | <result property="devicesQuantity" column="devices_quantity" /> |
| | |
| | | select id, resource_group_name, devices_quantity, theory_hours, rest_days, theory_capacity, request_date, del_flag, create_by, create_time, update_by, update_time, batch_number, plant from aps_resource_group_temp |
| | | </sql> |
| | | |
| | | <select id="selectApsResourceGroupTempList" parameterType="ApsResourceGroupTemp" resultMap="ApsResourceGroupTempResult"> |
| | | <select id="selectApsResourceGroupTempList" parameterType="com.aps.core.domain.ApsResourceGroupTemp" resultMap="ApsResourceGroupTempResult"> |
| | | <include refid="selectApsResourceGroupTempVo"/> |
| | | <where> |
| | | <if test="resourceGroupName != null and resourceGroupName != ''"> and resource_group_name like concat('%', #{resourceGroupName}, '%')</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsResourceGroupTemp" parameterType="ApsResourceGroupTemp"> |
| | | <insert id="insertApsResourceGroupTemp" parameterType="com.aps.core.domain.ApsResourceGroupTemp"> |
| | | insert into aps_resource_group_temp |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsResourceGroupTemp" parameterType="ApsResourceGroupTemp"> |
| | | <update id="updateApsResourceGroupTemp" parameterType="com.aps.core.domain.ApsResourceGroupTemp"> |
| | | update aps_resource_group_temp |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="resourceGroupName != null">resource_group_name = #{resourceGroupName},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsShopMapper"> |
| | | |
| | | <resultMap type="ApsShop" id="ApsShopResult"> |
| | | <resultMap type="com.aps.core.domain.ApsShop" id="ApsShopResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="shopName" column="shop_name" /> |
| | | <result property="shopCode" column="shop_code" /> |
| | |
| | | select id, shop_name, shop_code, plant_code, status, create_by, create_time, update_by, update_time from aps_shop |
| | | </sql> |
| | | |
| | | <select id="selectApsShopList" parameterType="ApsShop" resultMap="ApsShopResult"> |
| | | <select id="selectApsShopList" parameterType="com.aps.core.domain.ApsShop" resultMap="ApsShopResult"> |
| | | <include refid="selectApsShopVo"/> |
| | | <where> |
| | | <if test="shopName != null and shopName != ''"> and shop_name = #{shopName}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsShop" parameterType="ApsShop"> |
| | | <insert id="insertApsShop" parameterType="com.aps.core.domain.ApsShop"> |
| | | insert into aps_shop |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsShop" parameterType="ApsShop"> |
| | | <update id="updateApsShop" parameterType="com.aps.core.domain.ApsShop"> |
| | | update aps_shop |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="shopName != null">shop_name = #{shopName},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsStandardProcessMapper"> |
| | | |
| | | <resultMap type="ApsStandardProcess" id="ApsStandardProcessResult"> |
| | | <resultMap type="com.aps.core.domain.ApsStandardProcess" id="ApsStandardProcessResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="processNumber" column="process_number" /> |
| | | <result property="processName" column="process_name" /> |
| | |
| | | select id, process_number, process_name, resource_group_name, model, design_capacity, plant_id, plant, work_shop_id, work_shop, work_calender_id, del_flag, create_by, create_time, update_by, update_time, model_id, work_calender,major from aps_standard_process |
| | | </sql> |
| | | |
| | | <select id="selectApsStandardProcessList" parameterType="ApsStandardProcess" resultMap="ApsStandardProcessResult"> |
| | | <select id="selectApsStandardProcessList" parameterType="com.aps.core.domain.ApsStandardProcess" resultMap="ApsStandardProcessResult"> |
| | | <include refid="selectApsStandardProcessVo"/> |
| | | <where> |
| | | <if test="processNumber != null and processNumber != ''"> and process_number = #{processNumber}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsStandardProcess" parameterType="ApsStandardProcess"> |
| | | <insert id="insertApsStandardProcess" parameterType="com.aps.core.domain.ApsStandardProcess"> |
| | | insert into aps_standard_process |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="processNumber != null">process_number,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsStandardProcess" parameterType="ApsStandardProcess"> |
| | | <update id="updateApsStandardProcess" parameterType="com.aps.core.domain.ApsStandardProcess"> |
| | | update aps_standard_process |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="processNumber != null">process_number = #{processNumber},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsStandardProcessRouteHeaderMapper"> |
| | | |
| | | <resultMap type="ApsStandardProcessRouteHeader" id="ApsStandardProcessRouteHeaderResult"> |
| | | <resultMap type="com.aps.core.domain.ApsStandardProcessRouteHeader" id="ApsStandardProcessRouteHeaderResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="itemCode" column="item_code" /> |
| | | <result property="drawingNumber" column="drawing_number" /> |
| | |
| | | from aps_standard_process_route_header |
| | | </sql> |
| | | |
| | | <select id="selectApsStandardProcessRouteHeaderList" parameterType="ApsStandardProcessRouteHeader" resultMap="ApsStandardProcessRouteHeaderResult"> |
| | | <select id="selectApsStandardProcessRouteHeaderList" parameterType="com.aps.core.domain.ApsStandardProcessRouteHeader" resultMap="ApsStandardProcessRouteHeaderResult"> |
| | | <include refid="selectApsStandardProcessRouteHeaderVo"/> |
| | | <where> |
| | | <if test="routeId != null and routeId != ''"> and route_id = #{routeId}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsStandardProcessRouteHeader" parameterType="ApsStandardProcessRouteHeader"> |
| | | <insert id="insertApsStandardProcessRouteHeader" parameterType="com.aps.core.domain.ApsStandardProcessRouteHeader"> |
| | | insert into aps_standard_process_route_header |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsStandardProcessRouteHeader" parameterType="ApsStandardProcessRouteHeader"> |
| | | <update id="updateApsStandardProcessRouteHeader" parameterType="com.aps.core.domain.ApsStandardProcessRouteHeader"> |
| | | update aps_standard_process_route_header |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="routeId != null">route_id = #{routeId},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsStandardProcessRouteLineMapper"> |
| | | |
| | | <resultMap type="ApsStandardProcessRouteLine" id="ApsStandardProcessRouteLineResult"> |
| | | <resultMap type="com.aps.core.domain.ApsStandardProcessRouteLine" id="ApsStandardProcessRouteLineResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="routeId" column="route_id" /> |
| | | <result property="routeNum" column="route_num" /> |
| | |
| | | from aps_standard_process_route_line |
| | | </sql> |
| | | |
| | | <select id="selectApsStandardProcessRouteLineList" parameterType="ApsStandardProcessRouteLine" resultMap="ApsStandardProcessRouteLineResult"> |
| | | <select id="selectApsStandardProcessRouteLineList" parameterType="com.aps.core.domain.ApsStandardProcessRouteLine" resultMap="ApsStandardProcessRouteLineResult"> |
| | | <include refid="selectApsStandardProcessRouteLineVo"/> |
| | | <where> |
| | | <if test="routeId != null and routeId != ''"> and route_id = #{routeId}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsStandardProcessRouteLine" parameterType="ApsStandardProcessRouteLine"> |
| | | <insert id="insertApsStandardProcessRouteLine" parameterType="com.aps.core.domain.ApsStandardProcessRouteLine"> |
| | | insert into aps_standard_process_route_line |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsStandardProcessRouteLine" parameterType="ApsStandardProcessRouteLine"> |
| | | <update id="updateApsStandardProcessRouteLine" parameterType="com.aps.core.domain.ApsStandardProcessRouteLine"> |
| | | update aps_standard_process_route_line |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="routeId != null">route_id = #{routeId},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsWeldSeamMapper"> |
| | | |
| | | <resultMap type="ApsWeldSeam" id="ApsWeldSeamResult"> |
| | | <resultMap type="com.aps.core.domain.ApsWeldSeam" id="ApsWeldSeamResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="workOrderType" column="work_order_type" /> |
| | | <result property="materialCode" column="material_code" /> |
| | |
| | | select id, work_order_type, material_code, customer_drawing_number, organize_number, production_base, classification, produce_year, produce_month, production_quantity, customer, single_weld_seam, total_weld_seam, this_feedback_day, materials_requirement_day, sale_order_no, sale_order_line, main_work_order_no, superior_work_order_no, work_order_no, plant from aps_weld_seam |
| | | </sql> |
| | | |
| | | <select id="selectApsWeldSeamList" parameterType="ApsWeldSeam" resultMap="ApsWeldSeamResult"> |
| | | <select id="selectApsWeldSeamList" parameterType="com.aps.core.domain.ApsWeldSeam" resultMap="ApsWeldSeamResult"> |
| | | <include refid="selectApsWeldSeamVo"/> |
| | | <where> |
| | | <if test="workOrderType != null and workOrderType != ''"> and work_order_type = #{workOrderType}</if> |
| | |
| | | <include refid="selectApsWeldSeamVo"/> |
| | | where work_order_no = #{workOrderNo} |
| | | </select> |
| | | <insert id="insertApsWeldSeam" parameterType="ApsWeldSeam"> |
| | | <insert id="insertApsWeldSeam" parameterType="com.aps.core.domain.ApsWeldSeam"> |
| | | insert into aps_weld_seam |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsWeldSeam" parameterType="ApsWeldSeam"> |
| | | <update id="updateApsWeldSeam" parameterType="com.aps.core.domain.ApsWeldSeam"> |
| | | update aps_weld_seam |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="workOrderType != null">work_order_type = #{workOrderType},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsWeldSeamStatisticsMapper"> |
| | | |
| | | <resultMap type="ApsWeldSeamStatistics" id="ApsWeldSeamStatisticsResult"> |
| | | <resultMap type="com.aps.core.domain.ApsWeldSeamStatistics" id="ApsWeldSeamStatisticsResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="year" column="year" /> |
| | | <result property="month" column="month" /> |
| | |
| | | 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, del_flag, create_by, create_time, update_by, update_time from aps_weld_seam_statistics |
| | | </sql> |
| | | |
| | | <select id="selectApsWeldSeamStatisticsList" parameterType="ApsWeldSeamStatistics" resultMap="ApsWeldSeamStatisticsResult"> |
| | | <select id="selectApsWeldSeamStatisticsList" parameterType="com.aps.core.domain.ApsWeldSeamStatistics" resultMap="ApsWeldSeamStatisticsResult"> |
| | | <include refid="selectApsWeldSeamStatisticsVo"/> |
| | | <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> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsWeldSeamStatistics" parameterType="ApsWeldSeamStatistics"> |
| | | <insert id="insertApsWeldSeamStatistics" parameterType="com.aps.core.domain.ApsWeldSeamStatistics"> |
| | | insert into aps_weld_seam_statistics |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsWeldSeamStatistics" parameterType="ApsWeldSeamStatistics"> |
| | | <update id="updateApsWeldSeamStatistics" parameterType="com.aps.core.domain.ApsWeldSeamStatistics"> |
| | | update aps_weld_seam_statistics |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="year != null">year = #{year},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsWeldSeamTempMapper"> |
| | | |
| | | <resultMap type="ApsWeldSeamTemp" id="ApsWeldSeamTempResult"> |
| | | <resultMap type="com.aps.core.domain.ApsWeldSeamTemp" id="ApsWeldSeamTempResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="workOrderType" column="work_order_type" /> |
| | | <result property="materialCode" column="material_code" /> |
| | |
| | | select id, work_order_type, material_code, customer_drawing_number, organize_number, production_base, classification, produce_year, produce_month, production_quantity, customer, single_weld_seam, total_weld_seam, this_feedback_day, materials_requirement_day, sale_order_no, sale_order_line, main_work_order_no, superior_work_order_no, work_order_no, plant, batch_number from aps_weld_seam_temp |
| | | </sql> |
| | | |
| | | <select id="selectApsWeldSeamTempList" parameterType="ApsWeldSeamTemp" resultMap="ApsWeldSeamTempResult"> |
| | | <select id="selectApsWeldSeamTempList" parameterType="com.aps.core.domain.ApsWeldSeamTemp" resultMap="ApsWeldSeamTempResult"> |
| | | <include refid="selectApsWeldSeamTempVo"/> |
| | | <where> |
| | | <if test="workOrderType != null and workOrderType != ''"> and work_order_type = #{workOrderType}</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsWeldSeamTemp" parameterType="ApsWeldSeamTemp"> |
| | | <insert id="insertApsWeldSeamTemp" parameterType="com.aps.core.domain.ApsWeldSeamTemp"> |
| | | insert into aps_weld_seam_temp |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsWeldSeamTemp" parameterType="ApsWeldSeamTemp"> |
| | | <update id="updateApsWeldSeamTemp" parameterType="com.aps.core.domain.ApsWeldSeamTemp"> |
| | | update aps_weld_seam_temp |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="workOrderType != null">work_order_type = #{workOrderType},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsWorkCalendarMapper"> |
| | | |
| | | <resultMap type="ApsWorkCalendar" id="ApsWorkCalendarResult"> |
| | | <resultMap type="com.aps.core.domain.ApsWorkCalendar" id="ApsWorkCalendarResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="description" column="description" /> |
| | | <result property="type" column="type" /> |
| | |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="holidays" column="holidays" /> |
| | | <result property="applicable" column="applicable" /> |
| | | <result property="applicableTranslate" column="applicable_translate" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectApsWorkCalendarVo"> |
| | | select id, description, type, effective_date, expiring_date, content, applicable_factory, applicable_workshop, applicable_process, create_by, create_time, update_by, update_time from aps_work_calendar |
| | | select id, description, type, effective_date, expiring_date, content, applicable_factory, applicable_workshop, applicable_process, create_by, create_time, update_by, update_time, holidays, applicable, applicable_translate from aps_work_calendar |
| | | </sql> |
| | | |
| | | <select id="selectApsWorkCalendarList" parameterType="ApsWorkCalendar" resultMap="ApsWorkCalendarResult"> |
| | | <select id="selectApsWorkCalendarList" parameterType="com.aps.core.domain.ApsWorkCalendar" resultMap="ApsWorkCalendarResult"> |
| | | <include refid="selectApsWorkCalendarVo"/> |
| | | <where> |
| | | <if test="description != null and description != ''"> and description like '%' || #{description} || '%'</if> |
| | | <if test="type != null and type != ''"> and type = #{type}</if> |
| | | <if test="effectiveDate != null and expiringDate != null"> and ((effective_date >= #{effectiveDate} and effective_date <= #{expiringDate}) or (expiring_date >= #{effectiveDate} and expiring_date <= #{expiringDate}))</if> |
| | | <!-- <if test="content != null and content != ''"> and content = #{content}</if>--> |
| | | <if test="applicableFactory != null and applicableFactory != ''"> and applicable_factory = #{applicableFactory}</if> |
| | | <if test="applicableFactory != null and applicableFactory != ''"> |
| | | and EXISTS ( |
| | | SELECT 1 |
| | | FROM jsonb_array_elements(applicable) AS obj |
| | | WHERE obj ->> 'factory' = #{applicableFactory} |
| | | ) |
| | | </if> |
| | | <if test="applicableWorkshop != null and applicableWorkshop != ''"> and applicable_workshop = #{applicableWorkshop}</if> |
| | | <if test="applicableProcess != null and applicableProcess != ''"> and applicable_process = #{applicableProcess}</if> |
| | | </where> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsWorkCalendar" parameterType="ApsWorkCalendar"> |
| | | <insert id="insertApsWorkCalendar" parameterType="com.aps.core.domain.ApsWorkCalendar"> |
| | | insert into aps_work_calendar |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="holidays != null">holidays,</if> |
| | | <if test="applicable != null">applicable,</if> |
| | | <if test="applicableTranslate != null">applicable_translate,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="holidays != null">#{holidays, typeHandler=com.aps.core.typeHandler.JsonTypeHandler, jdbcType=OTHER},</if> |
| | | <if test="applicable != null">#{applicable, typeHandler=com.aps.core.typeHandler.JsonTypeHandler, jdbcType=OTHER},</if> |
| | | <if test="applicableTranslate != null">#{applicableTranslate},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsWorkCalendar" parameterType="ApsWorkCalendar"> |
| | | <update id="updateApsWorkCalendar" parameterType="com.aps.core.domain.ApsWorkCalendar"> |
| | | update aps_work_calendar |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="description != null">description = #{description},</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="holidays != null">holidays = #{holidays, typeHandler=com.aps.core.typeHandler.JsonTypeHandler, jdbcType=OTHER},</if> |
| | | <if test="applicable != null">applicable = #{applicable, typeHandler=com.aps.core.typeHandler.JsonTypeHandler, jdbcType=OTHER},</if> |
| | | <if test="applicableTranslate != null">applicable_translate = #{applicableTranslate},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | delete from aps_work_calendar where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteApsWorkCalendarByIds" parameterType="String"> |
| | | <delete id="deleteApsWorkCalendarByIds" parameterType="com.aps.core.domain.ApsWorkCalendar"> |
| | | delete from aps_work_calendar where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <delete id="deleteApsWorkCalendar" parameterType="com.aps.core.domain.ApsWorkCalendar"> |
| | | delete from aps_work_calendar where effective_date=#{effectiveDate} and expiring_date=#{expiringDate} and applicable_factory=#{applicableFactory} and applicable_workshop=#{applicableWorkshop} and applicable_process=#{applicableProcess} |
| | | </delete> |
| | | </mapper> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsWorkEventMapper"> |
| | | |
| | | <resultMap type="ApsWorkEvent" id="ApsWorkEventResult"> |
| | | <resultMap type="com.aps.core.domain.ApsWorkEvent" id="ApsWorkEventResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="description" column="description" /> |
| | | <result property="duration" column="duration" /> |
| | |
| | | select id, description, duration, start_date, end_date, start_time, end_time, applicable_factory, applicable_workshop, applicable_process, applicable_calendar, create_by, create_time, update_by, update_time from aps_work_event |
| | | </sql> |
| | | |
| | | <select id="selectApsWorkEventList" parameterType="ApsWorkEvent" resultMap="ApsWorkEventResult"> |
| | | <select id="selectApsWorkEventList" parameterType="com.aps.core.domain.ApsWorkEvent" resultMap="ApsWorkEventResult"> |
| | | <include refid="selectApsWorkEventVo"/> |
| | | <where> |
| | | <if test="description != null and description != ''"> and description like '%' || #{description} || '%'</if> |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsWorkEvent" parameterType="ApsWorkEvent"> |
| | | <insert id="insertApsWorkEvent" parameterType="com.aps.core.domain.ApsWorkEvent"> |
| | | insert into aps_work_event |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsWorkEvent" parameterType="ApsWorkEvent"> |
| | | <update id="updateApsWorkEvent" parameterType="com.aps.core.domain.ApsWorkEvent"> |
| | | update aps_work_event |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="description != null and description != ''">description = #{description},</if> |
| | |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | |
| | | <!-- 生成数据字典 --> |
| | | <dependency> |
| | | <groupId>cn.smallbun.screw</groupId> |
| | | <artifactId>screw-core</artifactId> |
| | | <version>1.0.5</version> |
| | | </dependency> |
| | | |
| | | <!-- RuoYi Api System --> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.aps</groupId>--> |
| | | <!-- <artifactId>aps-api-system</artifactId>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <!-- mybatis-plus --> |
| | | <dependency> |
| | | <groupId>org.mybatis</groupId> |
| | | <artifactId>mybatis-spring</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-spring-boot3-starter</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-jsqlparser</artifactId> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | import com.aps.common.log.enums.BusinessType; |
| | | import com.aps.common.security.utils.SecurityUtils; |
| | | import com.aps.job.domain.SysJob; |
| | | import com.aps.job.param.ApsWorkOrderJobParam; |
| | | import com.aps.job.service.*; |
| | | import com.aps.job.util.CronUtils; |
| | | import com.aps.job.util.ScheduleUtils; |
| | |
| | | import java.time.ZoneId; |
| | | import java.time.ZoneOffset; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @PostMapping("/refreshBomData") |
| | | public Boolean refreshBomData() throws SchedulerException, TaskException |
| | | public AjaxResult refreshBomData() throws SchedulerException, TaskException |
| | | { |
| | | return apsBomHeaderJobService.syncBomDataJob(1, 1000, "", ""); |
| | | try { |
| | | boolean res = apsBomHeaderJobService.syncBomDataJob(1, 1000, "", ""); |
| | | if(res){ |
| | | return success(); |
| | | }else { |
| | | return error(); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return error(); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/refreshProcessRouteData") |
| | | public Boolean refreshProcessRouteData() throws SchedulerException, TaskException |
| | | public AjaxResult refreshProcessRouteData() throws SchedulerException, TaskException |
| | | { |
| | | return apsStandardProcessRouteHeaderJobService.syncProcessRouteDataJob(1, 1000, "", ""); |
| | | try { |
| | | boolean res = apsStandardProcessRouteHeaderJobService.syncProcessRouteDataJob(1, 1000, "", ""); |
| | | if(res){ |
| | | return success(); |
| | | }else { |
| | | return error(); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return error(); |
| | | } |
| | | } |
| | | |
| | | @PutMapping("/test") |
| | |
| | | { |
| | | System.out.println("start"); |
| | | //同步工单数据 |
| | | boolean continueFlag = true; |
| | | Integer currentPage = 1; |
| | | ApsWorkOrderJobParam param=new ApsWorkOrderJobParam(); |
| | | param.setPageIndex(currentPage); |
| | | param.setDocState(Arrays.asList(0,1,2,4)); |
| | | param.setPageSize(500); |
| | | while (continueFlag){ |
| | | param.setPageIndex(currentPage); |
| | | continueFlag= apsWorkOrderJobService.batchSaveByPager(param); |
| | | currentPage++; |
| | | } |
| | | // boolean continueFlag = true; |
| | | // Integer currentPage = 1; |
| | | // ApsWorkOrderJobParam param=new ApsWorkOrderJobParam(); |
| | | // param.setPageIndex(currentPage); |
| | | // param.setDocState(Arrays.asList(0,1,2,4)); |
| | | // param.setPageSize(500); |
| | | // while (continueFlag){ |
| | | // param.setPageIndex(currentPage); |
| | | // continueFlag= apsWorkOrderJobService.batchSaveByPager(param); |
| | | // currentPage++; |
| | | // } |
| | | //同步物料数据 |
| | | // apsMaterialManagementJobService.syncApsMaterialData(1, 1000, "FORTUNA", ""); |
| | | // apsMaterialManagementJobService.syncApsMaterialData(1, 1000, "", ""); |
| | | //同步工艺路线数据 |
| | | // apsStandardProcessRouteHeaderJobService.syncProcessRouteData(1, 1000, "", ""); |
| | | //获取Redis缓存中的BOM数据 |
| | |
| | | //将BOM数据存进Redis中 |
| | | // remoteCoreService.setBomDataToRedis(SecurityConstants.INNER); |
| | | //同步物料库存数据 |
| | | // apsMaterialStorageManagementJobService.syncApsMaterialStorageData(1, 1000, "", ""); |
| | | apsMaterialStorageManagementJobService.syncApsMaterialStorageData(1, 1000, "", ""); |
| | | //同步BOM数据 |
| | | // apsBomHeaderJobService.syncBomData(1, 1000, "FORTUNA", ""); |
| | | // apsBomHeaderJobService.syncBomData(1, 1000, "", ""); |
| | | |
| | | // System.out.println(sequence.nextId()); |
| | | // List<String> docNos = new ArrayList<>(); |
| | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.aps.common.core.constant.SecurityConstants; |
| | | import com.aps.common.core.utils.DateUtils; |
| | | import com.aps.common.core.utils.StringUtils; |
| | | import com.aps.common.core.utils.uuid.IdUtils; |
| | |
| | | import com.aps.job.mapper.ApsBomLineJobMapper; |
| | | import com.aps.job.mapper.ApsWorkOrderJobLogMapper; |
| | | import com.aps.job.service.IApsBomHeaderJobService; |
| | | import com.aps.system.api.RemoteCoreService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.HttpEntity; |
| | |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Autowired |
| | | private RemoteCoreService remoteCoreService; |
| | | |
| | | /** |
| | | * 查询BOM Header 数据管理 |
| | |
| | | if(!res){ |
| | | return false; |
| | | } |
| | | remoteCoreService.setBomDataToRedis(SecurityConstants.INNER); |
| | | apsBomHeaderJobMapper.deleteApsBomHeader(); |
| | | apsBomLineJobMapper.deleteApsBomLine(); |
| | | apsBomHeaderJobMapper.insertIntoApsBomHeader(); |
| | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.aps.common.core.constant.SecurityConstants; |
| | | import com.aps.common.core.utils.DateUtils; |
| | | import com.aps.common.core.utils.StringUtils; |
| | | import com.aps.common.core.utils.uuid.IdUtils; |
| | |
| | | import com.aps.job.mapper.ApsStandardProcessRouteLineJobMapper; |
| | | import com.aps.job.mapper.ApsWorkOrderJobLogMapper; |
| | | import com.aps.job.service.IApsStandardProcessRouteHeaderJobService; |
| | | import com.aps.system.api.RemoteCoreService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.HttpEntity; |
| | |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Autowired |
| | | private RemoteCoreService remoteCoreService; |
| | | |
| | | /** |
| | | * 查询标准工艺路线Header |
| | |
| | | if(!res){ |
| | | return false; |
| | | } |
| | | remoteCoreService.setProcessRouteDataToRedis(SecurityConstants.INNER); |
| | | apsStandardProcessRouteHeaderJobMapper.deleteProcessRouteHeader(); |
| | | apsStandardProcessRouteLineJobMapper.deleteProcessRouteLine(); |
| | | apsStandardProcessRouteHeaderJobMapper.insertIntoProcessRouteHeader(); |
| | |
| | | create_by, |
| | | now() |
| | | FROM aps_bom_header_job |
| | | -- FROM aps_bom_header_job as a |
| | | -- LEFT JOIN aps_material_storage_management as b ON a.item_code = b.item_number |
| | | -- where b.material_type='制造件' |
| | | </insert> |
| | | |
| | | <!-- 删除 aps_bom_header 表中的数据 --> |
| | |
| | | create_by, |
| | | now() |
| | | FROM aps_bom_line_job |
| | | -- FROM aps_bom_line_job as a |
| | | -- LEFT JOIN aps_material_storage_management as b ON a.item_code = b.item_number |
| | | -- where b.material_type='制造件' |
| | | </insert> |
| | | |
| | | <!-- 删除 aps_bom_line 表中的数据 --> |
| | |
| | | plan_start_day,plan_end_day,next_process_deparment, |
| | | is_suspended,is_outsourcing,account, |
| | | id,create_time,del_flag,plant,order_status,std_op,op_status,next_op_name, |
| | | professional_affiliation,order_create_time,approve_on,start_work_date |
| | | professional_affiliation,order_create_time,approve_on,start_work_date,low_order_code |
| | | ) |
| | | select |
| | | doc_no,mainitem_code,mainitem_figure, |
| | |
| | | (case when low_order_code='0' then 'main' else 'sub' end ) as professional_affiliation, |
| | | order_create_time, |
| | | approve_on, |
| | | start_work_date |
| | | start_work_date, |
| | | low_order_code |
| | | from aps_work_order_job |
| | | where ( doc_status in (0,1,2,4) and is_hold_release='0' |
| | | and (item_code like 'M03%' or item_code like 'M04%'or item_code like 'A75%') |
| | |
| | | <artifactId>aps-common-swagger</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- mybatis-plus --> |
| | | <dependency> |
| | | <groupId>org.mybatis</groupId> |
| | | <artifactId>mybatis-spring</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-spring-boot3-starter</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-jsqlparser</artifactId> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | <include refid="selectConfigVo"/> |
| | | <where> |
| | | <if test="configName != null and configName != ''"> |
| | | AND config_name like concat('%', #{configName}, '%') |
| | | AND config_name like '%' || #{configName} || '%' |
| | | </if> |
| | | <if test="configType != null and configType != ''"> |
| | | AND config_type = #{configType} |
| | | </if> |
| | | <if test="configKey != null and configKey != ''"> |
| | | AND config_key like concat('%', #{configKey}, '%') |
| | | AND config_key like '%' || #{configKey} || '%' |
| | | </if> |
| | | <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> |
| | | and date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d') |
| | |
| | | AND parent_id = #{parentId} |
| | | </if> |
| | | <if test="deptName != null and deptName != ''"> |
| | | AND dept_name like concat('%', #{deptName}, '%') |
| | | AND dept_name like '%' || #{deptName} '%' |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | AND status = #{status} |
| | |
| | | AND dict_type = #{dictType} |
| | | </if> |
| | | <if test="dictLabel != null and dictLabel != ''"> |
| | | AND dict_label like concat('%', #{dictLabel}, '%') |
| | | AND dict_label like '%' || #{dictLabel} || '%' |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | AND status = #{status} |
| | |
| | | <include refid="selectDictTypeVo"/> |
| | | <where> |
| | | <if test="dictName != null and dictName != ''"> |
| | | AND dict_name like concat('%', cast(#{dictName} as varchar), '%') |
| | | AND dict_name like '%' || #{dictName} || '%' |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | AND status = #{status} |
| | | </if> |
| | | <if test="dictType != null and dictType != ''"> |
| | | AND dict_type like concat('%', cast(#{dictType} as varchar), '%') |
| | | AND dict_type like '%' || #{dictType} || '%' |
| | | </if> |
| | | <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> |
| | | and date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d') |
| | |
| | | select info_id, user_name, ipaddr, status, msg, access_time from sys_logininfor |
| | | <where> |
| | | <if test="ipaddr != null and ipaddr != ''"> |
| | | AND ipaddr like concat('%', #{ipaddr}, '%') |
| | | AND ipaddr like '%' || #{ipaddr} || '%' |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | AND status = #{status} |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | | AND user_name like concat('%', #{userName}, '%') |
| | | AND user_name like '%' || #{userName} || '%' |
| | | </if> |
| | | <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> |
| | | AND access_time >= #{params.beginTime} |
| | |
| | | <include refid="selectMenuVo"/> |
| | | <where> |
| | | <if test="menuName != null and menuName != ''"> |
| | | AND menu_name like concat('%', #{menuName}, '%') |
| | | AND menu_name like '%' || #{menuName} || '%' |
| | | </if> |
| | | <if test="visible != null and visible != ''"> |
| | | AND visible = #{visible} |
| | |
| | | left join sys_role ro on ur.role_id = ro.role_id |
| | | where ur.user_id = #{params.userId} |
| | | <if test="menuName != null and menuName != ''"> |
| | | AND m.menu_name like concat('%', #{menuName}, '%') |
| | | AND m.menu_name like '%' || #{menuName} || '%' |
| | | </if> |
| | | <if test="visible != null and visible != ''"> |
| | | AND m.visible = #{visible} |
| | |
| | | <include refid="selectNoticeVo"/> |
| | | <where> |
| | | <if test="noticeTitle != null and noticeTitle != ''"> |
| | | AND notice_title like concat('%', #{noticeTitle}, '%') |
| | | AND notice_title like '%' || #{noticeTitle} || '%' |
| | | </if> |
| | | <if test="noticeType != null and noticeType != ''"> |
| | | AND notice_type = #{noticeType} |
| | | </if> |
| | | <if test="createBy != null and createBy != ''"> |
| | | AND create_by like concat('%', #{createBy}, '%') |
| | | AND create_by like '%' || #{createBy} || '%' |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | <include refid="selectOperLogVo"/> |
| | | <where> |
| | | <if test="operIp != null and operIp != ''"> |
| | | AND oper_ip like concat('%', #{operIp}, '%') |
| | | AND oper_ip like '%' || #{operIp} || '%' |
| | | </if> |
| | | <if test="title != null and title != ''"> |
| | | AND title like concat('%', #{title}, '%') |
| | | AND title like '%' || #{title} || '%' |
| | | </if> |
| | | <if test="businessType != null"> |
| | | AND business_type = #{businessType} |
| | |
| | | AND status = #{status} |
| | | </if> |
| | | <if test="operName != null and operName != ''"> |
| | | AND oper_name like concat('%', #{operName}, '%') |
| | | AND oper_name like '%' || #{operName} || '%' |
| | | </if> |
| | | <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> |
| | | AND oper_time >= #{params.beginTime} |
| | |
| | | <include refid="selectPostVo"/> |
| | | <where> |
| | | <if test="postCode != null and postCode != ''"> |
| | | AND post_code like concat('%', #{postCode}, '%') |
| | | AND post_code like '%' || #{postCode} || '%' |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | AND status = #{status} |
| | | </if> |
| | | <if test="postName != null and postName != ''"> |
| | | AND post_name like concat('%', #{postName}, '%') |
| | | AND post_name like '%' || #{postName} || '%' |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | AND r.role_id = #{roleId} |
| | | </if> |
| | | <if test="roleName != null and roleName != ''"> |
| | | AND r.role_name like concat('%', #{roleName}, '%') |
| | | AND r.role_name like '%' || #{roleName} || '%' |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | AND r.status = #{status} |
| | | </if> |
| | | <if test="roleKey != null and roleKey != ''"> |
| | | AND r.role_key like concat('%', #{roleKey}, '%') |
| | | AND r.role_key like '%' || #{roleKey} || '%' |
| | | </if> |
| | | <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> |
| | | and date_format(r.create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d') |
| | |
| | | AND u.user_id = #{userId} |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | | AND u.user_name like concat('%', #{userName}, '%') |
| | | AND u.user_name like '%' || #{userName} || '%' |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | AND u.status = #{status} |
| | | </if> |
| | | <if test="phonenumber != null and phonenumber != ''"> |
| | | AND u.phonenumber like concat('%', #{phonenumber}, '%') |
| | | AND u.phonenumber like '%' || #{phonenumber} || '%' |
| | | </if> |
| | | <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> |
| | | AND date_format(u.create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d') |
| | |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | where u.del_flag = '0' and r.role_id = #{roleId} |
| | | <if test="userName != null and userName != ''"> |
| | | AND u.user_name like concat('%', #{userName}, '%') |
| | | AND u.user_name like '%' || #{userName} || '%' |
| | | </if> |
| | | <if test="phonenumber != null and phonenumber != ''"> |
| | | AND u.phonenumber like concat('%', #{phonenumber}, '%') |
| | | AND u.phonenumber like '%' || #{phonenumber} || '%' |
| | | </if> |
| | | <!-- 数据范围过滤 --> |
| | | ${params.dataScope} |
| | |
| | | where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL) |
| | | and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id = ur.user_id and ur.role_id = #{roleId}) |
| | | <if test="userName != null and userName != ''"> |
| | | AND u.user_name like concat('%', #{userName}, '%') |
| | | AND u.user_name like '%' || #{userName} || '%' |
| | | </if> |
| | | <if test="phonenumber != null and phonenumber != ''"> |
| | | AND u.phonenumber like concat('%', #{phonenumber}, '%') |
| | | AND u.phonenumber like '%' || #{phonenumber} || '%' |
| | | </if> |
| | | <!-- 数据范围过滤 --> |
| | | ${params.dataScope} |