|
@@ -9,12 +9,13 @@ import com.ruoyi.ams.agv.ndc.domain.AmsHexdefineDetail;
|
|
|
import com.ruoyi.ams.agv.ndc.domain.AmsTask;
|
|
|
import com.ruoyi.ams.agv.ndc.mapper.AmsHexdefineDetailMapper;
|
|
|
import com.ruoyi.ams.agv.ndc.service.IAmsHexdefineDetailService;
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
/**
|
|
|
* 任务定义(lp0-lp30)Service业务层处理
|
|
|
- *
|
|
|
+ *
|
|
|
* @author ruoyi
|
|
|
* @date 2022-08-12
|
|
|
*/
|
|
@@ -26,7 +27,7 @@ public class AmsHexdefineDetailServiceImpl implements IAmsHexdefineDetailService
|
|
|
|
|
|
/**
|
|
|
* 查询任务定义(lp0-lp30)
|
|
|
- *
|
|
|
+ *
|
|
|
* @param id 任务定义(lp0-lp30)主键
|
|
|
* @return 任务定义(lp0-lp30)
|
|
|
*/
|
|
@@ -43,7 +44,7 @@ public class AmsHexdefineDetailServiceImpl implements IAmsHexdefineDetailService
|
|
|
|
|
|
/**
|
|
|
* 查询任务定义(lp0-lp30)列表
|
|
|
- *
|
|
|
+ *
|
|
|
* @param amsHexdefineDetail 任务定义(lp0-lp30)
|
|
|
* @return 任务定义(lp0-lp30)
|
|
|
*/
|
|
@@ -72,7 +73,7 @@ public class AmsHexdefineDetailServiceImpl implements IAmsHexdefineDetailService
|
|
|
|
|
|
/**
|
|
|
* 新增任务定义(lp0-lp30)
|
|
|
- *
|
|
|
+ *
|
|
|
* @param amsHexdefineDetail 任务定义(lp0-lp30)
|
|
|
* @return 结果
|
|
|
*/
|
|
@@ -84,7 +85,7 @@ public class AmsHexdefineDetailServiceImpl implements IAmsHexdefineDetailService
|
|
|
|
|
|
/**
|
|
|
* 修改任务定义(lp0-lp30)
|
|
|
- *
|
|
|
+ *
|
|
|
* @param amsHexdefineDetail 任务定义(lp0-lp30)
|
|
|
* @return 结果
|
|
|
*/
|
|
@@ -96,7 +97,7 @@ public class AmsHexdefineDetailServiceImpl implements IAmsHexdefineDetailService
|
|
|
|
|
|
/**
|
|
|
* 批量删除任务定义(lp0-lp30)
|
|
|
- *
|
|
|
+ *
|
|
|
* @param ids 需要删除的任务定义(lp0-lp30)主键
|
|
|
* @return 结果
|
|
|
*/
|
|
@@ -108,7 +109,7 @@ public class AmsHexdefineDetailServiceImpl implements IAmsHexdefineDetailService
|
|
|
|
|
|
/**
|
|
|
* 删除任务定义(lp0-lp30)信息
|
|
|
- *
|
|
|
+ *
|
|
|
* @param id 任务定义(lp0-lp30)主键
|
|
|
* @return 结果
|
|
|
*/
|
|
@@ -127,6 +128,9 @@ public class AmsHexdefineDetailServiceImpl implements IAmsHexdefineDetailService
|
|
|
if (basTask.getColType() == ValType.TEXT.getCode()) {
|
|
|
//如果是数字需要进行转换
|
|
|
if (basTask.getValType() == 2) {
|
|
|
+ if (StringUtils.isEmpty(amsTask.getStr(basTask.getColVal()))) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
sb.append(String.format("%04X", Integer.parseInt(amsTask.getStr(basTask.getColVal()))));
|
|
|
} else {
|
|
|
sb.append(basTask.getColVal());
|
|
@@ -136,11 +140,20 @@ public class AmsHexdefineDetailServiceImpl implements IAmsHexdefineDetailService
|
|
|
if (basTask.getValType() == 1) {
|
|
|
//如果是数字需要进行转换,Priority为2位其余4位
|
|
|
if (basTask.getColName().equals("Priority")) {
|
|
|
+ if (StringUtils.isEmpty(amsTask.getStr(basTask.getColVal()))) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
sb.append(String.format("%02X", Integer.parseInt(amsTask.getStr(basTask.getColVal()))+ 0x80));
|
|
|
}else {
|
|
|
+ if (StringUtils.isEmpty(amsTask.getStr(basTask.getColVal()))) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
sb.append(String.format("%04X", Integer.parseInt(amsTask.getStr(basTask.getColVal()))));
|
|
|
}
|
|
|
} else {
|
|
|
+ if (StringUtils.isEmpty(amsTask.getStr(basTask.getColVal()))) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
sb.append(amsTask.getStr(basTask.getColVal()));
|
|
|
}
|
|
|
}
|