diff --git a/epmet-cloud-generator/src/main/resources/template/Controller.java.vm b/epmet-cloud-generator/src/main/resources/template/Controller.java.vm index 5caa046..81b4ab9 100644 --- a/epmet-cloud-generator/src/main/resources/template/Controller.java.vm +++ b/epmet-cloud-generator/src/main/resources/template/Controller.java.vm @@ -39,7 +39,7 @@ public class ${className}Controller { return new Result>().ok(page); } - @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) public Result<${className}DTO> get(@PathVariable("id") String id){ ${className}DTO data = ${classname}Service.get(id); return new Result<${className}DTO>().ok(data); @@ -63,7 +63,7 @@ public class ${className}Controller { return new Result(); } - @PostMapping("delete") + @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) public Result delete(@RequestBody String[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/PowerAxisStructDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/PowerAxisStructDTO.java index b503092..6a476d2 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/PowerAxisStructDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/PowerAxisStructDTO.java @@ -1,12 +1,14 @@ package com.epmet.plugin.power.dto.axis; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; + import lombok.Data; /** - * 动力主轴结构 + * 动力主轴结构 * * @author generator generator@elink-cn.com * @since v1.0.0 2022-04-18 @@ -19,81 +21,90 @@ public class PowerAxisStructDTO implements Serializable { /** * 主键 */ - private String id; + private String id; /** * 客户ID */ - private String customerId; + private String customerId; /** * 名称 */ - private String name; + private String name; /** * 绑定组织主键 */ - private String agencyId; + private String agencyId; /** * 绑定组织名称 */ - private String agencyName; + private String agencyName; /** * 绑定组织类别编码 */ - private String agencyType; + private String agencyType; /** * 上级主键 */ - private String pid; + private String pid; /** * 上级主键路径 全部上级主键,以:拼接 */ - private String pids; + private String pids; + + private BigDecimal longitude; + + private BigDecimal latitude; /** * 类别编码 */ - private String categoryCode; + private String categoryCode; /** * 排序 正序 */ - private Integer sort; + private Integer sort; + + /** + * 对应节点等级 0,1,2 + */ + private Integer structLevel; /** * 删除标识 0.未删除 1.已删除 */ - private String delFlag; + private String delFlag; /** * 乐观锁 */ - private Integer revision; + private Integer revision; /** * 创建人 */ - private String createdBy; + private String createdBy; /** * 创建时间 */ - private Date createdTime; + private Date createdTime; /** * 更新人 */ - private String updatedBy; + private String updatedBy; /** * 更新时间 */ - private Date updatedTime; + private Date updatedTime; } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/PowerKernelHouseholdDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/PowerKernelHouseholdDTO.java index 3e70505..4df180c 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/PowerKernelHouseholdDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/PowerKernelHouseholdDTO.java @@ -42,6 +42,16 @@ public class PowerKernelHouseholdDTO implements Serializable { */ private String ownerName; + /** + * 户主ID + */ + private String ownerIdCard; + + /** + * 户主电话 + */ + private String ownerPhone; + /** * 房屋ID */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisLeaderDetailFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisLeaderDetailFormDTO.java index 8d5e9d4..688e551 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisLeaderDetailFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisLeaderDetailFormDTO.java @@ -6,4 +6,5 @@ import lombok.Data; public class PowerAxisLeaderDetailFormDTO { private String axisStructId; private String leaderId; + private String customerId; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisListPositionFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisListPositionFormDTO.java new file mode 100644 index 0000000..cc2622f --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisListPositionFormDTO.java @@ -0,0 +1,10 @@ +package com.epmet.plugin.power.dto.axis.form; + +import lombok.Data; + +@Data +public class PowerAxisListPositionFormDTO { + private String tagCategory; + private String customerId; + private int structLevel; +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisServiceStationFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisServiceStationFormDTO.java new file mode 100644 index 0000000..e5a8626 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisServiceStationFormDTO.java @@ -0,0 +1,10 @@ +package com.epmet.plugin.power.dto.axis.form; + +import lombok.Data; + +@Data +public class PowerAxisServiceStationFormDTO { + private String axisStructId; + private int limit; + private String customerId; +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructFormDTO.java index 67e2e62..94965aa 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructFormDTO.java @@ -7,7 +7,8 @@ import lombok.NoArgsConstructor; @Data @NoArgsConstructor @AllArgsConstructor -public class PowerAxisStructFormDTO{ +public class PowerAxisStructFormDTO { private String agencyId; private String name; + private String customerId; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructListByCategoryCodeFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructListByCategoryCodeFormDTO.java index 3123ec9..c71c9ec 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructListByCategoryCodeFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructListByCategoryCodeFormDTO.java @@ -6,4 +6,5 @@ import lombok.Data; public class PowerAxisStructListByCategoryCodeFormDTO { private String agencyId; private String categoryCode; + private String customerId; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructStructTreeFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructStructTreeFormDTO.java index 9915db5..90e8a0a 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructStructTreeFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructStructTreeFormDTO.java @@ -5,4 +5,5 @@ import lombok.Data; @Data public class PowerAxisStructStructTreeFormDTO { private String agencyId; + private String customerId; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructViewFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructViewFormDTO.java index 81fd549..8d89707 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructViewFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructViewFormDTO.java @@ -4,5 +4,6 @@ import lombok.Data; @Data public class PowerAxisStructViewFormDTO { + private String customerId; private String agencyId; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelHouseHoldViewListFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelHouseHoldViewListFormDTO.java index 6177579..7ab0648 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelHouseHoldViewListFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelHouseHoldViewListFormDTO.java @@ -7,4 +7,5 @@ public class PowerKernelHouseHoldViewListFormDTO { private String axisStructId; private int pageNo; private int pageSize; + private String customerId; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java index a6b2dbc..f1b677b 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java @@ -6,4 +6,5 @@ import lombok.Data; public class PowerKernelListPostitionFormDTO { private String axisStructId; private int limit; + private String customerId; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/StructLeaderBindFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/StructLeaderBindFormDTO.java new file mode 100644 index 0000000..942c29d --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/StructLeaderBindFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.plugin.power.dto.axis.form; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class StructLeaderBindFormDTO implements Serializable { + + private static final long serialVersionUID = 523592353978009455L; + + /** + * 节点ID + */ + @NotBlank(message = "绑定节点不能为空") + private String axisStructId; + + /** + * 负责人ID + */ + @NotBlank(message = "绑定负责人不能为空") + private String leaderId; + + /** + * 负责人类别 + */ + @NotBlank(message = "负责人类别不能为空") + private String categoryCode; + + + private String customerId; +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/StructLeaderBriefFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/StructLeaderBriefFormDTO.java new file mode 100644 index 0000000..372d0ee --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/StructLeaderBriefFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.plugin.power.dto.axis.form; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class StructLeaderBriefFormDTO implements Serializable { + + private static final long serialVersionUID = 523592353978009455L; + + /** + * 节点级别 + */ + @NotBlank(message = "节点级别不能为空") + private int structLevel; + + /** + * 节点ID + */ + @NotBlank(message = "绑定节点不能为空") + private String axisStructId; + + /** + * 手机号或姓名 + */ + private String keyWord; + + private String customerId; +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisLeaderDetailResultDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisLeaderDetailResultDTO.java index 0f118d4..839ac2c 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisLeaderDetailResultDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisLeaderDetailResultDTO.java @@ -7,7 +7,7 @@ public class PowerAxisLeaderDetailResultDTO { private String name; private String gender; private String mobile; - private String introduction; + private String interoduction; private String categoryName; private String avatar; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisListPositionResultDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisListPositionResultDTO.java new file mode 100644 index 0000000..0e0257c --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisListPositionResultDTO.java @@ -0,0 +1,11 @@ +package com.epmet.plugin.power.dto.axis.result; + +import lombok.Data; + +@Data +public class PowerAxisListPositionResultDTO { + private String axisStructId; + private String longitude; + private String latitude; + private String axisStructName; +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisServiceStationResultDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisServiceStationResultDTO.java new file mode 100644 index 0000000..d2aedcf --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisServiceStationResultDTO.java @@ -0,0 +1,11 @@ +package com.epmet.plugin.power.dto.axis.result; + +import lombok.Data; + +@Data +public class PowerAxisServiceStationResultDTO { + private String stationId; + private String longitude; + private String latitude; + private String address; +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisSimpleListDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisSimpleListDTO.java index 58ae108..c87ce5a 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisSimpleListDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisSimpleListDTO.java @@ -2,8 +2,12 @@ package com.epmet.plugin.power.dto.axis.result; import lombok.Data; +import java.io.Serializable; + @Data -public class PowerAxisSimpleListDTO { +public class PowerAxisSimpleListDTO implements Serializable { + + private static final long serialVersionUID = 1760957932589482970L; private String id; private String name; private String mobile; diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisStructTreeResultDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisStructTreeResultDTO.java index 5ca4d17..b966866 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisStructTreeResultDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisStructTreeResultDTO.java @@ -3,8 +3,13 @@ package com.epmet.plugin.power.dto.axis.result; import com.epmet.commons.tools.utils.TreeNode; import lombok.Data; +import java.io.Serializable; + @Data -public class PowerAxisStructTreeResultDTO extends TreeNode { +public class PowerAxisStructTreeResultDTO extends TreeNode implements Serializable { + + private static final long serialVersionUID = 5859286638629746692L; + private Long id; private Long pid; private String name; diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/enums/PowerTagCategoryEnum.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/enums/PowerTagCategoryEnum.java index 7e42bd6..b29d263 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/enums/PowerTagCategoryEnum.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/enums/PowerTagCategoryEnum.java @@ -12,6 +12,10 @@ public enum PowerTagCategoryEnum { * 动力主轴负责人 */ LEADER("leader"), + /** + * 默认参数 + */ + PARAM("param"), /** * 动力主轴节点 */ diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml index 46166db..770b347 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml @@ -223,8 +223,8 @@ - epmet - elink@833066 + epmet_pli_power_user + EpmEt-db-UsEr 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/ViewController/PowerAxisStructViewController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/ViewController/PowerAxisStructViewController.java deleted file mode 100644 index 6403727..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/ViewController/PowerAxisStructViewController.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.epmet.plugin.power.modules.axis.ViewController; - -import com.epmet.commons.tools.utils.Result; -import com.epmet.plugin.power.dto.axis.form.PowerAxisLeaderDetailFormDTO; - -import com.epmet.plugin.power.dto.axis.form.PowerAxisStructStructTreeFormDTO; -import com.epmet.plugin.power.dto.axis.form.PowerAxisStructViewFormDTO; -import com.epmet.plugin.power.dto.axis.result.PowerAxisLeaderDetailResultDTO; -import com.epmet.plugin.power.dto.axis.result.PowerAxisStructResultDTO; -import com.epmet.plugin.power.dto.axis.result.PowerAxisStructTreeResultDTO; -import com.epmet.plugin.power.dto.axis.result.PowerAxisStructViewResultDTO; -import com.epmet.plugin.power.modules.axis.service.PowerAxisLeaderService; -import com.epmet.plugin.power.modules.axis.service.PowerAxisStructService; -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 java.util.List; - -@RestController -@RequestMapping("/data/axis") -public class PowerAxisStructViewController { - - @Autowired - private PowerAxisStructService powerAxisStructService; - - @Autowired - private PowerAxisLeaderService powerAxisLeaderService; - - /** - * 关键指标统计 - */ - @PostMapping("/statistics") - public Result getStatistics(@RequestBody PowerAxisStructViewFormDTO form){ - PowerAxisStructViewResultDTO result = powerAxisStructService.getStatistics(form); - return new Result().ok(result); - } - - /** - * 动力主轴负责人详细信息 - */ - @PostMapping("/leader") - public Result getLeaderDetail(@RequestBody PowerAxisLeaderDetailFormDTO form){ - PowerAxisLeaderDetailResultDTO dto = powerAxisLeaderService.getLeaderDetail(form); - return new Result().ok(dto); - } - - /** - *动力主轴结构树 - */ - @PostMapping("/structTree") - public Result getStructTree(@RequestBody PowerAxisStructStructTreeFormDTO form){ - List dto = powerAxisStructService.getStructTree(form); - return new Result().ok(dto); - } -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/ViewController/PowerAxiskernelHouseholdViewController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/ViewController/PowerAxiskernelHouseholdViewController.java deleted file mode 100644 index 5c9caf7..0000000 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/ViewController/PowerAxiskernelHouseholdViewController.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.epmet.plugin.power.modules.axis.ViewController; - -import com.epmet.commons.tools.utils.Result; -import com.epmet.plugin.power.dto.axis.ResultDTO; -import com.epmet.plugin.power.dto.axis.form.PowerKernelHouseHoldViewListFormDTO; -import com.epmet.plugin.power.dto.axis.form.PowerKernelListPostitionFormDTO; -import com.epmet.plugin.power.dto.axis.result.PowerKernelHouseHoldViewListResultDTO; -import com.epmet.plugin.power.dto.axis.result.PowerKernelListPostitionResultDTO; -import com.epmet.plugin.power.modules.axis.service.PowerKernelHouseholdService; -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 java.util.List; - - -@RestController -@RequestMapping("/data/kernelHousehold") -public class PowerAxiskernelHouseholdViewController { - - @Autowired - private PowerKernelHouseholdService powerKernelHouseholdService; - - - /** - * 党员中心户列表 - */ - @PostMapping("/list") - public ResultDTO getList(@RequestBody PowerKernelHouseHoldViewListFormDTO form){ - PowerKernelHouseHoldViewListResultDTO dto = powerKernelHouseholdService.getList(form); - return ResultDTO.success("查询成功",dto,powerKernelHouseholdService.getTotal(form)); - } - /** - * 党员中心户坐标集合 - */ - @PostMapping("/listPosition") - public ResultDTO getListPosition(@RequestBody PowerKernelListPostitionFormDTO form){ - List dto = powerKernelHouseholdService.getListPosition(form); - return ResultDTO.success("成功",dto,powerKernelHouseholdService.getListTotal(form)); - } -} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java new file mode 100644 index 0000000..7841605 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java @@ -0,0 +1,138 @@ +package com.epmet.plugin.power.modules.axis.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.plugin.power.dto.axis.ResultDTO; +import com.epmet.plugin.power.dto.axis.form.*; +import com.epmet.plugin.power.dto.axis.result.*; +import com.epmet.plugin.power.modules.axis.service.PowerAxisLeaderService; +import com.epmet.plugin.power.modules.axis.service.PowerAxisStructService; +import com.epmet.plugin.power.modules.axis.service.PowerKernelHouseholdService; +import com.epmet.plugin.power.modules.axis.service.PowerServiceStationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Random; +import java.util.UUID; + +/*** + * 动力主轴相关数据可视化接口 + * @author work@yujt.net.cn + * @date 2022/4/23/0023 10:27 + */ +@RestController +@RequestMapping("data") +public class PowerAxisDataVisualController { + + @Autowired + private PowerAxisStructService powerAxisStructService; + + @Autowired + private PowerAxisLeaderService powerAxisLeaderService; + + @Autowired + private PowerServiceStationService powerServiceStationService; + + @Autowired + private PowerKernelHouseholdService powerKernelHouseholdService; + + /** + * 党群服务站集合坐标 + * + * @param form + * @return com.epmet.plugin.power.dto.axis.ResultDTO + * @author LZN + * @date 2022/4/22 19:53 + */ + @PostMapping("serviceStation/listPosition") + public ResultDTO getListPostition(@RequestBody PowerAxisServiceStationFormDTO form) { + List list = powerServiceStationService.getListPosition(form); + return ResultDTO.success("成功", list, powerServiceStationService.queryTotal(form)); + } + + /** + * 关键指标统计 + * + * @param form + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/4/23 10:20 + */ + @PostMapping("axis/statistics") + public Result getStatistics(@RequestBody PowerAxisStructViewFormDTO form) { + PowerAxisStructViewResultDTO result = powerAxisStructService.getStatistics(form); + return new Result().ok(result); + } + + /** + * 动力主轴负责人详细信息 + * + * @param form + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/4/23 10:20 + */ + @PostMapping("axis/leader") + public Result getLeaderDetail(@RequestBody PowerAxisLeaderDetailFormDTO form) { + PowerAxisLeaderDetailResultDTO dto = powerAxisLeaderService.getLeaderDetail(form); + return new Result().ok(dto); + } + + /** + * 动力主轴结构树 + * + * @param form + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/4/23 10:20 + */ + @PostMapping("axis/structTree") + public Result getStructTree(@RequestBody PowerAxisStructStructTreeFormDTO form) { + List dto = powerAxisStructService.getStructTree(form); + return new Result().ok(dto); + } + + /** + * 动力主轴节点坐标集合 + * + * @param structLevel + * @return com.epmet.plugin.power.dto.axis.ResultDTO + * @author LZN + * @date 2022/4/23 10:19 + */ + @PostMapping("axis/{structLevel}/listPosition") + public ResultDTO getListPosition(@PathVariable int structLevel) { + List list = powerAxisStructService.getListPosition(structLevel); + return ResultDTO.success("成功", list, powerAxisStructService.queryTotal(structLevel)); + } + + + /** + * 党员中心户列表 + * + * @param form + * @return com.epmet.plugin.power.dto.axis.ResultDTO + * @author LZN + * @date 2022/4/23 10:20 + */ + @PostMapping("kernelHousehold/list") + public ResultDTO getList(@RequestBody PowerKernelHouseHoldViewListFormDTO form) { + List dto = powerKernelHouseholdService.getList(form); + return ResultDTO.success("查询成功", dto, powerKernelHouseholdService.getTotal(form)); + } + + /** + * 党员中心户坐标集合 + * + * @param form + * @return com.epmet.plugin.power.dto.axis.ResultDTO + * @author LZN + * @date 2022/4/23 10:20 + */ + @PostMapping("kernelHousehold/listPosition") + public ResultDTO getListPosition(@RequestBody PowerKernelListPostitionFormDTO form) { + List dto = powerKernelHouseholdService.getListPosition(form); + return ResultDTO.success("成功", dto, powerKernelHouseholdService.getListTotal(form)); + } + +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java index 071c933..250a4f8 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java @@ -1,9 +1,10 @@ package com.epmet.plugin.power.modules.axis.controller; - +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -15,7 +16,6 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.plugin.power.dto.axis.PowerAxisStructDTO; import com.epmet.plugin.power.dto.axis.form.PowerAxisStructLeaderFormDTO; -import com.epmet.plugin.power.dto.axis.form.PowerAxisStructListByCategoryCodeFormDTO; import com.epmet.plugin.power.dto.axis.result.*; import com.epmet.plugin.power.dto.axis.form.PowerAxisStructFormDTO; import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity; @@ -30,7 +30,7 @@ import java.util.Map; /** - * 动力主轴结构 + * 动力主轴结构 * * @author generator generator@elink-cn.com * @since v1.0.0 2022-04-18 @@ -43,21 +43,22 @@ public class PowerAxisStructController { private PowerAxisStructService powerAxisStructService; @RequestMapping("page") - public Result> page(@RequestParam Map params){ + public Result> page(@RequestParam Map params) { PageData page = powerAxisStructService.page(params); return new Result>().ok(page); } - @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id) { PowerAxisStructDTO data = powerAxisStructService.get(id); return new Result().ok(data); } @NoRepeatSubmit @PostMapping("save") - public Result save(@RequestBody PowerAxisStructDTO dto){ + public Result save(@RequestBody PowerAxisStructDTO dto, @LoginUser TokenDto tokenDto) { //效验数据 + dto.setCustomerId(tokenDto.getCustomerId()); ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); powerAxisStructService.save(dto); return new Result(); @@ -65,15 +66,16 @@ public class PowerAxisStructController { @NoRepeatSubmit @PostMapping("update") - public Result update(@RequestBody PowerAxisStructDTO dto){ + public Result update(@RequestBody PowerAxisStructDTO dto, @LoginUser TokenDto tokenDto) { //效验数据 + dto.setCustomerId(tokenDto.getCustomerId()); ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); powerAxisStructService.update(dto); return new Result(); } @PostMapping("delete") - public Result delete(@RequestBody String[] ids){ + public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); powerAxisStructService.delete(ids); @@ -98,90 +100,47 @@ public class PowerAxisStructController { public Result> selectAllForTree(@RequestBody PowerAxisStructLeaderFormDTO formDto) { return new Result().ok(powerAxisStructService.selectAllForTree(formDto)); } + /** * 根据名字查询 */ @PostMapping("/queryDeptByName") - public Result queryDeptByName(@RequestBody PowerAxisStructFormDTO form){ + public Result queryDeptByName(@RequestBody PowerAxisStructFormDTO form) { List result = powerAxisStructService.queryDeptByName(form); return new Result>().ok(result); } - /** - * 获取树状列表 - */ - @PostMapping("/getTreeList") - public Result queryList(){ - List list = powerAxisStructService.queryList(); - return new Result>().ok(list); - } - /** - * 添加组织 - */ - @PostMapping("/addOrg") - public Result addOrg(@RequestBody PowerAxisStructEntity form){ - powerAxisStructService.addOrg(form); - return new Result(); - } - /** - * 修改组织 - */ - @PostMapping("/modifyOrg") - public Result modifyOrg(@RequestBody PowerAxisStructEntity form){ - powerAxisStructService.modifyRog(form); - return new Result(); - } - /** * 根据id删除 */ @PostMapping("/deleteById/{id}") - public Result deleteById(@PathVariable String id){ + public Result deleteById(@PathVariable String id) { powerAxisStructService.delete(id); return new Result(); } - /** - * 获取上级网格党支部 - */ - @PostMapping("/GridPartyBranchList") - public Result> getGridPartyBranchList(){ - List list = powerAxisStructService.getGridPartyBranchList(); - return new Result>().ok(list); - } /** - * 获取上级组织 + * 根据节点接报,组装其上级节点树 + * + * @param structLevel 节点级别 + * @param tokenDto 登录用户 + * @return com.epmet.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2022/4/23/0023 14:44 */ - @PostMapping("/getPartyCommList") - public Result> getPartyCommList(){ - List list = powerAxisStructService.getPartyCommList(); - return new Result>().ok(list); + @PostMapping("bylevel/{structLevel}/parenttree") + public Result listParentTreeByLevel(@PathVariable String structLevel, @LoginUser TokenDto tokenDto) { + return new Result().ok(powerAxisStructService.listParentTreeByLevel(structLevel, tokenDto.getCustomerId())); } - /** - * 查询父id - */ - @PostMapping("/getPid") - public Result> getPid(){ - List pid = powerAxisStructService.getPid(); - return new Result>().ok(pid); - } /** * 根据id查询修改表单数据 */ @PostMapping("/queryModifyById/{id}") - public Result queryModifyById(@PathVariable String id){ + public Result queryModifyById(@PathVariable String id) { PowerAxisStructEntity power = powerAxisStructService.queryModifyById(id); return new Result().ok(power); } - /** - * 按节点类型获取节点列表 - */ - @PostMapping("/listByCategoryCode") - public Result getListByCategoryCode(@RequestBody PowerAxisStructListByCategoryCodeFormDTO form){ - List dto = powerAxisStructService.getListByCategoryCode(form); - return new Result().ok(dto); - } } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructLeaderController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructLeaderController.java index 9f3e7f8..213d2d4 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructLeaderController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructLeaderController.java @@ -1,7 +1,9 @@ package com.epmet.plugin.power.modules.axis.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -10,6 +12,9 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.plugin.power.dto.axis.PowerAxisStructLeaderDTO; +import com.epmet.plugin.power.dto.axis.form.StructLeaderBindFormDTO; +import com.epmet.plugin.power.dto.axis.form.StructLeaderBriefFormDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisSimpleListDTO; import com.epmet.plugin.power.modules.axis.excel.PowerAxisStructLeaderExcel; import com.epmet.plugin.power.modules.axis.service.PowerAxisStructLeaderService; import org.springframework.beans.factory.annotation.Autowired; @@ -21,33 +26,33 @@ import java.util.Map; /** - * 动力主轴负责人关系 + * 动力主轴负责人关系 * * @author generator generator@elink-cn.com * @since v1.0.0 2022-04-19 */ @RestController -@RequestMapping("powerAxisStructLeader") +@RequestMapping("axisstructleader") public class PowerAxisStructLeaderController { @Autowired private PowerAxisStructLeaderService powerAxisStructLeaderService; @RequestMapping("page") - public Result> page(@RequestParam Map params){ + public Result> page(@RequestParam Map params) { PageData page = powerAxisStructLeaderService.page(params); return new Result>().ok(page); } - @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ + @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) + public Result get(@PathVariable("id") String id) { PowerAxisStructLeaderDTO data = powerAxisStructLeaderService.get(id); return new Result().ok(data); } @NoRepeatSubmit @PostMapping("save") - public Result save(@RequestBody PowerAxisStructLeaderDTO dto){ + public Result save(@RequestBody PowerAxisStructLeaderDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); powerAxisStructLeaderService.save(dto); @@ -56,7 +61,7 @@ public class PowerAxisStructLeaderController { @NoRepeatSubmit @PostMapping("update") - public Result update(@RequestBody PowerAxisStructLeaderDTO dto){ + public Result update(@RequestBody PowerAxisStructLeaderDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); powerAxisStructLeaderService.update(dto); @@ -64,7 +69,7 @@ public class PowerAxisStructLeaderController { } @PostMapping("delete") - public Result delete(@RequestBody String[] ids){ + public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); powerAxisStructLeaderService.delete(ids); @@ -77,6 +82,34 @@ public class PowerAxisStructLeaderController { ExcelUtils.exportExcelToTarget(response, null, list, PowerAxisStructLeaderExcel.class); } + /** + * 查询当前组织下绑定的所有负责人 + * + * @param tokenDto 用户信息 + * @param formDto 查询条件 + * @return com.epmet.commons.tools.utils.Result> + * @author work@yujt.net.cn + * @date 2022/4/24/0024 19:35 + */ + @PostMapping("listbrief") + public Result> listLeaderByStructId(@LoginUser TokenDto tokenDto, @RequestBody StructLeaderBriefFormDTO formDto) { + return new Result().ok(powerAxisStructLeaderService.listLeaderByStructId(tokenDto, formDto)); + } + + /** + * 绑定节点负责人 + * + * @param tokenDto 用户信息 + * @param formDto 表单信息 + * @return com.epmet.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2022/4/25/0025 9:21 + */ + @PostMapping("bind") + public Result bindAxisStructLeader(@LoginUser TokenDto tokenDto, @RequestBody StructLeaderBindFormDTO formDto) { + powerAxisStructLeaderService.bindAxisStructLeader(tokenDto, formDto); + return new Result(); + } } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java index c8661b6..38379a3 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java @@ -1,7 +1,9 @@ package com.epmet.plugin.power.modules.axis.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -65,7 +67,7 @@ public class PowerAxisTagController { return new Result(); } - @PostMapping("delete") + @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); @@ -88,8 +90,8 @@ public class PowerAxisTagController { * @date 2022/4/18/0018 18:12 */ @PostMapping("listSimple/{tagCategory}") - public Result> listSimple(@PathVariable("tagCategory") String tagCategory) { - return new Result().ok(powerAxisTagService.listSimple(tagCategory)); + public Result> listSimple(@PathVariable("tagCategory") String tagCategory, @LoginUser TokenDto tokenDto) { + return new Result().ok(powerAxisTagService.listSimple(tagCategory, tokenDto.getCustomerId())); } /** diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerKernelHouseholdController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerKernelHouseholdController.java index 8ae80ea..12b2ef8 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerKernelHouseholdController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerKernelHouseholdController.java @@ -21,6 +21,7 @@ import com.epmet.plugin.power.modules.axis.excel.PowerKernelHouseholdExcel; import com.epmet.plugin.power.modules.axis.service.PowerKernelHouseholdService; import org.apache.commons.compress.utils.Lists; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; @@ -41,11 +42,7 @@ public class PowerKernelHouseholdController { @Autowired private PowerKernelHouseholdService powerKernelHouseholdService; - @Autowired - private GovOrgOpenFeignClient govOrgOpenFeignClient; - @Autowired - private LoginUserUtil loginUserUtil; @RequestMapping("page") public Result> page(@RequestParam Map params){ @@ -96,35 +93,7 @@ public class PowerKernelHouseholdController { */ @PostMapping("/bind") public Result Bind(@RequestBody PowerKernelHouseFormDTO form){ - String customerId = loginUserUtil.getLoginUserCustomerId(); - Set houseIds = new HashSet<>(); - Collections.addAll(houseIds,form.getHouseIdList()); - Result> listResult = govOrgOpenFeignClient.queryListHouseInfo(houseIds, customerId); - if(!listResult.success()){ - return listResult; - } - List houseList = listResult.getData(); - List list = Lists.newArrayList(); - PowerKernelHouseholdEntity entity; - - for(HouseInfoDTO houseInfo : houseList){ - Result icHouseDTOResult = govOrgOpenFeignClient.get(houseInfo.getHomeId()); - if(!icHouseDTOResult.success()){ - continue ; - } - IcHouseDTO houseDto = icHouseDTOResult.getData(); - entity = new PowerKernelHouseholdEntity(); - entity.setHouseId(houseInfo.getHomeId()); - entity.setLongitude(new BigDecimal(houseInfo.getBuildingLongitude())); - entity.setLatitude(new BigDecimal(houseInfo.getBuildingLatitude())); - entity.setAddress(houseInfo.getAllName()); - entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); - - entity.setOwnerPhone(houseDto.getOwnerPhone()); - entity.setOwnerIdCard(houseDto.getOwnerIdCard()); - entity.setOwnerName(houseDto.getOwnerName()); - powerKernelHouseholdService.insert(entity); - } + powerKernelHouseholdService.bind(form); return new Result(); } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisLeaderDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisLeaderDao.java index 45406cc..631fbd3 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisLeaderDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisLeaderDao.java @@ -21,7 +21,7 @@ import java.util.List; public interface PowerAxisLeaderDao extends BaseDao { - List getSimpleList(List ids); + List getSimpleList(List ids,String customerId); PowerAxisLeaderDetailResultDTO getLeaderDetail(PowerAxisLeaderDetailFormDTO form); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java index b16b37e..1f53238 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java @@ -7,6 +7,7 @@ import com.epmet.plugin.power.dto.axis.form.*; import com.epmet.plugin.power.dto.axis.result.*; import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -14,7 +15,7 @@ import java.util.Map; import java.util.List; /** - * 动力主轴结构 + * 动力主轴结构 * * @author generator generator@elink-cn.com * @since v1.0.0 2022-04-18 @@ -36,45 +37,81 @@ public interface PowerAxisStructDao extends BaseDao { */ List queryDeptByName(PowerAxisStructFormDTO form); - /** - * 获取树状列表 - */ - List queryList(); - void delete(String id); /** - * 获取上级网格党支部 + * 查询同组织下是否有同名的节点 + * + * @param customerId 客户ID + * @param name 节点名 + * @param agencyId 组织ID + * @param pid 上级节点 + * @return int + * @author work@yujt.net.cn + * @date 2022/4/23/0023 11:00 */ - List getGridPartyBranchList(); + int countRepeatStructByName(@Param("customerId") String customerId, + @Param("name") String name, + @Param("agencyId") String agencyId, + @Param("pid") String pid, + @Param("id") String id); /** - * 获取pid + * 查询同组织下是否有同级的节点 (主要用于一级节点判重) + * + * @param customerId 客户ID + * @param agencyId 组织ID + * @param categoryCode 节点级别编码(一级节点级别编码) + * @param id 主键 + * @return int + * @author work@yujt.net.cn + * @date 2022/4/23/0023 10:57 */ - List getPid(); + int countRepeatStructByCategory(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("categoryCode") String categoryCode, + @Param("id") String id); - /** - * 获取上级党委 - */ - List getPartyCommList(); + List getIdsByAgencyId(String agencyId, String customerId); + int queryGridParty(PowerAxisStructViewFormDTO form,String gridCateGoryCode); - int queryName(PowerAxisStructEntity form); + int queryGroupParty(PowerAxisStructViewFormDTO form,String groupCateGoryCode); - int queryCategory(PowerAxisStructEntity form); + int getKernelHouseHold(PowerAxisStructViewFormDTO form); - List getIdsByAgencyId(String agencyId); + int getServiceStation(PowerAxisStructViewFormDTO form); - List getListByCategoryCode(PowerAxisStructListByCategoryCodeFormDTO form); + List getStructTree(PowerAxisStructStructTreeFormDTO form); - int queryGridParty(PowerAxisStructViewFormDTO form); + String queryCategoryCode(PowerAxisListPositionFormDTO form); - int queryGroupParty(PowerAxisStructViewFormDTO form); + List querylistPosition(String customerId, String code); - int getKernelHouseHold(); - int getServiceStation(); + long queryTotal(String customerId, String code); - List getStructTree(PowerAxisStructStructTreeFormDTO form); + /** + * 根据节点接报,组装其上级节点树 + * + * @param structLevel 节点级别 + * @param customerId 客户ID + * @return java.util.List + * @author work@yujt.net.cn + * @date 2022/4/23/0023 14:38 + */ + List listParentTreeByLevel(@Param("structLevel") int structLevel, @Param("customerId") String customerId); + + /** + * 查询cateGoryCode + * + * @param customerId + * @param level + * @param tagCateGory + * @return java.lang.String + * @author LZN + * @date 2022/4/24 19:29 + */ + String getCateGoryCode(String customerId, int level, String tagCateGory); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructLeaderDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructLeaderDao.java index 20ec62a..db7c98a 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructLeaderDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructLeaderDao.java @@ -1,12 +1,17 @@ package com.epmet.plugin.power.modules.axis.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.dto.axis.form.StructLeaderBriefFormDTO; import com.epmet.plugin.power.dto.axis.result.PowerAxisSLeaderResultDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisSimpleListDTO; import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructLeaderEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** - * 动力主轴负责人关系 + * 动力主轴负责人关系 * * @author generator generator@elink-cn.com * @since v1.0.0 2022-04-19 @@ -14,5 +19,29 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface PowerAxisStructLeaderDao extends BaseDao { - PowerAxisSLeaderResultDTO queryLeaderDetailById(String axisStructId); + PowerAxisSLeaderResultDTO queryLeaderDetailById(String axisStructId, String customerId); + + /** + * 查询当前组织下绑定的所有负责人 + * + * @param formDto 查询条件 + * @return java.util.List + * @author work@yujt.net.cn + * @date 2022/4/24/0024 19:35 + */ + List listLeaderBriefByRootStructId(StructLeaderBriefFormDTO formDto); + + /** + * 删除节点负责人 + * + * @param customerId 客户ID + * @param axisStructId 节点ID + * @param leaderId 负责人ID + * @return void + * @author work@yujt.net.cn + * @date 2022/4/25/0025 9:16 + */ + void deleteStructLeader(@Param("customerId") String customerId, + @Param("axisStructId") String axisStructId, + @Param("leaderId") String leaderId); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java index 81f435b..ef10c7e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java @@ -4,6 +4,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.plugin.power.dto.axis.result.PowerAxisAllTagCategoryResultDTO; import com.epmet.plugin.power.modules.axis.entity.PowerAxisTagEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -24,4 +25,18 @@ public interface PowerAxisTagDao extends BaseDao { * @date 2022/4/19/0019 9:14 */ List listSimpleAll(); + + /** + * 根据ID查询节点等级 + * + * @param customerId 客户ID + * @param tagCategory 标签类别 + * @param axisStructId 节点ID + * @return int + * @author work@yujt.net.cn + * @date 2022/4/23/0023 15:42 + */ + Integer selectStructLevelById(@Param("customerId") String customerId, + @Param("tagCategory") String tagCategory, + @Param("axisStructId") String axisStructId); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerKernelHouseholdDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerKernelHouseholdDao.java index 2a50189..77add6e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerKernelHouseholdDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerKernelHouseholdDao.java @@ -10,6 +10,7 @@ import com.epmet.plugin.power.dto.axis.result.PowerKernelHouseHoldViewListResult import com.epmet.plugin.power.dto.axis.result.PowerKernelListPostitionResultDTO; import com.epmet.plugin.power.modules.axis.entity.PowerKernelHouseholdEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -23,11 +24,19 @@ import java.util.List; public interface PowerKernelHouseholdDao extends BaseDao { - PowerKernelHouseHoldViewListResultDTO getList(PowerKernelHouseHoldViewListFormDTO form); + List getList(PowerKernelHouseHoldViewListFormDTO form); long getTotal(PowerKernelHouseHoldViewListFormDTO form); - List getListPosition(PowerKernelListPostitionFormDTO form); + List getListPosition(PowerKernelListPostitionFormDTO form,List axisStructIds); long getListTotal(PowerKernelListPostitionFormDTO form); + + + List queryHouseIdList(String[] houseIdList, String customerId,String axisStructId); + + + List queryIds(String customerId, String axisStructId); + + List queryListPosition(String axisStructId, String customerId, int limit); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerServiceStationDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerServiceStationDao.java index 2caa14d..b20c58b 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerServiceStationDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerServiceStationDao.java @@ -2,9 +2,13 @@ package com.epmet.plugin.power.modules.axis.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.dto.axis.form.PowerAxisServiceStationFormDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisServiceStationResultDTO; import com.epmet.plugin.power.modules.axis.entity.PowerServiceStationEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 动力主轴党群服务站 * @@ -13,5 +17,8 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface PowerServiceStationDao extends BaseDao { - + + List getListPosition(PowerAxisServiceStationFormDTO form); + + long queryTotal(PowerAxisServiceStationFormDTO form); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/entity/PowerAxisLeaderEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/entity/PowerAxisLeaderEntity.java index 50f9293..0a2ae0f 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/entity/PowerAxisLeaderEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/entity/PowerAxisLeaderEntity.java @@ -51,4 +51,5 @@ public class PowerAxisLeaderEntity extends BaseEpmetEntity { */ private String avatar; + } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/entity/PowerAxisTagEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/entity/PowerAxisTagEntity.java index 2a9083a..6dd47d7 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/entity/PowerAxisTagEntity.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/entity/PowerAxisTagEntity.java @@ -6,7 +6,6 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; /** * 动力主轴标签 diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisLeaderService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisLeaderService.java index 7a71334..ebf4dec 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisLeaderService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisLeaderService.java @@ -81,11 +81,21 @@ public interface PowerAxisLeaderService extends BaseService + * @author LZN + * @date 2022/4/24 19:38 */ List getSimpleList(List ids); /** * 动力主轴负责人详细信息 + * + * @param form + * @return com.epmet.plugin.power.dto.axis.result.PowerAxisLeaderDetailResultDTO + * @author LZN + * @date 2022/4/24 19:38 */ PowerAxisLeaderDetailResultDTO getLeaderDetail(PowerAxisLeaderDetailFormDTO form); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructLeaderService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructLeaderService.java index 46e3f1b..d650592 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructLeaderService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructLeaderService.java @@ -2,15 +2,19 @@ package com.epmet.plugin.power.modules.axis.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.plugin.power.dto.axis.PowerAxisStructLeaderDTO; +import com.epmet.plugin.power.dto.axis.form.StructLeaderBindFormDTO; +import com.epmet.plugin.power.dto.axis.form.StructLeaderBriefFormDTO; import com.epmet.plugin.power.dto.axis.result.PowerAxisSLeaderResultDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisSimpleListDTO; import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructLeaderEntity; import java.util.List; import java.util.Map; /** - * 动力主轴负责人关系 + * 动力主轴负责人关系 * * @author generator generator@elink-cn.com * @since v1.0.0 2022-04-19 @@ -79,6 +83,33 @@ public interface PowerAxisStructLeaderService extends BaseService + * @author work@yujt.net.cn + * @date 2022/4/24/0024 19:35 + */ + List listLeaderByStructId(TokenDto tokenDto, StructLeaderBriefFormDTO formDto); + + /** + * 绑定节点负责人 + * + * @param tokenDto 用户信息 + * @param formDto 表单信息 + * @return void + * @author work@yujt.net.cn + * @date 2022/4/25/0025 9:21 + */ + void bindAxisStructLeader(TokenDto tokenDto, StructLeaderBindFormDTO formDto); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java index 30777cd..84d2489 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java @@ -12,7 +12,7 @@ import java.util.List; import java.util.Map; /** - * 动力主轴结构 + * 动力主轴结构 * * @author generator generator@elink-cn.com * @since v1.0.0 2022-04-18 @@ -84,11 +84,6 @@ public interface PowerAxisStructService extends BaseService queryDeptByName(PowerAxisStructFormDTO form); - /** - * 获取树状列表 - */ - List queryList(); - /** * 查询动力主轴全部机构,用于前端组装展示树 @@ -99,61 +94,67 @@ public interface PowerAxisStructService extends BaseService selectAllForTree(PowerAxisStructLeaderFormDTO formDto); - /** - * 添加组织 - */ - void addOrg(PowerAxisStructEntity form); - - /** - * 修改组织 - */ - void modifyRog(PowerAxisStructEntity form); - /** * 删除 + * * @param id */ void delete(String id); - /** - * 获取上级网格党支部 - */ - List getGridPartyBranchList(); - - /** - * 查询父id - * @return String - */ - List getPid(); - - /** - * 获取上级党委列表 - */ - List getPartyCommList(); - /** * 根据id查询修改表单数据 + * + * @param id + * @return com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity + * @author LZN + * @date 2022/4/24 19:39 */ PowerAxisStructEntity queryModifyById(String id); /** * 根据agencyId获取id列表 + * + * @param agencyId + * @return java.util.List + * @author LZN + * @date 2022/4/24 19:39 */ List getIdByAgencyId(String agencyId); /** - * 按节点类型获取节点列表 - */ - List getListByCategoryCode(PowerAxisStructListByCategoryCodeFormDTO form); - - /** + * * 关键指标统计 + * + * @param form + * @return com.epmet.plugin.power.dto.axis.result.PowerAxisStructViewResultDTO + * @author LZN + * @date 2022/4/24 19:40 */ PowerAxisStructViewResultDTO getStatistics(PowerAxisStructViewFormDTO form); /** * 树结构 + * + * @param form + * @return java.util.List + * @author LZN + * @date 2022/4/24 19:40 */ List getStructTree(PowerAxisStructStructTreeFormDTO form); + + List getListPosition(int structLevel); + + long queryTotal(int structLevel); + + /** + * 根据节点接报,组装其上级节点树 + * + * @param structLevel 节点级别 + * @param customerId 客户ID + * @return java.util.List + * @author work@yujt.net.cn + * @date 2022/4/23/0023 14:37 + */ + List listParentTreeByLevel(String structLevel, String customerId); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisTagService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisTagService.java index 3fd1d7a..decaebf 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisTagService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisTagService.java @@ -87,7 +87,7 @@ public interface PowerAxisTagService extends BaseService { * @author work@yujt.net.cn * @date 2022/4/18/0018 17:24 */ - List listSimple(String tagCategory); + List listSimple(String tagCategory, String customerId); /** * 查询所有标签 @@ -109,4 +109,16 @@ public interface PowerAxisTagService extends BaseService { * @date 2022/4/21/0021 17:21 */ int selectStructLevelByCode(String customerId, String tagCategory, String categoryCode); + + /** + * 根据ID查询节点等级 + * + * @param customerId 客户ID + * @param tagCategory 标签类别 + * @param axisStructId 节点ID + * @return java.lang.Integer + * @author work@yujt.net.cn + * @date 2022/4/23/0023 15:51 + */ + Integer selectStructLevelById(String customerId, String tagCategory, String axisStructId); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerKernelHouseholdService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerKernelHouseholdService.java index 7109d9e..080b8bc 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerKernelHouseholdService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerKernelHouseholdService.java @@ -86,7 +86,7 @@ public interface PowerKernelHouseholdService extends BaseService getList(PowerKernelHouseHoldViewListFormDTO form); long getTotal(PowerKernelHouseHoldViewListFormDTO form); /** @@ -95,4 +95,8 @@ public interface PowerKernelHouseholdService extends BaseService getListPosition(PowerKernelListPostitionFormDTO form); long getListTotal(PowerKernelListPostitionFormDTO form); + + void bind(PowerKernelHouseFormDTO form); + + } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerServiceStationService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerServiceStationService.java index 75eacd3..e503ba4 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerServiceStationService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerServiceStationService.java @@ -5,6 +5,8 @@ package com.epmet.plugin.power.modules.axis.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.plugin.power.dto.axis.PowerServiceStationDTO; +import com.epmet.plugin.power.dto.axis.form.PowerAxisServiceStationFormDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisServiceStationResultDTO; import com.epmet.plugin.power.modules.axis.entity.PowerServiceStationEntity; import java.util.List; @@ -77,4 +79,8 @@ public interface PowerServiceStationService extends BaseService getListPosition(PowerAxisServiceStationFormDTO form); + + long queryTotal(PowerAxisServiceStationFormDTO form); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisLeaderServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisLeaderServiceImpl.java index aec5228..70b91c6 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisLeaderServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisLeaderServiceImpl.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.plugin.power.dto.axis.PowerAxisLeaderDTO; import com.epmet.plugin.power.dto.axis.form.PowerAxisLeaderDetailFormDTO; @@ -39,6 +40,9 @@ public class PowerAxisLeaderServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -89,7 +93,9 @@ public class PowerAxisLeaderServiceImpl extends BaseServiceImpl getSimpleList(List ids) { - return baseDao.getSimpleList(ids); + String customerId = loginUserUtil.getLoginUserCustomerId(); + return baseDao.getSimpleList(ids, customerId); } @Override public PowerAxisLeaderDetailResultDTO getLeaderDetail(PowerAxisLeaderDetailFormDTO form) { + form.setCustomerId(loginUserUtil.getLoginUserCustomerId()); return baseDao.getLeaderDetail(form); } - private void delStructLeaderRelation(String customerId, String structId) { - LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); - lqw.eq(PowerAxisStructLeaderEntity::getStructReferenceId, structId) - .eq(PowerAxisStructLeaderEntity::getCustomerId, customerId); - powerAxisStructLeaderDao.delete(lqw); - } - private void addStructLeaderRelation(String customerId, String structId, String leaderId, String categoryCode) { PowerAxisStructLeaderEntity structLeader = new PowerAxisStructLeaderEntity(); structLeader.setCustomerId(customerId); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java index 84d8cd8..df73902 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java @@ -1,17 +1,32 @@ package com.epmet.plugin.power.modules.axis.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.enums.EpmetDelFlagEnum; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.plugin.power.dto.axis.form.StructLeaderBindFormDTO; +import com.epmet.plugin.power.dto.axis.form.StructLeaderBriefFormDTO; import com.epmet.plugin.power.dto.axis.result.PowerAxisSLeaderResultDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisSimpleListDTO; +import com.epmet.plugin.power.enums.PowerTagLevelEnum; +import com.epmet.plugin.power.modules.axis.dao.PowerAxisStructDao; import com.epmet.plugin.power.modules.axis.dao.PowerAxisStructLeaderDao; import com.epmet.plugin.power.dto.axis.PowerAxisStructLeaderDTO; +import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity; import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructLeaderEntity; import com.epmet.plugin.power.modules.axis.service.PowerAxisStructLeaderService; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -20,7 +35,7 @@ import java.util.List; import java.util.Map; /** - * 动力主轴负责人关系 + * 动力主轴负责人关系 * * @author generator generator@elink-cn.com * @since v1.0.0 2022-04-19 @@ -28,8 +43,11 @@ import java.util.Map; @Service public class PowerAxisStructLeaderServiceImpl extends BaseServiceImpl implements PowerAxisStructLeaderService { -// @Autowired -// private PowerAxisStructLeaderRedis powerAxisStructLeaderRedis; + @Autowired + private LoginUserUtil loginUserUtil; + + @Autowired + private PowerAxisStructDao powerAxisStructDao; @Override public PageData page(Map params) { @@ -47,8 +65,8 @@ public class PowerAxisStructLeaderServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -85,7 +103,48 @@ public class PowerAxisStructLeaderServiceImpl extends BaseServiceImpl listLeaderByStructId(TokenDto tokenDto, StructLeaderBriefFormDTO formDto) { + + int structLevel = formDto.getStructLevel(); + String axisStructId = formDto.getAxisStructId(); + String customerId = tokenDto.getCustomerId(); + String rootId; + if (PowerTagLevelEnum.ROOT.level() == structLevel) { + rootId = axisStructId; + } else { + + LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); + lqw.eq(PowerAxisStructEntity::getCustomerId, customerId) + .eq(PowerAxisStructEntity::getPid, axisStructId) + .eq(PowerAxisStructEntity::getDelFlag, EpmetDelFlagEnum.NORMAL.value()); + + PowerAxisStructEntity axisStructEntity = powerAxisStructDao.selectOne(lqw); + if (null == axisStructEntity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "节点匹配错误"); + } + + rootId = StringUtils.split(axisStructEntity.getPids(), StrConstant.COLON)[NumConstant.ZERO]; + } + + formDto.setCustomerId(customerId); + formDto.setAxisStructId(rootId); + return baseDao.listLeaderBriefByRootStructId(formDto); } + @Override + public void bindAxisStructLeader(TokenDto tokenDto, StructLeaderBindFormDTO formDto) { + baseDao.deleteStructLeader(formDto.getCustomerId(), formDto.getAxisStructId(), formDto.getLeaderId()); + + PowerAxisStructLeaderEntity structLeader = new PowerAxisStructLeaderEntity(); + structLeader.setCustomerId(formDto.getCustomerId()); + structLeader.setLeaderId(formDto.getLeaderId()); + structLeader.setStructReferenceId(formDto.getAxisStructId()); + structLeader.setCategoryCode(formDto.getCategoryCode()); + baseDao.insert(structLeader); + } } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java index ce016b5..c93c012 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java @@ -9,7 +9,6 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; -import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; @@ -91,15 +90,28 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl queryDeptByName(PowerAxisStructFormDTO form) { + String customerId = loginUserUtil.getLoginUserCustomerId(); + form.setCustomerId(customerId); List list = powerAxisStructDao.queryDeptByName(form); return list; } - @Override - public List queryList() { - List list = powerAxisStructDao.queryList(); - return list; - } - @Override public List selectAllForTree(PowerAxisStructLeaderFormDTO formDto) { return baseDao.selectAllForTree(formDto); } - @Override - public void addOrg(PowerAxisStructEntity form) { - int structLevel = powerAxisTagService.selectStructLevelByCode(loginUserUtil.getLoginUserCustomerId(), PowerTagCategoryEnum.STRUCT.category(), form.getCategoryCode()); + + // 验证表单字段 + private void verifyStructField(PowerAxisStructDTO structDto) { + String customerId = structDto.getCustomerId(); + String categoryCode = structDto.getCategoryCode(); + String agencyId = structDto.getAgencyId(); + Integer structLevel = structDto.getStructLevel(); + if (PowerTagLevelEnum.ROOT.level() == structLevel) { - if (baseDao.queryCategory(form) > NumConstant.ZERO) { + if (baseDao.countRepeatStructByCategory(customerId, agencyId, categoryCode, structDto.getId()) > NumConstant.ZERO) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下只允许存在一个顶级节点"); } + } else { + int parentStructLevel = powerAxisTagService.selectStructLevelById(customerId, PowerTagCategoryEnum.STRUCT.category(), structDto.getPid()); + if (structLevel - parentStructLevel > NumConstant.ONE) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "无法跨级添加节点"); + } } - if (baseDao.queryName(form) > NumConstant.ZERO) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下不允许存在重名的节点"); + if (baseDao.countRepeatStructByName(customerId, structDto.getName(), agencyId, structDto.getPid(), structDto.getId()) > NumConstant.ZERO) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一节点下不允许添加同名的子节点"); } - - this.assembleStruct(form, loginUserUtil.getLoginUserCustomerId()); - - baseDao.insert(form); } /** * 组装节点对象 * - * @param struct 提交的表单 - * @param customerId 客户ID + * @param struct 提交的表单 + * @param structLevel 节点级别 * @return void * @author work@yujt.net.cn * @date 2022/4/22/0022 14:04 */ - private void assembleStruct(PowerAxisStructEntity struct, String customerId) { - - struct.setCustomerId(customerId); + private void assembleStruct(PowerAxisStructEntity struct, int structLevel) { // 上级节点 String pid = struct.getPid(); - // 类别编码 - String categoryCode = struct.getCategoryCode(); if (StringUtils.isBlank(pid)) { // 查询类别编码对应的节点级别 - int structLevel = powerAxisTagService.selectStructLevelByCode(customerId, PowerTagCategoryEnum.STRUCT.category(), categoryCode); if (PowerTagLevelEnum.ROOT.level() == structLevel) { pid = NumConstant.ZERO_STR; } else { @@ -198,54 +207,11 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl NumConstant.ZERO) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下只允许存在一个顶级节点"); - } - } - if (baseDao.queryName(form) > NumConstant.ZERO) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "同一组织下不允许存在重名的节点"); - } - - this.assembleStruct(form, loginUserUtil.getLoginUserCustomerId()); - - baseDao.updateById(form); - } - -// private void - @Override public void delete(String id) { baseDao.delete(id); } - /** - * 获取上级网格党支部 - */ - @Override - public List getGridPartyBranchList() { - List list = baseDao.getGridPartyBranchList(); - return list; - } - - @Override - public List getPid() { - List pid = baseDao.getPid(); - return pid; - } - - @Override - public List getPartyCommList() { - List list = baseDao.getPartyCommList(); - return list; - } - @Override public PowerAxisStructEntity queryModifyById(String id) { PowerAxisStructEntity entity = baseDao.selectById(id); @@ -254,48 +220,106 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl getIdByAgencyId(String agencyId) { - List ids = baseDao.getIdsByAgencyId(agencyId); + String customerId = loginUserUtil.getLoginUserCustomerId(); + List ids = baseDao.getIdsByAgencyId(agencyId, customerId); return ids; } - /** - * 按节点类型获取节点列表 - */ - @Override - public List getListByCategoryCode(PowerAxisStructListByCategoryCodeFormDTO form) { - List dto = baseDao.getListByCategoryCode(form); - return dto; - } - @Override public PowerAxisStructViewResultDTO getStatistics(PowerAxisStructViewFormDTO form) { + form.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + // 查网格党支部数 grid_party - int gridParty = baseDao.queryGridParty(form); + String gridCateGoryCode = baseDao.getCateGoryCode(form.getCustomerId(),PowerTagLevelEnum.CHILD_FIRST.level(),PowerTagCategoryEnum.STRUCT.category()); + int gridParty = baseDao.queryGridParty(form,gridCateGoryCode); + // 查楼院党小组数 group_party - int groupParty = baseDao.queryGroupParty(form); + String groupCateGoryCode = baseDao.getCateGoryCode(form.getCustomerId(),PowerTagLevelEnum.CHILD_SECOND.level(),PowerTagCategoryEnum.STRUCT.category()); + int groupParty = baseDao.queryGroupParty(form,groupCateGoryCode); // 查询党员数 int partyNum = 0; // 查询党员中心户数 - int kernelHouseHold = baseDao.getKernelHouseHold(); + int kernelHouseHold = baseDao.getKernelHouseHold(form); // 查询服务站数 - int serviceStation = baseDao.getServiceStation(); + int serviceStation = baseDao.getServiceStation(form); // 查询志愿者队伍数 - int VolunteerTeamNum = 0; + int volunteerTeamNum = 0; + PowerAxisStructViewResultDTO result = new PowerAxisStructViewResultDTO(); result.setGridNum(gridParty); result.setGroupNum(groupParty); result.setPartyMemberNum(partyNum); result.setKernelHouseHoldNum(kernelHouseHold); result.setServiceStationNum(serviceStation); - result.setVolunteerTeamNum(VolunteerTeamNum); + result.setVolunteerTeamNum(volunteerTeamNum); + + + List tagList = powerAxisTagService.listSimple(PowerTagCategoryEnum.PARAM.category(), loginUserUtil.getLoginUserCustomerId()); + tagList.forEach( + item -> { + int numTemp; + switch (item.getCategoryCode()) { + case "volunteerTeamNum": + numTemp = Integer.parseInt(item.getCategoryName()); + if (numTemp > NumConstant.ZERO) { + result.setVolunteerTeamNum(numTemp); + } + break; + case "partyMemberNum": + numTemp = Integer.parseInt(item.getCategoryName()); + if (numTemp > NumConstant.ZERO) { + result.setPartyMemberNum(numTemp); + } + break; + case "kernelHouseHoldNum": + numTemp = Integer.parseInt(item.getCategoryName()); + if (numTemp > NumConstant.ZERO) { + result.setKernelHouseHoldNum(numTemp); + } + break; + default: + break; + } + } + ); + return result; } @Override public List getStructTree(PowerAxisStructStructTreeFormDTO form) { + form.setCustomerId(loginUserUtil.getLoginUserCustomerId()); List dto = baseDao.getStructTree(form); return TreeUtils.build(dto); } + @Override + public List getListPosition(int structLevel) { + PowerAxisListPositionFormDTO form = new PowerAxisListPositionFormDTO(); + String customerId = loginUserUtil.getLoginUserCustomerId(); + form.setCustomerId(customerId); + form.setStructLevel(structLevel); + form.setTagCategory(PowerTagCategoryEnum.STRUCT.category()); + String code = baseDao.queryCategoryCode(form); + List list = baseDao.querylistPosition(customerId, code); + return list; + } + + @Override + public long queryTotal(int structLevel) { + PowerAxisListPositionFormDTO form = new PowerAxisListPositionFormDTO(); + String customerId = loginUserUtil.getLoginUserCustomerId(); + form.setCustomerId(customerId); + form.setStructLevel(structLevel); + form.setTagCategory(PowerTagCategoryEnum.STRUCT.category()); + String code = baseDao.queryCategoryCode(form); + long total = baseDao.queryTotal(customerId, code); + return total; + } + @Override + public List listParentTreeByLevel(String structLevel, String customerId) { + List result = baseDao.listParentTreeByLevel(Integer.parseInt(structLevel), customerId); + return TreeUtils.build(result); + } } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java index 697415d..36ef95e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java @@ -36,9 +36,6 @@ import java.util.Map; @Service public class PowerAxisTagServiceImpl extends BaseServiceImpl implements PowerAxisTagService { -// @Autowired -// private PowerAxisTagRedis powerAxisTagRedis; - @Autowired private LoginUserUtil loginUserUtil; @@ -46,7 +43,7 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), + getPage(params, FieldConstant.CREATED_TIME, true), getWrapper(params) ); return getPageData(page, PowerAxisTagDTO.class); @@ -63,7 +60,8 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id) + .orderByAsc("TAG_CATEGORY", "STRUCT_LEVEL"); return wrapper; } @@ -78,6 +76,7 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl listSimple(String tagCategory) { + public List listSimple(String tagCategory, String customerId) { if (StringUtils.isBlank(tagCategory)) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "缺少参数"); @@ -105,7 +105,7 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq("TAG_CATEGORY", tagCategory) .eq("FORBIDDEN_FLAG", EpmetDelFlagEnum.NORMAL.value()) - .eq(FieldConstant.CUSTOMER_ID, loginUserUtil.getLoginUserCustomerId()) + .eq(FieldConstant.CUSTOMER_ID, customerId) .orderByAsc("STRUCT_LEVEL", FieldConstant.CREATED_TIME); return ConvertUtils.sourceToTarget(baseDao.selectList(wrapper), PowerAxisTagCategoryResultDTO.class); @@ -130,4 +130,9 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -54,11 +76,15 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + String axisStructId = (String) params.get("axisStructId"); + String ownerName = (String) params.get("ownerName"); QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id) + .eq(StringUtils.isNotBlank(axisStructId), "STRUCT_REFERENCE_ID", axisStructId) + .like(StringUtils.isNotBlank(ownerName), "OWNER_NAME", ownerName); return wrapper; } @@ -94,27 +120,83 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl getList(PowerKernelHouseHoldViewListFormDTO form) { form.setPageNo((form.getPageNo() - 1) * form.getPageSize()); - PowerKernelHouseHoldViewListResultDTO dto = baseDao.getList(form); + form.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + List dto = baseDao.getList(form); return dto; } @Override public long getTotal(PowerKernelHouseHoldViewListFormDTO form) { + form.setCustomerId(loginUserUtil.getLoginUserCustomerId()); return baseDao.getTotal(form); } @Override public List getListPosition(PowerKernelListPostitionFormDTO form) { - List dto = baseDao.getListPosition(form); - return dto; + return baseDao.queryListPosition(form.getAxisStructId(),form.getCustomerId(),form.getLimit()); } + @Override public long getListTotal(PowerKernelListPostitionFormDTO form) { + form.setCustomerId(loginUserUtil.getLoginUserCustomerId()); return baseDao.getListTotal(form); } + @Override + public void bind(PowerKernelHouseFormDTO form) { + String customerId = loginUserUtil.getLoginUserCustomerId(); + + // 查询出重复的houseId + List idList = baseDao.queryHouseIdList(form.getHouseIdList(), form.getAxisStructId(), customerId); + // 将idList转换为Set集合进行去重 + Set setIdList = new HashSet<>(); + for (String id : idList) { + setIdList.add(id); + } + // 将前端发送的houseId放入Set集合 + Set houseIds = new HashSet<>(); + Collections.addAll(houseIds, form.getHouseIdList()); + // 去重 + houseIds.removeAll(setIdList); + + Result> listResult = govOrgOpenFeignClient.queryListHouseInfo(houseIds, customerId); + if (!listResult.success()) { + return; + } + List houseList = listResult.getData(); + PowerKernelHouseholdEntity entity; + + for (HouseInfoDTO houseInfo : houseList) { + Result icHouseDTOResult = govOrgOpenFeignClient.get(houseInfo.getHomeId()); + if (!icHouseDTOResult.success()) { + continue; + } + IcHouseDTO houseDto = icHouseDTOResult.getData(); + entity = new PowerKernelHouseholdEntity(); + entity.setHouseId(houseInfo.getHomeId()); + + if (StringUtils.isNotBlank(houseInfo.getBuildingLatitude()) && StringUtils.isNotBlank(houseInfo.getBuildingLongitude())) { + entity.setLatitude(new BigDecimal(houseInfo.getBuildingLatitude())); + entity.setLongitude(new BigDecimal(houseInfo.getBuildingLongitude())); + } else { + entity.setLatitude(BigDecimal.ZERO); + entity.setLongitude(BigDecimal.ZERO); + } + entity.setAddress(houseInfo.getAllName()); + entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + + entity.setOwnerPhone(houseDto.getOwnerPhone()); + entity.setOwnerIdCard(houseDto.getOwnerIdCard()); + entity.setOwnerName(houseDto.getOwnerName()); + + entity.setStructReferenceId(form.getAxisStructId()); + + powerKernelHouseholdService.insert(entity); + } + } + } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerServiceStationServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerServiceStationServiceImpl.java index f8d9de1..25d9c99 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerServiceStationServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerServiceStationServiceImpl.java @@ -4,10 +4,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.plugin.power.dto.axis.PowerServiceStationDTO; +import com.epmet.plugin.power.dto.axis.form.PowerAxisServiceStationFormDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisServiceStationResultDTO; import com.epmet.plugin.power.modules.axis.dao.PowerServiceStationDao; import com.epmet.plugin.power.modules.axis.entity.PowerServiceStationEntity; import com.epmet.plugin.power.modules.axis.redis.PowerServiceStationRedis; @@ -33,6 +37,9 @@ public class PowerServiceStationServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -49,11 +56,15 @@ public class PowerServiceStationServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + String name = (String) params.get("name"); + String axisStructId = (String) params.get("axisStructId"); QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id) + .eq(StringUtils.isNotBlank(name), "NAME", name) + .eq(StringUtils.isNotBlank(axisStructId), "STRUCT_REFERENCE_ID", axisStructId); return wrapper; } @@ -67,6 +78,7 @@ public class PowerServiceStationServiceImpl extends BaseServiceImpl getListPosition(PowerAxisServiceStationFormDTO form) { + form.setCustomerId(loginUser.getLoginUserCustomerId()); + List list = baseDao.getListPosition(form); + return list; + } + + @Override + public long queryTotal(PowerAxisServiceStationFormDTO form) { + form.setCustomerId(loginUser.getLoginUserCustomerId()); + long total = baseDao.queryTotal(form); + return total; + } + } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/bootstrap.yml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/bootstrap.yml index 1737d89..66aedcd 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/bootstrap.yml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/bootstrap.yml @@ -82,7 +82,7 @@ mybatis-plus: #数据库相关配置 db-config: #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; - id-type: ASSIGN_ID + id-type: ASSIGN_UUID #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" field-strategy: NOT_NULL #驼峰下划线转换 diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/logback-spring.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/logback-spring.xml index eba24e9..2617816 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/logback-spring.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/logback-spring.xml @@ -143,7 +143,7 @@ - + diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisLeaderDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisLeaderDao.xml index c6953b0..a7cdb97 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisLeaderDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisLeaderDao.xml @@ -33,25 +33,32 @@ STRUCT_REFERENCE_ID = #{id} + and ppal.customer_id = #{customerId} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml index f2122c2..9e1f729 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml @@ -50,7 +50,7 @@ left join pli_power_axis_struct_leader sl on s.ID = sl.STRUCT_REFERENCE_ID left join pli_power_axis_leader l on l.ID = sl.LEADER_ID left join pli_power_axis_tag t on s.CATEGORY_CODE = t.CATEGORY_CODE - where s.DEL_FLAG = '0' + where s.DEL_FLAG = '0' and sl.del_flag = '0' and l.del_flag = '0' and s.AGENCY_ID = #{agencyId} @@ -84,83 +84,40 @@ and AGENCY_ID = #{agencyId} and del_flag = 0 + and customer_id = #{customerId} - - - - - SELECT count(*) FROM - pli_power_axis_struct + pli_power_axis_struct s WHERE - NAME = #{name} - AND - agency_id = #{agencyId} + s.CUSTOMER_ID = #{customerId} + AND s.`NAME` = #{name} + + AND s.AGENCY_ID = #{agencyId} + + + AND s.AGENCY_ID = (SELECT t.agency_id FROM pli_power_axis_struct t WHERE t.ID = #{pid}) + + + + AND s.ID != #{id} + AND s.pid = #{pid} - SELECT count(*) FROM pli_power_axis_struct WHERE - AGENCY_ID = #{agencyId} + AGENCY_ID = #{agencyId} and CUSTOMER_ID = #{customerId} and CATEGORY_CODE = #{categoryCode} + AND id != #{id} - + + + + + diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructLeaderDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructLeaderDao.xml index 44c7a36..6e85d26 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructLeaderDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructLeaderDao.xml @@ -16,6 +16,9 @@ + + delete from pli_power_axis_struct_leader where CUSTOMER_ID = #{customerId} and STRUCT_REFERENCE_ID = #{axisStructId} and LEADER_ID = #{leaderId} + + diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml index f3202cd..d0005b3 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml @@ -31,6 +31,20 @@ + \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerKernelHouseholdDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerKernelHouseholdDao.xml index 98f20a4..0c08a74 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerKernelHouseholdDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerKernelHouseholdDao.xml @@ -20,26 +20,22 @@ - + + + + + diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerServiceStationDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerServiceStationDao.xml index 8cafa10..2d81185 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerServiceStationDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerServiceStationDao.xml @@ -19,6 +19,31 @@ + + \ No newline at end of file