lizijie
2019-07-10 e97c393e23f4c015a44b5fef5fd26ae288bc6c0f
src/main/java/com/moral/service/impl/HistoryServiceImpl.java
@@ -30,10 +30,10 @@
import com.moral.entity.Sensor;
import com.moral.mapper.DeviceMapper;
import com.moral.mapper.HistoryMapper;
import com.moral.mapper.ProfessionMapper;
import com.moral.mapper.SensorMapper;
import com.moral.service.AccountService;
import com.moral.service.HistoryService;
import com.moral.service.ProfessionService;
@Service
public class HistoryServiceImpl implements HistoryService {
@@ -51,7 +51,7 @@
   private SensorMapper sensorMapper;
    @Resource
    private ProfessionMapper professionMapper;
    private ProfessionService professionService;
   @Override
   public Map<String, Object> getAllSensorAverageByDevice(Map<String, Object> parameters) throws Exception {
@@ -111,6 +111,7 @@
      ValidateUtil.notNull(parameters.get("accountId"), "param.is.null");
      String regionCode = parameters.get("regionCode").toString();
      parameters.put("provinceCode", regionCode.substring(0,2).concat("0000"));
      String regionType = "village";
      String nextLevel = "";
      if (regionCode.length() == 6) {
@@ -139,7 +140,7 @@
      String column = "value";
      if ("month".equals(timeType)) {
         if (1 != localDate.getDayOfMonth()) {
            table = "history_minutely";
            table = "history_daily";
            column = "json";
         }
         parameters.put("start", localDate.with(TemporalAdjusters.firstDayOfMonth()));
@@ -168,7 +169,7 @@
         }
      }
      if ("profession".equals(parameters.get("dimension"))) {
         List<Profession> professions = professionMapper.selectAll();
         List<Profession> professions = professionService.getProfessiontList(parameters);
         for (Map<String, Object> map : result) {
            for (Profession profession : professions) {
               if (map.get("name").equals(profession.getName())) {