Commit 99f63eed authored by 李秀明's avatar 李秀明

提交验收管理相关接口

parent 4e193a07
package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
......@@ -18,13 +19,14 @@ public class AcceptanceDto extends BaseDto {
private String ownersName;
@ApiModelProperty(value = "项目地址")
private String projectAddress;
private String projectAddressName;
@ApiModelProperty(value = "服务代理商")
private String serviceAgent;
@ApiModelProperty(value = "提交日期")
private Object submitDate;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Object acceptanceRecDate;
@JsonIgnore
@ApiModelProperty(value = "开始提交日期-[查询参数使用]")
......
......@@ -25,4 +25,12 @@ public interface AcceptanceRectificationOrderMapper extends BaseMapper<Acceptanc
@Param("page") IPage<AcceptanceRectificationOrderDto> page,
@Param("acceptanceSeqNbr") Long acceptanceSeqNbr
);
/**
* 根据编号查询
*
* @param sequenceNbr 编号
* @return 结果
*/
AcceptanceRectificationOrderDto queryBySequenceNbr(@Param("sequenceNbr") Long sequenceNbr);
}
package com.yeejoin.amos.boot.module.hygf.api.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.hygf.api.dto.AcceptanceDto;
......@@ -21,5 +22,6 @@ public interface IAcceptanceService {
* @param sequenceNbr sequenceNbr
* @return Map
*/
Map<String, Object> offlineAcceptanceDetails(Long sequenceNbr);
Map<String, Object> acceptanceDetails(Long sequenceNbr);
}
......@@ -9,7 +9,7 @@
ph.peasant_household_no AS powerStationCode,
ph.developer_name as serviceAgent,
ph.owners_name AS ownersName,
ph.project_address_name AS projectAddress,
ph.project_address_name AS projectAddressName,
bga.acceptance_rec_date AS acceptanceRecDate,
bga.acceptance_status AS acceptanceStatus,
ph.regional_companies_code AS regionalCompaniesCode,
......@@ -30,8 +30,8 @@
<if test="param.sequenceNbr != null and param.sequenceNbr != ''">
AND bga.sequence_nbr = #{param.sequenceNbr}
</if>
<if test="param.projectAddress != null and param.projectAddress != ''">
AND ph.project_address LIKE CONCAT('%', #{param.projectAddress}, '%')
<if test="param.projectAddressName != null and param.projectAddressName != ''">
AND ph.project_address_name LIKE CONCAT('%', #{param.projectAddressName}, '%')
</if>
<if test="param.serviceAgent != null and param.serviceAgent != ''">
AND ph.developer_name LIKE CONCAT('%', #{param.serviceAgent}, '%')
......
<?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">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.AcceptanceRectificationOrderMapper">
<select id="page" resultType="java.util.Map">
<select id="page" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.AcceptanceRectificationOrderDto">
SELECT
aro.sequence_nbr AS sequenceNbr,
ph.peasant_household_no as powerStationCode,
ph.owners_name AS ownersName,
ph.project_address AS powerStationAddress,
ph.project_address_name AS powerStationAddress,
IF(aro.rectification_status IS NULL OR aro.rectification_status = '', 0, 1) AS rectificationStatus
FROM
hygf_acceptance_rectification_order aro
LEFT JOIN hygf_peasant_household ph ON ph.sequence_nbr = aro.peasant_household_id
LEFT JOIN hygf_basic_grid_acceptance bga ON bga.peasant_household_id = aro.peasant_household_id
LEFT JOIN hygf_peasant_household ph ON ph.sequence_nbr = bga.peasant_household_id
<where>
aro.is_delete = 0
<if test="acceptanceSeqNbr != null and acceptanceSeqNbr != ''">
AND aro.peasant_household_id = #{acceptanceSeqNbr}
AND bga.sequence_nbr = #{acceptanceSeqNbr}
</if>
</where>
ORDER BY
aro.rectification_status DESC,
aro.rec_date DESC
</select>
<select id="queryBySequenceNbr"
resultType="com.yeejoin.amos.boot.module.hygf.api.dto.AcceptanceRectificationOrderDto">
SELECT
aro.*,
ph.peasant_household_no as powerStationCode,
ph.owners_name AS ownersName,
ph.project_address_name AS powerStationAddress,
IF(aro.rectification_status IS NULL OR aro.rectification_status = '', 0, 1) AS rectificationStatus
FROM
hygf_acceptance_rectification_order aro
LEFT JOIN hygf_basic_grid_acceptance bga ON bga.peasant_household_id = aro.peasant_household_id
LEFT JOIN hygf_peasant_household ph ON ph.sequence_nbr = bga.peasant_household_id
<where>
aro.is_delete = 0
<if test="sequenceNbr != null and sequenceNbr != ''">
AND aro.sequence_nbr = #{sequenceNbr}
</if>
</where>
</select>
</mapper>
......@@ -77,11 +77,11 @@ public class AcceptanceRectificationOrderController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@GetMapping
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个验收整改单", notes = "根据sequenceNbr查询单个验收整改单")
public ResponseModel<AcceptanceRectificationOrderDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(acceptanceRectificationOrderServiceImpl.queryBySeq(sequenceNbr));
public ResponseModel<AcceptanceRectificationOrderDto> selectOne(@RequestParam(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(acceptanceRectificationOrderServiceImpl.queryBySequenceNbr(sequenceNbr));
}
/**
......
......@@ -40,4 +40,8 @@ public class AcceptanceRectificationOrderServiceImpl extends BaseService<Accepta
public List<AcceptanceRectificationOrderDto> queryForAcceptanceRectificationOrderList() {
return this.queryForList("" , false);
}
public AcceptanceRectificationOrderDto queryBySequenceNbr(Long sequenceNbr) {
return acceptanceRectificationOrderMapper.queryBySequenceNbr(sequenceNbr);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yeejoin.amos.boot.module.hygf.api.Enum.AcceptanceStatusEnum;
......@@ -51,10 +52,10 @@ public class AcceptanceServiceImpl implements IAcceptanceService {
acceptanceDto.setAcceptanceStatus(jsonArray.toJSONString());
}
// 处理提交日期
if (Objects.nonNull(acceptanceDto.getSubmitDate()) && acceptanceDto.getSubmitDate() instanceof List) {
Object submitDate = acceptanceDto.getSubmitDate();
List<String> dates = ((ArrayList<String>) submitDate).stream().map(String::trim).collect(Collectors.toList());
if (!dates.isEmpty()) {
if (Objects.nonNull(acceptanceDto.getAcceptanceRecDate()) && acceptanceDto.getAcceptanceRecDate() instanceof List) {
Object acceptanceRecDate = acceptanceDto.getAcceptanceRecDate();
List<String> dates = ((ArrayList<String>) acceptanceRecDate).stream().map(String::trim).collect(Collectors.toList());
if (!dates.isEmpty() && StringUtils.hasText(dates.get(0)) && StringUtils.hasText(dates.get(1))) {
acceptanceDto.setStartSubmitDate(dates.get(0) + " 00:00:00");
acceptanceDto.setEndSubmitDate(dates.get(1) + " 23:59:59");
}
......@@ -76,7 +77,7 @@ public class AcceptanceServiceImpl implements IAcceptanceService {
* @return Map
*/
@Override
public Map<String, Object> offlineAcceptanceDetails(Long sequenceNbr) {
public Map<String, Object> acceptanceDetails(Long sequenceNbr) {
Assert.notNull(sequenceNbr, "sequenceNbr不能为空");
BasicGridAcceptance basicGridAcceptance = basicGridAcceptanceMapper.selectById(sequenceNbr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment