|
@@ -1,10 +1,12 @@
|
|
package com.rongwei.bscommon.sys.service.impl;
|
|
package com.rongwei.bscommon.sys.service.impl;
|
|
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.rongwei.bscommon.sys.dao.AspCheckItemsDao;
|
|
import com.rongwei.bscommon.sys.dao.AspCheckItemsDao;
|
|
import com.rongwei.bscommon.sys.service.AspCheckItemsService;
|
|
import com.rongwei.bscommon.sys.service.AspCheckItemsService;
|
|
import com.rongwei.bsentity.domain.AspCheckItems;
|
|
import com.rongwei.bsentity.domain.AspCheckItems;
|
|
|
|
+import com.rongwei.bsentity.domain.AspCheckItemsAreaDo;
|
|
import com.rongwei.bsentity.dto.EquipmentDisposeDTO;
|
|
import com.rongwei.bsentity.dto.EquipmentDisposeDTO;
|
|
import com.rongwei.bsentity.enums.PlantEnum;
|
|
import com.rongwei.bsentity.enums.PlantEnum;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
@@ -12,6 +14,8 @@ import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.util.Date;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
* 设备子系统——设备 服务实现类
|
|
* 设备子系统——设备 服务实现类
|
|
@@ -32,28 +36,32 @@ public class AspCheckItemsServiceImpl extends ServiceImpl<AspCheckItemsDao, AspC
|
|
* 根据ID修改地址信息
|
|
* 根据ID修改地址信息
|
|
*
|
|
*
|
|
* @param equipmentDisposeDTO
|
|
* @param equipmentDisposeDTO
|
|
|
|
+ * @param checkItemsArea
|
|
* @return
|
|
* @return
|
|
* @date 2024/1/16 16:28
|
|
* @date 2024/1/16 16:28
|
|
* @author shangmi
|
|
* @author shangmi
|
|
- *
|
|
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public void updateSiteById(EquipmentDisposeDTO equipmentDisposeDTO) {
|
|
|
|
|
|
+ public void updateSiteById(EquipmentDisposeDTO equipmentDisposeDTO, AspCheckItemsAreaDo checkItemsArea) {
|
|
LambdaUpdateWrapper<AspCheckItems> updateWrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<AspCheckItems> updateWrapper = new LambdaUpdateWrapper<>();
|
|
- updateWrapper.eq(AspCheckItems::getId,equipmentDisposeDTO.getEquipmentId())
|
|
|
|
- .set(AspCheckItems::getTenantid,equipmentDisposeDTO.getRollInPlantId())
|
|
|
|
- .set(AspCheckItems::getUsedeptid,equipmentDisposeDTO.getRollInDeptId())
|
|
|
|
- .set(AspCheckItems::getUsedeptname,equipmentDisposeDTO.getRollInDept())
|
|
|
|
|
|
+ boolean empty = ObjectUtil.isEmpty(checkItemsArea);
|
|
|
|
+ updateWrapper.eq(AspCheckItems::getId, equipmentDisposeDTO.getEquipmentId())
|
|
|
|
+ .set(AspCheckItems::getTenantid, equipmentDisposeDTO.getRollInPlantId())
|
|
|
|
+ .set(AspCheckItems::getUsedeptid, equipmentDisposeDTO.getRollInDeptId())
|
|
|
|
+ .set(AspCheckItems::getUsedeptname, equipmentDisposeDTO.getRollInDept())
|
|
.set(AspCheckItems::getOwnedfactory, PlantEnum.nameOf(equipmentDisposeDTO.getRollInPlantId()))
|
|
.set(AspCheckItems::getOwnedfactory, PlantEnum.nameOf(equipmentDisposeDTO.getRollInPlantId()))
|
|
- .set(AspCheckItems::getDeviceaddress,equipmentDisposeDTO.getRollInLocation());
|
|
|
|
- aspCheckItemsDao.update(null,updateWrapper);
|
|
|
|
|
|
+ .set(AspCheckItems::getDeviceaddress, equipmentDisposeDTO.getRollInLocation())
|
|
|
|
+ .set(empty, AspCheckItems::getCheckitemareaid, checkItemsArea.getId())
|
|
|
|
+ .set(empty, AspCheckItems::getChargeorgid, checkItemsArea.getAreachargerorgid());
|
|
|
|
+ aspCheckItemsDao.update(null, updateWrapper);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void updateStateById(String equipmentId) {
|
|
|
|
|
|
+ public void updateStateById(String equipmentId, Date newDate) {
|
|
LambdaUpdateWrapper<AspCheckItems> updateWrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<AspCheckItems> updateWrapper = new LambdaUpdateWrapper<>();
|
|
- updateWrapper.eq(AspCheckItems::getId,equipmentId)
|
|
|
|
- .set(AspCheckItems::getEnabled,"报废");
|
|
|
|
- aspCheckItemsDao.update(null,updateWrapper);
|
|
|
|
|
|
+ updateWrapper.eq(AspCheckItems::getId, equipmentId)
|
|
|
|
+ .set(AspCheckItems::getDevicestatus, "报废")
|
|
|
|
+ .set(AspCheckItems::getFactobsoledate, newDate);
|
|
|
|
+ aspCheckItemsDao.update(null, updateWrapper);
|
|
}
|
|
}
|
|
}
|
|
}
|