质量统计

highway
zhaoxiaolin 1 year ago
parent 4c02aa5b2e
commit 60270136f7

@ -2,6 +2,7 @@ package com.op.device.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
@ -73,6 +74,10 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
@Autowired
private EquOutsourceWorkMapper equOutsourceWorkMapper;
@Autowired
private EquSpareApplyMapper equSpareApplyMapper;
@Autowired
private SparePartsLedgerMapper sparePartsLedgerMapper;
/**
*
* **/
@ -245,6 +250,7 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
private int createOrderPlan(EquPlan plan){
Date nowtime = DateUtils.getNowDate();
String createBy = "job";
String factory = plan.getFactoryCode();
int sce = 0;
/**equ_plan->equ_order********************************************************************/
EquOrder order = new EquOrder();
@ -264,20 +270,39 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
/**equ_order**/
sce = equOrderMapper.insertEquOrder(order);
System.out.println(plan.getPlanCode()+"========equ_order:"+sce);
/**equ_plan_equ_spare->equ_order_equ_spare*************************************************************/
/**equ_plan_equ_spare->equ_spare_apply*************************************************************/
EquPlanEquSpare equPlanEquSpare = new EquPlanEquSpare();
equPlanEquSpare.setParentCode(plan.getPlanEquId());
List<EquPlanEquSpare> spares = equPlanEquSpareMapper.selectEquPlanEquSpareList(equPlanEquSpare);
for(EquPlanEquSpare spare:spares){
spare.setId(IdUtils.fastSimpleUUID());
spare.setCreateTime(nowtime);
spare.setCreateBy(createBy);
spare.setDelFlag("0");
spare.setCode(orderCode);
// 获取流水单号
int applySerialNum = equSpareApplyMapper.selectSerialNumber();
for (EquPlanEquSpare spare : spares) {
EquSpareApply apply = new EquSpareApply();
apply.setApplyId(IdUtils.fastSimpleUUID());
apply.setApplyCode("A"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD)+String.format("%03d",applySerialNum));
applySerialNum++;
apply.setSpareCode(spare.getMaterialCode());
apply.setSpareName(spare.getMaterialDesc());
apply.setSpareModel(spare.getSpareType());
apply.setSpareQuantity(spare.getApplyNum());
apply.setFactoryCode(factory);
apply.setApplyPeople("job");
apply.setParentCode(orderCode);
apply.setCreateBy("job");
apply.setCreateTime(nowtime);
apply.setSpareUseEquipment(plan.getEquipmentCode());
apply.setApplyTime(nowtime);
// 插入备件信息
equSpareApplyMapper.insertEquSpareApply(apply);
// TODO 减少备件仓库中备件数量
sparePartsLedgerMapper.updateSpareNumReduce(apply);
}
if(!CollectionUtils.isEmpty(spares)){
sce = equOrderEquSpareMapper.insertEquOrderEquSpares(spares);
System.out.println(plan.getPlanCode()+"========equ_order_equ_spare:"+sce);
System.out.println(plan.getPlanCode()+"========equ_spare_apply:"+sce);
}
/**equ_plan_detail->equ_order_detail*******************************************************/

@ -44,6 +44,9 @@ public class QcCheckTaskIncome extends BaseEntity {
@Excel(name = "收货数量")
private BigDecimal quality;
@Excel(name = "不合格数量")
private BigDecimal noOkQuality;
/** 单位 */
@Excel(name = "单位")
private String unit;
@ -120,6 +123,14 @@ public class QcCheckTaskIncome extends BaseEntity {
private String typeCode;
private String checkType;
public BigDecimal getNoOkQuality() {
return noOkQuality;
}
public void setNoOkQuality(BigDecimal noOkQuality) {
this.noOkQuality = noOkQuality;
}
public String getCheckType() {
return checkType;
}

@ -128,6 +128,61 @@ public class QcCheckTaskProduce extends BaseEntity {
private String typeCode;
private String checkType;
@Excel(name = "抽样数量")
private BigDecimal sampleQuality;
@Excel(name = "不合格数量")
private BigDecimal noOkQuality;
@Excel(name = "A类不合格数量")
private BigDecimal aNoOkquality;
@Excel(name = "B类不合格数量")
private BigDecimal bNoOkquality;
@Excel(name = "C类不合格数量")
private BigDecimal cNoOkquality;
public BigDecimal getaNoOkquality() {
return aNoOkquality;
}
public void setaNoOkquality(BigDecimal aNoOkquality) {
this.aNoOkquality = aNoOkquality;
}
public BigDecimal getbNoOkquality() {
return bNoOkquality;
}
public void setbNoOkquality(BigDecimal bNoOkquality) {
this.bNoOkquality = bNoOkquality;
}
public BigDecimal getcNoOkquality() {
return cNoOkquality;
}
public void setcNoOkquality(BigDecimal cNoOkquality) {
this.cNoOkquality = cNoOkquality;
}
public BigDecimal getSampleQuality() {
return sampleQuality;
}
public void setSampleQuality(BigDecimal sampleQuality) {
this.sampleQuality = sampleQuality;
}
public BigDecimal getNoOkQuality() {
return noOkQuality;
}
public void setNoOkQuality(BigDecimal noOkQuality) {
this.noOkQuality = noOkQuality;
}
public String getTypeCode() {
return typeCode;
}

@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="quality" column="quality" />
<result property="noOkQuality" column="noOk_quality" />
<result property="unit" column="unit" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
@ -40,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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, check_time, check_result, status, attr1, attr2, attr3, attr4, create_by,
create_time, update_by, update_time, factory_code, del_flag , check_type
create_time, update_by, update_time, factory_code, del_flag , check_type,noOk_quality
from qc_check_task
</sql>
@ -49,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qct.order_no, qct.material_code, qct.material_name, qct.quality, qct.unit,
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.create_by,qct.create_time, qct.update_by, qct.update_time,qct.check_type,qct.noOk_quality,
q.type_code
from qc_check_task qct
left join qc_check_type q on q.id = qct.check_type
@ -148,6 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="quality != null">quality,</if>
<if test="noOkQuality != null">noOk_quality,</if>
<if test="unit != null">unit,</if>
<if test="supplierCode != null">supplier_code,</if>
<if test="supplierName != null">supplier_name,</if>
@ -179,6 +181,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="quality != null">#{quality},</if>
<if test="noOkQuality != null">#{noOkQuality},</if>
<if test="unit != null">#{unit},</if>
<if test="supplierCode != null">#{supplierCode},</if>
<if test="supplierName != null">#{supplierName},</if>
@ -213,6 +216,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="quality != null">quality = #{quality},</if>
<if test="noOkQuality != null">noOk_quality = #{noOkQuality},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="supplierCode != null">supplier_code = #{supplierCode},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if>

@ -12,6 +12,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="quality" column="quality" />
<result property="sampleQuality" column="sample_quality" />
<result property="noOkQuality" column="noOk_quality" />
<result property="unit" column="unit" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
@ -41,7 +43,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
quality, unit, supplier_code, supplier_name, income_time, check_loc, check_status,
check_man_code, check_man_name, check_time, check_result, status, attr1,
attr2, attr3, attr4, create_by, create_time, update_by, update_time,
factory_code, del_flag , check_type
factory_code, del_flag , check_type,sample_quality,noOk_quality,
aNoOkquality,bNoOkquality,cNoOkquality
from qc_check_task
</sql>
@ -50,7 +53,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qct.order_no, qct.material_code, qct.material_name, qct.quality, qct.unit,
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.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
from qc_check_task qct
left join qc_check_type q on q.id = qct.check_type
@ -113,6 +118,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="quality != null">quality,</if>
<if test="sampleQuality != null">sample_quality,</if>
<if test="noOkQuality != null">noOk_quality,</if>
<if test="aNoOkquality != null">aNoOkquality,</if>
<if test="bNoOkquality != null">bNoOkquality,</if>
<if test="cNoOkquality != null">cNoOkquality,</if>
<if test="unit != null">unit,</if>
<if test="supplierCode != null">supplier_code,</if>
<if test="supplierName != null">supplier_name,</if>
@ -144,6 +154,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="quality != null">#{quality},</if>
<if test="sampleQuality != null">#{sampleQuality},</if>
<if test="noOkQuality != null">#{noOkQuality},</if>
<if test="aNoOkquality != null">#{aNoOkquality},</if>
<if test="bNoOkquality != null">#{bNoOkquality},</if>
<if test="cNoOkquality != null">#{cNoOkquality},</if>
<if test="unit != null">#{unit},</if>
<if test="supplierCode != null">#{supplierCode},</if>
<if test="supplierName != null">#{supplierName},</if>
@ -178,6 +193,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="quality != null">quality = #{quality},</if>
<if test="sampleQuality != null">sample_quality = #{sampleQuality},</if>
<if test="noOkQuality != null">noOk_quality = #{noOkQuality},</if>
<if test="aNoOkquality != null">aNoOkquality = #{aNoOkquality},</if>
<if test="bNoOkquality != null"> bNoOkquality = #{bNoOkquality},</if>
<if test="cNoOkquality != null">cNoOkquality = #{cNoOkquality},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="supplierCode != null">supplier_code = #{supplierCode},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if>

Loading…
Cancel
Save