|
@@ -82,6 +82,10 @@ public class EnvDeviceServiceImpl extends ServiceImpl<EnvDeviceMapper, EnvDevice
|
|
|
@Autowired
|
|
|
private EnvDeviceAtomizingMapper atomizingMapper;//喷雾
|
|
|
@Autowired
|
|
|
+ private EnvDeviceChuchouMapper envDeviceChuchouMapper;//除臭
|
|
|
+ @Autowired
|
|
|
+ private EnvDeviceLiaotaMapper envDeviceLiaotaMapper;//料塔
|
|
|
+ @Autowired
|
|
|
private EnvDeviceRecentlyDataMapper recentlyDataMapper;
|
|
|
|
|
|
|
|
@@ -136,44 +140,27 @@ public class EnvDeviceServiceImpl extends ServiceImpl<EnvDeviceMapper, EnvDevice
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Result add(HttpServletRequest httpServletRequest, EnvDevice envDevice1) {
|
|
|
-
|
|
|
- EnvDevice envDevice = new EnvDevice();
|
|
|
- envDevice.setFarmId(envDevice1.getFarmId());
|
|
|
- envDevice.setDeviceCode(envDevice1.getDeviceCode());
|
|
|
- envDevice.setDeviceName(envDevice1.getDeviceName());
|
|
|
- envDevice.setBuildLocation(envDevice1.getBuildLocation());
|
|
|
- envDevice.setUnitId(envDevice1.getUnitId());
|
|
|
- envDevice.setUnitName(envDevice1.getUnitName());
|
|
|
- envDevice.setDeviceBrand(envDevice1.getDeviceBrand());
|
|
|
- envDevice.setRemark(envDevice1.getRemark());
|
|
|
- envDevice.setDeviceStatus(0);
|
|
|
- envDevice.setDayAge(envDevice1.getDayAge());
|
|
|
- envDevice.setFengJiNum(envDevice1.getFengJiNum());
|
|
|
- envDevice.setXiaoChuangNum(envDevice1.getXiaoChuangNum());
|
|
|
- envDevice.setFengJiBianNum(envDevice1.getFengJiBianNum());
|
|
|
- envDevice.setShiLianNum(envDevice1.getShiLianNum());
|
|
|
- envDevice.setDaoLiuBan(envDevice1.getDaoLiuBan());
|
|
|
- envDevice.setPenWuNum(envDevice1.getPenWuNum());
|
|
|
- envDevice.setJiaReQiNum(envDevice1.getJiaReQiNum());
|
|
|
- envDevice.setZhaoMingDengNum(envDevice1.getZhaoMingDengNum());
|
|
|
+ @Transactional
|
|
|
+ public Result add(HttpServletRequest httpServletRequest, EnvDevice envDevice) {
|
|
|
+
|
|
|
+
|
|
|
|
|
|
QueryWrapper<BasePigpen> basePigpenQueryWrapper = new QueryWrapper<>();
|
|
|
- basePigpenQueryWrapper.eq("farm_id", envDevice1.getFarmId()).eq("id", envDevice1.getUnitId());
|
|
|
+ basePigpenQueryWrapper.eq("farm_id", envDevice.getFarmId()).eq("id", envDevice.getUnitId());
|
|
|
BasePigpen basePigpen = basePigpenMapper.selectOne(basePigpenQueryWrapper);
|
|
|
envDevice.setStageType(basePigpen.getStageCode());
|
|
|
|
|
|
QueryWrapper<EnvDevice> deviceQueryWrapper = new QueryWrapper<>();
|
|
|
- deviceQueryWrapper.eq("farm_id", envDevice1.getFarmId()).eq("unit_id", envDevice1.getUnitId());
|
|
|
+ deviceQueryWrapper.eq("farm_id", envDevice.getFarmId()).eq("unit_id", envDevice.getUnitId());
|
|
|
EnvDevice device1 = envDeviceMapper.selectOne(deviceQueryWrapper);//一个栋舍只能有一个设备
|
|
|
if (ObjectUtil.isEmpty(device1)) {
|
|
|
QueryWrapper<EnvDevice> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("device_name", envDevice1.getDeviceName()).eq("farm_id", envDevice1.getFarmId())
|
|
|
- .or().eq("device_code", envDevice1.getDeviceCode());
|
|
|
+ queryWrapper.eq("device_name", envDevice.getDeviceName()).eq("farm_id", envDevice.getFarmId())
|
|
|
+ .or().eq("device_code", envDevice.getDeviceCode());
|
|
|
EnvDevice device = envDeviceMapper.selectOne(queryWrapper);//名字和编码不能重复
|
|
|
if (ObjectUtil.isEmpty(device)) {
|
|
|
QueryWrapper<EnvDevice> queryWrapper1 = new QueryWrapper<>();
|
|
|
- queryWrapper1.eq("farm_id", envDevice1.getFarmId());
|
|
|
+ queryWrapper1.eq("farm_id", envDevice.getFarmId());
|
|
|
Integer integer = envDeviceMapper.selectCount(queryWrapper1);
|
|
|
if (integer == 0) {
|
|
|
envDevice.setDeviceSortCode("100" + "01");
|
|
@@ -196,14 +183,14 @@ public class EnvDeviceServiceImpl extends ServiceImpl<EnvDeviceMapper, EnvDevice
|
|
|
|
|
|
}
|
|
|
|
|
|
- public void addAll(EnvDevice envDevice1) {
|
|
|
+ public void addAll(EnvDevice envDevic) {
|
|
|
for (int i = 1; i < 24; i++) {
|
|
|
EnvDeviceRecentlyData data = new EnvDeviceRecentlyData();
|
|
|
- data.setDeviceCode(envDevice1.getDeviceSortCode());
|
|
|
+ data.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
if (i < 10) {
|
|
|
- data.setChipCode(envDevice1.getDeviceSortCode() + "140" + i);
|
|
|
+ data.setChipCode(envDevic.getDeviceSortCode() + "140" + i);
|
|
|
} else {
|
|
|
- data.setChipCode(envDevice1.getDeviceSortCode() + "14" + i);
|
|
|
+ data.setChipCode(envDevic.getDeviceSortCode() + "14" + i);
|
|
|
}
|
|
|
data.setChipStatus(0);
|
|
|
data.setChipType(i);
|
|
@@ -276,186 +263,233 @@ public class EnvDeviceServiceImpl extends ServiceImpl<EnvDeviceMapper, EnvDevice
|
|
|
if (i == 23) {
|
|
|
data.setChipName("体感温度");
|
|
|
}
|
|
|
- data.setFarmId(envDevice1.getFarmId());
|
|
|
+ data.setFarmId(envDevic.getFarmId());
|
|
|
data.setUpdateTime(new Date());
|
|
|
envDeviceRecentlyDataMapper.insert(data);
|
|
|
}
|
|
|
for (int i = 1; i < 9; i++) {
|
|
|
EnvTemp temp = new EnvTemp();
|
|
|
- temp.setDeviceCode(envDevice1.getDeviceSortCode());
|
|
|
- temp.setChipCode(envDevice1.getDeviceSortCode() + "140" + i);//温度1-8
|
|
|
- temp.setUnitId(envDevice1.getUnitId().toString());
|
|
|
- temp.setFarmId(envDevice1.getFarmId());
|
|
|
+ temp.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
+ temp.setChipCode(envDevic.getDeviceSortCode() + "140" + i);//温度1-8
|
|
|
+ temp.setUnitId(envDevic.getUnitId().toString());
|
|
|
+ temp.setFarmId(envDevic.getFarmId());
|
|
|
tempMapper.insert(temp);
|
|
|
}
|
|
|
EnvTemp temp = new EnvTemp();
|
|
|
- temp.setDeviceCode(envDevice1.getDeviceSortCode());
|
|
|
- temp.setChipCode(envDevice1.getDeviceSortCode() + "1423");//体感温度
|
|
|
- temp.setUnitId(envDevice1.getUnitId().toString());
|
|
|
- temp.setFarmId(envDevice1.getFarmId());
|
|
|
+ temp.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
+ temp.setChipCode(envDevic.getDeviceSortCode() + "1423");//体感温度
|
|
|
+ temp.setUnitId(envDevic.getUnitId().toString());
|
|
|
+ temp.setFarmId(envDevic.getFarmId());
|
|
|
tempMapper.insert(temp);
|
|
|
|
|
|
for (int i = 12; i < 15; i++) {
|
|
|
EnvHumi humi = new EnvHumi();
|
|
|
- humi.setChipCode(envDevice1.getDeviceSortCode() + "14" + i);//湿度
|
|
|
- humi.setDeviceCode(envDevice1.getDeviceSortCode());
|
|
|
- humi.setUnitId(envDevice1.getUnitId().toString());
|
|
|
- humi.setFarmId(envDevice1.getFarmId());
|
|
|
+ humi.setChipCode(envDevic.getDeviceSortCode() + "14" + i);//湿度
|
|
|
+ humi.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
+ humi.setUnitId(envDevic.getUnitId().toString());
|
|
|
+ humi.setFarmId(envDevic.getFarmId());
|
|
|
humiMapper.insert(humi);
|
|
|
}
|
|
|
|
|
|
EnvAmmonia ammonia = new EnvAmmonia();
|
|
|
- ammonia.setChipCode(envDevice1.getDeviceSortCode() + "1418");//氨气
|
|
|
- ammonia.setDeviceCode(envDevice1.getDeviceSortCode());
|
|
|
- ammonia.setUnitId(envDevice1.getUnitId().toString());
|
|
|
- ammonia.setFarmId(envDevice1.getFarmId());
|
|
|
+ ammonia.setChipCode(envDevic.getDeviceSortCode() + "1418");//氨气
|
|
|
+ ammonia.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
+ ammonia.setUnitId(envDevic.getUnitId().toString());
|
|
|
+ ammonia.setFarmId(envDevic.getFarmId());
|
|
|
ammoniaMapper.insert(ammonia);
|
|
|
|
|
|
EnvCo2 co2 = new EnvCo2();
|
|
|
- co2.setChipCode(envDevice1.getDeviceSortCode() + "1415");//co2
|
|
|
- co2.setDeviceCode(envDevice1.getDeviceSortCode());
|
|
|
- co2.setUnitId(envDevice1.getUnitId().toString());
|
|
|
- co2.setFarmId(envDevice1.getFarmId());
|
|
|
+ co2.setChipCode(envDevic.getDeviceSortCode() + "1415");//co2
|
|
|
+ co2.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
+ co2.setUnitId(envDevic.getUnitId().toString());
|
|
|
+ co2.setFarmId(envDevic.getFarmId());
|
|
|
co2Mapper.insert(co2);
|
|
|
|
|
|
EnvStive stive = new EnvStive();
|
|
|
- stive.setChipCode(envDevice1.getDeviceSortCode() + "1417");//粉尘
|
|
|
- stive.setDeviceCode(envDevice1.getDeviceSortCode());
|
|
|
- stive.setUnitId(envDevice1.getUnitId().toString());
|
|
|
- stive.setFarmId(envDevice1.getFarmId());
|
|
|
+ stive.setChipCode(envDevic.getDeviceSortCode() + "1417");//粉尘
|
|
|
+ stive.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
+ stive.setUnitId(envDevic.getUnitId().toString());
|
|
|
+ stive.setFarmId(envDevic.getFarmId());
|
|
|
stiveMapper.insert(stive);
|
|
|
|
|
|
EnvPressure pressure = new EnvPressure();
|
|
|
- pressure.setChipCode(envDevice1.getDeviceSortCode() + "1416");//压力
|
|
|
- pressure.setDeviceCode(envDevice1.getDeviceSortCode());
|
|
|
- pressure.setUnitId(envDevice1.getUnitId().toString());
|
|
|
- pressure.setFarmId(envDevice1.getFarmId());
|
|
|
+ pressure.setChipCode(envDevic.getDeviceSortCode() + "1416");//压力
|
|
|
+ pressure.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
+ pressure.setUnitId(envDevic.getUnitId().toString());
|
|
|
+ pressure.setFarmId(envDevic.getFarmId());
|
|
|
pressureMapper.insert(pressure);
|
|
|
|
|
|
|
|
|
- for (int i = 1; i < envDevice1.getFengJiNum() + 1; i++) {
|
|
|
+ for (int i = 1; i < envDevic.getFengJiNum() + 1; i++) {
|
|
|
EnvDeviceFan fan = new EnvDeviceFan();
|
|
|
- fan.setDeviceCode(envDevice1.getDeviceSortCode());
|
|
|
+ fan.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
if (i < 10) {
|
|
|
- fan.setChipCode(envDevice1.getDeviceSortCode() + "110" + i);
|
|
|
+ fan.setChipCode(envDevic.getDeviceSortCode() + "110" + i);
|
|
|
} else {
|
|
|
- fan.setChipCode(envDevice1.getDeviceSortCode() + "11" + i);
|
|
|
+ fan.setChipCode(envDevic.getDeviceSortCode() + "11" + i);
|
|
|
}
|
|
|
fan.setChipName("风机" + i);
|
|
|
- fan.setFarmId(envDevice1.getFarmId());
|
|
|
+ fan.setFarmId(envDevic.getFarmId());
|
|
|
fan.setChipStatus(0);
|
|
|
fan.setFengType(1);
|
|
|
fan.setOther1(String.valueOf(i));
|
|
|
fanMapper.insert(fan);
|
|
|
}
|
|
|
int j = 1;
|
|
|
- for (int i = envDevice1.getFengJiNum() + 1; i < envDevice1.getFengJiNum() + envDevice1.getFengJiBianNum() + 1; i++) {
|
|
|
+ for (int i = envDevic.getFengJiNum() + 1; i < envDevic.getFengJiNum() + envDevic.getFengJiBianNum() + 1; i++) {
|
|
|
EnvDeviceFan fan = new EnvDeviceFan();
|
|
|
- fan.setDeviceCode(envDevice1.getDeviceSortCode());
|
|
|
+ fan.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
if (i < 10) {
|
|
|
- fan.setChipCode(envDevice1.getDeviceSortCode() + "110" + i);
|
|
|
+ fan.setChipCode(envDevic.getDeviceSortCode() + "110" + i);
|
|
|
} else {
|
|
|
- fan.setChipCode(envDevice1.getDeviceSortCode() + "11" + i);
|
|
|
+ fan.setChipCode(envDevic.getDeviceSortCode() + "11" + i);
|
|
|
}
|
|
|
fan.setChipName("变频风机" + j);
|
|
|
- fan.setFarmId(envDevice1.getFarmId());
|
|
|
+ fan.setFarmId(envDevic.getFarmId());
|
|
|
fan.setChipStatus(0);
|
|
|
fan.setFengType(2);
|
|
|
fan.setOther1(String.valueOf(i));
|
|
|
fanMapper.insert(fan);
|
|
|
j++;
|
|
|
}
|
|
|
- for (int i = 1; i < envDevice1.getXiaoChuangNum() + 1; i++) {
|
|
|
- EnvDeviceFenestrule fenestrulen = new EnvDeviceFenestrule();
|
|
|
- fenestrulen.setDeviceCode(envDevice1.getDeviceSortCode());
|
|
|
+ if (envDevic.getXiaoChuangNum() != null) {
|
|
|
+ for (int i = 1; i < envDevic.getXiaoChuangNum() + 1; i++) {
|
|
|
+ EnvDeviceFenestrule fenestrulen = new EnvDeviceFenestrule();
|
|
|
+ fenestrulen.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
|
|
|
- if (i < 10) {
|
|
|
- fenestrulen.setChipCode(envDevice1.getDeviceSortCode() + "120" + i);
|
|
|
- } else {
|
|
|
- fenestrulen.setChipCode(envDevice1.getDeviceSortCode() + "12" + i);
|
|
|
+ if (i < 10) {
|
|
|
+ fenestrulen.setChipCode(envDevic.getDeviceSortCode() + "120" + i);
|
|
|
+ } else {
|
|
|
+ fenestrulen.setChipCode(envDevic.getDeviceSortCode() + "12" + i);
|
|
|
+ }
|
|
|
+ fenestrulen.setFarmId(envDevic.getFarmId());
|
|
|
+ fenestrulen.setChipStatus(0);
|
|
|
+ fenestrulen.setChipName("小窗" + i);
|
|
|
+ fenestrulen.setOther1(String.valueOf(i));
|
|
|
+ fenestruleMapper.insert(fenestrulen);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (envDevic.getShiLianNum() != null) {
|
|
|
+ for (int i = 1; i < envDevic.getShiLianNum() + 1; i++) {
|
|
|
+ EnvDevicePad devicePad = new EnvDevicePad();
|
|
|
+ devicePad.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
+ if (i < 10) {
|
|
|
+ devicePad.setChipCode(envDevic.getDeviceSortCode() + "200" + i);
|
|
|
+ } else {
|
|
|
+ devicePad.setChipCode(envDevic.getDeviceSortCode() + "20" + i);
|
|
|
+ }
|
|
|
+ devicePad.setFarmId(envDevic.getFarmId());
|
|
|
+ devicePad.setChipStatus(0);
|
|
|
+ devicePad.setChipName("湿帘" + i);
|
|
|
+ devicePad.setOther1(String.valueOf(i));
|
|
|
+ padMapper.insert(devicePad);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (envDevic.getDaoLiuBan() != null) {
|
|
|
+ for (int i = 1; i < envDevic.getDaoLiuBan() + 1; i++) {
|
|
|
+ EnvDeviceDeflector devicePad = new EnvDeviceDeflector();
|
|
|
+ devicePad.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
+ if (i < 10) {
|
|
|
+ devicePad.setChipCode(envDevic.getDeviceSortCode() + "210" + i);
|
|
|
+ } else {
|
|
|
+ devicePad.setChipCode(envDevic.getDeviceSortCode() + "21" + i);
|
|
|
+ }
|
|
|
+ devicePad.setFarmId(envDevic.getFarmId());
|
|
|
+ devicePad.setChipStatus(0);
|
|
|
+ devicePad.setChipName("导流板" + i);
|
|
|
+ devicePad.setOther1(String.valueOf(i));
|
|
|
+ deflectorMapper.insert(devicePad);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (envDevic.getPenWuNum() != null) {
|
|
|
+ for (int i = 1; i < envDevic.getPenWuNum() + 1; i++) {
|
|
|
+ EnvDeviceAtomizing devicePad = new EnvDeviceAtomizing();
|
|
|
+ devicePad.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
+ if (i < 10) {
|
|
|
+ devicePad.setChipCode(envDevic.getDeviceSortCode() + "220" + i);
|
|
|
+ } else {
|
|
|
+ devicePad.setChipCode(envDevic.getDeviceSortCode() + "22" + i);
|
|
|
+ }
|
|
|
+ devicePad.setFarmId(envDevic.getFarmId());
|
|
|
+ devicePad.setChipStatus(0);
|
|
|
+ devicePad.setChipName("喷雾" + i);
|
|
|
+ devicePad.setOther1(String.valueOf(i));
|
|
|
+ atomizingMapper.insert(devicePad);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (envDevic.getJiaReQiNum() != null) {
|
|
|
+ for (int i = 1; i < envDevic.getJiaReQiNum() + 1; i++) {
|
|
|
+ EnvDeviceHeater devicePad = new EnvDeviceHeater();
|
|
|
+ devicePad.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
+ if (i < 10) {
|
|
|
+ devicePad.setChipCode(envDevic.getDeviceSortCode() + "230" + i);
|
|
|
+ } else {
|
|
|
+ devicePad.setChipCode(envDevic.getDeviceSortCode() + "23" + i);
|
|
|
+ }
|
|
|
+ devicePad.setFarmId(envDevic.getFarmId());
|
|
|
+ devicePad.setChipStatus(0);
|
|
|
+ devicePad.setChipName("加热器" + i);
|
|
|
+ devicePad.setOther1(String.valueOf(i));
|
|
|
+ heaterMapper.insert(devicePad);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (envDevic.getZhaoMingDengNum() != null) {
|
|
|
+ for (int i = 1; i < envDevic.getZhaoMingDengNum() + 1; i++) {
|
|
|
+ EnvDeviceFloodlight devicePad = new EnvDeviceFloodlight();
|
|
|
+ devicePad.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
+ if (i < 10) {
|
|
|
+ devicePad.setChipCode(envDevic.getDeviceSortCode() + "240" + i);
|
|
|
+ } else {
|
|
|
+ devicePad.setChipCode(envDevic.getDeviceSortCode() + "24" + i);
|
|
|
+ }
|
|
|
+ devicePad.setFarmId(envDevic.getFarmId());
|
|
|
+ devicePad.setChipStatus(0);
|
|
|
+ devicePad.setChipName("照明灯" + i);
|
|
|
+ devicePad.setOther1(String.valueOf(i));
|
|
|
+ floodlightMapper.insert(devicePad);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (envDevic.getChuChouNum() != null){
|
|
|
+ for (int i = 1; i < envDevic.getChuChouNum() + 1; i++) {
|
|
|
+ EnvDeviceChuchou devicePad = new EnvDeviceChuchou();
|
|
|
+ devicePad.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
+ if (i < 10) {
|
|
|
+ devicePad.setChipCode(envDevic.getDeviceSortCode() + "250" + i);
|
|
|
+ } else {
|
|
|
+ devicePad.setChipCode(envDevic.getDeviceSortCode() + "25" + i);
|
|
|
+ }
|
|
|
+ devicePad.setFarmId(envDevic.getFarmId());
|
|
|
+ devicePad.setChipStatus(0);
|
|
|
+ devicePad.setChipName("除臭" + i);
|
|
|
+ devicePad.setOther1(String.valueOf(i));
|
|
|
+ envDeviceChuchouMapper.insert(devicePad);
|
|
|
}
|
|
|
- fenestrulen.setFarmId(envDevice1.getFarmId());
|
|
|
- fenestrulen.setChipStatus(0);
|
|
|
- fenestrulen.setChipName("小窗" + i);
|
|
|
- fenestrulen.setOther1(String.valueOf(i));
|
|
|
- fenestruleMapper.insert(fenestrulen);
|
|
|
}
|
|
|
+ if (envDevic.getLiaoTaNum() != null) {
|
|
|
|
|
|
- for (int i = 1; i < envDevice1.getShiLianNum() + 1; i++) {
|
|
|
- EnvDevicePad devicePad = new EnvDevicePad();
|
|
|
- devicePad.setDeviceCode(envDevice1.getDeviceSortCode());
|
|
|
- if (i < 10) {
|
|
|
- devicePad.setChipCode(envDevice1.getDeviceSortCode() + "200" + i);
|
|
|
- } else {
|
|
|
- devicePad.setChipCode(envDevice1.getDeviceSortCode() + "20" + i);
|
|
|
- }
|
|
|
- devicePad.setFarmId(envDevice1.getFarmId());
|
|
|
- devicePad.setChipStatus(0);
|
|
|
- devicePad.setChipName("湿帘" + i);
|
|
|
- devicePad.setOther1(String.valueOf(i));
|
|
|
- padMapper.insert(devicePad);
|
|
|
- }
|
|
|
- for (int i = 1; i < envDevice1.getDaoLiuBan() + 1; i++) {
|
|
|
- EnvDeviceDeflector devicePad = new EnvDeviceDeflector();
|
|
|
- devicePad.setDeviceCode(envDevice1.getDeviceSortCode());
|
|
|
- if (i < 10) {
|
|
|
- devicePad.setChipCode(envDevice1.getDeviceSortCode() + "210" + i);
|
|
|
- } else {
|
|
|
- devicePad.setChipCode(envDevice1.getDeviceSortCode() + "21" + i);
|
|
|
- }
|
|
|
- devicePad.setFarmId(envDevice1.getFarmId());
|
|
|
- devicePad.setChipStatus(0);
|
|
|
- devicePad.setChipName("导流板" + i);
|
|
|
- devicePad.setOther1(String.valueOf(i));
|
|
|
- deflectorMapper.insert(devicePad);
|
|
|
- }
|
|
|
- for (int i = 1; i < envDevice1.getPenWuNum() + 1; i++) {
|
|
|
- EnvDeviceAtomizing devicePad = new EnvDeviceAtomizing();
|
|
|
- devicePad.setDeviceCode(envDevice1.getDeviceSortCode());
|
|
|
- if (i < 10) {
|
|
|
- devicePad.setChipCode(envDevice1.getDeviceSortCode() + "220" + i);
|
|
|
- } else {
|
|
|
- devicePad.setChipCode(envDevice1.getDeviceSortCode() + "22" + i);
|
|
|
- }
|
|
|
- devicePad.setFarmId(envDevice1.getFarmId());
|
|
|
- devicePad.setChipStatus(0);
|
|
|
- devicePad.setChipName("喷雾" + i);
|
|
|
- devicePad.setOther1(String.valueOf(i));
|
|
|
- atomizingMapper.insert(devicePad);
|
|
|
- }
|
|
|
- for (int i = 1; i < envDevice1.getJiaReQiNum() + 1; i++) {
|
|
|
- EnvDeviceHeater devicePad = new EnvDeviceHeater();
|
|
|
- devicePad.setDeviceCode(envDevice1.getDeviceSortCode());
|
|
|
- if (i < 10) {
|
|
|
- devicePad.setChipCode(envDevice1.getDeviceSortCode() + "230" + i);
|
|
|
- } else {
|
|
|
- devicePad.setChipCode(envDevice1.getDeviceSortCode() + "23" + i);
|
|
|
- }
|
|
|
- devicePad.setFarmId(envDevice1.getFarmId());
|
|
|
- devicePad.setChipStatus(0);
|
|
|
- devicePad.setChipName("加热器" + i);
|
|
|
- devicePad.setOther1(String.valueOf(i));
|
|
|
- heaterMapper.insert(devicePad);
|
|
|
- }
|
|
|
- for (int i = 1; i < envDevice1.getZhaoMingDengNum() + 1; i++) {
|
|
|
- EnvDeviceFloodlight devicePad = new EnvDeviceFloodlight();
|
|
|
- devicePad.setDeviceCode(envDevice1.getDeviceSortCode());
|
|
|
- if (i < 10) {
|
|
|
- devicePad.setChipCode(envDevice1.getDeviceSortCode() + "240" + i);
|
|
|
- } else {
|
|
|
- devicePad.setChipCode(envDevice1.getDeviceSortCode() + "24" + i);
|
|
|
+ for (int i = 1; i < envDevic.getLiaoTaNum() + 1; i++) {
|
|
|
+ EnvDeviceLiaota devicePad = new EnvDeviceLiaota();
|
|
|
+ devicePad.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
+ if (i < 10) {
|
|
|
+ devicePad.setChipCode(envDevic.getDeviceSortCode() + "260" + i);
|
|
|
+ } else {
|
|
|
+ devicePad.setChipCode(envDevic.getDeviceSortCode() + "26" + i);
|
|
|
+ }
|
|
|
+ devicePad.setFarmId(envDevic.getFarmId());
|
|
|
+ devicePad.setChipStatus(0);
|
|
|
+ devicePad.setChipName("料塔" + i);
|
|
|
+ devicePad.setOther1(String.valueOf(i));
|
|
|
+ envDeviceLiaotaMapper.insert(devicePad);
|
|
|
}
|
|
|
- devicePad.setFarmId(envDevice1.getFarmId());
|
|
|
- devicePad.setChipStatus(0);
|
|
|
- devicePad.setChipName("照明灯" + i);
|
|
|
- devicePad.setOther1(String.valueOf(i));
|
|
|
- floodlightMapper.insert(devicePad);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
for (int i = 1; i < 6; i++) {
|
|
|
EnvDeviceOther other = new EnvDeviceOther();
|
|
|
- other.setDeviceCode(envDevice1.getDeviceSortCode());
|
|
|
- other.setChipCode(envDevice1.getDeviceSortCode() + "13" + i);
|
|
|
- other.setFarmId(envDevice1.getFarmId());
|
|
|
+ other.setDeviceCode(envDevic.getDeviceSortCode());
|
|
|
+ other.setChipCode(envDevic.getDeviceSortCode() + "13" + i);
|
|
|
+ other.setFarmId(envDevic.getFarmId());
|
|
|
if (i == 1) {
|
|
|
other.setChipName("照明");
|
|
|
}
|
|
@@ -479,12 +513,6 @@ public class EnvDeviceServiceImpl extends ServiceImpl<EnvDeviceMapper, EnvDevice
|
|
|
|
|
|
}
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
- String farm = "1000" + 01;
|
|
|
- System.out.println(farm);
|
|
|
- String farm2 = String.valueOf((Integer.valueOf(farm) + 9));
|
|
|
- System.out.println(farm2);
|
|
|
- }
|
|
|
|
|
|
@Override
|
|
|
public Result edit(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
@@ -576,6 +604,14 @@ public class EnvDeviceServiceImpl extends ServiceImpl<EnvDeviceMapper, EnvDevice
|
|
|
queryWrapper16.eq("device_code", deviceCode).eq("farm_id", farmId);
|
|
|
recentlyDataMapper.delete(queryWrapper16);//
|
|
|
|
|
|
+ QueryWrapper<EnvDeviceChuchou> queryWrapper17 = new QueryWrapper<>();
|
|
|
+ queryWrapper17.eq("device_code", deviceCode).eq("farm_id", farmId);
|
|
|
+ envDeviceChuchouMapper.delete(queryWrapper17);//除臭
|
|
|
+
|
|
|
+ QueryWrapper<EnvDeviceLiaota> queryWrapper18 = new QueryWrapper<>();
|
|
|
+ queryWrapper18.eq("device_code", deviceCode).eq("farm_id", farmId);
|
|
|
+ envDeviceLiaotaMapper.delete(queryWrapper18);//料塔
|
|
|
+
|
|
|
QueryWrapper<EnvDeviceOther> queryWrapper10 = new QueryWrapper<>();
|
|
|
queryWrapper10.eq("device_code", deviceCode).eq("farm_id", farmId);
|
|
|
otherMapper.delete(queryWrapper10);//其他
|