Commit 2b31b599 authored by 温志超's avatar 温志超

Merge remote-tracking branch 'origin/master'

parents 12a03ff6 5503ce41
...@@ -27,41 +27,7 @@ public class KanbanAbnormalController { ...@@ -27,41 +27,7 @@ public class KanbanAbnormalController {
@ApiOperation("当月异常分布数据") @ApiOperation("当月异常分布数据")
@PostMapping("/currentMonthStat") @PostMapping("/currentMonthStat")
public AjaxResult<AbnormalMonthStatDto> currentMonthStat() { public AjaxResult<AbnormalMonthStatDto> currentMonthStat() {
AbnormalMonthStatDto rst = new AbnormalMonthStatDto(); AbnormalMonthStatDto rst = kanbanAbnormalService.currentMonthStat();
AbnormalMonthStatDto.AbnormalMonthStatDetail abnormal1 = new AbnormalMonthStatDto.AbnormalMonthStatDetail();
abnormal1.setTotalCt(10);
abnormal1.setExpireUnClose(2);
abnormal1.setUnCloseCt(6);
rst.setEquipAbnormal(abnormal1);
AbnormalMonthStatDto.AbnormalMonthStatDetail abnormal2 = new AbnormalMonthStatDto.AbnormalMonthStatDetail();
abnormal2.setTotalCt(6);
abnormal2.setExpireUnClose(1);
abnormal2.setUnCloseCt(4);
rst.setProductAbnormal(abnormal2);
rst.setEquipCt(52);
rst.setEquipErrorCt(3);
List<AbnormalMonthStatDto.AbnormalCauseStat> abnormalCauseStats = new ArrayList<>();
abnormalCauseStats.add(new AbnormalMonthStatDto.AbnormalCauseStat(){
{
setCause("停电");
setCt(2);
}
});
abnormalCauseStats.add(new AbnormalMonthStatDto.AbnormalCauseStat(){
{
setCause("设备损坏");
setCt(4);
}
});
abnormalCauseStats.add(new AbnormalMonthStatDto.AbnormalCauseStat(){
{
setCause("硬件故障");
setCt(0);
}
});
rst.setAbnormalCauseData(abnormalCauseStats);
rst.setEquipErrorArr(ListUtil.toList(new Integer[]{0,0,0,2,2,0,0}));
return AjaxResult.success(rst); return AjaxResult.success(rst);
} }
......
package com.ximai.mes.kanban.controller; package com.ximai.mes.kanban.controller;
import com.ximai.common.core.domain.AjaxResult; import com.ximai.common.core.domain.AjaxResult;
import com.ximai.mes.kanban.dto.abnormal.AbnormalMonthStatDto;
import com.ximai.mes.kanban.dto.task.TaskStatDto; import com.ximai.mes.kanban.dto.task.TaskStatDto;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -102,6 +103,27 @@ public class KanbanTaskController { ...@@ -102,6 +103,27 @@ public class KanbanTaskController {
processMonthlyIndexDto.setQualifiedRatio(new BigDecimal("95")); processMonthlyIndexDto.setQualifiedRatio(new BigDecimal("95"));
processMonthlyIndexDto.setMonthPlanConcludeRatio(new BigDecimal("35")); processMonthlyIndexDto.setMonthPlanConcludeRatio(new BigDecimal("35"));
rst.setProcessMonthlyIndexDto(processMonthlyIndexDto); rst.setProcessMonthlyIndexDto(processMonthlyIndexDto);
List<TaskStatDto.AbnormalCauseStat> abnormalCauseStats = new ArrayList<>();
abnormalCauseStats.add(new TaskStatDto.AbnormalCauseStat(){
{
setCause("停电");
setCt(2);
}
});
abnormalCauseStats.add(new TaskStatDto.AbnormalCauseStat(){
{
setCause("设备损坏");
setCt(4);
}
});
abnormalCauseStats.add(new TaskStatDto.AbnormalCauseStat(){
{
setCause("硬件故障");
setCt(0);
}
});
rst.setAbnormalCauseData(abnormalCauseStats);
return AjaxResult.success(rst); return AjaxResult.success(rst);
} }
......
...@@ -22,31 +22,17 @@ public class AbnormalMonthStatDto { ...@@ -22,31 +22,17 @@ public class AbnormalMonthStatDto {
@ApiModelProperty("当前设备故障数") @ApiModelProperty("当前设备故障数")
Integer equipErrorCt; Integer equipErrorCt;
@ApiModelProperty("设备七天故障数") @ApiModelProperty("设备近七天故障数,顺序为:索引0当天、1昨天、2前天")
List<Integer> equipErrorArr=new ArrayList<>(); List<Integer> equipErrorArr=new ArrayList<>();
@ApiModelProperty("异常原因不合格分布")
List<AbnormalCauseStat> abnormalCauseData;
@Data @Data
public static class AbnormalMonthStatDetail{ public static class AbnormalMonthStatDetail{
@ApiModelProperty("异常总数") @ApiModelProperty("异常总数")
Integer totalCt; Integer totalCt=0;
@ApiModelProperty("未关闭数") @ApiModelProperty("未关闭数")
Integer unCloseCt; Integer unCloseCt=0;
@ApiModelProperty("超期未关闭数") @ApiModelProperty("超期未关闭数")
Integer expireUnClose; Integer expireUnClose=0;
}
@Data
public static class AbnormalCauseStat{
@ApiModelProperty("异常原因")
String cause;
@ApiModelProperty("异常原因")
Integer ct;
} }
} }
...@@ -18,6 +18,20 @@ public class TaskStatDto { ...@@ -18,6 +18,20 @@ public class TaskStatDto {
@ApiModelProperty("工序月统计指标") @ApiModelProperty("工序月统计指标")
ProcessMonthlyIndexDto processMonthlyIndexDto; ProcessMonthlyIndexDto processMonthlyIndexDto;
@ApiModelProperty("异常原因不合格分布")
List<AbnormalCauseStat> abnormalCauseData;
@Data
public static class AbnormalCauseStat{
@ApiModelProperty("异常原因")
String cause;
@ApiModelProperty("异常原因")
Integer ct=0;
}
@Data @Data
public static class ProcessOutput{ public static class ProcessOutput{
......
package com.ximai.mes.kanban.service; package com.ximai.mes.kanban.service;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ximai.mes.kanban.dto.abnormal.AbnormalMonthStatDto; import com.ximai.mes.kanban.dto.abnormal.AbnormalMonthStatDto;
import com.ximai.mes.md.domain.MdWorkunit;
import com.ximai.mes.md.mapper.MdWorkunitMapper;
import com.ximai.mes.md.service.IMdWorkunitService;
import com.ximai.mes.qc.domain.QcAbnormalInformation;
import com.ximai.mes.qc.domain.QcAbnormalReport;
import com.ximai.mes.qc.dto.QcAbnormalReportDto;
import com.ximai.mes.qc.dto.QcAbnormalReportStatusEnum;
import com.ximai.mes.qc.dto.QcAbnormalTypeEnum;
import com.ximai.mes.qc.mapper.QcAbnormalReportMapper;
import com.ximai.mes.qc.service.IQcAbnormalInformationService;
import com.ximai.mes.qc.service.IQcAbnormalReportService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.checkerframework.checker.units.qual.C;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.*;
import java.util.stream.Collectors;
@Service @Service
public class KanbanAbnormalService { public class KanbanAbnormalService {
@Autowired
IQcAbnormalReportService abnormalReportService;
@Autowired
IQcAbnormalInformationService abnormalInformationService;
@Autowired
MdWorkunitMapper workunitMapper;
@Autowired
QcAbnormalReportMapper abnormalReportMapper;
@ApiOperation("当月异常分布数据") @ApiOperation("当月异常分布数据")
@PostMapping("/currentMonthStat") @PostMapping("/currentMonthStat")
public AbnormalMonthStatDto currentMonthStat() { public AbnormalMonthStatDto currentMonthStat() {
return null; //本月第一天
LocalDateTime monthFirstDay = LocalDateTime.now().withDayOfMonth(1).with(LocalTime.MIN);
AbnormalMonthStatDto rst = new AbnormalMonthStatDto();
QueryWrapper<QcAbnormalReport> query = new QueryWrapper<>();
query.ge("create_time", monthFirstDay);
List<QcAbnormalReportDto> abnormalList = abnormalReportService.selectQcAbnormalReportDtoList(query);
Map<String, List<QcAbnormalReportDto>> abnormalTypeMap = abnormalList.stream().collect(Collectors.groupingBy(s->s.getAbnormalType()));
List<QcAbnormalReportDto> equipAbnormal = abnormalTypeMap.getOrDefault(QcAbnormalTypeEnum.DEVI.getType(), new ArrayList<>());
List<QcAbnormalReportDto> productAbnormal = abnormalTypeMap.getOrDefault(QcAbnormalTypeEnum.PROD.getType(), new ArrayList<>());
AbnormalMonthStatDto.AbnormalMonthStatDetail abnormal1 = this.stat(equipAbnormal);
AbnormalMonthStatDto.AbnormalMonthStatDetail abnormal2 = this.stat(productAbnormal);
rst.setProductAbnormal(abnormal2);
rst.setEquipAbnormal(abnormal1);
//统计所有未关闭设备异常
QueryWrapper<QcAbnormalReport> abnormalReportQuery = new QueryWrapper<>();
abnormalReportQuery.in("abnormal_status", new String[]{QcAbnormalReportStatusEnum.NOT.getStatus(), QcAbnormalReportStatusEnum.SUBMIT.getStatus()});
Integer abnormalEquipCt = abnormalReportMapper.selectCount(abnormalReportQuery);
rst.setEquipErrorCt(abnormalEquipCt);
QueryWrapper<MdWorkunit> workunitQuery = new QueryWrapper<>();
workunitQuery.eq("enable_flag", "Y");
int workunitCt = workunitMapper.selectCount(workunitQuery);
rst.setEquipCt(workunitCt-abnormalEquipCt);
// List<QcAbnormalReportDto> unqualifiedAbnormal = abnormalTypeMap.getOrDefault(QcAbnormalTypeEnum.UNQUALIFIED_REASON.getType(), new ArrayList<>());
// //按不合格原因分组
// Map<String, List<QcAbnormalReportDto>> unqualifiedAbnormalMap = unqualifiedAbnormal.stream().collect(Collectors.groupingBy(s->s.getAbnormalReason()));
// //查询不合格原因
// QcAbnormalInformation qcAbnormalInformationQuery = new QcAbnormalInformation();
// qcAbnormalInformationQuery.setAbnormalType(QcAbnormalTypeEnum.UNQUALIFIED_REASON.getType());
// List<QcAbnormalInformation> abnormalInfoList = abnormalInformationService.selectQcAbnormalInformationList(qcAbnormalInformationQuery);
// LinkedHashMap<String, Integer> unqualifiedAbnormalRstMap = new LinkedHashMap<>();
// List<AbnormalMonthStatDto.AbnormalCauseStat> abnormalCauseStats = new ArrayList<>();
// abnormalInfoList.forEach(s->{
// if(!unqualifiedAbnormalMap.containsKey(s.getAbnormalReason())){
// unqualifiedAbnormalRstMap.put(s.getAbnormalReason(), 0);
// }else {
// unqualifiedAbnormalRstMap.put(s.getAbnormalReason(), unqualifiedAbnormalMap.get(s.getAbnormalReason()).size());
// }
// });
// Map<String,Integer> queueUnqualifiedMap = MapUtil.sortByValue(unqualifiedAbnormalRstMap, true);
// queueUnqualifiedMap.forEach((k,v)->{
// abnormalCauseStats.add(new AbnormalMonthStatDto.AbnormalCauseStat(){
// {
// setCt(v);
// setCause(k);
// }
// });
// });
// rst.setAbnormalCauseData(abnormalCauseStats);
//查询七天内设备异常,按天统计
Calendar last7Day = Calendar.getInstance();
last7Day.set(Calendar.DATE, -6);
Map<String,List<QcAbnormalReportDto>> newEquipAbnormalMap = equipAbnormal.stream()
.filter(s->s.getCreateTime().compareTo(last7Day.getTime())>0)
.collect(Collectors.groupingBy(s-> DateUtil.format(s.getCreateTime(),"MMdd")));
//按日期dd/MM分组
List<Integer> last7EquipAbnormalCt = new ArrayList<>();
Calendar tempCurr = Calendar.getInstance();
for(int i=0;i<7;i++){
String key = DateUtil.format(tempCurr.getTime(), "MMdd");
if(newEquipAbnormalMap.containsKey(key)){
last7EquipAbnormalCt.add(newEquipAbnormalMap.get(key).size());
}else {
last7EquipAbnormalCt.add(0);
}
tempCurr.add(Calendar.DATE, -1);
}
rst.setEquipErrorArr(last7EquipAbnormalCt);
return rst;
} }
private AbnormalMonthStatDto.AbnormalMonthStatDetail stat(List<QcAbnormalReportDto> abnormalList){
AbnormalMonthStatDto.AbnormalMonthStatDetail abnormal1 = new AbnormalMonthStatDto.AbnormalMonthStatDetail();
if(abnormalList==null){
return abnormal1;
}
abnormal1.setTotalCt(abnormalList.size());
//报检时间超一天未关闭-超时未闭
Calendar curr = Calendar.getInstance();
curr.add(Calendar.DATE, 1);
int expireCt = abnormalList.stream().filter(s->{
if(s.getAbnormalStatus().equals(QcAbnormalReportStatusEnum.NOT.getStatus())
||s.getAbnormalStatus().equals(QcAbnormalReportStatusEnum.SUBMIT.getStatus())){
curr.setTime(s.getCreateTime());
curr.add(Calendar.DATE, 1);
if(curr.getTime().compareTo(curr.getTime())>0){
return true;
}
}
return false;
}).collect(Collectors.toList()).size();
abnormal1.setExpireUnClose(expireCt);
abnormal1.setUnCloseCt(abnormalList.stream().filter(s->s.getAbnormalStatus().equals(QcAbnormalReportStatusEnum.NOT.getStatus())
||s.getAbnormalStatus().equals(QcAbnormalReportStatusEnum.SUBMIT.getStatus())).collect(Collectors.toList()).size());
return abnormal1;
}
} }
...@@ -2,12 +2,15 @@ package com.ximai.mes.kanban.service; ...@@ -2,12 +2,15 @@ package com.ximai.mes.kanban.service;
import com.ximai.mes.kanban.dto.task.TaskStatDto; import com.ximai.mes.kanban.dto.task.TaskStatDto;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.checkerframework.checker.units.qual.A;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Service @Service
...@@ -15,8 +18,15 @@ public class KanbanTaskService { ...@@ -15,8 +18,15 @@ public class KanbanTaskService {
@ApiOperation("工序当月统计") @ApiOperation("工序当月统计")
@PostMapping("/currentMonthStat") @PostMapping("/currentMonthStat")
public List<TaskStatDto> currentMonthStat() { public TaskStatDto currentMonthStat() {
return null; TaskStatDto rst = new TaskStatDto();
List<TaskStatDto.ProcessOutput> outputList=new ArrayList<>();
List<TaskStatDto.ProcessQualifiedRate> qualifiedRateList=new ArrayList<>();
TaskStatDto.ProcessMonthlyIndexDto processMonthlyIndexDto=new TaskStatDto.ProcessMonthlyIndexDto();
rst.setOutputList(outputList);
rst.setQualifiedRateList(qualifiedRateList);
rst.setProcessMonthlyIndexDto(processMonthlyIndexDto);
return rst;
} }
} }
package com.ximai.mes.md.mapper; package com.ximai.mes.md.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ximai.mes.md.domain.MdVehicle;
import com.ximai.mes.md.domain.MdWorkunit; import com.ximai.mes.md.domain.MdWorkunit;
import com.ximai.mes.md.vo.MdWorkunitVo; import com.ximai.mes.md.vo.MdWorkunitVo;
import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Delete;
...@@ -15,7 +17,7 @@ import java.util.List; ...@@ -15,7 +17,7 @@ import java.util.List;
* @author yinjinlu * @author yinjinlu
* @date 2024-01-18 * @date 2024-01-18
*/ */
public interface MdWorkunitMapper { public interface MdWorkunitMapper extends BaseMapper<MdWorkunit> {
/** /**
* 查询工作单元 * 查询工作单元
......
...@@ -117,6 +117,14 @@ public class ProTaskWorkunit extends BaseEntity { ...@@ -117,6 +117,14 @@ public class ProTaskWorkunit extends BaseEntity {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date scheduleEndDate; private Date scheduleEndDate;
@ApiModelProperty("实际开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date actualStartDate;
@ApiModelProperty("实际结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date actualEndDate;
@ApiModelProperty("备注") @ApiModelProperty("备注")
private String remark; private String remark;
......
...@@ -841,6 +841,8 @@ public class ProTaskServiceImpl implements IProTaskService { ...@@ -841,6 +841,8 @@ public class ProTaskServiceImpl implements IProTaskService {
//本次合格数和不合格数总和大于可报工数目 与 已报工数目已经超过了排产数量 //本次合格数和不合格数总和大于可报工数目 与 已报工数目已经超过了排产数量
if ((feedbackQualityDouConst + fuantityUnqualify.doubleValue())>= task.getQuantityWait().doubleValue() && task.getQuantity().doubleValue() <= (execQuantityQualifySumConst + feedbackQualityDouConst + fuantityUnqualify.doubleValue())) { if ((feedbackQualityDouConst + fuantityUnqualify.doubleValue())>= task.getQuantityWait().doubleValue() && task.getQuantity().doubleValue() <= (execQuantityQualifySumConst + feedbackQualityDouConst + fuantityUnqualify.doubleValue())) {
//记录实际完工时间
taskWorkunit.setActualEndDate(Calendar.getInstance().getTime());
taskWorkunit.setStatus(FINISHED.getStatus()); taskWorkunit.setStatus(FINISHED.getStatus());
} }
quantityWaitVal = taskQuantityWaitConst.subtract(feedbackQualityVal.add(fuantityUnqualify)); quantityWaitVal = taskQuantityWaitConst.subtract(feedbackQualityVal.add(fuantityUnqualify));
......
...@@ -205,6 +205,10 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService { ...@@ -205,6 +205,10 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
proWorkorderService.updateWorkorderState(proWorkorder, WorkorderStatusEnum.PRODUCING); proWorkorderService.updateWorkorderState(proWorkorder, WorkorderStatusEnum.PRODUCING);
} }
} }
//记录实际开始时间
if(proTaskWorkunit.getActualStartDate()==null){
proTaskWorkunit.setActualStartDate(Calendar.getInstance().getTime());
}
} }
proTaskWorkunit.setStatus(taskStatusEnum.getStatus()); proTaskWorkunit.setStatus(taskStatusEnum.getStatus());
this.updateProTaskWorkunit(proTaskWorkunit); this.updateProTaskWorkunit(proTaskWorkunit);
......
package com.ximai.mes.qc.dto;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ximai.common.annotation.Excel;
import com.ximai.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
/**
* 车间异常单对象 qc_abnormal_report
*
* @author generator
* @date 2024-02-20
*/
@Data
public class QcAbnormalReportDto extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 车间异常单ID */
@TableId
private Long abnormalReportId;
/** 编批单号 */
@Excel(name = "编批单号")
private String batchNumber;
/** 编批单号 */
@Excel(name = "车间异常单单号 来源于编码规则:ABNORMAL_NUMBER")
private String abnormalNumber;
/** 工序ID */
@Excel(name = "工序ID")
private Long processId;
/** 工序编号 */
@Excel(name = "工序编号")
private String processCode;
/** 工序名称 */
@Excel(name = "工序名称")
private String processName;
/** 工作单元ID */
@Excel(name = "工作单元ID")
private Long workstationId;
/** 工作单元编号 */
@Excel(name = "工作单元编号")
private String workstationCode;
/** 工作单元名称 */
@Excel(name = "工作单元名称")
private String workstationName;
/** 异常类型 */
@Excel(name = "异常类型")
private String abnormalType;
/** 异常原因 */
@Excel(name = "异常原因")
private String abnormalReason;
/** 异常时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "异常时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date abnormalTime;
/** 单据状态 */
@Excel(name = "单据状态")
private String abnormalStatus;
private Long taskId;
/** 任务派工ID */
@Excel(name = "任务派工ID")
private Long taskWorkunitId;
//开始时间
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date beginPurchaseDate;
//结束时间
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endPurchaseDate;
/**
* 单据开始处理时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
/**
* 异常处理开始人
*/
private String startBy;
/**
* 处理结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
/**
* 处理结束人
*/
private String endBy;
/**
* 处理该异常的耗时
*/
private Long timeConsuming;
private String remarks;
}
package com.ximai.mes.qc.dto;
import com.ximai.mes.constant.TaskStatusEnum;
/**
* 车间异常单状态对象 QcAbnormalReportStatusEnum
*
* @author generator
* @date 2024-02-20
*/
public enum QcAbnormalReportStatusEnum {
/**
* 已提交
*/
SUBMIT("SUBMIT"),
/**
* 关闭
*/
CLOSE("CLOSE"),
/**
* 未提交
*/
NOT("NOT"),
/**
* 完成
*/
FINISH("FINISH");
/**
* Lock type
*/
private final String status;
QcAbnormalReportStatusEnum(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
public static QcAbnormalReportStatusEnum get(String status) {
for (QcAbnormalReportStatusEnum temp : QcAbnormalReportStatusEnum.values()) {
if (temp.getStatus().equals(status)) {
return temp;
}
}
return null;
}
}
package com.ximai.mes.qc.dto;
import com.ximai.mes.constant.TaskStatusEnum;
/**
* 车间异常单类型
*
* @author generator
* @date 2024-11-6
*/
public enum QcAbnormalTypeEnum {
/**
* 设备异常
*/
DEVI("DEVI"),
/**
* 生产异常
*/
PROD("PROD"),
/**
* 不合格异常
*/
UNQUALIFIED_REASON("UNQUALIFIED_REASON");
private final String type;
QcAbnormalTypeEnum(String type) {
this.type = type;
}
public String getType() {
return type;
}
public static QcAbnormalTypeEnum get(String type) {
for (QcAbnormalTypeEnum temp : QcAbnormalTypeEnum.values()) {
if (temp.getType().equals(type)) {
return temp;
}
}
return null;
}
}
package com.ximai.mes.qc.mapper; package com.ximai.mes.qc.mapper;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ximai.mes.qc.domain.QcAbnormalReport; import com.ximai.mes.qc.domain.QcAbnormalReport;
import com.ximai.mes.qc.dto.QcAbnormalReportDto;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/** /**
* 车间异常单Mapper接口 * 车间异常单Mapper接口
...@@ -28,6 +33,17 @@ public interface QcAbnormalReportMapper extends BaseMapper<QcAbnormalReport> ...@@ -28,6 +33,17 @@ public interface QcAbnormalReportMapper extends BaseMapper<QcAbnormalReport>
*/ */
public List<QcAbnormalReport> selectQcAbnormalReportList(QcAbnormalReport qcAbnormalReport); public List<QcAbnormalReport> selectQcAbnormalReportList(QcAbnormalReport qcAbnormalReport);
/**
* 查询车间异常单列表
*
* @param query 车间异常单
* @return 车间异常单集合
*/
@Select(value = "select t1.* from qc_abnormal_report t1\n" +
"${ew.customSqlSegment}")
public List<QcAbnormalReportDto> selectQcAbnormalReportDtoList(@Param("ew") QueryWrapper<QcAbnormalReport> query);
/** /**
* 新增车间异常单 * 新增车间异常单
* *
......
package com.ximai.mes.qc.service; package com.ximai.mes.qc.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ximai.mes.qc.domain.QcAbnormalReport; import com.ximai.mes.qc.domain.QcAbnormalReport;
import com.ximai.mes.qc.dto.QcAbnormalReportDto;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -27,6 +30,14 @@ public interface IQcAbnormalReportService { ...@@ -27,6 +30,14 @@ public interface IQcAbnormalReportService {
*/ */
List<QcAbnormalReport> selectQcAbnormalReportList(QcAbnormalReport qcAbnormalReport); List<QcAbnormalReport> selectQcAbnormalReportList(QcAbnormalReport qcAbnormalReport);
/**
* 查询车间异常单列表
*
* @param query 车间异常单
* @return 车间异常单集合
*/
public List<QcAbnormalReportDto> selectQcAbnormalReportDtoList(QueryWrapper<QcAbnormalReport> query);
/** /**
* 新增车间异常单 * 新增车间异常单
* *
......
package com.ximai.mes.qc.service.impl; package com.ximai.mes.qc.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ximai.common.constant.UserConstants; import com.ximai.common.constant.UserConstants;
import com.ximai.common.exception.ServiceException; import com.ximai.common.exception.ServiceException;
import com.ximai.common.utils.MessageUtils; import com.ximai.common.utils.MessageUtils;
...@@ -20,6 +21,7 @@ import com.ximai.mes.pro.service.IProPauseWorkService; ...@@ -20,6 +21,7 @@ import com.ximai.mes.pro.service.IProPauseWorkService;
import com.ximai.mes.pro.service.IProStartWorkService; import com.ximai.mes.pro.service.IProStartWorkService;
import com.ximai.mes.pro.service.task.IProTaskWorkunitService; import com.ximai.mes.pro.service.task.IProTaskWorkunitService;
import com.ximai.mes.qc.domain.QcAbnormalReport; import com.ximai.mes.qc.domain.QcAbnormalReport;
import com.ximai.mes.qc.dto.QcAbnormalReportDto;
import com.ximai.mes.qc.mapper.QcAbnormalReportMapper; import com.ximai.mes.qc.mapper.QcAbnormalReportMapper;
import com.ximai.mes.qc.service.IQcAbnormalReportService; import com.ximai.mes.qc.service.IQcAbnormalReportService;
import com.ximai.system.strategy.AutoCodeUtil; import com.ximai.system.strategy.AutoCodeUtil;
...@@ -85,6 +87,11 @@ public class QcAbnormalReportServiceImpl implements IQcAbnormalReportService { ...@@ -85,6 +87,11 @@ public class QcAbnormalReportServiceImpl implements IQcAbnormalReportService {
return qcAbnormalReportMapper.selectQcAbnormalReportList(qcAbnormalReport); return qcAbnormalReportMapper.selectQcAbnormalReportList(qcAbnormalReport);
} }
@Override
public List<QcAbnormalReportDto> selectQcAbnormalReportDtoList(QueryWrapper<QcAbnormalReport> query) {
return qcAbnormalReportMapper.selectQcAbnormalReportDtoList(query);
}
/** /**
* 新增车间异常单 * 新增车间异常单
* *
......
...@@ -23,6 +23,10 @@ ...@@ -23,6 +23,10 @@
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="remark" column="remark"/> <result property="remark" column="remark"/>
<result property="outsourceUnitPrice" column="outsource_unit_price"/> <result property="outsourceUnitPrice" column="outsource_unit_price"/>
<result property="scheduleStartDate" column="schedule_start_date"/>
<result property="scheduleEndDate" column="schedule_end_date"/>
<result property="actualStartDate" column="actual_start_date"/>
<result property="actualEndDate" column="actual_end_date"/>
<result property="vendorId" column="vendor_id"/> <result property="vendorId" column="vendor_id"/>
<result property="vendorName" column="vendor_name"/> <result property="vendorName" column="vendor_name"/>
<result property="outsourced" column="outsourced"/> <result property="outsourced" column="outsourced"/>
...@@ -49,6 +53,8 @@ ...@@ -49,6 +53,8 @@
ptw.quantity_changed, ptw.quantity_changed,
ptw.schedule_start_date, ptw.schedule_start_date,
ptw.schedule_end_date, ptw.schedule_end_date,
ptw.actual_start_date,
ptw.actual_end_date,
ptw.status, ptw.status,
ptw.create_by, ptw.create_by,
ptw.create_time, ptw.create_time,
...@@ -165,6 +171,8 @@ ...@@ -165,6 +171,8 @@
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="scheduleStartDate != null">schedule_start_date = #{scheduleStartDate},</if> <if test="scheduleStartDate != null">schedule_start_date = #{scheduleStartDate},</if>
<if test="scheduleEndDate != null">schedule_end_date = #{scheduleEndDate},</if> <if test="scheduleEndDate != null">schedule_end_date = #{scheduleEndDate},</if>
<if test="actualStartDate != null">actual_start_date = #{actualStartDate},</if>
<if test="actualEndDate != null">actual_end_date = #{actualEndDate},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment