opt:株洲中钨优化
This commit is contained in:
@@ -294,7 +294,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (productionLineDockingStationDeviceDriver.getAction() == 1) {
|
||||
if (productionLineDockingStationDeviceDriver.getAction() == 1 && productionLineDockingStationDeviceDriver.getMove() == 1) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
@@ -585,7 +585,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (productionLineDockingStationDeviceDriver.getAction() == 1) {
|
||||
if (productionLineDockingStationDeviceDriver.getAction() == 2 && productionLineDockingStationDeviceDriver.getMove()==0) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
@@ -870,7 +870,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (productionLineDockingStationDeviceDriver.getAction() == 1) {
|
||||
if (productionLineDockingStationDeviceDriver.getAction() == 1 && productionLineDockingStationDeviceDriver.getMove() == 1) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
@@ -1151,7 +1151,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (productionLineDockingStationDeviceDriver.getAction() == 1) {
|
||||
if (productionLineDockingStationDeviceDriver.getAction() == 2 && productionLineDockingStationDeviceDriver.getMove() == 0) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
|
||||
@@ -164,15 +164,14 @@ public class ProductionLineDockingStationDeviceDriver extends AbstractOpcDeviceD
|
||||
this.setIserror(false);
|
||||
}
|
||||
|
||||
|
||||
last_mode = mode;
|
||||
last_action = action;
|
||||
last_move = move;
|
||||
last_error = error;
|
||||
last_to_command = to_command;
|
||||
last_heartbeat = heartbeat;
|
||||
}
|
||||
|
||||
|
||||
public void writing(Map<String, Object> map) throws Exception {
|
||||
Map<String, Object> itemMap = new LinkedHashMap<>();
|
||||
map.forEach((key, value) -> {
|
||||
|
||||
@@ -70,6 +70,9 @@ public class RemoveSealCoverPositionDriver extends AbstractOpcDeviceDriver imple
|
||||
//取放信号
|
||||
int action = 0;
|
||||
int last_action = 0;
|
||||
//光电信号
|
||||
int move = 0;
|
||||
int last_move = 0;
|
||||
//报警信号
|
||||
int error = 0;
|
||||
int last_error = 0;
|
||||
@@ -165,6 +168,8 @@ public class RemoveSealCoverPositionDriver extends AbstractOpcDeviceDriver imple
|
||||
last_task = task;
|
||||
last_error = error;
|
||||
last_to_command = to_command;
|
||||
last_heartbeat = heartbeat;
|
||||
last_move = move;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,9 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.nl.common.utils.ValidationUtil.assertNotBlankJson;
|
||||
|
||||
@@ -162,6 +164,16 @@ public class PdaIosInController {
|
||||
|| StringUtils.isBlank(paramDto.getForm_data_code()))
|
||||
throw new IllegalArgumentException("载具、卸货区点位、单据不能为空!");
|
||||
}
|
||||
// 校验是否存在重复的载具
|
||||
List<String> vehicleCodeList = dto.getParam_list().stream().map(ZwConfirmInParamDto::getVehicle_code).collect(Collectors.toList());
|
||||
if(vehicleCodeList.size() != vehicleCodeList.stream().distinct().count()){
|
||||
throw new IllegalArgumentException("存在重复的载具!");
|
||||
}
|
||||
// 校验是否存在重复的卸货区点位
|
||||
List<String> siteCodeList = dto.getParam_list().stream().map(ZwConfirmInParamDto::getSite_code).collect(Collectors.toList());
|
||||
if(siteCodeList.size() != siteCodeList.stream().distinct().count()){
|
||||
throw new IllegalArgumentException("存在重复的卸货区点位!");
|
||||
}
|
||||
|
||||
return new ResponseEntity<>(pdaIosInService.zwConfirmIn(dto), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -147,7 +147,9 @@ public class PdaIosOutController {
|
||||
@Log("根据库区、物料信息获取库存信息")
|
||||
public ResponseEntity<Object> getStructivtByMaterialAndSectCode(@RequestBody JSONObject whereJson) {
|
||||
assertNotBlankJson(whereJson, "请求参数不能为空", "sect_code");
|
||||
return new ResponseEntity<>(pdaIosOutService.getStructivtByMaterialAndSectCode(whereJson), HttpStatus.OK);
|
||||
JSONObject selectJson = new JSONObject();
|
||||
selectJson.put("sect_id" ,whereJson.getString("sect_code"));
|
||||
return new ResponseEntity<>(pdaIosOutService.getStructivtByMaterialAndSectCode(selectJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -437,6 +437,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
}
|
||||
PmFormMaterialDto pmFormMaterialDto = new PmFormMaterialDto();
|
||||
BeanUtils.copyProperties(mdMeMaterialbase,pmFormMaterialDto);
|
||||
pmFormMaterialDto.setMaterial_code(pmFormDataList.get(0).getMaterial_code());
|
||||
pmFormMaterialDto.setExt_code(ext_code);
|
||||
return PdaResponse.requestParamOk(pmFormMaterialDto);
|
||||
}
|
||||
@@ -1425,13 +1426,16 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
throw new BadRequestException("载具" + vehicle_code + "未组盘,请先组盘!");
|
||||
}
|
||||
|
||||
MdMeMaterialbase mdMeMaterialbase = iMdMeMaterialbaseService.getByCode( groupPlates.get(0).getMaterial_id(),true);
|
||||
|
||||
|
||||
ZwConfirmCheckParamRespondDto respDto = new ZwConfirmCheckParamRespondDto();
|
||||
respDto.setQty(String.valueOf(groupPlates.get(0).getQty()));
|
||||
respDto.setMaterial_code(groupPlates.get(0).getMaterial_code());
|
||||
respDto.setMaterial_code(mdMeMaterialbase.getMaterial_code());
|
||||
respDto.setForm_data_code(groupPlates.get(0).getExt_code());
|
||||
respDto.setVehicle_code(vehicle_code);
|
||||
respDto.setSite_code(site_code);
|
||||
return PdaResponse.requestParamOk(respDto);
|
||||
return PdaResponse.requestParamOk(Collections.singletonList(respDto));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -406,17 +406,6 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
|
||||
@Override
|
||||
public PdaResponse getMaterialSuppByVehicleCode(JSONObject whereJson) {
|
||||
|
||||
//从库存判断
|
||||
List<Structattr> structattrList = iStructattrService.list(new LambdaQueryWrapper<Structattr>()
|
||||
.eq(Structattr::getOccupancy_state, 3)
|
||||
.eq(Structattr::getLock_type, "0")
|
||||
.eq(Structattr::getStoragevehicle_code, whereJson.getString("vehicle_code")));
|
||||
|
||||
if (structattrList.isEmpty()) {
|
||||
throw new BadRequestException("载具不在库位中或库位已锁定,请核对!");
|
||||
}
|
||||
|
||||
//查找状态为入库状态的组盘表
|
||||
List<GroupPlate> groupPlateList = iMdPbGroupPlateService.list(new QueryWrapper<GroupPlate>().lambda()
|
||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘"))
|
||||
@@ -445,6 +434,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
outJson.put("material_model", materialbase.getMaterial_model());
|
||||
}
|
||||
outJson.put("supp_code", groupPlateList.get(0).getSupp_code());
|
||||
outJson.put("qty", groupPlateList.get(0).getQty());
|
||||
outJson.put("supp_name", groupPlateList.get(0).getSupp_name());
|
||||
|
||||
return PdaResponse.requestParamOk(outJson);
|
||||
|
||||
@@ -17,6 +17,8 @@ public class PmFormMaterialDto extends Model<PmFormMaterialDto> {
|
||||
|
||||
private String material_model;
|
||||
|
||||
private String material_code;
|
||||
|
||||
private String material_name;
|
||||
|
||||
private String material_spec;
|
||||
|
||||
@@ -14,7 +14,9 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
@@ -51,7 +53,9 @@ public class SchBasePointController {
|
||||
|
||||
@PostMapping("/updatePointType")
|
||||
@Log("修改点位类型")
|
||||
public ResponseEntity<Object> updatePointType(@Validated @RequestBody SchBasePoint entity) {
|
||||
public ResponseEntity<Object> updatePointType(@RequestBody JSONObject whereJson) {
|
||||
List<JSONObject> rows = whereJson.getJSONArray("rows").toJavaList(JSONObject.class);
|
||||
List<SchBasePoint> entity = rows.stream().map(row -> row.toJavaObject(SchBasePoint.class)).collect(Collectors.toList());
|
||||
return new ResponseEntity<>(schBasePointService.updatePointType(entity),HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
|
||||
*
|
||||
* @param entity /
|
||||
*/
|
||||
PdaResponse updatePointType(SchBasePoint entity);
|
||||
PdaResponse updatePointType( List<SchBasePoint> entity);
|
||||
|
||||
/**
|
||||
* 编辑点位类型
|
||||
|
||||
@@ -143,24 +143,25 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse updatePointType(SchBasePoint entity) {
|
||||
SchBasePoint point = pointMapper.selectById(entity.getPoint_code());
|
||||
if (point == null) {
|
||||
throw new BadRequestException("点位信息不存在,请核对编码=【" + entity.getPoint_code() + "】的点位在系统中是否配置!");
|
||||
}
|
||||
public PdaResponse updatePointType(List<SchBasePoint> entityList) {
|
||||
for(SchBasePoint entity : entityList) {
|
||||
SchBasePoint point = pointMapper.selectById(entity.getPoint_code());
|
||||
if (point == null) {
|
||||
throw new BadRequestException("点位信息不存在,请核对编码=【" + entity.getPoint_code() + "】的点位在系统中是否配置!");
|
||||
}
|
||||
|
||||
if(!"YLXCQ".equals(point.getRegion_code())){
|
||||
throw new BadRequestException("只允许更改原料卸车区的点位");
|
||||
if (!"YLXCQ".equals(point.getRegion_code())) {
|
||||
throw new BadRequestException("只允许更改原料卸车区的点位");
|
||||
}
|
||||
point.setPoint_type(entity.getPoint_type());
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
point.setUpdate_id(currentUserId);
|
||||
point.setUpdate_name(nickName);
|
||||
point.setUpdate_time(now);
|
||||
pointMapper.updateById(point);
|
||||
}
|
||||
point.setPoint_type(entity.getPoint_type());
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
point.setUpdate_id(currentUserId);
|
||||
point.setUpdate_name(nickName);
|
||||
point.setUpdate_time(now);
|
||||
pointMapper.updateById(point);
|
||||
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user