新增白坯检验功能
parent
478e70ca22
commit
8ec2175fc4
@ -0,0 +1,43 @@
|
||||
package com.op.quality.controller;
|
||||
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.quality.domain.QcCheckBp;
|
||||
import com.op.quality.service.IQcCheckBpService;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* remark 白坯检验控制类
|
||||
*
|
||||
* @author 019117
|
||||
* @date
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/checkBp")
|
||||
public class QcCheckBpController {
|
||||
|
||||
@Resource
|
||||
private IQcCheckBpService qcCheckBpService;
|
||||
|
||||
/**
|
||||
* 获取需要检验的白坯列表
|
||||
* **/
|
||||
@GetMapping("/checkBpList")
|
||||
public List<QcCheckBp> getCheckBpList( QcCheckBp params ){
|
||||
return qcCheckBpService.getCheckBpList(params);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 提交检验结果
|
||||
* **/
|
||||
@PostMapping("/submitCheckResult")
|
||||
public AjaxResult submitCheckResult(@RequestBody QcCheckBp params){
|
||||
qcCheckBpService.submitCheckResult(params);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,145 @@
|
||||
package com.op.quality.domain;
|
||||
|
||||
import com.op.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* remark
|
||||
*
|
||||
* @author 019117
|
||||
* @date
|
||||
*/
|
||||
public class QcCheckBp extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
* **/
|
||||
private String materialCode;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
* **/
|
||||
private String materialName;
|
||||
|
||||
/**
|
||||
* checkDate
|
||||
* **/
|
||||
private String checkDate;
|
||||
|
||||
/**
|
||||
* 检查数量
|
||||
* **/
|
||||
private Integer checkNum;
|
||||
|
||||
/**
|
||||
* 不良数量
|
||||
* **/
|
||||
private Integer badNum;
|
||||
|
||||
/**
|
||||
* 是否合格
|
||||
* **/
|
||||
private String isQualified;
|
||||
|
||||
/**
|
||||
* 不合格原因
|
||||
* **/
|
||||
private String unqualifiedReason;
|
||||
|
||||
|
||||
/**
|
||||
* 不良项
|
||||
* **/
|
||||
private String badItem;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
* **/
|
||||
private String factoryCode;
|
||||
|
||||
/**
|
||||
* 创建人名称
|
||||
* **/
|
||||
private String createUserName;
|
||||
|
||||
|
||||
|
||||
public String getMaterialCode() {
|
||||
return materialCode;
|
||||
}
|
||||
|
||||
public void setMaterialCode(String materialCode) {
|
||||
this.materialCode = materialCode;
|
||||
}
|
||||
|
||||
public String getMaterialName() {
|
||||
return materialName;
|
||||
}
|
||||
|
||||
public void setMaterialName(String materialName) {
|
||||
this.materialName = materialName;
|
||||
}
|
||||
|
||||
public String getCheckDate() {
|
||||
return checkDate;
|
||||
}
|
||||
|
||||
public void setCheckDate(String checkDate) {
|
||||
this.checkDate = checkDate;
|
||||
}
|
||||
|
||||
public Integer getCheckNum() {
|
||||
return checkNum;
|
||||
}
|
||||
|
||||
public void setCheckNum(Integer checkNum) {
|
||||
this.checkNum = checkNum;
|
||||
}
|
||||
|
||||
public Integer getBadNum() {
|
||||
return badNum;
|
||||
}
|
||||
|
||||
public void setBadNum(Integer badNum) {
|
||||
this.badNum = badNum;
|
||||
}
|
||||
|
||||
public String getIsQualified() {
|
||||
return isQualified;
|
||||
}
|
||||
|
||||
public void setIsQualified(String isQualified) {
|
||||
this.isQualified = isQualified;
|
||||
}
|
||||
|
||||
public String getUnqualifiedReason() {
|
||||
return unqualifiedReason;
|
||||
}
|
||||
|
||||
public void setUnqualifiedReason(String unqualifiedReason) {
|
||||
this.unqualifiedReason = unqualifiedReason;
|
||||
}
|
||||
|
||||
public String getBadItem() {
|
||||
return badItem;
|
||||
}
|
||||
|
||||
public void setBadItem(String badItem) {
|
||||
this.badItem = badItem;
|
||||
}
|
||||
|
||||
public String getFactoryCode() {
|
||||
return factoryCode;
|
||||
}
|
||||
|
||||
public void setFactoryCode(String factoryCode) {
|
||||
this.factoryCode = factoryCode;
|
||||
}
|
||||
|
||||
public String getCreateUserName() {
|
||||
return createUserName;
|
||||
}
|
||||
|
||||
public void setCreateUserName(String createUserName) {
|
||||
this.createUserName = createUserName;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,241 @@
|
||||
package com.op.quality.domain;
|
||||
|
||||
import com.op.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* remark 留样复检发起oa流程
|
||||
*
|
||||
* @author 019117
|
||||
* @date
|
||||
*/
|
||||
public class QcCheckSampleTaskResult extends BaseEntity {
|
||||
|
||||
/**
|
||||
* id
|
||||
* **/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* sampleTaskId
|
||||
* **/
|
||||
private String sampleTaskId;
|
||||
|
||||
/**
|
||||
* 复检次数
|
||||
* **/
|
||||
private Integer checkTimes;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
* **/
|
||||
private Integer quantity;
|
||||
|
||||
/**
|
||||
* 是否合格
|
||||
* **/
|
||||
private String isQualified;
|
||||
|
||||
/**
|
||||
* 是否发起oa流程
|
||||
* **/
|
||||
private String isApplyOa;
|
||||
|
||||
/**
|
||||
* 申请部门
|
||||
* **/
|
||||
private String applyDept;
|
||||
|
||||
/**
|
||||
* 发现地点
|
||||
* **/
|
||||
private String findPlace;
|
||||
|
||||
/**
|
||||
* 是否供应商问题
|
||||
* */
|
||||
private String isSupplierIssue;
|
||||
|
||||
/**
|
||||
* 异常范围
|
||||
* **/
|
||||
private String excRange;
|
||||
|
||||
/**
|
||||
* 所属车间
|
||||
* **/
|
||||
private String workshop;
|
||||
|
||||
/**
|
||||
* 是否需要主管审核
|
||||
* **/
|
||||
private String isNeedAudit;
|
||||
|
||||
/**
|
||||
* QC主管
|
||||
* **/
|
||||
private String qcManager;
|
||||
|
||||
/**
|
||||
* 质量主管
|
||||
* **/
|
||||
private String qtManager;
|
||||
|
||||
/**
|
||||
* 不合格描述
|
||||
* **/
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* requestId
|
||||
* **/
|
||||
private String requestId;
|
||||
|
||||
/**
|
||||
* 创建人名称
|
||||
* **/
|
||||
private String createUserName;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSampleTaskId() {
|
||||
return sampleTaskId;
|
||||
}
|
||||
|
||||
public void setSampleTaskId(String sampleTaskId) {
|
||||
this.sampleTaskId = sampleTaskId;
|
||||
}
|
||||
|
||||
public Integer getCheckTimes() {
|
||||
return checkTimes;
|
||||
}
|
||||
|
||||
public void setCheckTimes(Integer checkTimes) {
|
||||
this.checkTimes = checkTimes;
|
||||
}
|
||||
|
||||
public String getQualified() {
|
||||
return isQualified;
|
||||
}
|
||||
|
||||
public void setQualified(String qualified) {
|
||||
isQualified = qualified;
|
||||
}
|
||||
|
||||
public String getIsApplyOa() {
|
||||
return isApplyOa;
|
||||
}
|
||||
|
||||
public void setIsApplyOa(String isApplyOa) {
|
||||
this.isApplyOa = isApplyOa;
|
||||
}
|
||||
|
||||
public String getApplyDept() {
|
||||
return applyDept;
|
||||
}
|
||||
|
||||
public void setApplyDept(String applyDept) {
|
||||
this.applyDept = applyDept;
|
||||
}
|
||||
|
||||
public String getFindPlace() {
|
||||
return findPlace;
|
||||
}
|
||||
|
||||
public void setFindPlace(String findPlace) {
|
||||
this.findPlace = findPlace;
|
||||
}
|
||||
|
||||
public String getExcRange() {
|
||||
return excRange;
|
||||
}
|
||||
|
||||
public void setExcRange(String excRange) {
|
||||
this.excRange = excRange;
|
||||
}
|
||||
|
||||
public String getWorkshop() {
|
||||
return workshop;
|
||||
}
|
||||
|
||||
public void setWorkshop(String workshop) {
|
||||
this.workshop = workshop;
|
||||
}
|
||||
|
||||
public String getQcManager() {
|
||||
return qcManager;
|
||||
}
|
||||
|
||||
public void setQcManager(String qcManager) {
|
||||
this.qcManager = qcManager;
|
||||
}
|
||||
|
||||
public String getQtManager() {
|
||||
return qtManager;
|
||||
}
|
||||
|
||||
public void setQtManager(String qtManager) {
|
||||
this.qtManager = qtManager;
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public String getRequestId() {
|
||||
return requestId;
|
||||
}
|
||||
|
||||
public void setRequestId(String requestId) {
|
||||
this.requestId = requestId;
|
||||
}
|
||||
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public String getIsQualified() {
|
||||
return isQualified;
|
||||
}
|
||||
|
||||
public void setIsQualified(String isQualified) {
|
||||
this.isQualified = isQualified;
|
||||
}
|
||||
|
||||
public String getIsSupplierIssue() {
|
||||
return isSupplierIssue;
|
||||
}
|
||||
|
||||
public void setIsSupplierIssue(String isSupplierIssue) {
|
||||
this.isSupplierIssue = isSupplierIssue;
|
||||
}
|
||||
|
||||
public String getIsNeedAudit() {
|
||||
return isNeedAudit;
|
||||
}
|
||||
|
||||
public void setIsNeedAudit(String isNeedAudit) {
|
||||
this.isNeedAudit = isNeedAudit;
|
||||
}
|
||||
|
||||
public String getCreateUserName() {
|
||||
return createUserName;
|
||||
}
|
||||
|
||||
public void setCreateUserName(String createUserName) {
|
||||
this.createUserName = createUserName;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.op.quality.mapper;
|
||||
|
||||
import com.op.quality.domain.QcCheckBp;
|
||||
import com.op.quality.domain.QcCheckTaskIncome;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* remark
|
||||
*
|
||||
* @author 019117
|
||||
* @date
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
public interface QcCheckBpMapper {
|
||||
|
||||
List<QcCheckBp> getCheckBpList(QcCheckBp params );
|
||||
|
||||
void insertCheckBpResult( QcCheckTaskIncome task );
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.op.quality.service;
|
||||
|
||||
import com.op.quality.domain.QcCheckBp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* remark
|
||||
*
|
||||
* @author 019117
|
||||
* @date
|
||||
*/
|
||||
public interface IQcCheckBpService {
|
||||
|
||||
List<QcCheckBp> getCheckBpList( QcCheckBp params );
|
||||
|
||||
void submitCheckResult( QcCheckBp params );
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
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.quality.domain.QcCheckBp;
|
||||
import com.op.quality.domain.QcCheckTaskIncome;
|
||||
import com.op.quality.domain.QcCheckTaskProduce;
|
||||
import com.op.quality.mapper.QcCheckBpMapper;
|
||||
import com.op.quality.mapper.QcCheckTaskIncomeMapper;
|
||||
import com.op.quality.mapper.QcCheckTaskProduceMapper;
|
||||
import com.op.quality.service.IQcCheckBpService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* remark
|
||||
*
|
||||
* @author 019117
|
||||
* @date
|
||||
*/
|
||||
@Service
|
||||
public class QcCheckBpServiceImpl implements IQcCheckBpService {
|
||||
|
||||
@Resource
|
||||
private QcCheckBpMapper qcCheckBpMapper;
|
||||
|
||||
@Resource
|
||||
private QcCheckTaskIncomeMapper qcCheckTaskIncomeMapper;
|
||||
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<QcCheckBp> getCheckBpList(QcCheckBp params) {
|
||||
return qcCheckBpMapper.getCheckBpList(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public void submitCheckResult(QcCheckBp params) {
|
||||
QcCheckTaskIncome task = new QcCheckTaskIncome();
|
||||
String prefixNoStr = DateUtils.parseDateToStr(DateUtils.YYYYMMDD, DateUtils.getNowDate());
|
||||
String suffixNoStr = String.format("%04d", qcCheckTaskIncomeMapper.getTodayMaxNum(task));
|
||||
|
||||
task.setRecordId(IdUtils.fastSimpleUUID());
|
||||
task.setCheckNo(prefixNoStr + suffixNoStr);
|
||||
task.setMaterialCode(params.getMaterialCode());
|
||||
task.setMaterialName(params.getMaterialName());
|
||||
task.setIncomeTime(new Date());
|
||||
task.setCheckStatus("2");
|
||||
task.setCheckManCode(params.getCreateBy());
|
||||
task.setCheckManName(params.getCreateUserName());
|
||||
task.setCheckTime(new Date());
|
||||
task.setCheckResult(params.getIsQualified());
|
||||
task.setStatus("0");
|
||||
task.setCreateTime(new Date());
|
||||
task.setFactoryCode(params.getFactoryCode());
|
||||
task.setCheckType("checkTypeLL");
|
||||
task.setNoOkQuality(new BigDecimal(params.getBadNum()));
|
||||
task.setSampleQuality(new BigDecimal(params.getCheckNum()));
|
||||
task.setTypeCode("material");
|
||||
task.setOrderType("bp");
|
||||
task.setRemark(params.getRemark());
|
||||
task.setRemarkCode(params.getBadItem());
|
||||
qcCheckBpMapper.insertCheckBpResult(task);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.op.quality.mapper.QcCheckBpMapper">
|
||||
|
||||
<select id="getCheckBpList" parameterType="com.op.quality.domain.QcCheckBp" resultType="com.op.quality.domain.QcCheckBp">
|
||||
SELECT
|
||||
mpd.material_code materialCode,
|
||||
mpd.material_name materialName
|
||||
FROM pro_order_workorder ow
|
||||
LEFT JOIN mes_prepare mp ON ow.workorder_code = mp.workorder_code
|
||||
LEFT JOIN mes_prepare_detail mpd ON mp.prepare_id = mpd.prepare_id
|
||||
WHERE ow.product_date = #{checkDate} AND mpd.material_name LIKE '%白坯%'
|
||||
AND mpd.recoil = 'X' AND mp.del_flag = '0' AND mpd.del_flag = '0'
|
||||
AND ow.del_flag = '0'
|
||||
GROUP BY
|
||||
mpd.material_code,
|
||||
mpd.material_name
|
||||
</select>
|
||||
|
||||
<insert id="insertCheckBpResult" parameterType="com.op.quality.domain.QcCheckTaskIncome">
|
||||
insert into qc_check_task
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="recordId != null">record_id,</if>
|
||||
<if test="checkNo != null">check_no,</if>
|
||||
<if test="incomeBatchNo != null">income_batch_no,</if>
|
||||
<if test="orderNo != null">order_no,</if>
|
||||
<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>
|
||||
<if test="incomeTime != null">income_time,</if>
|
||||
<if test="checkLoc != null">check_loc,</if>
|
||||
<if test="checkStatus != null">check_status,</if>
|
||||
<if test="checkManCode != null">check_man_code,</if>
|
||||
<if test="checkManName != null">check_man_name,</if>
|
||||
<if test="checkTime != null">check_time,</if>
|
||||
<if test="checkResult != null">check_result,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="checkType != null">check_type,</if>
|
||||
<if test="typeCode != null">type_code,</if>
|
||||
<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>
|
||||
<if test="remarkCode != null">remark_code,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="recordId != null">#{recordId},</if>
|
||||
<if test="checkNo != null">#{checkNo},</if>
|
||||
<if test="incomeBatchNo != null">#{incomeBatchNo},</if>
|
||||
<if test="orderNo != null">#{orderNo},</if>
|
||||
<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>
|
||||
<if test="incomeTime != null">#{incomeTime},</if>
|
||||
<if test="checkLoc != null">#{checkLoc},</if>
|
||||
<if test="checkStatus != null">#{checkStatus},</if>
|
||||
<if test="checkManCode != null">#{checkManCode},</if>
|
||||
<if test="checkManName != null">#{checkManName},</if>
|
||||
<if test="checkTime != null">#{checkTime},</if>
|
||||
<if test="checkResult != null">#{checkResult},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="checkType != null">#{checkType},</if>
|
||||
<if test="typeCode != null">#{typeCode},</if>
|
||||
<if test="sampleQuality != null">#{sampleQuality},</if>
|
||||
<if test="orderType != null">#{orderType},</if>
|
||||
<if test="orderTypeDesc != null">#{orderTypeDesc},</if>
|
||||
<if test="sampleCode != null">#{sampleCode},</if>
|
||||
<if test="remarkCode != null">#{remarkCode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue