入库过程检验

highway
zhaoxiaolin 1 year ago
parent 7c6d5a1b4f
commit ac16a5d785

@ -89,10 +89,10 @@ public class QcCheckTaskIncomeController extends BaseController {
qcCheckTaskIncome.setIncomeTimeEnd(dateEndStr);//end
}
if(StringUtils.isEmpty(qcCheckTaskIncome.getCheckTimeStart())){
qcCheckTaskIncome.setCheckTimeStart(qcCheckTaskIncome.getIncomeTimeStart());//start
qcCheckTaskIncome.setCheckTimeEnd(qcCheckTaskIncome.getIncomeTimeStart());//end
}
// if(StringUtils.isEmpty(qcCheckTaskIncome.getCheckTimeStart())){
// qcCheckTaskIncome.setCheckTimeStart(qcCheckTaskIncome.getIncomeTimeStart());//start
// qcCheckTaskIncome.setCheckTimeEnd(qcCheckTaskIncome.getIncomeTimeStart());//end
// }
List<QcCheckTaskIncome> list = qcCheckTaskIncomeService.selectQcCheckTaskIncomeList(qcCheckTaskIncome);
ExcelUtil<QcCheckTaskIncome> util = new ExcelUtil<QcCheckTaskIncome>(QcCheckTaskIncome.class);

@ -6,6 +6,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.common.core.utils.DateUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcSupplier;
import org.apache.commons.lang.StringUtils;
@ -85,10 +86,10 @@ public class QcCheckTaskProduceController extends BaseController {
qcCheckTaskProduce.setProduceDateEnd(dateEndStr);//end
}
if(StringUtils.isEmpty(qcCheckTaskProduce.getCheckTimeStart())){
qcCheckTaskProduce.setCheckTimeStart(qcCheckTaskProduce.getProduceDateStart());//start
qcCheckTaskProduce.setCheckTimeEnd(qcCheckTaskProduce.getProduceDateEnd());//end
}
// if(StringUtils.isEmpty(qcCheckTaskProduce.getCheckTimeStart())){
// qcCheckTaskProduce.setCheckTimeStart(qcCheckTaskProduce.getProduceDateStart());//start
// qcCheckTaskProduce.setCheckTimeEnd(qcCheckTaskProduce.getProduceDateEnd());//end
// }
List<QcCheckTaskProduce> list = qcCheckTaskProduceService.selectQcCheckTaskProduceList(qcCheckTaskProduce);
ExcelUtil<QcCheckTaskProduce> util = new ExcelUtil<QcCheckTaskProduce>(QcCheckTaskProduce.class);
@ -139,7 +140,7 @@ public class QcCheckTaskProduceController extends BaseController {
}
/**
*
*
*/
@GetMapping("/getQcListWorkCenter")
public TableDataInfo getQcListWorkCenter(QcCheckTaskProduce qcCheckTaskProduce) {
@ -147,9 +148,16 @@ public class QcCheckTaskProduceController extends BaseController {
List<QcCheckTaskProduce> list = qcCheckTaskProduceService.getQcListWorkCenter(qcCheckTaskProduce);
return getDataTable(list);
}
@GetMapping("/getCheckTypes")
public List<QcCheckType> getCheckTypes(QcCheckType qcCheckType) {
@PutMapping("/getCheckTypes")
public List<QcCheckType> getCheckTypes(@RequestBody QcCheckType qcCheckType) {
return qcCheckTaskProduceService.getCheckTypes(qcCheckType);
}
/**
*
*/
@PutMapping("/changeProduceStatus")
public AjaxResult changeProduceStatus(@RequestBody QcCheckTaskProduce qcCheckTaskProduce) {
return toAjax(qcCheckTaskProduceService.changeProduceStatus(qcCheckTaskProduce));
}
}

@ -1,7 +1,13 @@
package com.op.quality.controller;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.common.core.utils.DateUtils;
import com.op.quality.domain.QcCheckTaskProduce;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -40,6 +46,15 @@ public class QcCheckTaskWarehousingController extends BaseController {
@GetMapping("/list")
public TableDataInfo list(QcCheckTaskWarehousing qcCheckTaskWarehousing) {
startPage();
//默认时间范围T 00:00:00~T+1 00:00:00
if(StringUtils.isEmpty(qcCheckTaskWarehousing.getIncomeTimeStart())){
qcCheckTaskWarehousing.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";
qcCheckTaskWarehousing.setIncomeTimeEnd(dateEndStr);//end
}
List<QcCheckTaskWarehousing> list = qcCheckTaskWarehousingService.selectQcCheckTaskWarehousingList(qcCheckTaskWarehousing);
return getDataTable(list);
}
@ -51,6 +66,15 @@ public class QcCheckTaskWarehousingController extends BaseController {
@Log(title = "成品入库检验任务", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, QcCheckTaskWarehousing qcCheckTaskWarehousing) {
//默认时间范围T 00:00:00~T+1 00:00:00
if(StringUtils.isEmpty(qcCheckTaskWarehousing.getIncomeTimeStart())){
qcCheckTaskWarehousing.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";
qcCheckTaskWarehousing.setIncomeTimeEnd(dateEndStr);//end
}
List<QcCheckTaskWarehousing> list = qcCheckTaskWarehousingService.selectQcCheckTaskWarehousingList(qcCheckTaskWarehousing);
ExcelUtil<QcCheckTaskWarehousing> util = new ExcelUtil<QcCheckTaskWarehousing>(QcCheckTaskWarehousing.class);
util.exportExcel(response, list, "成品入库检验任务数据");
@ -72,7 +96,11 @@ public class QcCheckTaskWarehousingController extends BaseController {
@Log(title = "成品入库检验任务", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody QcCheckTaskWarehousing qcCheckTaskWarehousing) {
return toAjax(qcCheckTaskWarehousingService.insertQcCheckTaskWarehousing(qcCheckTaskWarehousing));
int r = qcCheckTaskWarehousingService.insertQcCheckTaskWarehousing(qcCheckTaskWarehousing);
if(r>0){
return toAjax(r);
}
return error("添加失败:请检查物料的关联检测项");
}
/**
@ -94,4 +122,14 @@ public class QcCheckTaskWarehousingController extends BaseController {
public AjaxResult remove(@PathVariable String[] recordIds) {
return toAjax(qcCheckTaskWarehousingService.deleteQcCheckTaskWarehousingByRecordIds(recordIds));
}
/**
*
*/
@GetMapping("/getQcListLoc")
public TableDataInfo getQcListLoc(QcCheckTaskWarehousing qcCheckTaskWarehousing) {
startPage();
List<QcCheckTaskWarehousing> list = qcCheckTaskWarehousingService.getQcListLoc(qcCheckTaskWarehousing);
return getDataTable(list);
}
}

@ -93,6 +93,15 @@ public class QcCheckTaskDetail extends BaseEntity {
private BigDecimal sample;
private Integer sampleNum;
private List<String> actualValues;
private String typeProjectId;
public String getTypeProjectId() {
return typeProjectId;
}
public void setTypeProjectId(String typeProjectId) {
this.typeProjectId = typeProjectId;
}
public List<String> getActualValues() {
return actualValues;

@ -117,6 +117,24 @@ public class QcCheckTaskIncome extends BaseEntity {
private String incomeTimeEnd;
private String checkTimeStart;
private String checkTimeEnd;
private String typeCode;
private String checkType;
public String getCheckType() {
return checkType;
}
public void setCheckType(String checkType) {
this.checkType = checkType;
}
public String getTypeCode() {
return typeCode;
}
public void setTypeCode(String typeCode) {
this.typeCode = typeCode;
}
public String getIncomeTimeStart() {
return incomeTimeStart;

@ -10,7 +10,7 @@ import com.op.common.core.web.domain.BaseEntity;
/**
* qc_check_task_warehousing
*
*
* @author Open Platform
* @date 2023-10-19
*/
@ -48,17 +48,17 @@ public class QcCheckTaskWarehousing extends BaseEntity {
@Excel(name = "单位")
private String unit;
/** 供应商编码 */
@Excel(name = "供应商编码")
/** 仓库编码 */
@Excel(name = "仓库编码")
private String supplierCode;
/** 供应商名称 */
@Excel(name = "供应商名称")
/** 仓库名称 */
@Excel(name = "仓库名称")
private String supplierName;
/** 来料时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "来料时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "来料时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date incomeTime;
/** 检测地点 */
@ -78,8 +78,8 @@ public class QcCheckTaskWarehousing extends BaseEntity {
private String checkManName;
/** 检验时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "检验时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "检验时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date checkTime;
/** 检验结果Y合格 */
@ -113,6 +113,61 @@ public class QcCheckTaskWarehousing extends BaseEntity {
/** 删除标识1删除0正常 */
private String delFlag;
private String incomeTimeStart;
private String incomeTimeEnd;
private String checkTimeStart;
private String checkTimeEnd;
private String typeCode;
private String checkType;
public String getCheckType() {
return checkType;
}
public void setCheckType(String checkType) {
this.checkType = checkType;
}
public String getIncomeTimeStart() {
return incomeTimeStart;
}
public void setIncomeTimeStart(String incomeTimeStart) {
this.incomeTimeStart = incomeTimeStart;
}
public String getIncomeTimeEnd() {
return incomeTimeEnd;
}
public void setIncomeTimeEnd(String incomeTimeEnd) {
this.incomeTimeEnd = incomeTimeEnd;
}
public String getCheckTimeStart() {
return checkTimeStart;
}
public void setCheckTimeStart(String checkTimeStart) {
this.checkTimeStart = checkTimeStart;
}
public String getCheckTimeEnd() {
return checkTimeEnd;
}
public void setCheckTimeEnd(String checkTimeEnd) {
this.checkTimeEnd = checkTimeEnd;
}
public String getTypeCode() {
return typeCode;
}
public void setTypeCode(String typeCode) {
this.typeCode = typeCode;
}
public void setRecordId(String recordId) {
this.recordId = recordId;
}

@ -3,17 +3,20 @@ package com.op.quality.mapper;
import java.util.List;
import com.op.quality.domain.QcCheckTaskWarehousing;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
*
*
* @author Open Platform
* @date 2023-10-19
*/
@Mapper
public interface QcCheckTaskWarehousingMapper {
/**
*
*
*
* @param recordId
* @return
*/
@ -21,7 +24,7 @@ public interface QcCheckTaskWarehousingMapper {
/**
*
*
*
* @param qcCheckTaskWarehousing
* @return
*/
@ -29,7 +32,7 @@ public interface QcCheckTaskWarehousingMapper {
/**
*
*
*
* @param qcCheckTaskWarehousing
* @return
*/
@ -37,7 +40,7 @@ public interface QcCheckTaskWarehousingMapper {
/**
*
*
*
* @param qcCheckTaskWarehousing
* @return
*/
@ -45,7 +48,7 @@ public interface QcCheckTaskWarehousingMapper {
/**
*
*
*
* @param recordId
* @return
*/
@ -53,9 +56,13 @@ public interface QcCheckTaskWarehousingMapper {
/**
*
*
*
* @param recordIds
* @return
*/
public int deleteQcCheckTaskWarehousingByRecordIds(String[] recordIds);
int getTodayMaxNum(QcCheckTaskWarehousing qcCheckTaskWarehousing);
List<QcCheckTaskWarehousing> getQcListLoc(QcCheckTaskWarehousing qcCheckTaskWarehousing);
}

@ -62,4 +62,6 @@ public interface IQcCheckTaskProduceService {
List<QcCheckTaskProduce> getQcListWorkCenter(QcCheckTaskProduce qcCheckTaskProduce);
List<QcCheckType> getCheckTypes(QcCheckType qcCheckType);
int changeProduceStatus(QcCheckTaskProduce qcCheckTaskProduce);
}

@ -5,14 +5,14 @@ import com.op.quality.domain.QcCheckTaskWarehousing;
/**
* Service
*
*
* @author Open Platform
* @date 2023-10-19
*/
public interface IQcCheckTaskWarehousingService {
/**
*
*
*
* @param recordId
* @return
*/
@ -20,7 +20,7 @@ public interface IQcCheckTaskWarehousingService {
/**
*
*
*
* @param qcCheckTaskWarehousing
* @return
*/
@ -28,7 +28,7 @@ public interface IQcCheckTaskWarehousingService {
/**
*
*
*
* @param qcCheckTaskWarehousing
* @return
*/
@ -36,7 +36,7 @@ public interface IQcCheckTaskWarehousingService {
/**
*
*
*
* @param qcCheckTaskWarehousing
* @return
*/
@ -44,7 +44,7 @@ public interface IQcCheckTaskWarehousingService {
/**
*
*
*
* @param recordIds
* @return
*/
@ -52,9 +52,11 @@ public interface IQcCheckTaskWarehousingService {
/**
*
*
*
* @param recordId
* @return
*/
public int deleteQcCheckTaskWarehousingByRecordId(String recordId);
List<QcCheckTaskWarehousing> getQcListLoc(QcCheckTaskWarehousing qcCheckTaskWarehousing);
}

@ -10,13 +10,11 @@ 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.QcCheckTaskDetailMapper;
import com.op.quality.mapper.QcCheckTypeProjectMapper;
import com.op.quality.mapper.QcMaterialGroupDetailMapper;
import com.op.quality.mapper.*;
import com.op.quality.service.IQcCheckTaskProduceService;
import com.op.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.quality.mapper.QcCheckTaskIncomeMapper;
import com.op.quality.service.IQcCheckTaskIncomeService;
import org.springframework.util.CollectionUtils;
import org.springframework.web.context.request.RequestContextHolder;
@ -44,6 +42,12 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
@Autowired
private QcCheckTaskDetailMapper qcCheckTaskDetailMapper;
@Autowired
private QcCheckTaskProduceMapper qcCheckTaskProduceMapper;
@Autowired
private QcCheckTaskWarehousingMapper qcCheckTaskWarehousingMapper;
/**
*
*
@ -101,7 +105,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
/**取检测项**/
QcCheckTypeProject qctp= new QcCheckTypeProject();
qctp.setTypeId("checkTypeLL");//来料检验
qctp.setTypeId(qcCheckTaskIncome.getCheckType());//生产过程检验
qctp.setMaterialCode(qcCheckTaskIncome.getMaterialCode());//特性
/**qc_check_type_project**/
List<QcCheckTaskDetail> items = qcCheckTypeProjectMapper.getTPByTypeMaterial(qctp);
@ -126,7 +130,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
item.setCreateTime(nowDate);
item.setCreateBy(createBy);
item.setFactoryCode(factoryCode);
item.setStatus("Y");
item.setStatus("N");
}
return qcCheckTaskDetailMapper.addBatch(items);
}
@ -217,13 +221,37 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
public int commitCheckResult(QcCheckTaskIncome qcCheckTaskIncome) {
//遍历检测项目
List<String> projects= qcCheckTaskDetailMapper.getProjectStatus(qcCheckTaskIncome.getRecordId());
String result = "N";
if(CollectionUtils.isEmpty(projects)){
qcCheckTaskIncome.setCheckResult("Y");//合格
result = "Y";//合格
}else{
qcCheckTaskIncome.setCheckResult("N");//不合格
result = "N";//合格
}
qcCheckTaskIncome.setCheckTime(DateUtils.getNowDate());
return qcCheckTaskIncomeMapper.updateQcCheckTaskIncome(qcCheckTaskIncome);
int n = 0;
String recordId = qcCheckTaskIncome.getRecordId();
if("material".equals(qcCheckTaskIncome.getTypeCode())){
qcCheckTaskIncome.setCheckStatus("2");
qcCheckTaskIncome.setCheckResult(result);
qcCheckTaskIncome.setCheckTime(DateUtils.getNowDate());
n = qcCheckTaskIncomeMapper.updateQcCheckTaskIncome(qcCheckTaskIncome);
}else if("produce".equals(qcCheckTaskIncome.getTypeCode())){
QcCheckTaskProduce qcCheckTaskProduce = new QcCheckTaskProduce();
qcCheckTaskProduce.setCheckStatus("2");
qcCheckTaskProduce.setRecordId(recordId);
qcCheckTaskProduce.setCheckResult(result);
qcCheckTaskProduce.setCheckTime(DateUtils.getNowDate());
n = qcCheckTaskProduceMapper.updateQcCheckTaskProduce(qcCheckTaskProduce);
}else if("product".equals(qcCheckTaskIncome.getTypeCode())){
QcCheckTaskWarehousing warehousing = new QcCheckTaskWarehousing();
warehousing.setCheckStatus("2");
warehousing.setRecordId(recordId);
warehousing.setCheckResult(result);
warehousing.setCheckTime(DateUtils.getNowDate());
n = qcCheckTaskWarehousingMapper.updateQcCheckTaskWarehousing(warehousing);
}
return n ;
}
}

@ -6,6 +6,7 @@ import java.util.List;
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.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.*;
import com.op.quality.mapper.QcCheckTaskDetailMapper;
@ -16,6 +17,8 @@ import org.springframework.stereotype.Service;
import com.op.quality.mapper.QcCheckTaskProduceMapper;
import com.op.quality.service.IQcCheckTaskProduceService;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@ -91,7 +94,7 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
qcCheckTaskProduce.setCheckNo(bpDD+liushuiStr);
/**qc_check_task_income**/
/**qc_check_task_produce**/
String beLongId = IdUtils.fastSimpleUUID();
qcCheckTaskProduce.setRecordId(beLongId);
qcCheckTaskProduce.setFactoryCode(factoryCode);
@ -176,9 +179,15 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
@Override
@DS("#header.poolName")
public List<QcCheckType> getCheckTypes(QcCheckType qcCheckType) {
qcCheckType.setTypeCode("produce");
return qcCheckTaskProduceMapper.getCheckTypes(qcCheckType);
}
@Override
@DS("#header.poolName")
public int changeProduceStatus(QcCheckTaskProduce qcCheckTaskProduce) {
qcCheckTaskProduce.setUpdateBy(SecurityUtils.getUsername());
qcCheckTaskProduce.setUpdateTime(DateUtils.getNowDate());
return qcCheckTaskProduceMapper.updateQcCheckTaskProduce(qcCheckTaskProduce);
}
}

@ -1,14 +1,28 @@
package com.op.quality.service.impl;
import java.util.Date;
import java.util.List;
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.QcCheckTaskDetail;
import com.op.quality.domain.QcCheckTypeProject;
import com.op.quality.domain.QcMaterialGroupDetail;
import com.op.quality.mapper.QcCheckTaskDetailMapper;
import com.op.quality.mapper.QcCheckTypeProjectMapper;
import com.op.quality.mapper.QcMaterialGroupDetailMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.quality.mapper.QcCheckTaskWarehousingMapper;
import com.op.quality.domain.QcCheckTaskWarehousing;
import com.op.quality.service.IQcCheckTaskWarehousingService;
import org.springframework.util.CollectionUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/**
* Service
@ -21,6 +35,15 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
@Autowired
private QcCheckTaskWarehousingMapper qcCheckTaskWarehousingMapper;
@Autowired
private QcCheckTypeProjectMapper qcCheckTypeProjectMapper;
@Autowired
private QcMaterialGroupDetailMapper qcMaterialGroupDetailMapper;
@Autowired
private QcCheckTaskDetailMapper qcCheckTaskDetailMapper;
/**
*
*
@ -42,6 +65,7 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
@Override
@DS("#header.poolName")
public List<QcCheckTaskWarehousing> selectQcCheckTaskWarehousingList(QcCheckTaskWarehousing qcCheckTaskWarehousing) {
qcCheckTaskWarehousing.setDelFlag("0");
return qcCheckTaskWarehousingMapper.selectQcCheckTaskWarehousingList(qcCheckTaskWarehousing);
}
@ -54,8 +78,57 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
@Override
@DS("#header.poolName")
public int insertQcCheckTaskWarehousing(QcCheckTaskWarehousing qcCheckTaskWarehousing) {
qcCheckTaskWarehousing.setCreateTime(DateUtils.getNowDate());
return qcCheckTaskWarehousingMapper.insertQcCheckTaskWarehousing(qcCheckTaskWarehousing);
String bpDD = DateUtils.parseDateToStr(DateUtils.YYYYMMDD, DateUtils.getNowDate());
int liushuiNum = qcCheckTaskWarehousingMapper.getTodayMaxNum(qcCheckTaskWarehousing);
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_","");
qcCheckTaskWarehousing.setCheckNo(bpDD+liushuiStr);
/**qc_check_task_warehousing**/
String beLongId = IdUtils.fastSimpleUUID();
qcCheckTaskWarehousing.setRecordId(beLongId);
qcCheckTaskWarehousing.setFactoryCode(factoryCode);
qcCheckTaskWarehousing.setCreateTime(nowDate);
qcCheckTaskWarehousingMapper.insertQcCheckTaskWarehousing(qcCheckTaskWarehousing);
/**取检测项**/
QcCheckTypeProject qctp= new QcCheckTypeProject();
qctp.setTypeId(qcCheckTaskWarehousing.getCheckType());//生产过程检验
qctp.setMaterialCode(qcCheckTaskWarehousing.getMaterialCode());//特性
/**qc_check_type_project**/
List<QcCheckTaskDetail> items = qcCheckTypeProjectMapper.getTPByTypeMaterial(qctp);
if(CollectionUtils.isEmpty(items)){
/**qc_material_group_detail**/
QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(qcCheckTaskWarehousing.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("Y");
}
return qcCheckTaskDetailMapper.addBatch(items);
}
/**
@ -94,4 +167,12 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
public int deleteQcCheckTaskWarehousingByRecordId(String recordId) {
return qcCheckTaskWarehousingMapper.deleteQcCheckTaskWarehousingByRecordId(recordId);
}
@Override
@DS("#header.poolName")
public List<QcCheckTaskWarehousing> getQcListLoc(QcCheckTaskWarehousing qcCheckTaskWarehousing) {
return qcCheckTaskWarehousingMapper.getQcListLoc(qcCheckTaskWarehousing);
}
}

@ -127,7 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
check_tool,unit_code,
check_standard,actual_value,
status,create_by,create_time,
factory_code,del_flag
factory_code,del_flag,type_project_id
) values
<foreach item="item" index="index" collection="list" separator=",">
(
@ -135,9 +135,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item.projectId},#{item.projectNo},#{item.ruleName},#{item.sort},
#{item.propertyCode},#{item.checkMode},
#{item.checkTool},#{item.unitCode},
#{item.checkStandard},#{item.actualValue},
'0',#{item.createBy},#{item.createTime},
#{item.factoryCode},'0'
#{item.standardValue},#{item.actualValue},
#{item.status},,#{item.createBy},#{item.createTime},
#{item.factoryCode},'0',#{item.typeProjectId}
)
</foreach>
</insert>

@ -122,8 +122,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
td.create_by createBy,
td.create_time createTime,
td.update_by updateBy,
td.update_time updateTime
td.update_time updateTime,
qctp.upper_diff upperDiff,
qctp.down_diff downDiff,
qctp.sample
from qc_check_task_detail td
left join qc_check_type_project qctp on td.type_project_id = qctp.id
where td.belong_to = #{belongTo}
</select>

@ -46,9 +46,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectQcCheckTaskProduceList" parameterType="QcCheckTaskProduce" resultMap="QcCheckTaskProduceResult">
<include refid="selectQcCheckTaskProduceVo"/>
<where>
<if test="checkNo != null and checkNo != ''"> and check_no = #{checkNo}</if>
<if test="batchNo != null and batchNo != ''"> and batch_no = #{batchNo}</if>
<if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
<if test="checkNo != null and checkNo != ''"> and check_no like concat('%', #{checkNo}, '%')</if>
<if test="batchNo != null and batchNo != ''"> and batch_no like concat('%', #{batchNo}, '%')</if>
<if test="orderNo != null and orderNo != ''"> and order_no like concat('%', #{orderNo}, '%')</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="quality != null "> and quality = #{quality}</if>

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.quality.mapper.QcCheckTaskWarehousingMapper">
<resultMap type="QcCheckTaskWarehousing" id="QcCheckTaskWarehousingResult">
<result property="recordId" column="record_id" />
<result property="checkNo" column="check_no" />
@ -41,12 +41,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectQcCheckTaskWarehousingList" parameterType="QcCheckTaskWarehousing" resultMap="QcCheckTaskWarehousingResult">
<include refid="selectQcCheckTaskWarehousingVo"/>
<where>
<if test="checkNo != null and checkNo != ''"> and check_no = #{checkNo}</if>
<if test="batchNo != null and batchNo != ''"> and batch_no = #{batchNo}</if>
<if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<where>
<if test="checkNo != null and checkNo != ''"> and check_no like concat('%', #{checkNo}, '%')</if>
<if test="batchNo != null and batchNo != ''"> and batch_no like concat('%', #{batchNo}, '%')</if>
<if test="orderNo != null and orderNo != ''"> and order_no like concat('%', #{orderNo}, '%')</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="quality != null "> and quality = #{quality}</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="supplierCode != null and supplierCode != ''"> and supplier_code = #{supplierCode}</if>
@ -64,14 +64,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="attr4 != null and attr4 != ''"> and attr4 = #{attr4}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
</where>
</select>
<select id="selectQcCheckTaskWarehousingByRecordId" parameterType="String" resultMap="QcCheckTaskWarehousingResult">
<include refid="selectQcCheckTaskWarehousingVo"/>
where record_id = #{recordId}
</select>
<select id="getTodayMaxNum" resultType="java.lang.Integer">
select count(0)+1
from qc_check_task_warehousing
where CONVERT(varchar(10),create_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
</select>
<select id="getQcListLoc" resultType="com.op.quality.domain.QcCheckTaskWarehousing">
select warehouse_code supplierCode,
warehouse_name supplierName
from base_warehouse
where del_flag = '0' and active_flag = '1'
</select>
<insert id="insertQcCheckTaskWarehousing" parameterType="QcCheckTaskWarehousing">
insert into qc_check_task_warehousing
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -175,9 +187,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteQcCheckTaskWarehousingByRecordIds" parameterType="String">
delete from qc_check_task_warehousing where record_id in
delete from qc_check_task_warehousing where record_id in
<foreach item="recordId" collection="array" open="(" separator="," close=")">
#{recordId}
</foreach>
</delete>
</mapper>
</mapper>

@ -94,7 +94,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE ctp.del_flag ='0' AND ctp.id = #{id}
</select>
<select id="getTPByTypeMaterial" resultType="com.op.quality.domain.QcCheckTaskDetail">
select qctp.project_id projectId,
select qctp.id typeProjectId,
qctp.project_id projectId,
qctp.project_no projectNo,
qctp.standard_value standardValue,
qctp.upper_diff upperDiff,
@ -105,8 +106,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qcp.property_code propertyCode,
qcp.check_tool checkTool,
qcp.unit_code unitCode,
qcp.check_mode checkMode,
qcp.check_standard checkStandard
qcp.check_mode checkMode
<!--,qcp.check_standard checkStandard-->
from qc_check_type_project qctp
left join qc_check_project qcp on qcp.id = qctp.project_id
where qctp.del_flag = '0' and qctp.status = '0'
@ -115,7 +116,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by qctp.sort
</select>
<select id="getTPByTypeGroup" resultType="com.op.quality.domain.QcCheckTaskDetail">
select qctp.project_id projectId,
select qctp.id typeProjectId,
qctp.project_id projectId,
qctp.project_no projectNo,
qctp.standard_value standardValue,
qctp.upper_diff upperDiff,
@ -126,8 +128,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qcp.property_code propertyCode,
qcp.check_tool checkTool,
qcp.unit_code unitCode,
qcp.check_mode checkMode,
qcp.check_standard checkStandard
qcp.check_mode checkMode
<!--,qcp.check_standard checkStandard-->
from qc_check_type_project qctp
left join qc_check_project qcp on qcp.id = qctp.project_id
where qctp.del_flag = '0' and qctp.status = '0'

Loading…
Cancel
Save