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);
}

@ -5,15 +5,15 @@ import com.aucma.base.domain.RecordDnbInstant;
/** /**
* Mapper * Mapper
* *
* @author Yinq * @author Yinq
* @date 2023-09-26 * @date 2023-09-26
*/ */
public interface RecordDnbInstantMapper public interface RecordDnbInstantMapper
{ {
/** /**
* *
* *
* @param objId * @param objId
* @return * @return
*/ */
@ -21,7 +21,7 @@ public interface RecordDnbInstantMapper
/** /**
* *
* *
* @param recordDnbInstant * @param recordDnbInstant
* @return * @return
*/ */
@ -29,7 +29,7 @@ public interface RecordDnbInstantMapper
/** /**
* *
* *
* @param recordDnbInstant * @param recordDnbInstant
* @return * @return
*/ */
@ -37,7 +37,7 @@ public interface RecordDnbInstantMapper
/** /**
* *
* *
* @param recordDnbInstant * @param recordDnbInstant
* @return * @return
*/ */
@ -45,7 +45,7 @@ public interface RecordDnbInstantMapper
/** /**
* *
* *
* @param objId * @param objId
* @return * @return
*/ */
@ -53,9 +53,11 @@ public interface RecordDnbInstantMapper
/** /**
* *
* *
* @param objIds * @param objIds
* @return * @return
*/ */
public int deleteRecordDnbInstantByObjIds(Long[] objIds); public int deleteRecordDnbInstantByObjIds(Long[] objIds);
int deleteRecordDnbInstantByDates(Long dates);
} }

@ -5,15 +5,15 @@ import com.aucma.base.domain.RecordDnbInstant;
/** /**
* Service * Service
* *
* @author Yinq * @author Yinq
* @date 2023-09-26 * @date 2023-09-26
*/ */
public interface IRecordDnbInstantService public interface IRecordDnbInstantService
{ {
/** /**
* *
* *
* @param objId * @param objId
* @return * @return
*/ */
@ -21,7 +21,7 @@ public interface IRecordDnbInstantService
/** /**
* *
* *
* @param recordDnbInstant * @param recordDnbInstant
* @return * @return
*/ */
@ -29,7 +29,7 @@ public interface IRecordDnbInstantService
/** /**
* *
* *
* @param recordDnbInstant * @param recordDnbInstant
* @return * @return
*/ */
@ -37,7 +37,7 @@ public interface IRecordDnbInstantService
/** /**
* *
* *
* @param recordDnbInstant * @param recordDnbInstant
* @return * @return
*/ */
@ -45,7 +45,7 @@ public interface IRecordDnbInstantService
/** /**
* *
* *
* @param objIds * @param objIds
* @return * @return
*/ */
@ -53,9 +53,11 @@ public interface IRecordDnbInstantService
/** /**
* *
* *
* @param objId * @param objId
* @return * @return
*/ */
public int deleteRecordDnbInstantByObjId(Long objId); public int deleteRecordDnbInstantByObjId(Long objId);
int deleteRecordDnbInstantByDates(long dates);
} }

@ -9,19 +9,19 @@ import com.aucma.base.service.IRecordDnbInstantService;
/** /**
* Service * Service
* *
* @author Yinq * @author Yinq
* @date 2023-09-26 * @date 2023-09-26
*/ */
@Service @Service
public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService
{ {
@Autowired @Autowired
private RecordDnbInstantMapper recordDnbInstantMapper; private RecordDnbInstantMapper recordDnbInstantMapper;
/** /**
* *
* *
* @param objId * @param objId
* @return * @return
*/ */
@ -33,7 +33,7 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService
/** /**
* *
* *
* @param recordDnbInstant * @param recordDnbInstant
* @return * @return
*/ */
@ -45,7 +45,7 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService
/** /**
* *
* *
* @param recordDnbInstant * @param recordDnbInstant
* @return * @return
*/ */
@ -57,7 +57,7 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService
/** /**
* *
* *
* @param recordDnbInstant * @param recordDnbInstant
* @return * @return
*/ */
@ -69,7 +69,7 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService
/** /**
* *
* *
* @param objIds * @param objIds
* @return * @return
*/ */
@ -81,7 +81,7 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService
/** /**
* *
* *
* @param objId * @param objId
* @return * @return
*/ */
@ -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>
</mapper> <delete id="deleteRecordDnbInstantByDates" parameterType="Long">
delete from record_dnb_instant where (sysdate-#{dates})>COLLECT_TIME
</delete>
</mapper>

@ -5,15 +5,15 @@ import com.aucma.report.domain.DeviceAlarmRecord;
/** /**
* Mapper * Mapper
* *
* @author Yinq * @author Yinq
* @date 2024-03-26 * @date 2024-03-26
*/ */
public interface DeviceAlarmRecordMapper public interface DeviceAlarmRecordMapper
{ {
/** /**
* *
* *
* @param objId * @param objId
* @return * @return
*/ */
@ -21,7 +21,7 @@ public interface DeviceAlarmRecordMapper
/** /**
* *
* *
* @param deviceAlarmRecord * @param deviceAlarmRecord
* @return * @return
*/ */
@ -29,7 +29,7 @@ public interface DeviceAlarmRecordMapper
/** /**
* *
* *
* @param deviceAlarmRecord * @param deviceAlarmRecord
* @return * @return
*/ */
@ -37,7 +37,7 @@ public interface DeviceAlarmRecordMapper
/** /**
* *
* *
* @param deviceAlarmRecord * @param deviceAlarmRecord
* @return * @return
*/ */
@ -45,7 +45,7 @@ public interface DeviceAlarmRecordMapper
/** /**
* *
* *
* @param objId * @param objId
* @return * @return
*/ */
@ -53,9 +53,11 @@ public interface DeviceAlarmRecordMapper
/** /**
* *
* *
* @param objIds * @param objIds
* @return * @return
*/ */
public int deleteDeviceAlarmRecordByObjIds(Long[] objIds); public int deleteDeviceAlarmRecordByObjIds(Long[] objIds);
int deleteDeviceAlarmRecordByDates(Long dates);
} }

@ -5,15 +5,15 @@ import com.aucma.report.domain.DeviceAlarmRecord;
/** /**
* Service * Service
* *
* @author Yinq * @author Yinq
* @date 2024-03-26 * @date 2024-03-26
*/ */
public interface IDeviceAlarmRecordService public interface IDeviceAlarmRecordService
{ {
/** /**
* *
* *
* @param objId * @param objId
* @return * @return
*/ */
@ -21,7 +21,7 @@ public interface IDeviceAlarmRecordService
/** /**
* *
* *
* @param deviceAlarmRecord * @param deviceAlarmRecord
* @return * @return
*/ */
@ -29,7 +29,7 @@ public interface IDeviceAlarmRecordService
/** /**
* *
* *
* @param deviceAlarmRecord * @param deviceAlarmRecord
* @return * @return
*/ */
@ -37,7 +37,7 @@ public interface IDeviceAlarmRecordService
/** /**
* *
* *
* @param deviceAlarmRecord * @param deviceAlarmRecord
* @return * @return
*/ */
@ -45,7 +45,7 @@ public interface IDeviceAlarmRecordService
/** /**
* *
* *
* @param objIds * @param objIds
* @return * @return
*/ */
@ -53,9 +53,14 @@ public interface IDeviceAlarmRecordService
/** /**
* *
* *
* @param objId * @param objId
* @return * @return
*/ */
public int deleteDeviceAlarmRecordByObjId(Long objId); public int deleteDeviceAlarmRecordByObjId(Long objId);
/**
*
* */
public int deleteDeviceAlarmRecordByDates(Long dates);
} }

@ -9,19 +9,19 @@ import com.aucma.report.service.IDeviceAlarmRecordService;
/** /**
* Service * Service
* *
* @author Yinq * @author Yinq
* @date 2024-03-26 * @date 2024-03-26
*/ */
@Service @Service
public class DeviceAlarmRecordServiceImpl implements IDeviceAlarmRecordService public class DeviceAlarmRecordServiceImpl implements IDeviceAlarmRecordService
{ {
@Autowired @Autowired
private DeviceAlarmRecordMapper deviceAlarmRecordMapper; private DeviceAlarmRecordMapper deviceAlarmRecordMapper;
/** /**
* *
* *
* @param objId * @param objId
* @return * @return
*/ */
@ -33,7 +33,7 @@ public class DeviceAlarmRecordServiceImpl implements IDeviceAlarmRecordService
/** /**
* *
* *
* @param deviceAlarmRecord * @param deviceAlarmRecord
* @return * @return
*/ */
@ -45,7 +45,7 @@ public class DeviceAlarmRecordServiceImpl implements IDeviceAlarmRecordService
/** /**
* *
* *
* @param deviceAlarmRecord * @param deviceAlarmRecord
* @return * @return
*/ */
@ -57,7 +57,7 @@ public class DeviceAlarmRecordServiceImpl implements IDeviceAlarmRecordService
/** /**
* *
* *
* @param deviceAlarmRecord * @param deviceAlarmRecord
* @return * @return
*/ */
@ -69,7 +69,7 @@ public class DeviceAlarmRecordServiceImpl implements IDeviceAlarmRecordService
/** /**
* *
* *
* @param objIds * @param objIds
* @return * @return
*/ */
@ -81,7 +81,7 @@ public class DeviceAlarmRecordServiceImpl implements IDeviceAlarmRecordService
/** /**
* *
* *
* @param objId * @param objId
* @return * @return
*/ */
@ -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>
</mapper> <delete id="deleteDeviceAlarmRecordByDates" parameterType="Long">
delete
from RECORD_ALARM_DEVICE
where (sysdate-#{dates})>ALARM_TIME
</delete>
</mapper>

Loading…
Cancel
Save