质量看板接口修改3

master
zhaoxiaolin 1 year ago
parent b27e18f403
commit 3671723f7e

@ -128,6 +128,10 @@ public class QcCheckTaskProduceDTO extends BaseEntity {
private String checkTimeEnd;
private String typeCode;
private String checkType;
private String carName;
private String carCode;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date produceDate;
@Excel(name = "抽样数量")
private BigDecimal sampleQuality;
@ -144,6 +148,30 @@ public class QcCheckTaskProduceDTO extends BaseEntity {
@Excel(name = "C类不合格数量")
private BigDecimal cNoOkquality;
public Date getProduceDate() {
return produceDate;
}
public void setProduceDate(Date produceDate) {
this.produceDate = produceDate;
}
public String getCarName() {
return carName;
}
public void setCarName(String carName) {
this.carName = carName;
}
public String getCarCode() {
return carCode;
}
public void setCarCode(String carCode) {
this.carCode = carCode;
}
public BigDecimal getaNoOkquality() {
return aNoOkquality;
}

@ -0,0 +1,258 @@
package com.op.system.api.domain.quality;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.List;
/**
* qc_user_material
*
* @author Open Platform
* @date 2023-10-09
*/
public class QcUserMaterialDTO extends BaseEntity {
private static final long serialVersionUID = 1L;
/** id */
private String id;
/** 员工编码 */
@Excel(name = "员工编码")
private String userCode;
/** 员工名称 */
@Excel(name = "员工名称")
private String userName;
/** 物料编码 */
@Excel(name = "物料编码")
private String materialCode;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
private String attr3;
/** 预留字段4 */
@Excel(name = "预留字段4")
private String attr4;
/** 工厂编码 */
@Excel(name = "工厂编码")
private String factoryCode;
/** 删除标识1删除0正常 */
private String delFlag;
/** 编号 */
private String userId;
/** 手机号 */
private String phonenumber;
private String email;
private String materialNames;
/** 状态 */
private String status;
private String materialId;
private String[] userCodes;
private String label;
private String key;
private List<String> selectedValues;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setUserCode(String userCode) {
this.userCode = userCode;
}
public String getUserCode() {
return userCode;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserName() {
return userName;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getMaterialName() {
return materialName;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
public String getAttr4() {
return attr4;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getPhonenumber() {
return phonenumber;
}
public void setPhonenumber(String phonenumber) {
this.phonenumber = phonenumber;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getMaterialNames() {
return materialNames;
}
public void setMaterialNames(String materialNames) {
this.materialNames = materialNames;
}
public String getMaterialId() {
return materialId;
}
public void setMaterialId(String materialId) {
this.materialId = materialId;
}
public String[] getUserCodes() {
return userCodes;
}
public void setUserCodes(String[] userCodes) {
this.userCodes = userCodes;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public List<String> getSelectedValues() {
return selectedValues;
}
public void setSelectedValues(List<String> selectedValues) {
this.selectedValues = selectedValues;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("userCode", getUserCode())
.append("userName", getUserName())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("userId", getUserId())
.append("phonenumber", getPhonenumber())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("factoryCode", getFactoryCode())
.append("delFlag", getDelFlag())
.toString();
}
}

@ -83,7 +83,7 @@ public class OpenController extends BaseController {
}
/**创建生产过程(烘房 首检)检验*/
@PostMapping(value = "createCheckProduceTask")
@PostMapping(value = "/createCheckProduceTask")
public AjaxResult createCheckProduceTask(@RequestBody QcCheckTaskProduceDTO qcCheckTaskProduce) {
if(StringUtils.isBlank(qcCheckTaskProduce.getIncomeBatchNo())){
return error("[IncomeBatchNo]不能为空");

@ -7,10 +7,7 @@ import com.op.system.api.domain.mes.MesReportWorkConsumeDTO;
import com.op.system.api.domain.mes.MesReportWorkDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
import com.op.system.api.domain.mes.ProRfidProcessDetail;
import com.op.system.api.domain.quality.QcCheckTaskDetailDTO;
import com.op.system.api.domain.quality.QcCheckTaskProduceDTO;
import com.op.system.api.domain.quality.QcCheckTypeProjectDTO;
import com.op.system.api.domain.quality.QcMaterialGroupDetailDTO;
import com.op.system.api.domain.quality.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -78,5 +75,7 @@ public interface OpenMapper {
void insertQcCheckTaskProduce(QcCheckTaskProduceDTO qcCheckTaskProduce);
public int addBatch(@Param("list") List<QcCheckTaskDetailDTO> items);
QcUserMaterialDTO getUserByMaterial(String materialCode);
}

@ -23,10 +23,7 @@ import com.op.system.api.domain.mes.MesReportWorkConsumeDTO;
import com.op.system.api.domain.mes.MesReportWorkDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
import com.op.system.api.domain.mes.ProRfidProcessDetail;
import com.op.system.api.domain.quality.QcCheckTaskDetailDTO;
import com.op.system.api.domain.quality.QcCheckTaskProduceDTO;
import com.op.system.api.domain.quality.QcCheckTypeProjectDTO;
import com.op.system.api.domain.quality.QcMaterialGroupDetailDTO;
import com.op.system.api.domain.quality.*;
import com.op.system.api.domain.sap.SapCloseOrderQuery;
import com.op.system.api.domain.sap.SapRFW;
import org.apache.commons.lang.StringUtils;
@ -305,6 +302,17 @@ public class OpenServiceImpl implements OpenService {
QcCheckTypeProjectDTO qctp= new QcCheckTypeProjectDTO();
qctp.setTypeId(qcCheckTaskProduce.getCheckType());//生产过程检验
qctp.setMaterialCode(qcCheckTaskProduce.getMaterialCode());//特性
/**qc_user_material取默认检查人**/
QcUserMaterialDTO qcUserMaterialDTO = openMapper.getUserByMaterial(qcCheckTaskProduce.getMaterialCode());
if(qcUserMaterialDTO == null){
qcCheckTaskProduce.setCheckManCode("mobile");
qcCheckTaskProduce.setCheckManName("手持测试用户");
}else{
qcCheckTaskProduce.setCheckManCode(qcUserMaterialDTO.getUserCode());
qcCheckTaskProduce.setCheckManName(qcUserMaterialDTO.getUserName());
}
/**qc_check_type_project**/
List<QcCheckTaskDetailDTO> items = openMapper.getTPByTypeMaterial(qctp);
if(CollectionUtils.isEmpty(items)){
@ -328,6 +336,9 @@ public class OpenServiceImpl implements OpenService {
qcCheckTaskProduce.setFactoryCode(factoryCode);
qcCheckTaskProduce.setCreateTime(nowDate);
qcCheckTaskProduce.setTypeCode("produce");//大检验节点
qcCheckTaskProduce.setIncomeTime(qcCheckTaskProduce.getProduceDate());
qcCheckTaskProduce.setSupplierCode(qcCheckTaskProduce.getCarCode());
qcCheckTaskProduce.setSupplierName(qcCheckTaskProduce.getCarName());
openMapper.insertQcCheckTaskProduce(qcCheckTaskProduce);
/**qc_check_task_detail**/
for(QcCheckTaskDetailDTO item:items){

@ -195,6 +195,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and qctp.type_id = #{typeId}
order by qctp.sort
</select>
<select id="getUserByMaterial" resultType="com.op.system.api.domain.quality.QcUserMaterialDTO">
select top 1 user_code userCode,
user_name userName
from qc_user_material where material_code = #{materialCode}
order by create_time desc
</select>
<insert id="insertEquRepairOrder" parameterType="DeviceRepairOrder">
insert into equ_repair_order

@ -45,6 +45,15 @@ public class QcCheckType extends BaseEntity {
private String delFlag;
private int taskNum;
private String checkManCode;
public String getCheckManCode() {
return checkManCode;
}
public void setCheckManCode(String checkManCode) {
this.checkManCode = checkManCode;
}
public int getTaskNum() {
return taskNum;

@ -2,6 +2,7 @@ package com.op.quality.service.impl;
import java.util.List;
import com.alibaba.nacos.common.utils.CollectionUtils;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.DateUtils;
@ -123,7 +124,8 @@ public class QcCheckTypeServiceImpl implements IQcCheckTypeService {
@Override
public List<QcCheckType> getTopTaskInfo(QcCheckType qcCheckType) {
DynamicDataSourceContextHolder.push(qcCheckType.getFactoryCode());// 这是数据源的key
return qcCheckTypeMapper.getTopTaskInfo(qcCheckType);
List<QcCheckType> dtos = qcCheckTypeMapper.getTopTaskInfo(qcCheckType);//检验任务
return dtos;
}
}

@ -1,5 +1,7 @@
package com.op.quality.service.impl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@ -73,6 +75,10 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
@Override
@DS("#header.poolName")
public int insertQcUserMaterial(QcUserMaterial qcUserMaterial) {
List<String> userCodes = new ArrayList<>();
userCodes.add(qcUserMaterial.getUserCode());
qcUserMaterial.setUserCodes(userCodes.toArray(new String[userCodes.size()]));
Date now = DateUtils.getNowDate();
if (StringUtils.isNotEmpty(qcUserMaterial.getUserCodes())) {
//删除之前的关联关系

@ -47,21 +47,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
count(0) taskNum,
'检验任务' attr1
from qc_check_task qct
left join qc_check_type qc on qct.check_type = qc.order_code
where qct.check_status = '0'
left join qc_check_type qc on qct.check_type = qc.order_code
left join qc_user_material qum on qum.material_code = qct.material_code
where qct.check_status = '0' and qum.user_code = #{checkManCode}
group by qct.check_type,qc.check_name
union ALL
select qcu.type,
qc.check_name,
count(0) taskNum,
'不合格处理'
union all
select '','',
count(0) taskNum,
'不合格处理' attr1
from qc_check_unqualified qcu
left join qc_check_type qc on qcu.type = qc.order_code
where qcu.status != '2'
group by qcu.type,qc.check_name
left join qc_check_task qct on qcu.task_id = qct.record_id
left join qc_user_material qum on qum.material_code = qct.material_code
where qcu.status != '2' and qum.user_code = #{checkManCode}
</select>
<insert id="insertQcCheckType" parameterType="QcCheckType">
insert into qc_check_type
<trim prefix="(" suffix=")" suffixOverrides=",">

@ -66,6 +66,11 @@ 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="aNoOkquality" column="aNoOkquality" />
<result property="bNoOkquality" column="bNoOkquality" />
<result property="cNoOkquality" column="cNoOkquality" />
<result property="sampleQuality" column="sample_quality" />
</resultMap>
<sql id="selectQuaVo">
select id,rfid,factory_id,factory_code,order_id,machine_id,bad_meg,product_id,isqua,file_id,attr1,attr2,
@ -248,7 +253,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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.check_type
qct.status,qct.create_by,qct.create_time,qct.check_type,
qct.noOk_quality,qct.aNoOkquality,qct.bNoOkquality,qct.cNoOkquality,qct.sample_quality
from qc_check_task qct
<where>
and qct.del_flag = '0'

@ -81,10 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and bp.product_code not in (
select um.material_code
from qc_user_material um
where um.user_code in
<foreach item="userCode" collection="userCodes" open="(" separator="," close=")">
#{userCode}
</foreach>
where um.user_code =#{userCode}
)
<if test="materialName != null and materialName != ''"> and bp.product_desc_zh like concat('%', #{materialName}, '%')</if>
</select>
@ -94,10 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
concat(bp.product_desc_zh,'(',bp.product_code,')') label
from qc_user_material um
left join base_product bp on um.material_code = bp.product_code
where um.user_code in
<foreach item="userCode" collection="userCodes" open="(" separator="," close=")">
#{userCode}
</foreach>
where um.user_code = #{userCode}
<if test="materialName != null and materialName != ''"> and bp.product_desc_zh like concat('%', #{materialName}, '%')</if>
</select>

Loading…
Cancel
Save