|
@@ -169,6 +169,7 @@ public class LampConfigServiceImpl extends ServiceImpl<LampConfigMapper, LampCon
|
|
lampConfig.setTempSet(temp);
|
|
lampConfig.setTempSet(temp);
|
|
|
|
|
|
lampConfig.setAgeList(dayAgeListStr.toString());
|
|
lampConfig.setAgeList(dayAgeListStr.toString());
|
|
|
|
+ lampConfig.setDayAge(initDayAge);
|
|
UpdateWrapper<LampConfig> wrapper = new UpdateWrapper<>();
|
|
UpdateWrapper<LampConfig> wrapper = new UpdateWrapper<>();
|
|
if (StringUtils.isBlank(id)){
|
|
if (StringUtils.isBlank(id)){
|
|
LampConfigAll lampConfigAll = new LampConfigAll();
|
|
LampConfigAll lampConfigAll = new LampConfigAll();
|
|
@@ -226,20 +227,25 @@ public class LampConfigServiceImpl extends ServiceImpl<LampConfigMapper, LampCon
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Result updateLamp(Map<String, Object> map, HttpServletRequest request) {
|
|
public Result updateLamp(Map<String, Object> map, HttpServletRequest request) {
|
|
- Integer uploadStart = (Integer) map.get("uploadStart");
|
|
|
|
|
|
+ Boolean uploadStart = (Boolean) map.get("uploadStart");
|
|
String id = (String) map.get("id");
|
|
String id = (String) map.get("id");
|
|
String unitId = (String)map.get("unitId");
|
|
String unitId = (String)map.get("unitId");
|
|
LampConfig lampConfig = new LampConfig();
|
|
LampConfig lampConfig = new LampConfig();
|
|
- lampConfig.setUploadStart(uploadStart);
|
|
|
|
|
|
+ if (uploadStart){
|
|
|
|
+ lampConfig.setUploadStart(1);
|
|
|
|
+ }else {
|
|
|
|
+ lampConfig.setUploadStart(0);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(unitId)){
|
|
if (ObjectUtil.isNotEmpty(unitId)){
|
|
- if (uploadStart ==1 && lampConfigMapper.exists(new QueryWrapper<LampConfig>().isNull("temp_set").eq("unit_id",unitId))) {
|
|
|
|
|
|
+ if (uploadStart && lampConfigMapper.exists(new QueryWrapper<LampConfig>().isNull("temp_set").eq("unit_id",unitId))) {
|
|
return new Result(10001,"有设备未配置,请先进行配置",false);
|
|
return new Result(10001,"有设备未配置,请先进行配置",false);
|
|
|
|
|
|
}
|
|
}
|
|
lampConfigMapper.update(lampConfig,new QueryWrapper<LampConfig>().eq("unit_id",unitId));
|
|
lampConfigMapper.update(lampConfig,new QueryWrapper<LampConfig>().eq("unit_id",unitId));
|
|
}else {
|
|
}else {
|
|
- if (uploadStart ==1 && lampConfigMapper.exists(new QueryWrapper<LampConfig>().isNull("temp_set").eq("id",id))) {
|
|
|
|
|
|
+ if (uploadStart && lampConfigMapper.exists(new QueryWrapper<LampConfig>().isNull("temp_set").eq("id",id))) {
|
|
return new Result(10001,"设备未配置,请先进行配置",false);
|
|
return new Result(10001,"设备未配置,请先进行配置",false);
|
|
|
|
|
|
}
|
|
}
|