Merge remote-tracking branch 'origin/master'

master
mengjiao 11 months ago
commit 6300af9a03

@ -5,6 +5,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.domain.BaseFileData;
import com.op.system.api.domain.SysUser; import com.op.system.api.domain.SysUser;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
@ -268,6 +269,7 @@ public class EquOrder extends BaseEntity {
private List<String> upkeepPictures; private List<String> upkeepPictures;
private String picturePath; private String picturePath;
private List<BaseFileData> picturePaths;
//工具 //工具
private String itemTools; private String itemTools;
@ -288,6 +290,14 @@ public class EquOrder extends BaseEntity {
this.upkeepPictures = upkeepPictures; this.upkeepPictures = upkeepPictures;
} }
public List<BaseFileData> getPicturePaths() {
return picturePaths;
}
public void setPicturePaths(List<BaseFileData> picturePaths) {
this.picturePaths = picturePaths;
}
public List<Date> getOrderStartArray() { public List<Date> getOrderStartArray() {
return orderStartArray; return orderStartArray;
} }

@ -303,8 +303,11 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
hasTask = deviceTaskMapper.getNewTaskOrder(plan); hasTask = deviceTaskMapper.getNewTaskOrder(plan);
} else if ("2".equals(plan.getCalculationRule())) { } else if ("2".equals(plan.getCalculationRule())) {
//单次生成保养计划 //单次生成保养计划
//根据planLoopStart 单次生成
if(plan.getPlanLoopStart().getTime() == DateUtils.getNowDate().getTime()){
hasTask = null;
}
} }
if (hasTask == null || Integer.parseInt(plan.getPlanLoop()) <= hasTask.getDays() || checkHourTask(hasTask, plan)) { if (hasTask == null || Integer.parseInt(plan.getPlanLoop()) <= hasTask.getDays() || checkHourTask(hasTask, plan)) {
//生成保养计划 //生成保养计划
int m = this.createOrderPlan(plan); int m = this.createOrderPlan(plan);

@ -20,6 +20,7 @@ import com.op.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.op.device.service.IEquOrderService; import com.op.device.service.IEquOrderService;
import org.springframework.util.CollectionUtils;
import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
@ -88,8 +89,16 @@ public class EquOrderServiceImpl implements IEquOrderService {
List<EquOrderDetail> detailList = equOrderDetailMapper.selectEquOrderDetailByOrderCode(order.getOrderCode()); List<EquOrderDetail> detailList = equOrderDetailMapper.selectEquOrderDetailByOrderCode(order.getOrderCode());
for (EquOrderDetail detail : detailList) { for (EquOrderDetail detail : detailList) {
// 标准 // 标准
List<EquOrderStandard> standardList = equOrderStandardMapper.selectEquOrderStandardByParentCode(detail.getId()); List<EquOrderStandard> standardLists = equOrderStandardMapper.selectEquOrderStandardByParentCode(detail.getId());
detail.setStandardList(standardList); for (EquOrderStandard standardList : standardLists) {
//每个检查标准里面的照片
String imageType = "3";
List<BaseFileData> file = equOrderStandardMapper.getBaseFileBatch(standardList.getId(), imageType);
if (!CollectionUtils.isEmpty(file)) {
standardList.setPicturePaths(file);
}
}
detail.setStandardList(standardLists);
} }
order.setDetailList(detailList); order.setDetailList(detailList);
@ -110,6 +119,12 @@ public class EquOrderServiceImpl implements IEquOrderService {
order.setPersonList(personList); order.setPersonList(personList);
//保养图片信息
String imageType = "3";
List<BaseFileData> file = equOrderStandardMapper.getBaseFileBatch(order.getOrderId(), imageType);
if (!CollectionUtils.isEmpty(file)) {
order.setPicturePaths(file);
}
return order; return order;
} }
@ -209,6 +224,8 @@ public class EquOrderServiceImpl implements IEquOrderService {
} }
// 获取检查项信息列表 // 获取检查项信息列表
//照片格式
String imageType = "3";
List<EquOrderDetail> detailList = equOrder.getDetailList(); List<EquOrderDetail> detailList = equOrder.getDetailList();
// 处理检查项信息 // 处理检查项信息
for (EquOrderDetail detail : detailList) { for (EquOrderDetail detail : detailList) {
@ -216,7 +233,8 @@ public class EquOrderServiceImpl implements IEquOrderService {
List<EquOrderStandard> standardList = detail.getStandardList(); List<EquOrderStandard> standardList = detail.getStandardList();
// 处理标准信息 // 处理标准信息
for (EquOrderStandard standard : standardList) { for (EquOrderStandard standard : standardList) {
//删除之前的图片,重新上传
equOrderStandardMapper.deleteBaseFileBySourceId(standard.getId(), imageType);
//上传附件 //上传附件
if (StringUtils.isNotEmpty(standard.getPicturePath())) { if (StringUtils.isNotEmpty(standard.getPicturePath())) {
String[] ids = standard.getPicturePath().split(","); String[] ids = standard.getPicturePath().split(",");
@ -265,6 +283,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
equOrder.setUpdateBy(SecurityContextHolder.getUserName()); equOrder.setUpdateBy(SecurityContextHolder.getUserName());
equOrder.setPlanPerson(SecurityContextHolder.getUserName());// 设置负责人 equOrder.setPlanPerson(SecurityContextHolder.getUserName());// 设置负责人
equOrder.setOrderEnd(DateUtils.getNowDate());// 设置结束时间 equOrder.setOrderEnd(DateUtils.getNowDate());// 设置结束时间
equOrder.setOrderStart(DateUtils.getNowDate());// 设置检查时间开始,实际上不需要开始时间
if (equOrder.getTimeArray().size() > 0) { if (equOrder.getTimeArray().size() > 0) {
equOrder.setOrderStart(equOrder.getTimeArray().get(0));// 工单开始时间 equOrder.setOrderStart(equOrder.getTimeArray().get(0));// 工单开始时间
equOrder.setOrderEnd(equOrder.getTimeArray().get(1));// 工单结束时间 equOrder.setOrderEnd(equOrder.getTimeArray().get(1));// 工单结束时间
@ -355,6 +374,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
} }
// 保养图片 // 保养图片
equOrderStandardMapper.deleteBaseFileBySourceId(equOrder.getOrderId(), imageType);
if (StringUtils.isNotEmpty(equOrder.getPicturePath())) { if (StringUtils.isNotEmpty(equOrder.getPicturePath())) {
String[] ids = equOrder.getPicturePath().split(","); String[] ids = equOrder.getPicturePath().split(",");
List<BaseFileData> files = new ArrayList<>(); List<BaseFileData> files = new ArrayList<>();
@ -367,6 +387,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
file.setSourceId(equOrder.getOrderId()); file.setSourceId(equOrder.getOrderId());
file.setCreateBy(SecurityUtils.getUsername()); file.setCreateBy(SecurityUtils.getUsername());
file.setCreateTime(new Date()); file.setCreateTime(new Date());
file.setImageType("3");
files.add(file); files.add(file);
} }
equFileMapper.insertEquFileBatch(files); equFileMapper.insertEquFileBatch(files);

@ -145,9 +145,11 @@ public class EquPlanServiceImpl implements IEquPlanService {
equPlan.setPlanId(IdUtils.fastSimpleUUID());// 计划id equPlan.setPlanId(IdUtils.fastSimpleUUID());// 计划id
equPlan.setPlanCode((DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + planSerialNum));// 计划编码 equPlan.setPlanCode((DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + planSerialNum));// 计划编码
if (equPlan.getPlanTimeArray().size() > 0) { if (equPlan.getPlanTimeArray() != null){
equPlan.setPlanLoopStart(equPlan.getPlanTimeArray().get(0));// 计划循环周期开始时间 if (equPlan.getPlanTimeArray().size() > 0) {
equPlan.setPlanLoopEnd(equPlan.getPlanTimeArray().get(1));// 计划循环周期结束时间 equPlan.setPlanLoopStart(equPlan.getPlanTimeArray().get(0));// 计划循环周期开始时间
equPlan.setPlanLoopEnd(equPlan.getPlanTimeArray().get(1));// 计划循环周期结束时间
}
} }
equPlan.setFactoryCode(factory);// 工厂编码 equPlan.setFactoryCode(factory);// 工厂编码
equPlan.setCreateBy(SecurityContextHolder.getUserName()); equPlan.setCreateBy(SecurityContextHolder.getUserName());
@ -174,9 +176,11 @@ public class EquPlanServiceImpl implements IEquPlanService {
@DS("#header.poolName") @DS("#header.poolName")
public AjaxResult updateEquPlan(EquPlan equPlan) { public AjaxResult updateEquPlan(EquPlan equPlan) {
// 设置循环范围时间 // 设置循环范围时间
if (equPlan.getPlanTimeArray().size() != 0) { if (equPlan.getPlanTimeArray() != null){
equPlan.setPlanLoopStart(equPlan.getPlanTimeArray().get(0));// 循环开始时间 if (equPlan.getPlanTimeArray().size() > 0) {
equPlan.setPlanLoopEnd(equPlan.getPlanTimeArray().get(1));// 循环结束时间 equPlan.setPlanLoopStart(equPlan.getPlanTimeArray().get(0));// 计划循环周期开始时间
equPlan.setPlanLoopEnd(equPlan.getPlanTimeArray().get(1));// 计划循环周期结束时间
}
} }
// 更新计划 // 更新计划
equPlanMapper.updateEquPlan(equPlan); equPlanMapper.updateEquPlan(equPlan);

@ -169,14 +169,17 @@
<!--设备总数--> <!--设备总数-->
<select id="getTotalEquipment" resultType="java.lang.String"> <select id="getTotalEquipment" resultType="java.lang.String">
select count(*) from base_equipment be where be.del_flag = '0' and be.status = '1' select count(1)
from base_equipment be
where be.del_flag = '0'
and be.status = '1'
</select> </select>
<select id="selectGroups" resultType="com.op.device.domain.vo.IEquFaultVO"> <select id="selectGroups" resultType="com.op.device.domain.vo.IEquFaultVO">
select be.equipment_code AS 'code', be.equipment_name AS 'name' select be.equipment_code AS 'code', be.equipment_name AS 'name'
from base_equipment be from base_equipment be
where be.del_flag = '0' where be.del_flag = '0'
and be.equipment_category = '1' and be.equipment_category = '1'
</select> </select>
<select id="selectEquipmentFaultNumForMonth" resultType="java.util.Map"> <select id="selectEquipmentFaultNumForMonth" resultType="java.util.Map">

@ -61,16 +61,44 @@
</sql> </sql>
<select id="selectEquOrderList" parameterType="EquOrder" resultMap="EquOrderResult"> <select id="selectEquOrderList" parameterType="EquOrder" resultMap="EquOrderResult">
select eo.order_id, eo.plan_id, eo.plan_code, eo.plan_type, eo.order_code, eo.plan_workshop, eo.plan_prod_line, select
eo.plan_loop, eo.order_id,
eo.plan_loop_type, eo.plan_id,
eo.plan_loop_start, eo.plan_loop_end, eo.order_start, eo.order_end, eo.equipment_code, eo.order_status, eo.plan_code,
eo.order_cost, eo.plan_person, eo.order_cost_time, eo.order_sign_person, eo.plan_type,
eo.factory_code, eo.attr1, eo.attr2, eo.attr3, eo.del_flag, eo.create_by, eo.create_time, eo.order_code,
eo.update_by, eo.plan_workshop,
eo.update_time,eo.upkeep,eo.calculation_rule,eo.shut_down,eo.order_inspect,eo.repair_code,eo.work_code,eo.outsource_code, eo.plan_prod_line,
be.equipment_name, eo.plan_loop,
ep.plan_name planName eo.plan_loop_type,
eo.plan_loop_start,
eo.plan_loop_end,
eo.order_start,
eo.order_end,
eo.equipment_code,
eo.order_status,
eo.order_cost,
eo.plan_person,
eo.order_cost_time,
eo.order_sign_person,
eo.factory_code,
eo.attr1,
eo.attr2,
eo.attr3,
eo.del_flag,
eo.create_by,
eo.create_time,
eo.update_by,
eo.update_time,
eo.upkeep,
eo.calculation_rule,
eo.shut_down,
eo.order_inspect,
eo.repair_code,
eo.work_code,
eo.outsource_code,
be.equipment_name,
ep.plan_name planName
from equ_order eo from equ_order eo
left join base_equipment be on be.equipment_code = eo.equipment_code left join base_equipment be on be.equipment_code = eo.equipment_code
left join equ_plan ep on ep.plan_code = eo.plan_code left join equ_plan ep on ep.plan_code = eo.plan_code
@ -83,23 +111,17 @@
<if test="planProdLine != null and planProdLine != ''">and eo.plan_prod_line = #{planProdLine}</if> <if test="planProdLine != null and planProdLine != ''">and eo.plan_prod_line = #{planProdLine}</if>
<if test="planLoop != null and planLoop != ''">and eo.plan_loop = #{planLoop}</if> <if test="planLoop != null and planLoop != ''">and eo.plan_loop = #{planLoop}</if>
<if test="planLoopType != null and planLoopType != ''">and eo.plan_loop_type = #{planLoopType}</if> <if test="planLoopType != null and planLoopType != ''">and eo.plan_loop_type = #{planLoopType}</if>
<if test="equipmentCode != null and equipmentCode != ''">and eo.equipment_code like concat('%', <if test="equipmentCode != null and equipmentCode != ''">and eo.equipment_code like concat('%',#{equipmentCode}, '%')</if>
#{equipmentCode}, '%') <if test="equipmentName != null and equipmentName != ''">and be.equipment_name like concat('%',#{equipmentName}, '%')</if>
</if>
<if test="equipmentName != null and equipmentName != ''">and be.equipment_name like concat('%',
#{equipmentName}, '%')
</if>
<if test="planLoopStart != null ">and eo.plan_loop_start = #{planLoopStart}</if> <if test="planLoopStart != null ">and eo.plan_loop_start = #{planLoopStart}</if>
<if test="planLoopEnd != null ">and eo.plan_loop_end = #{planLoopEnd}</if> <if test="planLoopEnd != null ">and eo.plan_loop_end = #{planLoopEnd}</if>
<if test="orderStart != null ">and CONVERT(date,eo.order_start) = #{orderStart}</if> <if test="orderStart != null ">and CONVERT(date,eo.order_start) = #{orderStart}</if>
<if test="orderEnd != null ">and eo.order_end = #{ord5erEnd}</if> <if test="orderEnd != null ">and eo.order_end = #{ord5erEnd}</if>
<if test="orderStatus != null and orderStatus != ''">and eo.order_status = #{orderStatus}</if> <if test="orderStatus != null and orderStatus != ''">and eo.order_status = #{orderStatus}</if>
<if test="orderCost != null ">and eo.order_cost = #{orderCost}</if> <if test="orderCost != null ">and eo.order_cost = #{orderCost}</if>
<if test="planPerson != null and planPerson != ''">and eo.plan_person like concat('%', #{planPerson}, '%') <if test="planPerson != null and planPerson != ''">and eo.plan_person like concat('%', #{planPerson}, '%')</if>
</if>
<if test="orderCostTime != null and orderCostTime != ''">and eo.order_cost_time = #{orderCostTime}</if> <if test="orderCostTime != null and orderCostTime != ''">and eo.order_cost_time = #{orderCostTime}</if>
<if test="orderSignPerson != null and orderSignPerson != ''">and eo.order_sign_person = #{orderSignPerson} <if test="orderSignPerson != null and orderSignPerson != ''">and eo.order_sign_person = #{orderSignPerson}</if>
</if>
<if test="factoryCode != null and factoryCode != ''">and eo.factory_code = #{factoryCode}</if> <if test="factoryCode != null and factoryCode != ''">and eo.factory_code = #{factoryCode}</if>
<if test="attr1 != null and attr1 != ''">and eo.attr1 = #{attr1}</if> <if test="attr1 != null and attr1 != ''">and eo.attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''">and eo.attr2 = #{attr2}</if> <if test="attr2 != null and attr2 != ''">and eo.attr2 = #{attr2}</if>
@ -124,6 +146,7 @@
<if test="orderStartArrayEnd != null ">and #{orderStartArrayEnd} >= CONVERT(date,eo.order_start)</if> <if test="orderStartArrayEnd != null ">and #{orderStartArrayEnd} >= CONVERT(date,eo.order_start)</if>
<if test="orderEndArrayStart != null ">and CONVERT(date,eo.order_end) >= #{orderEndArrayStart}</if> <if test="orderEndArrayStart != null ">and CONVERT(date,eo.order_end) >= #{orderEndArrayStart}</if>
<if test="orderEndArrayEnd != null ">and #{orderEndArrayEnd} >= CONVERT(date,eo.order_end)</if> <if test="orderEndArrayEnd != null ">and #{orderEndArrayEnd} >= CONVERT(date,eo.order_end)</if>
<if test="planName != null and planName != ''">and ep.plan_name like concat('%', #{planName}, '%')</if>
and eo.del_flag = '0' and be.del_flag = '0' and ep.del_flag = '0' and eo.del_flag = '0' and be.del_flag = '0' and ep.del_flag = '0'
</where> </where>
order by eo.create_time desc order by eo.create_time desc
@ -195,14 +218,14 @@
eo.outsource_code, eo.outsource_code,
be.equipment_name be.equipment_name
from equ_order eo from equ_order eo
left join base_equipment be on eo.equipment_code = be.equipment_code left join base_equipment be on eo.equipment_code = be.equipment_code
where eo.plan_type = #{planType} where eo.plan_type = #{planType}
and eo.del_flag = '0' and eo.del_flag = '0'
and eo.order_status != '1' and eo.order_status != '1'
and eo.order_code in (select order_code and eo.order_code in (select order_code
from equ_order_person from equ_order_person
where del_flag = '0' where del_flag = '0'
and user_name = #{userId} and user_name = #{userId}
GROUP BY order_code) GROUP BY order_code)
order by eo.plan_loop_type, eo.plan_loop, eo.create_time desc, eo.equipment_code order by eo.plan_loop_type, eo.plan_loop, eo.create_time desc, eo.equipment_code
</select> </select>
@ -245,12 +268,12 @@
eo.outsource_code, eo.outsource_code,
be.equipment_name be.equipment_name
from equ_order eo from equ_order eo
left join base_equipment be on eo.equipment_code = be.equipment_code left join base_equipment be on eo.equipment_code = be.equipment_code
where eo.del_flag = '0' where eo.del_flag = '0'
and eo.order_status = '1' and eo.order_status = '1'
and eo.plan_type = #{planType} and eo.plan_type = #{planType}
and eo.plan_person = #{userId} and eo.plan_person = #{userId}
and eo.order_code in (select order_code and eo.order_code in (select order_code
from equ_order_person from equ_order_person
where del_flag = '0' and user_name = #{userId} where del_flag = '0' and user_name = #{userId}
GROUP BY order_code) GROUP BY order_code)
@ -404,18 +427,18 @@
<!-- 手持维修查询检查项--> <!-- 手持维修查询检查项-->
<select id="selectCheckListByWorkCode" parameterType="EquOrder" resultMap="EquOrderResult"> <select id="selectCheckListByWorkCode" parameterType="EquOrder" resultMap="EquOrderResult">
select select
eo.order_id, eo.order_id,
eo.order_code, eo.order_code,
eo.repair_code, eo.repair_code,
eo.work_code, eo.work_code,
eo.plan_loop, eo.plan_loop,
eo.plan_loop_type, eo.plan_loop_type,
eod.id, eod.id,
eod.item_name, eod.item_name,
eod.item_method, eod.item_method,
eod.item_type, eod.item_type,
eod.item_type_name, eod.item_type_name,
eod.item_tools eod.item_tools
from equ_order eo from equ_order eo
left join equ_order_detail eod on eo.order_code = eod.order_code left join equ_order_detail eod on eo.order_code = eod.order_code
where eo.work_code = #{workCode} where eo.work_code = #{workCode}
@ -425,18 +448,18 @@
<!-- 手持报修查询检查项--> <!-- 手持报修查询检查项-->
<select id="selectCheckListByRepairCode" parameterType="EquOrder" resultMap="EquOrderResult"> <select id="selectCheckListByRepairCode" parameterType="EquOrder" resultMap="EquOrderResult">
select select
eo.order_id, eo.order_id,
eo.order_code, eo.order_code,
eo.repair_code, eo.repair_code,
eo.work_code, eo.work_code,
eo.plan_loop, eo.plan_loop,
eo.plan_loop_type, eo.plan_loop_type,
eod.id, eod.id,
eod.item_name, eod.item_name,
eod.item_method, eod.item_method,
eod.item_type, eod.item_type,
eod.item_type_name, eod.item_type_name,
eod.item_tools eod.item_tools
from equ_order eo from equ_order eo
left join equ_order_detail eod on eo.order_code = eod.order_code left join equ_order_detail eod on eo.order_code = eod.order_code
where eo.repair_code = #{repairCode} where eo.repair_code = #{repairCode}
@ -446,7 +469,7 @@
<!-- 查询对应检查项id--> <!-- 查询对应检查项id-->
<select id="getIdsByOrderCode" parameterType="EquOrder" resultType="java.lang.String"> <select id="getIdsByOrderCode" parameterType="EquOrder" resultType="java.lang.String">
select select
order_id order_id
from equ_order from equ_order
where repair_code = #{orderCode} where repair_code = #{orderCode}
and del_flag = '0' and del_flag = '0'
@ -475,7 +498,7 @@
update base_equipment update base_equipment
set equipment_status = #{status} set equipment_status = #{status}
where equipment_code = #{equipmentCode} where equipment_code = #{equipmentCode}
and del_flag = '0' and del_flag = '0'
</update> </update>

@ -20,6 +20,7 @@ public class MesMachineReport extends BaseEntity {
private String productDateStart; //查询开始时间 private String productDateStart; //查询开始时间
private String productDateEnd; //查询结束时间 private String productDateEnd; //查询结束时间
private String pduCode; //数据唯一键 private String pduCode; //数据唯一键
private String shiftId; //班次
private List<DynamicColumnVo> productNames; //产品名称列表 private List<DynamicColumnVo> productNames; //产品名称列表
@ -94,4 +95,12 @@ public class MesMachineReport extends BaseEntity {
public void setPduCode(String pduCode) { public void setPduCode(String pduCode) {
this.pduCode = pduCode; this.pduCode = pduCode;
} }
public String getShiftId() {
return shiftId;
}
public void setShiftId(String shiftId) {
this.shiftId = shiftId;
}
} }

@ -81,4 +81,6 @@ public interface MesReportWorkConsumeMapper {
List<MesReportWorkConsume> getBomList(MesReportWorkConsume mesReportWorkConsume); List<MesReportWorkConsume> getBomList(MesReportWorkConsume mesReportWorkConsume);
MesReportWorkConsume getNewConsumeInfo(String workorderCode); MesReportWorkConsume getNewConsumeInfo(String workorderCode);
List<MesReportWorkConsume> getSumConsumeList(MesReportWorkConsume consumeqo);
} }

@ -369,6 +369,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
//人工 = sum每批的工时数*每批用人数) Sac2 //人工 = sum每批的工时数*每批用人数) Sac2
//子工单报工 //子工单报工
logger.info("==========================一层工单报工开始"); logger.info("==========================一层工单报工开始");
sHzWorks.setMachineCode(mesReportWork.getMachineCode());
sapRson = this.reportHzToSap(sHzWorks); sapRson = this.reportHzToSap(sHzWorks);
logger.info("==========================一层工单报工结束:"+JSONObject.toJSONString(sapRson)); logger.info("==========================一层工单报工结束:"+JSONObject.toJSONString(sapRson));
}else if(workOrders.size()==2){ }else if(workOrders.size()==2){
@ -381,10 +382,10 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
if(sHzWorks==null){ if(sHzWorks==null){
return R.fail("未查询到子报工单"); return R.fail("未查询到子报工单");
} }
//查询base_product的report_rate//箱子-大盒-小盒
BigDecimal reportRate = mesReportWorkMapper.getReportRate(workOrders.get(0).getProductCode());
//子工单报工 //子工单报工
logger.info("==========================子工单报工开始"); logger.info("==========================子工单报工开始");
sHzWorks.setMachineCode(mesReportWork.getMachineCode());
sapRson = this.reportHzToSap(sHzWorks); sapRson = this.reportHzToSap(sHzWorks);
logger.info("==========================子工单报工结束:"+JSONObject.toJSONString(sapRson)); logger.info("==========================子工单报工结束:"+JSONObject.toJSONString(sapRson));
if(sapRson.getCode()== 200){ if(sapRson.getCode()== 200){
@ -402,13 +403,15 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
} }
//母工单报工 //母工单报工
logger.info("==========================母工单报工开始"); logger.info("==========================母工单报工开始");
//查询base_product的report_rate//箱子-大盒-小盒
BigDecimal reportRate = mesReportWorkMapper.getReportRate(workOrders.get(1).getProductCode());
if(reportRate != null){ if(reportRate != null){
BigDecimal newQuantity = sHzWorks.getQuantityFeedback().divide(reportRate,2, RoundingMode.HALF_UP); BigDecimal newQuantity = sHzWorks.getQuantityFeedback().divide(reportRate,2, RoundingMode.HALF_UP);
pHzWork.setQuantityFeedback(newQuantity); pHzWork.setQuantityFeedback(newQuantity);
}else{ }else{
pHzWork.setQuantityFeedback(sHzWorks.getQuantityFeedback()); pHzWork.setQuantityFeedback(sHzWorks.getQuantityFeedback());
} }
pHzWork.setMachineCode(mesReportWork.getMachineCode());
//pHzWork.setSac2("4");//母单报工固定值(上位机插入数据时候默认4) //pHzWork.setSac2("4");//母单报工固定值(上位机插入数据时候默认4)
R sapR = this.reportHzToSap(pHzWork); R sapR = this.reportHzToSap(pHzWork);
logger.info("==========================母工单报工结束"+JSONObject.toJSONString(sapR)); logger.info("==========================母工单报工结束"+JSONObject.toJSONString(sapR));
@ -435,7 +438,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
} }
//三层以上工单报工 //三层以上工单报工
logger.info("==========================三层(第"+n+"层)以上工单("+sHzWorks.getWorkorderCodeSap()+")报工开始"); logger.info("==========================三层(第"+n+"层)以上工单("+sHzWorks.getWorkorderCodeSap()+")报工开始");
sHzWorks.setMachineCode(mesReportWork.getMachineCode());
sapRson = this.reportHzToSap(sHzWorks); sapRson = this.reportHzToSap(sHzWorks);
logger.info("==========================三层(第"+n+"层)以上工单("+sHzWorks.getWorkorderCodeSap()+")报工结束:" logger.info("==========================三层(第"+n+"层)以上工单("+sHzWorks.getWorkorderCodeSap()+")报工结束:"
+ JSONObject.toJSONString(sapRson)); + JSONObject.toJSONString(sapRson));
@ -476,7 +479,8 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
MesReportWorkConsume consumeqo = new MesReportWorkConsume(); MesReportWorkConsume consumeqo = new MesReportWorkConsume();
consumeqo.setWorkorderCode(workOrder.getWorkorderCode()); consumeqo.setWorkorderCode(workOrder.getWorkorderCode());
consumeqo.setRecoil("X"); consumeqo.setRecoil("X");
List<MesReportWorkConsume> consumes = mesReportWorkConsumeMapper.selectMesReportWorkConsumeList(consumeqo); consumeqo.setMachineCode(workOrder.getMachineCode());
List<MesReportWorkConsume> consumes = mesReportWorkConsumeMapper.getSumConsumeList(consumeqo);
if (!CollectionUtils.isEmpty(consumes)) { if (!CollectionUtils.isEmpty(consumes)) {
for (MesReportWorkConsume consume : consumes) { for (MesReportWorkConsume consume : consumes) {
SapRFW.lt_hw lthw = new SapRFW.lt_hw();//MES生产订单报工货物移动修改 SapRFW.lt_hw lthw = new SapRFW.lt_hw();//MES生产订单报工货物移动修改

@ -622,6 +622,8 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
} }
private List<String> getDateInterval(String start, String end) { private List<String> getDateInterval(String start, String end) {
start = start.substring(0,10);
end = end.substring(0,10);
DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd"); DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd");
List<String> dateList = Lists.newArrayList(); List<String> dateList = Lists.newArrayList();

@ -103,7 +103,7 @@
where del_flag = '0' where del_flag = '0'
</select> </select>
<select id="getConsumeList" resultType="com.op.mes.domain.MesReportWorkConsume"> <select id="getConsumeList" resultType="com.op.mes.domain.MesReportWorkConsume">
select mrwc.record_id recordId, select DISTINCT mrwc.record_id recordId,
mrwc.workorder_code workorderCode, mrwc.workorder_code workorderCode,
mrwc.material_code materialCode, mrwc.material_code materialCode,
mrwc.material_name materialName, mrwc.material_name materialName,
@ -115,8 +115,9 @@
mrwc.attr1, mrwc.attr1,
mrwc.warehouse_code warehouseCode, mrwc.warehouse_code warehouseCode,
mpd.quantity planQuantity, mpd.quantity planQuantity,
mrwc.parent_order parentOrder mrwc.parent_order parentOrder,mrwc.report_code reportCode
from mes_report_work_consume mrwc from mes_report_work_consume mrwc
left join mes_report_work mrw on mrw.report_code = mrwc.report_code
left join pro_order_workorder pow on mrwc.workorder_code = pow.workorder_code left join pro_order_workorder pow on mrwc.workorder_code = pow.workorder_code
left join mes_prepare mp on mp.workorder_code = pow.workorder_code and mp.del_flag='0' left join mes_prepare mp on mp.workorder_code = pow.workorder_code and mp.del_flag='0'
left join mes_prepare_detail mpd on mpd.prepare_id = mp.prepare_id left join mes_prepare_detail mpd on mpd.prepare_id = mp.prepare_id
@ -125,9 +126,9 @@
where mrwc.del_flag = '0' and pow.del_flag = '0' where mrwc.del_flag = '0' and pow.del_flag = '0'
and mrwc.workorder_code = #{workorderCode} and mrwc.workorder_code = #{workorderCode}
<if test="machineCode!=''"> <if test="machineCode!=''">
and pow.workorder_name = #{machineCode} and mrw.machine_code = #{machineCode}
</if> </if>
order by mrwc.recoil,mrwc.attr1 order by mrwc.report_code,mrwc.recoil,mrwc.attr1
</select> </select>
<select id="getSonConsumeList" resultType="com.op.mes.domain.MesReportWorkConsume"> <select id="getSonConsumeList" resultType="com.op.mes.domain.MesReportWorkConsume">
select mrwc.record_id recordId, select mrwc.record_id recordId,
@ -169,6 +170,21 @@
from mes_report_work_consume from mes_report_work_consume
where workorder_code = #{workorderCode} and del_flag = '0' where workorder_code = #{workorderCode} and del_flag = '0'
</select> </select>
<select id="getSumConsumeList" resultType="com.op.mes.domain.MesReportWorkConsume">
select t.materialCode,
sum(t.quantity) quantity
from(
select DISTINCT
mrwc.material_code materialCode,
mrwc.quantity
from mes_report_work_consume mrwc
left join mes_report_work mrw on mrw.report_code = mrwc.report_code
left join pro_order_workorder pow on mrwc.workorder_code = pow.workorder_code
where mrwc.del_flag = '0' and pow.del_flag = '0'
and mrwc.workorder_code = #{workorderCode}
and mrw.machine_code = #{machineCode} and mrwc.recoil = #{recoil}
) t group by t.materialCode
</select>
<insert id="insertMesReportWorkConsume" parameterType="MesReportWorkConsume"> <insert id="insertMesReportWorkConsume" parameterType="MesReportWorkConsume">
insert into mes_report_work_consume insert into mes_report_work_consume

@ -563,7 +563,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mrw.use_man useMan, mrw.use_man useMan,
mrw.create_time createTime, mrw.create_time createTime,
pow.workorder_code_sap workorderCodeSap, pow.workorder_code_sap workorderCodeSap,
mrw.remark mrw.remark,mrw.report_code reportCode
from mes_report_work mrw from mes_report_work mrw
left join pro_order_workorder pow on mrw.workorder_code = pow.workorder_code left join pro_order_workorder pow on mrw.workorder_code = pow.workorder_code
where mrw.del_flag='0' and pow.del_flag = '0' where mrw.del_flag='0' and pow.del_flag = '0'
@ -766,6 +766,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) mt ) mt
LEFT JOIN pro_order_workorder pow ON pow.workorder_id = mt.OrderCode LEFT JOIN pro_order_workorder pow ON pow.workorder_id = mt.OrderCode
WHERE pow.order_code IS NOT NULL WHERE pow.order_code IS NOT NULL
<if test="shiftId != null and shiftId != ''">
and pow.shift_id = #{shiftId}
</if>
<if test="productCode != null and productCode != ''"> <if test="productCode != null and productCode != ''">
and pow.product_code like concat('%', #{productCode}, '%') and pow.product_code like concat('%', #{productCode}, '%')
</if> </if>
@ -936,6 +939,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where 1=1 where 1=1
<if test="id != null">and id = #{id}</if> <if test="id != null">and id = #{id}</if>
<if test="workorderCode != null">and workorder_code = #{workorderCode}</if> <if test="workorderCode != null">and workorder_code = #{workorderCode}</if>
<if test="machineCode != null">and machine_code = #{machineCode}</if>
</update> </update>
<update id="updateOrderWorkStatus"> <update id="updateOrderWorkStatus">
update pro_order_workorder update pro_order_workorder
@ -962,7 +966,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
upload_time = null, upload_time = null,
upload_status = '0', upload_status = '0',
upload_msg = null upload_msg = null
where workorder_code = #{workorderCode} or parent_order = #{workorderCode} where (workorder_code = #{workorderCode} or parent_order = #{workorderCode})
<if test="machineCode != null">and machine_code = #{machineCode}</if>
</update> </update>
<update id="updateAttr2"> <update id="updateAttr2">
update mes_report_work_consume update mes_report_work_consume
@ -973,6 +978,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<foreach collection="list" item="item" separator=";"> <foreach collection="list" item="item" separator=";">
update mes_report_work set remark = #{item.remark} update mes_report_work set remark = #{item.remark}
where workorder_code = #{item.workorderCode} where workorder_code = #{item.workorderCode}
<if test="item.reportCode != null">and report_code = #{item.reportCode}</if>
</foreach> </foreach>
</update> </update>

@ -85,6 +85,26 @@ public class QcCheckProject extends BaseEntity {
private String materialCode; private String materialCode;
private String typeCode; private String typeCode;
private String groupId; private String groupId;
@Excel(name = "检测项分类",readConverterExp = "0=内容物,1=包装")
private String itemType;
@Excel(name = "合格判定比例")
private String judgeRate;
public String getItemType() {
return itemType;
}
public void setItemType(String itemType) {
this.itemType = itemType;
}
public String getJudgeRate() {
return judgeRate;
}
public void setJudgeRate(String judgeRate) {
this.judgeRate = judgeRate;
}
public String getProjectType() { public String getProjectType() {
return projectType; return projectType;

@ -138,6 +138,33 @@ public class QcCheckTaskDetail extends BaseEntity {
private String defectCodes; private String defectCodes;
private String defectNames; private String defectNames;
private String defectQualitys; private String defectQualitys;
private String itemType;
private String judgeRate;
private String samplePlan;
public String getSamplePlan() {
return samplePlan;
}
public void setSamplePlan(String samplePlan) {
this.samplePlan = samplePlan;
}
public String getItemType() {
return itemType;
}
public void setItemType(String itemType) {
this.itemType = itemType;
}
public String getJudgeRate() {
return judgeRate;
}
public void setJudgeRate(String judgeRate) {
this.judgeRate = judgeRate;
}
public String getDefectCodes() { public String getDefectCodes() {
return defectCodes; return defectCodes;

@ -111,6 +111,24 @@ public class QcCheckTypeProject extends BaseEntity {
private String checkMode; private String checkMode;
private String unit; private String unit;
private String weight; private String weight;
private String itemType;
private String judgeRate;
public String getItemType() {
return itemType;
}
public void setItemType(String itemType) {
this.itemType = itemType;
}
public String getJudgeRate() {
return judgeRate;
}
public void setJudgeRate(String judgeRate) {
this.judgeRate = judgeRate;
}
public String getWeight() { public String getWeight() {
return weight; return weight;

@ -65,6 +65,7 @@ public interface QcCheckProjectMapper {
public QcCheckProject selectSerialNumber(); public QcCheckProject selectSerialNumber();
public QcCheckProject selectCheckProjectByRuleName(@Param("ruleName") String ruleName, public QcCheckProject selectCheckProjectByRuleName(@Param("ruleName") String ruleName,
@Param("projectType") String projectType); @Param("projectType") String projectType,
@Param("sort") String sort);
} }

@ -86,5 +86,4 @@ public interface QcCheckTaskProduceMapper {
public List<QcCheckTaskProduce> getOrderWorksW2(ProOrderWorkorderDTO qoWork); public List<QcCheckTaskProduce> getOrderWorksW2(ProOrderWorkorderDTO qoWork);
public QcCheckTaskProduce getLastXJTask(QcCheckTaskProduce productTask); public QcCheckTaskProduce getLastXJTask(QcCheckTaskProduce productTask);
} }

@ -65,4 +65,6 @@ public interface QcCheckTaskWarehousingMapper {
int getTodayMaxNum(QcCheckTaskWarehousing qcCheckTaskWarehousing); int getTodayMaxNum(QcCheckTaskWarehousing qcCheckTaskWarehousing);
List<QcCheckTaskWarehousing> getQcListLoc(QcCheckTaskWarehousing qcCheckTaskWarehousing); List<QcCheckTaskWarehousing> getQcListLoc(QcCheckTaskWarehousing qcCheckTaskWarehousing);
int updateWorkOrderStauts(QcCheckTaskWarehousing qcCheckTaskWarehousing);
} }

@ -154,7 +154,8 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService {
if (checkResult.isSuccess()) { if (checkResult.isSuccess()) {
for (QcCheckProject project : projectList) { for (QcCheckProject project : projectList) {
try { try {
QcCheckProject pro = qcCheckProjectMapper.selectCheckProjectByRuleName(project.getRuleName(), project.getProjectType()); QcCheckProject pro = qcCheckProjectMapper.selectCheckProjectByRuleName(project.getRuleName(),
project.getProjectType(),project.getSort().toString());
if (ObjectUtils.isEmpty(pro)) { if (ObjectUtils.isEmpty(pro)) {
BeanValidators.validateWithException(validator, project); BeanValidators.validateWithException(validator, project);
project.setId(IdUtils.fastSimpleUUID()); project.setId(IdUtils.fastSimpleUUID());

@ -537,7 +537,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
List<QcCheckTaskIncome> dtos = qcCheckUnqualifiedMapper.getProductWorkOrder(qcCheckTaskIncome); List<QcCheckTaskIncome> dtos = qcCheckUnqualifiedMapper.getProductWorkOrder(qcCheckTaskIncome);
for(QcCheckTaskIncome dto:dtos){ for(QcCheckTaskIncome dto:dtos){
String statusName = ""; String statusName = "";
if("w5".equals(dto.getStatus())){ if("w5".equals(dto.getStatus())){//设计有问题TODO
statusName = "质检完成"; statusName = "质检完成";
}else{ }else{
statusName = "质检未完成"; statusName = "质检未完成";

@ -253,7 +253,13 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
item.setFactoryCode(factoryCode); item.setFactoryCode(factoryCode);
item.setStatus("Y"); item.setStatus("Y");
} }
return qcCheckTaskDetailMapper.addBatch(items); int s = qcCheckTaskDetailMapper.addBatch(items);
// /**pro_order_workorder**/
// qcCheckTaskWarehousing.setStatus("w6");
// qcCheckTaskWarehousingMapper.updateWorkOrderStauts(qcCheckTaskWarehousing);
logger.info("qc_check_task_detail:"+s+"成功");
return 1;
} }
/** /**
@ -370,20 +376,18 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
List<QcCheckTaskProduce> w3works = qcCheckTaskProduceMapper.getOrderWorksW2(qoWork); List<QcCheckTaskProduce> w3works = qcCheckTaskProduceMapper.getOrderWorksW2(qoWork);
for(QcCheckTaskProduce productTask:w3works){ for(QcCheckTaskProduce productTask:w3works){
QcCheckTaskWarehousing cpTask = new QcCheckTaskWarehousing(); QcCheckTaskWarehousing cpTask = new QcCheckTaskWarehousing();
BeanUtils.copyProperties(productTask,cpTask);
productTask.setCheckType("checkTypeCP");//入库检验 productTask.setCheckType("checkTypeCP");//入库检验
productTask.setOrderNo(productTask.getWorkorderCode()); productTask.setOrderNo(productTask.getWorkorderCode());
BeanUtils.copyProperties(productTask,cpTask);
// //是否已经存在入库检验 //是否已经存在入库检验
// QcCheckTaskProduce cpTask0 = qcCheckTaskProduceMapper.getLastXJTask(productTask); QcCheckTaskProduce cpTask0 = qcCheckTaskProduceMapper.getLastXJTask(productTask);
// if(cpTask0 == null){ if(cpTask0 != null){
// logger.info("++++++++++++入库检验任务生成:已经存在++++++++++++++"); logger.info("++++++++++++入库检验任务生成:已经存在++++++++++++++");
// }else{ }else{
// int m = insertQcCheckTaskWarehousing(cpTask); int m = insertQcCheckTaskWarehousing(cpTask);
// logger.info("++++++++++++入库检验任务生成" + m + "++++++++++++++"); logger.info("++++++++++++入库检验任务生成" + m + "++++++++++++++");
// } }
} }
logger.info("++++++++++++" + poolName + "++++入库检验巡检结束++++++++++"); logger.info("++++++++++++" + poolName + "++++入库检验巡检结束++++++++++");
} }

@ -25,13 +25,16 @@
<result property="defectLevel" column="defect_level"/> <result property="defectLevel" column="defect_level"/>
<result property="projectType" column="project_type"/> <result property="projectType" column="project_type"/>
<result property="sort" column="sort" /> <result property="sort" column="sort" />
<result property="itemType" column="item_type" />
<result property="judgeRate" column="judge_rate" />
</resultMap> </resultMap>
<sql id="selectQcCheckProjectVo"> <sql id="selectQcCheckProjectVo">
select id, order_num, rule_name, property_code, check_mode, check_tool, unit_code, check_standard, select id, order_num, rule_name, property_code, check_mode, check_tool, unit_code, check_standard,
attr1, create_by, create_time, update_by, update_time, factory_code, del_flag,sample_plan, attr1, create_by, create_time, update_by, update_time, factory_code, del_flag,sample_plan,
judge,defect_level,project_type,sort judge,defect_level,project_type,sort,item_type,judge_rate
from qc_check_project
from qc_check_project
</sql> </sql>
<select id="selectQcCheckProjectList" parameterType="QcCheckProject" resultMap="QcCheckProjectResult"> <select id="selectQcCheckProjectList" parameterType="QcCheckProject" resultMap="QcCheckProjectResult">
@ -81,6 +84,8 @@
<if test="defectLevel != null">defect_level,</if> <if test="defectLevel != null">defect_level,</if>
<if test="projectType != null">project_type,</if> <if test="projectType != null">project_type,</if>
<if test="sort != null">sort,</if> <if test="sort != null">sort,</if>
<if test="itemType != null">item_type,</if>
<if test="judgeRate != null">judge_rate,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if> <if test="id != null">#{id},</if>
@ -103,6 +108,8 @@
<if test="defectLevel != null">#{defectLevel},</if> <if test="defectLevel != null">#{defectLevel},</if>
<if test="projectType != null">#{projectType},</if> <if test="projectType != null">#{projectType},</if>
<if test="sort != null">#{sort},</if> <if test="sort != null">#{sort},</if>
<if test="itemType != null">#{itemType},</if>
<if test="judgeRate != null">#{judgeRate},</if>
</trim> </trim>
</insert> </insert>
@ -128,6 +135,8 @@
<if test="defectLevel != null">defect_level = #{defectLevel},</if> <if test="defectLevel != null">defect_level = #{defectLevel},</if>
<if test="projectType != null">project_type = #{projectType},</if> <if test="projectType != null">project_type = #{projectType},</if>
<if test="sort != null">sort = #{sort},</if> <if test="sort != null">sort = #{sort},</if>
<if test="itemType != null">item_type = #{itemType},</if>
<if test="judgeRate != null">judge_rate = #{judgeRate},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
@ -151,7 +160,7 @@
<select id="selectCheckProjectByRuleName" resultMap="QcCheckProjectResult"> <select id="selectCheckProjectByRuleName" resultMap="QcCheckProjectResult">
<include refid="selectQcCheckProjectVo"/> <include refid="selectQcCheckProjectVo"/>
where rule_name = #{ruleName} and project_type = #{projectType} where rule_name = #{ruleName} and project_type = #{projectType} and sort = #{sort}
</select> </select>
</mapper> </mapper>

@ -153,7 +153,9 @@
qctp.upper_diff upperDiff, qctp.upper_diff upperDiff,
qctp.down_diff downDiff, qctp.down_diff downDiff,
qctp.sample, qctp.sample,
qctp.sample_num sampleNum, qcp.sample_plan samplePlan,
qctp.item_type itemType,
qctp.judge_rate judgeRate,
qpt.standard_no standardNo qpt.standard_no standardNo
from qc_check_task_detail td from qc_check_task_detail td
left join qc_check_type_project qctp on td.type_project_id = qctp.id left join qc_check_type_project qctp on td.type_project_id = qctp.id

@ -434,8 +434,8 @@
left join base_equipment be on be.equipment_code = pow.workorder_name and be.equipment_type_code = 'equ_type_bzx' left join base_equipment be on be.equipment_code = pow.workorder_name and be.equipment_type_code = 'equ_type_bzx'
where pow.del_flag = '0' where pow.del_flag = '0'
and pow.status = #{status} and pow.parent_order = '0' and pow.status = #{status} and pow.parent_order = '0'
<!--and (pow.product_date = CONVERT(varchar(10),GETDATE(), 120) <!---->and (pow.product_date = CONVERT(varchar(10),GETDATE(), 120)
or pow.product_date = CONVERT(varchar(10),DATEADD(DAY, -1, GETDATE()), 120))--> or pow.product_date = CONVERT(varchar(10),DATEADD(DAY, -1, GETDATE()), 120))
</select> </select>
<select id="getLastXJTask" resultType="com.op.quality.domain.QcCheckTaskProduce"> <select id="getLastXJTask" resultType="com.op.quality.domain.QcCheckTaskProduce">
select top 1 select top 1
@ -454,9 +454,10 @@
qct.confirm_man_code confirmManCode, qct.confirm_man_code confirmManCode,
qct.confirm_man_name confirmManName qct.confirm_man_name confirmManName
from qc_check_task qct from qc_check_task qct
where qct.check_type = 'checkTypeSCXJ' and qct.del_flag = '0' where qct.check_type = #{checkType} and qct.del_flag = '0'
and qct.del_flag = '0' and qct.order_no = #{workorderCode} and qct.del_flag = '0' and qct.order_no = #{workorderCode}
<!--and CONVERT(varchar(10),qct.income_time, 120) = CONVERT(varchar(10),GETDATE(), 120)--> <!--and CONVERT(varchar(10),qct.income_time, 120) = CONVERT(varchar(10),GETDATE(), 120)-->
order by qct.create_time desc order by qct.create_time desc
</select> </select>
</mapper> </mapper>

@ -213,6 +213,9 @@
</trim> </trim>
where record_id = #{recordId} where record_id = #{recordId}
</update> </update>
<update id="updateWorkOrderStauts">
update pro_order_workorder set status = #{status} where workorder_code = #{orderNo} and del_flag = '0'
</update>
<delete id="deleteQcCheckTaskWarehousingByRecordId" parameterType="String"> <delete id="deleteQcCheckTaskWarehousingByRecordId" parameterType="String">
delete from qc_check_task where record_id = #{recordId} delete from qc_check_task where record_id = #{recordId}

@ -216,7 +216,8 @@
standard_value,upper_diff,down_diff,unit, standard_value,upper_diff,down_diff,unit,
sample,sort, sample,sort,
create_by,create_time, create_by,create_time,
group_id,material_code,property_code group_id,material_code,property_code,
item_type,judge_rate
)values )values
<foreach collection="list" index="index" item="item" separator=","> <foreach collection="list" index="index" item="item" separator=",">
( (
@ -224,7 +225,8 @@
#{item.standardValue},#{item.upperDiff},#{item.downDiff},#{item.unit}, #{item.standardValue},#{item.upperDiff},#{item.downDiff},#{item.unit},
#{item.sample},#{item.sort}, #{item.sample},#{item.sort},
#{item.createBy},#{item.createTime}, #{item.createBy},#{item.createTime},
#{item.groupId},#{item.materialCode},#{item.propertyCode} #{item.groupId},#{item.materialCode},#{item.propertyCode},
#{item.itemType},#{item.judgeRate}
) )
</foreach> </foreach>
</insert> </insert>
@ -270,18 +272,20 @@
</delete> </delete>
<select id="getProjectInfoList" resultType="com.op.quality.domain.QcCheckProject"> <select id="getProjectInfoList" resultType="com.op.quality.domain.QcCheckProject">
select select
id, id,
order_num orderNum, order_num orderNum,
rule_name ruleName, rule_name ruleName,
property_code propertyCode, property_code propertyCode,
check_mode checkMode, check_mode checkMode,
check_tool checkTool, check_tool checkTool,
unit_code unitCode, unit_code unitCode,
check_standard checkStandard, check_standard checkStandard,
sample_plan samplePlan, sample_plan samplePlan,
sort, sort,
judge , judge ,
defect_level defectLevel defect_level defectLevel,
item_type itemType,
judge_rate judgeRate
from qc_check_project from qc_check_project
where del_flag = '0' where del_flag = '0'
<if test="projectType != null">and project_type = #{projectType}</if> <if test="projectType != null">and project_type = #{projectType}</if>
@ -292,6 +296,7 @@
<if test="samplePlan != null">and sample_plan = #{samplePlan}</if> <if test="samplePlan != null">and sample_plan = #{samplePlan}</if>
<if test="materialCode != null">and material_code = #{materialCode}</if> <if test="materialCode != null">and material_code = #{materialCode}</if>
) )
order by sort
</select> </select>
<select id="getProjectOptions" resultType="com.op.quality.domain.QcProjectType"> <select id="getProjectOptions" resultType="com.op.quality.domain.QcProjectType">
select project_type_code projectTypeCode, select project_type_code projectTypeCode,

Loading…
Cancel
Save