Merge remote-tracking branch 'origin/master'

master
wws 1 year ago
commit f9cb4a5c1d

@ -12,6 +12,24 @@ public class ChartSeriesDTO {
private List<String> yAxisData;
private List<ChartDTO> series;
private List<String> legendData;
private List<String> xAxisData;
public List<String> getxAxisData() {
return xAxisData;
}
public void setxAxisData(List<String> xAxisData) {
this.xAxisData = xAxisData;
}
public List<String> getLegendData() {
return legendData;
}
public void setLegendData(List<String> legendData) {
this.legendData = legendData;
}
public List<String> getyAxisData() {
return yAxisData;

@ -0,0 +1,185 @@
package com.op.quality.controller;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.web.page.TableDataInfo;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.QcBomComponent;
import com.op.quality.domain.QcCheckReportIncome;
import com.op.quality.domain.QcCheckTaskDetail;
import com.op.quality.domain.QcSupplier;
import com.op.quality.service.IQcCheckReportFirstService;
import com.op.system.api.domain.SysUser;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
/**
* Controller
*
* @author Open Platform
* @date 2023-10-19
*/
@RestController
@RequestMapping("/qcFirstReport")
public class QcCheckReportFirstController extends BaseController {
@Autowired
private IQcCheckReportFirstService qcCheckReportFirstService;
/**
*
*/
@RequiresPermissions("quality:firstReport:list")
@GetMapping("/list")
public TableDataInfo list(QcCheckReportIncome qcCheckReportIncome) {
//默认时间范围T 00:00:00~T+1 00:00:00
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)+" 23:59:59";
qcCheckReportIncome.setCheckTimeEnd(dateEndStr);//end
}
// if(StringUtils.isEmpty(qcCheckReportIncome.getCheckTimeStart())){
// qcCheckReportIncome.setCheckTimeStart(qcCheckReportIncome.getIncomeTimeStart());//start
// qcCheckReportIncome.setCheckTimeEnd(qcCheckReportIncome.getIncomeTimeStart());//end
// }
startPage();
List<QcCheckReportIncome> list = qcCheckReportFirstService.selectQcCheckReportIncomeList(qcCheckReportIncome);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("quality:firstReport: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
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
}
// if(StringUtils.isEmpty(qcCheckReportIncome.getCheckTimeStart())){
// qcCheckReportIncome.setCheckTimeStart(qcCheckReportIncome.getIncomeTimeStart());//start
// qcCheckReportIncome.setCheckTimeEnd(qcCheckReportIncome.getIncomeTimeStart());//end
// }
List<QcCheckReportIncome> list = qcCheckReportFirstService.selectQcCheckReportIncomeList(qcCheckReportIncome);
ExcelUtil<QcCheckReportIncome> util = new ExcelUtil<QcCheckReportIncome>(QcCheckReportIncome.class);
util.exportExcel(response, list, "来料检验数据");
}
/**
*
*/
@RequiresPermissions("quality:firstReport:query")
@GetMapping(value = "/{recordId}")
public AjaxResult getInfo(@PathVariable("recordId") String recordId) {
return success(qcCheckReportFirstService.selectQcCheckReportIncomeByRecordId(recordId));
}
/**
*
*/
@RequiresPermissions("quality:firstReport:add")
@Log(title = "来料检验", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody QcCheckReportIncome qcCheckReportIncome) {
int r = qcCheckReportFirstService.insertQcCheckReportIncome(qcCheckReportIncome);
if(r>0){
return toAjax(r);
}
return error("添加失败:请检查物料的关联检测项");
}
/**
*
*/
@RequiresPermissions("quality:firstReport:edit")
@Log(title = "来料检验", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody QcCheckReportIncome qcCheckReportIncome) {
return toAjax(qcCheckReportFirstService.updateQcCheckReportIncome(qcCheckReportIncome));
}
/**
*
*/
@RequiresPermissions("quality:firstReport:remove")
@Log(title = "来料检验", businessType = BusinessType.DELETE)
@DeleteMapping("/{recordIds}")
public AjaxResult remove(@PathVariable String[] recordIds) {
return toAjax(qcCheckReportFirstService.deleteQcCheckReportIncomeByRecordIds(recordIds));
}
/**
* BOM
*/
@GetMapping("/getQcListBom")
public TableDataInfo getQcListBom(QcBomComponent bomComponent) {
startPage();
List<QcBomComponent> list = qcCheckReportFirstService.getQcListBom(bomComponent);
return getDataTable(list);
}
/**
*
*/
@GetMapping("/getQcListSupplier")
public TableDataInfo getQcListSupplier(QcSupplier qcSupplier) {
startPage();
List<QcSupplier> list = qcCheckReportFirstService.getQcListSupplier(qcSupplier);
return getDataTable(list);
}
/**
*
*/
@GetMapping("/getQcListUser")
public TableDataInfo getQcListUser(SysUser sysUser) {
startPage();
List<SysUser> list = qcCheckReportFirstService.getQcListUser(sysUser);
return getDataTable(list);
}
/**
*
*/
@PutMapping("/changeIncomeStatus")
public AjaxResult changeIncomeStatus(@RequestBody QcCheckReportIncome qcCheckReportIncome) {
qcCheckReportIncome.setUpdateBy(SecurityUtils.getUsername());
qcCheckReportIncome.setUpdateTime(DateUtils.getNowDate());
return toAjax(qcCheckReportFirstService.updateIncomeStatus(qcCheckReportIncome));
}
/**
*
* @param
* @return
*/
@GetMapping("/getCkeckProjectList")
public TableDataInfo getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) {
List<QcCheckTaskDetail> list = qcCheckReportFirstService.getCkeckProjectList(qcCheckTaskDetail);
return getDataTable(list);
}
}

@ -176,7 +176,6 @@ public class QcCheckReportIncomeController extends BaseController {
*/
@GetMapping("/getCkeckProjectList")
public TableDataInfo getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) {
startPage();
List<QcCheckTaskDetail> list = qcCheckReportIncomeService.getCkeckProjectList(qcCheckTaskDetail);
return getDataTable(list);
}

@ -174,7 +174,6 @@ public class QcCheckReportProduceController extends BaseController {
*/
@GetMapping("/getCkeckProjectList")
public TableDataInfo getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) {
startPage();
List<QcCheckTaskDetail> list = qcCheckReportProduceService.getCkeckProjectList(qcCheckTaskDetail);
return getDataTable(list);
}

@ -179,7 +179,6 @@ public class QcCheckReportProductController extends BaseController {
*/
@GetMapping("/getCkeckProjectList")
public TableDataInfo getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) {
startPage();
List<QcCheckTaskDetail> list = qcCheckReportProductService.getCkeckProjectList(qcCheckTaskDetail);
return getDataTable(list);
}

@ -12,6 +12,7 @@ import javax.servlet.http.HttpServletResponse;
import com.op.common.core.utils.DateUtils;
import com.op.system.api.domain.quality.ChartDTO;
import com.op.system.api.domain.quality.ChartSeriesDTO;
import com.op.system.api.domain.quality.FactoryDto;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -251,4 +252,18 @@ public class QcStaticTableController extends BaseController {
List<QcStaticTable> list = qcStaticTableService.getXJCheckTableDetail(qcStaticTable);
return list;
}
/**巡检小时不良**/
@RequiresPermissions("quality:qcTableXJAnalysis:list")
@GetMapping("/getXJChartData")
public ChartSeriesDTO getXJChartData(QcStaticTable qcStaticTable) {
if(StringUtils.isEmpty(qcStaticTable.getYmdms())){
LocalDate date = LocalDate.now();
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String ymStr = dtf.format(date);
qcStaticTable.setYmdms(ymStr);//end
}
ChartSeriesDTO dto = qcStaticTableService.getXJChartData(qcStaticTable);
return dto;
}
}

@ -124,6 +124,15 @@ public class QcCheckReportIncome extends BaseEntity {
private String checkTimeEnd;
private String typeCode;//大类
private String checkType;//小类
private String checkName;
public String getCheckName() {
return checkName;
}
public void setCheckName(String checkName) {
this.checkName = checkName;
}
public BigDecimal getSampleQuality() {
return sampleQuality;

@ -144,6 +144,15 @@ public class QcCheckTaskProduce extends BaseEntity {
@Excel(name = "C类不合格数量")
private BigDecimal cNoOkquality;
private String checkName;
public String getCheckName() {
return checkName;
}
public void setCheckName(String checkName) {
this.checkName = checkName;
}
public String getOrderType() {
return orderType;

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import com.op.system.api.domain.quality.ChartDTO;
import com.op.system.api.domain.quality.ChartSeriesDTO;
import java.math.BigDecimal;
import java.util.Date;
@ -83,6 +84,24 @@ public class QcStaticTable extends BaseEntity {
private String column180190;
private String column190200;
private String column200210;
private String startDateStr;
private String endDateStr;
public String getStartDateStr() {
return startDateStr;
}
public void setStartDateStr(String startDateStr) {
this.startDateStr = startDateStr;
}
public String getEndDateStr() {
return endDateStr;
}
public void setEndDateStr(String endDateStr) {
this.endDateStr = endDateStr;
}
public String getColumn080090() {
return column080090;
@ -531,4 +550,5 @@ public class QcStaticTable extends BaseEntity {
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
}

@ -45,4 +45,10 @@ public interface QcStaticTableMapper {
List<QcStaticTable> getXJProjects(QcStaticTable qcStaticTable);
@MapKey("ymdms")
Map<String,QcStaticTable> getProjectDetail(QcStaticTable qcStaticTable);
List<String> getBatchnos(String orderNo);
List<QcStaticTable> getLegendData(QcStaticTable qcStaticTable);
@MapKey("ymdms")
Map<String, QcStaticTable> getXJMapData(QcStaticTable qcStaticTable);
}

@ -0,0 +1,78 @@
package com.op.quality.service;
import com.op.quality.domain.QcBomComponent;
import com.op.quality.domain.QcCheckReportIncome;
import com.op.quality.domain.QcCheckTaskDetail;
import com.op.quality.domain.QcSupplier;
import com.op.system.api.domain.SysUser;
import java.util.List;
/**
* Service
*
* @author Open Platform
* @date 2023-10-19
*/
public interface IQcCheckReportFirstService {
/**
*
*
* @param recordId
* @return
*/
public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId);
/**
*
*
* @param qcCheckReportIncome
* @return
*/
public List<QcCheckReportIncome> selectQcCheckReportIncomeList(QcCheckReportIncome qcCheckReportIncome);
/**
*
*
* @param qcCheckReportIncome
* @return
*/
public int insertQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome);
/**
*
*
* @param qcCheckReportIncome
* @return
*/
public int updateQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome);
/**
*
*
* @param recordIds
* @return
*/
public int deleteQcCheckReportIncomeByRecordIds(String[] recordIds);
/**
*
*
* @param recordId
* @return
*/
public int deleteQcCheckReportIncomeByRecordId(String recordId);
public List<QcBomComponent> getQcListBom(QcBomComponent bomComponent);
public List<QcSupplier> getQcListSupplier(QcSupplier qcSupplier);
public List<SysUser> getQcListUser(SysUser sysUser);
int updateIncomeStatus(QcCheckReportIncome qcCheckReportIncome);
List<QcCheckTaskDetail> getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail);
public List<QcCheckReportIncome> getPrintData(QcCheckReportIncome qcCheckReportIncome);
}

@ -4,6 +4,7 @@ import java.util.List;
import java.util.Map;
import com.op.quality.domain.QcStaticTable;
import com.op.system.api.domain.quality.ChartSeriesDTO;
import com.op.system.api.domain.quality.FactoryDto;
/**
@ -33,4 +34,6 @@ public interface IQcStaticTableService {
List<QcStaticTable> getXJCheckTableList(QcStaticTable qcStaticTable);
List<QcStaticTable> getXJCheckTableDetail(QcStaticTable qcStaticTable);
ChartSeriesDTO getXJChartData(QcStaticTable qcStaticTable);
}

@ -0,0 +1,207 @@
package com.op.quality.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.*;
import com.op.quality.mapper.QcCheckReportIncomeMapper;
import com.op.quality.mapper.QcCheckTaskDetailMapper;
import com.op.quality.mapper.QcCheckTypeProjectMapper;
import com.op.quality.mapper.QcMaterialGroupDetailMapper;
import com.op.quality.service.IQcCheckReportFirstService;
import com.op.quality.service.IQcCheckReportIncomeService;
import com.op.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
/**
* Service
*
* @author Open Platform
* @date 2023-10-19
*/
@Service
public class QcCheckReportFirstServiceImpl implements IQcCheckReportFirstService {
@Autowired
private QcCheckReportIncomeMapper qcCheckReportIncomeMapper;
@Autowired
private QcCheckTypeProjectMapper qcCheckTypeProjectMapper;
@Autowired
private QcMaterialGroupDetailMapper qcMaterialGroupDetailMapper;
@Autowired
private QcCheckTaskDetailMapper qcCheckTaskDetailMapper;
/**
*
*
* @param recordId
* @return
*/
@Override
@DS("#header.poolName")
public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId) {
return qcCheckReportIncomeMapper.selectQcCheckReportIncomeByRecordId(recordId);
}
/**
*
*
* @param qcCheckReportIncome
* @return
*/
@Override
@DS("#header.poolName")
public List<QcCheckReportIncome> selectQcCheckReportIncomeList(QcCheckReportIncome qcCheckReportIncome) {
qcCheckReportIncome.setDelFlag("0");
qcCheckReportIncome.setTypeCode("produce");
qcCheckReportIncome.setCheckType("checkTypeSC");
return qcCheckReportIncomeMapper.selectQcCheckReportIncomeList(qcCheckReportIncome);
}
/**
*
*
* @param qcCheckReportIncome
* @return
*/
@Override
@DS("#header.poolName")
public int insertQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome) {
String bpDD = DateUtils.parseDateToStr(DateUtils.YYYYMMDD, DateUtils.getNowDate());
int liushuiNum = qcCheckReportIncomeMapper.getTodayMaxNum(qcCheckReportIncome);
String liushuiStr = String.format("%04d", liushuiNum);
String createBy = SecurityUtils.getUsername();
Date nowDate= DateUtils.getNowDate();
//获取当前所选工厂
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
String factoryCode = request.getHeader(key.substring(8)).replace("ds_","");
qcCheckReportIncome.setCheckNo(bpDD+liushuiStr);
/**qc_check_task_income**/
String beLongId = IdUtils.fastSimpleUUID();
qcCheckReportIncome.setRecordId(beLongId);
qcCheckReportIncome.setFactoryCode(factoryCode);
qcCheckReportIncome.setCreateTime(nowDate);
qcCheckReportIncomeMapper.insertQcCheckReportIncome(qcCheckReportIncome);
/**取检测项**/
QcCheckTypeProject qctp= new QcCheckTypeProject();
qctp.setTypeId(qcCheckReportIncome.getCheckType());//生产过程检验
qctp.setMaterialCode(qcCheckReportIncome.getMaterialCode());//特性
/**qc_check_type_project**/
List<QcCheckTaskDetail> items = qcCheckTypeProjectMapper.getTPByTypeMaterial(qctp);
if(CollectionUtils.isEmpty(items)){
/**qc_material_group_detail**/
QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(qcCheckReportIncome.getMaterialCode());
if(group == null){
return 0;//没有找到检测项目
}
qctp.setGroupId(group.getGroupId());//共性
items = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp);
}
/**qc_check_task_detail**/
if(CollectionUtils.isEmpty(items)){
return 0;//没有找到检测项目
}
for(QcCheckTaskDetail item:items){
item.setRecordId(IdUtils.fastSimpleUUID());
item.setBelongTo(beLongId);
item.setCreateTime(nowDate);
item.setCreateBy(createBy);
item.setFactoryCode(factoryCode);
item.setStatus("N");
}
return qcCheckTaskDetailMapper.addBatch(items);
}
/**
*
*
* @param qcCheckReportIncome
* @return
*/
@Override
@DS("#header.poolName")
public int updateQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome) {
qcCheckReportIncome.setUpdateTime(DateUtils.getNowDate());
return qcCheckReportIncomeMapper.updateQcCheckReportIncome(qcCheckReportIncome);
}
/**
*
*
* @param recordIds
* @return
*/
@Override
@DS("#header.poolName")
public int deleteQcCheckReportIncomeByRecordIds(String[] recordIds) {
return qcCheckReportIncomeMapper.deleteQcCheckReportIncomeByRecordIds(recordIds);
}
/**
*
*
* @param recordId
* @return
*/
@Override
@DS("#header.poolName")
public int deleteQcCheckReportIncomeByRecordId(String recordId) {
return qcCheckReportIncomeMapper.deleteQcCheckReportIncomeByRecordId(recordId);
}
@Override
@DS("#header.poolName")
public List<QcBomComponent> getQcListBom(QcBomComponent bomComponent) {
return qcCheckReportIncomeMapper.getQcListBom(bomComponent);
}
@Override
@DS("#header.poolName")
public List<QcSupplier> getQcListSupplier(QcSupplier qcSupplier) {
return qcCheckReportIncomeMapper.getQcListSupplier(qcSupplier);
}
@Override
@DS("master")
public List<SysUser> getQcListUser(SysUser sysUser) {
return qcCheckReportIncomeMapper.getQcListUser(sysUser);
}
@Override
@DS("#header.poolName")
public int updateIncomeStatus(QcCheckReportIncome qcCheckReportIncome) {
return qcCheckReportIncomeMapper.updateQcCheckReportIncome(qcCheckReportIncome);
}
@Override
@DS("#header.poolName")
public List<QcCheckTaskDetail> getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) {
return qcCheckReportIncomeMapper.getCkeckProjectList(qcCheckTaskDetail);
}
@Override
@DS("#header.poolName")
public List<QcCheckReportIncome> getPrintData(QcCheckReportIncome qcCheckReportIncome) {
return null;
}
}

@ -389,7 +389,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
//发起来料检验OA流程
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("user",qcCheckTaskIncome.getUpdateBy());//提交人工号
paramMap.put("user","019047");//提交人工号qcCheckTaskIncome.getUpdateBy()
paramMap.put("requestLevel",0);//流程紧急度
paramMap.put("requestName","ZL0010-来料检验不合格审批流程(定单:"+qcCheckTaskIncome.getOrderNo()+")");//流程名称
paramMap.put("workflowld","26258");//该流程对应的唯- workFlowld
@ -397,10 +397,10 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
StringBuffer mainObject = new StringBuffer();
mainObject.append("{");
mainObject.append("\"CQ\":"+1);//厂区
mainObject.append("\"LLLB\":"+0);//来料类别【0、1】
mainObject.append("\"MATNR\""+"\"000000010101003200\"");//物料编码
mainObject.append(",\"LLLB\":"+0);//来料类别【0、1】
mainObject.append(",\"MATNR\":"+"\"000000010101003200\"");//物料编码
//mainObject.append("\"MAKTX\""+MATNR);//物料名称
mainObject.append("{");
mainObject.append("}");
paramMap.put("mainObject",mainObject.toString());
logger.info("流程Id 26258:"+ JSONObject.toJSONString(paramMap));
AjaxResult oaR = remoteOpenService.OAInspection(paramMap);
@ -549,24 +549,24 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
n = qcCheckUnqualifiedMapper.insertQcCheckUnqualified(unqualified);
logger.info("qc_check_unqualified:"+n);
//发起来料检验OA流程
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("user",updateBy);//提交人工号
paramMap.put("requestLevel",0);//流程紧急度
paramMap.put("requestName","ZL0010-来料检验不合格审批流程(定单:"+qcCheckTaskIncome.getOrderNo()+")");//流程名称
paramMap.put("workflowld","26258");//该流程对应的唯- workFlowld
StringBuffer mainObject = new StringBuffer();
mainObject.append("{");
mainObject.append("\"CQ\":"+1);//厂区
mainObject.append("\"LLLB\":"+0);//来料类别【0、1】
mainObject.append("\"MATNR\""+"\"000000010101003200\"");//物料编码
//mainObject.append("\"MAKTX\""+MATNR);//物料名称
mainObject.append("{");
paramMap.put("mainObject",mainObject.toString());
AjaxResult oaR = remoteOpenService.OAInspection(paramMap);
logger.info("流程Id 26258:"+ JSONObject.toJSONString(oaR));
// //发起来料检验OA流程
// Map<String, Object> paramMap = new HashMap<>();
// paramMap.put("user",updateBy);//提交人工号
// paramMap.put("requestLevel",0);//流程紧急度
// paramMap.put("requestName","ZL0010-来料检验不合格审批流程(定单:"+qcCheckTaskIncome.getOrderNo()+")");//流程名称
// paramMap.put("workflowld","26258");//该流程对应的唯- workFlowld
//
// StringBuffer mainObject = new StringBuffer();
// mainObject.append("{");
// mainObject.append("\"CQ\":"+1);//厂区
// mainObject.append("\"LLLB\":"+0);//来料类别【0、1】
// mainObject.append("\"MATNR\""+"\"000000010101003200\"");//物料编码
// //mainObject.append("\"MAKTX\""+MATNR);//物料名称
// mainObject.append("{");
// paramMap.put("mainObject",mainObject.toString());
//
// AjaxResult oaR = remoteOpenService.OAInspection(paramMap);
// logger.info("流程Id 26258:"+ JSONObject.toJSONString(oaR));
}
return n ;

@ -1,11 +1,20 @@
package com.op.quality.service.impl;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.quality.domain.QcCheckTaskIncome;
import com.op.system.api.domain.quality.ChartDTO;
import com.op.system.api.domain.quality.ChartSeriesDTO;
import com.op.system.api.domain.quality.FactoryDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -141,6 +150,14 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
@DS("#header.poolName")
public List<QcStaticTable> getXJCheckTableList(QcStaticTable qcStaticTable) {
List<QcStaticTable> tabledtos = qcStaticTableMapper.getXJCheckTableList(qcStaticTable);
for(QcStaticTable tabledto:tabledtos){
List<String> batchnos = qcStaticTableMapper.getBatchnos(tabledto.getOrderNo());
String ordernoStr = "";
for(String batchno:batchnos){
ordernoStr += batchno+";";
};
tabledto.setIncomeBatchNo(ordernoStr);
}
return tabledtos;
}
@ -253,5 +270,83 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
project.setColumn200210("-");
}
}
/**巡检小时不良**/
@Override
@DS("#header.poolName")
public ChartSeriesDTO getXJChartData(QcStaticTable qcStaticTable) {
ChartSeriesDTO seriesDTO = new ChartSeriesDTO();
//获取当天参与生产的车间
List<QcStaticTable> legends = qcStaticTableMapper.getLegendData(qcStaticTable);
List<String> legendData = new ArrayList<>();
if(!CollectionUtils.isEmpty(legends)){
legendData=legends.stream().map(QcStaticTable::getSupplierName).collect(Collectors.toList());
}else{
return null;
}
seriesDTO.setLegendData(legendData);
//横轴时间
qcStaticTable.setStartDateStr(qcStaticTable.getYmdms()+" 08:00:00");
qcStaticTable.setEndDateStr(qcStaticTable.getYmdms()+" 08:00:00");
List<String> xAxisData = this.getHourProductionTitle(qcStaticTable);
seriesDTO.setxAxisData(xAxisData);
//数据
Map<String,QcStaticTable> dataMap = qcStaticTableMapper.getXJMapData(qcStaticTable);
List<ChartDTO> series = new ArrayList<>();
ChartDTO serie = null;
for(QcStaticTable legend:legends){
serie= new ChartDTO();
serie.setName(legend.getSupplierName());
List<Double> data = new ArrayList<>();
for(String houreName:xAxisData){
String key = legend.getSupplierCode()+houreName.replace("时","");
QcStaticTable qt = dataMap.get(key);
if(qt!=null&&StringUtils.isNotBlank(qt.getSampleQuality())){
BigDecimal noOkRate = new BigDecimal(qt.getNoOkNums())
.multiply(new BigDecimal(100))
.divide(new BigDecimal(qt.getSampleQuality()),2,BigDecimal.ROUND_HALF_UP);
data.add(noOkRate.doubleValue());
}else{
data.add(0.00);
}
serie.setData(data);
}
serie.setData(data);
series.add(serie);
}
seriesDTO.setSeries(series);
return seriesDTO;
}
private List<String> getHourProductionTitle(QcStaticTable qcStaticTable) {
// 返回的日期集合
List<String> dayHours = new ArrayList<String>();
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH");
try {
Date start = dateFormat.parse(qcStaticTable.getStartDateStr());//开始
Date end = dateFormat.parse(qcStaticTable.getEndDateStr());//结束
Calendar calendar = Calendar.getInstance();
calendar.setTime(end);
calendar.add(Calendar.HOUR_OF_DAY, 14);
end = calendar.getTime();
Calendar tempStart = Calendar.getInstance();
tempStart.setTime(start);
Calendar tempEnd = Calendar.getInstance();
tempEnd.setTime(end);
while (tempStart.before(tempEnd)) {
dayHours.add(dateFormat.format(tempStart.getTime()).split(" ")[1]+"时");
tempStart.add(Calendar.HOUR_OF_DAY, 1);
}
} catch (ParseException e) {
e.printStackTrace();
}
return dayHours;
}
}

@ -34,6 +34,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="factoryCode" column="factory_code" />
<result property="delFlag" column="del_flag" />
<result property="sampleQuality" column="sample_quality" />
<result property="checkName" column="check_name" />
</resultMap>
<sql id="selectQcCheckReportIncomeVo">
@ -49,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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,
q.type_code
q.type_code,q.check_name
from qc_check_task qct
left join qc_check_type q on q.id = qct.check_type
<where>
@ -72,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="checkTimeStart != null "> and CONVERT(varchar(30),qct.check_time, 120) >= #{checkTimeStart}</if>
<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>
</where>
</select>

@ -36,6 +36,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="factoryCode" column="factory_code" />
<result property="delFlag" column="del_flag" />
<result property="checkType" column="check_type" />
<result property="checkName" column="check_name" />
</resultMap>
<sql id="selectQcCheckTaskProduceVo">
@ -56,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qct.create_by,qct.create_time, qct.update_by, qct.update_time,
qct.check_type,qct.sample_quality,qct.noOk_quality,
qct.aNoOkquality,qct.bNoOkquality,qct.cNoOkquality,
q.type_code
q.type_code,q.check_name
from qc_check_task qct
left join qc_check_type q on q.id = qct.check_type
<where>

@ -63,9 +63,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ctp.sample_num,
ctp.sort
FROM qc_check_type_project ctp
LEFT JOIN qc_check_project cp ON ctp.project_id = cp.id AND cp.del_flag = '0'
LEFT JOIN qc_check_project cp ON ctp.project_id = cp.id
<where>
AND ctp.del_flag = '0'
AND ctp.del_flag = '0' AND cp.del_flag = '0'
<if test="projectId != null and projectId != ''"> and ctp.project_id = #{projectId}</if>
<if test="typeId != null and typeId != ''"> and ctp.type_id = #{typeId}</if>
<if test="standardValue != null and standardValue != ''"> and ctp.standard_value like concat('%', #{standardValue}, '%')</if>

@ -132,26 +132,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getProjectDetail" resultType="com.op.quality.domain.QcStaticTable">
select qctd.project_id projectId,
qctd.status,
SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5),
CONVERT(VARCHAR(5),qctd.create_time, 108),
concat(qctd.project_id,
case when '09:00'>= SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5) and SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5)> '08:00' then '08'
when '10:00'>= SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5) and SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5)> '09:00' then '09'
when '11:00'>= SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5) and SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5)> '10:00' then '10'
when '12:00'>= SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5) and SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5)> '11:00' then '11'
when '13:30'>= SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5) and SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5)> '12:30' then '12'
when '14:30'>= SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5) and SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5)> '13:30' then '13'
when '15:30'>= SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5) and SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5)> '14:30' then '14'
when '16:30'>= SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5) and SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5)> '15:30' then '15'
when '17:30'>= SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5) and SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5)> '16:30' then '16'
when '19:00'>= SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5) and SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5)> '18:00' then '18'
when '20:00'>= SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5) and SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5)> '19:00' then '19'
when '21:00'>= SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5) and SUBSTRING(CONVERT(varchar(18),qctd.create_time, 120), 12, 5)> '20:00' then '20'
case when '09:00'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '08:00' then '08'
when '10:00'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '09:00' then '09'
when '11:00'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '10:00' then '10'
when '12:00'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '11:00' then '11'
when '13:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '12:30' then '12'
when '14:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '13:30' then '13'
when '15:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '14:30' then '14'
when '16:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '15:30' then '15'
when '17:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '16:30' then '16'
when '19:00'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '18:00' then '18'
when '20:00'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '19:00' then '19'
when '21:00'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '20:00' then '20'
else '-' end
)ymdms
from qc_check_task qct
left join qc_check_task_detail qctd on qct.record_id = qctd.belong_to
where qct.income_batch_no = #{incomeBatchNo} and qct.check_type = 'checkTypeSCXJ'
left join qc_check_task_detail qctd on qct.record_id = qctd.belong_to
where qct.qct.order_no = #{orderNo} and qct.check_type = 'checkTypeSCXJ'
order by qctd.create_time
</select>
<select id="getBatchnos" resultType="java.lang.String">
select powb.batch_code batchCode
from pro_order_workorder_batch powb
left join pro_order_workorder pow on powb.workorder_id = pow.workorder_id
where powb.del_flag = '0' and pow.del_flag = '0'
and pow.workorder_code = #{orderNo}
</select>
<select id="getLegendData" resultType="com.op.quality.domain.QcStaticTable">
select DISTINCT supplier_code supplierCode,
supplier_name supplierName
from qc_check_task
where check_type = 'checkTypeSCXJ' and del_flag = '0'
and CONVERT(varchar(10),income_time, 120) = #{ymdms}
</select>
<select id="getXJMapData" resultType="com.op.quality.domain.QcStaticTable">
select qct.supplier_code supplierCode,
qct.supplier_name supplierName,
sum(qct.sample_quality) sampleQuality,
sum(qct.noOk_quality) noOkNums,
concat(qct.supplier_code,CONVERT(VARCHAR(2), qct.check_time, 108)) ymdms
from qc_check_task qct
where qct.check_type = 'checkTypeSCXJ' and qct.del_flag = '0'
and CONVERT(varchar(10),qct.income_time, 120) = #{ymdms}
<if test="orderNo != null "> and qct.check_no like concat('%',#{orderNo},'%')</if>
<if test="materialCode != null "> and qct.material_code like concat('%',#{materialCode},'%')</if>
group by qct.supplier_code,qct.supplier_name,CONVERT(VARCHAR(2), qct.check_time, 108)
</select>
</mapper>

Loading…
Cancel
Save