点位代码更新

This commit is contained in:
lyd
2022-11-04 14:29:21 +08:00
parent 1900d7cd96
commit 19db98e95b
7 changed files with 421 additions and 28 deletions

View File

@@ -49,9 +49,6 @@ public class PointDto implements Serializable {
/** MES设备编码 */
private String mes_device_code;
/** 物料标识 */
private Long material_id;
/** 允许的载具类型 */
private String can_vehicle_type;
@@ -62,16 +59,16 @@ public class PointDto implements Serializable {
private String vehicle_code;
/** 载具数量 */
private BigDecimal vehicle_qty;
private String vehicle_qty;
/** 块 */
private BigDecimal block_num;
/** 排 */
private BigDecimal col_num;
private BigDecimal row_num;
/** 列 */
private BigDecimal row_num;
private BigDecimal col_num;
/** 层 */
private BigDecimal layer_num;
@@ -111,4 +108,43 @@ public class PointDto implements Serializable {
/** 修改时间 */
private String update_time;
/** 载具允许最大数量 */
private BigDecimal vehicle_max_qty;
/** 入库顺序 */
private BigDecimal in_order_seq;
/** 出库顺序 */
private BigDecimal out_order_seq;
/** 入空载具顺序 */
private BigDecimal in_empty_seq;
/** 出空载具顺序 */
private BigDecimal out_empty_seq;
/** 在执行的任务标识 */
private Long task_id;
/** 物料标识 */
private String material_id;
/** 批次 */
private String pcsn;
/** 库存数 */
private BigDecimal ivt_qty;
/** 计量单位标识 */
private Long qty_unit_id;
/** 入库时间 */
private String instorage_time;
/** 静置时间(分钟) */
private BigDecimal standing_time;
/** 是否关联库存表 */
private String is_ref_ivt;
}

View File

@@ -23,6 +23,7 @@ import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -153,13 +154,8 @@ public class PointServiceImpl implements PointService {
throw new BadRequestException("被删除或无权限,操作失败!");
}
String pointStatus = dto.getPoint_status();
if (ObjectUtil.isNotEmpty(pointStatus) && pointStatus.equals("1")) {
entity.setMaterial_id(null);
entity.setVehicle_type(null);
entity.setVehicle_code(null);
entity.setVehicle_qty(null);
}
WQLObject materialBaseTab = WQLObject.getWQLObject("MD_ME_MaterialBase");
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point");
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
@@ -168,10 +164,31 @@ public class PointServiceImpl implements PointService {
dto.setUpdate_time(now);
dto.setUpdate_optid(currentUserId);
dto.setUpdate_optname(nickName);
String pointStatus = dto.getPoint_status();
WQLObject wo = WQLObject.getWQLObject("sch_base_point");
if (ObjectUtil.isNotEmpty(pointStatus) && pointStatus.equals("1")) { // 空位
dto.setMaterial_id("");
dto.setVehicle_type("");
dto.setVehicle_code("");
dto.setVehicle_qty("");
dto.setPcsn("");
dto.setIvt_qty(BigDecimal.valueOf(0));
dto.setInstorage_time(null);
dto.setStanding_time(BigDecimal.valueOf(0));
} else if (pointStatus.equals("2")) { // 空载具
dto.setMaterial_id(null);
dto.setInstorage_time(now);
dto.setStanding_time(BigDecimal.valueOf(0));
} else { // 有料
if (ObjectUtil.isEmpty(dto.getMaterial_id())) throw new BadRequestException("物料不能为空");
if (ObjectUtil.isEmpty(dto.getIvt_qty())) throw new BadRequestException("库存数不能为空");
JSONObject materialObj = materialBaseTab.query("material_id = '" + dto.getMaterial_id() + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(materialObj)) throw new BadRequestException("未找到该物料");
dto.setStanding_time(materialObj.getBigDecimal("standing_time"));
dto.setInstorage_time(now);
}
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
wo.update(json);
pointTab.update(json);
}

View File

@@ -49,11 +49,13 @@
PAGEQUERY
SELECT
point.*,
d3.label as lock_type_name
d3.label as lock_type_name,
ma.material_name
FROM
sch_base_point point
LEFT JOIN SCH_BASE_Region region ON point.region_id = region.region_id
LEFT JOIN sys_dict_detail d3 ON point.lock_type = d3.value and d3.name='d_lock_type'
LEFT JOIN md_me_materialbase ma ON ma.material_id = point.material_id
WHERE
point.is_delete = '0'
OPTION 输入.region_id <> ""