质量点检定时任务

highway
zhaoxiaolin 1 year ago
parent c044825dd4
commit 6974fa79fa

@ -29,6 +29,12 @@ public class WCSDTO {
private String spec;
private String productionState;
private List<WCSDataDTO> stationNos;
private String workorderId;
private String bucketCode;
private String materialCode;
private String materialName;
private String shiftId;
private String workorderCode;
public List<WCSDataDTO> getStationNos() {
return stationNos;
@ -161,4 +167,52 @@ public class WCSDTO {
public void setData(List<WCSDataDTO> data) {
this.data = data;
}
public String getWorkorderId() {
return workorderId;
}
public void setWorkorderId(String workorderId) {
this.workorderId = workorderId;
}
public String getBucketCode() {
return bucketCode;
}
public void setBucketCode(String bucketCode) {
this.bucketCode = bucketCode;
}
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 getShiftId() {
return shiftId;
}
public void setShiftId(String shiftId) {
this.shiftId = shiftId;
}
public String getWorkorderCode() {
return workorderCode;
}
public void setWorkorderCode(String workorderCode) {
this.workorderCode = workorderCode;
}
}

@ -143,14 +143,14 @@ public class EquPlan extends BaseEntity {
// 是否停机保养
private String shutDown;
private String planEquCode;
private String planEquId;
public String getPlanEquCode() {
return planEquCode;
public String getPlanEquId() {
return planEquId;
}
public void setPlanEquCode(String planEquCode) {
this.planEquCode = planEquCode;
public void setPlanEquId(String planEquId) {
this.planEquId = planEquId;
}
public String getUpkeep() {

@ -20,5 +20,5 @@ public interface DeviceTaskMapper {
List<EquPlan> getPlans(EquPlan equPlan);
EquOrder getNewTaskOrder(EquOrder equOrder);
EquOrder getNewTaskOrder(EquPlan quPlan);
}

@ -3,6 +3,8 @@ package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquCheckItemDetail;
import com.op.device.domain.EquOrder;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
@ -10,6 +12,7 @@ import com.op.device.domain.EquCheckItemDetail;
* @author wws
* @date 2023-10-10
*/
@Mapper
public interface EquCheckItemDetailMapper {
/**
*
@ -91,4 +94,5 @@ public interface EquCheckItemDetailMapper {
* @return
*/
List<EquCheckItemDetail> selectCheckItemDetailByItemCode(String itemCode);
}

@ -3,6 +3,9 @@ package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquOrderDetail;
import com.op.device.domain.EquPlanDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* -Mapper
@ -10,6 +13,7 @@ import com.op.device.domain.EquOrderDetail;
* @author Open Platform
* @date 2023-10-23
*/
@Mapper
public interface EquOrderDetailMapper {
/**
* -
@ -72,4 +76,6 @@ public interface EquOrderDetailMapper {
* @return
*/
List<EquOrderDetail> selectEquOrderDetailByOrderCode(String orderCode);
int insertEquOrderDetails(@Param("list") List<EquPlanDetail> details);
}

@ -3,6 +3,8 @@ package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquOrderEqu;
import com.op.device.domain.EquPlanEqu;
import org.apache.ibatis.annotations.Param;
/**
* -Mapper
@ -65,4 +67,7 @@ public interface EquOrderEquMapper {
* @return
*/
EquOrderEqu selectEquOrderEquListByParentCode(String orderCode);
int insertEquOrderEqus(@Param("list") List<EquPlanEqu> equs);
}

@ -4,6 +4,7 @@ import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.device.domain.EquOrder;
import com.op.device.domain.EquPlan;
import com.op.device.domain.dto.PDADTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -118,4 +119,5 @@ public interface EquOrderMapper {
* @return
*/
List<EquOrder> selectTodayTask(PDADTO pdadto);
}

@ -3,6 +3,8 @@ package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquOrderPerson;
import com.op.device.domain.EquPlanPerson;
import org.apache.ibatis.annotations.Param;
/**
* -Mapper
@ -65,4 +67,6 @@ public interface EquOrderPersonMapper {
* @return
*/
List<String> selectEquOrderPersonByOrderCode(String orderCode);
int insertEquOrderPlans(@Param("list") List<EquPlanPerson> persons);
}

@ -5,6 +5,8 @@ import java.util.List;
import com.op.common.core.domain.BaseFileData;
import com.op.device.domain.EquOrder;
import com.op.device.domain.EquOrderStandard;
import com.op.device.domain.EquPlanStandard;
import org.apache.ibatis.annotations.Param;
/**
* -Mapper
@ -80,4 +82,6 @@ public interface EquOrderStandardMapper {
* @return
*/
public List<EquOrderStandard> selectPdaEquOrderList(EquOrder equOrder);
int insertEquOrderStandards(@Param("list") List<EquPlanStandard> standards);
}

@ -2,6 +2,7 @@ package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquPlan;
import com.op.device.domain.EquPlanDetail;
/**
@ -84,4 +85,6 @@ public interface EquPlanDetailMapper {
* @return
*/
List<EquPlanDetail> selectEquPlanDetailListByParentCode(String code);
List<EquPlanDetail> selectPlanDetailList(EquPlan plan);
}

@ -1,6 +1,8 @@
package com.op.device.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.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
import com.op.device.domain.*;
@ -10,8 +12,10 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import static com.op.common.core.web.domain.AjaxResult.error;
@ -32,6 +36,26 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
@Autowired
private EquOrderMapper equOrderMapper;
@Autowired
private EquOrderDetailMapper equOrderDetailMapper;
@Autowired
private EquPlanDetailMapper equPlanDetailMapper;
@Autowired
private EquPlanEquMapper equPlanEquMapper;
@Autowired
private EquOrderEquMapper equOrderEquMapper;
@Autowired
private EquPlanStandardMapper equPlanStandardMapper;
@Autowired
private EquOrderStandardMapper equOrderStandardMapper;
@Autowired
private EquPlanPersonMapper equPlanPersonMapper;
@Autowired
private EquOrderPersonMapper equOrderPersonMapper;
/**
*
* **/
@ -42,13 +66,12 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
equPlan.setPlanType("spotInspection");
List<EquPlan> plans = deviceTaskMapper.getPlans(equPlan);
for(EquPlan plan:plans){
if("day".equals(plan.getPlanLoopType())){
EquOrder order = new EquOrder();
order.setPlanType("spotInspection");
EquOrder hasTask = deviceTaskMapper.getNewTaskOrder(order);
if(hasTask==null || Integer.parseInt(plan.getPlanLoop())<= hasTask.getDays()){
//生成点检计划
this.createSpotCheckPlan(plan);
EquOrder hasTask = deviceTaskMapper.getNewTaskOrder(plan);
if(hasTask==null || Integer.parseInt(plan.getPlanLoop())<= hasTask.getDays()){
//生成点检计划
int m = this.createSpotCheckPlan(plan);
if(m==0){
error("equ_order相关添加失败");
}
}
}
@ -57,13 +80,95 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
}
private int createSpotCheckPlan(EquPlan plan){
/**equ_order**/
Date nowtime = DateUtils.getNowDate();
String createBy = SecurityUtils.getUsername();
int sce = 0;
/**equ_plan->equ_order********************************************************************/
EquOrder order = new EquOrder();
//源->目标
BeanUtils.copyProperties(plan,order);
equOrderMapper.insertEquOrder(order);
/**equ_order_detail**/
List<EquOrderDetail> details = new ArrayList<>();
order.setOrderId(IdUtils.fastSimpleUUID());
order.setCreateBy(createBy);
order.setCreateTime(nowtime);
// 流水号
String serialNum = String.format("%03d",equOrderMapper.selectSerialNumber());
String orderCode = "O"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD)+serialNum;
order.setOrderCode(orderCode);
/**equ_order**/
sce = equOrderMapper.insertEquOrder(order);
/**equ_plan_equ->equ_order_equ*************************************************************/
EquPlanEqu equPlanEqu = new EquPlanEqu();
equPlanEqu.setId(plan.getPlanEquId());
List<EquPlanEqu> equs = equPlanEquMapper.selectEquPlanEquList(equPlanEqu);
if(CollectionUtils.isEmpty(equs)){
return 0;
}
String orderEquId = IdUtils.fastSimpleUUID();
//equs一定就一个实值
for(EquPlanEqu equ:equs){
equ.setId(orderEquId);
equ.setCreateTime(nowtime);
equ.setCreateBy(createBy);
equ.setDelFlag("0");
equ.setCode(orderCode);
}
sce = equOrderEquMapper.insertEquOrderEqus(equs);
/**equ_plan_detail->equ_order_detail*******************************************************/
EquPlanDetail itqo = new EquPlanDetail();
itqo.setParentCode(plan.getPlanEquId());
itqo.setDelFlag("0");
List<EquPlanDetail> details = equPlanDetailMapper.selectEquPlanDetailList(itqo);
if(CollectionUtils.isEmpty(details)){
return 0;
}
return 0;
List<EquPlanStandard> standards = new ArrayList<>();
List<EquPlanStandard> standards0 = null;
for(EquPlanDetail itme:details){
String detailId = IdUtils.fastSimpleUUID();
EquPlanStandard standardqo = new EquPlanStandard();
//equ_plan_detail的id
standardqo.setParentCode(itme.getId());
standards0 = equPlanStandardMapper.selectEquPlanStandardList(standardqo);
for(EquPlanStandard standard:standards0) {
standard.setId(IdUtils.fastSimpleUUID());
standard.setCreateTime(nowtime);
standard.setCreateBy(createBy);
standard.setDelFlag("0");
standard.setPlanCode(orderCode);
standard.setParentCode(detailId);
}
standards.addAll(standards0);
itme.setId(detailId);
itme.setCreateTime(nowtime);
itme.setCreateBy(createBy);
itme.setDelFlag("0");
itme.setParentCode(orderEquId);
}
sce = equOrderDetailMapper.insertEquOrderDetails(details);
/**equ_plan_standard->equ_order_standard*******************************************************/
if(CollectionUtils.isEmpty(standards)){
return 0;
}
sce = equOrderStandardMapper.insertEquOrderStandards(standards);
/**equ_plan_person->equ_order_person*********************************************************/
EquPlanPerson equPlanPerson = new EquPlanPerson();
equPlanPerson.setPlanCode(plan.getPlanCode());
List<EquPlanPerson> persons = equPlanPersonMapper.selectEquPlanPersonList(equPlanPerson);
if(CollectionUtils.isEmpty(persons)){
return 0;
}
for(EquPlanPerson person:persons){
person.setId(IdUtils.fastSimpleUUID());
person.setCreateTime(nowtime);
person.setCreateBy(createBy);
person.setDelFlag("0");
person.setPlanCode(orderCode);
}
sce = equOrderPersonMapper.insertEquOrderPlans(persons);
return sce;
}
}

@ -5,7 +5,8 @@
<mapper namespace="com.op.device.mapper.DeviceTaskMapper">
<select id="getPlans" resultType="com.op.device.domain.EquPlan">
select ep.plan_code planCode,
select ep.plan_workshop planWorkshop,
ep.plan_code planCode,
ep.plan_name planName,
ep.plan_loop planLoop,
ep.plan_loop_type planLoopType,
@ -15,7 +16,8 @@
ep.plan_type planType,
ep.plan_outsource planOutsource,
epe.equipment_code equipmentCode,
epe.equipment_name equipmentName
epe.equipment_name equipmentName,
epe.id planEquId
from equ_plan ep
left join equ_plan_equ epe on ep.plan_code = epe.plan_code
where ep.del_flag = '0' and epe.del_flag = '0' and ep.plan_status = '0'
@ -25,9 +27,13 @@
<select id="getNewTaskOrder" resultType="com.op.device.domain.EquOrder">
select top 1 order_code orderCode,
create_time createTime,
DATEDIFF (day, create_time, GETDATE()) days
<if test='planLoopType=="day"'> DATEDIFF (day, create_time, GETDATE()) days </if>
<if test='planLoopType=="week"'> DATEDIFF (week, create_time, GETDATE()) days </if>
<if test='planLoopType=="month"'> DATEDIFF (month, create_time, GETDATE()) days </if>
<if test='planLoopType=="season"'> DATEDIFF (month, create_time, GETDATE())/3 days </if>
<if test='planLoopType=="year"'> DATEDIFF (year, create_time, GETDATE()) days </if>
from equ_order
where plan_type = #{planType}
where plan_type = #{planType} and plan_code = #{planCode}
order by create_time desc
</select>
</mapper>

@ -25,7 +25,9 @@
</resultMap>
<sql id="selectEquCheckItemDetailVo">
select detail_id, parent_code, standard_type, standard_name, factory_code, detail_up_limit, detail_down_limit, detail_unit, attr1, attr2, attr3, del_flag, create_time, create_by, update_time, update_by, detail_code from equ_check_item_detail
select detail_id, parent_code, standard_type, standard_name, factory_code, detail_up_limit, detail_down_limit,
detail_unit, attr1, attr2, attr3, del_flag, create_time, create_by, update_time, update_by, detail_code
from equ_check_item_detail
</sql>
<select id="selectEquCheckItemDetailList" parameterType="EquCheckItemDetail" resultMap="EquCheckItemDetailResult">
@ -160,4 +162,4 @@
where parent_code = (
select item_code from equ_check_item where item_id = #{itemId} )
</delete>
</mapper>
</mapper>

@ -26,7 +26,10 @@
</resultMap>
<sql id="selectEquOrderDetailVo">
select id, code, order_code, parent_code, item_code, item_name, item_method, item_type, item_type_name, factroy_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_order_detail
select id, code, order_code, parent_code, item_code, item_name, item_method,
item_type, item_type_name, factroy_code, attr1, attr2, attr3, del_flag,
create_by, create_time, update_by, update_time
from equ_order_detail
</sql>
<select id="selectEquOrderDetailList" parameterType="EquOrderDetail" resultMap="EquOrderDetailResult">
@ -106,6 +109,25 @@
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<insert id="insertEquOrderDetails">
insert into equ_order_detail
(
id, parent_code,
item_code, item_name, item_method,
item_type, item_type_name, factroy_code, del_flag,
create_by, create_time
)
VALUES
<foreach collection="list" index="index" item="item" separator=",">
(
#{item.id},#{item.parentCode},
#{item.itemCode},#{item.itemName},#{item.itemMethod},
#{item.itemType},#{item.itemTypeName},#{item.factroyCode},#{item.delFlag},
#{item.createBy},#{item.createTime}
)
</foreach>
</insert>
<update id="updateEquOrderDetail" parameterType="EquOrderDetail">
update equ_order_detail
@ -141,4 +163,4 @@
#{id}
</foreach>
</delete>
</mapper>
</mapper>

@ -89,6 +89,18 @@
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<insert id="insertEquOrderEqus">
insert into equ_order_equ(
id,order_code,equipment_code, equipment_name,
factory_code,del_flag, create_by, create_time
)values
<foreach collection="list" index="index" item="item" separator=",">
(
#{item.id},#{item.code},#{item.equipmentCode},#{item.equipmentName},
#{item.factoryCode},#{item.delFlag},#{item.createBy},#{item.createTime}
)
</foreach>
</insert>
<update id="updateEquOrderEqu" parameterType="EquOrderEqu">
update equ_order_equ
@ -121,4 +133,4 @@
#{id}
</foreach>
</delete>
</mapper>
</mapper>

@ -42,7 +42,12 @@
</resultMap>
<sql id="selectEquOrderVo">
select order_id, plan_id, plan_code, plan_type, order_code, plan_workshop, plan_prod_line, plan_loop, plan_loop_type, plan_loop_start, plan_loop_end, order_start, order_end, equipment_code, order_status, order_cost, plan_person, order_cost_time, order_sign_person, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,upkeep,calculation_rule,shut_down,order_inspect,repair_code,work_code from equ_order
select order_id, plan_id, plan_code, plan_type, order_code, plan_workshop, plan_prod_line, plan_loop, plan_loop_type,
plan_loop_start, plan_loop_end, order_start, order_end, equipment_code, order_status,
order_cost, plan_person, order_cost_time, order_sign_person,
factory_code, attr1, attr2, attr3, del_flag, create_by, create_time,
update_by, update_time,upkeep,calculation_rule,shut_down,order_inspect,repair_code,work_code
from equ_order
</sql>
<select id="selectEquOrderList" parameterType="EquOrder" resultMap="EquOrderResult">
@ -261,4 +266,4 @@
#{orderId}
</foreach>
</delete>
</mapper>
</mapper>

@ -21,7 +21,9 @@
</resultMap>
<sql id="selectEquOrderPersonVo">
select id, order_code, user_id, user_name, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_order_person
select id, order_code, user_id, user_name, factory_code, attr1, attr2, attr3,
del_flag, create_by, create_time, update_by, update_time
from equ_order_person
</sql>
<select id="selectEquOrderPersonList" parameterType="EquOrderPerson" resultMap="EquOrderPersonResult">
@ -80,6 +82,21 @@
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<insert id="insertEquOrderPlans">
insert into equ_order_person
(
id, order_code, user_id, user_name, factory_code,
del_flag, create_by, create_time
)
VALUES
<foreach collection="list" index="index" item="item" separator=",">
(
#{item.id},#{item.planCode},
#{item.userId},#{item.userName},#{item.factroyCode},
#{item.delFlag},#{item.createBy},#{item.createTime}
)
</foreach>
</insert>
<update id="updateEquOrderPerson" parameterType="EquOrderPerson">
update equ_order_person
@ -110,4 +127,4 @@
#{id}
</foreach>
</delete>
</mapper>
</mapper>

@ -37,7 +37,11 @@
</resultMap>
<sql id="selectEquOrderStandardVo">
select id, code, parent_code, order_code, standard_type, standard_name, detail_up_limit, detail_down_limit, detail_unit, detail_reach, actual_value, detail_error, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,error_flag,fault_type,repair_reach,repair_value,repair_picture from equ_order_standard
select id, code, parent_code, order_code, standard_type, standard_name, detail_up_limit, detail_down_limit,
detail_unit, detail_reach, actual_value, detail_error, factory_code, attr1, attr2, attr3,
del_flag, create_by, create_time, update_by, update_time,picture_path,error_flag,fault_type,repair_reach,
repair_value,repair_picture
from equ_order_standard
</sql>
<select id="selectEquOrderStandardList" parameterType="EquOrderStandard" resultMap="EquOrderStandardResult">
@ -152,6 +156,21 @@
)
</foreach>
</insert>
<insert id="insertEquOrderStandards">
insert into equ_order_standard(
id, parent_code, order_code, standard_type, standard_name,
detail_up_limit, detail_down_limit,detail_unit,
factory_code,del_flag, create_by, create_time,fault_type
)
VALUES
<foreach collection="list" index="index" item="item" separator=",">
(
#{item.id},#{item.parentCode},#{item.planCode},#{item.standardType},#{item.standardName},
#{item.detailUpLimit},#{item.detailDownLimit},#{item.detailUnit},
#{item.factroyCode},#{item.delFlag},#{item.createBy},#{item.createTime}
)
</foreach>
</insert>
<update id="updateEquOrderStandard" parameterType="EquOrderStandard">
update equ_order_standard
@ -217,4 +236,4 @@
and eos.error_flag = '1'
</where>
</select>
</mapper>
</mapper>

@ -28,7 +28,10 @@
</resultMap>
<sql id="selectEquPlanDetailVo">
select id, code, plan_id,plan_code, parent_code, item_code, item_name, item_method, item_type, item_type_name, item_remark, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_plan_detail
select id, code, plan_id,plan_code, parent_code, item_code, item_name, item_method, item_type,
item_type_name, item_remark, factory_code, attr1, attr2, attr3, del_flag,
create_by, create_time, update_by, update_time
from equ_plan_detail
</sql>
<select id="selectEquPlanDetailList" parameterType="EquPlanDetail" resultMap="EquPlanDetailResult">
@ -160,4 +163,4 @@
<delete id="delEquPlanDetailByPlanCode">
update equ_plan_detail set del_flag = '1' where plan_code = #{planCode}
</delete>
</mapper>
</mapper>

@ -23,12 +23,15 @@
</resultMap>
<sql id="selectEquPlanEquVo">
select id, code, parent_code,plan_code, equipment_code, equipment_name, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_plan_equ
select id, code, parent_code,plan_code, equipment_code, equipment_name, factory_code,
attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time
from equ_plan_equ
</sql>
<select id="selectEquPlanEquList" parameterType="EquPlanEqu" resultMap="EquPlanEquResult">
<include refid="selectEquPlanEquVo"/>
<where>
<if test="id != null and id != ''"> and id = #{id}</if>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
<if test="parentCode != null and parentCode != ''"> and parent_code = #{parentCode}</if>
@ -129,4 +132,4 @@
<delete id="delEquPlanEquByPlanCode">
update equ_plan_equ set del_flag = '1' where plan_code = #{planCode}
</delete>
</mapper>
</mapper>

@ -21,7 +21,9 @@
</resultMap>
<sql id="selectEquPlanPersonVo">
select id, plan_code, user_id, user_name, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_plan_person
select id, plan_code, user_id, user_name, factory_code, attr1, attr2, attr3, del_flag,
create_by, create_time, update_by, update_time
from equ_plan_person
</sql>
<select id="selectEquPlanPersonList" parameterType="EquPlanPerson" resultMap="EquPlanPersonResult">
@ -119,4 +121,4 @@
<delete id="delEquPlanPersonByPlanCode">
update equ_plan_person set del_flag = '1' where plan_code = #{planCode}
</delete>
</mapper>
</mapper>

@ -27,7 +27,10 @@
</resultMap>
<sql id="selectEquPlanStandardVo">
select id, code, parent_code,plan_code, detail_code, standard_type, standard_name, detail_up_limit, detail_down_limit, detail_unit, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_plan_standard
select id, code, parent_code,plan_code, detail_code, standard_type, standard_name, detail_up_limit,
detail_down_limit, detail_unit, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time,
update_by, update_time
from equ_plan_standard
</sql>
<select id="selectEquPlanStandardList" parameterType="EquPlanStandard" resultMap="EquPlanStandardResult">
@ -155,4 +158,4 @@
<delete id="delEquPlanStandardByPlanCode">
update equ_plan_standard set del_flag = '1' where plan_code = #{planCode}
</delete>
</mapper>
</mapper>

@ -57,6 +57,19 @@ public class OpenController extends BaseController {
return success(openService.reportWork(mesReportWork));
}
/**获取料罐信息**/
@PostMapping("/getLGInfo")
public AjaxResult getLGInfo(@RequestBody WCSDTO wcsDTO) {
if(StringUtils.isBlank(wcsDTO.getReqTime())){
return error("[reqTime] is null");
}
if(StringUtils.isBlank(wcsDTO.getFactory())){
return error("[factory] is null");
}
return success(openService.getLGInfo(wcsDTO));
}
public static void main(String args[]){
System.out.println(DateUtils.getDate());
}

@ -1,6 +1,7 @@
package com.op.open.mapper;
import com.op.system.api.domain.SysSapLog;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.mes.MesReportWorkDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
import com.op.system.api.domain.mes.ProRfidProcessDetail;
@ -38,5 +39,7 @@ public interface OpenMapper {
void updateWorkOrderStatus(MesReportWorkDTO work);
ProOrderWorkorderDTO getOrderByCode(String workorderCode);
List<WCSDTO> getLGInfo(WCSDTO wcsDTO);
}

@ -4,6 +4,8 @@ import com.op.common.core.domain.R;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.mes.MesReportWorkDTO;
import java.util.List;
/**
* Service
*
@ -15,4 +17,6 @@ public interface OpenService {
WCSDTO requestDestinationStations(WCSDTO wcsdto);
R reportWork(MesReportWorkDTO mesReportWork);
List<WCSDTO> getLGInfo(WCSDTO wcsDTO);
}

@ -210,6 +210,12 @@ public class OpenServiceImpl implements OpenService {
return R.ok();
}
@Override
public List<WCSDTO> getLGInfo(WCSDTO wcsDTO) {
DynamicDataSourceContextHolder.push("ds_"+wcsDTO.getFactory());// 这是数据源的key
return openMapper.getLGInfo(wcsDTO);
}
// //根据工单子单编码获取最顶级订单的母单
// private ProOrderWorkorderDTO getTopOrder(String workorderCode) {
// //pro_order_workorder
@ -222,6 +228,7 @@ public class OpenServiceImpl implements OpenService {
// }
public static void main(String args[]){
DateTimeFormatter ymdhms = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate today = LocalDate.now();

@ -109,5 +109,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
unit
from pro_order_workorder where workorder_code = #{workorderCode}
</select>
<select id="getLGInfo" resultType="com.op.system.api.domain.dto.WCSDTO">
SELECT pw.workorder_id workorderId,
pw.bucket_code bucketCode,
pw.material_code materialCode,
pw.material_name materialName,
pw.shift_id shiftId,
pow.workorder_code workorderCode
from
pro_wet_material_plan_detail pw
left join pro_order_workorder pow on pw.workorder_id = pow.workorder_id
where CONVERT(varchar(10),plan_time, 120) = #{reqTime}
</select>
</mapper>

Loading…
Cancel
Save