问题修复

master
zhaoxiaolin 6 months ago
parent 991307491a
commit bed8f9a353

@ -750,7 +750,7 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
return 0;
}
int reportNum = mesReportWorkMapper.deleteReport(reportCode);
int consumeNum = mesReportWorkMapper.deleteReportConsume(reportCode);
//int consumeNum = mesReportWorkMapper.deleteReportConsume(reportCode);
return reportNum;
}

@ -67,18 +67,18 @@ public class QcCheckReportInventoryController extends BaseController {
*
*/
@RequiresPermissions("quality:inventoryReport:export")
@Log(title = "来料检验", businessType = BusinessType.EXPORT)
@Log(title = "库存检验报告明细", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, QcCheckReportIncome qcCheckReportIncome) {
//默认时间范围T 00:00:00~T+1 00:00:00
if (StringUtils.isEmpty(qcCheckReportIncome.getIncomeTimeStart())) {
qcCheckReportIncome.setIncomeTimeStart(DateUtils.getDate() + " 00:00:00");//start
if (StringUtils.isEmpty(qcCheckReportIncome.getCheckTimeStart())) {
qcCheckReportIncome.setCheckTimeStart(DateUtils.getDate() + " 00:00:00");//start
LocalDate date = LocalDate.now();
LocalDate dateEnd = date.plusDays(1);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String dateEndStr = dtf.format(dateEnd) + " 00:00:00";
qcCheckReportIncome.setIncomeTimeEnd(dateEndStr);//end
String dateEndStr = dtf.format(dateEnd) + " 23:59:59";
qcCheckReportIncome.setCheckTimeEnd(dateEndStr);//end
}
// if(StringUtils.isEmpty(qcCheckReportIncome.getCheckTimeStart())){
@ -88,7 +88,7 @@ public class QcCheckReportInventoryController extends BaseController {
List<QcCheckReportIncome> list = qcCheckReportInventoryService.selectQcCheckReportIncomeList(qcCheckReportIncome);
ExcelUtil<QcCheckReportIncome> util = new ExcelUtil<QcCheckReportIncome>(QcCheckReportIncome.class);
util.exportExcel(response, list, "来料检验数据");
util.exportExcel(response, list, "库存检验报告明细");
}
/**

@ -59,7 +59,7 @@ public class QcCheckReportProduceController extends BaseController {
*
*/
@RequiresPermissions("quality:produceReport:export")
@Log(title = "来料检验", businessType = BusinessType.EXPORT)
@Log(title = "生产过程检验报告明细导出", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, QcCheckReportIncome qcCheckReportIncome) {
@ -80,7 +80,7 @@ public class QcCheckReportProduceController extends BaseController {
List<QcCheckReportIncome> list = qcCheckReportProduceService.selectQcCheckReportIncomeList(qcCheckReportIncome);
ExcelUtil<QcCheckReportIncome> util = new ExcelUtil<QcCheckReportIncome>(QcCheckReportIncome.class);
util.exportExcel(response, list, "来料检验数据");
util.exportExcel(response, list, "生产过程检验报告明细");
}
/**

@ -714,6 +714,9 @@ public class QcStaticTableController extends BaseController {
//表格结构数据
ArrayList<ExcelCol> excelCols = new ArrayList<>();
excelCols.add(new ExcelCol("CPK品类", "cpkTypeName", 30));
excelCols.add(new ExcelCol("线体名称", "lineName", 30));
excelCols.add(new ExcelCol("检验节点", "checkTypeName", 30));
excelCols.add(new ExcelCol("检测项", "ruleName", 30));
for (int n = 0; n < title2Cols.size(); n++) {
excelCols.add(new ExcelCol(title2Cols.get(n), "date" + (n+1), 20));
}

@ -70,13 +70,13 @@ public class QcCheckReportIncome extends BaseEntity {
/**
*
*/
@Excel(name = "供应商编码")
@Excel(name = "供应商/车间编码")
private String supplierCode;
/**
*
*/
@Excel(name = "供应商名称")
@Excel(name = "供应商/车间名称")
private String supplierName;
/**

@ -118,6 +118,33 @@ public class QcStaticTable extends BaseEntity {
private List<String> columns2;
private String incomeTimeStart;
private String incomeTimeEnd;
private String lineCode;
private String lineName;
private String checkTypeName;
public String getCheckTypeName() {
return checkTypeName;
}
public void setCheckTypeName(String checkTypeName) {
this.checkTypeName = checkTypeName;
}
public String getLineCode() {
return lineCode;
}
public void setLineCode(String lineCode) {
this.lineCode = lineCode;
}
public String getLineName() {
return lineName;
}
public void setLineName(String lineName) {
this.lineName = lineName;
}
public String getEquipmentName() {
return equipmentName;

@ -1281,11 +1281,15 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
colNameArray = this.getMonthByMonth(qcCPKInfo.getYmArrayStart(),qcCPKInfo.getYmArrayEnd());
mxMapData = qcStaticTableMapper.getDLData(qcCPKInfo);
}
// List<ProLineDTO> lines = qcStaticTableMapper.getProdLineList()
List<HashMap> mapData = new ArrayList<HashMap>();
List<ChartDTO> echartData = new ArrayList<>();
HashMap dmap = null;
ChartDTO edata = null;
for(QcCPKInfo cpkT:cpkTypeList){
dmap = new HashMap();
edata = new ChartDTO();
@ -1296,54 +1300,67 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
double USL = cpkT.getUpperDiff().doubleValue();
double LSL = cpkT.getDownDiff().doubleValue();
dmap.put("cpkTypeName",cpkT.getCpkTypeName());
int monthNum = 0;//有数据的月份
BigDecimal monthSum = BigDecimal.ZERO;
for(int m=0;m<colNameArray.size();m++){
String key = cpkT.getCpkType() + "-" + colNameArray.get(m);
QcStaticTable act = mxMapData.get(key);
if(act!=null){
String actArrayStr = act.getQuality().replace("[", "")
.replace("]", "")
.replace("\"", "");
List<String> actArray0 = Arrays.asList(actArrayStr.split(","));
List<String> actArray = new ArrayList<>();
for(String avg:actArray0){
if(avg.matches(".*\\..*\\..*")){
actArray.add(avg.substring(2));
}else{
actArray.add(avg);
//for(ProLineDTO proLineDTO:lines){
int monthNum = 0;//有数据的月份
BigDecimal monthSum = BigDecimal.ZERO;
for(int m=0;m<colNameArray.size();m++){
String key = cpkT.getCpkType() + "-" + colNameArray.get(m);
QcStaticTable act = mxMapData.get(key);
if(act!=null){
String actArrayStr = act.getQuality().replace("[", "")
.replace("]", "")
.replace("\"", "");
List<String> actArray0 = Arrays.asList(actArrayStr.split(","));
List<String> actArray = new ArrayList<>();
for(String avg:actArray0){
if(avg.matches(".*\\..*\\..*")){
actArray.add(avg.substring(2));
}else{
actArray.add(avg);
}
}
}
double[] data = actArray.stream()
.mapToDouble(Double::parseDouble) // 将String转换为double
.toArray(); // 转换为double数组 ;
double[] data = actArray.stream()
.mapToDouble(Double::parseDouble) // 将String转换为double
.toArray(); // 转换为double数组 ;
double cpk = calculateCpk(data,USL,LSL);
BigDecimal cpkVal = new BigDecimal(Double.toString(cpk)).setScale(2, BigDecimal.ROUND_HALF_UP);
String index = (m+1)+"";
dmap.put("date"+index,cpkVal);
monthSum = monthSum.add(cpkVal);
++monthNum;
double cpk = calculateCpk(data,USL,LSL);
BigDecimal cpkVal = new BigDecimal(Double.toString(cpk)).setScale(2, BigDecimal.ROUND_HALF_UP);
String index = (m+1)+"";
dmap.put("date"+index,cpkVal);
monthSum = monthSum.add(cpkVal);
++monthNum;
serisedata.add(cpkVal.doubleValue());
dmap.put("lineName",act.getLineName());
dmap.put("checkTypeName",act.getCheckTypeName());
dmap.put("ruleName",act.getRuleName());
}else{
String index = (m+1)+"";
dmap.put("date"+index,"0");
dmap.put("cpkAvg","0");
dmap.put("lineName","");
dmap.put("checkTypeName","");
dmap.put("ruleName","");
serisedata.add(0.0);
}
serisedata.add(cpkVal.doubleValue());
}else{
String index = (m+1)+"";
dmap.put("date"+index,"0");
dmap.put("cpkAvg","0");
serisedata.add(0.0);
}
}
edata.setData(serisedata);
edata.setData(serisedata);
if(monthNum>0){
BigDecimal avgBD = monthSum.divide(new BigDecimal(monthNum),2,RoundingMode.HALF_UP);
dmap.put("cpkAvg",avgBD.toString());
}
if(monthNum>0){
BigDecimal avgBD = monthSum.divide(new BigDecimal(monthNum),2,RoundingMode.HALF_UP);
dmap.put("cpkAvg",avgBD.toString());
}
mapData.add(dmap);
echartData.add(edata);
mapData.add(dmap);
echartData.add(edata);
//}
}
resultDto.setTableData(mapData);
resultDto.setEchartData(echartData);

@ -78,7 +78,7 @@
<if test="checkStatus != null and checkStatus != ''">and qct.check_status = #{checkStatus}</if>
<if test="checkManCode != null and checkManCode != ''">and qct.check_man_code = #{checkManCode}</if>
<if test="checkManName != null and checkManName != ''">and qct.check_man_name like concat('%',#{checkManName}, '%')</if>
and qct.del_flag = '0' and pow.del_flag = '0'
and qct.del_flag = '0'
<if test="checkResult != null and checkResult != ''">and qct.check_result = #{checkResult}</if>
<if test="status != null and status != ''">and qct.status = #{status}</if>
<if test="delFlag != null and delFlag != ''">and qct.del_flag = #{delFlag}</if>
@ -88,6 +88,7 @@
<if test="checkTimeEnd != null ">and #{checkTimeEnd} > CONVERT(varchar(30),qct.check_time, 120)</if>
<if test="typeCode != null ">and q.type_code = #{typeCode}</if>
<if test="checkType != null ">and qct.check_type = #{checkType}</if>
<if test='typeCode != "material" '>and pow.del_flag = '0'</if>
</where>
</select>

@ -357,7 +357,7 @@
qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_loc, qct.check_status,
qct.check_time, qct.check_result, qct.check_type,'首件检验' check_name,
CONVERT(varchar(10),qct.create_time, 120) createTimeStr,
qct.confirm,qct.confirm_man_name
qct.confirm,qct.confirm_man_name,qct.check_man_code ,qct.check_man_name
from qc_check_task qct
<where>
<if test="checkNo != null and checkNo != ''">and qct.check_no = #{checkNo}</if>
@ -390,7 +390,7 @@
qct.order_no, qct.material_code, qct.material_name, qct.quality, qct.unit,
qct.supplier_code, qct.supplier_name,CONVERT(varchar(10), qct.income_time, 120) income_time,'','',
null,'', qct.check_type,'巡检检验' check_name,CONVERT(varchar(10),qct.create_time, 120) createTimeStr,
qct.confirm,qct.confirm_man_name
qct.confirm,qct.confirm_man_name,'',''
from qc_check_task qct
<where>
<if test="checkNo != null and checkNo != ''">and qct.check_no = #{checkNo}</if>

@ -467,7 +467,7 @@
<select id="getDLData" resultType="com.op.quality.domain.QcStaticTable">
SELECT
concat(q.cpkType,'-',q.ymdms) yearMonth,
ymdms,rule_name ruleName,
ymdms,rule_name ruleName,q.lineName,q.checkTypeName,
project_no projectNo,
STUFF(
(SELECT ',' + t.actual_value
@ -492,17 +492,20 @@
select
bpa.cpk_type cpkType,
CONVERT(varchar(7),qct.income_time, 120) ymdms,
qctd.rule_name,qctd.project_no,qctd.actual_value
qctd.rule_name,qctd.project_no,qctd.actual_value,
be.equipment_name lineName,qt.check_name checkTypeName
from qc_check_task qct
left join qc_check_task_detail qctd on qct.record_id = qctd.belong_to
left join base_product_attached bpa on concat('0000000',bpa.product_code) = qct.material_code
left join base_equipment be on be.equipment_type_code = 'equ_type_bzx' and be.del_flag = '0'
left join qc_check_type qt on qt.order_code = qct.check_type
where qct.check_type = #{checkType} and qctd.property_code = '1' and qct.check_time is not null
<if test="ymArrayStart != null ">and CONVERT(varchar(7),qct.income_time, 120) >= #{ymArrayStart}</if>
<if test="ymArrayEnd != null ">and #{ymArrayEnd}>=CONVERT(varchar(7),qct.income_time,120) </if>
<if test="checkLoc != null ">and qct.check_loc = #{checkLoc}</if>
and qctd.project_id = #{projectId} and bpa.cpk_type = #{cpkType}
) q
GROUP BY q.cpkType, q.ymdms,q.rule_name,q.project_no
GROUP BY q.cpkType, q.ymdms,q.rule_name,q.project_no,q.lineName,q.checkTypeName
</select>
@ -947,7 +950,7 @@
<select id="getDLDataDay" resultType="com.op.quality.domain.QcStaticTable">
SELECT
concat(q.cpkType,'-',q.ymdms) yearMonth,
ymdms,rule_name ruleName,
ymdms,rule_name ruleName,q.lineName,q.checkTypeName,
project_no projectNo,
STUFF(
(SELECT ',' + t.actual_value
@ -972,17 +975,20 @@
select
bpa.cpk_type cpkType,
CONVERT(varchar(10),qct.income_time, 120) ymdms,
qctd.rule_name,qctd.project_no,qctd.actual_value
qctd.rule_name,qctd.project_no,qctd.actual_value,
be.equipment_name lineName,qt.check_name checkTypeName
from qc_check_task qct
left join qc_check_task_detail qctd on qct.record_id = qctd.belong_to
left join base_product_attached bpa on concat('0000000',bpa.product_code) = qct.material_code
left join base_equipment be on be.equipment_type_code = 'equ_type_bzx' and be.del_flag = '0'
left join qc_check_type qt on qt.order_code = qct.check_type
where qct.check_type = #{checkType} and qctd.property_code = '1' and qct.check_time is not null
<if test="ymArrayStart != null ">and CONVERT(varchar(10),qct.income_time, 120) >= #{ymArrayStart}</if>
<if test="ymArrayEnd != null ">and #{ymArrayEnd}>=CONVERT(varchar(10),qct.income_time,120) </if>
<if test="checkLoc != null ">and qct.check_loc = #{checkLoc}</if>
and qctd.project_id = #{projectId} and bpa.cpk_type = #{cpkType}
) q
GROUP BY q.cpkType, q.ymdms,q.rule_name,q.project_no
GROUP BY q.cpkType, q.ymdms,q.rule_name,q.project_no,q.lineName,q.checkTypeName
</select>
<select id="getXJCheckTableDetailList" resultType="com.op.quality.domain.CheckTypeXJDetail">
select

Loading…
Cancel
Save