opt:烘烤区域相关表代码检查,优化替换
This commit is contained in:
@@ -1,200 +0,0 @@
|
||||
package org.nl.b_lms.sch.point.dao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
||||
|
||||
/**
|
||||
* {@code @Description:} 烘烤区点位库存表(StIvtHotpointivt)实体类
|
||||
* {@code @Author:} gbx
|
||||
*
|
||||
* @since 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("st_ivt_hotpointivt")
|
||||
public class StIvtHotpointivt extends Model<StIvtHotpointivt> {
|
||||
|
||||
private static final long serialVersionUID = -7739291296662381393L;
|
||||
//@TableId(value = "id", type = IdType.NONE)
|
||||
|
||||
|
||||
/**
|
||||
* 库存记录标识
|
||||
*/
|
||||
@TableId(value = "ivt_id", type = IdType.NONE)
|
||||
private Long ivt_id;
|
||||
|
||||
|
||||
/**
|
||||
* 点位编码
|
||||
*/
|
||||
private String point_code;
|
||||
|
||||
|
||||
/**
|
||||
* 点位状态
|
||||
*/
|
||||
private String point_status;
|
||||
|
||||
|
||||
/**
|
||||
* 母卷号
|
||||
*/
|
||||
private String container_name;
|
||||
|
||||
|
||||
/**
|
||||
* 母卷工单标识
|
||||
*/
|
||||
private String workorder_id;
|
||||
|
||||
|
||||
/**
|
||||
* 母卷轴编码
|
||||
*/
|
||||
private String full_vehicle_code;
|
||||
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
|
||||
/**
|
||||
* 库存数
|
||||
*/
|
||||
private BigDecimal ivt_qty;
|
||||
|
||||
|
||||
/**
|
||||
* 计量单位标识
|
||||
*/
|
||||
private Long qty_unit_id;
|
||||
|
||||
|
||||
/**
|
||||
* 入库时间
|
||||
*/
|
||||
private String instorage_time;
|
||||
|
||||
|
||||
/**
|
||||
* 生产区域
|
||||
*/
|
||||
private String product_area;
|
||||
|
||||
|
||||
/**
|
||||
* 温度
|
||||
*/
|
||||
private BigDecimal temperature;
|
||||
|
||||
|
||||
/**
|
||||
* 组别
|
||||
*/
|
||||
private String group_name;
|
||||
|
||||
|
||||
/**
|
||||
* 位置
|
||||
*/
|
||||
private String point_location;
|
||||
|
||||
|
||||
/**
|
||||
* 顺序号
|
||||
*/
|
||||
private BigDecimal sort_seq;
|
||||
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String is_used;
|
||||
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long create_id;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String create_time;
|
||||
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private Long update_optid;
|
||||
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String update_optname;
|
||||
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String update_time;
|
||||
|
||||
|
||||
/**
|
||||
* 规划
|
||||
*/
|
||||
private String plan;
|
||||
|
||||
|
||||
/**
|
||||
* 外部编码
|
||||
*/
|
||||
private String ext_code;
|
||||
|
||||
|
||||
/**
|
||||
* 倒计时
|
||||
*/
|
||||
private String last_time;
|
||||
|
||||
|
||||
/**
|
||||
* 获取主键值
|
||||
*
|
||||
* @return 主键值
|
||||
*/
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.ivt_id;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package org.nl.b_lms.sch.point.dao.mapper;
|
||||
|
||||
import org.nl.b_lms.sch.point.dao.StIvtHotpointivt;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* {@code @Description:} 烘烤区点位库存表(StIvtHotpointivt)数据持久层
|
||||
* {@code @Author:} gbx
|
||||
*
|
||||
* @since 2024-01-24
|
||||
*/
|
||||
public interface StIvtHotpointivtMapper extends BaseMapper<StIvtHotpointivt> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
package org.nl.b_lms.sch.point.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.*;
|
||||
import lombok.Data;
|
||||
import lombok.Builder;
|
||||
|
||||
|
||||
/**
|
||||
* {@code @Description:} 烘烤区点位库存表(StIvtHotpointivt)数据传输类
|
||||
* {@code @Author:} gbx
|
||||
*
|
||||
* @since 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class StIvtHotpointivtDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 库存记录标识
|
||||
*/
|
||||
private Long ivt_id;
|
||||
/**
|
||||
* 点位编码
|
||||
*/
|
||||
private String point_code;
|
||||
/**
|
||||
* 点位状态
|
||||
*/
|
||||
private String point_status;
|
||||
/**
|
||||
* 母卷号
|
||||
*/
|
||||
private String container_name;
|
||||
/**
|
||||
* 母卷工单标识
|
||||
*/
|
||||
private String workorder_id;
|
||||
/**
|
||||
* 母卷轴编码
|
||||
*/
|
||||
private String full_vehicle_code;
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
/**
|
||||
* 库存数
|
||||
*/
|
||||
private BigDecimal ivt_qty;
|
||||
/**
|
||||
* 计量单位标识
|
||||
*/
|
||||
private Long qty_unit_id;
|
||||
/**
|
||||
* 入库时间
|
||||
*/
|
||||
private String instorage_time;
|
||||
/**
|
||||
* 生产区域
|
||||
*/
|
||||
private String product_area;
|
||||
/**
|
||||
* 温度
|
||||
*/
|
||||
private BigDecimal temperature;
|
||||
/**
|
||||
* 组别
|
||||
*/
|
||||
private String group_name;
|
||||
/**
|
||||
* 位置
|
||||
*/
|
||||
private String point_location;
|
||||
/**
|
||||
* 顺序号
|
||||
*/
|
||||
private BigDecimal sort_seq;
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String is_used;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long create_id;
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String create_name;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private Long update_optid;
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String update_optname;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
/**
|
||||
* 规划
|
||||
*/
|
||||
private String plan;
|
||||
/**
|
||||
* 外部编码
|
||||
*/
|
||||
private String ext_code;
|
||||
/**
|
||||
* 倒计时
|
||||
*/
|
||||
private String last_time;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
package org.nl.b_lms.sch.point.dto;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.*;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.b_lms.sch.point.dao.StIvtHotpointivt;
|
||||
import org.nl.b_lms.sch.point.dto.StIvtHotpointivtVO;
|
||||
|
||||
/**
|
||||
* {@code @Description:} 烘烤区点位库存表(StIvtHotpointivt)查询参数类
|
||||
* {@code @Author:} gbx
|
||||
*
|
||||
* @since 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class StIvtHotpointivtVO extends BaseQuery<StIvtHotpointivt> {
|
||||
/**
|
||||
* 库存记录标识
|
||||
*/
|
||||
private Long ivt_id;
|
||||
/**
|
||||
* 点位编码
|
||||
*/
|
||||
private String point_code;
|
||||
/**
|
||||
* 点位状态
|
||||
*/
|
||||
private String point_status;
|
||||
/**
|
||||
* 母卷号
|
||||
*/
|
||||
private String container_name;
|
||||
/**
|
||||
* 母卷工单标识
|
||||
*/
|
||||
private String workorder_id;
|
||||
/**
|
||||
* 母卷轴编码
|
||||
*/
|
||||
private String full_vehicle_code;
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
/**
|
||||
* 库存数
|
||||
*/
|
||||
private BigDecimal ivt_qty;
|
||||
/**
|
||||
* 计量单位标识
|
||||
*/
|
||||
private Long qty_unit_id;
|
||||
/**
|
||||
* 入库时间
|
||||
*/
|
||||
private String instorage_time;
|
||||
/**
|
||||
* 生产区域
|
||||
*/
|
||||
private String product_area;
|
||||
/**
|
||||
* 温度
|
||||
*/
|
||||
private BigDecimal temperature;
|
||||
/**
|
||||
* 组别
|
||||
*/
|
||||
private String group_name;
|
||||
/**
|
||||
* 位置
|
||||
*/
|
||||
private String point_location;
|
||||
/**
|
||||
* 顺序号
|
||||
*/
|
||||
private BigDecimal sort_seq;
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String is_used;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long create_id;
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String create_name;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private Long update_optid;
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String update_optname;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
/**
|
||||
* 规划
|
||||
*/
|
||||
private String plan;
|
||||
/**
|
||||
* 外部编码
|
||||
*/
|
||||
private String ext_code;
|
||||
/**
|
||||
* 倒计时
|
||||
*/
|
||||
private String last_time;
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package org.nl.b_lms.sch.point.service;
|
||||
|
||||
import org.nl.b_lms.sch.point.dao.StIvtHotpointivt;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
|
||||
|
||||
/**
|
||||
* {@code @Description:} 烘烤区点位库存表(StIvtHotpointivt)服务接口层
|
||||
* {@code @Author:} gbx
|
||||
*
|
||||
* @since 2024-01-24
|
||||
*/
|
||||
public interface IstIvtHotpointivtService extends IService<StIvtHotpointivt> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 查询条件
|
||||
* @param pageable 分页参数
|
||||
* @return IPage<StIvtHotpointivt>
|
||||
*/
|
||||
IPage<StIvtHotpointivt> queryAll(Map whereJson, PageQuery pageable);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param entity /
|
||||
*/
|
||||
void create(StIvtHotpointivt entity);
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param entity /
|
||||
*/
|
||||
void update(StIvtHotpointivt entity);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
*
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Set<String> ids);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
package org.nl.b_lms.sch.point.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.b_lms.sch.point.dao.StIvtHotpointivt;
|
||||
import org.nl.b_lms.sch.point.dao.mapper.StIvtHotpointivtMapper;
|
||||
import org.nl.b_lms.sch.point.service.IstIvtHotpointivtService;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
/**
|
||||
* {@code @Description:} 烘烤区点位库存表(StIvtHotpointivt)服务实现层
|
||||
* {@code @Author:} gbx
|
||||
*
|
||||
* @since 2024-01-24
|
||||
*/
|
||||
@Service("stIvtHotpointivtService")
|
||||
public class StIvtHotpointivtServiceImpl extends ServiceImpl<StIvtHotpointivtMapper, StIvtHotpointivt> implements IstIvtHotpointivtService {
|
||||
|
||||
|
||||
@Resource
|
||||
private StIvtHotpointivtMapper stIvtHotpointivtMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 查询条件
|
||||
* @param page 分页参数
|
||||
*/
|
||||
@Override
|
||||
public IPage<StIvtHotpointivt> queryAll(Map whereJson, PageQuery page) {
|
||||
return stIvtHotpointivtMapper.selectPage(new Page<>(page.getPage() + 1, page.getSize()), new QueryWrapper<StIvtHotpointivt>()
|
||||
.lambda());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param entity 对象实体
|
||||
*/
|
||||
@Override
|
||||
public void create(StIvtHotpointivt entity) {
|
||||
stIvtHotpointivtMapper.insert(getBasicInfo(entity, true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param entity 对象实体
|
||||
*/
|
||||
@Override
|
||||
public void update(StIvtHotpointivt entity) {
|
||||
// StIvtHotpointivt dto = stIvtHotpointivtMapper.selectById(entity.getId);
|
||||
// if (dto == null) {
|
||||
// throw new BadRequestException("不存在该数据!");
|
||||
// }
|
||||
stIvtHotpointivtMapper.updateById(getBasicInfo(entity, false));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
*
|
||||
* @param ids 多个Id主键
|
||||
*/
|
||||
@Override
|
||||
public void deleteAll(Set<String> ids) {
|
||||
// 物理删除
|
||||
stIvtHotpointivtMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取实体基础信息
|
||||
*
|
||||
* @param entity 对象实体
|
||||
* @param isCreate 是否创建
|
||||
*/
|
||||
private StIvtHotpointivt getBasicInfo(StIvtHotpointivt entity, boolean isCreate) {
|
||||
// if (isCreate) {
|
||||
// entity.setCreate_id(Long.valueOf(SecurityUtils.getCurrentUserId()));
|
||||
// entity.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
// entity.setCreate_time(DateUtil.now());
|
||||
// }
|
||||
// entity.setUpdate_optid(Long.valueOf(SecurityUtils.getCurrentUserId()));
|
||||
// entity.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
// entity.setUpdate_time(DateUtil.now());
|
||||
return entity;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,9 +2,7 @@ package org.nl.b_lms.sch.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -13,12 +11,7 @@ import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.dao.mapper.SchBaseTaskMapper;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
|
||||
import org.nl.wms.pda.mps.service.mapper.HotMapper;
|
||||
import org.nl.wms.sch.AcsTaskDto;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
@@ -28,7 +21,6 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
|
||||
@@ -24,6 +24,10 @@ import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
|
||||
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
|
||||
import org.nl.wms.pda.mps.service.BakingService;
|
||||
import org.nl.wms.pda.mps.service.HandleBakingService;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.HotPointIvtService;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.HotPointIvt;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.StIvtHotregioniomst;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.mapper.HotregioniomstMappper;
|
||||
import org.nl.wms.sch.tasks.CutConveyorTask;
|
||||
import org.nl.wms.sch.tasks.InCoolIvtTask;
|
||||
import org.nl.wms.sch.tasks.InHotTask;
|
||||
@@ -32,6 +36,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@@ -40,6 +46,10 @@ public class BakingServiceImpl implements BakingService {
|
||||
@Autowired
|
||||
private RedisUtils redisUtils;
|
||||
@Autowired
|
||||
private HotPointIvtService hotPointIvtService;
|
||||
@Autowired
|
||||
private HotregioniomstMappper hotregioniomstMappper;
|
||||
@Autowired
|
||||
IUserAreaPermissionService userAreaPermissionService;
|
||||
@Autowired
|
||||
private SchBaseTaskMapper schBaseTaskMapper;
|
||||
@@ -69,8 +79,6 @@ public class BakingServiceImpl implements BakingService {
|
||||
WQLObject coolIvtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt");
|
||||
// 冷却区出入表
|
||||
WQLObject coolTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO");
|
||||
// 烤箱区点位库存表
|
||||
WQLObject hosIvtTab = WQLObject.getWQLObject("ST_IVT_HotPointIvt");
|
||||
// 生箔工单表
|
||||
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder");
|
||||
// 物料表
|
||||
@@ -148,7 +156,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
//位置1或0
|
||||
jsonMap.put("point_location", jsonPointZc.getString("point_location"));
|
||||
//获取温度幅度
|
||||
//查询烤箱区点位库存表ST_IVT_HotPointIvt,启用、空位、且无未完成的任务的点位
|
||||
//查询烤箱区点位库存表stivthotpointivt,启用、空位、且无未完成的任务的点位
|
||||
JSONArray hot_rows = WQL.getWO("PDA_BAKING_01").addParamMap(jsonMap).process().getResultJSONArray(0);
|
||||
JSONObject jsonHotIvt = new JSONObject();
|
||||
for (int i = 0; i < hot_rows.size(); i++) {
|
||||
@@ -239,7 +247,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
hotParam.put("temperature", temperature);
|
||||
//烘烤时间
|
||||
hotParam.put("oven_time", hours);
|
||||
//创建烘箱主表ST_IVT_HotRegionIOMst
|
||||
//创建烘箱主表
|
||||
this.createHotIoMst(hotParam);
|
||||
} else {
|
||||
/*
|
||||
@@ -416,7 +424,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
if (ObjectUtil.isEmpty(point_code1)) {
|
||||
throw new BadRequestException("点位不能为空");
|
||||
}
|
||||
JSONObject jsonHotIvt = hosIvtTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
HotPointIvt jsonHotIvt = hotPointIvtService.findByCode(point_code1);
|
||||
if (ObjectUtil.isEmpty(jsonHotIvt)) {
|
||||
throw new BadRequestException("烘烤区域无此点位!");
|
||||
}
|
||||
@@ -426,17 +434,17 @@ public class BakingServiceImpl implements BakingService {
|
||||
if (have_task) {
|
||||
throw new BadRequestException("该点位存在未完成的任务!");
|
||||
}
|
||||
if (StrUtil.isEmpty(jsonHotIvt.getString("container_name"))) {
|
||||
if (StrUtil.isEmpty(jsonHotIvt.getContainer_name())) {
|
||||
throw new BadRequestException("该点位不存在母卷!");
|
||||
}
|
||||
// 1.查询暂存位有没有空位
|
||||
String product_area = jsonHotIvt.getString("product_area");
|
||||
String product_area = jsonHotIvt.getProduct_area();
|
||||
|
||||
//判断区域是否属于B1,B1的出烘箱流程出到对应的半成品区
|
||||
if ("B1".equals(product_area)) {
|
||||
JSONObject jsonRaw = rawTab.query("container_name = '" + jsonHotIvt.getString("container_name") + "' and is_delete = '0'").uniqueResult(0);
|
||||
JSONObject jsonRaw = rawTab.query("container_name = '" + jsonHotIvt.getContainer_name() + "' and is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonRaw)) {
|
||||
throw new BadRequestException("未查询到母卷号:" + jsonHotIvt.getString("container_name") + "对应的生箔工单!");
|
||||
throw new BadRequestException("未查询到母卷号:" + jsonHotIvt.getContainer_name() + "对应的生箔工单!");
|
||||
}
|
||||
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonMater)) {
|
||||
@@ -446,8 +454,8 @@ public class BakingServiceImpl implements BakingService {
|
||||
//查询当前点位为空且没有任务的桁架内缓存点
|
||||
JSONObject cache_param = new JSONObject();
|
||||
cache_param.put("flag", "4");
|
||||
cache_param.put("point_location", jsonHotIvt.getString("point_location"));
|
||||
cache_param.put("product_area", jsonHotIvt.getString("product_area"));
|
||||
cache_param.put("point_location", jsonHotIvt.getPoint_location());
|
||||
cache_param.put("product_area", jsonHotIvt.getProduct_area());
|
||||
JSONObject cache_jo = WQL.getWO("PDA_COOLIN").addParamMap(cache_param).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(cache_jo)) {
|
||||
throw new BadRequestException("桁架范围内没有可用的空点位,请检查库存!");
|
||||
@@ -457,13 +465,19 @@ public class BakingServiceImpl implements BakingService {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", point_code1);
|
||||
param.put("point_code2", cache_jo.getString("point_code"));
|
||||
param.put("material_code", jsonHotIvt.getString("container_name"));
|
||||
param.put("product_area", jsonHotIvt.getString("product_area"));
|
||||
param.put("material_code", jsonHotIvt.getContainer_name());
|
||||
param.put("product_area", jsonHotIvt.getProduct_area());
|
||||
OutHotTask outHotTask = new OutHotTask();
|
||||
String task_id = outHotTask.createTask(param);
|
||||
|
||||
//查询该母卷对应最近的一条入烘箱记录
|
||||
JSONObject last_hot_mst = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst").query("container_name = '" + jsonHotIvt.getString("container_name") + "' AND io_type = '0' order by confirm_time desc").uniqueResult(0);
|
||||
LambdaQueryWrapper<StIvtHotregioniomst> wrapper = new LambdaQueryWrapper<StIvtHotregioniomst>();
|
||||
wrapper.eq(StIvtHotregioniomst::getContainer_name,jsonHotIvt.getContainer_name());
|
||||
wrapper.eq(StIvtHotregioniomst::getIo_type,"0");
|
||||
wrapper.orderByDesc(StIvtHotregioniomst::getConfirm_time);
|
||||
List<StIvtHotregioniomst> last_hot_msts = hotregioniomstMappper.selectList(wrapper);
|
||||
|
||||
StIvtHotregioniomst last_hot_mst = last_hot_msts.get(0);
|
||||
|
||||
JSONObject hotParam = new JSONObject();
|
||||
hotParam.put("container_name", jsonRaw.getString("container_name"));
|
||||
@@ -480,7 +494,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
if (ObjectUtil.isEmpty(last_hot_mst)) {
|
||||
hotParam.put("oven_time", "480");
|
||||
} else {
|
||||
hotParam.put("oven_time", last_hot_mst.getString("oven_time"));
|
||||
hotParam.put("oven_time", last_hot_mst.getOven_time());
|
||||
}
|
||||
this.createHotIoMst(hotParam);
|
||||
} else {
|
||||
@@ -511,7 +525,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
map.put("reging_id", reging_id);
|
||||
map.put("point_location", jsonHotIvt.getString("point_location"));
|
||||
map.put("point_location", jsonHotIvt.getPoint_location());
|
||||
//只找出箱点位
|
||||
map.put("point_type", "5");
|
||||
|
||||
@@ -551,14 +565,14 @@ public class BakingServiceImpl implements BakingService {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", point_code1);
|
||||
param.put("point_code2", point_code2);
|
||||
param.put("material_code", jsonHotIvt.getString("container_name"));
|
||||
param.put("product_area", jsonHotIvt.getString("product_area"));
|
||||
param.put("material_code", jsonHotIvt.getContainer_name());
|
||||
param.put("product_area", jsonHotIvt.getProduct_area());
|
||||
OutHotTask outHotTask = new OutHotTask();
|
||||
String task_id = outHotTask.createTask(param);
|
||||
|
||||
JSONObject jsonRaw = rawTab.query("container_name = '" + jsonHotIvt.getString("container_name") + "' and is_delete = '0'").uniqueResult(0);
|
||||
JSONObject jsonRaw = rawTab.query("container_name = '" + jsonHotIvt.getContainer_name() + "' and is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonRaw)) {
|
||||
throw new BadRequestException("未查询到母卷号:" + jsonHotIvt.getString("container_name") + "对应的生箔工单!");
|
||||
throw new BadRequestException("未查询到母卷号:" + jsonHotIvt.getContainer_name() + "对应的生箔工单!");
|
||||
}
|
||||
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonMater)) {
|
||||
@@ -566,8 +580,13 @@ public class BakingServiceImpl implements BakingService {
|
||||
}
|
||||
|
||||
//查询该母卷对应最近的一条入烘箱记录
|
||||
JSONObject last_hot_mst = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst").query("container_name = '" + jsonHotIvt.getString("container_name") + "' AND io_type = '0' order by confirm_time desc").uniqueResult(0);
|
||||
LambdaQueryWrapper<StIvtHotregioniomst> wrapper = new LambdaQueryWrapper<StIvtHotregioniomst>();
|
||||
wrapper.eq(StIvtHotregioniomst::getContainer_name,jsonHotIvt.getContainer_name());
|
||||
wrapper.eq(StIvtHotregioniomst::getIo_type,"0");
|
||||
wrapper.orderByDesc(StIvtHotregioniomst::getConfirm_time);
|
||||
List<StIvtHotregioniomst> last_hot_msts = hotregioniomstMappper.selectList(wrapper);
|
||||
|
||||
StIvtHotregioniomst last_hot_mst = last_hot_msts.get(0);
|
||||
JSONObject hotParam = new JSONObject();
|
||||
hotParam.put("container_name", jsonRaw.getString("container_name"));
|
||||
hotParam.put("workorder_id", jsonRaw.getString("workorder_id"));
|
||||
@@ -583,7 +602,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
if (ObjectUtil.isEmpty(last_hot_mst)) {
|
||||
hotParam.put("oven_time", "480");
|
||||
} else {
|
||||
hotParam.put("oven_time", last_hot_mst.getString("oven_time"));
|
||||
hotParam.put("oven_time", last_hot_mst.getOven_time());
|
||||
}
|
||||
this.createHotIoMst(hotParam);
|
||||
}
|
||||
@@ -749,10 +768,6 @@ public class BakingServiceImpl implements BakingService {
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String createHotIoMst(JSONObject param) {
|
||||
/*
|
||||
* 创建烘箱区出入主表
|
||||
*/
|
||||
WQLObject hotMstTab = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst"); // 烘箱区出入主表
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
@@ -780,7 +795,9 @@ public class BakingServiceImpl implements BakingService {
|
||||
jsonHotMst.put("confirm_optid", currentUserId);
|
||||
jsonHotMst.put("confirm_optname", currentUsername);
|
||||
jsonHotMst.put("confirm_time", DateUtil.now());
|
||||
hotMstTab.insert(jsonHotMst);
|
||||
StIvtHotregioniomst hotmst = new StIvtHotregioniomst();
|
||||
hotmst.copyFrom(jsonHotMst);
|
||||
hotregioniomstMappper.insert(hotmst);
|
||||
|
||||
return jsonHotMst.getString("iostorinv_id");
|
||||
}
|
||||
@@ -808,7 +825,6 @@ public class BakingServiceImpl implements BakingService {
|
||||
@Override
|
||||
public JSONObject query(JSONObject whereJson) {
|
||||
WQLObject coolIvtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt");
|
||||
WQLObject hotIvtTab = WQLObject.getWQLObject("ST_IVT_HotPointIvt");
|
||||
WQLObject pointIvtTab = WQLObject.getWQLObject("sch_base_point");
|
||||
|
||||
String point_code = whereJson.getString("point_code");
|
||||
@@ -835,10 +851,10 @@ public class BakingServiceImpl implements BakingService {
|
||||
throw new BadRequestException("当前登录人员暂无【" + product_area + "】操作权限");
|
||||
}
|
||||
} else {
|
||||
JSONObject jsonHot = hotIvtTab.query("point_code = '" + point_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonHot) && ObjectUtil.isNotEmpty(jsonHot.getString("container_name"))) {
|
||||
json.put("container_name", jsonHot.getString("container_name"));
|
||||
String product_area = jsonHot.getString("product_area");
|
||||
HotPointIvt jsonHot = hotPointIvtService.findByCode(point_code);
|
||||
if (ObjectUtil.isNotEmpty(jsonHot) && ObjectUtil.isNotEmpty(jsonHot.getContainer_name())) {
|
||||
json.put("container_name", jsonHot.getContainer_name());
|
||||
String product_area = jsonHot.getProduct_area();
|
||||
if (!in_area_id.contains(product_area)) {
|
||||
throw new BadRequestException("当前登录人员暂无【" + product_area + "】操作权限");
|
||||
}
|
||||
|
||||
@@ -19,16 +19,27 @@ import org.nl.wms.basedata.master.interfaceback.service.dao.mapper.InterfaceBack
|
||||
import org.nl.wms.ext.mes.service.LmsToMesService;
|
||||
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
|
||||
import org.nl.wms.pda.mps.service.HandleBakingService;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.HotPointIvtService;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.HotPointIvt;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.StIvtHotregioniomst;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.mapper.HotregioniomstMappper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class HandleBakingServiceImpl implements HandleBakingService {
|
||||
@Autowired
|
||||
private InterfaceBackMapper interfaceBackMapper;
|
||||
@Autowired
|
||||
private HotPointIvtService hotPointIvtService;
|
||||
@Autowired
|
||||
private HotregioniomstMappper hotregioniomstMappper;
|
||||
/*
|
||||
* 业务流程:
|
||||
* 入烤箱:
|
||||
@@ -51,7 +62,6 @@ public class HandleBakingServiceImpl implements HandleBakingService {
|
||||
String option = whereJson.getString("option"); // 1-入箱 2-出箱
|
||||
|
||||
WQLObject coolstIvtCoolpointivtService = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区点位库存表
|
||||
WQLObject hosstIvtCoolpointivtService = WQLObject.getWQLObject("ST_IVT_HotPointIvt"); // 烤箱区点位库存表
|
||||
WQLObject stIvtCoolRegionIoService = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
|
||||
WQLObject pdmBiRawfoilworkorderService = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
|
||||
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料表
|
||||
@@ -149,29 +159,29 @@ public class HandleBakingServiceImpl implements HandleBakingService {
|
||||
this.createHotIoMst(hotParam);
|
||||
|
||||
// 更新烘箱区库存状态
|
||||
JSONObject jsonHotIvt = hosstIvtCoolpointivtService.query("point_code = '" + next_point_code + "'").uniqueResult(0);
|
||||
HotPointIvt jsonHotIvt = hotPointIvtService.findByCode(next_point_code);
|
||||
if (ObjectUtil.isEmpty(jsonHotIvt)) {
|
||||
throw new BadRequestException("终点请扫描正确的烘箱点位!");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(jsonHotIvt.getString("container_name"))) {
|
||||
if (StrUtil.isNotEmpty(jsonHotIvt.getContainer_name())) {
|
||||
throw new BadRequestException("目的点上存在母卷!");
|
||||
}
|
||||
jsonHotIvt.put("point_status", "02");
|
||||
jsonHotIvt.put("container_name", container_name);
|
||||
jsonHotIvt.put("workorder_id", jsonRaw.getString("workorder_id"));
|
||||
jsonHotIvt.put("ivt_qty", jsonRaw.getString("productin_qty"));
|
||||
jsonHotIvt.put("instorage_time", DateUtil.now());
|
||||
jsonHotIvt.put("update_optid", currentUserId);
|
||||
jsonHotIvt.put("update_optname", nickName);
|
||||
jsonHotIvt.put("update_time", DateUtil.now());
|
||||
hosstIvtCoolpointivtService.update(jsonHotIvt);
|
||||
jsonHotIvt.setPoint_status("02");
|
||||
jsonHotIvt.setContainer_name(container_name);
|
||||
jsonHotIvt.setWorkorder_id(jsonRaw.getString("workorder_id"));
|
||||
jsonHotIvt.setIvt_qty(jsonRaw.getBigDecimal("productin_qty"));
|
||||
jsonHotIvt.setInstorage_time(DateUtil.now());
|
||||
jsonHotIvt.setUpdate_optid(currentUserId);
|
||||
jsonHotIvt.setUpdate_optname(nickName);
|
||||
jsonHotIvt.setUpdate_time(DateUtil.now());
|
||||
hotPointIvtService.update(jsonHotIvt);
|
||||
|
||||
// 将入烘箱信息发送给mes
|
||||
JSONObject param = new JSONObject();
|
||||
String userName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||
String passWord = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||
param.put("iContainerName", container_name);
|
||||
param.put("iResourceName", jsonHotIvt.getString("ext_code"));
|
||||
param.put("iResourceName", jsonHotIvt.getExt_code());
|
||||
param.put("iMoveInDate", DateUtil.now());
|
||||
param.put("iPlanBakingTemperature", temperature);
|
||||
param.put("iPlanBakingTimer", hours);
|
||||
@@ -188,11 +198,11 @@ public class HandleBakingServiceImpl implements HandleBakingService {
|
||||
}
|
||||
|
||||
} else if (StrUtil.equals(option, "2")) {
|
||||
JSONObject cool_ivt = WQLObject.getWQLObject("st_ivt_hotpointivt").query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
HotPointIvt cool_ivt = hotPointIvtService.findByCode(point_code1);
|
||||
if (ObjectUtil.isEmpty(cool_ivt)) {
|
||||
throw new BadRequestException("请扫描正确的烘烤区点位!");
|
||||
}
|
||||
String on_container_name = cool_ivt.getString("container_name");
|
||||
String on_container_name = cool_ivt.getContainer_name();
|
||||
if (!on_container_name.equals(container_name)) {
|
||||
throw new BadRequestException("点位上母卷不符!");
|
||||
}
|
||||
@@ -212,17 +222,17 @@ public class HandleBakingServiceImpl implements HandleBakingService {
|
||||
this.createHotIoMst(hotParam);
|
||||
|
||||
//维护烘箱库存信息
|
||||
JSONObject jsonHotIvt = hosstIvtCoolpointivtService.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
HotPointIvt jsonHotIvt = hotPointIvtService.findByCode(point_code1);
|
||||
// 更新烘箱区库存状态
|
||||
jsonHotIvt.put("point_status", "01");
|
||||
jsonHotIvt.put("container_name", "");
|
||||
jsonHotIvt.put("workorder_id", "");
|
||||
jsonHotIvt.put("ivt_qty", 0);
|
||||
jsonHotIvt.put("instorage_time", "");
|
||||
jsonHotIvt.put("update_optid", currentUserId);
|
||||
jsonHotIvt.put("update_optname", nickName);
|
||||
jsonHotIvt.put("update_time", DateUtil.now());
|
||||
hosstIvtCoolpointivtService.update(jsonHotIvt);
|
||||
jsonHotIvt.setPoint_status("01");
|
||||
jsonHotIvt.setContainer_name("");
|
||||
jsonHotIvt.setWorkorder_id("");
|
||||
jsonHotIvt.setIvt_qty(BigDecimal.valueOf(0));
|
||||
jsonHotIvt.setInstorage_time("");
|
||||
jsonHotIvt.setUpdate_optid(currentUserId);
|
||||
jsonHotIvt.setUpdate_optname(nickName);
|
||||
jsonHotIvt.setUpdate_time(DateUtil.now());
|
||||
hotPointIvtService.update(jsonHotIvt);
|
||||
|
||||
//生成冷却区入库记录
|
||||
JSONObject jsonCool = new JSONObject();
|
||||
@@ -271,15 +281,19 @@ public class HandleBakingServiceImpl implements HandleBakingService {
|
||||
coolstIvtCoolpointivtService.update(jsonIvt);
|
||||
|
||||
//查询该母卷对应最近的一条入烘箱记录
|
||||
JSONObject last_hot_mst = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst").query("container_name = '" + container_name + "' AND io_type = '0' order by confirm_time desc").uniqueResult(0);
|
||||
|
||||
LambdaQueryWrapper<StIvtHotregioniomst> wrapper = new LambdaQueryWrapper<StIvtHotregioniomst>();
|
||||
wrapper.eq(StIvtHotregioniomst::getContainer_name,container_name);
|
||||
wrapper.eq(StIvtHotregioniomst::getIo_type,"0");
|
||||
wrapper.orderByDesc(StIvtHotregioniomst::getConfirm_time);
|
||||
List<StIvtHotregioniomst> last_hot_msts = hotregioniomstMappper.selectList(wrapper);
|
||||
StIvtHotregioniomst last_hot_mst = last_hot_msts.get(0);
|
||||
// 将出烘箱信息发送给mes
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("iContainerName", jsonRaw.getString("container_name"));
|
||||
param.put("iResourceName", jsonHotIvt.getString("ext_code"));
|
||||
param.put("iResourceName", jsonHotIvt.getExt_code());
|
||||
param.put("iMoveOutDate", DateUtil.now());
|
||||
param.put("iabxActualBakingTemperature", last_hot_mst.getDoubleValue("temperature"));
|
||||
param.put("iabxActualBakingTimer", last_hot_mst.getDoubleValue("oven_time"));
|
||||
param.put("iabxActualBakingTemperature", last_hot_mst.getTemperature());
|
||||
param.put("iabxActualBakingTimer", last_hot_mst.getOven_time());
|
||||
|
||||
//判断该接口是否需要回传
|
||||
LambdaQueryWrapper<InterfaceBack> lam = new LambdaQueryWrapper<>();
|
||||
@@ -354,7 +368,6 @@ public class HandleBakingServiceImpl implements HandleBakingService {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
WQLObject stIvtHotregioniomstService = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst"); // 烘箱区出入主表
|
||||
|
||||
JSONObject jsonHotMst = new JSONObject();
|
||||
jsonHotMst.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
@@ -379,8 +392,9 @@ public class HandleBakingServiceImpl implements HandleBakingService {
|
||||
jsonHotMst.put("confirm_optid", currentUserId);
|
||||
jsonHotMst.put("confirm_optname", nickName);
|
||||
jsonHotMst.put("confirm_time", DateUtil.now());
|
||||
stIvtHotregioniomstService.insert(jsonHotMst);
|
||||
|
||||
StIvtHotregioniomst hotmst = new StIvtHotregioniomst();
|
||||
hotmst.copyFrom(jsonHotMst);
|
||||
hotregioniomstMappper.insert(hotmst);
|
||||
return jsonHotMst.getString("iostorinv_id");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
package org.nl.wms.pda.mps.service.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: mapper接口
|
||||
* @Date: 2023/5/23
|
||||
*/
|
||||
public interface HotMapper extends BaseMapper<JSONObject> {
|
||||
|
||||
void updateHotByObject(JSONObject object);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<?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="org.nl.wms.pda.mps.service.mapper.HotMapper">
|
||||
<update id="updateHotByObject" parameterType="com.alibaba.fastjson.JSONObject">
|
||||
UPDATE st_ivt_hotpointivt
|
||||
SET point_status = #{point_status}
|
||||
, container_name = #{container_name}
|
||||
, workorder_id = #{workorder_id}
|
||||
, ivt_qty = #{ivt_qty}
|
||||
, instorage_time = #{instorage_time}
|
||||
, update_optid = #{update_optid}
|
||||
, update_optname = #{update_optname}
|
||||
, update_time = #{update_time}
|
||||
WHERE point_code = #{point_code}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -3,13 +3,11 @@ package org.nl.wms.pdm.ivt.hotpoint.rest;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.HotPointIvtService;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dto.HotPointIvtDto;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.HotPointIvt;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dto.HotPointIvtQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -29,33 +27,25 @@ public class HotPointIvtController {
|
||||
|
||||
@GetMapping
|
||||
@Log("查询烘烤区点位库存")
|
||||
|
||||
//@SaCheckPermission("@el.check('hotpointivt:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(hotPointIvtService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增烘烤区点位库存")
|
||||
|
||||
//@SaCheckPermission("@el.check('hotpointivt:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody HotPointIvtDto dto) {
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody HotPointIvt dto) {
|
||||
hotPointIvtService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改烘烤区点位库存")
|
||||
|
||||
//@SaCheckPermission("@el.check('hotpointivt:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody HotPointIvtDto dto) {
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody HotPointIvt dto) {
|
||||
hotPointIvtService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除烘烤区点位库存")
|
||||
|
||||
//@SaCheckPermission("@el.check('hotpointivt:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
hotPointIvtService.deleteAll(ids);
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
package org.nl.wms.pdm.ivt.hotpoint.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.HotPointIvt;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.StIvtHotregioniomst;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dto.HotPointIvtDto;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dto.HotPointIvtQuery;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
@@ -30,15 +27,7 @@ public interface HotPointIvtService extends IService<HotPointIvt> {
|
||||
* @param whereJson 条件参数
|
||||
* @return List<HotpointivtDto>
|
||||
*/
|
||||
List<HotPointIvtDto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param ivt_id ID
|
||||
* @return Hotpointivt
|
||||
*/
|
||||
HotPointIvtDto findById(Long ivt_id);
|
||||
List<HotPointIvt> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
@@ -46,21 +35,21 @@ public interface HotPointIvtService extends IService<HotPointIvt> {
|
||||
* @param code code
|
||||
* @return Hotpointivt
|
||||
*/
|
||||
HotPointIvtDto findByCode(String code);
|
||||
HotPointIvt findByCode(String code);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void create(HotPointIvtDto dto);
|
||||
void create(HotPointIvt dto);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void update(HotPointIvtDto dto);
|
||||
void update(HotPointIvt dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
@@ -76,7 +65,6 @@ public interface HotPointIvtService extends IService<HotPointIvt> {
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
// IPage<HotPointIvt> taskDtlQuery(HotPointIvtQuery whereJson, PageQuery page);
|
||||
Map<String, Object> taskDtlQuery(HotPointIvtQuery whereJson, PageQuery page);
|
||||
|
||||
void uploadMes(JSONObject form);
|
||||
|
||||
@@ -7,17 +7,20 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("st_ivt_hotpointivt")
|
||||
public class HotPointIvt {
|
||||
public class HotPointIvt implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/** 库存记录标识 */
|
||||
/**
|
||||
* 防止精度丢失
|
||||
*/
|
||||
@TableId
|
||||
@TableId(value = "ivt_id")
|
||||
private Long ivt_id;
|
||||
|
||||
/**
|
||||
@@ -138,5 +141,7 @@ public class HotPointIvt {
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
private String ext_code;
|
||||
|
||||
private String plan;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package org.nl.wms.pdm.ivt.hotpoint.service.dao;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@@ -90,4 +93,8 @@ public class StIvtHotregioniomst {
|
||||
|
||||
//是否删除
|
||||
private String is_delete;
|
||||
|
||||
public void copyFrom(JSONObject source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
task.task_code
|
||||
FROM
|
||||
st_ivt_hotregioniomst mst
|
||||
LEFT JOIN sch_base_task task ON task.task_id = mst.task_id
|
||||
<where>
|
||||
LEFT JOIN sch_base_task task ON task.task_id = mst.task_id
|
||||
where 1=1
|
||||
AND mst.is_delete = '0'
|
||||
<if test="whereJson.bill_code != null">
|
||||
AND mst.bill_code = #{whereJson.bill_code}
|
||||
</if>
|
||||
@@ -43,8 +44,6 @@
|
||||
<if test="whereJson.container_name != null">
|
||||
AND mst.container_name = #{whereJson.container_name}
|
||||
</if>
|
||||
AND mst.is_delete = '0'
|
||||
</where>
|
||||
ORDER BY mst.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.nl.wms.pdm.ivt.hotpoint.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.StIvtHotregioniomst;
|
||||
|
||||
public interface HotregioniomstMappper extends BaseMapper<StIvtHotregioniomst> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
package org.nl.wms.pdm.ivt.hotpoint.service.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class HotPointIvtDto implements Serializable {
|
||||
/** 库存记录标识 */
|
||||
/**
|
||||
* 防止精度丢失
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long ivt_id;
|
||||
|
||||
/**
|
||||
* 点位编码
|
||||
*/
|
||||
private String point_code;
|
||||
|
||||
/**
|
||||
* 点位状态
|
||||
*/
|
||||
private String point_status;
|
||||
|
||||
/**
|
||||
* 母卷号
|
||||
*/
|
||||
private String container_name;
|
||||
|
||||
/**
|
||||
* 母卷工单标识
|
||||
*/
|
||||
private String workorder_id;
|
||||
|
||||
/**
|
||||
* 母卷轴编码
|
||||
*/
|
||||
private String full_vehicle_code;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 库存数
|
||||
*/
|
||||
private BigDecimal ivt_qty;
|
||||
|
||||
/**
|
||||
* 计量单位标识
|
||||
*/
|
||||
private Long qty_unit_id;
|
||||
|
||||
/**
|
||||
* 入库时间
|
||||
*/
|
||||
private String instorage_time;
|
||||
|
||||
/**
|
||||
* 生产区域
|
||||
*/
|
||||
private String product_area;
|
||||
|
||||
/**
|
||||
* 温度
|
||||
*/
|
||||
private BigDecimal temperature;
|
||||
|
||||
/**
|
||||
* 组别
|
||||
*/
|
||||
private String group_name;
|
||||
|
||||
/**
|
||||
* 位置
|
||||
*/
|
||||
private String point_location;
|
||||
|
||||
/**
|
||||
* 顺序号
|
||||
*/
|
||||
private BigDecimal sort_seq;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String is_used;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String update_optid;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String update_optname;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String last_time;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ import org.nl.wms.pdm.ivt.hotpoint.service.HotPointIvtService;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.HotPointIvt;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.StIvtHotregioniomst;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.mapper.HotPointIvtMappper;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dto.HotPointIvtDto;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.mapper.HotregioniomstMappper;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dto.HotPointIvtQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -45,6 +45,8 @@ public class HotPointIvtServiceImpl extends ServiceImpl<HotPointIvtMappper, HotP
|
||||
@Autowired
|
||||
private HotPointIvtMappper hotPointIvtMappper;
|
||||
@Autowired
|
||||
private HotregioniomstMappper hotregioniomstMappper;
|
||||
@Autowired
|
||||
private InterfaceBackMapper interfaceBackMapper;
|
||||
@Autowired
|
||||
private RedisUtils redisUtils;
|
||||
@@ -63,8 +65,8 @@ public class HotPointIvtServiceImpl extends ServiceImpl<HotPointIvtMappper, HotP
|
||||
.eq(ObjectUtil.isNotEmpty(whereJson.get("is_used")), HotPointIvt::getIs_used, whereJson.get("is_used"))
|
||||
.eq(ObjectUtil.isNotEmpty(whereJson.get("point_location")), HotPointIvt::getPoint_location, whereJson.get("point_location"))
|
||||
.in(ObjectUtil.isNotEmpty(in_area_id), HotPointIvt::getProduct_area, in_area_id)
|
||||
.eq(ObjectUtil.isNotEmpty(whereJson.get("begin_time")), HotPointIvt::getInstorage_time, whereJson.get("begin_time"))
|
||||
.eq(ObjectUtil.isNotEmpty(whereJson.get("end_time")), HotPointIvt::getInstorage_time, whereJson.get("end_time"));
|
||||
.gt(ObjectUtil.isNotEmpty(whereJson.get("begin_time")), HotPointIvt::getInstorage_time, whereJson.get("begin_time"))
|
||||
.lt(ObjectUtil.isNotEmpty(whereJson.get("end_time")), HotPointIvt::getInstorage_time, whereJson.get("end_time"));
|
||||
|
||||
IPage<HotPointIvt> pages = new Page<>(page.getOffset() + 1, page.getPageSize());
|
||||
IPage<HotPointIvt> hotPointIvtList = hotPointIvtMappper.selectPage(pages, wrapper);
|
||||
@@ -83,39 +85,22 @@ public class HotPointIvtServiceImpl extends ServiceImpl<HotPointIvtMappper, HotP
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HotPointIvtDto> queryAll(Map whereJson) {
|
||||
public List<HotPointIvt> queryAll(Map whereJson) {
|
||||
List<HotPointIvt> list = hotPointIvtMappper.selectList(null);
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
return BeanUtil.copyToList(list, HotPointIvtDto.class);
|
||||
}
|
||||
return null;
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HotPointIvtDto findById(Long ivt_id) {
|
||||
HotPointIvt hotPointIvt = hotPointIvtMappper.selectOne(Wrappers.lambdaQuery(HotPointIvt.class).eq(ObjectUtil.isNotEmpty(ivt_id), HotPointIvt::getIvt_id, ivt_id));
|
||||
if (ObjectUtil.isNotEmpty(hotPointIvt)) {
|
||||
HotPointIvtDto hotPointIvtDto = BeanUtil.copyProperties(hotPointIvt, HotPointIvtDto.class);
|
||||
return hotPointIvtDto;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HotPointIvtDto findByCode(String code) {
|
||||
public HotPointIvt findByCode(String code) {
|
||||
LambdaQueryWrapper<HotPointIvt> wrapper = new LambdaQueryWrapper<HotPointIvt>()
|
||||
.eq(ObjectUtil.isNotEmpty(code), HotPointIvt::getPoint_code, code);
|
||||
HotPointIvt hotPointIvt = hotPointIvtMappper.selectOne(wrapper);
|
||||
if (ObjectUtil.isNotEmpty(hotPointIvt)) {
|
||||
HotPointIvtDto hotPointIvtDto = BeanUtil.copyProperties(hotPointIvt, HotPointIvtDto.class);
|
||||
return hotPointIvtDto;
|
||||
}
|
||||
return null;
|
||||
return hotPointIvt;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(HotPointIvtDto dto) {
|
||||
public void create(HotPointIvt dto) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
@@ -133,8 +118,8 @@ public class HotPointIvtServiceImpl extends ServiceImpl<HotPointIvtMappper, HotP
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(HotPointIvtDto dto) {
|
||||
HotPointIvtDto ivtDto = this.findById(dto.getIvt_id());
|
||||
public void update(HotPointIvt dto) {
|
||||
HotPointIvt ivtDto = hotPointIvtMappper.selectById(dto.getIvt_id());
|
||||
if (ivtDto == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
@@ -145,22 +130,14 @@ public class HotPointIvtServiceImpl extends ServiceImpl<HotPointIvtMappper, HotP
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
HotPointIvt hotPointIvt = BeanUtil.copyProperties(dto, HotPointIvt.class);
|
||||
hotPointIvtMappper.updateById(hotPointIvt);
|
||||
hotPointIvtMappper.updateById(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Long[] ids) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
List<HotPointIvt> list = hotPointIvtMappper.selectBatchIds(Arrays.asList(ids));
|
||||
for (HotPointIvt hotPointIvt : list) {
|
||||
hotPointIvt.setIs_delete("1");
|
||||
hotPointIvt.setUpdate_optid(currentUserId);
|
||||
hotPointIvt.setUpdate_optname(nickName);
|
||||
hotPointIvt.setUpdate_time(now);
|
||||
hotPointIvtMappper.updateById(hotPointIvt);
|
||||
hotPointIvtMappper.deleteById(hotPointIvt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
//package org.nl.wms.pdm.ivt.rest;
|
||||
//
|
||||
//
|
||||
//import com.alibaba.fastjson.JSONObject;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.nl.modules.logging.annotation.Log;
|
||||
//import org.nl.wms.pdm.ivt.service.HotPointIvtService;
|
||||
//import org.nl.wms.pdm.ivt.service.dto.HotPointIvtDto;
|
||||
//import org.springframework.data.domain.Pageable;
|
||||
//import org.springframework.http.HttpStatus;
|
||||
//import org.springframework.http.ResponseEntity;
|
||||
//import org.springframework.validation.annotation.Validated;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//
|
||||
//import java.util.Map;
|
||||
//
|
||||
///**
|
||||
// * @author lyd
|
||||
// * @date 2022-10-09
|
||||
// **/
|
||||
//@RestController
|
||||
//@RequiredArgsConstructor
|
||||
//
|
||||
//@RequestMapping("/api/hotpointivt")
|
||||
//@Slf4j
|
||||
//public class HotPointIvtController {
|
||||
//
|
||||
// private final HotPointIvtService hotpointivtService;
|
||||
//
|
||||
// @GetMapping
|
||||
// @Log("查询烘烤区点位库存")
|
||||
//
|
||||
// //@SaCheckPermission("@el.check('hotpointivt:list')")
|
||||
// public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
// return new ResponseEntity<>(hotpointivtService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
// }
|
||||
//
|
||||
// @PostMapping
|
||||
// @Log("新增烘烤区点位库存")
|
||||
//
|
||||
// //@SaCheckPermission("@el.check('hotpointivt:add')")
|
||||
// public ResponseEntity<Object> create(@Validated @RequestBody HotPointIvtDto dto) {
|
||||
// hotpointivtService.create(dto);
|
||||
// return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
// }
|
||||
//
|
||||
// @PutMapping
|
||||
// @Log("修改烘烤区点位库存")
|
||||
//
|
||||
// //@SaCheckPermission("@el.check('hotpointivt:edit')")
|
||||
// public ResponseEntity<Object> update(@Validated @RequestBody HotPointIvtDto dto) {
|
||||
// hotpointivtService.update(dto);
|
||||
// return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
// }
|
||||
//
|
||||
// @Log("删除烘烤区点位库存")
|
||||
//
|
||||
// //@SaCheckPermission("@el.check('hotpointivt:del')")
|
||||
// @DeleteMapping
|
||||
// public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
// hotpointivtService.deleteAll(ids);
|
||||
// return new ResponseEntity<>(HttpStatus.OK);
|
||||
// }
|
||||
//
|
||||
// @GetMapping("/taskDtlQuery")
|
||||
// @Log("查询烘烤任务明细")
|
||||
//
|
||||
// public ResponseEntity<Object> taskDtlQuery(@RequestParam Map whereJson, Pageable page) {
|
||||
// return new ResponseEntity<>(hotpointivtService.taskDtlQuery(whereJson, page), HttpStatus.OK);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/uploadMes")
|
||||
// @Log("手动回传MES")
|
||||
//
|
||||
// public ResponseEntity<Object> uploadMes(@RequestBody JSONObject form) {
|
||||
// hotpointivtService.uploadMes(form);
|
||||
// return new ResponseEntity<>(HttpStatus.OK);
|
||||
// }
|
||||
//}
|
||||
@@ -1,83 +0,0 @@
|
||||
//package org.nl.wms.pdm.ivt.service;
|
||||
//
|
||||
//import com.alibaba.fastjson.JSONObject;
|
||||
//import org.nl.wms.pdm.ivt.service.dto.HotPointIvtDto;
|
||||
//import org.springframework.data.domain.Pageable;
|
||||
//
|
||||
//import java.util.List;
|
||||
//import java.util.Map;
|
||||
//
|
||||
///**
|
||||
// * @author lyd
|
||||
// * @description 服务接口
|
||||
// * @date 2022-10-09
|
||||
// **/
|
||||
//public interface HotPointIvtService {
|
||||
//
|
||||
// /**
|
||||
// * 查询数据分页
|
||||
// *
|
||||
// * @param whereJson 条件
|
||||
// * @param page 分页参数
|
||||
// * @return Map<String, Object>
|
||||
// */
|
||||
// Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||
//
|
||||
// /**
|
||||
// * 查询所有数据不分页
|
||||
// *
|
||||
// * @param whereJson 条件参数
|
||||
// * @return List<HotpointivtDto>
|
||||
// */
|
||||
// List<HotPointIvtDto> queryAll(Map whereJson);
|
||||
//
|
||||
// /**
|
||||
// * 根据ID查询
|
||||
// *
|
||||
// * @param ivt_id ID
|
||||
// * @return Hotpointivt
|
||||
// */
|
||||
// HotPointIvtDto findById(Long ivt_id);
|
||||
//
|
||||
// /**
|
||||
// * 根据编码查询
|
||||
// *
|
||||
// * @param code code
|
||||
// * @return Hotpointivt
|
||||
// */
|
||||
// HotPointIvtDto findByCode(String code);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 创建
|
||||
// *
|
||||
// * @param dto /
|
||||
// */
|
||||
// void create(HotPointIvtDto dto);
|
||||
//
|
||||
// /**
|
||||
// * 编辑
|
||||
// *
|
||||
// * @param dto /
|
||||
// */
|
||||
// void update(HotPointIvtDto dto);
|
||||
//
|
||||
// /**
|
||||
// * 多选删除
|
||||
// *
|
||||
// * @param ids /
|
||||
// */
|
||||
// void deleteAll(Long[] ids);
|
||||
//
|
||||
// /**
|
||||
// * 任务明细分页查询
|
||||
// *
|
||||
// * @param whereJson 条件
|
||||
// * @param page 分页参数
|
||||
// * @return Map<String, Object>
|
||||
// */
|
||||
// Map<String, Object> taskDtlQuery(Map whereJson, Pageable page);
|
||||
//
|
||||
// void uploadMes(JSONObject form);
|
||||
//
|
||||
//}
|
||||
@@ -1,134 +0,0 @@
|
||||
//package org.nl.wms.pdm.ivt.service.dto;
|
||||
//
|
||||
//import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
//import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
//import lombok.Data;
|
||||
//
|
||||
//import java.io.Serializable;
|
||||
//import java.math.BigDecimal;
|
||||
//
|
||||
///**
|
||||
// * @author lyd
|
||||
// * @description /
|
||||
// * @date 2022-10-09
|
||||
// **/
|
||||
//@Data
|
||||
//public class HotPointIvtDto implements Serializable {
|
||||
//
|
||||
// /** 库存记录标识 */
|
||||
// /**
|
||||
// * 防止精度丢失
|
||||
// */
|
||||
// @JsonSerialize(using = ToStringSerializer.class)
|
||||
// private Long ivt_id;
|
||||
//
|
||||
// /**
|
||||
// * 点位编码
|
||||
// */
|
||||
// private String point_code;
|
||||
//
|
||||
// /**
|
||||
// * 点位状态
|
||||
// */
|
||||
// private String point_status;
|
||||
//
|
||||
// /**
|
||||
// * 母卷号
|
||||
// */
|
||||
// private String container_name;
|
||||
//
|
||||
// /**
|
||||
// * 母卷工单标识
|
||||
// */
|
||||
// private String workorder_id;
|
||||
//
|
||||
// /**
|
||||
// * 母卷轴编码
|
||||
// */
|
||||
// private String full_vehicle_code;
|
||||
//
|
||||
// /**
|
||||
// * 批次
|
||||
// */
|
||||
// private String pcsn;
|
||||
//
|
||||
// /**
|
||||
// * 库存数
|
||||
// */
|
||||
// private BigDecimal ivt_qty;
|
||||
//
|
||||
// /**
|
||||
// * 计量单位标识
|
||||
// */
|
||||
// private Long qty_unit_id;
|
||||
//
|
||||
// /**
|
||||
// * 入库时间
|
||||
// */
|
||||
// private String instorage_time;
|
||||
//
|
||||
// /**
|
||||
// * 生产区域
|
||||
// */
|
||||
// private String product_area;
|
||||
//
|
||||
// /**
|
||||
// * 温度
|
||||
// */
|
||||
// private BigDecimal temperature;
|
||||
//
|
||||
// /**
|
||||
// * 组别
|
||||
// */
|
||||
// private String group_name;
|
||||
//
|
||||
// /**
|
||||
// * 位置
|
||||
// */
|
||||
// private String point_location;
|
||||
//
|
||||
// /**
|
||||
// * 顺序号
|
||||
// */
|
||||
// private BigDecimal sort_seq;
|
||||
//
|
||||
// /**
|
||||
// * 是否启用
|
||||
// */
|
||||
// private String is_used;
|
||||
//
|
||||
// /**
|
||||
// * 备注
|
||||
// */
|
||||
// private String remark;
|
||||
//
|
||||
// /**
|
||||
// * 创建人
|
||||
// */
|
||||
// private String create_id;
|
||||
//
|
||||
// /**
|
||||
// * 创建人姓名
|
||||
// */
|
||||
// private String create_name;
|
||||
//
|
||||
// /**
|
||||
// * 创建时间
|
||||
// */
|
||||
// private String create_time;
|
||||
//
|
||||
// /**
|
||||
// * 修改人
|
||||
// */
|
||||
// private String update_optid;
|
||||
//
|
||||
// /**
|
||||
// * 修改人姓名
|
||||
// */
|
||||
// private String update_optname;
|
||||
//
|
||||
// /**
|
||||
// * 修改时间
|
||||
// */
|
||||
// private String update_time;
|
||||
//}
|
||||
@@ -1,262 +0,0 @@
|
||||
//package org.nl.wms.pdm.ivt.service.impl;
|
||||
//
|
||||
//
|
||||
//import cn.hutool.core.date.DateUtil;
|
||||
//import cn.hutool.core.map.MapUtil;
|
||||
//import cn.hutool.core.util.IdUtil;
|
||||
//import cn.hutool.core.util.ObjectUtil;
|
||||
//import com.alibaba.fastjson.JSON;
|
||||
//import com.alibaba.fastjson.JSONArray;
|
||||
//import com.alibaba.fastjson.JSONObject;
|
||||
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
//import lombok.RequiredArgsConstructor;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.nl.common.utils.SecurityUtils;
|
||||
//import org.nl.modules.common.exception.BadRequestException;
|
||||
//import org.nl.modules.common.utils.RedisUtils;
|
||||
//import org.nl.modules.wql.WQL;
|
||||
//import org.nl.modules.wql.core.bean.WQLObject;
|
||||
//import org.nl.modules.wql.util.SpringContextHolder;
|
||||
//import org.nl.modules.wql.util.WqlUtil;
|
||||
//import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
//import org.nl.wms.basedata.master.interfaceback.service.dao.InterfaceBack;
|
||||
//import org.nl.wms.basedata.master.interfaceback.service.dao.mapper.InterfaceBackMapper;
|
||||
//import org.nl.wms.basedata.st.areapermissions.service.IUserAreaPermissionService;
|
||||
//import org.nl.wms.ext.mes.service.LmsToMesService;
|
||||
//import org.nl.wms.pdm.ivt.service.HotPointIvtService;
|
||||
//import org.nl.wms.pdm.ivt.service.dto.HotPointIvtDto;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.data.domain.Pageable;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//import org.springframework.transaction.annotation.Transactional;
|
||||
//
|
||||
//import java.util.HashMap;
|
||||
//import java.util.List;
|
||||
//import java.util.Map;
|
||||
//
|
||||
///**
|
||||
// * @author lyd
|
||||
// * @description 服务实现
|
||||
// * @date 2022-10-09
|
||||
// **/
|
||||
//@Service
|
||||
//@RequiredArgsConstructor
|
||||
//@Slf4j
|
||||
//public class HotPointIvtServiceImpl implements HotPointIvtService {
|
||||
// @Autowired
|
||||
// private InterfaceBackMapper interfaceBackMapper;
|
||||
// @Autowired
|
||||
// private RedisUtils redisUtils;
|
||||
// @Autowired
|
||||
// IUserAreaPermissionService userAreaPermissionService;
|
||||
// @Override
|
||||
// public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
// //获取人员对应的区域
|
||||
// String in_area_id = userAreaPermissionService.getInArea();
|
||||
// HashMap map = new HashMap();
|
||||
// map.put("flag", "1");
|
||||
// if (whereJson.get("point_code") != null) {
|
||||
// map.put("point_code", "%" + whereJson.get("point_code") + "%");
|
||||
// }
|
||||
// map.put("point_status", whereJson.get("point_status"));
|
||||
// map.put("product_area", whereJson.get("product_area"));
|
||||
// map.put("is_used", whereJson.get("is_used"));
|
||||
// map.put("begin_time", whereJson.get("begin_time"));
|
||||
// map.put("end_time", whereJson.get("end_time"));
|
||||
// map.put("point_location", whereJson.get("point_location"));
|
||||
//
|
||||
// if (ObjectUtil.isNotEmpty(in_area_id)) {
|
||||
// map.put("in_area_id", in_area_id);
|
||||
// }
|
||||
// JSONObject json = WQL.getWO("ST_IVT_HOTPOINTIVT").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "product_area,point_code");
|
||||
// JSONArray rows = json.getJSONArray("content");
|
||||
// JSONArray new_rows = new JSONArray();
|
||||
// for (int i = 0; i < rows.size(); i++) {
|
||||
// JSONObject row = rows.getJSONObject(i);
|
||||
// String temperature = (String) redisUtils.hget(row.getString("point_code"), "temperature");
|
||||
// String last_time = (String) redisUtils.hget(row.getString("point_code"), "last_time");
|
||||
// row.put("temperature", temperature);
|
||||
// row.put("last_time", last_time);
|
||||
// new_rows.add(row);
|
||||
// }
|
||||
// json.put("content", new_rows);
|
||||
// return json;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<HotPointIvtDto> queryAll(Map whereJson) {
|
||||
// WQLObject wo = WQLObject.getWQLObject("st_ivt_hotpointivt");
|
||||
// JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
// if (ObjectUtil.isNotEmpty(arr)) {
|
||||
// return arr.toJavaList(HotPointIvtDto.class);
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public HotPointIvtDto findById(Long ivt_id) {
|
||||
// WQLObject wo = WQLObject.getWQLObject("st_ivt_hotpointivt");
|
||||
// JSONObject json = wo.query("ivt_id = '" + ivt_id + "'").uniqueResult(0);
|
||||
// if (ObjectUtil.isNotEmpty(json)) {
|
||||
// return json.toJavaObject(HotPointIvtDto.class);
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public HotPointIvtDto findByCode(String code) {
|
||||
// WQLObject wo = WQLObject.getWQLObject("st_ivt_hotpointivt");
|
||||
// JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
|
||||
// if (ObjectUtil.isNotEmpty(json)) {
|
||||
// return json.toJavaObject(HotPointIvtDto.class);
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public void create(HotPointIvtDto dto) {
|
||||
// String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
// String nickName = SecurityUtils.getCurrentNickName();
|
||||
// String now = DateUtil.now();
|
||||
//
|
||||
// dto.setIvt_id(IdUtil.getSnowflake(1, 1).nextId());
|
||||
// dto.setCreate_id(currentUserId);
|
||||
// dto.setCreate_name(nickName);
|
||||
// dto.setUpdate_optid(currentUserId);
|
||||
// dto.setUpdate_optname(nickName);
|
||||
// dto.setUpdate_time(now);
|
||||
// dto.setCreate_time(now);
|
||||
//
|
||||
// WQLObject wo = WQLObject.getWQLObject("st_ivt_hotpointivt");
|
||||
// JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
// wo.insert(json);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public void update(HotPointIvtDto dto) {
|
||||
// HotPointIvtDto entity = this.findById(dto.getIvt_id());
|
||||
// if (entity == null) {
|
||||
// throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
// }
|
||||
//
|
||||
// String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
// String nickName = SecurityUtils.getCurrentNickName();
|
||||
//
|
||||
// String now = DateUtil.now();
|
||||
// dto.setUpdate_time(now);
|
||||
// dto.setUpdate_optid(currentUserId);
|
||||
// dto.setUpdate_optname(nickName);
|
||||
//
|
||||
// WQLObject wo = WQLObject.getWQLObject("st_ivt_hotpointivt");
|
||||
// JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
// if (!json.containsKey("temperature")) {
|
||||
// json.put("temperature", null);
|
||||
// }
|
||||
// wo.update(json);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public void deleteAll(Long[] ids) {
|
||||
// String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
// String nickName = SecurityUtils.getCurrentNickName();
|
||||
// String now = DateUtil.now();
|
||||
//
|
||||
// WQLObject wo = WQLObject.getWQLObject("st_ivt_hotpointivt");
|
||||
// for (Long ivt_id : ids) {
|
||||
// JSONObject param = new JSONObject();
|
||||
// param.put("ivt_id", String.valueOf(ivt_id));
|
||||
// param.put("is_delete", "1");
|
||||
// param.put("update_optid", currentUserId);
|
||||
// param.put("update_optname", nickName);
|
||||
// param.put("update_time", now);
|
||||
// wo.update(param);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void uploadMes(JSONObject form) {
|
||||
// String flag = form.getString("flag");
|
||||
//
|
||||
// LmsToMesService lmsToMesService = SpringContextHolder.getBean(LmsToMesService.class);
|
||||
// // 将入烘箱信息发送给mes
|
||||
// JSONObject param = new JSONObject();
|
||||
// String userName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||
// String passWord = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||
// param.put("iContainerName", form.getString("container_name"));
|
||||
// param.put("iResourceName", form.getString("ext_code"));
|
||||
// param.put("UserName", userName);
|
||||
// param.put("PassWord", passWord);
|
||||
//
|
||||
// //入箱回传
|
||||
// if ("1".equals(flag)) {
|
||||
// //判断该接口是否需要回传
|
||||
// param.put("iMoveInDate", DateUtil.now());
|
||||
// param.put("iPlanBakingTemperature", form.getDoubleValue("temperature"));
|
||||
// param.put("iPlanBakingTimer", form.getDoubleValue("oven_time"));
|
||||
//
|
||||
// LambdaQueryWrapper<InterfaceBack> lam = new LambdaQueryWrapper<>();
|
||||
// lam.eq(InterfaceBack::getInterface_name, "momRollBakeInBound");
|
||||
// lam.eq(InterfaceBack::getIs_back, "1");
|
||||
// InterfaceBack back_jo = interfaceBackMapper.selectOne(lam);
|
||||
// if (ObjectUtil.isNotEmpty(back_jo)) {
|
||||
// lmsToMesService.momRollBakeInBound(param);
|
||||
// }
|
||||
//
|
||||
// //将该母卷的入烘箱标识改为0
|
||||
// HashMap<String, String> map = new HashMap<>();
|
||||
// map.put("is_baking", "0");
|
||||
// WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").update(map, "container_name = '" + form.getString("container_name") + "'");
|
||||
// log.info("母卷:" + form.getString("container_name") + "对应的入烘箱任务完成,请求烘烤标识改为0");
|
||||
// }
|
||||
// //出箱回传
|
||||
// if ("2".equals(flag)) {
|
||||
// param.put("MoveOutDate", DateUtil.now());
|
||||
// param.put("ActualBakingTemperature", form.getDoubleValue("temperature"));
|
||||
// param.put("ActualBakingTimer", form.getDoubleValue("oven_time"));
|
||||
// //判断该接口是否需要回传
|
||||
// LambdaQueryWrapper<InterfaceBack> lam = new LambdaQueryWrapper<>();
|
||||
// lam.eq(InterfaceBack::getInterface_name, "momRollBakeOutBound");
|
||||
// lam.eq(InterfaceBack::getIs_back, "1");
|
||||
// InterfaceBack back_jo = interfaceBackMapper.selectOne(lam);
|
||||
// if (ObjectUtil.isNotEmpty(back_jo)) {
|
||||
// lmsToMesService.momRollBakeOutBound(param);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Map<String, Object> taskDtlQuery(Map whereJson, Pageable page) {
|
||||
//
|
||||
// String task_code = MapUtil.getStr(whereJson, "task_code");
|
||||
// String start_point_code = MapUtil.getStr(whereJson, "start_point_code");
|
||||
// String next_point_code = MapUtil.getStr(whereJson, "next_point_code");
|
||||
// String container_name = MapUtil.getStr(whereJson, "container_name");
|
||||
//
|
||||
// JSONObject map = new JSONObject();
|
||||
// map.put("flag", "2");
|
||||
// map.put("bill_code", MapUtil.getStr(whereJson, "bill_code"));
|
||||
// map.put("dtl_status", MapUtil.getStr(whereJson, "dtl_status"));
|
||||
// map.put("begin_time", whereJson.get("begin_time"));
|
||||
// map.put("end_time", whereJson.get("end_time"));
|
||||
// map.put("container_name", container_name);
|
||||
// if (ObjectUtil.isNotEmpty(task_code)) {
|
||||
// map.put("task_code", "%" + task_code + "%");
|
||||
// }
|
||||
// if (ObjectUtil.isNotEmpty(start_point_code)) {
|
||||
// map.put("start_point_code", "%" + start_point_code + "%");
|
||||
// }
|
||||
// if (ObjectUtil.isNotEmpty(next_point_code)) {
|
||||
// map.put("next_point_code", "%" + next_point_code + "%");
|
||||
// }
|
||||
//
|
||||
// JSONObject json = WQL.getWO("ST_IVT_HOTPOINTIVT").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "create_time DESC");
|
||||
//
|
||||
// return json;
|
||||
// }
|
||||
//
|
||||
//}
|
||||
@@ -1,138 +0,0 @@
|
||||
[交易说明]
|
||||
交易名: 烘烤区点位库存
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.point_code TYPEAS s_string
|
||||
输入.point_status TYPEAS s_string
|
||||
输入.product_area TYPEAS s_string
|
||||
输入.is_used TYPEAS s_string
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
输入.container_name TYPEAS s_string
|
||||
输入.bill_code TYPEAS s_string
|
||||
输入.dtl_status TYPEAS s_string
|
||||
输入.task_code TYPEAS s_string
|
||||
输入.start_point_code TYPEAS s_string
|
||||
输入.next_point_code TYPEAS s_string
|
||||
输入.point_location TYPEAS s_string
|
||||
输入.in_area_id TYPEAS f_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
hot.*
|
||||
FROM
|
||||
st_ivt_hotpointivt hot
|
||||
WHERE
|
||||
hot.product_area in 输入.in_area_id
|
||||
OPTION 输入.point_location <> ""
|
||||
point_location = 输入.point_location
|
||||
ENDOPTION
|
||||
OPTION 输入.point_code <> ""
|
||||
point_code LIKE 输入.point_code
|
||||
ENDOPTION
|
||||
OPTION 输入.point_status <> ""
|
||||
point_status = 输入.point_status
|
||||
ENDOPTION
|
||||
OPTION 输入.product_area <> ""
|
||||
product_area = 输入.product_area
|
||||
ENDOPTION
|
||||
OPTION 输入.is_used <> ""
|
||||
is_used = 输入.is_used
|
||||
ENDOPTION
|
||||
OPTION 输入.begin_time <> ""
|
||||
instorage_time >= 输入.begin_time
|
||||
ENDOPTION
|
||||
OPTION 输入.end_time <> ""
|
||||
instorage_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
mst.bill_code,
|
||||
mst.container_name,
|
||||
mst.start_point_code,
|
||||
mst.end_point_code,
|
||||
mst.temperature,
|
||||
mst.oven_time,
|
||||
mst.create_name,
|
||||
mst.create_time,
|
||||
mst.confirm_optname,
|
||||
mst.confirm_time,
|
||||
task.task_code
|
||||
FROM
|
||||
ST_IVT_HotRegionIOMst mst
|
||||
LEFT JOIN sch_base_task task ON task.task_id = mst.task_id
|
||||
|
||||
WHERE
|
||||
mst.is_delete = '0'
|
||||
|
||||
OPTION 输入.bill_code <> ""
|
||||
mst.bill_code = 输入.bill_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.task_code <> ""
|
||||
task.task_code like 输入.task_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.start_point_code <> ""
|
||||
mst.start_point_code like 输入.start_point_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.next_point_code <> ""
|
||||
mst.end_point_code like 输入.next_point_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.begin_time <> ""
|
||||
mst.create_time >= 输入.begin_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.end_time <> ""
|
||||
mst.create_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.container_name <> ""
|
||||
mst.container_name = 输入.container_name
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
@@ -20,7 +20,10 @@ import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.basedata.master.interfaceback.service.dao.InterfaceBack;
|
||||
import org.nl.wms.basedata.master.interfaceback.service.dao.mapper.InterfaceBackMapper;
|
||||
import org.nl.wms.ext.mes.service.LmsToMesService;
|
||||
import org.nl.wms.pda.mps.service.mapper.HotMapper;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.HotPointIvtService;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.HotPointIvt;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.StIvtHotregioniomst;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.mapper.HotregioniomstMappper;
|
||||
import org.nl.wms.sch.AcsTaskDto;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
@@ -40,7 +43,11 @@ public class InHotTask extends AbstractAcsTask {
|
||||
@Autowired
|
||||
private InterfaceBackMapper interfaceBackMapper;
|
||||
@Autowired
|
||||
private HotregioniomstMappper hotregioniomstMappper;
|
||||
@Autowired
|
||||
private SchBaseTaskMapper schBaseTaskMapper;
|
||||
@Autowired
|
||||
private HotPointIvtService hotPointIvtService;
|
||||
@Override
|
||||
public List<AcsTaskDto> addTask() {
|
||||
/*
|
||||
@@ -87,8 +94,6 @@ public class InHotTask extends AbstractAcsTask {
|
||||
public void updateTaskStatus(SchBaseTask taskObj, String status) {
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表
|
||||
WQLObject coolIvtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区库存表
|
||||
WQLObject hotIvtTab = WQLObject.getWQLObject("ST_IVT_HotPointIvt"); // 烘箱区库存表
|
||||
WQLObject hotMstTab = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst"); // 烘箱区出入主表
|
||||
WQLObject coolIoTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
|
||||
|
||||
String task_id = taskObj.getTask_id();
|
||||
@@ -104,7 +109,9 @@ public class InHotTask extends AbstractAcsTask {
|
||||
|
||||
coolIoTab.delete("task_id = '" + task_id + "'");
|
||||
|
||||
hotMstTab.delete("task_id = '" + task_id + "'");
|
||||
LambdaQueryWrapper<StIvtHotregioniomst> wrapper = new LambdaQueryWrapper<StIvtHotregioniomst>()
|
||||
.eq(StIvtHotregioniomst::getTask_id, task_id);
|
||||
hotregioniomstMappper.delete(wrapper);
|
||||
}
|
||||
|
||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
@@ -128,7 +135,10 @@ public class InHotTask extends AbstractAcsTask {
|
||||
schBaseTaskMapper.updateById(jsonTask);
|
||||
|
||||
// 更新主表: 什么时候更新主表
|
||||
JSONObject jsonHotMst = hotMstTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
LambdaQueryWrapper<StIvtHotregioniomst> wrapper = new LambdaQueryWrapper<StIvtHotregioniomst>()
|
||||
.eq(StIvtHotregioniomst::getTask_id, task_id);
|
||||
List<StIvtHotregioniomst> jsonHotMsts = hotregioniomstMappper.selectList(wrapper);
|
||||
StIvtHotregioniomst jsonHotMst = jsonHotMsts.get(0);
|
||||
|
||||
String hot_point_code = "";
|
||||
// 判断此任务是否有三个点位
|
||||
@@ -152,18 +162,18 @@ public class InHotTask extends AbstractAcsTask {
|
||||
* 暂存区入烘箱任务
|
||||
*/
|
||||
// 更新烘箱区库存状态
|
||||
JSONObject jsonHotIvt = hotIvtTab.query("point_code = '" + jsonTask.getPoint_code2() + "'").uniqueResult(0);
|
||||
jsonHotIvt.put("point_status", "02");
|
||||
jsonHotIvt.put("container_name", jsonHotMst.getString("container_name"));
|
||||
jsonHotIvt.put("workorder_id", jsonHotMst.getString("workorder_id"));
|
||||
jsonHotIvt.put("ivt_qty", jsonHotMst.getString("qty"));
|
||||
jsonHotIvt.put("instorage_time", DateUtil.now());
|
||||
jsonHotIvt.put("update_optid", currentUserId);
|
||||
jsonHotIvt.put("update_optname", currentUsername);
|
||||
jsonHotIvt.put("update_time", DateUtil.now());
|
||||
hotIvtTab.update(jsonHotIvt);
|
||||
HotPointIvt jsonHotIvt = hotPointIvtService.findByCode(jsonTask.getPoint_code2());
|
||||
jsonHotIvt.setPoint_status("02");
|
||||
jsonHotIvt.setContainer_name(jsonHotMst.getContainer_name());
|
||||
jsonHotIvt.setWorkorder_id(jsonHotMst.getWorkorder_id());
|
||||
jsonHotIvt.setIvt_qty(jsonHotMst.getQty());
|
||||
jsonHotIvt.setInstorage_time(DateUtil.now());
|
||||
jsonHotIvt.setUpdate_optid(currentUserId);
|
||||
jsonHotIvt.setUpdate_optname(currentUsername);
|
||||
jsonHotIvt.setUpdate_time(DateUtil.now());
|
||||
hotPointIvtService.update(jsonHotIvt);
|
||||
|
||||
String product_area = jsonHotIvt.getString("product_area");
|
||||
String product_area = jsonHotIvt.getProduct_area();
|
||||
if (product_area.equals("B1")) {
|
||||
JSONObject jsonPoint = coolIvtTab.query("point_code = '" + jsonTask.getPoint_code1() + "'").uniqueResult(0);
|
||||
jsonPoint.put("container_name", "");
|
||||
@@ -178,7 +188,7 @@ public class InHotTask extends AbstractAcsTask {
|
||||
}
|
||||
|
||||
|
||||
hot_point_code = jsonHotIvt.getString("ext_code");
|
||||
hot_point_code = jsonHotIvt.getExt_code();
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -195,7 +205,6 @@ public class InHotTask extends AbstractAcsTask {
|
||||
JSONObject jsonCoolIvt = coolIvtTab.query("full_point_code = '" + jsonTask.getPoint_code1() + "'").uniqueResult(0);
|
||||
String container_name = jsonCoolIvt.getString("container_name"); // 母卷号
|
||||
String workorder_id = jsonCoolIvt.getString("workorder_id"); // 母卷工单标识
|
||||
String ivt_qty = jsonCoolIvt.getString("ivt_qty"); // 库存
|
||||
|
||||
jsonCoolIvt.put("full_point_status", "01");
|
||||
jsonCoolIvt.put("cool_ivt_status", "01");
|
||||
@@ -209,35 +218,31 @@ public class InHotTask extends AbstractAcsTask {
|
||||
coolIvtTab.update(jsonCoolIvt);
|
||||
|
||||
// 更新烘箱区库存状态
|
||||
JSONObject jsonHotIvt = hotIvtTab.query("point_code = '" + jsonTask.getPoint_code3() + "'").uniqueResult(0);
|
||||
jsonHotIvt.put("point_status", "02");
|
||||
jsonHotIvt.put("container_name", container_name);
|
||||
jsonHotIvt.put("workorder_id", workorder_id);
|
||||
jsonHotIvt.put("ivt_qty", ivt_qty);
|
||||
jsonHotIvt.put("instorage_time", DateUtil.now());
|
||||
jsonHotIvt.put("update_optid", currentUserId);
|
||||
jsonHotIvt.put("update_optname", currentUsername);
|
||||
jsonHotIvt.put("update_time", DateUtil.now());
|
||||
HotPointIvt jsonHotIvt = hotPointIvtService.findByCode(jsonTask.getPoint_code3());
|
||||
jsonHotIvt.setPoint_status("02");
|
||||
jsonHotIvt.setContainer_name(container_name);
|
||||
jsonHotIvt.setWorkorder_id(workorder_id);
|
||||
jsonHotIvt.setIvt_qty(jsonCoolIvt.getBigDecimal("ivt_qty"));
|
||||
jsonHotIvt.setInstorage_time(DateUtil.now());
|
||||
jsonHotIvt.setUpdate_optid(currentUserId);
|
||||
jsonHotIvt.setUpdate_optname(currentUsername);
|
||||
jsonHotIvt.setUpdate_time(DateUtil.now());
|
||||
|
||||
log.info("入烘箱wql执行update语句!");
|
||||
hotIvtTab.update(jsonHotIvt);
|
||||
hotPointIvtService.update(jsonHotIvt);
|
||||
|
||||
log.info("入烘箱mybatis执行update语句!");
|
||||
HotMapper hotMapper = SpringContextHolder.getBean(HotMapper.class);
|
||||
hotMapper.updateHotByObject(jsonHotIvt);
|
||||
|
||||
hot_point_code = jsonHotIvt.getString("ext_code");
|
||||
hot_point_code = jsonHotIvt.getExt_code();
|
||||
}
|
||||
|
||||
// 将入烘箱信息发送给mes
|
||||
JSONObject param = new JSONObject();
|
||||
String userName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||
String passWord = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||
param.put("iContainerName", jsonHotMst.getString("container_name"));
|
||||
param.put("iContainerName", jsonHotMst.getContainer_name());
|
||||
param.put("iResourceName", hot_point_code);
|
||||
param.put("iMoveInDate", DateUtil.now());
|
||||
param.put("iPlanBakingTemperature", jsonHotMst.getDoubleValue("temperature"));
|
||||
param.put("iPlanBakingTimer", jsonHotMst.getDoubleValue("oven_time"));
|
||||
param.put("iPlanBakingTemperature", jsonHotMst.getTemperature());
|
||||
param.put("iPlanBakingTimer", jsonHotMst.getOven_time());
|
||||
param.put("UserName", userName);
|
||||
param.put("PassWord", passWord);
|
||||
|
||||
@@ -256,8 +261,8 @@ public class InHotTask extends AbstractAcsTask {
|
||||
//将该母卷的入烘箱标识改为0
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("is_baking", "0");
|
||||
WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").update(map, "container_name = '" + jsonHotMst.getString("container_name") + "'");
|
||||
log.info("母卷:" + jsonHotMst.getString("container_name") + "对应的入烘箱任务完成,请求烘烤标识改为0");
|
||||
WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").update(map, "container_name = '" + jsonHotMst.getContainer_name() + "'");
|
||||
log.info("母卷:" + jsonHotMst.getContainer_name() + "对应的入烘箱任务完成,请求烘烤标识改为0");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,10 @@ import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.basedata.master.interfaceback.service.dao.InterfaceBack;
|
||||
import org.nl.wms.basedata.master.interfaceback.service.dao.mapper.InterfaceBackMapper;
|
||||
import org.nl.wms.ext.mes.service.LmsToMesService;
|
||||
import org.nl.wms.pda.mps.service.mapper.HotMapper;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.HotPointIvtService;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.HotPointIvt;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.StIvtHotregioniomst;
|
||||
import org.nl.wms.pdm.ivt.hotpoint.service.dao.mapper.HotregioniomstMappper;
|
||||
import org.nl.wms.sch.AcsTaskDto;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
@@ -27,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -39,6 +43,10 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
private InterfaceBackMapper interfaceBackMapper;
|
||||
@Autowired
|
||||
private SchBaseTaskMapper schBaseTaskMapper;
|
||||
@Autowired
|
||||
private HotPointIvtService hotPointIvtService;
|
||||
@Autowired
|
||||
private HotregioniomstMappper hotregioniomstMappper;
|
||||
@Override
|
||||
public List<AcsTaskDto> addTask() {
|
||||
/*
|
||||
@@ -77,8 +85,6 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateTaskStatus(SchBaseTask taskObj, String status) {
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表
|
||||
WQLObject hotIvtTab = WQLObject.getWQLObject("ST_IVT_HotPointIvt"); // 烘箱区库存表
|
||||
WQLObject hotMstTab = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst"); // 烘箱区出入主表
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区库存表
|
||||
|
||||
|
||||
@@ -94,8 +100,9 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
jsonTask.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
jsonTask.setUpdate_time(DateUtil.now());
|
||||
schBaseTaskMapper.updateById(jsonTask);
|
||||
|
||||
hotMstTab.delete("task_id = '" + task_id + "'");
|
||||
LambdaQueryWrapper<StIvtHotregioniomst> wrapper = new LambdaQueryWrapper<StIvtHotregioniomst>()
|
||||
.eq(StIvtHotregioniomst::getTask_id, task_id);
|
||||
hotregioniomstMappper.delete(wrapper);
|
||||
}
|
||||
|
||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
@@ -171,10 +178,13 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
AbstractAcsTask task = new CoolCutTask();
|
||||
task.createTask(jo);
|
||||
} else {
|
||||
JSONObject jsonHotIvt = hotIvtTab.query("point_code = '" + jsonTask.getPoint_code1() + "'").uniqueResult(0);
|
||||
HotPointIvt jsonHotIvt = hotPointIvtService.findByCode(jsonTask.getPoint_code1());
|
||||
|
||||
// 更新主表: 什么时候更新主表
|
||||
JSONObject jsonHotMst = hotMstTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
LambdaQueryWrapper<StIvtHotregioniomst> wrapper = new LambdaQueryWrapper<StIvtHotregioniomst>()
|
||||
.eq(StIvtHotregioniomst::getTask_id, task_id);
|
||||
List<StIvtHotregioniomst> jsonHotMsts = hotregioniomstMappper.selectList(wrapper);
|
||||
StIvtHotregioniomst jsonHotMst = jsonHotMsts.get(0);
|
||||
|
||||
// 更新暂存区点位状态
|
||||
JSONObject jsonPoint2 = pointTab.query("point_code = '" + jsonTask.getPoint_code2() + "'").uniqueResult(0);
|
||||
@@ -184,47 +194,37 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
jsonPoint2.put("full_point_status", "02");
|
||||
jsonPoint2.put("cool_ivt_status", "04");
|
||||
jsonPoint2.put("instorage_time", DateUtil.now());
|
||||
jsonPoint2.put("container_name", jsonHotIvt.getString("container_name"));
|
||||
jsonPoint2.put("container_name", jsonHotIvt.getContainer_name());
|
||||
ivtTab.update(jsonPoint2);
|
||||
} else {
|
||||
jsonPoint2.put("point_status", "2");
|
||||
jsonPoint2.put("material_code", jsonHotIvt.getString("container_name"));
|
||||
jsonPoint2.put("material_code", jsonHotIvt.getContainer_name());
|
||||
pointTab.update(jsonPoint2);
|
||||
}
|
||||
|
||||
|
||||
// 更新烘箱区库存状态
|
||||
jsonHotIvt.put("point_status", "01");
|
||||
jsonHotIvt.put("container_name", "");
|
||||
jsonHotIvt.put("workorder_id", "");
|
||||
jsonHotIvt.put("ivt_qty", 0);
|
||||
jsonHotIvt.put("instorage_time", "");
|
||||
jsonHotIvt.put("update_optid", currentUserId);
|
||||
jsonHotIvt.put("update_optname", currentUsername);
|
||||
jsonHotIvt.put("update_time", DateUtil.now());
|
||||
jsonHotIvt.setPoint_status("01");
|
||||
jsonHotIvt.setContainer_name("");
|
||||
jsonHotIvt.setWorkorder_id("");
|
||||
jsonHotIvt.setIvt_qty(BigDecimal.valueOf(0));
|
||||
jsonHotIvt.setInstorage_time("");
|
||||
jsonHotIvt.setUpdate_optid(currentUserId);
|
||||
jsonHotIvt.setUpdate_optname(currentUsername);
|
||||
jsonHotIvt.setUpdate_time(DateUtil.now());
|
||||
|
||||
log.info("出烘箱wql执行update语句!");
|
||||
hotIvtTab.update(jsonHotIvt);
|
||||
JSONObject update_ivt = hotIvtTab.query("point_code = '" + jsonTask.getPoint_code1() + "'").uniqueResult(0);
|
||||
hotPointIvtService.update(jsonHotIvt);
|
||||
HotPointIvt update_ivt = hotPointIvtService.findByCode(jsonTask.getPoint_code1() );
|
||||
log.info("更新完后烘箱库存为:-----------------" + update_ivt.toString());
|
||||
|
||||
log.info("出烘箱mybatis执行update语句!");
|
||||
HotMapper hotMapper = SpringContextHolder.getBean(HotMapper.class);
|
||||
hotMapper.updateHotByObject(jsonHotIvt);
|
||||
JSONObject update_ivt2 = hotIvtTab.query("point_code = '" + jsonTask.getPoint_code1() + "'").uniqueResult(0);
|
||||
log.info("更新完后烘箱库存为:-----------------" + update_ivt2.toString());
|
||||
|
||||
if (!update_ivt2.getString("container_name").equals(update_ivt.getString("container_name"))) {
|
||||
log.info("出烘箱WQL更新不成功!");
|
||||
}
|
||||
|
||||
// 将出烘箱信息发送给mes
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("iContainerName", jsonHotMst.getString("container_name"));
|
||||
param.put("iResourceName", jsonHotIvt.getString("ext_code"));
|
||||
param.put("iContainerName", jsonHotMst.getContainer_name());
|
||||
param.put("iResourceName", jsonHotIvt.getExt_code());
|
||||
param.put("iMoveOutDate", DateUtil.now());
|
||||
param.put("iabxActualBakingTemperature", jsonHotMst.getDoubleValue("temperature"));
|
||||
param.put("iabxActualBakingTimer", jsonHotMst.getDoubleValue("oven_time"));
|
||||
param.put("iabxActualBakingTemperature", jsonHotMst.getTemperature());
|
||||
param.put("iabxActualBakingTimer", jsonHotMst.getOven_time());
|
||||
|
||||
//判断该接口是否需要回传
|
||||
LambdaQueryWrapper<InterfaceBack> lam = new LambdaQueryWrapper<>();
|
||||
|
||||
Reference in New Issue
Block a user