|
@@ -1,6 +1,11 @@
|
|
|
package com.izouma.awesomeadmin.service.impl;
|
|
package com.izouma.awesomeadmin.service.impl;
|
|
|
|
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
+
|
|
|
|
|
+import com.izouma.awesomeadmin.dao.AimTemplateArMapper;
|
|
|
|
|
+import com.izouma.awesomeadmin.dao.ArContentMapper;
|
|
|
|
|
+import com.izouma.awesomeadmin.model.AimTemplateAr;
|
|
|
|
|
+import com.izouma.awesomeadmin.model.ArContent;
|
|
|
import org.apache.log4j.Logger;
|
|
import org.apache.log4j.Logger;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -11,42 +16,49 @@ import com.izouma.awesomeadmin.service.AimPlaceInfoService;
|
|
|
import com.izouma.awesomeadmin.dao.AimPlaceInfoMapper;
|
|
import com.izouma.awesomeadmin.dao.AimPlaceInfoMapper;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
-* service接口实现类
|
|
|
|
|
-*/
|
|
|
|
|
|
|
+ * service接口实现类
|
|
|
|
|
+ */
|
|
|
@Service
|
|
@Service
|
|
|
-public class AimPlaceInfoServiceImpl implements AimPlaceInfoService{
|
|
|
|
|
|
|
+public class AimPlaceInfoServiceImpl implements AimPlaceInfoService {
|
|
|
|
|
|
|
|
private static Logger logger = Logger.getLogger(AimPlaceInfoServiceImpl.class);
|
|
private static Logger logger = Logger.getLogger(AimPlaceInfoServiceImpl.class);
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private AimPlaceInfoMapper aimPlaceInfoMapper;
|
|
private AimPlaceInfoMapper aimPlaceInfoMapper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private AimTemplateArMapper aimTemplateArMapper;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ArContentMapper arContentMapper;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public List<AimPlaceInfo> getAimPlaceInfoList(AimPlaceInfo record) {
|
|
public List<AimPlaceInfo> getAimPlaceInfoList(AimPlaceInfo record) {
|
|
|
|
|
|
|
|
logger.info("getAimPlaceInfoList");
|
|
logger.info("getAimPlaceInfoList");
|
|
|
try {
|
|
try {
|
|
|
|
|
|
|
|
- return aimPlaceInfoMapper.queryAllAimPlaceInfo(record);
|
|
|
|
|
|
|
+ return aimPlaceInfoMapper.queryAllAimPlaceInfo(record);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- logger.error("getAimPlaceInfoList", e);
|
|
|
|
|
|
|
+ logger.error("getAimPlaceInfoList", e);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public List<AimPlaceInfo> getAimPlaceInfoByPage(Page page, AimPlaceInfo record) {
|
|
public List<AimPlaceInfo> getAimPlaceInfoByPage(Page page, AimPlaceInfo record) {
|
|
|
|
|
|
|
|
logger.info("getAimPlaceInfoByPage");
|
|
logger.info("getAimPlaceInfoByPage");
|
|
|
try {
|
|
try {
|
|
|
|
|
|
|
|
- Map<String, Object> parameter = new HashMap<String, Object>();
|
|
|
|
|
- parameter.put("record", record);
|
|
|
|
|
- parameter.put(AppConstant.PAGE, page);
|
|
|
|
|
|
|
+ Map<String, Object> parameter = new HashMap<String, Object>();
|
|
|
|
|
+ parameter.put("record", record);
|
|
|
|
|
+ parameter.put(AppConstant.PAGE, page);
|
|
|
|
|
|
|
|
- return aimPlaceInfoMapper.queryAimPlaceInfoByPage(parameter);
|
|
|
|
|
|
|
+ return aimPlaceInfoMapper.queryAimPlaceInfoByPage(parameter);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- logger.error("getAimPlaceInfoByPage", e);
|
|
|
|
|
|
|
+ logger.error("getAimPlaceInfoByPage", e);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
return null;
|
|
@@ -60,7 +72,7 @@ public class AimPlaceInfoServiceImpl implements AimPlaceInfoService{
|
|
|
|
|
|
|
|
return aimPlaceInfoMapper.selectByPrimaryKey(Integer.valueOf(id));
|
|
return aimPlaceInfoMapper.selectByPrimaryKey(Integer.valueOf(id));
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- logger.error("getAimPlaceInfoById", e);
|
|
|
|
|
|
|
+ logger.error("getAimPlaceInfoById", e);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
return null;
|
|
@@ -74,7 +86,7 @@ public class AimPlaceInfoServiceImpl implements AimPlaceInfoService{
|
|
|
|
|
|
|
|
return aimPlaceInfoMapper.queryAimPlaceInfo(record);
|
|
return aimPlaceInfoMapper.queryAimPlaceInfo(record);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- logger.error("getAimPlaceInfo", e);
|
|
|
|
|
|
|
+ logger.error("getAimPlaceInfo", e);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
return null;
|
|
@@ -89,7 +101,30 @@ public class AimPlaceInfoServiceImpl implements AimPlaceInfoService{
|
|
|
int updates = aimPlaceInfoMapper.insertSelective(record);
|
|
int updates = aimPlaceInfoMapper.insertSelective(record);
|
|
|
|
|
|
|
|
if (updates > 0) {
|
|
if (updates > 0) {
|
|
|
- return true;
|
|
|
|
|
|
|
+ AimTemplateAr param = new AimTemplateAr();
|
|
|
|
|
+ param.setTemplateAimId(record.getTemplateAimId());
|
|
|
|
|
+
|
|
|
|
|
+ List<AimTemplateAr> aimTemplateArList = aimTemplateArMapper.queryAllAimTemplateAr(param);
|
|
|
|
|
+ if (aimTemplateArList.size() > 0) {
|
|
|
|
|
+
|
|
|
|
|
+ for (AimTemplateAr aimTemplateAr : aimTemplateArList) {
|
|
|
|
|
+ ArContent arContent = new ArContent();
|
|
|
|
|
+ arContent.setName(aimTemplateAr.getArName());
|
|
|
|
|
+ arContent.setType(aimTemplateAr.getArType());
|
|
|
|
|
+ arContent.setActivationMode(aimTemplateAr.getActivationMode());
|
|
|
|
|
+ arContent.setAreaId(record.getAreaId());
|
|
|
|
|
+ arContent.setThingId(record.getThingId());
|
|
|
|
|
+ arContent.setAimGroupId(String.valueOf(record.getAimGroupId()));
|
|
|
|
|
+ arContent.setAimPlaceId(String.valueOf(record.getId()));
|
|
|
|
|
+ arContent.setTemplateId(aimTemplateAr.getTemplateId());
|
|
|
|
|
+ arContent.setTemplateAimId(String.valueOf(aimTemplateAr.getTemplateAimId()));
|
|
|
|
|
+ arContent.setTemplateArId(String.valueOf(aimTemplateAr.getId()));
|
|
|
|
|
+
|
|
|
|
|
+ arContentMapper.insertSelective(arContent);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
logger.error("createAimPlaceInfo", e);
|
|
logger.error("createAimPlaceInfo", e);
|
|
@@ -104,13 +139,13 @@ public class AimPlaceInfoServiceImpl implements AimPlaceInfoService{
|
|
|
logger.info("deleteAimPlaceInfo");
|
|
logger.info("deleteAimPlaceInfo");
|
|
|
try {
|
|
try {
|
|
|
|
|
|
|
|
- int updates = aimPlaceInfoMapper.delete(record);
|
|
|
|
|
|
|
+ int updates = aimPlaceInfoMapper.delete(record);
|
|
|
|
|
|
|
|
if (updates > 0) {
|
|
if (updates > 0) {
|
|
|
- return true;
|
|
|
|
|
|
|
+ return true;
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- logger.error("deleteAimPlaceInfo", e);
|
|
|
|
|
|
|
+ logger.error("deleteAimPlaceInfo", e);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
return false;
|
|
@@ -125,10 +160,10 @@ public class AimPlaceInfoServiceImpl implements AimPlaceInfoService{
|
|
|
int updates = aimPlaceInfoMapper.updateByPrimaryKeySelective(record);
|
|
int updates = aimPlaceInfoMapper.updateByPrimaryKeySelective(record);
|
|
|
|
|
|
|
|
if (updates > 0) {
|
|
if (updates > 0) {
|
|
|
- return true;
|
|
|
|
|
|
|
+ return true;
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- logger.error("updateAimPlaceInfo", e);
|
|
|
|
|
|
|
+ logger.error("updateAimPlaceInfo", e);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
return false;
|