问题修复5

master
zhaoxiaolin 5 months ago
parent 04aff0d8f9
commit 6504f975a4

@ -436,6 +436,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
}else if(workOrders.size()>=3){
BigDecimal gamng = null;
BigDecimal bottomQua = BigDecimal.ZERO;
for(int n=0;n<workOrders.size();n++){
MesReportWork workOrder = workOrders.get(n);
mesReportWork.setUploadStatus("1");//除了1报工成功的都需要报工
@ -444,6 +445,10 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
mesReportWork.setMachineCode(mesReportWork.getMachineCode());
MesReportWork sHzWorks = mesReportWorkMapper.getReportWorkHz(mesReportWork);
if(n == 0){
bottomQua = sHzWorks.getQuantityFeedback();
}
if(sHzWorks==null){//再去查预报工的一条数带出基本数据其它全部赋值0
sHzWorks = mesReportWorkMapper.getReportWorkHzAttr1(mesReportWork);
}
@ -459,6 +464,16 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
}
//三层以上工单报工
logger.info("==========================三层(第"+n+"层)以上工单("+sHzWorks.getWorkorderCodeSap()+")报工开始");
if(n > 1){
//查询base_product的report_rate//箱子-大盒-小盒
BigDecimal reportRate = mesReportWorkMapper.getReportRate(workOrders.get(n).getProductCode());
if(reportRate != null){
BigDecimal newQuantity = bottomQua.divide(reportRate,2, RoundingMode.HALF_UP);
sHzWorks.setQuantityFeedback(newQuantity);
}else{
sHzWorks.setQuantityFeedback(sHzWorks.getQuantityFeedback());
}
}
sHzWorks.setMachineCode(mesReportWork.getMachineCode());
sapRson = this.reportHzToSap3(sHzWorks);
logger.info("==========================三层(第"+n+"层)以上工单("+sHzWorks.getWorkorderCodeSap()+")报工结束:"
@ -668,6 +683,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
SapRFW sapRFW = new SapRFW();
sapRFW.setAufnr(workOrder.getWorkorderCodeSap());//虚拟工单号
sapRFW.setGamng(workOrder.getQuantityFeedback().toString());//报工数量
SapRFW.lt_gs ltgs = new SapRFW.lt_gs();//生产订单报工工时修改
ltgs.setConf_activity1(workOrder.getSac1());//机器
ltgs.setConf_activity2(workOrder.getSac2());//人工

@ -7,6 +7,7 @@ import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
@ -597,6 +598,89 @@ public class QcStaticTableController extends BaseController {
public List<HashMap> getTableHzDataSC(@RequestBody QcStaticTable qcStaticTable) {
return qcStaticTableService.getTableHzDataSC(qcStaticTable);
}
@Log(title = "首检分析报表统计", businessType = BusinessType.EXPORT)
@PostMapping("/exportSCTable")
public void exportSCTable(HttpServletResponse response, QcStaticTable qcStaticTable) {
QcStaticTable titledto = qcStaticTableService.getTableHzTitle(qcStaticTable);
List<HashMap> list0 = qcStaticTableService.getTableHzDataSC(qcStaticTable);
List<HashMap> list = list0.stream()
.filter(hmap -> !hmap.get("sampleQuality").equals("0"))
.collect(Collectors.toList());
List<String> title2Cols = titledto.getColumns1();
//String titleRow1 = String.join(",", title2Cols);
String titleRow1 = "首检分析报表";
//表格结构数据
ArrayList<ExcelCol> excelCols = new ArrayList<>();
excelCols.add(new ExcelCol("时间", "timeCol", 15));
excelCols.add(new ExcelCol("抽检数", "sampleQuality", 10));
for (int n = 0; n < title2Cols.size(); n++) {
excelCols.add(new ExcelCol(title2Cols.get(n), "col" + (n), 15));
}
excelCols.add(new ExcelCol("不良数", "noOkQua", 10));
excelCols.add(new ExcelCol("不良率(%)", "noOkRate", 10));
String titleName = "首检统计分析报表";
SXSSFWorkbook workbook = null;
try {
//设置响应头
response.setHeader("Content-disposition",
"attachment; filename=" + titleName);
response.setContentType("application/octet-stream;charset=UTF-8");
ServletOutputStream outputStream = response.getOutputStream();
//调用工具类
workbook = ExcelMapUtil.initWorkbook(titleName, titleRow1, excelCols, list);
workbook.write(outputStream);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (workbook != null) {
workbook.dispose();
}
}
}
@Log(title = "来料分析报表统计", businessType = BusinessType.EXPORT)
@PostMapping("/exportIncomeTable")
public void exportIncomeTable(HttpServletResponse response, QcStaticTable qcStaticTable) {
QcStaticTable titledto = qcStaticTableService.getTableHzTitle(qcStaticTable);
List<HashMap> list = qcStaticTableService.getTableHzDataSC(qcStaticTable);
List<String> title2Cols = titledto.getColumns1();
//String titleRow1 = String.join(",", title2Cols);
String titleRow1 = "巡检分析报表";
//表格结构数据
ArrayList<ExcelCol> excelCols = new ArrayList<>();
excelCols.add(new ExcelCol("时间", "timeCol", 15));
excelCols.add(new ExcelCol("抽检批次", "sampleQuality", 10));
for (int n = 0; n < title2Cols.size(); n++) {
excelCols.add(new ExcelCol(title2Cols.get(n), "col" + (n), 15));
}
excelCols.add(new ExcelCol("不良数", "noOkQua", 10));
excelCols.add(new ExcelCol("不良率(%)", "noOkRate", 10));
String titleName = "来料统计分析报表";
SXSSFWorkbook workbook = null;
try {
//设置响应头
response.setHeader("Content-disposition",
"attachment; filename=" + titleName);
response.setContentType("application/octet-stream;charset=UTF-8");
ServletOutputStream outputStream = response.getOutputStream();
//调用工具类
workbook = ExcelMapUtil.initWorkbook(titleName, titleRow1, excelCols, list);
workbook.write(outputStream);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (workbook != null) {
workbook.dispose();
}
}
}
@PostMapping("/getTableHzNoOkDataSC")
public List<QcStaticTable> getTableHzNoOkDataSC(@RequestBody QcStaticTable qcStaticTable) {
return qcStaticTableService.getTableHzNoOkDataSC(qcStaticTable);
@ -619,6 +703,46 @@ public class QcStaticTableController extends BaseController {
util.exportExcel(response, list, "巡检检验结果明细");
}
@Log(title = "巡检检验结果统计", businessType = BusinessType.EXPORT)
@PostMapping("/exportXJTable")
public void exportXJTable(HttpServletResponse response, QcStaticTable qcStaticTable) {
QcStaticTable titledto = qcStaticTableService.getTableHzTitle(qcStaticTable);
List<HashMap> list = qcStaticTableService.getTableHzData(qcStaticTable);
List<String> title2Cols = titledto.getColumns1();
//String titleRow1 = String.join(",", title2Cols);
String titleRow1 = "巡检分析报表";
//表格结构数据
ArrayList<ExcelCol> excelCols = new ArrayList<>();
excelCols.add(new ExcelCol("时间", "timeCol", 15));
excelCols.add(new ExcelCol("抽样数", "sampleQuality", 10));
for (int n = 0; n < title2Cols.size(); n++) {
excelCols.add(new ExcelCol(title2Cols.get(n), "col" + (n), 15));
}
excelCols.add(new ExcelCol("不良数", "noOkQua", 10));
excelCols.add(new ExcelCol("不良率(%)", "noOkRate", 10));
String titleName = "巡检分析报表";
SXSSFWorkbook workbook = null;
try {
//设置响应头
response.setHeader("Content-disposition",
"attachment; filename=" + titleName);
response.setContentType("application/octet-stream;charset=UTF-8");
ServletOutputStream outputStream = response.getOutputStream();
//调用工具类
workbook = ExcelMapUtil.initWorkbook(titleName, titleRow1, excelCols, list);
workbook.write(outputStream);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (workbook != null) {
workbook.dispose();
}
}
}
/**
* ----
**/

@ -17,6 +17,8 @@ import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
@ -208,7 +210,27 @@ public class QcCheckReportInventoryServiceImpl implements IQcCheckReportInventor
qcCheckReportIncome.setDelFlag("0");
qcCheckReportIncome.setTypeCode("inventory");
List<QcCheckReportIncome> dtos = qcCheckReportIncomeMapper.getPrintXJList(qcCheckReportIncome);
if(!CollectionUtils.isEmpty(dtos)){
//查找受控文件--fileNo
qcCheckReportIncome.setCheckType("checkTypeCC");
try {
String dateFormatPattern = "yyyy-MM-dd HH:mm:ss";
SimpleDateFormat dateFormat = new SimpleDateFormat(dateFormatPattern);
Date date = dateFormat.parse(qcCheckReportIncome.getCheckTimeStart());
qcCheckReportIncome.setIncomeTime(date);
} catch (ParseException e) {
System.err.println("日期格式不正确: " + e.getMessage());
}
String fileNo = qcCheckReportIncomeMapper.getStandardNo(qcCheckReportIncome);
if(com.op.common.core.utils.StringUtils.isNotBlank(fileNo)){
dtos.get(0).setFileNo(fileNo);
}
}
int n = 1;
String checkManName = "";
for(QcCheckReportIncome dto:dtos){
dto.setXh(n++);
List<String> batchnos = qcStaticTableMapper.getBatchnos(dto.getOrderNo());
@ -217,6 +239,16 @@ public class QcCheckReportInventoryServiceImpl implements IQcCheckReportInventor
ordernoStr += batchno + ";";
};
dto.setIncomeBatchNo(ordernoStr);
if(dto.getCheckResult().equals("Y")){
dto.setCheckResult("无质量问题");
}else{
dto.setRemark(dto.getRemark()+";"+dto.getAttr3());
}
checkManName+=dto.getCheckManName()+";";
dto.setCheckManName(checkManName);
}
return dtos;
}

@ -1056,8 +1056,10 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
colMap.put("sampleQuality",sampl.getSampleQuality().replaceAll("\\..*", ""));
BigDecimal noOkRate = new BigDecimal(noOkNumR.getNoOkQuality()).multiply(new BigDecimal("100.00"))
.divide(new BigDecimal(sampl.getSampleQuality()),2, BigDecimal.ROUND_HALF_UP);
colMap.put("noOkQua",noOkNumR.getNoOkQuality());
colMap.put("noOkRate",noOkRate);
}else{
colMap.put("noOkQua","0");
colMap.put("sampleQuality","0");
colMap.put("noOkRate","0");
}

@ -45,7 +45,7 @@
<result property="cxzz" column="cxzz"/>
<result property="workorderCodeSap" column="workorder_code_sap"/>
<result property="modelType" column="modelType"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectQcCheckReportIncomeVo">
@ -284,10 +284,10 @@
<select id="getPrintXJList" parameterType="QcCheckReportIncome"
resultMap="QcCheckReportIncomeResult">
select qct.order_no,qct.material_code, qct.material_name, qct.check_no, qct.income_batch_no,
qct.check_result, CONVERT(varchar(10),qct.income_time, 120),bp.umrez modelType,
qct.check_result, CONVERT(varchar(10),qct.income_time, 120),concat(bp.umrez,'装') modelType,
qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_loc, qct.check_status,
qct.check_man_code, qct.check_man_name,qct.check_time, qct.check_result, qct.status,qct.sample_quality,
qct.create_by,qct.create_time, qct.update_by, qct.update_time,qct.check_type
qct.remark,qct.attr3,qct.check_type
from qc_check_task qct
left join base_product bp on qct.material_code = bp.product_code and bp.del_flag = '0'
<where>

@ -550,7 +550,7 @@ public class SysUserServiceImpl implements ISysUserService {
//Date maxTime = DateUtils.getNowDate();
String ymd = DateFormatUtils.format(maxTime, "yyyy-MM-dd");//yyyy-MM-dd
log.info("更新人力-参数:"+ ymd);
//AjaxResult hrR = remoteOpenService.GetHrUserInfo(ymd);
//AjaxResult hrR = remoteOpenService.GetHrUserInfo("2024-05-01");
AjaxResult hrR = remoteOpenService.GetHrUserInfo(ymd);
List<HRInfo> infoList = new ArrayList<>();

Loading…
Cancel
Save