diff --git a/psdc-business/lib/dntd-common-1.0-SNAPSHOT.jar b/psdc-business/lib/dntd-common-1.0-SNAPSHOT.jar index 8e7fa26..e69de29 100644 Binary files a/psdc-business/lib/dntd-common-1.0-SNAPSHOT.jar and b/psdc-business/lib/dntd-common-1.0-SNAPSHOT.jar differ diff --git a/psdc-business/lib/dntd-model-buildheating-1.0-SNAPSHOT.jar b/psdc-business/lib/dntd-model-buildheating-1.0-SNAPSHOT.jar index 756fecd..e69de29 100644 Binary files a/psdc-business/lib/dntd-model-buildheating-1.0-SNAPSHOT.jar and b/psdc-business/lib/dntd-model-buildheating-1.0-SNAPSHOT.jar differ diff --git a/psdc-business/lib/dntd-model-heatboiler-1.0-SNAPSHOT.jar b/psdc-business/lib/dntd-model-heatboiler-1.0-SNAPSHOT.jar index d8f0809..e69de29 100644 Binary files a/psdc-business/lib/dntd-model-heatboiler-1.0-SNAPSHOT.jar and b/psdc-business/lib/dntd-model-heatboiler-1.0-SNAPSHOT.jar differ diff --git a/psdc-business/lib/dntd-modelI-1.0-SNAPSHOT.jar b/psdc-business/lib/dntd-modelI-1.0-SNAPSHOT.jar index ed88bd3..e69de29 100644 Binary files a/psdc-business/lib/dntd-modelI-1.0-SNAPSHOT.jar and b/psdc-business/lib/dntd-modelI-1.0-SNAPSHOT.jar differ diff --git a/psdc-business/lib/dntd-tool-1.0-SNAPSHOT.jar b/psdc-business/lib/dntd-tool-1.0-SNAPSHOT.jar index d87b833..e69de29 100644 Binary files a/psdc-business/lib/dntd-tool-1.0-SNAPSHOT.jar and b/psdc-business/lib/dntd-tool-1.0-SNAPSHOT.jar differ diff --git a/psdc-business/lib/lib.rar b/psdc-business/lib/lib.rar new file mode 100644 index 0000000..e69de29 diff --git a/psdc-business/src/main/java/com/psdc/entity/SysDeviceHeatScene.java b/psdc-business/src/main/java/com/psdc/entity/SysDeviceHeatScene.java new file mode 100644 index 0000000..24b7271 --- /dev/null +++ b/psdc-business/src/main/java/com/psdc/entity/SysDeviceHeatScene.java @@ -0,0 +1,39 @@ +package com.psdc.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class SysDeviceHeatScene { + //设备id + private String id; + //设备类型 + private String devType; + //设备细类 + private String devSubType; + //技术类型 + private String devTechType; + //热效率 + private Double heatEfficiency; + //设备功率 + private Double devPower; + //设备单价 + private Double devPrice; + // 电替代设备年人工费用 + private Double devSubstituteLaborCost; + // 原设备的人工费用 + private Double laborCost ; + //单台设备可参考供暖面积 + private Double devReferenceArea; + //设备使用年限 + private Integer devServiceLife; + //设备年运行时长 + private Integer devAnnualOperationTime; + //备注 + private String remark; + + +} diff --git a/psdc-business/src/main/java/com/psdc/mapper/SysDeviceHeatSceneMapper.java b/psdc-business/src/main/java/com/psdc/mapper/SysDeviceHeatSceneMapper.java new file mode 100644 index 0000000..b557b1e --- /dev/null +++ b/psdc-business/src/main/java/com/psdc/mapper/SysDeviceHeatSceneMapper.java @@ -0,0 +1,26 @@ +package com.psdc.mapper; + +import com.psdc.entity.SysDeviceHeatScene; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * @Author:戴仕崑 + * @Project:psdc + * @Filename:SysDeviceHeatSceneMapper + * @Slogan 致敬大师,致敬未来的你 + * @Date:2024/2/20 14:53 + * @Version 1.0 + */ +@Mapper +public interface SysDeviceHeatSceneMapper { + + /** + * 查询建筑供暖场景下所有设备 + * @return 设备列表 + */ + List selAllDevices(); + + +} diff --git a/psdc-business/src/main/java/com/psdc/service/model/IBuildHeatingService.java b/psdc-business/src/main/java/com/psdc/service/model/IBuildHeatingService.java index 0f637fd..3537230 100644 --- a/psdc-business/src/main/java/com/psdc/service/model/IBuildHeatingService.java +++ b/psdc-business/src/main/java/com/psdc/service/model/IBuildHeatingService.java @@ -3,6 +3,8 @@ package com.psdc.service.model; import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; +import java.util.List; + /** * @Author:戴仕崑 * @Project:psdc @@ -13,7 +15,9 @@ import cn.hutool.json.JSONObject; */ public interface IBuildHeatingService { - JSONObject exeModel2Report(JSONArray devSpecList, JSONObject jsonObject, String key); + JSONObject exeModel2Report(JSONObject jsonObject, String key); + + List selAllDevices(); } diff --git a/psdc-business/src/main/java/com/psdc/service/model/impl/BuildHeatingServiceImpl.java b/psdc-business/src/main/java/com/psdc/service/model/impl/BuildHeatingServiceImpl.java index 19c4fe5..53ac6dd 100644 --- a/psdc-business/src/main/java/com/psdc/service/model/impl/BuildHeatingServiceImpl.java +++ b/psdc-business/src/main/java/com/psdc/service/model/impl/BuildHeatingServiceImpl.java @@ -3,9 +3,13 @@ package com.psdc.service.model.impl; import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import com.dky.tool.ModelTool; +import com.psdc.mapper.SysDeviceHeatSceneMapper; import com.psdc.service.model.IBuildHeatingService; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; + /** * @Author:戴仕崑 * @Project:psdc @@ -17,13 +21,27 @@ import org.springframework.stereotype.Service; @Service public class BuildHeatingServiceImpl implements IBuildHeatingService { + @Resource + SysDeviceHeatSceneMapper deviceHeatSceneMapper; @Override - public JSONObject exeModel2Report(JSONArray devSpecList, JSONObject param, String key) { - JSONObject list = new JSONObject(); - list.put("devSpecList",devSpecList); - new ModelTool(list); + public JSONObject exeModel2Report(JSONObject param, String key) { + JSONObject jsonObject = null; + try{ + JSONObject list = new JSONObject(); + list.put("devSpecList",deviceHeatSceneMapper.selAllDevices()); + new ModelTool(list); + jsonObject = ModelTool.exeModel2Report(param, key); - return ModelTool.exeModel2Report(param, key); + } catch (Exception e){ + e.printStackTrace(); + } + return jsonObject; } + + @Override + public List selAllDevices() { + return deviceHeatSceneMapper.selAllDevices(); + } + } diff --git a/psdc-business/src/main/resources/mapper/business/SysDeviceHeatSceneMapper.xml b/psdc-business/src/main/resources/mapper/business/SysDeviceHeatSceneMapper.xml new file mode 100644 index 0000000..82ddcd8 --- /dev/null +++ b/psdc-business/src/main/resources/mapper/business/SysDeviceHeatSceneMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/psdc-web/src/main/java/com/psdc/controller/model/BuildHeatingController.java b/psdc-web/src/main/java/com/psdc/controller/model/BuildHeatingController.java index 6e8a9e9..22d2439 100644 --- a/psdc-web/src/main/java/com/psdc/controller/model/BuildHeatingController.java +++ b/psdc-web/src/main/java/com/psdc/controller/model/BuildHeatingController.java @@ -4,19 +4,14 @@ import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import com.dky.utils.entity.SysDeviceHeatScene; import com.psdc.core.domain.AjaxResult; -import com.psdc.entity.SecretKey; import com.psdc.service.model.IBuildHeatingService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; -import java.text.SimpleDateFormat; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Optional; /** * @Author:戴仕崑 @@ -35,15 +30,19 @@ public class BuildHeatingController { @PostMapping("/getReport") public AjaxResult getGenerateKey(@RequestBody Map requestBody) { - List devSpecList = (List) requestBody.get("devSpecList"); - JSONArray objects = new JSONArray(); - objects.addAll(devSpecList); HashMap param = (HashMap) requestBody.get("param"); JSONObject jsonObject = new JSONObject(); jsonObject.putAll(param); String key = (String) requestBody.get("key"); AjaxResult ajax = AjaxResult.success(); - ajax.put("report", buildHeatingService.exeModel2Report(objects, jsonObject, key)); + ajax.put("report", buildHeatingService.exeModel2Report(jsonObject, key)); + return ajax; + } + + @GetMapping("/selAllDevices") + public AjaxResult selAllDevices(){ + AjaxResult ajax = AjaxResult.success(); + ajax.put("data", buildHeatingService.selAllDevices()); return ajax; }