只有活动中的工单才能进行报工

orign^2
zhaoxiaolin 1 year ago
parent ad6f335ffc
commit 4362014544

@ -267,7 +267,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
new LinkedBlockingQueue<Runnable>());
try {
dateSources.forEach(dateSource -> {
if("ds_1000".equals(dateSource.get("poolName"))){//只有999白坯工厂有这种情况
if("ds_999".equals(dateSource.get("poolName"))){//只有999白坯工厂有这种情况
logger.info("++++++++++++" + dateSource.get("poolName") + "++++开始++++++++++");
Runnable run = () -> dateBKFunc(dateSource.get("poolName"),tables);
executorService.execute(run);

@ -471,9 +471,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getReportWorkHzList" resultType="com.op.mes.domain.MesReportWork">
select mrw.workorderCode,mrw.productCode,mrw.productName,mrw.machineCode,mrw.machineName,
mrw.shiftCode,mrw.feedbackTime feedbackTimeStr,mrw.quantityFeedback,
mrw.workTime,mrw.useMan,mrw.uploadStatus,mrw.unit,<!--mrw.uploadTime,-->
pow.order_code orderCode,pow.quantity_split quantity
mrw.shiftCode,mrw.quantityFeedback,
mrw.workTime,mrw.useMan,mrw.uploadStatus,mrw.unit,
pow.order_code orderCode,pow.quantity_split quantity,
pow.workorder_code_sap workorderCodeSap,
pow.product_date productDate
from (
select workorder_code workorderCode,
product_code productCode,
@ -481,7 +483,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
machine_code machineCode,
machine_name machineName,
shift_code shiftCode,
CONVERT(varchar(10),feedback_time, 120) feedbackTime,
sum(quantity_feedback) quantityFeedback,
sum(work_time) workTime,
sum(use_man) useMan,
@ -495,18 +496,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="machineCode != null and machineCode != ''"> and machine_code = #{machineCode}</if>
<if test="machineName != null and machineName != ''"> and machine_name like concat('%', #{machineName}, '%')</if>
<if test="feedbackTimeStart != null "> and CONVERT(varchar(19),feedback_time, 120) >= #{feedbackTimeStart}</if>
<if test="feedbackTimeEnd != null "> and #{feedbackTimeEnd} >= CONVERT(varchar(19),feedback_time, 120)</if>
<if test="uploadStatus != null and uploadStatus != ''"> and upload_status = #{uploadStatus}</if>
group by workorder_code, product_code,product_name,CONVERT(varchar(10),feedback_time, 120),machine_code,machine_name,shift_code
group by workorder_code, product_code,product_name,machine_code,machine_name,shift_code
,upload_status,unit
<!--,upload_time-->
) mrw
left join pro_order_workorder pow on mrw.workorderCode = pow.workorder_code
<where>
pow.del_flag = '0'
<if test="feedbackTimeStart != null "> and pow.product_date >= #{feedbackTimeStart}</if>
<if test="feedbackTimeEnd != null "> and #{feedbackTimeEnd} >= pow.product_date</if>
<if test="orderCode != null and orderCode != ''"> and pow.order_code like concat('%', #{orderCode}, '%')</if>
</where>
order by mrw.feedbackTime desc
order by pow.product_date desc
</select>
<select id="getReportList" resultType="com.op.mes.domain.MesReportWork">
select

@ -0,0 +1,54 @@
package com.op.quality.controller;
import com.op.common.core.utils.StringUtils;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcInterface;
import com.op.quality.service.IQcInterfaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
*
*
* @author zxl
* @date 2023-11-15
*/
@RestController
@RequestMapping("/qcInterface")
public class QcInterfaceController {
@Autowired
private IQcInterfaceService qcInterfaceService;
/**
*/
@GetMapping("/getDictData")
public List<QcInterface> getDictData(QcInterface qcInterface) {
return qcInterfaceService.getDictData(qcInterface);
}
/**
* --
* @param qcInterface
* @return
*/
@GetMapping("/getOverallInfo")
public List<QcInterface> getOverallInfo(QcInterface qcInterface) {
return qcInterfaceService.getOverallInfo(qcInterface);
}
/**
* --
* @param qcInterface
* @return
*/
@GetMapping("/getCheckProjectsPie")
public List<QcInterface> getCheckProjectsPie(QcInterface qcInterface) {
return qcInterfaceService.getCheckProjectsPie(qcInterface);
}
}

@ -0,0 +1,79 @@
package com.op.quality.domain;
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;
/**
*
*
* @author Open Platform
* @date 2023-10-12
*/
public class QcInterface extends BaseEntity {
private static final long serialVersionUID = 1L;
private String ymdType;
private String ymdTypeName;
private String dictType;
private String factoryCode;
private String quality;
private String ymd;
private String projectName;
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public String getYmd() {
return ymd;
}
public void setYmd(String ymd) {
this.ymd = ymd;
}
public String getQuality() {
return quality;
}
public void setQuality(String quality) {
this.quality = quality;
}
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getYmdType() {
return ymdType;
}
public void setYmdType(String ymdType) {
this.ymdType = ymdType;
}
public String getYmdTypeName() {
return ymdTypeName;
}
public void setYmdTypeName(String ymdTypeName) {
this.ymdTypeName = ymdTypeName;
}
public String getDictType() {
return dictType;
}
public void setDictType(String dictType) {
this.dictType = dictType;
}
}

@ -84,4 +84,6 @@ public interface QcCheckTaskIncomeMapper {
List<SysDictData> getQcUnitList(SysDictData sysDictData);
List<QcCheckTaskIncome> getBatchList(QcCheckTaskIncome qcCheckTaskIncome);
String getTypeCode(String checkType);
}

@ -0,0 +1,24 @@
package com.op.quality.mapper;
import com.op.quality.domain.QcCheckProject;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcInterface;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* Mapper
*
* @author Open Platform
* @date 2023-10-13
*/
@Mapper
public interface QcInterfaceMapper {
List<QcInterface> getDictData(QcInterface qcInterface);
List<QcInterface> getOverallInfo(QcInterface qcInterface);
List<QcInterface> getCheckProjectsPie(QcInterface qcInterface);
}

@ -0,0 +1,21 @@
package com.op.quality.service;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcInterface;
import java.util.List;
/**
*
* @author Open Platform
* @date 2023-10-13
*/
public interface IQcInterfaceService {
List<QcInterface> getDictData(QcInterface qcInterface);
List<QcInterface> getOverallInfo(QcInterface qcInterface);
List<QcInterface> getCheckProjectsPie(QcInterface qcInterface);
}

@ -135,6 +135,8 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
qcCheckTaskIncome.setRecordId(beLongId);
qcCheckTaskIncome.setFactoryCode(factoryCode);
qcCheckTaskIncome.setCreateTime(nowDate);
//String typeCode = qcCheckTaskIncomeMapper.getTypeCode(qcCheckTaskIncome.getCheckType());
qcCheckTaskIncome.setTypeCode("material");//大检验节点
qcCheckTaskIncomeMapper.insertQcCheckTaskIncome(qcCheckTaskIncome);
/**qc_check_task_detail**/
for(QcCheckTaskDetail item:items){

@ -126,6 +126,7 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
qcCheckTaskProduce.setRecordId(beLongId);
qcCheckTaskProduce.setFactoryCode(factoryCode);
qcCheckTaskProduce.setCreateTime(nowDate);
qcCheckTaskProduce.setTypeCode("produce");//大检验节点
qcCheckTaskProduceMapper.insertQcCheckTaskProduce(qcCheckTaskProduce);
/**qc_check_task_detail**/
for(QcCheckTaskDetail item:items){

@ -127,6 +127,7 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
qcCheckTaskWarehousing.setRecordId(beLongId);
qcCheckTaskWarehousing.setFactoryCode(factoryCode);
qcCheckTaskWarehousing.setCreateTime(nowDate);
qcCheckTaskWarehousing.setTypeCode("product");//大检验节点
qcCheckTaskWarehousingMapper.insertQcCheckTaskWarehousing(qcCheckTaskWarehousing);
/**qc_check_task_detail**/
for(QcCheckTaskDetail item:items){

@ -0,0 +1,69 @@
package com.op.quality.service.impl;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcInterface;
import com.op.quality.mapper.QcInterfaceMapper;
import com.op.quality.service.IQcInterfaceService;
import com.op.system.api.domain.SysDictData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
/**
* Service
*
* @author Open Platform
* @date 2023-10-13
*/
@Service
public class QcInterfaceServiceImpl implements IQcInterfaceService {
@Autowired
private QcInterfaceMapper qcInterfaceMapper;
@Override
public List<QcInterface> getDictData(QcInterface qcInterface) {
DynamicDataSourceContextHolder.push("master");
return qcInterfaceMapper.getDictData(qcInterface);
}
@Override
public List<QcInterface> getOverallInfo(QcInterface qcInterface) {
DynamicDataSourceContextHolder.push(qcInterface.getFactoryCode());
String nowYMD = DateUtils.getDate();
qcInterface.setYmd(nowYMD);
List<QcInterface> dtos = qcInterfaceMapper.getOverallInfo(qcInterface);
if(!CollectionUtils.isEmpty(dtos)&&dtos.size()==2){
QcInterface qif = new QcInterface();
qif.setYmdTypeName("okRate");
if(dtos.get(1).getQuality().equals("0")){
qif.setQuality("100%");
}else{
BigDecimal okRate = (new BigDecimal(dtos.get(0).getQuality())
.subtract(new BigDecimal(dtos.get(1).getQuality())))
.multiply(new BigDecimal("100"))
.divide(new BigDecimal(dtos.get(0).getQuality()),2, RoundingMode.HALF_UP);
qif.setQuality(okRate.toString()+"%");
}
dtos.add(qif);
}
return dtos;
}
@Override
public List<QcInterface> getCheckProjectsPie(QcInterface qcInterface) {
DynamicDataSourceContextHolder.push(qcInterface.getFactoryCode());
String nowYMD = DateUtils.getDate();
qcInterface.setYmd(nowYMD);
List<QcInterface> dtos = qcInterfaceMapper.getCheckProjectsPie(qcInterface);
return dtos;
}
}

@ -146,6 +146,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
public List<QcUserMaterial> getList(QcUserMaterial qcUserMaterial) {
List<QcUserMaterial> dto = qcUserMaterialMapper.getUserMaterialListUndo(qcUserMaterial);
qcUserMaterial.setMaterialName(null);
List<QcUserMaterial> selected = qcUserMaterialMapper.getUserMaterialListDo(qcUserMaterial);
dto.addAll(selected);

@ -154,6 +154,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where powb.del_flag = '0' and pow.del_flag = '0'
and pow.workorder_code = #{workorderCode}
</select>
<select id="getTypeCode" resultType="java.lang.String">
select type_code from qc_check_type where order_code = #{checkType}
</select>
<insert id="insertQcCheckTaskIncome" parameterType="QcCheckTaskIncome">
insert into qc_check_task

@ -0,0 +1,60 @@
<?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.QcInterfaceMapper">
<select id="getDictData" resultType="com.op.quality.domain.QcInterface">
select dict_label ymdTypeName,
dict_value ymdType
from sys_dict_data
where dict_type = #{dictType} and status = '0'
</select>
<select id="getOverallInfo" resultType="com.op.quality.domain.QcInterface">
select count(0) quality,'all' ymdTypeName
from wms_raw_order_in
where active_flag = '1'
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),receipt_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),receipt_time, 120) =SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),receipt_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
union ALL
select count(0),'unOk'
from qc_check_unqualified qcu
left join qc_check_type qct on qcu.type = qct.order_code
where qct.type_code = #{typeCode} and qcu.del_flag = '0'
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qcu.create_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qcu.create_time, 120) = SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qcu.create_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
</select>
<select id="getCheckProjectsPie" resultType="com.op.quality.domain.QcInterface">
select count(0) quality,
qctd.project_no,
qctd.rule_name projectName
from qc_check_task_detail qctd
left join qc_check_task qct on qctd.belong_to = qct.record_id
where qct.check_result = 'N' and qct.type_code = #{typeCode}
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qctd.update_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qcu.update_time, 120) = SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qcu.update_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
group by qctd.project_no,qctd.rule_name
</select>
</mapper>

@ -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.QcUserMaterialMapper">
<resultMap type="QcUserMaterial" id="QcUserMaterialResult">
<result property="id" column="id" />
<result property="userCode" column="user_code" />
@ -45,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectQcUserMaterialList" parameterType="QcUserMaterial" resultMap="QcUserMaterialResult">
<include refid="selectQcUserMaterialVo"/>
<where>
<where>
<if test="userCode != null and userCode != ''"> and user_code = #{userCode}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
@ -170,4 +170,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{userCode}
</foreach>
</delete>
</mapper>
</mapper>

Loading…
Cancel
Save