From 61cef1c9ea24a11b325ffc3a2027139c9c496361 Mon Sep 17 00:00:00 2001 From: HAHA Date: Tue, 19 Apr 2022 15:07:17 +0800 Subject: [PATCH] =?UTF-8?q?message:=20=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../axis/form/PowerAxisStructAddFormDTO.java | 51 +++++++++++++++++++ .../controller/PowerAxisStructController.java | 47 ++++++++++++++--- .../modules/axis/dao/PowerAxisStructDao.java | 22 +++++++- .../axis/service/PowerAxisStructService.java | 22 +++++++- .../impl/PowerAxisStructServiceImpl.java | 28 ++++++++++ .../src/main/resources/bootstrap.yml | 2 +- .../mapper/poweraxis/PowerAxisStructDao.xml | 48 +++++++++++++++++ 7 files changed, 210 insertions(+), 10 deletions(-) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructAddFormDTO.java diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructAddFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructAddFormDTO.java new file mode 100644 index 0000000..d6e3253 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructAddFormDTO.java @@ -0,0 +1,51 @@ +package com.epmet.plugin.power.dto.axis.form; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class PowerAxisStructAddFormDTO { + /** + * 客户ID + */ + private String customerId; + + /** + * 名称 + */ + private String name; + + /** + * 绑定组织主键 + */ + private String agencyId; + + /** + * 绑定组织名称 + */ + private String agencyName; + + /** + * 绑定组织类别编码 + */ + private String agencyType; + + /** + * 上级主键 + */ + private String pid; + + /** + * 类别编码 + */ + private String categoryCode; + + /** + * 排序 正序 + */ + private Integer sort; + +} 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 4fe6147..a79da6f 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,6 +1,7 @@ package com.epmet.plugin.power.modules.axis.controller; + import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ExcelUtils; @@ -15,8 +16,14 @@ 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.result.PowerAxisStructLeaderResultDTO; +import com.epmet.plugin.power.dto.axis.form.PowerAxisStructAddFormDTO; +import com.epmet.plugin.power.dto.axis.form.PowerAxisStructFormDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisStructListResultDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisStructResultDTO; +import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity; import com.epmet.plugin.power.modules.axis.excel.PowerAxisStructExcel; import com.epmet.plugin.power.modules.axis.service.PowerAxisStructService; +import oracle.jdbc.proxy.annotation.Post; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -26,7 +33,7 @@ import java.util.Map; /** - * 动力主轴结构 + * 动力主轴结构 * * @author generator generator@elink-cn.com * @since v1.0.0 2022-04-18 @@ -39,20 +46,20 @@ 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){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); powerAxisStructService.save(dto); @@ -61,7 +68,7 @@ public class PowerAxisStructController { @NoRepeatSubmit @PostMapping("update") - public Result update(@RequestBody PowerAxisStructDTO dto) { + public Result update(@RequestBody PowerAxisStructDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); powerAxisStructService.update(dto); @@ -69,7 +76,7 @@ public class PowerAxisStructController { } @PostMapping("delete") - public Result delete(@RequestBody String[] ids) { + public Result delete(@RequestBody String[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); powerAxisStructService.delete(ids); @@ -94,5 +101,31 @@ public class PowerAxisStructController { public Result> selectAllForTree(@RequestBody PowerAxisStructLeaderFormDTO formDto) { return new Result().ok(powerAxisStructService.selectAllForTree(formDto)); } + /** + * 根据名字查询 + */ + @PostMapping("/queryDeptByName") + 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 PowerAxisStructAddFormDTO form){ + int i = powerAxisStructService.addOrg(form); + System.out.println("1111111111"); + 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/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 bf66e9d..916532f 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 @@ -2,6 +2,11 @@ package com.epmet.plugin.power.modules.axis.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.plugin.power.dto.axis.PowerAxisStructDTO; +import com.epmet.plugin.power.dto.axis.form.PowerAxisStructAddFormDTO; +import com.epmet.plugin.power.dto.axis.form.PowerAxisStructFormDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisStructListResultDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisStructResultDTO; import com.epmet.plugin.power.dto.axis.form.PowerAxisStructLeaderFormDTO; import com.epmet.plugin.power.dto.axis.result.PowerAxisStructLeaderResultDTO; import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity; @@ -10,8 +15,10 @@ import org.apache.ibatis.annotations.Mapper; import java.util.List; import java.util.Map; +import java.util.List; + /** - * 动力主轴结构 + * 动力主轴结构 * * @author generator generator@elink-cn.com * @since v1.0.0 2022-04-18 @@ -27,4 +34,17 @@ public interface PowerAxisStructDao extends BaseDao { * @date 2022/4/19/0019 14:03 */ List selectAllForTree(PowerAxisStructLeaderFormDTO formDto); + + /** + * 根据名字查询 + */ + List queryDeptByName(PowerAxisStructFormDTO form); + + /** + * 获取树状列表 + */ + List queryList(); + + + int addOrg(PowerAxisStructAddFormDTO 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/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 ad94533..dea850d 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 @@ -4,6 +4,10 @@ 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.PowerAxisStructDTO; +import com.epmet.plugin.power.dto.axis.form.PowerAxisStructAddFormDTO; +import com.epmet.plugin.power.dto.axis.form.PowerAxisStructFormDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisStructListResultDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisStructResultDTO; import com.epmet.plugin.power.dto.axis.form.PowerAxisStructLeaderFormDTO; import com.epmet.plugin.power.dto.axis.result.PowerAxisStructLeaderResultDTO; import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity; @@ -12,7 +16,7 @@ import java.util.List; import java.util.Map; /** - * 动力主轴结构 + * 动力主轴结构 * * @author generator generator@elink-cn.com * @since v1.0.0 2022-04-18 @@ -79,6 +83,17 @@ public interface PowerAxisStructService extends BaseService queryDeptByName(PowerAxisStructFormDTO form); + + /** + * 获取树状列表 + */ + List queryList(); + + /** * 查询动力主轴全部机构,用于前端组装展示树 * @@ -87,4 +102,9 @@ public interface PowerAxisStructService extends BaseService selectAllForTree(PowerAxisStructLeaderFormDTO formDto); + + /** + * 添加组织 + */ + int addOrg(PowerAxisStructAddFormDTO 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/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 41e6c67..832aca1 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 @@ -8,8 +8,12 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.plugin.power.dto.axis.PowerAxisStructDTO; +import com.epmet.plugin.power.dto.axis.form.PowerAxisStructAddFormDTO; +import com.epmet.plugin.power.dto.axis.form.PowerAxisStructFormDTO; import com.epmet.plugin.power.dto.axis.form.PowerAxisStructLeaderFormDTO; import com.epmet.plugin.power.dto.axis.result.PowerAxisStructLeaderResultDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisStructListResultDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisStructResultDTO; import com.epmet.plugin.power.modules.axis.dao.PowerAxisStructDao; import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity; import com.epmet.plugin.power.modules.axis.redis.PowerAxisStructRedis; @@ -19,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -35,6 +40,9 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -87,8 +95,28 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl queryDeptByName(PowerAxisStructFormDTO form) { + 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 int addOrg(PowerAxisStructAddFormDTO form) { + int i = baseDao.addOrg(form); + return i; + } } \ 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 2d57da4..dbb638a 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 @@ -142,4 +142,4 @@ thread: queueCapacity: @thread.threadPool.queue-capacity@ keepAliveSeconds: @thread.threadPool.keep-alive-seconds@ threadNamePrefix: @thread.threadPool.thread-name-prefix@ - rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@ \ No newline at end of file + rejectedExecutionHandler: @thread.threadPool.rejected-execution-handler@ 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 2600090..f2fec27 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 @@ -21,6 +21,25 @@ + + INSERT INTO + pli_power_axis_struct + (name, + CUSTOMER_ID, + sort, + CATEGORY_CODE, + AGENCY_ID, + AGENCY_NAME, + AGENCY_TYPE) + VALUES + (#{name}, + #{customerId}, + #{sort}, + #{categoryCode}, + #{agencyId}, + #{agencyName}, + #{agencyType}) + + + + + \ No newline at end of file