报表加日志+质检查自动判定+其它

master
zhaoxiaolin 7 months ago
parent 7330d3b4be
commit 918c57bd39

@ -149,6 +149,15 @@ public class QcCheckTaskProduceDTO extends BaseEntity {
private BigDecimal cNoOkquality;
private String workorderCode;
private String checkLevel;
public String getCheckLevel() {
return checkLevel;
}
public void setCheckLevel(String checkLevel) {
this.checkLevel = checkLevel;
}
public String getWorkorderCode() {
return workorderCode;

@ -136,6 +136,7 @@ public class SapRFW {
String material;
String entry_qnt;
String rspos;
public String getMaterial() {
return material;
@ -152,10 +153,20 @@ public class SapRFW {
public void setEntry_qnt(String entry_qnt) {
this.entry_qnt = entry_qnt;
}
public String getRspos() {
return rspos;
}
public void setRspos(String rspos) {
this.rspos = rspos;
}
@Override
public String toString() {
return "lt_hw{" +
"material='" + material + '\'' +
"rspos='" + rspos + '\'' +
",material='" + material + '\'' +
", entry_qnt='" + entry_qnt + '\'' +
'}';
}

@ -155,6 +155,7 @@ public class EquCheckItemController extends BaseController {
* @return
*/
@GetMapping("/matchList")
@Log(title = "汇总报表", businessType = BusinessType.QUERY)
public AjaxResult selectMatchListByEquipmentCode(SummaryReportDTO summaryReportDTO) {
return equCheckItemService.selectMatchListByEquipmentCode(summaryReportDTO);
}

@ -39,6 +39,7 @@ public class EquOperationController extends BaseController {
*/
@RequiresPermissions("device:operation:list")
@GetMapping("/list")
@Log(title = "设备完好率", businessType = BusinessType.QUERY)
public TableDataInfo list(EquOperation equOperation) {
startPage();
List<EquOperation> list = equOperationService.selectEquOperationList(equOperation);

@ -39,6 +39,7 @@ public class EquOrderController extends BaseController {
*/
@RequiresPermissions("device:deviceOrder:list")
@GetMapping("/list")
@Log(title = "保养记录", businessType = BusinessType.QUERY)
public TableDataInfo list(EquOrder equOrder) {
startPage();
List<EquOrder> list = equOrderService.selectEquOrderList(equOrder);
@ -49,7 +50,7 @@ public class EquOrderController extends BaseController {
*
*/
@RequiresPermissions("device:deviceOrder:export")
@Log(title = "计划工单", businessType = BusinessType.EXPORT)
@Log(title = "点检记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EquOrder equOrder) {
List<EquOrder> list = equOrderService.selectEquOrderList(equOrder);

@ -49,6 +49,7 @@ public class EquRepairWorkOrderController extends BaseController {
*
*/
@RequiresPermissions("device:repairOrder:list")
@Log(title = "维修报表", businessType = BusinessType.QUERY)
@GetMapping("/list")
public TableDataInfo list(EquRepairWorkOrder equRepairWorkOrder) {
startPage();

@ -42,6 +42,7 @@ public class MesPrepareController extends BaseController {
*/
@RequiresPermissions("mes:prepare:list")
@GetMapping("/list")
@Log(title = "备料单查询", businessType = BusinessType.QUERY)
public TableDataInfo list(MesPrepare mesPrepare) {
startPage();
List<MesPrepare> list = mesPrepareService.selectMesPrepareList(mesPrepare);

@ -20,6 +20,8 @@ import com.op.common.core.utils.bean.BeanUtils;
import com.op.common.core.utils.poi.ExcelMapUtil;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.datasource.creator.DynamicDatasourceCreator;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.mes.domain.*;
import com.op.mes.domain.dto.LineChartDto;
import com.op.mes.domain.dto.SysFactoryDto;
@ -68,6 +70,7 @@ public class MesReportWorkController extends BaseController {
*/
@RequiresPermissions("mes:reportWork:list")
@GetMapping("/list")
@Log(title = "报工报表", businessType = BusinessType.EXPORT)
public TableDataInfo list(MesReportWork mesReportWork) {
startPage();
// //默认时间范围T 00:00:00~T+1 00:00:00
@ -181,6 +184,7 @@ public class MesReportWorkController extends BaseController {
*/
@RequiresPermissions("mes:processFinish:list")
@GetMapping("/getProcessFinishList")
@Log(title = "工单各工序完成记录", businessType = BusinessType.EXPORT)
public TableDataInfo getProcessFinishList(MesProcessReport mesReportWork) {
startPage();
List<MesProcessReport> list = mesReportWorkService.getProcessFinishList(mesReportWork);
@ -205,6 +209,7 @@ public class MesReportWorkController extends BaseController {
*/
@RequiresPermissions("mes:production:list")
@GetMapping("/getProductionList")
@Log(title = "成品产量报表", businessType = BusinessType.QUERY)
public TableDataInfo getProductionList(MesReportProduction mesReportProduction) {
startPage();
List<MesReportProduction> list = mesReportWorkService.getProductionList(mesReportProduction);
@ -237,6 +242,7 @@ public class MesReportWorkController extends BaseController {
}
@RequiresPermissions("mes:dailyReport:list")
@GetMapping("/getDailyReportNew")
@Log(title = "生成日报表查询", businessType = BusinessType.QUERY)
public TableDataInfo getDailyReportNew(MesDailyReportVo mesDailyReportVo) {
startPage();
List<MesDailyReportVo> list = mesReportWorkService.getDailyReportNew(mesDailyReportVo);
@ -358,6 +364,7 @@ public class MesReportWorkController extends BaseController {
*/
@RequiresPermissions("mes:hourProduction:list")
@GetMapping("/getHourProductionList")
@Log(title = "设备小时产量查询", businessType = BusinessType.QUERY)
public List<HashMap> getHourProductionList(MesHourReport mesHourReport) {
List<String> hourNames = this.getHourProductionTitle(mesHourReport);
mesHourReport.setHourNames(hourNames);
@ -405,6 +412,7 @@ public class MesReportWorkController extends BaseController {
}
@GetMapping("/getMachineProductionList")
@Log(title = "成型机生成报表", businessType = BusinessType.QUERY)
public List<Map<String, Object>> getMachineProductionList(MesMachineReport mesMachineReport) {
List<DynamicColumnVo> proNames = this.getMachineProductionTitle(mesMachineReport);
mesMachineReport.setProductNames(proNames);

@ -39,6 +39,7 @@ public class ProRfidProcessDetailController extends BaseController {
*/
@RequiresPermissions("mes:detail:list")
@GetMapping("/list")
@Log(title = "rfid流程查看", businessType = BusinessType.QUERY)
public TableDataInfo list(ProRfidProcessDetail proRfidProcessDetail) {
startPage();
List<ProRfidProcessDetail> list = proRfidProcessDetailService.selectProRfidProcessDetailList(proRfidProcessDetail);

@ -113,6 +113,15 @@ public class MesReportWorkConsume extends BaseEntity {
private String warehouseName;
private String planQuantity;
private String machineCode;
private String rspos;//sap物料项目编号
public String getRspos() {
return rspos;
}
public void setRspos(String rspos) {
this.rspos = rspos;
}
public String getMachineCode() {
return machineCode;

@ -625,6 +625,9 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
SapRFW.lt_hw lthw = new SapRFW.lt_hw();//MES生产订单报工货物移动修改
lthw.setEntry_qnt(consume.getQuantity() + "");//数量
lthw.setMaterial(consume.getMaterialCode());//物料编码
if(StringUtils.isNotBlank(consume.getRspos())){//自主加的物料
lthw.setRspos(consume.getRspos());//sap物料项目凭证
}
lt_hwList.add(lthw);
}
} else {

@ -265,8 +265,6 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
mesReportWork.setUpdateBy(updateBy);
}
//会更新好几次//着急发布后面再说
//mesReportWorkMapper.updateReportRemark(mesReportWorks);
return mesReportWorkMapper.submitReportPS(mesReportWorks);
}

@ -115,13 +115,14 @@
mrwc.attr1,
mrwc.warehouse_code warehouseCode,
mpd.quantity planQuantity,
mrwc.parent_order parentOrder,mrwc.report_code reportCode
mrwc.parent_order parentOrder,mrwc.report_code reportCode,
mrwc.rspos
from mes_report_work_consume mrwc
left join mes_report_work mrw on mrw.report_code = mrwc.report_code
left join pro_order_workorder pow on mrwc.workorder_code = pow.workorder_code
left join mes_prepare mp on mp.workorder_code = pow.workorder_code and mp.del_flag='0'
left join mes_prepare_detail mpd on mpd.prepare_id = mp.prepare_id
and mpd.material_code = mrwc.material_code
and mpd.material_code = mrwc.material_code and mpd.attr1 = mrwc.rspos
and mpd.del_flag = '0'
where mrwc.del_flag = '0' and pow.del_flag = '0'
and mrwc.workorder_code = #{workorderCode}
@ -172,18 +173,20 @@
</select>
<select id="getSumConsumeList" resultType="com.op.mes.domain.MesReportWorkConsume">
select t.materialCode,
t.rspos,
sum(t.quantity) quantity
from(
select DISTINCT
mrwc.material_code materialCode,
mrwc.quantity
mrwc.quantity,
mrwc.rspos
from mes_report_work_consume mrwc
left join mes_report_work mrw on mrw.report_code = mrwc.report_code
left join pro_order_workorder pow on mrwc.workorder_code = pow.workorder_code
where mrwc.del_flag = '0' and pow.del_flag = '0'
and mrwc.workorder_code = #{workorderCode}
and mrw.machine_code = #{machineCode} and mrwc.recoil = #{recoil}
) t group by t.materialCode
) t group by t.materialCode,t.rspos
</select>
<insert id="insertMesReportWorkConsume" parameterType="MesReportWorkConsume">

@ -1100,6 +1100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
set quantity_feedback = #{item.quantityFeedback},
work_time = #{item.workTime},
use_man = #{item.useMan},
<if test="item.batch != null">batch = #{item.batch},</if>
update_by = #{item.updateBy},
update_time = #{item.updateTime},
remark = #{item.remark}

@ -93,5 +93,6 @@ public interface OpenMapper {
EquEquipmentDTO selectEquipmentDetailByEquipmentCode(String equipmentCode);
List<SysNoticeGroup> getNotices(SysNoticeGroup noticeQo);
}

@ -457,15 +457,6 @@ public class OpenServiceImpl implements OpenService {
return 0;//没有找到检测项目
}
// /**qc_sample_rule**/
// QcCheckTaskProduceDTO sampQua = new QcCheckTaskProduceDTO();
// sampQua.setCheckType(qcCheckTaskProduce.getCheckType());
// sampQua.setQuality(qcCheckTaskProduce.getQuality());
// String sampNum = openMapper.getSampNum(sampQua);
// if(StringUtils.isNotBlank(sampNum)){
// qcCheckTaskProduce.setSampleQuality(new BigDecimal(sampNum));
// }
/**qc_check_task**/
qcCheckTaskProduce.setRecordId(beLongId);
qcCheckTaskProduce.setFactoryCode(factoryCode);
@ -647,8 +638,6 @@ public class OpenServiceImpl implements OpenService {
return false;
}
public static void main(String args[]){
// 创建两个日期时间对象
LocalDateTime dateTime1 = LocalDateTime.of(2024, 4, 18, 9, 33); // 2023年1月1日 10:30

@ -963,10 +963,10 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
for (int j = 0; j < splitOrderDTO.getFormFields().size(); j++) {
newbatchs.add(splitOrderDTO.getFormFields().get(j).getBatchCode());
}
List<String> batchCodes = proOrderWorkorderBatchMapper.checkBatchCodeByWorkOrderIds(workorderIds,newbatchs);
if (!CollectionUtils.isEmpty(batchCodes)) {
checkout = false;
}
// List<String> batchCodes = proOrderWorkorderBatchMapper.checkBatchCodeByWorkOrderIds(workorderIds,newbatchs);
// if (!CollectionUtils.isEmpty(batchCodes)) {
// checkout = false;
// }
//校验各工序设备是否已选择
List<CascaderDTO> processes = proOrderMapper.getRouteProcess(splitOrderDTO.getRouteCode());
if (splitOrderDTO.getProdLineCodeArray().length == 0) {

@ -106,8 +106,9 @@
pow.route_code, pow.prod_line_code, pow.product_date,
pow.shift_id, pow.parent_order,pow.status, pow.prod_type,pow.factory_code,
pow.end_flag,pow.car_num,pow.sort_no,
pow.workorder_code_sap
pow.workorder_code_sap,po.atrr2
from pro_order_workorder pow
left join pro_order po on pow.order_id = po.id
<where>
<if test="workorderCode != null and workorderCode != ''">and pow.workorder_code like concat('%',
#{workorderCode}, '%')
@ -725,13 +726,14 @@
INSERT INTO mes_prepare_detail (
record_id,prepare_id,material_code,material_name,unit,
quantity,create_by,create_time,factory_code,status,
locator,need_date,recoil,fund_quanlity,buy_flag,parent_work_order
locator,need_date,recoil,fund_quanlity,buy_flag,parent_work_order,attr1
)VALUES
<foreach collection="list" item="d" index="index" separator=",">
(
#{d.recordId},#{d.prepareId},#{d.materialCode},#{d.materailName},#{d.unit},
#{d.quantity},#{d.createBy},#{d.createTime},#{d.factoryCode},#{d.status},
#{d.locator},#{d.needDate},#{d.recoil},#{d.fundQuanlity},#{d.buyFlag},#{d.parentWorkOrder}
#{d.locator},#{d.needDate},#{d.recoil},#{d.fundQuanlity},#{d.buyFlag},#{d.parentWorkOrder},
#{d.attr1}
)
</foreach>

@ -36,6 +36,7 @@ public class QcProCheckController extends BaseController {
}
@GetMapping("/getHfChartData")
@Log(title = "烘房白坯质量查看", businessType = BusinessType.QUERY)
public ChartSeriesDTO getHfChartData(QcProCheck qcProCheck) {
ChartSeriesDTO dto = qcProCheckService.getHfChartData(qcProCheck);
return dto;

@ -57,6 +57,7 @@ public class QcStaticTableController extends BaseController {
*/
@RequiresPermissions("quality:qcTableIncome:list")
@GetMapping("/getIncomeTableList")
@Log(title = "供应商质量统计", businessType = BusinessType.QUERY)
public TableDataInfo getIncomeTableList(QcStaticTable qcStaticTable) {
if (StringUtils.isNotBlank(qcStaticTable.getSupplierCode())) {
List<String> codes = Arrays.asList(qcStaticTable.getSupplierCode().split(","));
@ -88,6 +89,7 @@ public class QcStaticTableController extends BaseController {
*/
@RequiresPermissions("quality:qcTableProduce:list")
@GetMapping("/getProduceChartData")
@Log(title = "产品质量分析", businessType = BusinessType.QUERY)
public QcStaticTable getProduceChartData(QcStaticTable qcStaticTable) {
QcStaticTable resultdto = new QcStaticTable();
//默认时间范围T 00:00:00~T+1 00:00:00
@ -256,6 +258,7 @@ public class QcStaticTableController extends BaseController {
*/
@RequiresPermissions("quality:qcTableXJ:list")
@GetMapping("/getXJCheckTableList")
@Log(title = "生成巡检记录", businessType = BusinessType.QUERY)
public TableDataInfo getXJCheckTableList(QcStaticTable qcStaticTable) {
//默认时间范围T 00:00:00~T+1 00:00:00
@ -282,6 +285,7 @@ public class QcStaticTableController extends BaseController {
@RequiresPermissions("quality:qcTableXJAnalysis:list")
@GetMapping("/getXJChartData")
@Log(title = "巡检不良分析", businessType = BusinessType.QUERY)
public ChartSeriesDTO getXJChartData(QcStaticTable qcStaticTable) {
if (StringUtils.isEmpty(qcStaticTable.getYmdms())) {
LocalDate date = LocalDate.now();
@ -298,6 +302,7 @@ public class QcStaticTableController extends BaseController {
**/
@RequiresPermissions("quality:qcProduceAnalysis:list")
@GetMapping("/getQmsRateTable")
@Log(title = "质检不良统计", businessType = BusinessType.QUERY)
public TableDataInfo getQmsRateTable(QcStaticTable qcStaticTable) {
//默认时间范围T 00:00:00~T+1 00:00:00
if (StringUtils.isEmpty(qcStaticTable.getYmArrayStart())) {
@ -333,6 +338,7 @@ public class QcStaticTableController extends BaseController {
* ----
**/
@GetMapping("/getDLTableAvgInfo")
@Log(title = "定量值分析", businessType = BusinessType.QUERY)
public QcStaticTable getDLTableAvgInfo(QcStaticTable qcStaticTable) {
return qcStaticTableService.getDLTableAvgInfo(qcStaticTable);
}

@ -193,6 +193,26 @@ public class QuaController extends BaseController {
return success(qcProCheckService.getWeightInfo(qcCheckTaskDetail));
}
/**
*
*/
@PostMapping(value = "/getAutoJudge")
public AjaxResult getAutoJudge(@RequestBody QcCheckTaskDetail qcCheckTaskDetail) {
if(StringUtils.isBlank(qcCheckTaskDetail.getSampleQuality())){
return error("[sampleQuality]不能为空");
}
if(StringUtils.isBlank(qcCheckTaskDetail.getCheckLevel())){
return error("[checkLevel]不能为空");
}
if(StringUtils.isBlank(qcCheckTaskDetail.getSampleAql())){
return error("[sampleAql]不能为空");
}
if(CollectionUtils.isEmpty(qcCheckTaskDetail.getActualValues())){
return error("[actualValue]不能为空");
}
return success(qcProCheckService.getAutoJudge(qcCheckTaskDetail));
}
/**
*
*/

@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import java.math.BigDecimal;
/**
* qc_check_project
*
@ -52,7 +54,6 @@ public class QcCheckProject extends BaseEntity {
/**
*
*/
@Excel(name = "单位")
private String unitCode;
/**
@ -64,13 +65,11 @@ public class QcCheckProject extends BaseEntity {
/**
* 1
*/
@Excel(name = "预留字段1")
private String attr1;
/**
*
*/
@Excel(name = "工厂编码")
private String factoryCode;
@Excel(name = "抽样方案")
private String samplePlan;
@ -87,8 +86,28 @@ public class QcCheckProject extends BaseEntity {
private String groupId;
@Excel(name = "检测项分类",readConverterExp = "0=内容物,1=包装")
private String itemType;
@Excel(name = "合格判定比例")
//@Excel(name = "合格判定比例")
private String judgeRate;
@Excel(name = "合格上限")
private BigDecimal upperDiff;
@Excel(name = "合格下限")
private BigDecimal downDiff;
public BigDecimal getUpperDiff() {
return upperDiff;
}
public void setUpperDiff(BigDecimal upperDiff) {
this.upperDiff = upperDiff;
}
public BigDecimal getDownDiff() {
return downDiff;
}
public void setDownDiff(BigDecimal downDiff) {
this.downDiff = downDiff;
}
public String getItemType() {
return itemType;

@ -186,6 +186,15 @@ public class QcCheckReportIncome extends BaseEntity {
private Date confirmTime;
private Boolean myself;
private String shiftId;
private String orderType;
public String getOrderType() {
return orderType;
}
public void setOrderType(String orderType) {
this.orderType = orderType;
}
public String getShiftId() {
return shiftId;

@ -142,6 +142,42 @@ public class QcCheckTaskDetail extends BaseEntity {
private String judgeRate;
private String samplePlan;
private String weight;
private String sampleCode;
private String sampleQuality;
private String sampleAql;
private String checkLevel;
public String getCheckLevel() {
return checkLevel;
}
public void setCheckLevel(String checkLevel) {
this.checkLevel = checkLevel;
}
public String getSampleCode() {
return sampleCode;
}
public void setSampleCode(String sampleCode) {
this.sampleCode = sampleCode;
}
public String getSampleQuality() {
return sampleQuality;
}
public void setSampleQuality(String sampleQuality) {
this.sampleQuality = sampleQuality;
}
public String getSampleAql() {
return sampleAql;
}
public void setSampleAql(String sampleAql) {
this.sampleAql = sampleAql;
}
public String getProjectRuleName() {
return projectRuleName;

@ -199,7 +199,33 @@ public class QcCheckTaskIncome extends BaseEntity {
private String materialFrom;//物料来源
private String startOA;//发起oa 1是 0否
private String checkLevel;
private String checkAql;
private String sampleCode;
private String sampleAql;
private String reason;
public String getSampleAql() {
return sampleAql;
}
public void setSampleAql(String sampleAql) {
this.sampleAql = sampleAql;
}
public String getSampleCode() {
return sampleCode;
}
public void setSampleCode(String sampleCode) {
this.sampleCode = sampleCode;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public String getCheckLevel() {
return checkLevel;
@ -209,13 +235,6 @@ public class QcCheckTaskIncome extends BaseEntity {
this.checkLevel = checkLevel;
}
public String getCheckAql() {
return checkAql;
}
public void setCheckAql(String checkAql) {
this.checkAql = checkAql;
}
public String getOrderCode() {
return orderCode;

@ -178,6 +178,24 @@ public class QcCheckTaskWarehousing extends BaseEntity {
private BigDecimal cNoOkquality;
private String workorderCode;
private String checkName;
private String checkLevel;
private String sampleCode;
public String getSampleCode() {
return sampleCode;
}
public void setSampleCode(String sampleCode) {
this.sampleCode = sampleCode;
}
public String getCheckLevel() {
return checkLevel;
}
public void setCheckLevel(String checkLevel) {
this.checkLevel = checkLevel;
}
public String getWorkorderCode() {
return workorderCode;

@ -1,5 +1,6 @@
package com.op.quality.mapper;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -129,4 +130,8 @@ public interface QcCheckTaskIncomeMapper {
List<SysNoticeGroup> getNoticesGroup(SysNoticeGroup noticeQo);
QcCheckTaskIncome hasIncomeTask(QcCheckTaskIncomeDTO income);
String getSampleQua(QcCheckTaskIncome qcCheckTaskIncome);
Integer getnoOkVals(QcCheckTaskIncome qcCheckTaskIncome);
}

@ -64,4 +64,10 @@ public interface QcProjectTypeMapper {
QcProjectType selectQcProjectTypeByCode(String projectTypeCode);
int getTodayMaxNum();
void deleteQcProjectByIds(String[] ids);
void deleteQcProjectByCodes(String[] codes);
int deleteQcProjectTypeByCodes(String[] codes);
}

@ -105,4 +105,5 @@ public interface IQcCheckTaskIncomeService {
public String getWeightValue(String id);
QcCheckTaskIncome hasIncomeTask(QcCheckTaskIncomeDTO income);
}

@ -45,4 +45,6 @@ public interface QcProCheckService {
ChartSeriesDTO getHfChartData(QcProCheck qcProCheck);
String getWeightInfo(QcCheckTaskDetail qcCheckTaskDetail);
QcCheckTaskDetail getAutoJudge(QcCheckTaskDetail qcCheckTaskDetail);
}

@ -210,16 +210,12 @@ public class QcCheckReportIncomeServiceImpl implements IQcCheckReportIncomeServi
//检验项目
String ruleName = dto.getRuleName();
String projectRuleName0 = ruleName.split("]")[0];
if(StringUtils.isNotBlank(projectRuleName0)){
dto.setProjectRuleName(projectRuleName0.replace("[",""));
if(StringUtils.isNotBlank(ruleName)){
String projectRuleName0 = ruleName.split("]")[0];
if(StringUtils.isNotBlank(projectRuleName0)){
dto.setProjectRuleName(projectRuleName0.replace("[",""));
}
}
// //判定(前端做了)
// if("Y".equals(dto.getStatus())){
// dto.setStatus("√");
// }else if("N".equals(dto.getStatus())){
// dto.setStatus("×");
// }
}
return dtos;

@ -189,15 +189,14 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
return 0;//没有找到检测项目
}
// /**qc_sample_rule**/
// QcCheckTaskIncome sampQua = new QcCheckTaskIncome();
// sampQua.setCheckType(qcCheckTaskIncome.getCheckType());
// sampQua.setQuality(qcCheckTaskIncome.getQuality());
// String sampNum = qcSampleRuleMapper.getSampNum(sampQua);
// if(StringUtils.isNotBlank(sampNum)){
// qcCheckTaskIncome.setSampleQuality(new BigDecimal(sampNum));
// //抽样方案
// String sampleQua = this.getSampleQua(qcCheckTaskIncome);
// if(StringUtils.isNotBlank(sampleQua)){
// qcCheckTaskIncome.setSampleCode(sampleQua.split("-")[0]);
// qcCheckTaskIncome.setSampleQuality(new BigDecimal(sampleQua.split("-")[1]));
// }
/**qc_check_task**/
String beLongId = IdUtils.fastSimpleUUID();
qcCheckTaskIncome.setRecordId(beLongId);
@ -354,6 +353,13 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
}
qcCheckTaskIncome.setNoOkQuality(noOkQuality);
// //抽样方案
// String sampleQua = this.getSampleQua(qcCheckTaskIncome);
// if(StringUtils.isNotBlank(sampleQua)){
// qcCheckTaskIncome.setSampleCode(sampleQua.split("-")[0]);
// qcCheckTaskIncome.setSampleQuality(new BigDecimal(sampleQua.split("-")[1]));
// }
return qcCheckTaskIncomeMapper.updateQcCheckTaskIncome(qcCheckTaskIncome);
}
@ -659,12 +665,9 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
result = qcCheckTaskIncome.getCheckResult();
}
//抽样方案
BigDecimal sampleQua = this.getSampleQua(qcCheckTaskIncome);
int n = 0;
QcCheckTaskIncome qcCheckTask = new QcCheckTaskIncome();
qcCheckTask.setSampleQuality(sampleQua);
//qcCheckTask.setSampleQuality(sampleQua);
qcCheckTask.setUpdateBy(updateBy);
qcCheckTask.setRecordId(belongId);
qcCheckTask.setCheckStatus("2");//检测状态0待检测1检测中2检测完成
@ -682,6 +685,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
qcCheckTask.setCheckManCode(qcCheckTaskIncome.getUpdateBy());
qcCheckTask.setCheckManName(qcCheckTaskIncome.getUpdateByName());
qcCheckTask.setSampleQuality(qcCheckTaskIncome.getSampleQuality());
qcCheckTask.setReason(qcCheckTaskIncome.getReason());
/**qc_check_task**/
n = qcCheckTaskIncomeMapper.updateQcCheckTask(qcCheckTask);
logger.info("qc_check_task:"+n);
@ -707,6 +711,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
n = qmsFileMapper.insertBaseFileBatch(files);
System.out.println("base_file:"+n);
}
}
n= qcCheckTaskIncomeMapper.updateQcCheckTaskDetails(details);
logger.info("更新qc_check_task_detail:"+n);
@ -888,11 +893,13 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
//发企业微信--------------------结束
}
}
//抽样方案
protected BigDecimal getSampleQua(QcCheckTaskIncome qcCheckTaskIncome){
BigDecimal sampleQua = BigDecimal.ZERO;
return sampleQua;
protected String getSampleQua(QcCheckTaskIncome qcCheckTaskIncome){
String sampleQuaStr = "";
if(StringUtils.isNotBlank(qcCheckTaskIncome.getCheckLevel())&&qcCheckTaskIncome.getQuality()!=null){
sampleQuaStr = qcCheckTaskIncomeMapper.getSampleQua(qcCheckTaskIncome);
}
return sampleQuaStr;
}
@Override
@ -938,6 +945,4 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
public QcCheckTaskIncome hasIncomeTask(QcCheckTaskIncomeDTO income) {
return qcCheckTaskIncomeMapper.hasIncomeTask(income);
}
}

@ -242,14 +242,17 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
}
}
qcCheckTaskWarehousing.setNoOkQuality(noOkQuality);
// /**qc_sample_rule**/
// QcCheckTaskIncome sampQua = new QcCheckTaskIncome();
// sampQua.setCheckType(qcCheckTaskWarehousing.getCheckType());
// sampQua.setQuality(qcCheckTaskWarehousing.getQuality());
// String sampNum = qcSampleRuleMapper.getSampNum(sampQua);
// if(StringUtils.isNotBlank(sampNum)){
// qcCheckTaskWarehousing.setSampleQuality(new BigDecimal(sampNum));
// //抽样方案
// QcCheckTaskIncome qincome = new QcCheckTaskIncome();
// qincome.setQuality(qcCheckTaskWarehousing.getQuality());
// qincome.setCheckLevel(qcCheckTaskWarehousing.getCheckLevel());
// String sampleQua = this.getSampleQua(qincome);
// if(StringUtils.isNotBlank(sampleQua)){
// qcCheckTaskWarehousing.setSampleCode(sampleQua.split("-")[0]);
// qcCheckTaskWarehousing.setSampleQuality(new BigDecimal(sampleQua.split("-")[1]));
// }
/**qc_check_task**/
qcCheckTaskWarehousing.setIncomeTime(DateUtils.getNowDate());//检验任务日期
int n = qcCheckTaskWarehousingMapper.insertQcCheckTaskWarehousing(qcCheckTaskWarehousing);
@ -425,4 +428,13 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
}
logger.info("++++++++++++" + poolName + "++++入库检验巡检结束++++++++++");
}
// //抽样方案
// protected String getSampleQua(QcCheckTaskIncome qcCheckTaskIncome){
// String sampleQuaStr = "";
// if(StringUtils.isNotBlank(qcCheckTaskIncome.getCheckLevel())&&qcCheckTaskIncome.getQuality()!=null){
// sampleQuaStr = qcCheckTaskIncomeMapper.getSampleQua(qcCheckTaskIncome);
// }
// return sampleQuaStr;
// }
}

@ -20,7 +20,9 @@ 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.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
@ -221,4 +223,55 @@ public class QcProCheckServiceImpl implements QcProCheckService {
return qcProCheckMapper.getWeightInfo(qcCheckTaskDetail);
}
@Override
@DS("#header.poolName")
public QcCheckTaskDetail getAutoJudge(QcCheckTaskDetail qcCheckTaskDetail) {
if(StringUtils.isNotBlank(qcCheckTaskDetail.getFactoryCode())){
DynamicDataSourceContextHolder.push(qcCheckTaskDetail.getFactoryCode());
}
QcCheckTaskDetail dto = new QcCheckTaskDetail();
QcCheckTaskIncome qincome = new QcCheckTaskIncome();
qincome.setQuality(new BigDecimal(qcCheckTaskDetail.getSampleQuality()));
qincome.setCheckLevel(qcCheckTaskDetail.getCheckLevel());
String sampleQuaStr = qcCheckTaskIncomeMapper.getSampleQua(qincome);
if(StringUtils.isNotBlank(sampleQuaStr)){
dto.setSampleCode(sampleQuaStr.split("-")[0]);
dto.setSampleQuality(sampleQuaStr.split("-")[1]);
}
qincome.setSampleAql(qcCheckTaskDetail.getSampleAql());
qincome.setSampleCode(dto.getSampleCode());
Integer nookstandar = qcCheckTaskIncomeMapper.getnoOkVals(qincome);
if(nookstandar == null){
return dto;
}
String status = "N";
int nookNum = 0;
for(String aValue:qcCheckTaskDetail.getActualValues()){
if(qcCheckTaskDetail.getUpperDiff()!=null && qcCheckTaskDetail.getDownDiff()!=null
&& qcCheckTaskDetail.getDownDiff().compareTo(new BigDecimal(aValue)) < 1
&& qcCheckTaskDetail.getUpperDiff().compareTo(new BigDecimal(aValue)) >=0){
System.out.println("Y");
}else if(qcCheckTaskDetail.getUpperDiff()==null && qcCheckTaskDetail.getDownDiff()!=null
&& qcCheckTaskDetail.getDownDiff().compareTo(new BigDecimal(aValue)) < 1){
System.out.println("Y");
}else if(qcCheckTaskDetail.getUpperDiff()!=null && qcCheckTaskDetail.getDownDiff()==null
&& qcCheckTaskDetail.getUpperDiff().compareTo(new BigDecimal(aValue)) >=0){
System.out.println("Y");
}else{
System.out.println("N");
++nookNum;
}
}
if(nookNum<=nookstandar.intValue()){
status = "Y";
}
dto.setStatus(status);
return dto;
}
public static void main(String args[]){
int m = 0;
++m;
System.out.println(m);
}
}

@ -107,8 +107,9 @@ public class QcProjectTypeServiceImpl implements IQcProjectTypeService {
*/
@Override
@DS("#header.poolName")
public int deleteQcProjectTypeByIds(String[] ids) {
return qcProjectTypeMapper.deleteQcProjectTypeByIds(ids);
public int deleteQcProjectTypeByIds(String[] codes) {
qcProjectTypeMapper.deleteQcProjectByCodes(codes);
return qcProjectTypeMapper.deleteQcProjectTypeByCodes(codes);
}
/**

@ -27,13 +27,15 @@
<result property="sort" column="sort" />
<result property="itemType" column="item_type" />
<result property="judgeRate" column="judge_rate" />
<result property="upperDiff" column="upper_diff" />
<result property="downDiff" column="down_diff" />
</resultMap>
<sql id="selectQcCheckProjectVo">
select id, order_num, rule_name, property_code, check_mode, check_tool, unit_code, check_standard,
attr1, create_by, create_time, update_by, update_time, factory_code, del_flag,sample_plan,
judge,defect_level,project_type,sort,item_type,judge_rate
judge,defect_level,project_type,sort,item_type,judge_rate,
upper_diff,down_diff
from qc_check_project
</sql>
@ -86,6 +88,8 @@
<if test="sort != null">sort,</if>
<if test="itemType != null">item_type,</if>
<if test="judgeRate != null">judge_rate,</if>
<if test="upperDiff != null">upper_diff,</if>
<if test="downDiff != null">down_diff,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@ -110,6 +114,8 @@
<if test="sort != null">#{sort},</if>
<if test="itemType != null">#{itemType},</if>
<if test="judgeRate != null">#{judgeRate},</if>
<if test="upperDiff != null">#{upperDiff},</if>
<if test="downDiff != null">#{downDiff},</if>
</trim>
</insert>
@ -137,6 +143,8 @@
<if test="sort != null">sort = #{sort},</if>
<if test="itemType != null">item_type = #{itemType},</if>
<if test="judgeRate != null">judge_rate = #{judgeRate},</if>
<if test="upperDiff != null">upper_diff= #{upperDiff},</if>
<if test="downDiff != null">down_diff= #{downDiff},</if>
</trim>
where id = #{id}
</update>

@ -38,13 +38,14 @@
<result property="checkType" column="check_type"/>
<result property="reason" column="reason"/>
<result property="productType" column="product_type"/>
<result property="orderType" column="order_type"/>
</resultMap>
<sql id="selectQcCheckReportIncomeVo">
select record_id, check_no, income_batch_no, order_no, material_code, material_name, quality, unit,
supplier_code, supplier_name, income_time, check_loc, check_status, check_man_code, check_man_name,sample_quality,
check_time, check_result, status, check_type, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time,
factory_code, del_flag,reason,product_type
factory_code, del_flag,reason,product_type,order_type
from qc_check_task
</sql>
@ -156,7 +157,9 @@
qcp.sample_plan samplePlan,
qctp.item_type itemType,
qctp.judge_rate judgeRate,
qpt.standard_no standardNo
qpt.standard_no standardNo,
qctp.upper_diff upperDiff,
qctp.down_diff downDiff
from qc_check_task_detail td
left join qc_check_type_project qctp on td.type_project_id = qctp.id
left join qc_check_project qcp on qcp.id = qctp.project_id

@ -169,6 +169,11 @@
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="defectCode != null">defect_code = #{defectCode},</if>
<if test="defectQuality != null">defect_quality = #{defectQuality},</if>
<if test="sampleCode != null">sample_code = #{sampleCode},</if>
<if test="sampleQuality != null">sample_quality = #{sampleQuality},</if>
<if test="sampleAql != null">sample_aql = #{sampleAql},</if>
<if test="checkLevel != null">check_level = #{checkLevel},</if>
</trim>
where record_id = #{recordId}
</update>

@ -36,7 +36,7 @@
<result property="delFlag" column="del_flag"/>
<result property="checkType" column="check_type"/>
<result property="sampleQuality" column="sample_quality"/>
<result property="sampleCode" column="sample_code"/>
<result property="orderType" column="order_type"/>
<result property="orderTypeDesc" column="order_type_desc"/>
</resultMap>
@ -56,7 +56,7 @@
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.create_by,qct.create_time, qct.update_by, qct.update_time,qct.check_type,qct.noOk_quality,
qct.sample_quality, qct.type_code, qct.order_type
qct.sample_quality, qct.type_code, qct.order_type,qct.sample_code
from qc_check_task qct
<where>
<if test="checkNo != null and checkNo != ''">and qct.check_no = #{checkNo}</if>
@ -150,6 +150,10 @@
td.belong_to belongTo,
td.defect_code defectCode,
td.defect_quality defectQuality,
td.sample_code sampleCode,
td.sample_quality sampleQuality,
td.sample_aql sampleAql,
td.check_level checkLevel,
qctp.upper_diff upperDiff,
qctp.down_diff downDiff,
qctp.sample,
@ -216,6 +220,7 @@
<if test="sampleQuality != null">sample_quality,</if>
<if test="orderType != null">order_type,</if>
<if test="orderTypeDesc != null">order_type_desc,</if>
<if test="sampleCode != null">sample_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordId != null">#{recordId},</if>
@ -252,6 +257,7 @@
<if test="sampleQuality != null">#{sampleQuality},</if>
<if test="orderType != null">#{orderType},</if>
<if test="orderTypeDesc != null">#{orderTypeDesc},</if>
<if test="sampleCode != null">#{sampleCode},</if>
</trim>
</insert>
@ -289,6 +295,7 @@
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="checkType != null">check_type = #{checkType},</if>
<if test="sampleQuality != null">sample_quality = #{sampleQuality},</if>
<if test="sampleCode != null">sample_code = #{sampleCode},</if>
</trim>
where record_id = #{recordId}
</update>
@ -306,6 +313,7 @@
<if test="cNoOkquality != null">cNoOkquality = #{cNoOkquality},</if>
<if test="incomeBatchNo != null">income_batch_no = #{incomeBatchNo},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="reason != null">reason = #{reason},</if>
check_result = #{checkResult},
update_by = #{updateBy},
update_time = #{updateTime}
@ -320,6 +328,10 @@
update_by = #{item.updateBy},
update_time = #{item.updateTime},
remark = #{item.remark},
<if test="item.sampleCode != null">sample_code = #{item.sampleCode},</if>
<if test="item.sampleQuality != null">sample_quality = #{item.sampleQuality},</if>
<if test="item.sampleAql != null">sample_aql = #{item.sampleAql},</if>
<if test="item.checkLevel != null">check_level = #{item.checkLevel},</if>
defect_code = #{item.defectCode},
defect_quality = #{item.defectQuality}
where
@ -522,6 +534,45 @@
and quality = #{quality}
and income_time = #{incomeTime} and del_flag = '0'
</select>
<select id="getSampleQua" resultType="String">
select sample_code
from qc_sample_rule_code
where check_level = #{checkLevel}
and #{quality}>=start_value
and end_value>= #{quality}
and del_flag='0'
</select>
<select id="getnoOkVals" resultType="java.lang.Integer">
select
<if test='sampleAql == "aql1"'>aql1</if>
<if test='sampleAql == "aql2"'>aql2</if>
<if test='sampleAql == "aql3"'>aql3</if>
<if test='sampleAql == "aql4"'>aql4</if>
<if test='sampleAql == "aql5"'>aql5</if>
<if test='sampleAql == "aql6"'>aql6</if>
<if test='sampleAql == "aql7"'>aql7</if>
<if test='sampleAql == "aql8"'>aql8</if>
<if test='sampleAql == "aql9"'>aql9</if>
<if test='sampleAql == "aql10"'>aql10</if>
<if test='sampleAql == "aql11"'>aql11</if>
<if test='sampleAql == "aql12"'>aql12</if>
<if test='sampleAql == "aql13"'>aql13</if>
<if test='sampleAql == "aql14"'>aql14</if>
<if test='sampleAql == "aql15"'>aql15</if>
<if test='sampleAql == "aql16"'>aql16</if>
<if test='sampleAql == "aql17"'>aql17</if>
<if test='sampleAql == "aql18"'>aql18</if>
<if test='sampleAql == "aql19"'>aql19</if>
<if test='sampleAql == "aql20"'>aql20</if>
<if test='sampleAql == "aql21"'>aql21</if>
<if test='sampleAql == "aql22"'>aql22</if>
<if test='sampleAql == "aql23"'>aql23</if>
<if test='sampleAql == "aql24"'>aql24</if>
<if test='sampleAql == "aql25"'>aql25</if>
<if test='sampleAql == "aql26"'>aql26</if>
from qc_sample_rule_aql
where del_flag='0' and sample_code like concat(#{sampleCode},'%')
</select>
<!--批量更新原始表-->
<update id="updateIncomeBatchList">

@ -142,6 +142,7 @@
<if test="noOkQuality != null">noOk_quality,</if>
<if test="sampleQuality != null">sample_quality,</if>
<if test="orderType != null">order_type,</if>
<if test="sampleCode != null">sample_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordId != null">#{recordId},</if>
@ -177,6 +178,7 @@
<if test="noOkQuality != null">#{noOkQuality},</if>
<if test="sampleQuality != null">#{sampleQuality},</if>
<if test="orderType != null">#{orderType},</if>
<if test="sampleCode != null">#{sampleCode},</if>
</trim>
</insert>

@ -285,7 +285,9 @@
judge ,
defect_level defectLevel,
item_type itemType,
judge_rate judgeRate
judge_rate judgeRate,
upper_diff upperDiff,
down_diff downDiff
from qc_check_project
where del_flag = '0'
<if test="projectType != null">and project_type = #{projectType}</if>

@ -103,11 +103,35 @@
</update>
<delete id="deleteQcProjectTypeById" parameterType="String">
delete from qc_project_type where id = #{id}
update qc_project_type set del_flag = '1' where id = #{id}
</delete>
<delete id="deleteQcProjectTypeByIds" parameterType="String">
delete from qc_project_type where id in
update qc_project_type set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteQcProjectTypeByCodes" parameterType="String">
update qc_project_type set del_flag = '1' where project_type_code in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteQcProjectByIds">
update p
set p.del_flag = '1'
from qc_check_project p
left join qc_project_type pt on pt.project_type_code = p.project_type
where pt.id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteQcProjectByCodes">
update p set p.del_flag = '1'
from qc_check_project p
where p.project_type in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>

@ -317,6 +317,7 @@ public class SapOrderServiceImpl implements SapOrderService {
//System.out.println("LT_HW_jCoTable"+LT_HW_jCoTable);
for (SapRFW.lt_hw lt_hw : sapRFW.getLt_hwList()) {
LT_HW_jCoTable.appendRow();
LT_HW_jCoTable.setValue("RSPOS", lt_hw.getRspos());
LT_HW_jCoTable.setValue("MATERIAL", lt_hw.getMaterial());
LT_HW_jCoTable.setValue("ENTRY_QNT", lt_hw.getEntry_qnt());
}

@ -699,7 +699,7 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
qcCheckTaskIncomeDTO.setSupplierCode("0000102272");
qcCheckTaskIncomeDTO.setFactoryCode("1000");
qcCheckTaskIncomeDTO.setSupplierName("广州市彩晴包装印刷有限公司");
qcCheckTaskIncomeDTO.setOrderType("bc");
qcCheckTaskIncomeDTO.setOrderType("8040");//包材固定码
qcCheckTaskIncomeDTO.setUnit("KG");
qcCheckTaskIncomeDTO.setQuality(new BigDecimal("10"));
qcCheckTaskIncomeDTO.setMaterialCode("000000020800001083");
@ -739,8 +739,6 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
QcCheckTaskIncomeDTO qcCheckTaskIncomeDTO = new QcCheckTaskIncomeDTO();
qcCheckTaskIncomeDTO.setCheckLoc("mjtest");
qcCheckTaskIncomeDTO.setCheckType("checkTypeLL");
// qcCheckTaskIncomeDTO.setCheckManCode("mobile");
// qcCheckTaskIncomeDTO.setCheckManName("手持测试用户");
qcCheckTaskIncomeDTO.setSupplierCode(order1.getSupplierCode());
String name = odsProcureOrderMapper.selectBaseSupplier(order1);
qcCheckTaskIncomeDTO.setSupplierName(name);

Loading…
Cancel
Save