yinq 8 months ago
commit 8331cdadf2

@ -5,11 +5,14 @@ import com.aucma.api.domain.dto.SAPPortDto;
import com.aucma.api.domain.dto.WERKSDto; import com.aucma.api.domain.dto.WERKSDto;
import com.aucma.api.service.ISAPPortService; import com.aucma.api.service.ISAPPortService;
import com.aucma.base.domain.BaseOrderInfo; import com.aucma.base.domain.BaseOrderInfo;
import com.aucma.base.mapper.PublicMapper;
import com.aucma.base.service.IBaseOrderInfoService; import com.aucma.base.service.IBaseOrderInfoService;
import com.aucma.base.service.IRecordDnbInstantService;
import com.aucma.common.utils.DateUtils; import com.aucma.common.utils.DateUtils;
import com.aucma.production.domain.BaseBomInfo; import com.aucma.production.domain.BaseBomInfo;
import com.aucma.production.service.IBaseBomInfoService; import com.aucma.production.service.IBaseBomInfoService;
import com.aucma.production.service.IProductPlanInfoService; import com.aucma.production.service.IProductPlanInfoService;
import com.aucma.report.service.IDeviceAlarmRecordService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -36,6 +39,15 @@ public class SAPTask {
@Autowired @Autowired
private IBaseOrderInfoService orderInfoService; private IBaseOrderInfoService orderInfoService;
@Autowired
private IDeviceAlarmRecordService deviceAlarmRecordService;
@Autowired
private IRecordDnbInstantService recordDnbInstantService;
@Autowired
private PublicMapper publicMapper;
/** /**
* SAP * SAP
* @param factoryCode * @param factoryCode
@ -148,4 +160,30 @@ public class SAPTask {
return sapPortDto; return sapPortDto;
} }
/***
*
*/
public void DeleteDeviceAlarmRecordTable(Long dates){
deviceAlarmRecordService.deleteDeviceAlarmRecordByDates(dates);
System.out.println("删除设备报警记录数据库中数据");
}
/**
*
* */
public void DeleteRecordDnbInstant(Long dates){
recordDnbInstantService.deleteRecordDnbInstantByDates(dates);
System.out.println("删除电实时数据");
}
/**
*
*
* */
public void DeleteDOORFOAMREMACHINE(Long dates){
publicMapper.DeleteDOORFOAMREMACHINE(dates);
System.out.println("删除门体发泡数据");
}
} }

@ -0,0 +1,17 @@
package com.aucma.base.mapper;
import com.aucma.common.annotation.DataSource;
import com.aucma.common.enums.DataSourceType;
import org.springframework.stereotype.Repository;
/**
* @ClassName : PublicMapper
* @Description :
* @Author :
* @Date: 2024-03-30 17:29
*/
@Repository
public interface PublicMapper {
@DataSource(value = DataSourceType.SLAVE)
int DeleteDOORFOAMREMACHINE(Long dates);
}

@ -58,4 +58,6 @@ public interface RecordDnbInstantMapper
* @return * @return
*/ */
public int deleteRecordDnbInstantByObjIds(Long[] objIds); public int deleteRecordDnbInstantByObjIds(Long[] objIds);
int deleteRecordDnbInstantByDates(Long dates);
} }

@ -58,4 +58,6 @@ public interface IRecordDnbInstantService
* @return * @return
*/ */
public int deleteRecordDnbInstantByObjId(Long objId); public int deleteRecordDnbInstantByObjId(Long objId);
int deleteRecordDnbInstantByDates(long dates);
} }

@ -90,4 +90,9 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService
{ {
return recordDnbInstantMapper.deleteRecordDnbInstantByObjId(objId); return recordDnbInstantMapper.deleteRecordDnbInstantByObjId(objId);
} }
@Override
public int deleteRecordDnbInstantByDates(long dates) {
return recordDnbInstantMapper.deleteRecordDnbInstantByDates(dates);
}
} }

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.aucma.base.mapper.PublicMapper">
<delete id="DeleteDOORFOAMREMACHINE" parameterType="Long">
delete
from DOOR_FOAMREMACHINE
where (sysdate-#{dates})>CREATED_TIME
</delete>
</mapper>

@ -183,4 +183,7 @@
#{objId} #{objId}
</foreach> </foreach>
</delete> </delete>
<delete id="deleteRecordDnbInstantByDates" parameterType="Long">
delete from record_dnb_instant where (sysdate-#{dates})>COLLECT_TIME
</delete>
</mapper> </mapper>

@ -58,4 +58,6 @@ public interface DeviceAlarmRecordMapper
* @return * @return
*/ */
public int deleteDeviceAlarmRecordByObjIds(Long[] objIds); public int deleteDeviceAlarmRecordByObjIds(Long[] objIds);
int deleteDeviceAlarmRecordByDates(Long dates);
} }

@ -58,4 +58,9 @@ public interface IDeviceAlarmRecordService
* @return * @return
*/ */
public int deleteDeviceAlarmRecordByObjId(Long objId); public int deleteDeviceAlarmRecordByObjId(Long objId);
/**
*
* */
public int deleteDeviceAlarmRecordByDates(Long dates);
} }

@ -90,4 +90,9 @@ public class DeviceAlarmRecordServiceImpl implements IDeviceAlarmRecordService
{ {
return deviceAlarmRecordMapper.deleteDeviceAlarmRecordByObjId(objId); return deviceAlarmRecordMapper.deleteDeviceAlarmRecordByObjId(objId);
} }
@Override
public int deleteDeviceAlarmRecordByDates(Long dates) {
return deviceAlarmRecordMapper.deleteDeviceAlarmRecordByDates(dates);
}
} }

@ -134,4 +134,9 @@
#{objId} #{objId}
</foreach> </foreach>
</delete> </delete>
<delete id="deleteDeviceAlarmRecordByDates" parameterType="Long">
delete
from RECORD_ALARM_DEVICE
where (sysdate-#{dates})>ALARM_TIME
</delete>
</mapper> </mapper>
Loading…
Cancel
Save