diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java index 5aa3a0c4b..8c262f081 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java @@ -201,7 +201,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple this.setIsonline(false); message = "有报警"; //无报警 - } else if (error != 0 && error1 != 1) { + } else if (error != 0 || error1 != 0) { this.setIserror(true); message = "有报警"; //无报警 @@ -463,7 +463,6 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple /*map.put("action", action); map.put("message", message);*/ /*map.put("task", this.getTask());*/ - map.put("error", ErrorUtil.getDictDetail("hx_error_type", String.valueOf(this.getError()))); map.put("temperature", temperature); map.put("countdown_house", countdown_house); map.put("countdown_min", countdown_min); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java index 9e01b2419..161ab13ba 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java @@ -478,7 +478,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i return false; } // 判断相邻烘箱是否有货有异常 - if (filterNeighbors(startdevice)) return false; +// if (filterNeighbors(startdevice)) return false; } if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { @@ -488,7 +488,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i return false; } // 判断相邻烘箱是否有货有异常 - if (filterNeighbors(nextdevice)) return false; +// if (filterNeighbors(nextdevice)) return false; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java index 6e942c196..d95790c24 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java @@ -118,6 +118,14 @@ public class WmsToAcsController { } + @PostMapping("/writeTime") + @Log("下发烘箱时间") + @SaIgnore + public ResponseEntity writeTime(@RequestBody String whereJson) throws Exception { + return new ResponseEntity<>(wmstoacsService.writeTime(whereJson), HttpStatus.OK); + } + + @PostMapping("/getCutpointivtType") @Log("分切下料缓存信息") @SaIgnore diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java index e166edb83..590a27bcf 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java @@ -120,4 +120,6 @@ public interface WmsToAcsService { Map getTubeMes(String whereJson) throws Exception; Map getCutpointivtType(String whereJson)throws Exception; + + Map writeTime(String whereJson) throws Exception; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index 0648dbc05..94eed9f67 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -781,6 +781,46 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { } + @Override + public Map writeTime(String whereJson) throws Exception { + log.info("下发烘箱时间--------------:输入参数" + whereJson); + LuceneLogDto logDto = LuceneLogDto.builder() + .content("下发烘箱时间-----输入参数:" + whereJson) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + JSONArray datas = JSONArray.parseArray(whereJson); + for (int i = 0; i < datas.size(); i++) { + JSONObject data = (JSONObject) datas.get(i); + String device_code = data.getString("device_code"); + String time = data.getString("house"); + Device device = deviceAppService.findDeviceByCode(device_code); + if (ObjectUtil.isEmpty(device)) { + throw new Exception("未找到对应设备:" + device_code); + } + HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; + if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { + hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver(); + try { + hongXiangConveyorDeviceDriver.writing("to_time_house", time); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + JSONObject resultJson = new JSONObject(); + resultJson.put("status", HttpStatus.OK.value()); + resultJson.put("message", "操作成功"); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code("下发烘箱时间") + .content("下发烘箱时间-----返回参数:" + resultJson) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + resultJson.put("status", HttpStatus.OK.value()); + return resultJson; + } + @Override public Map queryDevice(String jsonObject) throws Exception { try { diff --git a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java index 74e83d9b8..a7a801774 100644 --- a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java +++ b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java @@ -49,4 +49,5 @@ public interface WmsToAcsService { */ JSONObject getCutpointivtType(JSONArray param); + JSONObject toAcsHotTime(JSONArray acsArray); } diff --git a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java index a09502ac7..7ba414caa 100644 --- a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java +++ b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java @@ -58,6 +58,12 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { return AcsUtil.notifyAcs4("api/wms/getTubeMsg", param); } + + @Override + public JSONObject toAcsHotTime(JSONArray param) { + return AcsUtil.notifyAcs4("api/wms/writeTime", param); + } + @Override public JSONObject getCutpointivtType(JSONArray param) { return AcsUtil.notifyAcs4("api/wms/getCutpointivtType", param); diff --git a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/AppUpdateController.java b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/AppUpdateController.java new file mode 100644 index 000000000..fcedcf36c --- /dev/null +++ b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/AppUpdateController.java @@ -0,0 +1,122 @@ +package org.nl.wms.pda; + +/** + * @author ldjun + * @version 1.0 + * @date 2023年02月14日 15:20 + * @desc desc + */ + +import cn.dev33.satoken.annotation.SaIgnore; +import com.alibaba.fastjson.JSONObject; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.common.exception.BadRequestException; +import org.nl.common.utils.MapOf; +import org.nl.system.service.param.ISysParamService; +import org.nl.system.service.param.dao.Param; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.util.Map; + +import static cn.hutool.http.HttpUtil.downloadFile; + +/** + * + */ +@RestController +@RequiredArgsConstructor + +@RequestMapping("/api/pda/update") +@Slf4j +public class AppUpdateController { + + private final ISysParamService iSysParamService; + + @PostMapping + + @SaIgnore + public ResponseEntity apkUrl() { + Map of = MapOf.of("versionName", "1.0.1", "url", "http://192.168.20.13:8011/api/pda/update/download/app-release"); +// Map of = MapOf.of("versionName", "1.0.1", "url", "http://localhost:8011/api/pda/update/download/app-release"); + return new ResponseEntity<>(of, HttpStatus.OK); + } + + + @RequestMapping("/download/app-release") + @SaIgnore + public void setPrint(HttpServletResponse response){ + Param byCode = iSysParamService.findByCode("apkurl"); + if (byCode==null){ + throw new BadRequestException("更新失败:为配置apk下载地址"); + } + System.out.println(byCode.getValue()); + try { + downloadFile(response,byCode.getValue(),"release"); + }catch (Exception ex){ + ex.printStackTrace(); + } + } + + /** + * 附件下载 + * @param response + * @param fileName + * @param path + * @return + * @throws Exception + */ + public void downloadFile(HttpServletResponse response, String path, String fileName) throws Exception { + if (fileName != null) { + //设置文件路径 + File file = new File(path); + if (file.exists()) { + response.setHeader("content-type", "application/octet-stream"); + response.setContentType("application/octet-stream"); + try { + response.setHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes("utf-8"), "ISO-8859-1") + ".apk"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + byte[] buffer = new byte[1024]; + FileInputStream fis = null; + BufferedInputStream bis = null; + try { + fis = new FileInputStream(file); + bis = new BufferedInputStream(fis); + OutputStream os = response.getOutputStream(); + int i = bis.read(buffer); + while (i != -1) { + os.write(buffer, 0, i); + i = bis.read(buffer); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (bis != null) { + try { + bis.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (fis != null) { + try { + fis.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + } + } + + +} diff --git a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/mps/service/impl/BakingPdaServiceImpl.java b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/mps/service/impl/BakingPdaServiceImpl.java index 71f31b9d7..5fafda21a 100644 --- a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/mps/service/impl/BakingPdaServiceImpl.java +++ b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/mps/service/impl/BakingPdaServiceImpl.java @@ -166,6 +166,8 @@ public class BakingPdaServiceImpl implements BakingPdaService { // 收卷辊编码 String rollCode = param.getString("roll_code"); String temperature = param.getString("temperature"); + // 临时功能大于1650宽度的卷 + String isWidth = param.getString("is_width"); if (!isValidInteger(temperature)) { throw new BadRequestException("温度请输入整数!"); } @@ -245,6 +247,7 @@ public class BakingPdaServiceImpl implements BakingPdaService { } JSONObject taskParam = new JSONObject(); taskParam.put("order_code", orderCode); + taskParam.put("is_width", isWidth); taskParam.put("device_code", pointCode); taskParam.put("vehicle_code", rollCode); taskParam.put("config_code", "InHotTrussTask"); diff --git a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/mps/service/impl/RawFoilPdaServiceImpl.java b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/mps/service/impl/RawFoilPdaServiceImpl.java index dbc201227..a4ea590af 100644 --- a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/mps/service/impl/RawFoilPdaServiceImpl.java +++ b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/mps/service/impl/RawFoilPdaServiceImpl.java @@ -15,6 +15,7 @@ import org.nl.wms.ext.acs.service.WmsToAcsService; import org.nl.wms.pda.mps.service.RawFoilPdaService; import org.nl.wms.pdm.bi.dao.PdmBiRawfoilworkorder; import org.nl.wms.pdm.bi.service.IpdmBiRawfoilworkorderService; +import org.nl.wms.pdm.ivt.hot.service.dao.mapper.StIvtHotpointivtMapper; import org.nl.wms.pdm.ivt.raw.service.IstIvtSbpointivtService; import org.nl.wms.pdm.ivt.raw.service.dao.StIvtSbpointivt; import org.nl.wms.sch.point.service.ISchBasePointService; @@ -71,6 +72,9 @@ public class RawFoilPdaServiceImpl implements RawFoilPdaService { @Autowired private InHotTrussTask inHotTrussTask; + + @Autowired + private StIvtHotpointivtMapper stIvtHotpointivtMapper; @Override @Transactional(rollbackFor = Exception.class) public JSONObject needEmptyVehicle(JSONObject param) { @@ -189,6 +193,8 @@ public class RawFoilPdaServiceImpl implements RawFoilPdaService { } // point_code, order_code, is_call_empty String pointCode = param.getString("point_code"); + // 临时功能大于1650宽度的卷 + String isWidth = param.getString("is_width"); // 母卷号 String orderCode = param.getString("order_code"); // 大小卷 @@ -214,7 +220,7 @@ public class RawFoilPdaServiceImpl implements RawFoilPdaService { setDjw(param); } else { // 找烘箱位置 - String stIvtHotpointivt = inHotTrussTask.getStIvtHotpointivt(rollType, temperature); + String stIvtHotpointivt = inHotTrussTask.getStIvtHotpointivt(rollType, temperature,isWidth); if (StrUtil.isNotEmpty(stIvtHotpointivt)) { param.put("put_code", stIvtHotpointivt); } else { @@ -227,12 +233,7 @@ public class RawFoilPdaServiceImpl implements RawFoilPdaService { // schBasePoint.setPoint_status(POINT_STATUS_BINDING); // pointService.updateById(schBasePoint); if (ObjectUtil.isNotEmpty(order)) { - if (StrUtil.isNotEmpty(theory_height)) { - order.setTheory_height(new BigDecimal(theory_height)); - } - if (StrUtil.isNotEmpty(productin_qty)) { - order.setProductin_qty(new BigDecimal(productin_qty)); - } + order.setUp_coiler_date(DateUtil.now()); order.setBaking_temperature(temperature); order.setBaking_time(time); @@ -249,12 +250,7 @@ public class RawFoilPdaServiceImpl implements RawFoilPdaService { rawOrder.setMfg_order_name("$$$$"); rawOrder.setProduct_name("锂电"); rawOrder.setDescription("锂电"); - if (StrUtil.isNotEmpty(theory_height)) { - order.setTheory_height(new BigDecimal(theory_height)); - } - if (StrUtil.isNotEmpty(productin_qty)) { - order.setProductin_qty(new BigDecimal(productin_qty)); - } + rawOrder.setUp_coiler_date(DateUtil.now()); rawOrder.setStatus("01"); rawOrder.setWind_roll("roll"); diff --git a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/st/service/impl/OtherPdaServiceImpl.java b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/st/service/impl/OtherPdaServiceImpl.java index d3b5404e7..a371f2515 100644 --- a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/st/service/impl/OtherPdaServiceImpl.java +++ b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/st/service/impl/OtherPdaServiceImpl.java @@ -361,7 +361,7 @@ public class OtherPdaServiceImpl implements OtherPdaService { // point_code, vehicle_code, vehicle_type // 到物料表中查找载具号 String pointCode = param.getString("point_code"); - List schBaseTasks = taskService.checkHaveTask(pointCode); + List schBaseTasks = taskService.checkHaveTask3(pointCode); if (schBaseTasks.size() > 0) { throw new BadRequestException("点位[" + pointCode + "]已经存在任务!"); } diff --git a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/bi/dao/mapper/PdmBiRawfoilworkorderMapper.xml b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/bi/dao/mapper/PdmBiRawfoilworkorderMapper.xml index 1b7cc1d3d..f4d4e7ed8 100644 --- a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/bi/dao/mapper/PdmBiRawfoilworkorderMapper.xml +++ b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/bi/dao/mapper/PdmBiRawfoilworkorderMapper.xml @@ -17,7 +17,7 @@ w.* FROM st_ivt_hotpointivt p LEFT JOIN pdm_bi_rawfoilworkorder w ON w.workorder_id = p.workorder_id - WHERE p.point_status = '04'; + WHERE p.point_status = '04' ORDER BY zc_point; diff --git a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/impl/StIvtHotpointivtServiceImpl.java b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/impl/StIvtHotpointivtServiceImpl.java index bad629fc8..9767e9d38 100644 --- a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/impl/StIvtHotpointivtServiceImpl.java +++ b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/ivt/hot/service/impl/StIvtHotpointivtServiceImpl.java @@ -2,6 +2,9 @@ package org.nl.wms.pdm.ivt.hot.service.impl; import cn.hutool.core.lang.Assert; 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 com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; @@ -9,12 +12,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.nl.common.domain.query.PageQuery; +import org.nl.wms.ext.acs.service.WmsToAcsService; import org.nl.wms.pdm.ivt.hot.service.IstIvtHotpointivtService; import org.nl.wms.pdm.ivt.hot.service.dao.StIvtHotpointivt; import org.nl.wms.pdm.ivt.hot.service.dao.dto.StIvtHotpointivtParam; import org.nl.wms.pdm.ivt.hot.service.dao.mapper.StIvtHotpointivtMapper; import org.nl.wms.quartz.dto.HotDeviceAndEreaDto; import org.nl.wms.storage_manage.ios.enums.IOSEnum; +import org.nl.wms.util.URLEnum; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -38,6 +43,9 @@ public class StIvtHotpointivtServiceImpl extends ServiceImpl { */ List checkHaveTask(String code); + + /** + * 检测点位编码是否存在任务 + * @param code 点位编码 + * @return 任务 + */ + List checkHaveTask3(String code); + /** * 检测点位编码是否存在status<=7的任务 * @param code diff --git a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.java b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.java index 932410c9c..4f790ae6a 100644 --- a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.java +++ b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.java @@ -20,6 +20,8 @@ public interface SchBaseTaskMapper extends BaseMapper { List checkHaveTask2(String code); + List checkHaveTask3(String code); + List checkHaveRelatedTaskInRequestParam(String param); List getWasteFoilTask(String code); diff --git a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.xml b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.xml index cf250adb7..e4054775b 100644 --- a/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.xml +++ b/lms2/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/dao/mapper/SchBaseTaskMapper.xml @@ -56,6 +56,17 @@ ) + + +