Commit c6a6a33b by 李小惠

Merge branch 'develop' of http://gitlab.sothing.top/843502640/jyzb_platformV2 into develop-lxh

parents e7f8a1ac 0b73f4a8
...@@ -35,10 +35,25 @@ public class EquipmentSizeDto { ...@@ -35,10 +35,25 @@ public class EquipmentSizeDto {
private String name; private String name;
/** /**
* 创建时间 * 装备名称
*/ */
private Date createTime; private String eqName;
/**
* 类别1名称
*/
private String type1Name;
/**
* 类别2名称
*/
private String type2name;
/**
* 类别3名称
*/
private String type3Name;
/**
* 类别汇总名称
*/
private String combinedTypes;
/** /**
* 更新时间 * 更新时间
*/ */
......
...@@ -12,5 +12,6 @@ public class OrgDto { ...@@ -12,5 +12,6 @@ public class OrgDto {
private String areaName; private String areaName;
private String levelFlag; private String levelFlag;
private String dName; private String dName;
private Boolean isLeaf;
} }
...@@ -12,6 +12,7 @@ public class QueryOrgReq { ...@@ -12,6 +12,7 @@ public class QueryOrgReq {
private String parentId; private String parentId;
private Integer isDepartment; private Integer isDepartment;
private Integer level; private Integer level;
private Integer delFlag;
} }
...@@ -14,7 +14,7 @@ public class UpdateOrgReq { ...@@ -14,7 +14,7 @@ public class UpdateOrgReq {
* 状态 * 状态
*/ */
@NotNull(message = "状态不能为空", groups = {ValidationApi.updateStatus.class}) @NotNull(message = "状态不能为空", groups = {ValidationApi.updateStatus.class})
private Integer statusFlag; private Integer delFlag;
/** /**
* 组织机构列表 * 组织机构列表
*/ */
......
package com.junmp.jyzb.controller; package com.junmp.jyzb.controller;
import cn.hutool.db.Page;
import com.junmp.jyzb.api.bean.dto.EquipmentSizeDto; import com.junmp.jyzb.api.bean.dto.EquipmentSizeDto;
import com.junmp.jyzb.api.bean.query.QueryEquipmentSizeReq; import com.junmp.jyzb.api.bean.query.QueryEquipmentSizeReq;
import com.junmp.jyzb.api.bean.req.UpdateEquipmentSizeReq; import com.junmp.jyzb.api.bean.req.UpdateEquipmentSizeReq;
...@@ -7,6 +8,7 @@ import com.junmp.jyzb.entity.EquipmentSize; ...@@ -7,6 +8,7 @@ import com.junmp.jyzb.entity.EquipmentSize;
import com.junmp.jyzb.service.EquipmentSizeService; import com.junmp.jyzb.service.EquipmentSizeService;
import com.junmp.v2.common.bean.request.ValidationApi; import com.junmp.v2.common.bean.request.ValidationApi;
import com.junmp.v2.common.bean.response.ApiRes; import com.junmp.v2.common.bean.response.ApiRes;
import com.junmp.v2.db.api.page.PageResult;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -53,6 +55,11 @@ public class EquipmentSizeController { ...@@ -53,6 +55,11 @@ public class EquipmentSizeController {
public ApiRes<List<EquipmentSizeDto>> getAllSize(@RequestBody QueryEquipmentSizeReq req){ public ApiRes<List<EquipmentSizeDto>> getAllSize(@RequestBody QueryEquipmentSizeReq req){
return ApiRes.success(equipmentSizeService.getAllSize(req)); return ApiRes.success(equipmentSizeService.getAllSize(req));
} }
@PostMapping("/GetSizePage")
@ApiOperation("分页查询号型信息")
public ApiRes<PageResult<EquipmentSizeDto>> getSizePage(@RequestBody QueryEquipmentSizeReq req){
return ApiRes.success(equipmentSizeService.getSizePages(req));
}
@PostMapping("/UpdateSize") @PostMapping("/UpdateSize")
@ApiOperation("修改号型信息") @ApiOperation("修改号型信息")
......
package com.junmp.jyzb.mapper; package com.junmp.jyzb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.junmp.jyzb.api.bean.dto.EquipmentSizeDto;
import com.junmp.jyzb.api.bean.query.QueryEquipmentSizeReq;
import com.junmp.jyzb.entity.Cabinet;
import com.junmp.jyzb.entity.EquipmentSize; import com.junmp.jyzb.entity.EquipmentSize;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -10,4 +15,20 @@ import java.util.Map; ...@@ -10,4 +15,20 @@ import java.util.Map;
@Mapper @Mapper
public interface EquipmentSizeMapper extends BaseMapper<EquipmentSize> { public interface EquipmentSizeMapper extends BaseMapper<EquipmentSize> {
/**
* 获取分页的信息
*/
public List<EquipmentSizeDto> getSizePage(
@Param("req") QueryEquipmentSizeReq req,
@Param("page") Page<EquipmentSizeDto> page
);
/**
* 获取分页的信息
*/
public Integer getSizeCount(
@Param("name") String name,
@Param("typeId") String typeId
);
} }
\ No newline at end of file
...@@ -6,6 +6,7 @@ import com.junmp.jyzb.api.bean.query.QueryEquipmentSizeReq; ...@@ -6,6 +6,7 @@ import com.junmp.jyzb.api.bean.query.QueryEquipmentSizeReq;
import com.junmp.jyzb.api.bean.req.UpdateEquipmentSizeReq; import com.junmp.jyzb.api.bean.req.UpdateEquipmentSizeReq;
import com.junmp.jyzb.entity.EquipmentSize; import com.junmp.jyzb.entity.EquipmentSize;
import com.junmp.jyzb.utils.ResponseResult; import com.junmp.jyzb.utils.ResponseResult;
import com.junmp.v2.db.api.page.PageResult;
import java.util.List; import java.util.List;
...@@ -21,4 +22,5 @@ public interface EquipmentSizeService extends IService<EquipmentSize> { ...@@ -21,4 +22,5 @@ public interface EquipmentSizeService extends IService<EquipmentSize> {
Boolean changeSizeState(UpdateEquipmentSizeReq req); Boolean changeSizeState(UpdateEquipmentSizeReq req);
List<EquipmentSizeDto> getAllSize(QueryEquipmentSizeReq req); List<EquipmentSizeDto> getAllSize(QueryEquipmentSizeReq req);
PageResult<EquipmentSizeDto> getSizePages(QueryEquipmentSizeReq req);
} }
...@@ -27,6 +27,4 @@ public interface PubOrgService extends IService<PubOrg> { ...@@ -27,6 +27,4 @@ public interface PubOrgService extends IService<PubOrg> {
//根据组织机构id查询出组织机构是否存在 //根据组织机构id查询出组织机构是否存在
PubOrg PubOrgExist(Long id); PubOrg PubOrgExist(Long id);
} }
...@@ -2,6 +2,7 @@ package com.junmp.jyzb.service.impl; ...@@ -2,6 +2,7 @@ package com.junmp.jyzb.service.impl;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.junmp.jyzb.api.bean.dto.EquipmentSizeDto; import com.junmp.jyzb.api.bean.dto.EquipmentSizeDto;
import com.junmp.jyzb.api.bean.dto.EquipmentTypeDto; import com.junmp.jyzb.api.bean.dto.EquipmentTypeDto;
...@@ -9,6 +10,7 @@ import com.junmp.jyzb.api.bean.query.QueryEquipmentSizeReq; ...@@ -9,6 +10,7 @@ import com.junmp.jyzb.api.bean.query.QueryEquipmentSizeReq;
import com.junmp.jyzb.api.bean.req.UpdateEquipmentSizeReq; import com.junmp.jyzb.api.bean.req.UpdateEquipmentSizeReq;
import com.junmp.jyzb.api.exception.enums.ProductExceptionEnum; import com.junmp.jyzb.api.exception.enums.ProductExceptionEnum;
import com.junmp.jyzb.entity.EquipmentSize; import com.junmp.jyzb.entity.EquipmentSize;
import com.junmp.jyzb.entity.ProductSku;
import com.junmp.jyzb.mapper.EquipmentTypeMapper; import com.junmp.jyzb.mapper.EquipmentTypeMapper;
import com.junmp.jyzb.service.EquipmentSizeService; import com.junmp.jyzb.service.EquipmentSizeService;
import com.junmp.jyzb.utils.DateTimeUtil; import com.junmp.jyzb.utils.DateTimeUtil;
...@@ -17,6 +19,9 @@ import com.junmp.jyzb.utils.ResponseResult; ...@@ -17,6 +19,9 @@ import com.junmp.jyzb.utils.ResponseResult;
import com.junmp.jyzb.utils.ReturnMsg; import com.junmp.jyzb.utils.ReturnMsg;
import com.junmp.v2.common.exception.base.ServiceException; import com.junmp.v2.common.exception.base.ServiceException;
import com.junmp.v2.common.util.BeanPlusUtil; import com.junmp.v2.common.util.BeanPlusUtil;
import com.junmp.v2.db.api.factory.PageFactory;
import com.junmp.v2.db.api.factory.PageResultFactory;
import com.junmp.v2.db.api.page.PageResult;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import com.junmp.jyzb.mapper.EquipmentSizeMapper; import com.junmp.jyzb.mapper.EquipmentSizeMapper;
...@@ -83,6 +88,16 @@ public class EquipmentSizeServiceImpl extends ServiceImpl<EquipmentSizeMapper, E ...@@ -83,6 +88,16 @@ public class EquipmentSizeServiceImpl extends ServiceImpl<EquipmentSizeMapper, E
} }
return dtoList; return dtoList;
} }
@Override
public PageResult<EquipmentSizeDto> getSizePages(QueryEquipmentSizeReq req) {
Page<EquipmentSizeDto> page = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize());
List<EquipmentSizeDto> voList= equipmentSizeMapper.getSizePage(req,page);
page.setRecords(voList);
return PageResultFactory.createPageResult(page);
}
private EquipmentSize querySize(UpdateEquipmentSizeReq req) { private EquipmentSize querySize(UpdateEquipmentSizeReq req) {
EquipmentSize app = this.getById(req.getId()); EquipmentSize app = this.getById(req.getId());
......
...@@ -234,7 +234,7 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem ...@@ -234,7 +234,7 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem
List<PubOrg> st = list(wp); List<PubOrg> st = list(wp);
st.forEach(p-> st.forEach(p->
{ {
p.setStatusFlag(req.getStatusFlag()); p.setDelFlag(req.getDelFlag());
}); });
return this.updateBatchById(st); return this.updateBatchById(st);
...@@ -329,12 +329,22 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem ...@@ -329,12 +329,22 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem
list.forEach(p->{ list.forEach(p->{
OrgDto org=new OrgDto(); OrgDto org=new OrgDto();
BeanPlusUtil.copyProperties(p, org); BeanPlusUtil.copyProperties(p, org);
// 判断是否有子节点
boolean hasChildren = hasChildren(req.getDelFlag(),p.getOrgId());
org.setIsLeaf(!hasChildren);
orgs.add(org); orgs.add(org);
}); });
return orgs; return orgs;
} }
// 判断是否有子节点的方法
private boolean hasChildren(Integer Del, Long parentId) {
LambdaQueryWrapper<PubOrg> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PubOrg::getOrgParentId, parentId);
wrapper.eq(ObjectUtil.isNotNull(Del),PubOrg::getDelFlag, Del);
Long count = this.count(wrapper);
return count > 0;
}
public List<OrgDto> getOrgList(QueryOrgReq req) { public List<OrgDto> getOrgList(QueryOrgReq req) {
LambdaQueryWrapper<PubOrg> wp= this.createWrapper(req); LambdaQueryWrapper<PubOrg> wp= this.createWrapper(req);
List<PubOrg> list = this.list(wp); List<PubOrg> list = this.list(wp);
...@@ -356,6 +366,7 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem ...@@ -356,6 +366,7 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem
wrapper.eq(ObjectUtil.isNotEmpty(req.getIsDepartment()), PubOrg::getIsDepartment, req.getIsDepartment()); wrapper.eq(ObjectUtil.isNotEmpty(req.getIsDepartment()), PubOrg::getIsDepartment, req.getIsDepartment());
//根据业务编码查询 //根据业务编码查询
wrapper.eq(ObjectUtil.isNotEmpty(req.getLevel()), PubOrg::getLevelFlag, req.getLevel()); wrapper.eq(ObjectUtil.isNotEmpty(req.getLevel()), PubOrg::getLevelFlag, req.getLevel());
wrapper.eq(ObjectUtil.isNotEmpty(req.getDelFlag()), PubOrg::getDelFlag, req.getDelFlag());
wrapper.eq(ObjectUtil.isNotEmpty(req.getParentId()), PubOrg::getOrgParentId,req.getParentId() ); wrapper.eq(ObjectUtil.isNotEmpty(req.getParentId()), PubOrg::getOrgParentId,req.getParentId() );
wrapper.eq(ObjectUtil.isNotEmpty(req.getOrgCode()), PubOrg::getOrgCode, req.getOrgCode()); wrapper.eq(ObjectUtil.isNotEmpty(req.getOrgCode()), PubOrg::getOrgCode, req.getOrgCode());
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.junmp.jyzb.mapper.EquipmentSizeMapper"> <mapper namespace="com.junmp.jyzb.mapper.EquipmentSizeMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.entity.EquipmentSize"> <select id="getSizePage" resultType="com.junmp.jyzb.api.bean.dto.EquipmentSizeDto">
<!--@mbg.generated-->
<!--@Table base_equipment_size-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="type_id" jdbcType="VARCHAR" property="typeId" />
<result column="code" jdbcType="INTEGER" property="code" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="note" jdbcType="VARCHAR" property="note" />
<result column="epc_type" jdbcType="INTEGER" property="epcType" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, type_id, detail_id, code, `name`, create_time, update_time, note, epc_type
</sql>
SELECT
t1.id,
t1.state,
t2.name AS eqName,
t1.name AS name,
t1.type_id as typeId,
t1.price,
t1.code AS code,
t3.name AS type3Name,
t4.name AS type2name,
t5.name AS type1Name,
CONCAT_WS(' / ', t5.name, t4.name, t3.name) AS combinedTypes
FROM
`base_equipment_size` t1
LEFT JOIN `base_equipment_type` t2 ON t1.type_id = t2.id
LEFT JOIN `base_equipment_type` t3 ON t2.parent_id = t3.id
LEFT JOIN `base_equipment_type` t4 ON t3.parent_id = t4.id
LEFT JOIN `base_equipment_type` t5 ON t4.parent_id = t5.id
LEFT JOIN `base_equipment_type` t6 ON t5.parent_id = t6.id
WHERE 1 = 1
<if test="null != req">
<if test="null != req.name">
AND t1.name LIKE CONCAT('%', #{req.name}, '%')
</if>
<if test="null != req.typeId and '' != req.typeId">
AND t1.type_id= #{req.typeId}
</if>
</if>
</select>
<select id="getSizeCount" resultType="int">
SELECT
COUNT(*)
FROM
`base_equipment_size` t1
LEFT JOIN `base_equipment_type` t2 ON t1.type_id = t2.id
LEFT JOIN `base_equipment_type` t3 ON t2.parent_id = t3.id
LEFT JOIN `base_equipment_type` t4 ON t3.parent_id = t4.id
LEFT JOIN `base_equipment_type` t5 ON t4.parent_id = t5.id
LEFT JOIN `base_equipment_type` t6 ON t5.parent_id = t6.id
<if test="name != null and name != ''">
AND t1.name LIKE CONCAT('%', #{name}, '%')
</if>
<if test="typeId != null and typeId != ''">
AND t1.type_id= #{typeId}
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -26,7 +26,7 @@ knife4j: ...@@ -26,7 +26,7 @@ knife4j:
spring: spring:
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.3.128/db_jyzb?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true url: jdbc:mysql://192.168.3.128:3306/db_jyzb?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true
username: junmp username: junmp
password: 123456 password: 123456
......
scanner:
open: false
# 配置第三方请求
junmp:
swagger:
base-package: com.junmp
id:
worker-id: 1
data-center-id: 1
epoch: 1656036996843
max: 9999
log:
type: db
ds: true #是否多数据源
knife4j:
enable: true
setting:
enableDebug: false
# basic:
# enable: true
# username: ning
# password: ning
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
<<<<<<< HEAD
url: jdbc:mysql://192.168.3.128:3306/db_jyzb?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true
=======
url: jdbc:mysql://192.168.3.128/db_jyzb?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true
>>>>>>> ce2cec735d8197f0f6b77fb7df738d825354bd3c
username: junmp
password: 123456
redis:
#host: 192.168.3.188
host: 192.168.3.188
port: 6379
database: 1
password:
flowable:
dmn:
enabled: false
cmmn:
enabled: false
idm:
enabled: false
async-history-executor-activate: false
async-executor-activate: false
check-process-definitions: false
content:
enabled: false
app:
enabled: false
eventregistry:
enabled: false
#mybatis plus 设置
mybatis-plus:
configuration:
cache-enabled: true
lazy-loading-enabled: true
multiple-result-sets-enabled: true
map-underscore-to-camel-case: true #开启驼峰命名
global-config:
banner: false
enable-sql-runner: true
db-config:
id-type: assign_id
table-underline: true
# mapper-locations: classpath*:com/junmp/junmpProcess/mapper/**/xml/*Mapper.xml
mapper-locations: classpath*:/mapper/**/*Mapper.xml
flowable:
dmn:
enabled: false
cmmn:
enabled: false
idm:
enabled: false
async-history-executor-activate: false
async-executor-activate: false
check-process-definitions: false
content:
enabled: false
app:
enabled: false
eventregistry:
enabled: false
com:
mqtt:
url: tcp://broker.emqx.io:1883 #这里要写 tcp:// 不能是 mqtt,不然不是合法的 schema,源码中有
clientId: mqtt_test_spring
topics: iot/#,home/#
username: admin
password: public
timeout: 10
keepalive: 20
\ No newline at end of file
...@@ -50,7 +50,6 @@ ...@@ -50,7 +50,6 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-boot-maven-plugin.version>2.5.0</spring-boot-maven-plugin.version> <spring-boot-maven-plugin.version>2.5.0</spring-boot-maven-plugin.version>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<mysql-connector-java.version>8.0.21</mysql-connector-java.version>
<mybatis-plus-boot-starter>3.5.1</mybatis-plus-boot-starter> <mybatis-plus-boot-starter>3.5.1</mybatis-plus-boot-starter>
<junmp.v2.version>1.0.0</junmp.v2.version> <junmp.v2.version>1.0.0</junmp.v2.version>
<spring.ds.version>3.5.1</spring.ds.version> <spring.ds.version>3.5.1</spring.ds.version>
...@@ -259,11 +258,11 @@ ...@@ -259,11 +258,11 @@
</dependency> </dependency>
<!-- bcrypt依赖 --> <!-- bcrypt依赖 -->
<dependency> <!-- <dependency>-->
<groupId>org.springframework.security</groupId> <!-- <groupId>org.springframework.security</groupId>-->
<artifactId>spring-security-web</artifactId> <!-- <artifactId>spring-security-web</artifactId>-->
<version>5.0.5.RELEASE</version> <!-- <version>5.0.5.RELEASE</version>-->
</dependency> <!-- </dependency>-->
<!--导入导出依赖--> <!--导入导出依赖-->
<dependency> <dependency>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论