Commit 27a3b654 authored by chenzhao's avatar chenzhao

投融资调整

parent a9e9b6b8
package com.yeejoin.amos.boot.module.hygf.api.dto; package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.support.spring.annotation.FastJsonFilter; import com.alibaba.fastjson.support.spring.annotation.FastJsonFilter;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
...@@ -11,6 +13,7 @@ import lombok.EqualsAndHashCode; ...@@ -11,6 +13,7 @@ import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author system_generator * @author system_generator
...@@ -63,4 +66,5 @@ public class FinancingInfoDto extends BaseDto { ...@@ -63,4 +66,5 @@ public class FinancingInfoDto extends BaseDto {
@ApiModelProperty(value = "单价") @ApiModelProperty(value = "单价")
private String unitPrice; private String unitPrice;
List<PeasantHousehold> peasantHouseholds;
} }
package com.yeejoin.amos.boot.module.hygf.api.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
public class IdsDTO {
private List<Long> ids;
public List<Long> getIds() {
return ids;
}
public void setIds(List<Long> ids) {
this.ids = ids;
}
}
\ No newline at end of file
...@@ -227,4 +227,9 @@ public class PeasantHousehold extends BaseEntity { ...@@ -227,4 +227,9 @@ public class PeasantHousehold extends BaseEntity {
*/ */
@TableField(exist = false) @TableField(exist = false)
private String realScale; private String realScale;
/**
放款金额
*/
@TableField(exist = false)
private Double disbursementMoney;
} }
...@@ -51,5 +51,6 @@ public interface PeasantHouseholdMapper extends BaseMapper<PeasantHousehold> { ...@@ -51,5 +51,6 @@ public interface PeasantHouseholdMapper extends BaseMapper<PeasantHousehold> {
void deleteHhcByNo(String peasantHouseholdNo); void deleteHhcByNo(String peasantHouseholdNo);
List<PeasantHousehold> getInfoByIds(@Param(value = "ids") List<String> ids);
// String getHygfCommercialScale(Long surveyInformationId); // String getHygfCommercialScale(Long surveyInformationId);
} }
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
(select CONCAT_WS(',',instance_id,node_routing) instanceId FROM hygf_financing_auditing WHERE hygf_financing_auditing.peasant_household_id = hph.sequence_nbr ORDER BY rec_date desc limit 1) instanceId, (select CONCAT_WS(',',instance_id,node_routing) instanceId FROM hygf_financing_auditing WHERE hygf_financing_auditing.peasant_household_id = hph.sequence_nbr ORDER BY rec_date desc limit 1) instanceId,
hygf_unit_info.head_name responsibleUserName, hygf_unit_info.head_name responsibleUserName,
hygf_unit_info.head_phone responsibleUserPhone, hygf_unit_info.head_phone responsibleUserPhone,
info.disbursement_money as disbursementMoney,
hph.regional_companies_code, hph.regional_companies_code,
hph.developer_code hph.developer_code
FROM FROM
...@@ -30,10 +31,7 @@ ...@@ -30,10 +31,7 @@
and hph.regional_companies_code = #{params.regionalCompaniesCode} and hph.regional_companies_code = #{params.regionalCompaniesCode}
</if> </if>
<if test="params.type == 2 "> <if test="params.type == 2 ">
and info.status in ('待融资审核','审核通过','放款完成' ) and info.financing_companies_seq = #{params.financingCompaniesSeq} and info.status in ('待融资审核','审核通过','放款完成','已放款','审核不通过' ) and info.financing_companies_seq = #{params.financingCompaniesSeq}
</if>
<if test="params.type == 3 ">
and info.status in ('待整改','整改未完成')
</if> </if>
<if test="params.region != null and params.region !='' "> <if test="params.region != null and params.region !='' ">
and hph.project_address like concat ('%',#{params.region},'%') and hph.project_address like concat ('%',#{params.region},'%')
...@@ -42,8 +40,11 @@ ...@@ -42,8 +40,11 @@
ORDER BY ORDER BY
info.rec_date DESC ,hph.sequence_nbr DESC ) as sta info.rec_date DESC ,hph.sequence_nbr DESC ) as sta
<where> <where>
<if test="params.status != null and params.status != ''"> <if test="params.status != null and params.status.size() > 0">
and sta.status = #{params.status} and sta.status in
<foreach collection="params.status" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if> </if>
</where> </where>
</select> </select>
......
...@@ -133,8 +133,28 @@ on hygf_document_station.preparation_money_id=hygf_preparation_money.sequence_nb ...@@ -133,8 +133,28 @@ on hygf_document_station.preparation_money_id=hygf_preparation_money.sequence_nb
<select id="deleteHhcByNo"> <select id="deleteHhcByNo">
DELETE FROM hygf_household_contract WHERE peasant_household_number=#{peasantHouseholdNo} DELETE FROM hygf_household_contract WHERE peasant_household_number=#{peasantHouseholdNo}
</select> </select>
<select id="getInfoByIds" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold">
SELECT
ph.sequence_nbr,
ph.owners_name,
concat( ph.project_address_name, ph.project_address_detail ) AS project_address_name,
(ei.component_quantity * ei.component_specification / 1000) as realScale
FROM
hygf_peasant_household ph
LEFT JOIN hygf_work_order_power_station ps ON ps.peasant_household_id = ph.sequence_nbr
LEFT JOIN hygf_power_station_engineering_info ei ON ei.work_order_power_station_id= ps.sequence_nbr
<where>
ph.is_delete = 0
<if test="ids != null and ids.size()>0">
AND ph.sequence_nbr IN
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
<!-- <select id="getHygfCommercialScale" resultType="String">--> <!-- <select id="getHygfCommercialScale" resultType="String">-->
<!-- select scale from hygf_commercial where survey_information_id=${surveyInformationId}--> <!-- select scale from hygf_commercial where survey_information_id=${surveyInformationId}-->
<!-- </select>--> <!-- </select>-->
</mapper> </mapper>
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.controller; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.controller;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.map.MapBuilder; import cn.hutool.core.map.MapBuilder;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.module.hygf.api.dto.IdsDTO;
import com.yeejoin.amos.boot.module.hygf.api.util.CommonResponseNewUtil; import com.yeejoin.amos.boot.module.hygf.api.util.CommonResponseNewUtil;
import com.yeejoin.amos.boot.module.hygf.api.util.CommonResponseUtil; import com.yeejoin.amos.boot.module.hygf.api.util.CommonResponseUtil;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -65,8 +66,8 @@ public class FinancingInfoController extends BaseController { ...@@ -65,8 +66,8 @@ public class FinancingInfoController extends BaseController {
@PutMapping(value = "/updateState") @PutMapping(value = "/updateState")
@ApiOperation(httpMethod = "PUT", value = "新增", notes = "新增") @ApiOperation(httpMethod = "PUT", value = "新增", notes = "新增")
@Transactional @Transactional
public ResponseModel updateState(@RequestBody List<Long> ids) { public ResponseModel updateState(@RequestBody IdsDTO ids) {
financingInfoServiceImpl.updateState(ids); financingInfoServiceImpl.updateState(ids.getIds());
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
...@@ -114,10 +115,10 @@ public class FinancingInfoController extends BaseController { ...@@ -114,10 +115,10 @@ public class FinancingInfoController extends BaseController {
@PutMapping(value = "/updateMoney") @PutMapping(value = "/updateMoney")
@ApiOperation(httpMethod = "PUT", value = "批量放款录入", notes = "批量放款录入") @ApiOperation(httpMethod = "PUT", value = "批量放款录入", notes = "批量放款录入")
@Transactional @Transactional
public ResponseModel<FinancingInfoDto> updateMoney(@RequestParam List<Long> stationIds, @RequestParam Double money , @RequestParam Date date) { public ResponseModel<FinancingInfoDto> updateMoney(@RequestBody FinancingInfoDto financingInfoDto) {
financingInfoServiceImpl.upDateMoney(stationIds,money,date); financingInfoServiceImpl.upDateMoney(financingInfoDto);
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
...@@ -163,11 +164,12 @@ public class FinancingInfoController extends BaseController { ...@@ -163,11 +164,12 @@ public class FinancingInfoController extends BaseController {
@RequestParam(value = "status",required = false) String status, @RequestParam(value = "status",required = false) String status,
@RequestParam(value = "regionalCompaniesCode" ,required = false) String regionalCompaniesCode , @RequestParam(value = "regionalCompaniesCode" ,required = false) String regionalCompaniesCode ,
@RequestParam(value = "region" ,required = false) String region , @RequestParam(value = "region" ,required = false) String region ,
@RequestParam(value = "batchNo" ,required = false) String batchNo ,
@RequestParam(value = "ownersName",required = false) String ownersName){ @RequestParam(value = "ownersName",required = false) String ownersName){
Page<Map<String, Object>> page = new Page<Map<String, Object>>(); Page<Map<String, Object>> page = new Page<Map<String, Object>>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(financingInfoServiceImpl.queryForFinancingInfoPage(page,type,status,regionalCompaniesCode,ownersName, region)); return ResponseHelper.buildResponse(financingInfoServiceImpl.queryForFinancingInfoPage(page,type,status,regionalCompaniesCode,ownersName, region,batchNo));
} }
/** /**
......
...@@ -42,6 +42,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService; ...@@ -42,6 +42,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 服务实现类 * 服务实现类
...@@ -83,13 +84,22 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina ...@@ -83,13 +84,22 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
private RedisLockUtil redisLockUtil; private RedisLockUtil redisLockUtil;
@UserLimits @UserLimits
public Page<Map<String, Object>> queryForFinancingInfoPage(Page<Map<String, Object>> page, String type, String status, String regionalCompaniesCode, String ownersName, String region) { public Page<Map<String, Object>> queryForFinancingInfoPage(Page<Map<String, Object>> page, String type, String status, String regionalCompaniesCode, String ownersName, String region,String batchNo) {
StdUserEmpower orgCode = (StdUserEmpower) redisUtils.get("Emp_" + RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())); StdUserEmpower orgCode = (StdUserEmpower) redisUtils.get("Emp_" + RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()));
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class); ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
List<String> amosOrgCodes = orgCode.getAmosOrgCode(); List<String> amosOrgCodes = orgCode.getAmosOrgCode();
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("ownersName", ownersName); params.put("ownersName", ownersName);
params.put("status", status); if (null != status ){
if(status.equals("未通过")){
params.put("status", Arrays.asList("审核不通过","重新验收"));
}else if (status.equals("已放款")){
params.put("status", Arrays.asList("已放款","放款完成"));
}else {
params.put("status", Arrays.asList(status));
}
}
params.put("regionalCompaniesCode", regionalCompaniesCode); params.put("regionalCompaniesCode", regionalCompaniesCode);
params.put("type", type); params.put("type", type);
params.put("region", region); params.put("region", region);
...@@ -419,15 +429,26 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina ...@@ -419,15 +429,26 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
} }
public void upDateMoney(List<Long> stationIds, Double money, Date date) { public void upDateMoney(FinancingInfoDto financingInfoDto) {
Map<Long, Double> maps = financingInfoDto.getPeasantHouseholds().stream()
.collect(Collectors.toMap(
PeasantHousehold::getSequenceNbr, // key extractor
PeasantHousehold::getDisbursementMoney, // value mapper
(existingValue, newValue) -> existingValue // merge function
));
LambdaQueryWrapper<FinancingInfo> up = new LambdaQueryWrapper<>(); LambdaQueryWrapper<FinancingInfo> up = new LambdaQueryWrapper<>();
up.in(FinancingInfo::getPeasantHouseholdId,stationIds); up.in(FinancingInfo::getPeasantHouseholdId,maps.keySet());
List<FinancingInfo> financingInfos = this.getBaseMapper().selectList(up); List<FinancingInfo> financingInfos = this.getBaseMapper().selectList(up);
financingInfos.forEach(e->{ financingInfos.forEach(e->{
e.setDisbursementMoney(money); e.setDisbursementMoney(maps.get(e.getPeasantHouseholdId()));
e.setDisbursementTime(date); e.setDisbursementTime(financingInfoDto.getDisbursementTime());
e.setUnitPrice(financingInfoDto.getUnitPrice());
if (financingInfoDto.getFiles() != null){
e.setFile(JSON.toJSONString(financingInfoDto.getFiles()));
}
this.getBaseMapper().updateById(e); this.getBaseMapper().updateById(e);
LambdaQueryWrapper<FinancingAuditing> query = new LambdaQueryWrapper<>(); LambdaQueryWrapper<FinancingAuditing> query = new LambdaQueryWrapper<>();
......
...@@ -799,12 +799,8 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto ...@@ -799,12 +799,8 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
@Override @Override
public List<PeasantHousehold> getInfoByIds(String ids) { public List<PeasantHousehold> getInfoByIds(String ids) {
QueryWrapper<PeasantHousehold> queryWrapper = new QueryWrapper<>(); List<String> strings = Arrays.asList(ids.split(","));
queryWrapper.select("sequence_nbr ","owners_name" ,"concat(project_address_name,project_address_detail) as project_address_name"); return this.getBaseMapper().getInfoByIds(strings);
queryWrapper.in("sequence_nbr",Arrays.asList(ids.split(",")));
queryWrapper.eq("is_delete",0);
List<PeasantHousehold> peasantHouseholds = this.getBaseMapper().selectList(queryWrapper);
return peasantHouseholds;
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名--> <!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/ccs.log.%d{yyyy-MM-dd}.log</FileNamePattern> <FileNamePattern>/ccs.log.%d{yyyy-MM-dd}.log</FileNamePattern>
<!--日志文件保留天数--> <!--日志文件保留天数-->
<MaxHistory>7</MaxHistory> <MaxHistory>7</MaxHistory>
</rollingPolicy> </rollingPolicy>
......
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