Merge remote-tracking branch 'origin/master'

master
mengjiao 1 year ago
commit 8272aabbe6

@ -0,0 +1,31 @@
package com.op.system.api.domain.quality;
import java.util.List;
/**
*
*echart
* @author zxl
* @date 2023-07-18
*/
public class ChartSeriesDTO {
private List<String> yAxisData;
private List<ChartDTO> series;
public List<String> getyAxisData() {
return yAxisData;
}
public void setyAxisData(List<String> yAxisData) {
this.yAxisData = yAxisData;
}
public List<ChartDTO> getSeries() {
return series;
}
public void setSeries(List<ChartDTO> series) {
this.series = series;
}
}

@ -9,6 +9,8 @@ import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType; import com.op.common.log.enums.BusinessType;
import com.op.quality.domain.QcProCheck; import com.op.quality.domain.QcProCheck;
import com.op.quality.service.QcProCheckService; import com.op.quality.service.QcProCheckService;
import com.op.system.api.domain.quality.ChartDTO;
import com.op.system.api.domain.quality.ChartSeriesDTO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -30,7 +32,13 @@ public class QcProCheckController extends BaseController {
@GetMapping("/list") @GetMapping("/list")
public List<QcProCheck> list(QcProCheck qcProCheck) { public List<QcProCheck> list(QcProCheck qcProCheck) {
List<QcProCheck> qcProChecks = qcProCheckService.selectQcCheckList(qcProCheck); List<QcProCheck> qcProChecks = qcProCheckService.selectQcCheckList(qcProCheck);
return qcProCheckService.selectQcCheckList(qcProCheck); return qcProChecks;
}
@GetMapping("/getHfChartData")
public ChartSeriesDTO getHfChartData(QcProCheck qcProCheck) {
ChartSeriesDTO dto = qcProCheckService.getHfChartData(qcProCheck);
return dto;
} }
@Log(title = "白坯合格统计", businessType = BusinessType.EXPORT) @Log(title = "白坯合格统计", businessType = BusinessType.EXPORT)

@ -226,4 +226,26 @@ public class QcStaticTableController extends BaseController {
public List<FactoryDto> getWorkcenterList(FactoryDto factoryDto) { public List<FactoryDto> getWorkcenterList(FactoryDto factoryDto) {
return qcStaticTableService.getWorkcenterList(factoryDto); return qcStaticTableService.getWorkcenterList(factoryDto);
} }
/**
*
*/
@RequiresPermissions("quality:qcTableXJ:list")
@GetMapping("/getXJCheckTableList")
public List<QcStaticTable> getXJCheckTableList(QcStaticTable qcStaticTable) {
if(StringUtils.isNotBlank(qcStaticTable.getSupplierCode())){
List<String> codes = Arrays.asList(qcStaticTable.getSupplierCode().split(","));
qcStaticTable.setSupplierCodes(codes);
}
//默认时间范围T 00:00:00~T+1 00:00:00
if(StringUtils.isEmpty(qcStaticTable.getYearMonth())){
LocalDate date = LocalDate.now();
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM");
String ymStr = dtf.format(date);
qcStaticTable.setYearMonth(ymStr);//end
}
startPage();
List<QcStaticTable> list = qcStaticTableService.getXJCheckTableList(qcStaticTable);
return list;
}
} }

@ -83,6 +83,43 @@ public class QcProCheck extends BaseEntity {
@Excel(name = "合格率") @Excel(name = "合格率")
private String passRate; private String passRate;
private String chartType;
private String quality;
private String okQuality;
private String shiftId;
public String getShiftId() {
return shiftId;
}
public void setShiftId(String shiftId) {
this.shiftId = shiftId;
}
public String getOkQuality() {
return okQuality;
}
public void setOkQuality(String okQuality) {
this.okQuality = okQuality;
}
public String getQuality() {
return quality;
}
public void setQuality(String quality) {
this.quality = quality;
}
public String getChartType() {
return chartType;
}
public void setChartType(String chartType) {
this.chartType = chartType;
}
public String getAcceptanceNumber() { public String getAcceptanceNumber() {
return acceptanceNumber; return acceptanceNumber;
} }

@ -39,4 +39,7 @@ public interface QcProCheckMapper {
List<QcCheckTaskIncome> getCheckTaskList(QcCheckTaskIncome qcCheckTaskIncome); List<QcCheckTaskIncome> getCheckTaskList(QcCheckTaskIncome qcCheckTaskIncome);
List<QcProCheck> getQcProCheckList(QcProCheck qcProCheck); List<QcProCheck> getQcProCheckList(QcProCheck qcProCheck);
List<QcProCheck> getHFnames(QcProCheck qcProCheck);
} }

@ -29,4 +29,6 @@ public interface IQcStaticTableService {
public Map<String, QcStaticTable> getProduceChartDataYM(QcStaticTable qcStaticTable); public Map<String, QcStaticTable> getProduceChartDataYM(QcStaticTable qcStaticTable);
List<FactoryDto> getWorkcenterList(FactoryDto factoryDto); List<FactoryDto> getWorkcenterList(FactoryDto factoryDto);
List<QcStaticTable> getXJCheckTableList(QcStaticTable qcStaticTable);
} }

@ -7,6 +7,8 @@ import com.op.quality.domain.QcCheckTaskIncome;
import com.op.quality.domain.QcCheckTypeProject; import com.op.quality.domain.QcCheckTypeProject;
import com.op.quality.domain.QcProCheck; import com.op.quality.domain.QcProCheck;
import com.op.system.api.domain.SysDictData; import com.op.system.api.domain.SysDictData;
import com.op.system.api.domain.quality.ChartDTO;
import com.op.system.api.domain.quality.ChartSeriesDTO;
import java.util.List; import java.util.List;
@ -39,4 +41,6 @@ public interface QcProCheckService {
List<SysDictData> getQcUnitList(SysDictData sysDictData); List<SysDictData> getQcUnitList(SysDictData sysDictData);
List<QcProCheck> selectQcCheckList(QcProCheck qcProCheck); List<QcProCheck> selectQcCheckList(QcProCheck qcProCheck);
ChartSeriesDTO getHfChartData(QcProCheck qcProCheck);
} }

@ -14,6 +14,8 @@ import com.op.quality.mapper.QcCheckTaskIncomeMapper;
import com.op.quality.mapper.QcProCheckMapper; import com.op.quality.mapper.QcProCheckMapper;
import com.op.quality.service.QcProCheckService; import com.op.quality.service.QcProCheckService;
import com.op.system.api.domain.SysDictData; import com.op.system.api.domain.SysDictData;
import com.op.system.api.domain.quality.ChartDTO;
import com.op.system.api.domain.quality.ChartSeriesDTO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -151,4 +153,35 @@ public class QcProCheckServiceImpl implements QcProCheckService {
return qcProCheckMapper.getQcProCheckList(qcProCheck); return qcProCheckMapper.getQcProCheckList(qcProCheck);
} }
@Override
@DS("#header.poolName")
public ChartSeriesDTO getHfChartData(QcProCheck qcProCheck) {
ChartSeriesDTO dto = new ChartSeriesDTO();
List<QcProCheck> checkList = null;
List<String> yData = new ArrayList<>();
List<ChartDTO> sers = new ArrayList<>();
checkList = qcProCheckMapper.getHFnames(qcProCheck);
ChartDTO chartDTO = new ChartDTO();
chartDTO.setName("合格");
List<Double> data = new ArrayList<>();
ChartDTO chartDTO0 = new ChartDTO();
chartDTO0.setName("不合格");
List<Double> data0 = new ArrayList<>();
for(QcProCheck check:checkList){
yData.add(check.getMachineName());
data.add(Double.parseDouble(check.getOkQuality()));
data0.add(Double.parseDouble(check.getQuality())-Double.parseDouble(check.getOkQuality()));
}
chartDTO.setData(data);
chartDTO0.setData(data0);
sers.add(chartDTO);
sers.add(chartDTO0);
dto.setyAxisData(yData);
dto.setSeries(sers);
return dto;
}
} }

@ -136,5 +136,11 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
return qcStaticTableMapper.getWorkcenterList(factoryDto); return qcStaticTableMapper.getWorkcenterList(factoryDto);
} }
/**巡检**/
@Override
public List<QcStaticTable> getXJCheckTableList(QcStaticTable qcStaticTable) {
return null;
}
} }

@ -286,5 +286,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
GROUP BY q1.machine_code GROUP BY q1.machine_code
</select> </select>
<select id="getHFnames" resultType="com.op.quality.domain.QcProCheck">
select
alls.machineName,
alls.machineCode,
alls.quality,
ok.okQuality
from(
select count(0) quality,
<if test='chartType =="hf"'>
q1.machine_code machineCode,
q1.machine_name machineName
</if>
<if test='chartType =="cp"'>
q1.product_code machineCode,
q1.product_name machineName
</if>
from qc_pro_check q1
left join pro_order_workorder pow on pow.workorder_code = q1.workorder_code
<where>
<if test="workorderCode != null and workorderCode != ''">and q1.workorder_code like concat('%', #{workorderCode}, '%')</if>
<if test="productCode != null and productCode != ''">and q1.product_code like concat('%', #{productCode}, '%')</if>
<if test="machineCode != null and machineCode != ''">and q1.machine_code like concat('%', #{machineCode}, '%')</if>
<if test="createTimeStart != null ">and CONVERT(datetime,q1.create_time) >= #{createTimeStart}</if>
<if test="createTimeEnd != null ">and #{createTimeEnd} >= CONVERT(datetime,q1.create_time)</if>
and q1.machine_name LIKE '烘房%'
<if test="shiftId != null ">and pow.shift_id = #{shiftId}</if>
</where>
<if test='chartType =="hf"'>
group by q1.machine_code, q1.machine_name
</if>
<if test='chartType =="cp"'>
group by q1.product_code, q1.product_name
</if>
) alls
left join (
select count(0) okQuality,
<if test='chartType =="hf"'>
q1.machine_code machineCode,
q1.machine_name machineName
</if>
<if test='chartType =="cp"'>
q1.product_code machineCode,
q1.product_name machineName
</if>
from qc_pro_check q1
left join pro_order_workorder pow on pow.workorder_code = q1.workorder_code
<where>
<if test="workorderCode != null and workorderCode != ''">and q1.workorder_code like concat('%', #{workorderCode}, '%')</if>
<if test="productCode != null and productCode != ''">and q1.product_code like concat('%', #{productCode}, '%')</if>
<if test="machineCode != null and machineCode != ''">and q1.machine_code like concat('%', #{machineCode}, '%')</if>
<if test="createTimeStart != null ">and CONVERT(datetime,q1.create_time) >= #{createTimeStart}</if>
<if test="createTimeEnd != null ">and #{createTimeEnd} >= CONVERT(datetime,q1.create_time)</if>
and q1.machine_name LIKE '烘房%'
<if test="shiftId != null ">and pow.shift_id = #{shiftId}</if>
and q1.isqua = '1'
</where>
<if test='chartType =="hf"'>
group by q1.machine_code, q1.machine_name
</if>
<if test='chartType =="cp"'>
group by q1.product_code, q1.product_name
</if>
) ok on alls.machineCode = ok.machineCode
order by alls.machineName
</select>
</mapper> </mapper>

Loading…
Cancel
Save