init():南钢程序前后端分离
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
package com.fizz.business.controller;
|
||||
|
||||
import com.fizz.business.domain.CrmPdiPlan;
|
||||
import com.fizz.business.form.PlanQueryForm;
|
||||
import com.fizz.business.service.CrmPdiPlanService;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/pdi")
|
||||
@Api("南钢计划接口")
|
||||
public class CrmPdiPlanController {
|
||||
|
||||
@Autowired
|
||||
private CrmPdiPlanService crmPdiPlanService;
|
||||
|
||||
@GetMapping("/get/{coilid}")
|
||||
@ApiOperation("通过钢卷号查询计划")
|
||||
public R<CrmPdiPlan> getByCoilId(@PathVariable String coilid) {
|
||||
|
||||
return R.ok(crmPdiPlanService.getByCoilIdAndOperId(coilid));
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增计划")
|
||||
public boolean add(@RequestBody CrmPdiPlan crmPdiPlan) {
|
||||
return crmPdiPlanService.addCrmPdiPlan(crmPdiPlan);
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("修改计划")
|
||||
public boolean update(@RequestBody CrmPdiPlan crmPdiPlan) {
|
||||
return crmPdiPlanService.updateCrmPdiPlan(crmPdiPlan);
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@ApiOperation("计划删除")
|
||||
public boolean delete(@RequestBody List<Long> coilid) {
|
||||
return crmPdiPlanService.deleteCrmPdiPlan(coilid);
|
||||
}
|
||||
|
||||
@PostMapping("/list")
|
||||
@ApiOperation("查询计划列表")
|
||||
public R<List<CrmPdiPlan>> list(@RequestBody PlanQueryForm form) {
|
||||
return R.ok(crmPdiPlanService.listAll(form));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.fizz.business.controller;
|
||||
|
||||
import com.fizz.business.domain.CrmPdoExcoil;
|
||||
import com.fizz.business.service.CrmPdoExcoilService;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/pdo")
|
||||
@Api("南钢实绩接口")
|
||||
public class CrmPdoExcoilController {
|
||||
|
||||
@Autowired
|
||||
private CrmPdoExcoilService crmPdoExcoilService;
|
||||
|
||||
@GetMapping("/get/{excoilid}/{operid}")
|
||||
@ApiOperation("查询实绩")
|
||||
public CrmPdoExcoil getByExcoilIdAndOperId(@PathVariable String excoilid, @PathVariable Integer operid) {
|
||||
return crmPdoExcoilService.getByExcoilIdAndOperId(excoilid, operid);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增实绩")
|
||||
public boolean add(@RequestBody CrmPdoExcoil crmPdoExcoil) {
|
||||
return crmPdoExcoilService.addCrmPdoExcoil(crmPdoExcoil);
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("修改")
|
||||
public boolean update(@RequestBody CrmPdoExcoil crmPdoExcoil) {
|
||||
return crmPdoExcoilService.updateCrmPdoExcoil(crmPdoExcoil);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete/{excoilid}/{operid}")
|
||||
@ApiOperation("删除实绩")
|
||||
public boolean delete(@PathVariable String excoilid, @PathVariable Integer operid) {
|
||||
return crmPdoExcoilService.deleteCrmPdoExcoil(excoilid, operid);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询实绩列表")
|
||||
public List<CrmPdoExcoil> list() {
|
||||
return crmPdoExcoilService.listAll();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.fizz.business.controller;
|
||||
|
||||
import com.fizz.business.domain.CrmPdiPlan;
|
||||
import com.fizz.business.domain.RollData;
|
||||
import com.fizz.business.domain.RollHistory;
|
||||
import com.fizz.business.form.RollHistoryForm;
|
||||
import com.fizz.business.service.RollDataService;
|
||||
import com.fizz.business.service.RollHistoryService;
|
||||
import com.fizz.business.vo.OnlineRollDataVO;
|
||||
import com.fizz.business.vo.ReadyRollDataVO;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/roller")
|
||||
@Api("南钢轧辊接口")
|
||||
public class RollerController {
|
||||
@Resource
|
||||
RollHistoryService rollHistoryService;
|
||||
|
||||
@Resource
|
||||
RollDataService rollDataService;
|
||||
|
||||
@GetMapping("/data/backup")
|
||||
@ApiOperation("轧辊数据-获取当前备辊信息")
|
||||
public R<List<ReadyRollDataVO> > getReadyRollList() {
|
||||
return R.ok(rollDataService.getReadyRollList(null,null,"BACKUP"));
|
||||
}
|
||||
|
||||
@GetMapping("/data/ready/{position}/{type}")
|
||||
@ApiOperation("轧辊数据-获取离线辊信息")
|
||||
public R<List<ReadyRollDataVO> > getOfflineRollList(@PathVariable String position, @PathVariable String type) {
|
||||
return R.ok(rollDataService.getReadyRollList(position,type,"OFFLINE"));
|
||||
}
|
||||
|
||||
@GetMapping("/data/online")
|
||||
@ApiOperation("轧辊数据-获取在线辊信息")
|
||||
public R<List<OnlineRollDataVO>> getOnlineRollList() {
|
||||
return R.ok(rollDataService.getOnlineRollList());
|
||||
}
|
||||
|
||||
@GetMapping("/change/backup")
|
||||
@ApiOperation("轧辊操作-备辊")
|
||||
public R<List<String>> backupRoll(@RequestBody List<ReadyRollDataVO> rollList) {
|
||||
return R.ok(rollDataService.BackupRoll(rollList));
|
||||
}
|
||||
|
||||
@GetMapping("/change/online")
|
||||
@ApiOperation("轧辊操作-上线")
|
||||
public R<List<OnlineRollDataVO>> onlineRoll() {
|
||||
return R.ok(rollDataService.onlineRoll());
|
||||
}
|
||||
|
||||
@GetMapping("/history/changeid")
|
||||
@ApiOperation("轧辊历史-获取所有换辊号")
|
||||
public R<List<String>> getChangeIdList() {
|
||||
return R.ok(rollHistoryService.getChangeIdList());
|
||||
}
|
||||
|
||||
@GetMapping("/history/rollid")
|
||||
@ApiOperation("轧辊历史-获取所有轧辊号")
|
||||
public R<List<String>> getRollIdList() {
|
||||
return R.ok(rollHistoryService.getRollIdList());
|
||||
}
|
||||
|
||||
@GetMapping("/history/list")
|
||||
@ApiOperation("轧辊历史-获取换辊记录")
|
||||
public R<List<RollHistory>> getRollHistorytList(@RequestBody RollHistoryForm rollHistoryForm) {
|
||||
return R.ok(rollHistoryService.getRollHistory(rollHistoryForm));
|
||||
}
|
||||
}
|
||||
121
business/src/main/java/com/fizz/business/domain/CrmPdiPlan.java
Normal file
121
business/src/main/java/com/fizz/business/domain/CrmPdiPlan.java
Normal file
@@ -0,0 +1,121 @@
|
||||
package com.fizz.business.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@TableName("crm_pdi_plan")
|
||||
public class CrmPdiPlan implements Serializable {
|
||||
|
||||
@TableId
|
||||
@ApiModelProperty(value = "id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "序列号")
|
||||
private Integer seqid;
|
||||
|
||||
@ApiModelProperty(value = "多火轧制次数")
|
||||
private Integer operid;
|
||||
|
||||
@ApiModelProperty(value = "卷ID")
|
||||
private String coilid;
|
||||
|
||||
@ApiModelProperty(value = "热轧卷ID")
|
||||
private String hotCoilid;
|
||||
|
||||
@ApiModelProperty(value = "道次数")
|
||||
private Integer passno;
|
||||
|
||||
@ApiModelProperty(value = "退火厚度")
|
||||
private Integer annealThick;
|
||||
|
||||
@ApiModelProperty(value = "入口厚度")
|
||||
private Float entryThick;
|
||||
|
||||
@ApiModelProperty(value = "入口宽度")
|
||||
private Float entryWidth;
|
||||
|
||||
@ApiModelProperty(value = "入口重量")
|
||||
private Float entryWeight;
|
||||
|
||||
@ApiModelProperty(value = "入口长度")
|
||||
private Float entryLength;
|
||||
|
||||
@ApiModelProperty(value = "入口内径")
|
||||
private Integer entryInnerDiameter;
|
||||
|
||||
@ApiModelProperty(value = "入口外径")
|
||||
private Integer entryOuterDiameter;
|
||||
|
||||
@ApiModelProperty(value = "出口卷号")
|
||||
private String exitCoilid;
|
||||
|
||||
@ApiModelProperty(value = "下工序代码")
|
||||
private String nextUnit;
|
||||
|
||||
@ApiModelProperty(value = "分割数量")
|
||||
private Integer splitNum;
|
||||
|
||||
@ApiModelProperty(value = "切割模式")
|
||||
private Integer cutMode;
|
||||
|
||||
@ApiModelProperty(value = "出口重量1")
|
||||
private Float exitValue1;
|
||||
|
||||
@ApiModelProperty(value = "出口重量2")
|
||||
private Float exitValue2;
|
||||
|
||||
@ApiModelProperty(value = "出口重量3")
|
||||
private Float exitValue3;
|
||||
|
||||
@ApiModelProperty(value = "出口重量4")
|
||||
private Float exitValue4;
|
||||
|
||||
@ApiModelProperty(value = "出口重量5")
|
||||
private Float exitValue5;
|
||||
|
||||
@ApiModelProperty(value = "出口重量6")
|
||||
private Float exitValue6;
|
||||
|
||||
@ApiModelProperty(value = "出口重量")
|
||||
private Float exitWeight;
|
||||
|
||||
@ApiModelProperty(value = "出口长度")
|
||||
private Float exitLength;
|
||||
|
||||
@ApiModelProperty(value = "出口厚度")
|
||||
private Float exitThick;
|
||||
|
||||
@ApiModelProperty(value = "出口宽度")
|
||||
private Float exitWidth;
|
||||
|
||||
@ApiModelProperty(value = "等级")
|
||||
private String grade;
|
||||
|
||||
@ApiModelProperty(value = "屈服强度")
|
||||
private Integer yieldStrength;
|
||||
|
||||
@ApiModelProperty(value = "抗拉强度")
|
||||
private Integer tensileStrength;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "记录日期")
|
||||
private LocalDateTime insdate;
|
||||
|
||||
@ApiModelProperty(value = "上线时间")
|
||||
private LocalDateTime onlineTime;
|
||||
|
||||
@ApiModelProperty(value = "开始日期")
|
||||
private LocalDateTime startDate;
|
||||
|
||||
@ApiModelProperty(value = "结束日期")
|
||||
private LocalDateTime endDate;
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.fizz.business.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
@Data
|
||||
@TableName("crm_pdo_excoil")
|
||||
public class CrmPdoExcoil implements Serializable {
|
||||
|
||||
@TableId
|
||||
@ApiModelProperty(value = "成品卷ID")
|
||||
private String excoilid;
|
||||
|
||||
@ApiModelProperty(value = "进入卷ID")
|
||||
private String encoilid;
|
||||
|
||||
@ApiModelProperty(value = "钢种")
|
||||
private String grade;
|
||||
|
||||
@ApiModelProperty(value = "多火轧制次数")
|
||||
private Integer operid;
|
||||
|
||||
@ApiModelProperty(value = "分卷id")
|
||||
private Integer subid;
|
||||
|
||||
@ApiModelProperty(value = "头部位置")
|
||||
private Float headpos;
|
||||
|
||||
@ApiModelProperty(value = "尾部位置")
|
||||
private Float tailpos;
|
||||
|
||||
@ApiModelProperty(value = "班次")
|
||||
private String shift;
|
||||
|
||||
@ApiModelProperty(value = "班组")
|
||||
private String crew;
|
||||
|
||||
@ApiModelProperty(value = "退火厚度")
|
||||
private Float annealThick;
|
||||
|
||||
@ApiModelProperty(value = "入口厚度")
|
||||
private Float entryThick;
|
||||
|
||||
@ApiModelProperty(value = "入口宽度")
|
||||
private Float entryWidth;
|
||||
|
||||
@ApiModelProperty(value = "入口重量")
|
||||
private Float entryWeight;
|
||||
|
||||
@ApiModelProperty(value = "成品厚度")
|
||||
private Float exitThick;
|
||||
|
||||
@ApiModelProperty(value = "成品宽度")
|
||||
private Float exitWidth;
|
||||
|
||||
@ApiModelProperty(value = "成品长度")
|
||||
private Float exitLength;
|
||||
|
||||
@ApiModelProperty(value = "成品内径")
|
||||
private Float exitInnerDiameter;
|
||||
|
||||
@ApiModelProperty(value = "理论出口重量")
|
||||
private Float calcExitWeight;
|
||||
|
||||
@ApiModelProperty(value = "实际出口重量")
|
||||
private Float measExitWeight;
|
||||
|
||||
@ApiModelProperty(value = "外径")
|
||||
private Float outerDiameter;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "上线时间")
|
||||
private Timestamp onlineDate;
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private Timestamp startDate;
|
||||
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private Timestamp endDate;
|
||||
|
||||
@ApiModelProperty(value = "插入日期")
|
||||
private Timestamp insdate;
|
||||
|
||||
@ApiModelProperty(value = "质量")
|
||||
private Float quality;
|
||||
|
||||
@ApiModelProperty(value = "热卷ID")
|
||||
private String hotCoilid;
|
||||
|
||||
@ApiModelProperty(value = "下机组代码")
|
||||
private String nextUnit;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "目的地")
|
||||
private String destination;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.fizz.business.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@TableName("plant_config")
|
||||
@ApiModel(value = "PlantConfig对象", description = "配置数据")
|
||||
public class PlantConfig implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String varname;
|
||||
|
||||
@ApiModelProperty(value = "arrayindex")
|
||||
private Integer arrayindex;
|
||||
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = "值")
|
||||
private String value;
|
||||
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty(value = "时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime timestamp;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.fizz.business.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@TableName("roll_change_cycle")
|
||||
@ApiModel(value = "RollChangeCycle对象", description = "换辊")
|
||||
public class RollChangeCycle implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "位置")
|
||||
private String position;
|
||||
|
||||
@ApiModelProperty(value = "机架号")
|
||||
private Integer standid;
|
||||
|
||||
@ApiModelProperty(value = "轧制长度")
|
||||
private Double rolledLength;
|
||||
|
||||
@ApiModelProperty(value = "轧制重量")
|
||||
private Double rolledWeight;
|
||||
|
||||
@ApiModelProperty(value = "轧制数量")
|
||||
private Integer rolledCount;
|
||||
|
||||
@ApiModelProperty(value = "insdate")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime insdate;
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.fizz.business.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@TableName("roll_data")
|
||||
@ApiModel(value = "RollData对象", description = "轧辊数据")
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
public class RollData implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "rollid",type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "轧辊号")
|
||||
private String rollid;
|
||||
|
||||
@ApiModelProperty(value = "工序")
|
||||
private String seton;
|
||||
|
||||
@ApiModelProperty(value = "类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "位置")
|
||||
private String position;
|
||||
|
||||
@ApiModelProperty(value = "机架号")
|
||||
private Integer standid;
|
||||
|
||||
@ApiModelProperty(value = "消耗")
|
||||
private Integer composition;
|
||||
|
||||
@ApiModelProperty(value = "直径")
|
||||
private Double diameter;
|
||||
|
||||
@ApiModelProperty(value = "粗糙度")
|
||||
private Double rough;
|
||||
|
||||
@ApiModelProperty(value = "凸度")
|
||||
private Double crown;
|
||||
|
||||
@ApiModelProperty(value = "轧制长度")
|
||||
private Double rolledLength;
|
||||
|
||||
@ApiModelProperty(value = "轧制重量")
|
||||
private Double rolledWeight;
|
||||
|
||||
@ApiModelProperty(value = "轧制数量")
|
||||
private Integer rolledCount;
|
||||
|
||||
@ApiModelProperty(value = "总轧制重量")
|
||||
private Double totalRolledWeight;
|
||||
|
||||
@ApiModelProperty(value = "总轧制长度")
|
||||
private Double totalRolledLength;
|
||||
|
||||
@ApiModelProperty(value = "总轧制数量")
|
||||
private Integer totalRolledCount;
|
||||
|
||||
@ApiModelProperty(value = "修理次数")
|
||||
private Integer grindCount;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "Installation Time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime instalTime;
|
||||
|
||||
@ApiModelProperty(value = "Deinstallation Time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime deinstalTime;
|
||||
|
||||
@ApiModelProperty(value = "Update Time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updtime;
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.fizz.business.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@TableName("Roll_history")
|
||||
@ApiModel(value = "RollHistory对象", description = "轧辊历史")
|
||||
public class RollHistory implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "轧辊号")
|
||||
private String rollid;
|
||||
|
||||
@ApiModelProperty(value = "换辊id")
|
||||
private String changeid;
|
||||
|
||||
@ApiModelProperty(value = "班")
|
||||
private String shift;
|
||||
|
||||
@ApiModelProperty(value = "组")
|
||||
private String crew;
|
||||
|
||||
@ApiModelProperty(value = "工序")
|
||||
private String seton;
|
||||
|
||||
@ApiModelProperty(value = "类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "位置")
|
||||
private String position;
|
||||
|
||||
@ApiModelProperty(value = "机架号")
|
||||
private Integer standid;
|
||||
|
||||
@ApiModelProperty(value = "消化")
|
||||
private Integer composition;
|
||||
|
||||
@ApiModelProperty(value = "直径")
|
||||
private Double diameter;
|
||||
|
||||
@ApiModelProperty(value = "粗糙度")
|
||||
private Double rough;
|
||||
|
||||
@ApiModelProperty(value = "凸度")
|
||||
private Double crown;
|
||||
|
||||
@ApiModelProperty(value = "轧制长度")
|
||||
private Double rolledLength;
|
||||
|
||||
@ApiModelProperty(value = "轧制重量")
|
||||
private Double rolledWeight;
|
||||
|
||||
@ApiModelProperty(value = "轧制数量")
|
||||
private Integer rolledCount;
|
||||
|
||||
@ApiModelProperty(value = "总轧制重量")
|
||||
private Double totalRolledWeight;
|
||||
|
||||
@ApiModelProperty(value = "总轧制长度")
|
||||
private Double totalRolledLength;
|
||||
|
||||
@ApiModelProperty(value = "总轧制数量")
|
||||
private Integer totalRolledCount;
|
||||
|
||||
@ApiModelProperty(value = "修理次数")
|
||||
private Integer grindCount;
|
||||
|
||||
@ApiModelProperty(value = "换辊类型")
|
||||
private String changeType;
|
||||
|
||||
@ApiModelProperty(value = "Installation Time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime instalTime;
|
||||
|
||||
@ApiModelProperty(value = "Deinstallation Time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime deinstalTime;
|
||||
|
||||
@ApiModelProperty(value = "changeTime")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime changeTime;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.fizz.business.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@TableName("shift_history")
|
||||
@Data
|
||||
@ApiModel(value = "RollData对象", description = "轧辊数据")
|
||||
public class ShiftHistory implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "班次")
|
||||
private String shift;
|
||||
|
||||
@ApiModelProperty(value = "组次")
|
||||
private String crew;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "时间")
|
||||
private LocalDateTime insdate;
|
||||
}
|
||||
1
business/src/main/java/com/fizz/business/dto/10086.txt
Normal file
1
business/src/main/java/com/fizz/business/dto/10086.txt
Normal file
@@ -0,0 +1 @@
|
||||
11111
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.fizz.business.form;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
@Data
|
||||
public class PlanQueryForm {
|
||||
|
||||
@ApiModelProperty(value = "卷ID")
|
||||
private String coilid;
|
||||
|
||||
@ApiModelProperty(value = "热轧卷ID")
|
||||
private String hotCoilid;
|
||||
|
||||
@ApiModelProperty(value = "道次数")
|
||||
private Integer passno;
|
||||
|
||||
@ApiModelProperty(value = "入口厚度")
|
||||
private Float entryThick;
|
||||
|
||||
@ApiModelProperty(value = "入口宽度")
|
||||
private Float entryWidth;
|
||||
|
||||
@ApiModelProperty(value = "入口内径")
|
||||
private Integer entryInnerDiameter;
|
||||
|
||||
@ApiModelProperty(value = "入口外径")
|
||||
private Integer entryOuterDiameter;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "记录日期")
|
||||
private LocalDateTime insdate;
|
||||
|
||||
@ApiModelProperty(value = "上线时间")
|
||||
private LocalDateTime onlineTime;
|
||||
|
||||
@ApiModelProperty(value = "开始日期")
|
||||
private LocalDateTime startDate;
|
||||
|
||||
@ApiModelProperty(value = "结束日期")
|
||||
private LocalDateTime endDate;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.fizz.business.form;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class RollHistoryForm {
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@ApiModelProperty(value = "换辊号")
|
||||
private String changeId;
|
||||
|
||||
@ApiModelProperty(value = "轧辊号")
|
||||
private String rollid;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
11111
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fizz.business.domain.CrmPdiPlan;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface CrmPdiPlanMapper extends BaseMapper<CrmPdiPlan> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fizz.business.domain.CrmPdoExcoil;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface CrmPdoExcoilMapper extends BaseMapper<CrmPdoExcoil> {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fizz.business.domain.PlantConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface PlantConfigMapper extends BaseMapper<PlantConfig> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fizz.business.domain.RollChangeCycle;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface RollChangeCycleMapper extends BaseMapper<RollChangeCycle> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fizz.business.domain.RollData;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface RollDataMapper extends BaseMapper<RollData> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fizz.business.domain.RollHistory;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface RollHistoryMapper extends BaseMapper<RollHistory> {
|
||||
List<String> getChangeIdList();
|
||||
|
||||
List<String> getRollIdList();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fizz.business.domain.ShiftHistory;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ShiftHistoryMapper extends BaseMapper<ShiftHistory> {
|
||||
}
|
||||
1
business/src/main/java/com/fizz/business/mq/10086.txt
Normal file
1
business/src/main/java/com/fizz/business/mq/10086.txt
Normal file
@@ -0,0 +1 @@
|
||||
11111
|
||||
@@ -0,0 +1 @@
|
||||
11111
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fizz.business.domain.CrmPdiPlan;
|
||||
import com.fizz.business.form.PlanQueryForm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CrmPdiPlanService extends IService<CrmPdiPlan> {
|
||||
|
||||
public CrmPdiPlan getByCoilIdAndOperId(String coilid);
|
||||
|
||||
public boolean addCrmPdiPlan(CrmPdiPlan crmPdiPlan);
|
||||
|
||||
public boolean updateCrmPdiPlan(CrmPdiPlan crmPdiPlan);
|
||||
|
||||
public boolean deleteCrmPdiPlan(List<Long> coilid);
|
||||
|
||||
public List<CrmPdiPlan> listAll(PlanQueryForm form);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fizz.business.domain.CrmPdoExcoil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CrmPdoExcoilService extends IService<CrmPdoExcoil> {
|
||||
CrmPdoExcoil getByExcoilIdAndOperId(String excoilid, Integer operid);
|
||||
|
||||
boolean addCrmPdoExcoil(CrmPdoExcoil crmPdoExcoil);
|
||||
|
||||
boolean updateCrmPdoExcoil(CrmPdoExcoil crmPdoExcoil);
|
||||
|
||||
boolean deleteCrmPdoExcoil(String excoilid, Integer operid);
|
||||
|
||||
List<CrmPdoExcoil> listAll();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fizz.business.domain.PlantConfig;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface PlantConfigService extends IService<PlantConfig> {
|
||||
Map<String,PlantConfig> getAllConfig();
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fizz.business.domain.RollChangeCycle;
|
||||
|
||||
public interface RollChangeCycleService extends IService<RollChangeCycle> {
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fizz.business.domain.RollData;
|
||||
import com.fizz.business.vo.OnlineRollDataVO;
|
||||
import com.fizz.business.vo.ReadyRollDataVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface RollDataService extends IService<RollData> {
|
||||
List<RollData> getList(String position,String type,String status);
|
||||
|
||||
List<ReadyRollDataVO> getReadyRollList(String position,String type,String status);
|
||||
|
||||
List<OnlineRollDataVO> getOnlineRollList();
|
||||
|
||||
List<String> BackupRoll(List<ReadyRollDataVO> rollList);
|
||||
|
||||
List<OnlineRollDataVO> onlineRoll();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fizz.business.domain.RollHistory;
|
||||
import com.fizz.business.form.RollHistoryForm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface RollHistoryService extends IService<RollHistory> {
|
||||
List<String> getChangeIdList();
|
||||
|
||||
List<String> getRollIdList();
|
||||
|
||||
List<RollHistory> getRollHistory(RollHistoryForm rollHistoryForm);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fizz.business.domain.ShiftHistory;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
public interface ShiftHistoryService extends IService<ShiftHistory> {
|
||||
ShiftHistory getCurrent();
|
||||
|
||||
List<ShiftHistory> getShiftCurrentListByDate(LocalDateTime startTime, LocalDateTime endTime);
|
||||
|
||||
List<String> getCrews();
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fizz.business.domain.CrmPdiPlan;
|
||||
import com.fizz.business.form.PlanQueryForm;
|
||||
import com.fizz.business.mapper.CrmPdiPlanMapper;
|
||||
import com.fizz.business.service.CrmPdiPlanService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service
|
||||
public class CrmPdiPlanServiceImpl extends ServiceImpl<CrmPdiPlanMapper, CrmPdiPlan> implements CrmPdiPlanService {
|
||||
|
||||
|
||||
/**
|
||||
* 根据卷ID和操作员ID查询单个记录
|
||||
* @param coilid 卷ID
|
||||
* @return 查询到的CrmPdiPlan对象
|
||||
*/
|
||||
public CrmPdiPlan getByCoilIdAndOperId(String coilid) {
|
||||
QueryWrapper<CrmPdiPlan> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like("coilid", coilid);
|
||||
return this.getOne(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加新记录
|
||||
* @param crmPdiPlan 要添加的CrmPdiPlan对象
|
||||
* @return 是否添加成功
|
||||
*/
|
||||
public boolean addCrmPdiPlan(CrmPdiPlan crmPdiPlan) {
|
||||
return this.save(crmPdiPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新已有记录
|
||||
* @param crmPdiPlan 要更新的CrmPdiPlan对象
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
public boolean updateCrmPdiPlan(CrmPdiPlan crmPdiPlan) {
|
||||
return this.updateById(crmPdiPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据卷ID和操作员ID删除记录
|
||||
* @param coilid 卷ID
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
public boolean deleteCrmPdiPlan(List<Long> coilid) {
|
||||
QueryWrapper<CrmPdiPlan> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("COILID", coilid);
|
||||
return this.removeBatchByIds(coilid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
* @return CrmPdiPlan对象的列表
|
||||
*/
|
||||
public List<CrmPdiPlan> listAll(PlanQueryForm form) {
|
||||
QueryWrapper<CrmPdiPlan> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.in("STATUS", "NEW","READY");
|
||||
return this.list();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fizz.business.domain.CrmPdoExcoil;
|
||||
import com.fizz.business.mapper.CrmPdoExcoilMapper;
|
||||
import com.fizz.business.service.CrmPdoExcoilService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CrmPdoExcoilServiceImpl extends ServiceImpl<CrmPdoExcoilMapper, CrmPdoExcoil> implements CrmPdoExcoilService {
|
||||
|
||||
/**
|
||||
* 根据退出卷ID和操作员ID查询记录
|
||||
* @param excoilid 退出卷ID
|
||||
* @param operid 操作员ID
|
||||
* @return 查询到的CrmPdoExcoil对象
|
||||
*/
|
||||
public CrmPdoExcoil getByExcoilIdAndOperId(String excoilid, Integer operid) {
|
||||
QueryWrapper<CrmPdoExcoil> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("excoilid", excoilid).eq("operid", operid);
|
||||
return this.getOne(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加新记录
|
||||
* @param crmPdoExcoil 要添加的CrmPdoExcoil对象
|
||||
* @return 是否添加成功
|
||||
*/
|
||||
public boolean addCrmPdoExcoil(CrmPdoExcoil crmPdoExcoil) {
|
||||
return this.save(crmPdoExcoil);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新已有记录
|
||||
* @param crmPdoExcoil 要更新的CrmPdoExcoil对象
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
public boolean updateCrmPdoExcoil(CrmPdoExcoil crmPdoExcoil) {
|
||||
return this.updateById(crmPdoExcoil);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据退出卷ID和操作员ID删除记录
|
||||
* @param excoilid 退出卷ID
|
||||
* @param operid 操作员ID
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
public boolean deleteCrmPdoExcoil(String excoilid, Integer operid) {
|
||||
QueryWrapper<CrmPdoExcoil> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("excoilid", excoilid).eq("operid", operid);
|
||||
return this.remove(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
* @return CrmPdoExcoil对象的列表
|
||||
*/
|
||||
public List<CrmPdoExcoil> listAll() {
|
||||
return this.list();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fizz.business.domain.PlantConfig;
|
||||
import com.fizz.business.mapper.PlantConfigMapper;
|
||||
import com.fizz.business.service.PlantConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class PlantConfigServiceImpl extends ServiceImpl<PlantConfigMapper, PlantConfig> implements PlantConfigService {
|
||||
@Override
|
||||
public Map<String, PlantConfig> getAllConfig() {
|
||||
return this.list().stream().collect(Collectors.toMap(
|
||||
PlantConfig::getVarname,
|
||||
obj -> obj,
|
||||
(key1 , key2) -> key1
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fizz.business.domain.RollChangeCycle;
|
||||
import com.fizz.business.mapper.RollChangeCycleMapper;
|
||||
import com.fizz.business.service.RollChangeCycleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class RollChangeCycleServiceImpl extends ServiceImpl<RollChangeCycleMapper, RollChangeCycle> implements RollChangeCycleService {
|
||||
}
|
||||
@@ -0,0 +1,326 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fizz.business.domain.PlantConfig;
|
||||
import com.fizz.business.domain.RollData;
|
||||
import com.fizz.business.domain.RollHistory;
|
||||
import com.fizz.business.domain.ShiftHistory;
|
||||
import com.fizz.business.mapper.RollDataMapper;
|
||||
import com.fizz.business.service.PlantConfigService;
|
||||
import com.fizz.business.service.RollDataService;
|
||||
import com.fizz.business.service.RollHistoryService;
|
||||
import com.fizz.business.service.ShiftHistoryService;
|
||||
import com.fizz.business.vo.OnlineRollDataVO;
|
||||
import com.fizz.business.vo.ReadyRollDataVO;
|
||||
|
||||
import com.ruoyi.common.utils.bean.BeanUtils;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class RollDataServiceImpl extends ServiceImpl<RollDataMapper, RollData> implements RollDataService {
|
||||
|
||||
@Resource
|
||||
PlantConfigService plantConfigService;
|
||||
|
||||
@Resource
|
||||
ShiftHistoryService shiftHistoryService;
|
||||
|
||||
@Resource
|
||||
RollHistoryService rollHistoryService;
|
||||
|
||||
@Override
|
||||
public List<RollData> getList(String position,String type,String status) {
|
||||
QueryWrapper<RollData> queryWrapper = new QueryWrapper<>();
|
||||
if(ObjectUtil.isNotEmpty(position)){
|
||||
queryWrapper.eq("position", position);
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(type)){
|
||||
queryWrapper.eq("type", type);
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(status)){
|
||||
queryWrapper.eq("status", status);
|
||||
}
|
||||
queryWrapper.last(" order by FIELD(CONCAT(POSITION, '_', TYPE), " +
|
||||
"'TOP_BACKUP', 'TOP_INTERMEDIATE', 'TOP_WORK', " +
|
||||
"'BOTTOM_WORK','BOTTOM_INTERMEDIATE', 'BOTTOM_BACKUP')");
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReadyRollDataVO> getReadyRollList(String position,String type, String status) {
|
||||
List<ReadyRollDataVO> readyRollDataVOList = new ArrayList<>();
|
||||
List<RollData> rollDataList = getList(position, type,status);
|
||||
for (RollData rollData : rollDataList) {
|
||||
ReadyRollDataVO readyRollDataVO = new ReadyRollDataVO();
|
||||
// 使用 BeanUtils 复制属性
|
||||
BeanUtils.copyProperties(rollData, readyRollDataVO);
|
||||
readyRollDataVOList.add(readyRollDataVO);
|
||||
}
|
||||
return readyRollDataVOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OnlineRollDataVO> getOnlineRollList() {
|
||||
Map<String, PlantConfig> plantConfigMap = plantConfigService.getAllConfig();
|
||||
|
||||
List<OnlineRollDataVO> readyRollDataVOList = new ArrayList<>();
|
||||
List<RollData> rollDataList = getList(null, null,"ONLINE");
|
||||
for (RollData rollData : rollDataList) {
|
||||
OnlineRollDataVO onlineRollDataVO = new OnlineRollDataVO();
|
||||
// 使用 BeanUtils 复制属性
|
||||
BeanUtils.copyProperties(rollData, onlineRollDataVO);
|
||||
String lengthKey="";
|
||||
String weightKey="";
|
||||
switch(rollData.getType()){
|
||||
case "BACKUP":
|
||||
lengthKey = "MAX_BUR_ROLLER_LENGTH";
|
||||
weightKey = "MAX_BUR_ROLLER_WEIGHT";
|
||||
break;
|
||||
case "INTERMEDIATE":
|
||||
lengthKey = "MAX_INTERMEDIATE_ROLLER_LENGTH";
|
||||
weightKey = "MAX_INTERMEDIATE_ROLLER_WEIGHT";
|
||||
break;
|
||||
case "WORK":
|
||||
lengthKey = "MAX_WORK_ROLLER_LENGTH";
|
||||
weightKey = "MAX_WORK_ROLLER_WEIGHT";
|
||||
break;
|
||||
}
|
||||
//轧制长度,轧制重量
|
||||
if(plantConfigMap.containsKey(lengthKey)){
|
||||
PlantConfig plantConfig = plantConfigMap.get(lengthKey);
|
||||
double value = Double.parseDouble(plantConfig.getValue());
|
||||
onlineRollDataVO.setUsableLength(value);
|
||||
onlineRollDataVO.setLeftLength(value-onlineRollDataVO.getRolledWeight());
|
||||
}
|
||||
if(plantConfigMap.containsKey(weightKey)){
|
||||
PlantConfig plantConfig = plantConfigMap.get(weightKey);
|
||||
double value = Double.parseDouble(plantConfig.getValue());
|
||||
onlineRollDataVO.setRolledWeight(value);
|
||||
onlineRollDataVO.setLeftLength(value-onlineRollDataVO.getRolledWeight());
|
||||
}
|
||||
readyRollDataVOList.add(onlineRollDataVO);
|
||||
}
|
||||
return readyRollDataVOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> BackupRoll(List<ReadyRollDataVO> rollList) {
|
||||
if(ObjectUtil.isEmpty(rollList)){
|
||||
return Arrays.asList("轧辊数量为空,无法备辊");
|
||||
}
|
||||
//统一检查所有轧辊状态
|
||||
List<String> rollidList = rollList.stream()
|
||||
.map(ReadyRollDataVO::getRollid)
|
||||
.collect(Collectors.toList());
|
||||
List<RollData> rollDataList = this.baseMapper.selectBatchIds(rollidList);
|
||||
|
||||
if(rollDataList.stream()
|
||||
.anyMatch(item->item.getStatus().equals("ONLINE"))){
|
||||
return Arrays.asList("存在轧辊已在线,无法备辊");
|
||||
}
|
||||
Map<String, PlantConfig> plantConfigMap = plantConfigService.getAllConfig();
|
||||
//检查是否成对
|
||||
//检查辊径大小
|
||||
//检查辊径差
|
||||
List<String> result = new ArrayList<>();
|
||||
//工作辊
|
||||
checkRollDia( plantConfigMap,rollList,result,"WORK");
|
||||
checkRollDia( plantConfigMap,rollList,result,"INTERMEDIATE");
|
||||
checkRollDia( plantConfigMap,rollList,result,"BACKUP");
|
||||
|
||||
//清楚所有已有备辊,添加新备辊,有则更新数据,没有则新增
|
||||
if(ObjectUtil.isEmpty(result)){
|
||||
lambdaUpdate().set(RollData::getStatus,"OFFLINE")
|
||||
.eq(RollData::getStatus,"BACKUP")
|
||||
.update();
|
||||
|
||||
List<RollData> newDataList = Lists.newArrayList();
|
||||
rollList.forEach(item->{
|
||||
|
||||
RollData temp = rollDataList.stream().filter(n->n.getRollid().equals(item.getRollid()))
|
||||
.findFirst().orElse(RollData.builder()
|
||||
.rollid(item.getRollid())
|
||||
.position(item.getPosition())
|
||||
.type(item.getType())
|
||||
.seton("CRM")
|
||||
.standid(1)
|
||||
.grindCount(0)
|
||||
.build());
|
||||
//更新辊径、凸度和粗糙度
|
||||
temp.setDiameter(temp.getDiameter());
|
||||
temp.setCrown(temp.getCrown());
|
||||
temp.setRough(temp.getRough());
|
||||
|
||||
newDataList.add(temp);
|
||||
});
|
||||
this.saveOrUpdateBatch(newDataList);
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OnlineRollDataVO> onlineRoll() {
|
||||
List<RollData> backupRollList = getList(null, null,"BACKUP");
|
||||
List<RollData> onlineRollList = getList(null, null,"ONLINE");
|
||||
if(ObjectUtil.isEmpty(backupRollList)){
|
||||
return getOnlineRollList();
|
||||
}
|
||||
ShiftHistory shiftHistory = shiftHistoryService.getCurrent();
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
||||
String changeID = LocalDateTime.now().format(dateTimeFormatter);
|
||||
List<RollHistory> rollHistoryList =Lists.newArrayList();
|
||||
List<RollData> changeRollList =Lists.newArrayList();
|
||||
//更换轧辊
|
||||
backupRollList.forEach(item->{
|
||||
//上线卷
|
||||
item.setStatus("ONLINE");
|
||||
item.setGrindCount(item.getGrindCount()+1);
|
||||
item.setRolledCount(0);
|
||||
item.setRolledWeight(0d);
|
||||
item.setRolledLength(0d);
|
||||
item.setInstalTime(LocalDateTime.now());
|
||||
item.setDeinstalTime(LocalDateTime.now());
|
||||
changeRollList.add(item);
|
||||
|
||||
RollHistory rollHistoryOn = RollHistory.builder().build();
|
||||
BeanUtils.copyProperties(item, rollHistoryOn);
|
||||
rollHistoryOn.setChangeid(changeID);
|
||||
rollHistoryOn.setShift(shiftHistory.getShift());
|
||||
rollHistoryOn.setCrew(shiftHistory.getCrew());
|
||||
rollHistoryOn.setChangeType("ON");
|
||||
rollHistoryOn.setChangeTime(LocalDateTime.now());
|
||||
rollHistoryList.add(rollHistoryOn);
|
||||
|
||||
//下线卷
|
||||
RollData onlineRoll = onlineRollList.stream().filter(n->n.getPosition().equals(item.getPosition())
|
||||
&&n.getType().equals(item.getType()))
|
||||
.findFirst().orElse(null);
|
||||
if(ObjectUtil.isNotNull(onlineRoll)){
|
||||
onlineRoll.setStatus("OFFLINE");
|
||||
onlineRoll.setDeinstalTime(LocalDateTime.now());
|
||||
changeRollList.add(onlineRoll);
|
||||
|
||||
RollHistory rollHistoryOff = RollHistory.builder().build();
|
||||
BeanUtils.copyProperties(onlineRoll, rollHistoryOff);
|
||||
rollHistoryOff.setChangeid(changeID);
|
||||
rollHistoryOff.setShift(shiftHistory.getShift());
|
||||
rollHistoryOff.setCrew(shiftHistory.getCrew());
|
||||
rollHistoryOff.setChangeType("OFF");
|
||||
rollHistoryOff.setChangeTime(LocalDateTime.now());
|
||||
rollHistoryList.add(rollHistoryOff);
|
||||
}
|
||||
|
||||
});
|
||||
this.updateBatchById(changeRollList);
|
||||
rollHistoryService.saveBatch(rollHistoryList);
|
||||
return getOnlineRollList();
|
||||
}
|
||||
|
||||
private void checkRollDia(Map<String, PlantConfig> plantConfigMap,List<ReadyRollDataVO> rollList,List<String> result,String type){
|
||||
String name = "";
|
||||
String maxValueKey = "";
|
||||
String minValueKey = "";
|
||||
String diffValueKey = "";
|
||||
|
||||
switch(type){
|
||||
case "BACKUP":
|
||||
maxValueKey = "MAX_BR_DIA";
|
||||
minValueKey = "MIN_BR_DIA";
|
||||
diffValueKey = "MAX_BR_DIA_DIFF";
|
||||
name = "工作辊";
|
||||
break;
|
||||
case "INTERMEDIATE":
|
||||
maxValueKey = "MAX_IR_DIA";
|
||||
minValueKey = "MIN_IR_DIA";
|
||||
diffValueKey = "MAX_IR_DIA_DIFF";
|
||||
name = "工作辊";
|
||||
break;
|
||||
case "WORK":
|
||||
maxValueKey = "MAX_WR_DIA";
|
||||
minValueKey = "MIN_WR_DIA";
|
||||
diffValueKey = "MAX_WR_DIA_DIFF";
|
||||
name = "工作辊";
|
||||
break;
|
||||
}
|
||||
|
||||
List<ReadyRollDataVO> rolls = rollList.stream()
|
||||
.filter(item->item.getType().equals(type))
|
||||
.collect(Collectors.toList());
|
||||
if(rolls.size()>0){
|
||||
//工作辊成对更换
|
||||
double rollDia1;
|
||||
double rollDia2;
|
||||
if(type.equals("WORK")||type.equals("INTERMEDIATE")) {
|
||||
if (rolls.size() != 2) {
|
||||
result.add(String.format("{0}必须成对更换", name));
|
||||
return;
|
||||
} else {
|
||||
if (rolls.get(0).getPosition().equals(rolls.get(1).getPosition())) {
|
||||
result.add(String.format("{0}备辊位置重复", name));
|
||||
return;
|
||||
}
|
||||
rollDia1 = rolls.get(0).getDiameter();
|
||||
rollDia2 = rolls.get(1).getDiameter();
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(rolls.size()>2){
|
||||
result.add(String.format("{0}备辊数量错误",name));
|
||||
return;
|
||||
}else {
|
||||
rollDia1 = rolls.get(0).getDiameter();
|
||||
if(rolls.size()==2) {
|
||||
if (rolls.get(0).getPosition().equals(rolls.get(1).getPosition())) {
|
||||
result.add(String.format("{0}备辊位置重复", name));
|
||||
return;
|
||||
}
|
||||
rollDia2 = rolls.get(1).getDiameter();
|
||||
}else {
|
||||
//单个备辊,和在线辊比较
|
||||
rollDia2 = rollDia1;
|
||||
String nextPosition = rolls.get(0).getPosition().equals("TOP")?"BOTTOM":"TOP";
|
||||
List<RollData> onlineList = getList(nextPosition,type,"ONLINE");
|
||||
if(onlineList.size()>0){
|
||||
rollDia2 = onlineList.get(0).getDiameter();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//最大值
|
||||
if(plantConfigMap.containsKey(maxValueKey)){
|
||||
double value = Double.parseDouble(plantConfigMap.get(maxValueKey).getValue());
|
||||
if(rollDia1>value||rollDia2>value){
|
||||
result.add(String.format("{0}径超限[max:{1}]",name,value));
|
||||
}
|
||||
}
|
||||
//最小值
|
||||
if(plantConfigMap.containsKey(minValueKey)){
|
||||
double value = Double.parseDouble(plantConfigMap.get(minValueKey).getValue());
|
||||
if(rollDia1<value||rollDia2<value){
|
||||
result.add(String.format("{0}径超限[min:{1}]",name,value));
|
||||
}
|
||||
}
|
||||
//差值
|
||||
if(plantConfigMap.containsKey(diffValueKey)){
|
||||
double value = Double.parseDouble(plantConfigMap.get(diffValueKey).getValue());
|
||||
if(Math.abs(rollDia1-rollDia2)>value){
|
||||
result.add(String.format("{0}径超限[diff:{1}]",name,value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fizz.business.domain.RollHistory;
|
||||
import com.fizz.business.form.RollHistoryForm;
|
||||
import com.fizz.business.mapper.RollHistoryMapper;
|
||||
import com.fizz.business.service.RollHistoryService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class RollHistoryServiceImpl extends ServiceImpl<RollHistoryMapper, RollHistory> implements RollHistoryService {
|
||||
@Override
|
||||
public List<String> getChangeIdList() {
|
||||
return baseMapper.getChangeIdList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getRollIdList() {
|
||||
return baseMapper.getRollIdList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RollHistory> getRollHistory(RollHistoryForm rollHistoryForm) {
|
||||
LambdaQueryWrapper<RollHistory> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if(ObjectUtil.isNotEmpty(rollHistoryForm.getStartTime())){
|
||||
queryWrapper.ge(RollHistory::getChangeTime,rollHistoryForm.getStartTime());
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(rollHistoryForm.getEndTime())){
|
||||
queryWrapper.le(RollHistory::getChangeTime,rollHistoryForm.getEndTime());
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(rollHistoryForm.getChangeId())){
|
||||
queryWrapper.eq(RollHistory::getChangeid,rollHistoryForm.getChangeId());
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(rollHistoryForm.getRollid())){
|
||||
queryWrapper.eq(RollHistory::getRollid,rollHistoryForm.getRollid());
|
||||
}
|
||||
queryWrapper.orderByDesc(RollHistory::getChangeTime);
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fizz.business.domain.ShiftHistory;
|
||||
import com.fizz.business.mapper.ShiftHistoryMapper;
|
||||
import com.fizz.business.service.ShiftHistoryService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class ShiftHistoryServiceImpl extends ServiceImpl<ShiftHistoryMapper, ShiftHistory> implements ShiftHistoryService {
|
||||
@Override
|
||||
public ShiftHistory getCurrent() {
|
||||
QueryWrapper<ShiftHistory> queryWrapper = new QueryWrapper<>();
|
||||
return this.getOne(queryWrapper.orderByDesc("insdate").last("LIMIT 1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShiftHistory> getShiftCurrentListByDate(LocalDateTime startTime, LocalDateTime endTime) {
|
||||
return lambdaQuery()
|
||||
.ge(ShiftHistory::getInsdate, startTime)
|
||||
.lt(ShiftHistory::getInsdate, endTime)
|
||||
.isNotNull(ShiftHistory::getCrew)
|
||||
.orderByDesc(ShiftHistory::getInsdate)
|
||||
.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getCrews() {
|
||||
QueryWrapper<ShiftHistory> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select("DISTINCT crew");
|
||||
List<ShiftHistory> shiftCurrentList = baseMapper.selectList(queryWrapper);
|
||||
|
||||
return shiftCurrentList
|
||||
.stream()
|
||||
.map(ShiftHistory::getCrew)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
1
business/src/main/java/com/fizz/business/utils/10086.txt
Normal file
1
business/src/main/java/com/fizz/business/utils/10086.txt
Normal file
@@ -0,0 +1 @@
|
||||
11111
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.fizz.business.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class OnlineRollDataVO {
|
||||
@ApiModelProperty(value = "轧辊号")
|
||||
private String rollid;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "位置")
|
||||
private String position;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "直径")
|
||||
private Double diameter;
|
||||
|
||||
@ApiModelProperty(value = "粗糙度")
|
||||
private Double rough;
|
||||
|
||||
@ApiModelProperty(value = "凸度")
|
||||
private Double crown;
|
||||
|
||||
@ApiModelProperty(value = "轧制长度")
|
||||
private Double rolledLength;
|
||||
|
||||
@ApiModelProperty(value = "轧制重量")
|
||||
private Double rolledWeight;
|
||||
|
||||
@ApiModelProperty(value = "轧制数量")
|
||||
private Integer rolledCount;
|
||||
|
||||
@ApiModelProperty(value = "Installation Time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime instalTime;
|
||||
|
||||
@ApiModelProperty(value = "可用长度")
|
||||
private Double usableLength;
|
||||
|
||||
@ApiModelProperty(value = "剩余长度")
|
||||
private Double leftLength;
|
||||
|
||||
@ApiModelProperty(value = "可用重量")
|
||||
private Double usableWeight;
|
||||
|
||||
@ApiModelProperty(value = "剩余重量")
|
||||
private Double leftWeight;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.fizz.business.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ReadyRollDataVO {
|
||||
@ApiModelProperty(value = "轧辊号")
|
||||
private String rollid;
|
||||
|
||||
@ApiModelProperty(value = "类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "位置")
|
||||
private String position;
|
||||
|
||||
@ApiModelProperty(value = "直径")
|
||||
private Double diameter;
|
||||
|
||||
@ApiModelProperty(value = "粗糙度")
|
||||
private Double rough;
|
||||
|
||||
@ApiModelProperty(value = "凸度")
|
||||
private Double crown;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user