Conflicts:
	6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ApmsController.java
This commit is contained in:
李广豪 2022-07-08 19:56:45 +08:00
commit 835b98e486
17 changed files with 359 additions and 102 deletions

View File

@ -100,6 +100,19 @@ public abstract class BaseSupport {
protected <T> R<T> successful(String msg, T data) { protected <T> R<T> successful(String msg, T data) {
return R.ok(msg, data); return R.ok(msg, data);
} }
/**
* <p>
* 请求成功
* </p>
* @param code 正确码
* @param msg 提示内容
* @param data 数据内容
* @param <T> 对象泛型
* @return
*/
protected <T> R<T> successful(int code,String msg, T data) {
return R.ok(code,msg, data);
}
/** /**
* <p> * <p>

View File

@ -15,7 +15,7 @@ import java.time.LocalDateTime;
* </p> * </p>
* *
* @author mt * @author mt
* @since 2021-12-29 * @since 2022-01-05
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@ -79,7 +79,7 @@ public class ApmsCheckResult extends Model<ApmsCheckResult> {
private String idenCardNum; private String idenCardNum;
/** /**
* 硬度检验结果合格不合格返工作废 * 硬度检验结果待检验合格不合格返工作废
*/ */
@TableField("hardness") @TableField("hardness")
private String hardness; private String hardness;
@ -120,6 +120,90 @@ public class ApmsCheckResult extends Model<ApmsCheckResult> {
@TableField("hardness_value_three") @TableField("hardness_value_three")
private String hardnessValueThree; private String hardnessValueThree;
/**
* 金相检验渗碳淬火 渗碳层深度
*/
@TableField("metallography_stch_stccsd")
private Float metallographyStchStccsd;
/**
* 金相检验渗碳淬火 表面为马氏体残余奥氏体
*/
@TableField("metallography_stch_mstost")
private String metallographyStchMstost;
/**
* 金相检验渗碳淬火 细小颗粒状碳化物
*/
@TableField("metallography_stch_xxklzthw")
private String metallographyStchXxklzthw;
/**
* 金相检验渗碳淬火 心部为低碳马氏体加游离铁素体
*/
@TableField("metallography_stch_dtmstyltst")
private String metallographyStchDtmstyltst;
/**
* 金相检验整体淬火 基体为回火马氏体
*/
@TableField("metallography_ztch_hhmst")
private String metallographyZtchHhmst;
/**
* 金相检验整体淬火 基体为回火托式体
*/
@TableField("metallography_ztch_hhtst")
private String metallographyZtchHhtst;
/**
* 金相检验整体淬火 基体为回火素式体
*/
@TableField("metallography_ztch_hhsst")
private String metallographyZtchHhsst;
/**
* 金相检验氮化 表面亮白色的为氮化合物层深
*/
@TableField("metallography_dh_dhhwcs")
private Float metallographyDhDhhwcs;
/**
* 金相检验氮化 向内为扩散层深
*/
@TableField("metallography_dh_kscs")
private Float metallographyDhKscs;
/**
* 金相检验氮化 心部
*/
@TableField("metallography_dh_xb")
private String metallographyDhXb;
/**
* 金相检验表面淬火 表面为板条马氏体
*/
@TableField("metallography_bmch_btmst")
private String metallographyBmchBtmst;
/**
* 金相检验表面淬火 心部
*/
@TableField("metallography_bmch_xb")
private String metallographyBmchXb;
/**
* 金相检验 备注
*/
@TableField("metallography_bz")
private String metallographyBz;
/**
* 金相检验心部硬度 心部硬度检验结果
*/
@TableField("metallography_xbyd_xbydjyjg")
private Float metallographyXbydXbydjyjg;
public static final String ID = "id"; public static final String ID = "id";
@ -153,6 +237,34 @@ public class ApmsCheckResult extends Model<ApmsCheckResult> {
public static final String HARDNESS_VALUE_THREE = "hardness_value_three"; public static final String HARDNESS_VALUE_THREE = "hardness_value_three";
public static final String METALLOGRAPHY_STCH_STCCSD = "metallography_stch_stccsd";
public static final String METALLOGRAPHY_STCH_MSTOST = "metallography_stch_mstost";
public static final String METALLOGRAPHY_STCH_XXKLZTHW = "metallography_stch_xxklzthw";
public static final String METALLOGRAPHY_STCH_DTMSTYLTST = "metallography_stch_dtmstyltst";
public static final String METALLOGRAPHY_ZTCH_HHMST = "metallography_ztch_hhmst";
public static final String METALLOGRAPHY_ZTCH_HHTST = "metallography_ztch_hhtst";
public static final String METALLOGRAPHY_ZTCH_HHSST = "metallography_ztch_hhsst";
public static final String METALLOGRAPHY_DH_DHHWCS = "metallography_dh_dhhwcs";
public static final String METALLOGRAPHY_DH_KSCS = "metallography_dh_kscs";
public static final String METALLOGRAPHY_DH_XB = "metallography_dh_xb";
public static final String METALLOGRAPHY_BMCH_BTMST = "metallography_bmch_btmst";
public static final String METALLOGRAPHY_BMCH_XB = "metallography_bmch_xb";
public static final String METALLOGRAPHY_BZ = "metallography_bz";
public static final String METALLOGRAPHY_XBYD_XBYDJYJG = "metallography_xbyd_xbydjyjg";
@Override @Override
protected Serializable pkVal() { protected Serializable pkVal() {
return this.id; return this.id;

View File

@ -97,7 +97,7 @@ public class OrderInfo extends Model<OrderInfo> {
private String orderNo; private String orderNo;
/** /**
* 原订单号APMS系统获取 返单时才存在 * 原订单号(对应原先的标识卡号)APMS系统获取 返单时才存在
*/ */
@TableField("old_order_no") @TableField("old_order_no")
private String oldOrderNo; private String oldOrderNo;

View File

@ -9,7 +9,7 @@ import com.mt.wms.core.dal.entity.ApmsCheckResult;
* </p> * </p>
* *
* @author mt * @author mt
* @since 2021-12-29 * @since 2022-01-05
*/ */
public interface ApmsCheckResultMapper extends BaseMapper<ApmsCheckResult> { public interface ApmsCheckResultMapper extends BaseMapper<ApmsCheckResult> {

View File

@ -20,12 +20,30 @@
<result column="hardness_value_one" property="hardnessValueOne"/> <result column="hardness_value_one" property="hardnessValueOne"/>
<result column="hardness_value_two" property="hardnessValueTwo"/> <result column="hardness_value_two" property="hardnessValueTwo"/>
<result column="hardness_value_three" property="hardnessValueThree"/> <result column="hardness_value_three" property="hardnessValueThree"/>
<result column="metallography_stch_stccsd" property="metallographyStchStccsd"/>
<result column="metallography_stch_mstost" property="metallographyStchMstost"/>
<result column="metallography_stch_xxklzthw" property="metallographyStchXxklzthw"/>
<result column="metallography_stch_dtmstyltst" property="metallographyStchDtmstyltst"/>
<result column="metallography_ztch_hhmst" property="metallographyZtchHhmst"/>
<result column="metallography_ztch_hhtst" property="metallographyZtchHhtst"/>
<result column="metallography_ztch_hhsst" property="metallographyZtchHhsst"/>
<result column="metallography_dh_dhhwcs" property="metallographyDhDhhwcs"/>
<result column="metallography_dh_kscs" property="metallographyDhKscs"/>
<result column="metallography_dh_xb" property="metallographyDhXb"/>
<result column="metallography_bmch_btmst" property="metallographyBmchBtmst"/>
<result column="metallography_bmch_xb" property="metallographyBmchXb"/>
<result column="metallography_bz" property="metallographyBz"/>
<result column="metallography_xbyd_xbydjyjg" property="metallographyXbydXbydjyjg"/>
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, valid, create_time, creator_id, updater_id, update_time, version, sheet_no, iden_card_num, hardness, id, valid, create_time, creator_id, updater_id, update_time, version, sheet_no, iden_card_num, hardness,
metallography, heart_hardness, remake, hardness_value_one, hardness_value_two, hardness_value_three metallography, heart_hardness, remake, hardness_value_one, hardness_value_two, hardness_value_three,
metallography_stch_stccsd, metallography_stch_mstost, metallography_stch_xxklzthw,
metallography_stch_dtmstyltst, metallography_ztch_hhmst, metallography_ztch_hhtst, metallography_ztch_hhsst,
metallography_dh_dhhwcs, metallography_dh_kscs, metallography_dh_xb, metallography_bmch_btmst,
metallography_bmch_xb, metallography_bz, metallography_xbyd_xbydjyjg
</sql> </sql>
</mapper> </mapper>

View File

@ -9,7 +9,7 @@ import com.mt.wms.core.dal.entity.ApmsCheckResult;
* </p> * </p>
* *
* @author mt * @author mt
* @since 2021-12-29 * @since 2022-01-05
*/ */
public interface ApmsCheckResultServiceBiz extends IService<ApmsCheckResult> { public interface ApmsCheckResultServiceBiz extends IService<ApmsCheckResult> {

View File

@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
* </p> * </p>
* *
* @author mt * @author mt
* @since 2021-12-29 * @since 2022-01-05
*/ */
@Service @Service
public class ApmsCheckResultServiceBizImpl extends ServiceImpl<ApmsCheckResultMapper, ApmsCheckResult> implements ApmsCheckResultServiceBiz { public class ApmsCheckResultServiceBizImpl extends ServiceImpl<ApmsCheckResultMapper, ApmsCheckResult> implements ApmsCheckResultServiceBiz {

View File

@ -99,5 +99,8 @@ public class R<T> implements Serializable {
public static <T> R<T> ok(String msg, T data) { public static <T> R<T> ok(String msg, T data) {
return new R<T>().msg(msg).data(data); return new R<T>().msg(msg).data(data);
} }
public static <T> R<T> ok(int code,String msg, T data) {
return new R<T>().code(code).msg(msg).data(data);
}
} }

View File

@ -47,10 +47,9 @@ public class ApmsController extends BaseController {
@Autowired @Autowired
private CommunicationLogServiceBiz communicationLogServiceBiz; private CommunicationLogServiceBiz communicationLogServiceBiz;
// static String Token = "eyJhbGciOiJIUzI1NiJ9.eyJkYXRlIjozMTkyNzU4NDk4ODA3LCJwbGF0Rm9ybUlkIjoyLCJhcGlLZXkiOiI3ZWU4ZjU5YmJhZWFlMjdlIiwiZXhwIjozMTkyNzU4NDk4LCJpYXQiOjE2Mzc1NTg0OTh9.RH3MRQr1dCBYW996-WXN69eXu1ZFblAQHfhZHNbTmCg";
static String Token = ""; static String Token = "";
static LocalDateTime TokenExpireTime = LocalDateTime.now(); static LocalDateTime TokenExpireTime = LocalDateTime.now();
static String ApiAddress = "http://59.110.171.25:80"; static String ApiAddress = "http://192.168.1.109:80";
@PostMapping(value = "apmsPostOrder") @PostMapping(value = "apmsPostOrder")
@ApiOperation(value = "WMS接收APMS推送订单信息") @ApiOperation(value = "WMS接收APMS推送订单信息")

View File

@ -139,6 +139,10 @@ public class CurrTaskController extends BaseController {
@ApiOperation(value = "订单加工-创建多个个分步骤加工任务至任务队列") @ApiOperation(value = "订单加工-创建多个个分步骤加工任务至任务队列")
public R<String> createAutoTask(@Validated @RequestBody AutoCurrTaskParam autoCurrTaskParam){ public R<String> createAutoTask(@Validated @RequestBody AutoCurrTaskParam autoCurrTaskParam){
List<TaskCreateParam> detParams = autoCurrTaskParam.getTaskCreateParamList(); List<TaskCreateParam> detParams = autoCurrTaskParam.getTaskCreateParamList();
Boolean apmsCreateProcessSheet=false;
String sheetNo=null;
int i=1;
R<ApmsCreateProcessSheetVo> processSheet=null;
//自动任务循环添加多条currTask //自动任务循环添加多条currTask
AutoExeTask autoExeTask=new AutoExeTask(); AutoExeTask autoExeTask=new AutoExeTask();
for (TaskCreateParam param:detParams for (TaskCreateParam param:detParams
@ -168,7 +172,7 @@ public class CurrTaskController extends BaseController {
{ {
return failed("创建失败APMS中验证炉号" + kilnCode + "失败!"); return failed("创建失败APMS中验证炉号" + kilnCode + "失败!");
} }
if (i==1){
//通知apms创建一个生产单 //通知apms创建一个生产单
ApmsCreateProcessSheet apmsCreateSheet = new ApmsCreateProcessSheet(); ApmsCreateProcessSheet apmsCreateSheet = new ApmsCreateProcessSheet();
apmsCreateSheet.setWorkShopCode("BM"); apmsCreateSheet.setWorkShopCode("BM");
@ -186,9 +190,12 @@ public class CurrTaskController extends BaseController {
}); });
apmsCreateSheet.setStoveCode(kilnCode); apmsCreateSheet.setStoveCode(kilnCode);
apmsCreateSheet.setItems(createItems); apmsCreateSheet.setItems(createItems);
R<ApmsCreateProcessSheetVo> processSheet = apmsControl.createProcessSheet(apmsCreateSheet); processSheet = apmsControl.createProcessSheet(apmsCreateSheet);
apmsCreateProcessSheet=processSheet.getData().getSuccess();
sheetNo=processSheet.getData().getSheetNo();
}
if (processSheet.getData().getSuccess()) if (apmsCreateProcessSheet)
{ {
//apms创建成功后写入数据库 //apms创建成功后写入数据库
R<IdVo> mainTask = currTaskService.createProcessTask(param); R<IdVo> mainTask = currTaskService.createProcessTask(param);
@ -227,19 +234,19 @@ public class CurrTaskController extends BaseController {
setUpdateCommonField(autoExeTask); setUpdateCommonField(autoExeTask);
autoExeTaskServiceBiz.updateById(autoExeTask); autoExeTaskServiceBiz.updateById(autoExeTask);
} }
String sheetNo = processSheet.getData().getSheetNo();
//将返回的生产单号写入到主任务中 //将返回的生产单号写入到主任务中
CurrTask currTaskById = currTaskService.getCurrTaskById(mainTask.getData().getId()); CurrTask currTaskById = currTaskService.getCurrTaskById(mainTask.getData().getId());
currTaskById.setSheetNo(sheetNo); currTaskById.setSheetNo(sheetNo);
currTaskService.updateCurrTaskById(currTaskById); currTaskService.updateCurrTaskById(currTaskById);
//生成详细任务中的检验结果数据在apms推送生产单结果时创建 //生成详细任务中的检验结果数据在apms推送生产单结果时创建
return successful("创建成功,任务添加至等待执行队列。"); //return successful("创建成功,任务添加至等待执行队列。");
} }
else else
{ {
return failed("创建失败APMS报错" + processSheet.getData().getMsg()); return failed("创建失败APMS报错" + processSheet.getData().getMsg());
} }
i++;
} }
return null; return null;
} }
@ -264,8 +271,8 @@ public class CurrTaskController extends BaseController {
@PostMapping(value = "deleteBySheetNo") @PostMapping(value = "deleteBySheetNo")
@ApiOperation(value = "人工通过生产单编号删除未正式开始的生产单(通知APMS)") @ApiOperation(value = "人工通过生产单编号删除未正式开始的生产单(通知APMS)")
public R<String> deleteBySheetNo(@Validated @RequestBody String sheetNo) { public R<String> deleteBySheetNo(@Validated @RequestBody CurrTaskQueryParam param) {
return currTaskService.deleteBySheetNo(sheetNo); return currTaskService.deleteBySheetNo(param.getSheetNo());
} }
@PostMapping(value = "runTask") @PostMapping(value = "runTask")
@ApiOperation(value = "执行任务") @ApiOperation(value = "执行任务")

View File

@ -41,6 +41,92 @@ public class ApmsCompleteOrder extends BaseParam {
@ApiModelProperty(value = "硬度检验值3", required = false) @ApiModelProperty(value = "硬度检验值3", required = false)
private String hardnessValueThree; private String hardnessValueThree;
/**
* 金相检验渗碳淬火 渗碳层深度
*/
@ApiModelProperty(value = "金相检验渗碳淬火 渗碳层深度")
private Float metallographyStchStccsd;
/**
* 金相检验渗碳淬火 表面为马氏体残余奥氏体
*/
@ApiModelProperty(value = "金相检验渗碳淬火 表面为马氏体、残余奥氏体(级)")
private String metallographyStchMstost;
/**
* 金相检验渗碳淬火 细小颗粒状碳化物
*/
@ApiModelProperty(value = "金相检验渗碳淬火 细小颗粒状碳化物")
private String metallographyStchXxklzthw;
/**
* 金相检验渗碳淬火 心部为低碳马氏体加游离铁素体
*/
@ApiModelProperty(value = "金相检验渗碳淬火 心部为低碳马氏体加游离铁素体(级)")
private String metallographyStchDtmstyltst;
/**
* 金相检验整体淬火 基体为回火马氏体
*/
@ApiModelProperty(value = "金相检验整体淬火 基体为回火马氏体(级)")
private String metallographyZtchHhmst;
/**
* 金相检验整体淬火 基体为回火托式体
*/
@ApiModelProperty(value = "金相检验整体淬火 基体为回火托式体(级)")
private String metallographyZtchHhtst;
/**
* 金相检验整体淬火 基体为回火素式体
*/
@ApiModelProperty(value = "金相检验整体淬火 基体为回火素式体(级)")
private String metallographyZtchHhsst;
/**
* 金相检验氮化 表面亮白色的为氮化合物层深
*/
@ApiModelProperty(value = "金相检验氮化 表面亮白色的为氮化合物层深")
private Float metallographyDhDhhwcs;
/**
* 金相检验氮化 向内为扩散层深
*/
@ApiModelProperty(value = "金相检验氮化 向内为扩散层深")
private Float metallographyDhKscs;
/**
* 金相检验氮化 心部
*/
@ApiModelProperty(value = "金相检验氮化 心部")
private String metallographyDhXb;
/**
* 金相检验表面淬火 表面为板条马氏体
*/
@ApiModelProperty(value = "金相检验表面淬火 表面为板条马氏体(级)")
private String metallographyBmchBtmst;
/**
* 金相检验表面淬火 心部
*/
@ApiModelProperty(value = "金相检验表面淬火 心部")
private String metallographyBmchXb;
/**
* 金相检验 备注
*/
@ApiModelProperty(value = "金相检验 备注")
private String metallographyBz;
/**
* 金相检验心部硬度 心部硬度检验结果
*/
@ApiModelProperty(value = "金相检验心部硬度 心部硬度检验结果")
private Float metallographyXbydXbydjyjg;
@ApiModelProperty(value = "备注", required = false) @ApiModelProperty(value = "备注", required = false)
private String remake; private String remake;
} }

View File

@ -23,4 +23,7 @@ public class CurrTaskQueryParam extends BasePageParam {
@ApiModelProperty(value = "车辆id") @ApiModelProperty(value = "车辆id")
private String vehicleId; private String vehicleId;
private String sheetNo;
} }

View File

@ -76,6 +76,8 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
RunTaskUtils runTaskUtils; RunTaskUtils runTaskUtils;
@Autowired @Autowired
AutoExeTaskServiceBiz autoExeTaskServiceBiz; AutoExeTaskServiceBiz autoExeTaskServiceBiz;
@Autowired
KilnInfoServiceBiz kilnInfoServiceBiz;
@Override @Override
public CurrTaskVo getCurrTask(IdParam idParam) { public CurrTaskVo getCurrTask(IdParam idParam) {
@ -101,11 +103,15 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
CurrTask currTask = new CurrTask(); CurrTask currTask = new CurrTask();
BeanUtils.copyProperties(param, currTask); BeanUtils.copyProperties(param, currTask);
currTask.setTaskType(TaskTypeEnum.WTK.getValue()); currTask.setTaskType(TaskTypeEnum.WTK.getValue());
KilnInfo kilnInfo = kilnInfoServiceBiz.getById(currTask.getKilnId());
//根据工艺号查询工艺id以及工艺plc值 //根据工艺号查询工艺id以及工艺plc值
CraftInfo one = craftInfoServiceBiz.getOne(new QueryWrapper<CraftInfo>().eq(CraftInfo.CREATOR_ID, param.getCraftCode())); CraftInfo one = craftInfoServiceBiz.getOne(new QueryWrapper<CraftInfo>().eq(CraftInfo.CRAFT_CODE, param.getCraftCode()));
currTask.setTargetPosition(kilnInfo.getCode());
currTask.setCraftCodeId(one.getId()); currTask.setCraftCodeId(one.getId());
currTask.setPlcValue(one.getPlcValue()); currTask.setPlcValue(one.getPlcValue());
currTask.setInterCode(IDGenerator.gen("RW", IDGenerator.PATTERN_YYYYMMDDHHMM, 2, "TASK_CODE")); currTask.setInterCode(IDGenerator.gen("RW", IDGenerator.PATTERN_YYYYMMDDHHMM, 2, "TASK_CODE"));
currTask.setTaskCode(IDGenerator.gen("RW", IDGenerator.PATTERN_YYYYMMDDHHMM, 2, "TASK_CODE"));
setCommonField(currTask); setCommonField(currTask);
currTaskServiceBiz.save(currTask); currTaskServiceBiz.save(currTask);
return successful(IdVo.builder().id(currTask.getId()).build()); return successful(IdVo.builder().id(currTask.getId()).build());
@ -152,8 +158,15 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
R<ApmsEndProcessVo> apmsStartProcessR = apmsControl.deleteBySheetNo(sheetNo); R<ApmsEndProcessVo> apmsStartProcessR = apmsControl.deleteBySheetNo(sheetNo);
if (apmsStartProcessR.getData().getSuccess()) if (apmsStartProcessR.getData().getSuccess())
{ {
currTaskServiceBiz.removeById(byId.getId()); Long currTaskId = byId.getId();
currTaskDetService.deleteByCurrTaskId(byId.getId()); currTaskServiceBiz.removeById(currTaskId);
currTaskDetService.deleteByCurrTaskId(currTaskId);
if (byId.getIsAuto()==1){
List<CurrTask> currTaskList = currTaskServiceBiz.list(new QueryWrapper<CurrTask>().eq(CurrTask.AUTO_EXE_TASK_ID, byId.getAutoExeTaskId()));
if (currTaskList.size()==0){
autoExeTaskServiceBiz.removeById(byId.getAutoExeTaskId());
}
}
return successful("APMS生产单删除成功。"); return successful("APMS生产单删除成功。");
} }
else else
@ -161,6 +174,9 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
return failed(apmsStartProcessR.getData().getMsg()); return failed(apmsStartProcessR.getData().getMsg());
} }
} }
if (byId.getStatus()==2){
return failed("无法删除,任务已加工完成。");
}
return failed("无法删除,任务正在执行中。"); return failed("无法删除,任务正在执行中。");
} }

View File

@ -103,7 +103,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
return failed(1, "操作失败,接收到重复订单信息:" + apmsPostOrderParam.getOrderNo()); return failed(1, "操作失败,接收到重复订单信息:" + apmsPostOrderParam.getOrderNo());
} }
orderInfoService.save(orderInfo); orderInfoService.save(orderInfo);
return successful("Wms接收Apms订单成功。", ""); return successful(0,"Wms接收Apms订单成功。", "");
} }
@Override @Override
@ -165,8 +165,8 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
PageVo<OrderInfoTaskDetVo> currOrderCurrTask = currTaskDetService.getCurrOrderCurrTask(param); PageVo<OrderInfoTaskDetVo> currOrderCurrTask = currTaskDetService.getCurrOrderCurrTask(param);
Assert.notNull("该订单暂无详细任务记录。", currOrderCurrTask.getRecords()); Assert.notNull("该订单暂无详细任务记录。", currOrderCurrTask.getRecords());
//获取车辆信息 //获取车辆信息
R<List<VehicleVo>> vehicle = vehicleService.list(new VehicleQueryParam()); //R<List<VehicleVo>> vehicle = vehicleService.list(new VehicleQueryParam());
Map<Long, List<VehicleVo>> collect = vehicle.getData().stream().collect(Collectors.groupingBy(VehicleVo::getId)); //Map<Long, List<VehicleVo>> collect = vehicle.getData().stream().collect(Collectors.groupingBy(VehicleVo::getId));
//获取窑炉信息 //获取窑炉信息
R<List<KilnInfoVo>> kiln = kilnInfoService.list(new KilnInfoQueryParam()); R<List<KilnInfoVo>> kiln = kilnInfoService.list(new KilnInfoQueryParam());
Map<Long, List<KilnInfoVo>> collect2 = kiln.getData().stream().collect(Collectors.groupingBy(KilnInfoVo::getId)); Map<Long, List<KilnInfoVo>> collect2 = kiln.getData().stream().collect(Collectors.groupingBy(KilnInfoVo::getId));
@ -181,6 +181,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
orderInfo.setKilnId(currTask.getKilnId()); orderInfo.setKilnId(currTask.getKilnId());
orderInfo.setStartPosition(currTask.getStartPosition()); orderInfo.setStartPosition(currTask.getStartPosition());
orderInfo.setTargetPosition(currTask.getTargetPosition()); orderInfo.setTargetPosition(currTask.getTargetPosition());
orderInfo.setTaskCode(currTask.getTaskCode());
//orderInfo.setVehicleId(currTask.getVehicleId()); //orderInfo.setVehicleId(currTask.getVehicleId());
//获取窑炉和车辆的名称信息 //获取窑炉和车辆的名称信息
if (orderInfo.getKilnId() != null) if (orderInfo.getKilnId() != null)
@ -216,7 +217,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
// 考虑返工单的加工情况添加到返工统计信息中 // 考虑返工单的加工情况添加到返工统计信息中
if (Objects.nonNull(one.getOldOrderNo())) if (Objects.nonNull(one.getOldOrderNo()))
{ {
List<OrderInfo> list = orderInfoService.list(new QueryWrapper<OrderInfo>().eq(OrderInfo.VALID, 1).eq(OrderInfo.ORDER_NO, one.getOldOrderNo())); List<OrderInfo> list = orderInfoService.list(new QueryWrapper<OrderInfo>().eq(OrderInfo.VALID, 1).eq(OrderInfo.IDEN_CARD_NUM, one.getOldOrderNo()));
float reQuantity = 0; float reQuantity = 0;
float reWeight = 0; float reWeight = 0;
for (OrderInfo orderInfo : list) for (OrderInfo orderInfo : list)
@ -265,7 +266,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
byId.setUpdateTime(LocalDateTime.now()); byId.setUpdateTime(LocalDateTime.now());
byId.setOrderVoid(0); byId.setOrderVoid(0);
orderInfoService.updateById(byId); orderInfoService.updateById(byId);
return successful("操作成功,订单状态置为作废。", ""); return successful(0,"操作成功,订单状态置为作废。", "");
} }
@Override @Override
@ -303,38 +304,23 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
{ {
//通过标识卡号与生产单号进行检验结果存储 //通过标识卡号与生产单号进行检验结果存储
ApmsCheckResult one = new ApmsCheckResult(); ApmsCheckResult one = new ApmsCheckResult();
one.setIdenCardNum(apmsCompleteOrder.getIdenCardNum()); BeanUtils.copyProperties(apmsCompleteOrder, one);
one.setSheetNo(apmsCompleteOrder.getSheetNo());
one.setCreateTime(LocalDateTime.now()); one.setCreateTime(LocalDateTime.now());
one.setUpdateTime(LocalDateTime.now());
one.setValid(WhetherEnum.YES.getValue()); one.setValid(WhetherEnum.YES.getValue());
one.setMetallography(apmsCompleteOrder.getMetallographic()); one.setMetallography(apmsCompleteOrder.getMetallographic());
one.setHeartHardness(apmsCompleteOrder.getHeartHardness());
one.setHardnessValueOne(apmsCompleteOrder.getHardnessValueOne());
one.setHardnessValueTwo(apmsCompleteOrder.getHardnessValueTwo());
one.setHardnessValueThree(apmsCompleteOrder.getHardnessValueThree());
one.setHardness(apmsCompleteOrder.getHardness());
one.setUpdateTime(LocalDateTime.now());
one.setRemake(apmsCompleteOrder.getRemake());
apmsCheckResultServiceBiz.save(one); apmsCheckResultServiceBiz.save(one);
//订单不应该在该地方完成额外提供一个完成接口供人工完成不通知apms //订单不应该在该地方完成额外提供一个完成接口供人工完成不通知apms
return successful("操作成功,接收检验结果完成。", ""); return successful(0,"操作成功,接收检验结果完成。", "");
} }
else else
{ {
//存在检验结果更新的情况主管或其他人员可能会更改结果 //存在检验结果更新的情况主管或其他人员可能会更改结果
one1.setIdenCardNum(apmsCompleteOrder.getIdenCardNum()); BeanUtils.copyProperties(apmsCompleteOrder, one1);
one1.setSheetNo(apmsCompleteOrder.getSheetNo());
one1.setValid(WhetherEnum.YES.getValue());
one1.setMetallography(apmsCompleteOrder.getMetallographic()); one1.setMetallography(apmsCompleteOrder.getMetallographic());
one1.setHeartHardness(apmsCompleteOrder.getHeartHardness());
one1.setHardnessValueOne(apmsCompleteOrder.getHardnessValueOne());
one1.setHardnessValueTwo(apmsCompleteOrder.getHardnessValueTwo());
one1.setHardnessValueThree(apmsCompleteOrder.getHardnessValueThree());
one1.setHardness(apmsCompleteOrder.getHardness());
one1.setUpdateTime(LocalDateTime.now()); one1.setUpdateTime(LocalDateTime.now());
one1.setRemake(apmsCompleteOrder.getRemake());
apmsCheckResultServiceBiz.updateById(one1); apmsCheckResultServiceBiz.updateById(one1);
return successful("操作成功,更新检验结果完成。", ""); return successful(0,"操作成功,更新检验结果完成。", "");
} }
} }

View File

@ -132,7 +132,7 @@ public class AsynRunTaskService extends BaseService {
//执行成功,托盘进炉 //执行成功,托盘进炉
if (status==1){ if (status==1){
// TODO: 2022/7/7 开始记录能源消耗 // TODO: 2022/7/7 开始记录能源消耗
//asynStartRecordConsume(currTaskId,currTask.getKilnId()); asynStartRecordConsume(currTaskId,currTask.getKilnId());
logger.info("===执行任务:"+currTaskId+" ,车辆搬运任务,车辆:"+vehicleId+" ,起点:"+startPoint+" ,终点:"+endPoint+"任务执行成功==="); logger.info("===执行任务:"+currTaskId+" ,车辆搬运任务,车辆:"+vehicleId+" ,起点:"+startPoint+" ,终点:"+endPoint+"任务执行成功===");
//更新调度表状态为完成 //更新调度表状态为完成
runTask.setUpdateTime(LocalDateTime.now()); runTask.setUpdateTime(LocalDateTime.now());
@ -148,7 +148,7 @@ public class AsynRunTaskService extends BaseService {
vehicle.setStatus(0); vehicle.setStatus(0);
vehicleInfoServiceBiz.updateById(vehicle); vehicleInfoServiceBiz.updateById(vehicle);
// TODO: 2022/7/6 上报apms加工单开始 // TODO: 2022/7/6 上报apms加工单开始
//apmsStartProcess(currTask); apmsStartProcess(currTask);
}else { }else {
runTask.setStatus(3); runTask.setStatus(3);
@ -217,7 +217,7 @@ public class AsynRunTaskService extends BaseService {
//执行成功,托盘进炉 //执行成功,托盘进炉
if (status==1){ if (status==1){
// TODO: 2022/7/7 // TODO: 2022/7/7
//asynStartRecordConsume(currTaskId,currTask.getKilnId()); asynStartRecordConsume(currTaskId,currTask.getKilnId());
logger.info("===执行任务:"+currTaskId+" ,车辆搬运任务,车辆:"+vehicleId+" ,起点:"+startPoint+" ,终点:"+endPoint+"任务执行成功==="); logger.info("===执行任务:"+currTaskId+" ,车辆搬运任务,车辆:"+vehicleId+" ,起点:"+startPoint+" ,终点:"+endPoint+"任务执行成功===");
//更新调度表状态为完成 //更新调度表状态为完成
runTask.setUpdateTime(LocalDateTime.now()); runTask.setUpdateTime(LocalDateTime.now());
@ -244,7 +244,7 @@ public class AsynRunTaskService extends BaseService {
vehicle.setStatus(0); vehicle.setStatus(0);
vehicleInfoServiceBiz.updateById(vehicle); vehicleInfoServiceBiz.updateById(vehicle);
// TODO: 2022/7/6 上报apms生产单开始加工 // TODO: 2022/7/6 上报apms生产单开始加工
//apmsStartProcess(currTask); apmsStartProcess(currTask);
}else { }else {
runTask.setStatus(3); runTask.setStatus(3);
runTask.setUpdateTime(LocalDateTime.now()); runTask.setUpdateTime(LocalDateTime.now());
@ -417,7 +417,7 @@ public class AsynRunTaskService extends BaseService {
if (status==1){ if (status==1){
// TODO: 2022/7/7 加工完成记录结束时能源消耗 // TODO: 2022/7/7 加工完成记录结束时能源消耗
//asynEndRecordConsume(currTaskId,currTask.getKilnId()); asynEndRecordConsume(currTaskId,currTask.getKilnId());
logger.info("===执行任务:"+currTaskId+" ,车辆搬运任务,车辆:"+vehicleId+" ,起点:"+startPoint+" ,终点:"+endPoint+"任务执行成功==="); logger.info("===执行任务:"+currTaskId+" ,车辆搬运任务,车辆:"+vehicleId+" ,起点:"+startPoint+" ,终点:"+endPoint+"任务执行成功===");
//更新关系表状态为完成 //更新关系表状态为完成
runTask.setUpdateTime(LocalDateTime.now()); runTask.setUpdateTime(LocalDateTime.now());
@ -436,8 +436,9 @@ public class AsynRunTaskService extends BaseService {
//更新小车状态 //更新小车状态
vehicle.setStatus(0); vehicle.setStatus(0);
vehicleInfoServiceBiz.updateById(vehicle); vehicleInfoServiceBiz.updateById(vehicle);
// TODO: 2022/7/6 上报apms加工完成 // TODO: 2022/7/6 上报apms加工完成.每次进炉加工完成后就上报apms完成处理生产单等所有加工步骤都完成后上报apms完成生产单
/* ApmsEndProcess apmsEndProcess=new ApmsEndProcess(); logger.info("任务:"+currTaskId+" 生产单号:"+currTask.getSheetNo()+"开始上报apm完成处理生产单");
ApmsEndProcess apmsEndProcess=new ApmsEndProcess();
apmsEndProcess.setEndTime(LocalDateTime.now().toString()); apmsEndProcess.setEndTime(LocalDateTime.now().toString());
apmsEndProcess.setEndUser("QJJP03"); apmsEndProcess.setEndUser("QJJP03");
apmsEndProcess.setSheetNo(currTask.getSheetNo()); apmsEndProcess.setSheetNo(currTask.getSheetNo());
@ -458,6 +459,7 @@ public class AsynRunTaskService extends BaseService {
return; return;
} }
} }
logger.info("任务:"+currTask.getTaskCode()+"开始上报apms完成生产单");
ApmsFinishProcessSheet apmsFinishProcessSheet=new ApmsFinishProcessSheet(); ApmsFinishProcessSheet apmsFinishProcessSheet=new ApmsFinishProcessSheet();
apmsFinishProcessSheet.setSheetNo(currTask.getSheetNo()); apmsFinishProcessSheet.setSheetNo(currTask.getSheetNo());
apmsFinishProcessSheet.setEndTime(LocalDateTime.now().toString()); apmsFinishProcessSheet.setEndTime(LocalDateTime.now().toString());
@ -477,7 +479,7 @@ public class AsynRunTaskService extends BaseService {
R<ApmsFinishProcessSheetVo> apmsFinishProcessSheetVoR = apmsController.finishProcessSheet(apmsFinishProcessSheet); R<ApmsFinishProcessSheetVo> apmsFinishProcessSheetVoR = apmsController.finishProcessSheet(apmsFinishProcessSheet);
if (apmsFinishProcessSheetVoR.getCode()!=0){ if (apmsFinishProcessSheetVoR.getCode()!=0){
logger.info("任务:"+currTask.getTaskCode()+"完成后上报apms完成生产单失败"); logger.info("任务:"+currTask.getTaskCode()+"完成后上报apms完成生产单失败");
}*/ }
}else { }else {
runTask.setStatus(3); runTask.setStatus(3);
runTask.setUpdateTime(LocalDateTime.now()); runTask.setUpdateTime(LocalDateTime.now());
@ -581,7 +583,7 @@ public class AsynRunTaskService extends BaseService {
PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>() PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
.eq(PlcNameSpace.EQ_ID, kilnId) .eq(PlcNameSpace.EQ_ID, kilnId)
.eq(PlcNameSpace.EQ_TYPE, 0)); .eq(PlcNameSpace.EQ_TYPE, 0));
String nameSpaceNote = nameSpace.getNote(); String nameSpaceNote = nameSpace.getName();
switch (kilnInfo.getType()){ switch (kilnInfo.getType()){
//加工炉 //加工炉
case 1: case 1:
@ -600,7 +602,7 @@ public class AsynRunTaskService extends BaseService {
parTemValue.setOilTankActTemValue(actualOilTemp.floatValue()); parTemValue.setOilTankActTemValue(actualOilTemp.floatValue());
parTemValue.setKilnId(kilnId); parTemValue.setKilnId(kilnId);
parTemValue.setTaskId(currTaskId); parTemValue.setTaskId(currTaskId);
setCommonField(parTemValue); parTemValue.setCreateTime(LocalDateTime.now());
parTemValueServiceBiz.save(parTemValue); parTemValueServiceBiz.save(parTemValue);
//电度值 //电度值
Double electricalValue = readPlc(nameSpaceNote,"ElectricalValue"); Double electricalValue = readPlc(nameSpaceNote,"ElectricalValue");
@ -615,7 +617,7 @@ public class AsynRunTaskService extends BaseService {
parEleValue.setTotalBat(electricalValue.floatValue()); parEleValue.setTotalBat(electricalValue.floatValue());
parEleValue.setKilnId(kilnId); parEleValue.setKilnId(kilnId);
parEleValue.setTaskId(currTaskId); parEleValue.setTaskId(currTaskId);
setCommonField(parEleValue); parEleValue.setCreateTime(LocalDateTime.now());
parEleValueServiceBiz.save(parEleValue); parEleValueServiceBiz.save(parEleValue);
//一号油搅拌转速 //一号油搅拌转速
Double oilStirringSpeed1 = readPlc(nameSpaceNote, "OilStirringSpeed1"); Double oilStirringSpeed1 = readPlc(nameSpaceNote, "OilStirringSpeed1");
@ -626,7 +628,7 @@ public class AsynRunTaskService extends BaseService {
parRotSpeedValue.setOilStiSpeedAValue(oilStirringSpeed2.floatValue()); parRotSpeedValue.setOilStiSpeedAValue(oilStirringSpeed2.floatValue());
parRotSpeedValue.setKilnId(kilnId); parRotSpeedValue.setKilnId(kilnId);
parRotSpeedValue.setTaskId(currTaskId); parRotSpeedValue.setTaskId(currTaskId);
setCommonField(parRotSpeedValue); parRotSpeedValue.setCreateTime(LocalDateTime.now());
parRotSpeedValueServiceBiz.save(parRotSpeedValue); parRotSpeedValueServiceBiz.save(parRotSpeedValue);
//氮气 //氮气
Double nitrogenFlow = readPlc(nameSpaceNote, "NitrogenFlow"); Double nitrogenFlow = readPlc(nameSpaceNote, "NitrogenFlow");
@ -649,7 +651,7 @@ public class AsynRunTaskService extends BaseService {
parGasValue.setSetNitPotValue(setupCarbon.floatValue()); parGasValue.setSetNitPotValue(setupCarbon.floatValue());
parGasValue.setKilnId(kilnId); parGasValue.setKilnId(kilnId);
parGasValue.setTaskId(currTaskId); parGasValue.setTaskId(currTaskId);
setCommonField(parGasValue); parGasValue.setCreateTime(LocalDateTime.now());
parGasValueServiceBiz.save(parGasValue); parGasValueServiceBiz.save(parGasValue);
break; break;
//回火炉 //回火炉
@ -663,7 +665,7 @@ public class AsynRunTaskService extends BaseService {
parTemValue2.setActTemValue(actualTemp.floatValue()); parTemValue2.setActTemValue(actualTemp.floatValue());
parTemValue2.setKilnId(kilnId); parTemValue2.setKilnId(kilnId);
parTemValue2.setTaskId(currTaskId); parTemValue2.setTaskId(currTaskId);
setCommonField(parTemValue2); parTemValue2.setCreateTime(LocalDateTime.now());
parTemValueServiceBiz.save(parTemValue2); parTemValueServiceBiz.save(parTemValue2);
//电度值 //电度值
electricalValue = readPlc(nameSpaceNote,"TotalElectricity"); electricalValue = readPlc(nameSpaceNote,"TotalElectricity");
@ -678,7 +680,7 @@ public class AsynRunTaskService extends BaseService {
parEleValue2.setTotalBat(electricalValue.floatValue()); parEleValue2.setTotalBat(electricalValue.floatValue());
parEleValue2.setKilnId(kilnId); parEleValue2.setKilnId(kilnId);
parEleValue2.setTaskId(currTaskId); parEleValue2.setTaskId(currTaskId);
setCommonField(parEleValue2); parEleValue2.setCreateTime(LocalDateTime.now());
parEleValueServiceBiz.save(parEleValue2); parEleValueServiceBiz.save(parEleValue2);
break; break;
//氮化炉 //氮化炉
@ -701,7 +703,7 @@ public class AsynRunTaskService extends BaseService {
parTemValue3.setFurnacePressure(furnacePressure.floatValue()); parTemValue3.setFurnacePressure(furnacePressure.floatValue());
parTemValue3.setKilnId(kilnId); parTemValue3.setKilnId(kilnId);
parTemValue3.setTaskId(currTaskId); parTemValue3.setTaskId(currTaskId);
setCommonField(parTemValue3); parTemValue3.setCreateTime(LocalDateTime.now());
parTemValueServiceBiz.save(parTemValue3); parTemValueServiceBiz.save(parTemValue3);
//电度值 //电度值
electricalValue = readPlc(nameSpaceNote,"ElectricalValue"); electricalValue = readPlc(nameSpaceNote,"ElectricalValue");
@ -716,7 +718,7 @@ public class AsynRunTaskService extends BaseService {
parEleValue3.setTotalBat(electricalValue.floatValue()); parEleValue3.setTotalBat(electricalValue.floatValue());
parEleValue3.setKilnId(kilnId); parEleValue3.setKilnId(kilnId);
parEleValue3.setTaskId(currTaskId); parEleValue3.setTaskId(currTaskId);
setCommonField(parEleValue3); parEleValue3.setCreateTime(LocalDateTime.now());
parEleValueServiceBiz.save(parEleValue3); parEleValueServiceBiz.save(parEleValue3);
//实际氮势 //实际氮势
actualCarbon = readPlc(nameSpaceNote, "ActualCarbon"); actualCarbon = readPlc(nameSpaceNote, "ActualCarbon");
@ -741,7 +743,7 @@ public class AsynRunTaskService extends BaseService {
parGasValue3.setDecompositionRate(decompositionRate.floatValue()); parGasValue3.setDecompositionRate(decompositionRate.floatValue());
parGasValue3.setKilnId(kilnId); parGasValue3.setKilnId(kilnId);
parGasValue3.setTaskId(currTaskId); parGasValue3.setTaskId(currTaskId);
setCommonField(parGasValue3); parGasValue3.setCreateTime(LocalDateTime.now());
parGasValueServiceBiz.save(parGasValue3); parGasValueServiceBiz.save(parGasValue3);
break; break;
//清洗炉 //清洗炉
@ -759,7 +761,7 @@ public class AsynRunTaskService extends BaseService {
parEleValue4.setTotalBat(electricalValue.floatValue()); parEleValue4.setTotalBat(electricalValue.floatValue());
parEleValue4.setKilnId(kilnId); parEleValue4.setKilnId(kilnId);
parEleValue4.setTaskId(currTaskId); parEleValue4.setTaskId(currTaskId);
setCommonField(parEleValue4); parEleValue4.setCreateTime(LocalDateTime.now());
parEleValueServiceBiz.save(parEleValue4); parEleValueServiceBiz.save(parEleValue4);
break; break;
default: default:
@ -773,7 +775,7 @@ public class AsynRunTaskService extends BaseService {
PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>() PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
.eq(PlcNameSpace.EQ_ID, kilnId) .eq(PlcNameSpace.EQ_ID, kilnId)
.eq(PlcNameSpace.EQ_TYPE, 0)); .eq(PlcNameSpace.EQ_TYPE, 0));
String nameSpaceNote = nameSpace.getNote(); String nameSpaceNote = nameSpace.getName();
switch (kilnInfo.getType()){ switch (kilnInfo.getType()){
//加工炉 //加工炉
case 1: case 1:
@ -792,7 +794,7 @@ public class AsynRunTaskService extends BaseService {
parTemValue.setOilTankActTemValue(actualOilTemp.floatValue()); parTemValue.setOilTankActTemValue(actualOilTemp.floatValue());
parTemValue.setKilnId(kilnId); parTemValue.setKilnId(kilnId);
parTemValue.setTaskId(currTaskId); parTemValue.setTaskId(currTaskId);
setCommonField(parTemValue); parTemValue.setCreateTime(LocalDateTime.now());
parTemValueServiceBiz.save(parTemValue); parTemValueServiceBiz.save(parTemValue);
//电度值 //电度值
Double electricalValue = readPlc(nameSpaceNote,"ElectricalValue"); Double electricalValue = readPlc(nameSpaceNote,"ElectricalValue");
@ -807,7 +809,7 @@ public class AsynRunTaskService extends BaseService {
parEleValue.setTotalBat(electricalValue.floatValue()); parEleValue.setTotalBat(electricalValue.floatValue());
parEleValue.setKilnId(kilnId); parEleValue.setKilnId(kilnId);
parEleValue.setTaskId(currTaskId); parEleValue.setTaskId(currTaskId);
setCommonField(parEleValue); parEleValue.setCreateTime(LocalDateTime.now());
parEleValueServiceBiz.save(parEleValue); parEleValueServiceBiz.save(parEleValue);
//一号油搅拌转速 //一号油搅拌转速
Double oilStirringSpeed1 = readPlc(nameSpaceNote, "OilStirringSpeed1"); Double oilStirringSpeed1 = readPlc(nameSpaceNote, "OilStirringSpeed1");
@ -818,7 +820,7 @@ public class AsynRunTaskService extends BaseService {
parRotSpeedValue.setOilStiSpeedAValue(oilStirringSpeed2.floatValue()); parRotSpeedValue.setOilStiSpeedAValue(oilStirringSpeed2.floatValue());
parRotSpeedValue.setKilnId(kilnId); parRotSpeedValue.setKilnId(kilnId);
parRotSpeedValue.setTaskId(currTaskId); parRotSpeedValue.setTaskId(currTaskId);
setCommonField(parRotSpeedValue); parRotSpeedValue.setCreateTime(LocalDateTime.now());
parRotSpeedValueServiceBiz.save(parRotSpeedValue); parRotSpeedValueServiceBiz.save(parRotSpeedValue);
//氮气 //氮气
Double nitrogenFlow = readPlc(nameSpaceNote, "NitrogenFlow"); Double nitrogenFlow = readPlc(nameSpaceNote, "NitrogenFlow");
@ -841,7 +843,7 @@ public class AsynRunTaskService extends BaseService {
parGasValue.setSetNitPotValue(setupCarbon.floatValue()); parGasValue.setSetNitPotValue(setupCarbon.floatValue());
parGasValue.setKilnId(kilnId); parGasValue.setKilnId(kilnId);
parGasValue.setTaskId(currTaskId); parGasValue.setTaskId(currTaskId);
setCommonField(parGasValue); parGasValue.setCreateTime(LocalDateTime.now());
parGasValueServiceBiz.save(parGasValue); parGasValueServiceBiz.save(parGasValue);
break; break;
//回火炉 //回火炉
@ -855,7 +857,7 @@ public class AsynRunTaskService extends BaseService {
parTemValue2.setActTemValue(actualTemp.floatValue()); parTemValue2.setActTemValue(actualTemp.floatValue());
parTemValue2.setKilnId(kilnId); parTemValue2.setKilnId(kilnId);
parTemValue2.setTaskId(currTaskId); parTemValue2.setTaskId(currTaskId);
setCommonField(parTemValue2); parTemValue2.setCreateTime(LocalDateTime.now());
parTemValueServiceBiz.save(parTemValue2); parTemValueServiceBiz.save(parTemValue2);
//电度值 //电度值
electricalValue = readPlc(nameSpaceNote,"TotalElectricity"); electricalValue = readPlc(nameSpaceNote,"TotalElectricity");
@ -870,7 +872,7 @@ public class AsynRunTaskService extends BaseService {
parEleValue2.setTotalBat(electricalValue.floatValue()); parEleValue2.setTotalBat(electricalValue.floatValue());
parEleValue2.setKilnId(kilnId); parEleValue2.setKilnId(kilnId);
parEleValue2.setTaskId(currTaskId); parEleValue2.setTaskId(currTaskId);
setCommonField(parEleValue2); parEleValue2.setCreateTime(LocalDateTime.now());
parEleValueServiceBiz.save(parEleValue2); parEleValueServiceBiz.save(parEleValue2);
break; break;
//氮化炉 //氮化炉
@ -893,7 +895,7 @@ public class AsynRunTaskService extends BaseService {
parTemValue3.setFurnacePressure(furnacePressure.floatValue()); parTemValue3.setFurnacePressure(furnacePressure.floatValue());
parTemValue3.setKilnId(kilnId); parTemValue3.setKilnId(kilnId);
parTemValue3.setTaskId(currTaskId); parTemValue3.setTaskId(currTaskId);
setCommonField(parTemValue3); parTemValue3.setCreateTime(LocalDateTime.now());
parTemValueServiceBiz.save(parTemValue3); parTemValueServiceBiz.save(parTemValue3);
//电度值 //电度值
electricalValue = readPlc(nameSpaceNote,"ElectricalValue"); electricalValue = readPlc(nameSpaceNote,"ElectricalValue");
@ -908,7 +910,7 @@ public class AsynRunTaskService extends BaseService {
parEleValue3.setTotalBat(electricalValue.floatValue()); parEleValue3.setTotalBat(electricalValue.floatValue());
parEleValue3.setKilnId(kilnId); parEleValue3.setKilnId(kilnId);
parEleValue3.setTaskId(currTaskId); parEleValue3.setTaskId(currTaskId);
setCommonField(parEleValue3); parEleValue3.setCreateTime(LocalDateTime.now());
parEleValueServiceBiz.save(parEleValue3); parEleValueServiceBiz.save(parEleValue3);
//实际氮势 //实际氮势
actualCarbon = readPlc(nameSpaceNote, "ActualCarbon"); actualCarbon = readPlc(nameSpaceNote, "ActualCarbon");
@ -933,7 +935,7 @@ public class AsynRunTaskService extends BaseService {
parGasValue3.setDecompositionRate(decompositionRate.floatValue()); parGasValue3.setDecompositionRate(decompositionRate.floatValue());
parGasValue3.setKilnId(kilnId); parGasValue3.setKilnId(kilnId);
parGasValue3.setTaskId(currTaskId); parGasValue3.setTaskId(currTaskId);
setCommonField(parGasValue3); parGasValue3.setCreateTime(LocalDateTime.now());
parGasValueServiceBiz.save(parGasValue3); parGasValueServiceBiz.save(parGasValue3);
break; break;
//清洗炉 //清洗炉
@ -951,7 +953,7 @@ public class AsynRunTaskService extends BaseService {
parEleValue4.setTotalBat(electricalValue.floatValue()); parEleValue4.setTotalBat(electricalValue.floatValue());
parEleValue4.setKilnId(kilnId); parEleValue4.setKilnId(kilnId);
parEleValue4.setTaskId(currTaskId); parEleValue4.setTaskId(currTaskId);
setCommonField(parEleValue4); parEleValue4.setCreateTime(LocalDateTime.now());
parEleValueServiceBiz.save(parEleValue4); parEleValueServiceBiz.save(parEleValue4);
break; break;
default: default:

View File

@ -203,7 +203,7 @@ public class RunTaskUtils {
} else { } else {
//当前加工步骤不为第一步 //当前加工步骤不为第一步
int secondCount = autoExeTaskServiceBiz.count(new QueryWrapper<AutoExeTask>().eq(AutoExeTask.T_TASK_ID, currTask.getId())); int secondCount = autoExeTaskServiceBiz.count(new QueryWrapper<AutoExeTask>().eq(AutoExeTask.T_TASK_ID, currTask.getId()));
if (secondCount == 2) { if (secondCount == 1) {
//当前为自动任务第二步 //当前为自动任务第二步
AutoExeTask autoExeTask = autoExeTaskServiceBiz.getOne(new QueryWrapper<AutoExeTask>().eq(AutoExeTask.T_TASK_ID, currTask.getId())); AutoExeTask autoExeTask = autoExeTaskServiceBiz.getOne(new QueryWrapper<AutoExeTask>().eq(AutoExeTask.T_TASK_ID, currTask.getId()));
//该自动任务的工艺类型为2还有第三步 //该自动任务的工艺类型为2还有第三步

View File

@ -123,7 +123,7 @@ public class ScheduledTask extends BaseService {
/** /**
* 正在加工的加工任务详情 * 正在加工的加工任务详情
*/ */
//@Scheduled(fixedDelay = 1000*60) @Scheduled(fixedDelay = 1000*60)
public void screen() throws IOException { public void screen() throws IOException {
//查询出正在进炉加工的curr_task,查询对应炉号是否Working,查询计划时间剩余时间查询标识卡详情 //查询出正在进炉加工的curr_task,查询对应炉号是否Working,查询计划时间剩余时间查询标识卡详情
List<CurrTask> currTaskList = currTaskServiceBiz.list(new QueryWrapper<CurrTask>().eq(CurrTask.IS_IN, 1)); List<CurrTask> currTaskList = currTaskServiceBiz.list(new QueryWrapper<CurrTask>().eq(CurrTask.IS_IN, 1));
@ -148,15 +148,15 @@ public class ScheduledTask extends BaseService {
//剩余时间 //剩余时间
Integer remainingTime=0; Integer remainingTime=0;
if (kilnInfo.getType()!=4){ if (kilnInfo.getType()!=4){
remainingTime = Integer.parseInt(readPlcToString(nameSpace, "ProgramTimeRemain")); remainingTime = readPlc(nameSpace, "ProgramTimeRemain").intValue();
} }
if(kilnInfo.getType()==1||kilnInfo.getType()==3){ if(kilnInfo.getType()==1||kilnInfo.getType()==3){
//运行时间 //运行时间
Integer runTime = Integer.parseInt(readPlcToString(nameSpace, "ProgramRunTime")); Integer runTime = readPlc(nameSpace, "ProgramRunTime").intValue();
setupTime=runTime+remainingTime; setupTime=runTime+remainingTime;
} }
if (kilnInfo.getType()==2){ if (kilnInfo.getType()==2){
setupTime=Integer.parseInt(readPlcToString(nameSpace, "SetTime")); setupTime=readPlc(nameSpace, "SetTime").intValue();
} }
nowCurrTask.setSetupTime(setupTime); nowCurrTask.setSetupTime(setupTime);
nowCurrTask.setRemainingTime(remainingTime); nowCurrTask.setRemainingTime(remainingTime);
@ -212,8 +212,9 @@ public class ScheduledTask extends BaseService {
} }
//查询出正在加工的窑炉遍历根据采集频率的不同采集高频数据能源消耗暂定30秒 //查询出正在加工的窑炉遍历根据采集频率的不同采集高频数据能源消耗暂定30秒
//@Scheduled(fixedDelay = 1000*30) @Scheduled(fixedDelay = 1000*30)
public void getFastValue(){ public void getFastValue(){
logger.info("==采集高频能耗数据开始==");
//加工炉列表 //加工炉列表
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list(new QueryWrapper<KilnInfo>().in(KilnInfo.TYPE,1,3)); List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list(new QueryWrapper<KilnInfo>().in(KilnInfo.TYPE,1,3));
for (KilnInfo kilnInfo:kilnInfoList for (KilnInfo kilnInfo:kilnInfoList
@ -230,6 +231,10 @@ public class ScheduledTask extends BaseService {
Long kilnId = kilnInfo.getId(); Long kilnId = kilnInfo.getId();
String identificationNumber = readPlcToString(nameSpaceNote, "DischargeIdentNumber"); String identificationNumber = readPlcToString(nameSpaceNote, "DischargeIdentNumber");
Long currTaskId = Long.valueOf(JSONObject.parseObject(identificationNumber).get("result").toString()); Long currTaskId = Long.valueOf(JSONObject.parseObject(identificationNumber).get("result").toString());
if (currTaskId==0){
logger.info("==当前加工的为手动加工任务,不记录能耗==");
continue;
}
//加工炉 //加工炉
if (kilnInfo.getType()==1){ if (kilnInfo.getType()==1){
//一号油搅拌转速 //一号油搅拌转速
@ -295,14 +300,16 @@ public class ScheduledTask extends BaseService {
parGasValue3.setCreateTime(LocalDateTime.now()); parGasValue3.setCreateTime(LocalDateTime.now());
parGasValueServiceBiz.save(parGasValue3); parGasValueServiceBiz.save(parGasValue3);
} }
} }
} }
logger.info("==采集高频能耗数据结束==");
} }
//查询出正在加工的窑炉遍历根据采集频率的不同采集低频数据能源消耗暂定3分钟一次 //查询出正在加工的窑炉遍历根据采集频率的不同采集低频数据能源消耗暂定3分钟一次
//@Scheduled(fixedDelay = 1000*60*3) @Scheduled(fixedDelay = 1000*60*3)
public void getSlowValue(){ public void getSlowValue(){
System.out.println("开始采集数据"); logger.info("==开始采集低频数据==");
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list(); List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list();
for (KilnInfo kilnInfo:kilnInfoList for (KilnInfo kilnInfo:kilnInfoList
) { ) {
@ -317,6 +324,10 @@ public class ScheduledTask extends BaseService {
Long kilnId = kilnInfo.getId(); Long kilnId = kilnInfo.getId();
String identificationNumber = readPlcToString(nameSpaceNote, "DischargeIdentNumber"); String identificationNumber = readPlcToString(nameSpaceNote, "DischargeIdentNumber");
Long currTaskId = Long.valueOf(JSONObject.parseObject(identificationNumber).get("result").toString()); Long currTaskId = Long.valueOf(JSONObject.parseObject(identificationNumber).get("result").toString());
if (currTaskId==0){
logger.info("==当前加工的为手动加工任务,不记录能耗==");
continue;
}
//加工炉 //加工炉
if (kilnInfo.getType()==1){ if (kilnInfo.getType()==1){
//实际温度 //实际温度
@ -439,7 +450,7 @@ public class ScheduledTask extends BaseService {
} }
} }
} }
System.out.println("采集完成"); logger.info("==结束采集低频数据==");
} }
//遍历窑炉空窑炉查询缓存区是否有等待加工的任务 //遍历窑炉空窑炉查询缓存区是否有等待加工的任务
@ -491,9 +502,10 @@ public class ScheduledTask extends BaseService {
} }
//遍历正在工作炉子的报警变量记录报警 //遍历正在工作炉子的报警变量记录报警
//@Scheduled(fixedDelay = 1000*30) @Scheduled(fixedDelay = 1000*60)
public void listenKilnAlarm(){ public void listenKilnAlarm(){
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list(); List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list();
logger.info("==开始查询炉子是否有报警==");
for (KilnInfo kilnInfo:kilnInfoList for (KilnInfo kilnInfo:kilnInfoList
) { ) {
PlcNameSpace kilnNameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>() PlcNameSpace kilnNameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
@ -545,7 +557,7 @@ public class ScheduledTask extends BaseService {
} }
} }
} }
logger.info("==结束查询炉子是否有报警==");
} }
//监听车辆是否在线暂时不用 //监听车辆是否在线暂时不用