Commit ee3135e3 authored by chenzhao's avatar chenzhao

修改投融资bug

parent 66e1659c
package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -15,7 +16,7 @@ import java.util.Map;
* @date 2024-04-01
*/
public interface FinancingInfoMapper extends BaseMapper<FinancingInfo> {
@UserEmpower(field = {"hph.regional_companies_code"},dealerField = {"hph.developer_code","hph.regional_companies_code"},fieldConditions = {"eq","in"},relationship = {"and"})
List<Map<String,Object>> getStationFinancingInfoList(@Param(value = "params") Map<String,Object> params,@Param(value = "amosOrgCodes")List<String> amosOrgCodes);
......
......@@ -19,33 +19,25 @@
`hygf_peasant_household` hph
LEFT JOIN hygf_financing_info info ON info.peasant_household_id = hph.sequence_nbr
LEFT JOIN hygf_unit_info on hph.developer_code = hygf_unit_info.amos_company_code
WHERE
hph.construction_state = '验收完成'
<if test="params.ownersName != null and params.ownersName !=''">
and hph.owners_name like concat('%',#{params.ownersName},'%')
</if>
<if test="params.regionalCompaniesCode != null and params.regionalCompaniesCode !=''">
and hph.regional_companies_code = #{params.regionalCompaniesCode}
</if>
<if test="params.type == 1 ">
and hph.regional_companies_code in
<foreach collection="amosOrgCodes" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="params.type == 2 ">
and info.status in ('待融资审核','审核通过','放款完成' ) and info.financing_companies_seq = #{params.financingCompaniesSeq}
</if>
<if test="params.type == 3 ">
and info.status in ('待整改')
and hph.regional_companies_code in
<foreach collection="amosOrgCodes" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="params.status != null and params.status != ''">
and info.status = #{params.status}
</if>
<where>
hph.construction_state = '验收完成'
<if test="params.ownersName != null and params.ownersName !=''">
and hph.owners_name like concat('%',#{params.ownersName},'%')
</if>
<if test="params.regionalCompaniesCode != null and params.regionalCompaniesCode !=''">
and hph.regional_companies_code = #{params.regionalCompaniesCode}
</if>
<if test="params.type == 2 ">
and info.status in ('待融资审核','审核通过','放款完成' ) and info.financing_companies_seq = #{params.financingCompaniesSeq}
</if>
<if test="params.type == 3 ">
and info.status in ('待整改')
</if>
<if test="params.status != null and params.status != ''">
and info.status = #{params.status}
</if>
</where>
order by info.rec_date desc
</select>
<select id="selectDataInfo" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoDto">
SELECT
......
......@@ -8,7 +8,7 @@
hfro.sequence_nbr,
hfro.peasant_household_id,
hfro.rectification_status,
hph.owners_name,
hph.peasant_household_name,
hph.peasant_household_no,
project_address_name as projectAddress
from
......
......@@ -94,6 +94,14 @@ public class FinancingRectificationOrderController extends BaseController {
return ResponseHelper.buildResponse(dto);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/problemDescription/{peasantHouseholdId}")
@ApiOperation(httpMethod = "GET",value = "获取整改问题", notes = "获取整改问题")
public ResponseModel<String> getProblemDescription(@PathVariable Long peasantHouseholdId) {
return ResponseHelper.buildResponse(financingRectificationOrderServiceImpl.getProblemDescription(peasantHouseholdId));
}
/**
* 列表分页查询
*
......
......@@ -3,9 +3,12 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.map.MapBuilder;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingAuditing;
import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingRectificationOrder;
import com.yeejoin.amos.boot.module.hygf.api.mapper.FinancingRectificationOrderMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IFinancingRectificationOrderService;
......@@ -30,6 +33,8 @@ public class FinancingRectificationOrderServiceImpl extends BaseService<Financin
private FinancingRectificationOrderMapper financingRectificationOrderMapper;
@Autowired
FinancingInfoServiceImpl financingInfoServiceImpl;
@Autowired
FinancingAuditingServiceImpl financingAuditingService;
/**
* 分页查询
*/
......@@ -58,10 +63,38 @@ public class FinancingRectificationOrderServiceImpl extends BaseService<Financin
model.setRectificationPhoto(JSON.toJSONString(model.getRectificationPhotos()));
}
this.updateWithModel(model);
FinancingInfoDto financingInfoDto = financingInfoServiceImpl.selectDataInfo(model.getPeasantHouseholdId());
if (model.getRectificationStatus().equals("整改完成")){
FinancingInfoDto financingInfoDto = financingInfoServiceImpl.selectDataInfo(model.getPeasantHouseholdId());
financingInfoServiceImpl.execueFlow(MapBuilder.<String,Object>create().put("instanceId",financingInfoDto.getInstanceId()).put("approvalStatus","0").put("isZG","1").build());
}else {
financingInfoDto.setStatus(model.getRectificationStatus());
financingInfoServiceImpl.updateWithModel(financingInfoDto);
}
return model;
}
public String getProblemDescription(Long peasantHouseholdId) {
LambdaQueryWrapper<FinancingRectificationOrder> wrapper = new LambdaQueryWrapper<>();
wrapper.select(FinancingRectificationOrder::getProblemDescription);
wrapper.eq(FinancingRectificationOrder::getPeasantHouseholdId,peasantHouseholdId);
wrapper.orderByDesc(BaseEntity::getRecDate);
wrapper.last("limit 1");
FinancingRectificationOrder financingRectificationOrder = this.getBaseMapper().selectOne(wrapper);
if (null !=financingRectificationOrder){
return financingRectificationOrder.getProblemDescription();
}
LambdaQueryWrapper<FinancingAuditing> query = new LambdaQueryWrapper<>();
query.eq(FinancingAuditing::getPeasantHouseholdId,peasantHouseholdId);
query.orderByDesc(BaseEntity::getRecDate);
query.last("limit 1");
FinancingAuditing financingAuditing = financingAuditingService.getBaseMapper().selectOne(query);
return financingAuditing.getStatus();
}
}
\ No newline at end of file
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