bug修改
This commit is contained in:
@@ -37,8 +37,8 @@ public class CsDevModelAddParm {
|
|||||||
* 版本日期
|
* 版本日期
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "版本日期")
|
@ApiModelProperty(value = "版本日期")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
private Date versionDate;
|
private Date versionDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ public class CsDevModelAuditParm {
|
|||||||
* 版本日期
|
* 版本日期
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "版本日期")
|
@ApiModelProperty(value = "版本日期")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
private Date versionDate;
|
private Date versionDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -31,14 +31,19 @@ public class CsDevModelQueryListParm {
|
|||||||
* 版本日期
|
* 版本日期
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "版本日期")
|
@ApiModelProperty(value = "版本日期")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
private String versionStartDate;
|
private String versionStartDate;
|
||||||
|
|
||||||
@ApiModelProperty(value = "版本日期")
|
@ApiModelProperty(value = "版本日期")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
private String versionendDate;
|
private String versionEndDate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "版本准确日期")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
private String versionDate;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -43,14 +43,14 @@ public class CsDevModelQueryParm {
|
|||||||
* 版本日期
|
* 版本日期
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "版本日期")
|
@ApiModelProperty(value = "版本日期")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
private String versionStartDate;
|
private String versionStartDate;
|
||||||
|
|
||||||
@ApiModelProperty(value = "版本日期")
|
@ApiModelProperty(value = "版本日期")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
private String versionendDate;
|
private String versionEndDate;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -41,4 +41,5 @@ public class CsDictAddParm {
|
|||||||
@ApiModelProperty(value = "sort")
|
@ApiModelProperty(value = "sort")
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -50,8 +50,8 @@ public class CsEdDataAddParm {
|
|||||||
* 版本日期
|
* 版本日期
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "版本日期")
|
@ApiModelProperty(value = "版本日期")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
private Date versionDate;
|
private Date versionDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ public class CsEdDataAuditParm {
|
|||||||
* 版本日期
|
* 版本日期
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "版本日期")
|
@ApiModelProperty(value = "版本日期")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
private LocalDate versionDate;
|
private LocalDate versionDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -43,13 +43,13 @@ public class CsEdDataQueryParm {
|
|||||||
* 版本日期
|
* 版本日期
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "版本日期")
|
@ApiModelProperty(value = "版本日期")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
private String versionStartDate;
|
private String versionStartDate;
|
||||||
|
|
||||||
@ApiModelProperty(value = "版本日期")
|
@ApiModelProperty(value = "版本日期")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
private String versionendDate;
|
private String versionendDate;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.njcn.algorithm.pojo.param;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2023/4/10 19:47【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CsEngineeringQueryPageParm {
|
||||||
|
|
||||||
|
@NotNull(message="当前页不能为空!")
|
||||||
|
@Min(value = 1, message = "当前页不能为0")
|
||||||
|
@ApiModelProperty(value = "当前页",name = "currentPage",dataType ="Integer",required = true)
|
||||||
|
private Integer currentPage;
|
||||||
|
/**显示条数*/
|
||||||
|
@NotNull(message="显示条数不能为空!")
|
||||||
|
@ApiModelProperty(value = "显示条数",name = "pageSize",dataType ="Integer",required = true)
|
||||||
|
private Integer pageSize;
|
||||||
|
@ApiModelProperty(value = "工程名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "用户id")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "省")
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "市")
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -45,12 +45,18 @@ public class CsEngineeringVO extends BaseEntity {
|
|||||||
@ApiModelProperty(value = "省")
|
@ApiModelProperty(value = "省")
|
||||||
private String province;
|
private String province;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "省名称")
|
||||||
|
private String provinceName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 市
|
* 市
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "市")
|
@ApiModelProperty(value = "市")
|
||||||
private String city;
|
private String city;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "市名称")
|
||||||
|
private String cityName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 描述
|
* 描述
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -17,6 +17,17 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class ProjectEquipmentVO {
|
public class ProjectEquipmentVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "工程id")
|
||||||
|
private String engineeringid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "工程名称")
|
||||||
|
private String engineeringName;
|
||||||
@ApiModelProperty(value = "项目id")
|
@ApiModelProperty(value = "项目id")
|
||||||
private String projectId;
|
private String projectId;
|
||||||
|
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ public class DevModelController extends BaseController {
|
|||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/queryEquipmentByProject")
|
@PostMapping("/queryEquipmentByProject")
|
||||||
@ApiOperation("通过项目查询出厂设备")
|
@ApiOperation("设备模板列表查询")
|
||||||
@ApiImplicitParam(name = "csDevModelQueryListParm", value = "项目信息", required = true)
|
@ApiImplicitParam(name = "csDevModelQueryListParm", value = "信息", required = true)
|
||||||
public HttpResult<List<CsDevModelPageVO>> queryEquipmentByProject(@RequestBody CsDevModelQueryListParm csDevModelQueryListParm){
|
public HttpResult<List<CsDevModelPageVO>> queryEquipmentByProject(@RequestBody CsDevModelQueryListParm csDevModelQueryListParm){
|
||||||
String methodDescribe = getMethodDescribe("queryEquipmentByProject");
|
String methodDescribe = getMethodDescribe("queryEquipmentByProject");
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.njcn.algorithm.controller.project;
|
package com.njcn.algorithm.controller.project;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.njcn.algorithm.pojo.param.CsEngineeringAddParm;
|
import com.njcn.algorithm.pojo.param.CsEngineeringAddParm;
|
||||||
import com.njcn.algorithm.pojo.param.CsEngineeringAuditParm;
|
import com.njcn.algorithm.pojo.param.CsEngineeringAuditParm;
|
||||||
|
import com.njcn.algorithm.pojo.param.CsEngineeringQueryPageParm;
|
||||||
import com.njcn.algorithm.pojo.param.CsEngineeringQueryParm;
|
import com.njcn.algorithm.pojo.param.CsEngineeringQueryParm;
|
||||||
import com.njcn.algorithm.pojo.vo.CsEngineeringVO;
|
import com.njcn.algorithm.pojo.vo.CsEngineeringVO;
|
||||||
import com.njcn.algorithm.service.CsEngineeringService;
|
import com.njcn.algorithm.service.CsEngineeringService;
|
||||||
@@ -74,4 +76,15 @@ public class EngineeringController extends BaseController {
|
|||||||
List<CsEngineeringVO> csEngineeringVOList = csEngineeringService.queryEngineering(csEngineeringQueryParm);
|
List<CsEngineeringVO> csEngineeringVOList = csEngineeringService.queryEngineering(csEngineeringQueryParm);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, csEngineeringVOList, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, csEngineeringVOList, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/queryEngineeringPage")
|
||||||
|
@ApiOperation("分页查询工程列表")
|
||||||
|
@ApiImplicitParam(name = "csEngineeringQueryPageParm", value = "修改项目参数", required = true)
|
||||||
|
public HttpResult<IPage<CsEngineeringVO>> queryEngineeringPage(@Validated @RequestBody CsEngineeringQueryPageParm csEngineeringQueryPageParm){
|
||||||
|
String methodDescribe = getMethodDescribe("queryEngineeringPage");
|
||||||
|
|
||||||
|
IPage<CsEngineeringVO> page = csEngineeringService.queryEngineeringPage(csEngineeringQueryPageParm);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,8 +29,8 @@
|
|||||||
<if test="csDevModelQueryParm.versionStartDate != null and csDevModelQueryParm.versionStartDate != ''">
|
<if test="csDevModelQueryParm.versionStartDate != null and csDevModelQueryParm.versionStartDate != ''">
|
||||||
AND a.version_date >= #{csDevModelQueryParm.versionStartDate }
|
AND a.version_date >= #{csDevModelQueryParm.versionStartDate }
|
||||||
</if>
|
</if>
|
||||||
<if test="csDevModelQueryParm.versionendDate != null and csDevModelQueryParm.versionendDate != ''">
|
<if test="csDevModelQueryParm.versionEndDate != null and csDevModelQueryParm.versionEndDate != ''">
|
||||||
AND a.version_date <= #{csDevModelQueryParm.versionendDate }
|
AND a.version_date <= #{csDevModelQueryParm.versionEndDate }
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="csDevModelQueryParm.devName != null and csDevModelQueryParm.devName != ''">
|
<if test="csDevModelQueryParm.devName != null and csDevModelQueryParm.devName != ''">
|
||||||
@@ -49,8 +49,12 @@
|
|||||||
<if test="csDevModelQueryListParm.versionStartDate != null and csDevModelQueryListParm.versionStartDate != ''">
|
<if test="csDevModelQueryListParm.versionStartDate != null and csDevModelQueryListParm.versionStartDate != ''">
|
||||||
AND a.version_date >= #{csDevModelQueryListParm.versionStartDate }
|
AND a.version_date >= #{csDevModelQueryListParm.versionStartDate }
|
||||||
</if>
|
</if>
|
||||||
<if test="csDevModelQueryListParm.versionendDate != null and csDevModelQueryListParm.versionendDate != ''">
|
<if test="csDevModelQueryListParm.versionEndDate != null and csDevModelQueryListParm.versionEndDate != ''">
|
||||||
AND a.version_date <= #{csDevModelQueryListParm.versionendDate }
|
AND a.version_date <= #{csDevModelQueryListParm.versionEndDate }
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="csDevModelQueryListParm.versionDate != null and csDevModelQueryListParm.versionDate != ''">
|
||||||
|
AND a.version_date = #{csDevModelQueryListParm.versionDate }
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="csDevModelQueryListParm.versionNo != null and csDevModelQueryListParm.versionNo != ''">
|
<if test="csDevModelQueryListParm.versionNo != null and csDevModelQueryListParm.versionNo != ''">
|
||||||
|
|||||||
@@ -32,15 +32,19 @@
|
|||||||
</sql>
|
</sql>
|
||||||
<select id="queryProjectEquipmentVO" resultType="com.njcn.algorithm.pojo.vo.ProjectEquipmentVO">
|
<select id="queryProjectEquipmentVO" resultType="com.njcn.algorithm.pojo.vo.ProjectEquipmentVO">
|
||||||
SELECT
|
SELECT
|
||||||
|
a.engineering_id engineeringId,
|
||||||
|
d.name engineeringName,
|
||||||
a.id projectId,
|
a.id projectId,
|
||||||
a.name projectName,
|
a.name projectName,
|
||||||
b.id equipmentId,
|
b.id equipmentId,
|
||||||
b.name equipmentName
|
b.name equipmentName
|
||||||
FROM cs_project a,
|
FROM cs_project a,
|
||||||
cs_equipment_delivery b,
|
cs_equipment_delivery b,
|
||||||
cs_project_equipment c
|
cs_project_equipment c,
|
||||||
|
cs_engineering d
|
||||||
WHERE a.id = c.project_id
|
WHERE a.id = c.project_id
|
||||||
AND b.id = c.equipment_id
|
AND b.id = c.equipment_id
|
||||||
|
and a.engineering_id =d.id
|
||||||
<if test="projectEquipmentQueryParm!=null and projectEquipmentQueryParm.projectType != null and projectEquipmentQueryParm.projectType !=''">
|
<if test="projectEquipmentQueryParm!=null and projectEquipmentQueryParm.projectType != null and projectEquipmentQueryParm.projectType !=''">
|
||||||
AND a.project_type = #{projectEquipmentQueryParm.projectType}
|
AND a.project_type = #{projectEquipmentQueryParm.projectType}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.njcn.algorithm.service;
|
package com.njcn.algorithm.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.njcn.algorithm.pojo.param.CsEngineeringAddParm;
|
import com.njcn.algorithm.pojo.param.CsEngineeringAddParm;
|
||||||
import com.njcn.algorithm.pojo.param.CsEngineeringAuditParm;
|
import com.njcn.algorithm.pojo.param.CsEngineeringAuditParm;
|
||||||
|
import com.njcn.algorithm.pojo.param.CsEngineeringQueryPageParm;
|
||||||
import com.njcn.algorithm.pojo.param.CsEngineeringQueryParm;
|
import com.njcn.algorithm.pojo.param.CsEngineeringQueryParm;
|
||||||
import com.njcn.algorithm.pojo.po.CsEngineeringPO;
|
import com.njcn.algorithm.pojo.po.CsEngineeringPO;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
@@ -38,4 +40,12 @@ public interface CsEngineeringService extends IService<CsEngineeringPO>{
|
|||||||
* @Date: 2023/4/10
|
* @Date: 2023/4/10
|
||||||
*/
|
*/
|
||||||
List<CsEngineeringVO> queryEngineering(CsEngineeringQueryParm csEngineeringQueryParm);
|
List<CsEngineeringVO> queryEngineering(CsEngineeringQueryParm csEngineeringQueryParm);
|
||||||
}
|
/**
|
||||||
|
* @Description: 分页查询
|
||||||
|
* @Param: [csEngineeringQueryPageParm]
|
||||||
|
* @return: com.baomidou.mybatisplus.core.metadata.IPage<com.njcn.algorithm.pojo.vo.CsEngineeringVO>
|
||||||
|
* @Author: clam
|
||||||
|
* @Date: 2023/4/12
|
||||||
|
*/
|
||||||
|
IPage<CsEngineeringVO> queryEngineeringPage(CsEngineeringQueryPageParm csEngineeringQueryPageParm);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,14 +1,21 @@
|
|||||||
package com.njcn.algorithm.service.impl;
|
package com.njcn.algorithm.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
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.njcn.algorithm.mapper.CsEngineeringMapper;
|
import com.njcn.algorithm.mapper.CsEngineeringMapper;
|
||||||
import com.njcn.algorithm.pojo.param.CsEngineeringAddParm;
|
import com.njcn.algorithm.pojo.param.CsEngineeringAddParm;
|
||||||
import com.njcn.algorithm.pojo.param.CsEngineeringAuditParm;
|
import com.njcn.algorithm.pojo.param.CsEngineeringAuditParm;
|
||||||
|
import com.njcn.algorithm.pojo.param.CsEngineeringQueryPageParm;
|
||||||
import com.njcn.algorithm.pojo.param.CsEngineeringQueryParm;
|
import com.njcn.algorithm.pojo.param.CsEngineeringQueryParm;
|
||||||
import com.njcn.algorithm.pojo.po.CsEngineeringPO;
|
import com.njcn.algorithm.pojo.po.CsEngineeringPO;
|
||||||
import com.njcn.algorithm.pojo.vo.CsEngineeringVO;
|
import com.njcn.algorithm.pojo.vo.CsEngineeringVO;
|
||||||
import com.njcn.algorithm.service.CsEngineeringService;
|
import com.njcn.algorithm.service.CsEngineeringService;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
|
import com.njcn.system.api.AreaFeignClient;
|
||||||
|
import com.njcn.system.pojo.po.Area;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -16,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,8 +36,12 @@ import java.util.stream.Collectors;
|
|||||||
* @version V1.0.0
|
* @version V1.0.0
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, CsEngineeringPO> implements CsEngineeringService{
|
public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, CsEngineeringPO> implements CsEngineeringService{
|
||||||
|
|
||||||
|
private final AreaFeignClient areaFeignClient;
|
||||||
|
private final RedisUtil redisUtil;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public Boolean addEngineering(CsEngineeringAddParm csEngineeringAddParm) {
|
public Boolean addEngineering(CsEngineeringAddParm csEngineeringAddParm) {
|
||||||
@@ -63,8 +75,47 @@ public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, C
|
|||||||
csEngineeringVOList = csEngineeringPOS.stream ().map (temp->{
|
csEngineeringVOList = csEngineeringPOS.stream ().map (temp->{
|
||||||
CsEngineeringVO vo = new CsEngineeringVO();
|
CsEngineeringVO vo = new CsEngineeringVO();
|
||||||
BeanUtils.copyProperties (temp, vo);
|
BeanUtils.copyProperties (temp, vo);
|
||||||
|
vo.setProvinceName (this.getAreaById (vo.getProvince ()));
|
||||||
|
vo.setCityName (this.getAreaById (vo.getCity ()));
|
||||||
return vo;
|
return vo;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
return csEngineeringVOList;
|
return csEngineeringVOList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<CsEngineeringVO> queryEngineeringPage(CsEngineeringQueryPageParm csEngineeringQueryPageParm) {
|
||||||
|
Page<CsEngineeringPO> tempPage = new Page<> (csEngineeringQueryPageParm.getCurrentPage ( ), csEngineeringQueryPageParm.getPageSize ( ));
|
||||||
|
Page<CsEngineeringVO> returnPage = new Page<> (csEngineeringQueryPageParm.getCurrentPage ( ), csEngineeringQueryPageParm.getPageSize ( ));
|
||||||
|
|
||||||
|
QueryWrapper<CsEngineeringPO> queryWrapper = new QueryWrapper<> ();
|
||||||
|
queryWrapper.eq (StringUtils.isNotBlank (csEngineeringQueryPageParm.getUserId ()),"user_id",csEngineeringQueryPageParm.getUserId ()).
|
||||||
|
eq (StringUtils.isNotBlank (csEngineeringQueryPageParm.getProvince ()),"province",csEngineeringQueryPageParm.getProvince ()).
|
||||||
|
eq (StringUtils.isNotBlank (csEngineeringQueryPageParm.getCity ()),"city",csEngineeringQueryPageParm.getCity ()).
|
||||||
|
eq ("status","1" ).
|
||||||
|
like (StringUtils.isNotBlank (csEngineeringQueryPageParm.getName ()),"name",csEngineeringQueryPageParm.getName ());
|
||||||
|
Page<CsEngineeringPO> csEngineeringPOPage = this.getBaseMapper ( ).selectPage (tempPage, queryWrapper);
|
||||||
|
List<CsEngineeringVO> collect = csEngineeringPOPage.getRecords ( ).stream ( ).map (temp -> {
|
||||||
|
CsEngineeringVO vo = new CsEngineeringVO ( );
|
||||||
|
BeanUtils.copyProperties (temp, vo);
|
||||||
|
vo.setProvinceName (this.getAreaById (vo.getProvince ()));
|
||||||
|
vo.setCityName (this.getAreaById (vo.getCity ()));
|
||||||
|
return vo;
|
||||||
|
}).collect (Collectors.toList ( ));
|
||||||
|
returnPage.setRecords (collect);
|
||||||
|
return returnPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getAreaById(String id){
|
||||||
|
|
||||||
|
String areaName =redisUtil.getStringByKey (id);
|
||||||
|
areaName =Optional.ofNullable (areaName).orElseGet (() ->{
|
||||||
|
Area data = areaFeignClient.selectIdArea (id).getData ( );
|
||||||
|
redisUtil.saveByKey (id,data.getName ());
|
||||||
|
return data.getName ();
|
||||||
|
});
|
||||||
|
|
||||||
|
return areaName;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user