Merge branch 'master' of http://121.40.234.130:8899/root/yongYuJiaJu
This commit is contained in:
@@ -66,4 +66,20 @@ public class RegionController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getPointStatusSelectById")
|
||||
@Log("获取点位状态下拉框")
|
||||
@ApiOperation("获取点位状态下拉框")
|
||||
//@SaCheckPermission("region:add")
|
||||
public ResponseEntity<Object> getPointStatusSelectById(@RequestBody Long region_id) {
|
||||
return new ResponseEntity<>(regionService.getPointStatusSelectById(region_id), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PostMapping("/getPointTypeSelectById")
|
||||
@Log("获取点位类型下拉框")
|
||||
@ApiOperation("获取点位类型下拉框")
|
||||
//@SaCheckPermission("region:add")
|
||||
public ResponseEntity<Object> getPointTypeSelectById(@RequestBody Long region_id) {
|
||||
return new ResponseEntity<>(regionService.getPointTypeSelectById(region_id), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
package org.nl.wms.sch.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.nl.wms.sch.service.dto.RegionDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
@@ -69,4 +70,17 @@ public interface RegionService {
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
/**
|
||||
* 获取点位状态下拉框
|
||||
* @param region_id
|
||||
* @return
|
||||
*/
|
||||
JSONArray getPointStatusSelectById(Long region_id);
|
||||
|
||||
/**
|
||||
* 获取点位类型下拉框
|
||||
* @param region_id
|
||||
* @return
|
||||
*/
|
||||
JSONArray getPointTypeSelectById(Long region_id);
|
||||
}
|
||||
|
||||
@@ -1,128 +1,111 @@
|
||||
package org.nl.wms.sch.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author ldjun
|
||||
* @description /
|
||||
* @date 2021-12-07
|
||||
* @author 1
|
||||
* @date 2022-10-19
|
||||
**/
|
||||
@Data
|
||||
public class PointDto implements Serializable {
|
||||
|
||||
/** 点位标识 */
|
||||
/**
|
||||
* 防止精度丢失
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long point_id;
|
||||
|
||||
/**
|
||||
* 点位编码
|
||||
*/
|
||||
/** 点位编码 */
|
||||
private String point_code;
|
||||
|
||||
/**
|
||||
* 点位名称
|
||||
*/
|
||||
/** 点位名称 */
|
||||
private String point_name;
|
||||
|
||||
/**
|
||||
* 所属区域
|
||||
*/
|
||||
/** 所属区域 */
|
||||
private Long region_id;
|
||||
|
||||
/**
|
||||
* 点位类型
|
||||
*/
|
||||
/** 区域编码 */
|
||||
private String region_code;
|
||||
|
||||
/** 区域名称 */
|
||||
private String region_name;
|
||||
|
||||
/** 点位类型 */
|
||||
private String point_type;
|
||||
|
||||
/**
|
||||
* 点位状态
|
||||
*/
|
||||
/** 点位状态 */
|
||||
private String point_status;
|
||||
|
||||
/**
|
||||
* 锁定类型
|
||||
*/
|
||||
/** 锁定类型 */
|
||||
private String lock_type;
|
||||
|
||||
/**
|
||||
* 载具编码
|
||||
*/
|
||||
private String vehicle_code;
|
||||
/** 设备编码 */
|
||||
private String device_code;
|
||||
|
||||
/**
|
||||
* 载具数量
|
||||
*/
|
||||
private Integer vehicle_qty;
|
||||
/** MES设备编码 */
|
||||
private String mes_device_code;
|
||||
|
||||
/**
|
||||
* 载具类型
|
||||
*/
|
||||
/** 允许的载具类型 */
|
||||
private String can_vehicle_type;
|
||||
|
||||
/** 载具类型 */
|
||||
private String vehicle_type;
|
||||
|
||||
/**
|
||||
* 是否专机
|
||||
*/
|
||||
private String is_host;
|
||||
/** 载具编码 */
|
||||
private String vehicle_code;
|
||||
|
||||
/**
|
||||
* 来源标识
|
||||
*/
|
||||
private Long source_id;
|
||||
/** 载具数量 */
|
||||
private BigDecimal vehicle_qty;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
/** 块 */
|
||||
private BigDecimal block_num;
|
||||
|
||||
/** 排 */
|
||||
private BigDecimal row_num;
|
||||
|
||||
/** 列 */
|
||||
private BigDecimal col_num;
|
||||
|
||||
/** 层 */
|
||||
private BigDecimal layer_num;
|
||||
|
||||
/** 点位组编码 */
|
||||
private String point_group_code;
|
||||
|
||||
/** 是否建工单 */
|
||||
private String is_have_workder;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
/** 来源标识 */
|
||||
private Long source_id;
|
||||
|
||||
/** 是否启用 */
|
||||
private String is_used;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
/** 是否删除 */
|
||||
private String is_delete;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
/** 创建人 */
|
||||
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 device_point_type;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,9 @@ import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.sch.service.PointService;
|
||||
import org.nl.wms.sch.service.RegionService;
|
||||
import org.nl.wms.sch.service.dto.PointDto;
|
||||
import org.nl.wms.sch.service.dto.RegionDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -34,6 +36,9 @@ import java.util.Map;
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class PointServiceImpl implements PointService {
|
||||
|
||||
private final RegionService regionService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
HashMap map = new HashMap();
|
||||
@@ -46,6 +51,39 @@ public class PointServiceImpl implements PointService {
|
||||
map.put("point_type", whereJson.get("point_type"));
|
||||
map.put("name", whereJson.get("name"));
|
||||
JSONObject json = WQL.getWO("QSCH_BASE_POINT").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "point_code asc");
|
||||
JSONArray content = json.getJSONArray("content");
|
||||
JSONArray res = new JSONArray();
|
||||
for (int i = 0; i < content.size(); i++) {
|
||||
JSONObject object = content.getJSONObject(i);
|
||||
Long region_id = object.getLong("region_id");
|
||||
String point_status = object.getString("point_status");
|
||||
String point_type = object.getString("point_type");
|
||||
RegionDto regionDto = regionService.findById(region_id);
|
||||
String point_status_explain = regionDto.getPoint_status_explain();
|
||||
String point_type_explain = regionDto.getPoint_type_explain();
|
||||
// 获取点位状态名称
|
||||
if (!ObjectUtil.isEmpty(point_status)) {
|
||||
JSONObject statusArr = new JSONObject();
|
||||
String[] split = point_status_explain.split(",");
|
||||
for ( int j = 0; j < split.length; j++) {
|
||||
String[] status = split[j].split("-");
|
||||
statusArr.put(status[0], status[1]);
|
||||
}
|
||||
object.put("point_status_name", statusArr.getString(point_status));
|
||||
}
|
||||
// 获取点位类型
|
||||
if (!ObjectUtil.isEmpty(point_type)) {
|
||||
JSONObject typeArr = new JSONObject();
|
||||
String[] split = point_type_explain.split(",");
|
||||
for ( int j = 0; j < split.length; j++) {
|
||||
String[] types = split[j].split("-");
|
||||
typeArr.put(types[0], types[1]);
|
||||
}
|
||||
object.put("point_status_name", typeArr.getString(point_type));
|
||||
}
|
||||
res.add(object);
|
||||
}
|
||||
json.put("content", res);
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -91,6 +129,9 @@ public class PointServiceImpl implements PointService {
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
RegionDto regionDto = regionService.findById(dto.getRegion_id());
|
||||
dto.setRegion_code(regionDto.getRegion_code());
|
||||
dto.setRegion_name(regionDto.getRegion_name());
|
||||
dto.setPoint_id(IdUtil.getSnowflake(1, 1).nextId());
|
||||
dto.setCreate_id(currentUserId);
|
||||
dto.setCreate_name(nickName);
|
||||
@@ -212,7 +253,7 @@ public class PointServiceImpl implements PointService {
|
||||
|
||||
@Override
|
||||
public JSONArray getRegion() {
|
||||
JSONArray resultJSONArray = WQLObject.getWQLObject("SCH_BASE_Region").query("is_used = '1'").getResultJSONArray(0);
|
||||
JSONArray resultJSONArray = WQLObject.getWQLObject("SCH_BASE_Region").query().getResultJSONArray(0);
|
||||
return resultJSONArray;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ 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 cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -129,4 +130,55 @@ public class RegionServiceImpl implements RegionService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取点位状态下拉框
|
||||
*
|
||||
* @param region_id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JSONArray getPointStatusSelectById(Long region_id) {
|
||||
/**
|
||||
* label,value
|
||||
*/
|
||||
JSONArray res = new JSONArray();
|
||||
String point_status_explain = findById(region_id).getPoint_status_explain();
|
||||
if (ObjectUtil.isEmpty(point_status_explain)) return res;
|
||||
String[] explain = point_status_explain.split(",");
|
||||
for (int i = 0; i < explain.length; i++) {
|
||||
String[] status = explain[i].split("-");
|
||||
JSONObject point_status = new JSONObject();
|
||||
point_status.put("label", status[1]);
|
||||
point_status.put("value", status[0]);
|
||||
res.add(point_status);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取点位类型下拉框
|
||||
*
|
||||
* @param region_id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JSONArray getPointTypeSelectById(Long region_id) {
|
||||
/**
|
||||
* label,value
|
||||
*/
|
||||
JSONArray res = new JSONArray();
|
||||
String point_type_explain = findById(region_id).getPoint_type_explain();
|
||||
if (ObjectUtil.isEmpty(point_type_explain)) return res;
|
||||
String[] explain = point_type_explain.split(",");
|
||||
for (int i = 0; i < explain.length; i++) {
|
||||
String[] types = explain[i].split("-");
|
||||
JSONObject point_type = new JSONObject();
|
||||
point_type.put("label", types[1]);
|
||||
point_type.put("value", types[0]);
|
||||
res.add(point_type);
|
||||
res.add(point_type);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class CallEmpVehicleTask extends AbstractAcsTask {
|
||||
int vehicle_qty = JSONObject.parseObject(JSON.toJSONString(point_code1)).getIntValue("vehicle_qty");
|
||||
BigDecimal vehicle_qty_point = NumberUtil.sub(String.valueOf(vehicle_qty), String.valueOf(1));
|
||||
|
||||
point_code1.setVehicle_qty(Integer.valueOf(vehicle_qty_point.toString()));
|
||||
point_code1.setVehicle_qty(vehicle_qty_point);
|
||||
if (StrUtil.equals(vehicle_qty_point.toString(), "0")) {
|
||||
point_code1.setPoint_status("00");
|
||||
point_code1.setVehicle_type("");
|
||||
|
||||
@@ -86,7 +86,7 @@ public class SendEmpVehicleTask extends AbstractAcsTask {
|
||||
int vehicle_qty = JSONObject.parseObject(JSON.toJSONString(nextDto)).getIntValue("vehicle_qty");
|
||||
BigDecimal vehicle_qty_point = NumberUtil.add(String.valueOf(vehicle_qty), String.valueOf(jsonEmp.getIntValue("vehicle_qty")));
|
||||
|
||||
nextDto.setVehicle_qty(Integer.valueOf(vehicle_qty_point.toString()));
|
||||
nextDto.setVehicle_qty(vehicle_qty_point);
|
||||
nextDto.setPoint_status("01");
|
||||
nextDto.setLock_type("00");
|
||||
nextDto.setVehicle_type(jsonTask.getString("vehicle_type"));
|
||||
|
||||
@@ -48,42 +48,12 @@
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
point.point_id,
|
||||
point.point_code,
|
||||
point.point_name,
|
||||
point.region_id,
|
||||
region.region_name,
|
||||
point.point_type,
|
||||
point.point_status,
|
||||
point.lock_type,
|
||||
d1.label as point_type_name,
|
||||
d4.label as point_status_name,
|
||||
d3.label as lock_type_name,
|
||||
point.vehicle_code,
|
||||
point.source_id,
|
||||
point.remark,
|
||||
point.taskdtl_type,
|
||||
point.taskdtl_id,
|
||||
point.task_code,
|
||||
point.inv_type,
|
||||
point.inv_id,
|
||||
point.inv_code,
|
||||
point.is_used,
|
||||
point.is_delete,
|
||||
point.vehicle_qty,
|
||||
point.create_name,
|
||||
point.create_time,
|
||||
point.update_optname,
|
||||
point.update_time,
|
||||
point.vehicle_type,
|
||||
point.is_host,
|
||||
point.device_point_type
|
||||
point.*,
|
||||
d3.label as lock_type_name
|
||||
FROM
|
||||
sch_base_point point
|
||||
LEFT JOIN SCH_BASE_Region region ON point.region_id = region.region_id
|
||||
LEFT JOIN sys_dict_detail d1 ON point.point_type = d1.value and d1.name='sch_point_type'
|
||||
LEFT JOIN sys_dict_detail d3 ON point.lock_type = d3.value and d3.name='d_lock_type'
|
||||
LEFT JOIN sys_dict_detail d4 ON point.point_status = d4.value and d4.name='sch_point_status'
|
||||
WHERE
|
||||
point.is_delete = '0'
|
||||
OPTION 输入.region_id <> ""
|
||||
|
||||
Reference in New Issue
Block a user