admin/src/components/business/OperaPlatformWindow.vue
@@ -26,8 +26,8 @@ </el-option> </el-select> </el-form-item> <el-form-item label="LED空闲文案:" prop="remark"> <el-input type="text" v-model="form.remark" placeholder="请输入LED空闲文案" v-trim /> <el-form-item label="LED空闲文案:" prop="ledContent"> <el-input type="text" v-model="form.ledContent" placeholder="请输入LED空闲文案" v-trim /> </el-form-item> <el-form-item label="同时作业数量:" prop="workingNum"> <el-input type="number" v-model="form.workingNum" placeholder="请输入同时作业数量" v-trim /> @@ -71,7 +71,7 @@ startTime: '', endTime: '', workingNum: 1, remark: '', ledContent: '', workRate: '', stayTimeoutAlarmTime: '', workTimeoutAlarmTime: '', admin/src/views/platform/platform.vue
@@ -50,7 +50,7 @@ </el-table-column> --> <el-table-column prop="broadcastNames" label="关联广播" min-width="100px"></el-table-column> <el-table-column prop="ledNames" label="关联LED" min-width="100px"></el-table-column> <el-table-column prop="remark" label="LED空闲文案" min-width="180px"></el-table-column> <el-table-column prop="ledContent" label="LED空闲文案" min-width="180px"></el-table-column> <el-table-column prop="hkDate" label="同步时间" min-width="150px"></el-table-column> <el-table-column label="月台状态" fixed="right" width="100px"> <template slot-scope="{row}"> server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Platform.java
@@ -65,6 +65,9 @@ @ApiModelProperty(value = "备注") @ExcelColumn(name="备注") private String remark; @ApiModelProperty(value = "led空闲文案") @ExcelColumn(name="led空闲文案") private String ledContent; @ApiModelProperty(value = "状态 0正常 1禁用", example = "1") @ExcelColumn(name="状态 0正常 1禁用") server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformServiceImpl.java
@@ -9,10 +9,7 @@ import com.doumee.core.utils.Constants; import com.doumee.core.utils.DateUtil; import com.doumee.core.utils.Utils; import com.doumee.dao.business.DeviceMapper; import com.doumee.dao.business.PlatformDeviceMapper; import com.doumee.dao.business.PlatformJobMapper; import com.doumee.dao.business.PlatformMapper; import com.doumee.dao.business.*; import com.doumee.dao.business.join.PlatformJobJoinMapper; import com.doumee.dao.business.join.PlatformJoinMapper; import com.doumee.dao.business.model.*; @@ -46,6 +43,8 @@ @Autowired private PlatformMapper platformMapper; @Autowired private PlatformGroupMapper platformGroupMapper; @Autowired private PlatformJoinMapper platformJoinMapper; @Autowired @@ -135,6 +134,28 @@ public void updateById(Platform platform) { platform.setEditor(platform.getLoginUserInfo().getId()); platform.setEditDate(new Date()); Platform model = platformMapper.selectById(platform.getId()); if(model ==null || Constants.equalsInteger(model.getIsdeleted(),Constants.ONE)){ throw new BusinessException(ResponseStatus.DATA_EMPTY); } if(model.getGroupId()!= null && platform.getGroupId()!=null && !Constants.equalsInteger(platform.getGroupId(),model.getGroupId())){ PlatformGroup group = platformGroupMapper.selectById(platform.getGroupId()); if(group ==null || Constants.equalsInteger(group.getIsdeleted(),Constants.ZERO)){ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,月台组信息不正确!"); } //如果月台分组发生变化 Long count = platformJobJoinMapper.selectCount( new QueryWrapper<PlatformJob>().lambda() .eq(PlatformJob::getIsdeleted,Constants.ZERO) .notIn(PlatformJob::getStatus,Constants.PlatformJobStatus.WART_SIGN_IN.getKey() ,Constants.PlatformJobStatus.WAIT_CONFIRM.getKey() ,Constants.PlatformJobStatus.DONE.getKey() ,Constants.PlatformJobStatus.LEAVED.getKey() ,Constants.PlatformJobStatus.CANCEL.getKey() )); if(count!=null && count>0){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,当前月台有正在作业的任务,不能进行月台组切换操作!"); } } //删除LED/广播数据 platformDeviceMapper.delete(new QueryWrapper<PlatformDevice>().lambda() .eq(PlatformDevice::getPlatformId,platform.getId()) server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPlatformsServiceImpl.java
@@ -1,6 +1,7 @@ package com.doumee.service.business.impl.hksync; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.doumee.core.constants.ResponseStatus; import com.doumee.core.exception.BusinessException; @@ -13,10 +14,12 @@ import com.doumee.core.utils.Constants; import com.doumee.core.utils.DateUtil; import com.doumee.dao.business.PlatformDeviceMapper; import com.doumee.dao.business.PlatformJobMapper; import com.doumee.dao.business.PlatformMapper; import com.doumee.dao.business.model.Device; import com.doumee.dao.business.model.Platform; import com.doumee.dao.business.model.PlatformDevice; import com.doumee.dao.business.model.PlatformJob; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -35,6 +38,8 @@ public class HkSyncPlatformsServiceImpl extends HkSyncBaseServiceImpl { @Autowired private PlatformMapper platformMapper; @Autowired private PlatformJobMapper platformJobMapper; @Autowired private PlatformDeviceMapper platformDeviceMapper; @@ -65,9 +70,23 @@ getDataChangeList(allList,allHkList,addList,deviceList,editList,deleteList,date); if(deleteList.size()>0){ //逻辑删除 List<Integer> platIds = new ArrayList<>(); for(Platform d : deleteList){ platformMapper.updateById(d); platIds.add(d.getId()); } //更新删除的月台信息删正在执行的作业状态为【待签到】状态 platformJobMapper.update(null, new UpdateWrapper<PlatformJob>().lambda() .eq(PlatformJob::getIsdeleted,Constants.ZERO) .notIn(PlatformJob::getStatus,Constants.PlatformJobStatus.WART_SIGN_IN.getKey() ,Constants.PlatformJobStatus.WAIT_CONFIRM.getKey() ,Constants.PlatformJobStatus.DONE.getKey() ,Constants.PlatformJobStatus.LEAVED.getKey() ,Constants.PlatformJobStatus.CANCEL.getKey() ) .in(PlatformJob::getPlatformId,platIds) .set(PlatformJob::getPlatformId,null) .set(PlatformJob::getStatus,Constants.PlatformJobStatus.WART_SIGN_IN.getKey()) ); } if(deviceList.size()>0){ platformDeviceMapper.insert(deviceList);