no message
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
|
||||
package org.nl.wms.Cribbing.rest;
|
||||
|
||||
|
||||
import org.nl.wms.Cribbing.service.CribbinginfoService;
|
||||
import org.nl.wms.Cribbing.service.dto.CribbinginfoDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.annotation.Log;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @author qinx
|
||||
* @date 2022-09-26
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "基础垛形参数管理")
|
||||
@RequestMapping("/api/cribbinginfo")
|
||||
@Slf4j
|
||||
public class CribbinginfoController {
|
||||
|
||||
private final CribbinginfoService cribbinginfoService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询基础垛形参数")
|
||||
@ApiOperation("查询基础垛形参数")
|
||||
//@PreAuthorize("@el.check('cribbinginfo:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(cribbinginfoService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增基础垛形参数")
|
||||
@ApiOperation("新增基础垛形参数")
|
||||
//@PreAuthorize("@el.check('cribbinginfo:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody CribbinginfoDto dto) {
|
||||
cribbinginfoService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改基础垛形参数")
|
||||
@ApiOperation("修改基础垛形参数")
|
||||
//@PreAuthorize("@el.check('cribbinginfo:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody CribbinginfoDto dto) {
|
||||
cribbinginfoService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除基础垛形参数")
|
||||
@ApiOperation("删除基础垛形参数")
|
||||
//@PreAuthorize("@el.check('cribbinginfo:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
cribbinginfoService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
|
||||
package org.nl.wms.Cribbing.service;
|
||||
|
||||
import org.nl.wms.Cribbing.service.dto.CribbinginfoDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author qinx
|
||||
* @date 2022-09-26
|
||||
**/
|
||||
public interface CribbinginfoService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param whereJson 条件参数
|
||||
* @return List<CribbinginfoDto>
|
||||
*/
|
||||
List<CribbinginfoDto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param info_id ID
|
||||
* @return Cribbinginfo
|
||||
*/
|
||||
CribbinginfoDto findById(Long info_id);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
* @param code code
|
||||
* @return Cribbinginfo
|
||||
*/
|
||||
CribbinginfoDto findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param dto /
|
||||
*/
|
||||
void create(CribbinginfoDto dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param dto /
|
||||
*/
|
||||
void update(CribbinginfoDto dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,227 @@
|
||||
package org.nl.wms.Cribbing.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author qinx
|
||||
* @date 2022-09-26
|
||||
**/
|
||||
@Data
|
||||
public class CribbinginfoDto implements Serializable {
|
||||
|
||||
/** 对应标识 */
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long info_id;
|
||||
|
||||
/** 物料标志 */
|
||||
private Long material_id;
|
||||
|
||||
/** 物料编码 */
|
||||
private String material_code;
|
||||
|
||||
/** 物料名称 */
|
||||
private String material_name;
|
||||
|
||||
/** 规格 */
|
||||
private String material_spec;
|
||||
|
||||
/** 产品编号 */
|
||||
private String product_code;
|
||||
|
||||
/** A长边 */
|
||||
private String AlongSide;
|
||||
|
||||
/** B短边 */
|
||||
private String BshortSide;
|
||||
|
||||
/** H梯形高 */
|
||||
private String Htrapezoidal;
|
||||
|
||||
/** W厚度 */
|
||||
private String Wthickness;
|
||||
|
||||
/** 当前垛盘数 */
|
||||
private String tray_qty;
|
||||
|
||||
/** 垛盘高度 */
|
||||
private String tray_high;
|
||||
|
||||
/** 垛型类别 */
|
||||
private String crib_category;
|
||||
|
||||
/** 码垛X1行 */
|
||||
private String palletX1_line;
|
||||
|
||||
/** 码垛Y1列 */
|
||||
private String palletY1_row;
|
||||
|
||||
/** 码垛A1角度 */
|
||||
private String palletA1_angle;
|
||||
|
||||
/** 码垛X2行 */
|
||||
private String palletX2_line;
|
||||
|
||||
/** 码垛Y2列 */
|
||||
private String palletY2_row;
|
||||
|
||||
/** 码垛A2角度 */
|
||||
private String palletA2_angle;
|
||||
|
||||
/** 码垛X3行 */
|
||||
private String palletX3_line;
|
||||
|
||||
/** 码垛Y3列 */
|
||||
private String palletY3_row;
|
||||
|
||||
/** 码垛A3角度 */
|
||||
private String palletA3_angle;
|
||||
|
||||
/** 压垛X1行 */
|
||||
private String pressCribX1_line;
|
||||
|
||||
/** 压垛Y1列 */
|
||||
private String pressCribY1_row;
|
||||
|
||||
/** 压垛A1角度 */
|
||||
private String pressCribA1_angle;
|
||||
|
||||
/** 压垛X2行 */
|
||||
private String pressCribX2_line;
|
||||
|
||||
/** 压垛Y2列 */
|
||||
private String pressCribY2_row;
|
||||
|
||||
/** 压垛A2角度 */
|
||||
private String pressCribA2_angle;
|
||||
|
||||
/** 压垛X3行 */
|
||||
private String pressCribX3_line;
|
||||
|
||||
/** 压垛Y3列 */
|
||||
private String pressCribY3_row;
|
||||
|
||||
/** 压垛A3角度 */
|
||||
private String pressCribA3_angle;
|
||||
|
||||
/** Z轴偏移 */
|
||||
private String Zoffset;
|
||||
|
||||
/** 码垛层数 */
|
||||
private String pallet_layerQty;
|
||||
|
||||
/** 压垛层数 */
|
||||
private String pressCrib_layerQty;
|
||||
|
||||
/** 码层X1间隔 */
|
||||
private String codeLayerX1_interval;
|
||||
|
||||
/** 码层Y1间隔 */
|
||||
private String codeLayerY1_interval;
|
||||
|
||||
/** 码层X2间隔 */
|
||||
private String codeLayerX2_interval;
|
||||
|
||||
/** 码层Y2间隔 */
|
||||
private String codeLayerY2_interval;
|
||||
|
||||
/** 码层X3间隔 */
|
||||
private String codeLayerX3_interval;
|
||||
|
||||
/** 码层Y3间隔 */
|
||||
private String codeLayerY3_interval;
|
||||
|
||||
/** 码层X1偏移 */
|
||||
private String codeLayerX1_offset;
|
||||
|
||||
/** 码层Y1偏移 */
|
||||
private String codeLayerY1_offset;
|
||||
|
||||
/** 码层X2偏移 */
|
||||
private String codeLayerX2_offset;
|
||||
|
||||
/** 码层Y2偏移 */
|
||||
private String codeLayerY2_offset;
|
||||
|
||||
/** 码层X3偏移 */
|
||||
private String codeLayerX3_offset;
|
||||
|
||||
/** 码层Y3偏移 */
|
||||
private String codeLayerY3_offset;
|
||||
|
||||
/** 压层X1间隔 */
|
||||
private String pressLayerX1_interval;
|
||||
|
||||
/** 压层Y1间隔 */
|
||||
private String pressLayerY1_interval;
|
||||
|
||||
/** 压层X2间隔 */
|
||||
private String pressLayerX2_interval;
|
||||
|
||||
/** 压层Y2间隔 */
|
||||
private String pressLayerY2_interval;
|
||||
|
||||
/** 压层X3间隔 */
|
||||
private String pressLayerX3_interval;
|
||||
|
||||
/** 压层Y3间隔 */
|
||||
private String pressLayerY3_interval;
|
||||
|
||||
/** 压层X1偏移 */
|
||||
private String pressLayerX1_offset;
|
||||
|
||||
/** 压层Y1偏移 */
|
||||
private String pressLayerY1_offset;
|
||||
|
||||
/** 压层X2偏移 */
|
||||
private String pressLayerX2_offset;
|
||||
|
||||
/** 压层Y2偏移 */
|
||||
private String pressLayerY2_offset;
|
||||
|
||||
/** 压层X3偏移 */
|
||||
private String pressLayerX3_offset;
|
||||
|
||||
/** 压层Y3偏移 */
|
||||
private String pressLayerY3_offset;
|
||||
|
||||
/** 1#垛总数 */
|
||||
private String one_cribTotal;
|
||||
|
||||
/** 2#垛总数 */
|
||||
private String two_cribTotal;
|
||||
|
||||
/** 1#垛当前数 */
|
||||
private String one_qty;
|
||||
|
||||
/** 2#垛当前数 */
|
||||
private String two_qty;
|
||||
|
||||
/** 工具坐标 */
|
||||
private String tool_coordinate;
|
||||
|
||||
/** 组盘人 */
|
||||
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 is_delete;
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
|
||||
package org.nl.wms.Cribbing.service.impl;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.wms.Cribbing.service.CribbinginfoService;
|
||||
import org.nl.wms.Cribbing.service.dto.CribbinginfoDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.wql.core.bean.ResultBean;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.nl.wql.util.WqlUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
|
||||
/**
|
||||
* @description 服务实现
|
||||
* @author qinx
|
||||
* @date 2022-09-26
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class CribbinginfoServiceImpl implements CribbinginfoService {
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(Map whereJson, Pageable page){
|
||||
WQLObject wo = WQLObject.getWQLObject("md_me_cribbinginfo");
|
||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "1=1", "update_time desc");
|
||||
final JSONObject json = rb.pageResult();
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CribbinginfoDto> queryAll(Map whereJson){
|
||||
WQLObject wo = WQLObject.getWQLObject("md_me_cribbinginfo");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(CribbinginfoDto.class);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CribbinginfoDto findById(Long info_id) {
|
||||
WQLObject wo = WQLObject.getWQLObject("md_me_cribbinginfo");
|
||||
JSONObject json = wo.query("info_id = '" + info_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)){
|
||||
return json.toJavaObject( CribbinginfoDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CribbinginfoDto findByCode(String code) {
|
||||
WQLObject wo = WQLObject.getWQLObject("md_me_cribbinginfo");
|
||||
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)){
|
||||
return json.toJavaObject( CribbinginfoDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(CribbinginfoDto dto) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
dto.setInfo_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("md_me_cribbinginfo");
|
||||
JSONObject json = JSONObject.parseObject(JSONObject.toJSONString(dto));
|
||||
wo.insert(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(CribbinginfoDto dto) {
|
||||
CribbinginfoDto entity = this.findById(dto.getInfo_id());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
|
||||
String now = DateUtil.now();
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("md_me_cribbinginfo");
|
||||
JSONObject json = JSONObject.parseObject(JSONObject.toJSONString(dto));
|
||||
wo.update(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("md_me_cribbinginfo");
|
||||
for (Long info_id: ids) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("info_id", String.valueOf(info_id));
|
||||
param.put("is_delete", "1");
|
||||
param.put("update_optid", currentUserId);
|
||||
param.put("update_optname", nickName);
|
||||
param.put("update_time", now);
|
||||
wo.update(param);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -291,7 +291,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
vehicle_code = jsonObject.get("vehicle_code").toString();
|
||||
}
|
||||
String qty = String.valueOf(jsonObject.get("qty"));
|
||||
//产品编码
|
||||
String product_code = String.valueOf(jsonObject.get("product_code"));
|
||||
//String material_code = (String) jsonObject.get("material_code");
|
||||
if (StrUtil.isEmpty(product_code)){
|
||||
throw new BadRequestException("产品编号不能为空!");
|
||||
}
|
||||
produceInfoByCode = this.getProduceInfoByCode(device_code);
|
||||
String material_id = (String) produceInfoByCode.get("material_id");
|
||||
String cust_id = (String) produceInfoByCode.get("cust_id");
|
||||
@@ -305,6 +310,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
groubObj.put("material_id", material_id);
|
||||
groubObj.put("material_code", materialObj.getString("material_code"));
|
||||
groubObj.put("material_name", materialObj.getString("material_name"));
|
||||
groubObj.put("product_code", product_code);
|
||||
groubObj.put("cust_id", cust_id);
|
||||
groubObj.put("qty", qty);
|
||||
groubObj.put("producetask_id", producetask_id);
|
||||
@@ -508,7 +514,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
code = "2";
|
||||
}
|
||||
//更新窑的信息
|
||||
// KilnUtil.outKiln(vehicle_code);
|
||||
KilnUtil.outKiln(vehicle_code);
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "任务状态反馈成功!");
|
||||
|
||||
@@ -112,13 +112,19 @@
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
material.material_spec,
|
||||
material.material_model
|
||||
material.material_model,
|
||||
info.product_code,
|
||||
info.AlongSide,
|
||||
info.BshortSide,
|
||||
info.Htrapezoidal,
|
||||
info.Wthickness
|
||||
FROM
|
||||
pdm_mg_producetask task
|
||||
LEFT JOIN sch_base_point point ON point.device_id = task.device_id
|
||||
AND point.point_code <> 'MDJXS101'
|
||||
LEFT JOIN md_me_material material ON material.material_id = task.material_id
|
||||
LEFT JOIN pdm_base_device device ON device.device_id = task.device_id
|
||||
left join MD_ME_CribbingInfo info on info.material_id = material.material_id
|
||||
WHERE
|
||||
1 =1
|
||||
OPTION 输入.producetask_id <> ""
|
||||
@@ -136,12 +142,18 @@
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
material.material_spec,
|
||||
material.material_model
|
||||
material.material_model,
|
||||
info.product_code,
|
||||
info.AlongSide,
|
||||
info.BshortSide,
|
||||
info.Htrapezoidal,
|
||||
info.Wthickness
|
||||
FROM
|
||||
pdm_mg_producetask task
|
||||
LEFT JOIN sch_base_point point ON point.device_id = task.device_id
|
||||
AND point.point_code <> 'MDJXS101'
|
||||
LEFT JOIN md_me_material material ON material.material_id = task.material_id
|
||||
left join MD_ME_CribbingInfo info on info.material_id = material.material_id
|
||||
WHERE
|
||||
1 =1
|
||||
OPTION 输入.producetask_id <> ""
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user