Commit ce142a2e authored by chenzhao's avatar chenzhao

存量合同2.0开发 接口补充

parent 6d348521
package com.yeejoin.amos.boot.module.hygf.api.mapper; package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoHistoryDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingInfoHistory; import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingInfoHistory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...@@ -16,4 +17,6 @@ public interface FinancingInfoHistoryMapper extends BaseMapper<FinancingInfoHist ...@@ -16,4 +17,6 @@ public interface FinancingInfoHistoryMapper extends BaseMapper<FinancingInfoHist
List<Map<String,Object>> getFinancingList(String ownersName , List<String> status, String province); List<Map<String,Object>> getFinancingList(String ownersName , List<String> status, String province);
FinancingInfoHistoryDto selectDataInfo(Long peasantHouseholdId);
} }
...@@ -2,8 +2,19 @@ ...@@ -2,8 +2,19 @@
<!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.yeejoin.amos.boot.module.hygf.api.mapper.FinancingInfoHistoryMapper"> <mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.FinancingInfoHistoryMapper">
<select id="selectDataInfo" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoHistoryDto">
SELECT
hfi.*
FROM
`hygf_financing_info` hfi
WHERE
hfi.peasant_household_id = #{peasantHouseholdId}
</select>
<select id="getFinancingList" resultType="java.util.Map"> <select id="getFinancingList" resultType="java.util.Map">
select select sta.* from ( select
hhpf.owners_name ownersName, hhpf.owners_name ownersName,
hhpf.peasant_household_no peasantHouseholdNo, hhpf.peasant_household_no peasantHouseholdNo,
hhpf.province, hhpf.province,
...@@ -17,17 +28,23 @@ ...@@ -17,17 +28,23 @@
from from
hygf_history_peasant_household hhpf hygf_history_peasant_household hhpf
LEFT JOIN hygf_financing_info_history hfih on hhpf.sequence_nbr = hfih.peasant_household_id LEFT JOIN hygf_financing_info_history hfih on hhpf.sequence_nbr = hfih.peasant_household_id
<where>
<if test="ownersName != null and ownersName != ''"> <if test="ownersName != null and ownersName != ''">
and hhpf.owners_name like concat('',#{ownersName},'%') and hhpf.owners_name like concat('',#{ownersName},'%')
</if> </if>
<if test="status != null and status.size() > 0">
and hfih.status in
<foreach collection="status" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="province != null and province != ''"> <if test="province != null and province != ''">
and hhpf.province =#{province} and hhpf.province =#{province}
</if> </if>
</where>
ORDER BY
hhpf.sequence_nbr DESC) as sta
<where>
<if test="status != null and status.size() > 0">
and sta.status in
<foreach collection="status" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select> </select>
</mapper> </mapper>
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.controller; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoDto; import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.IdsDTO; import com.yeejoin.amos.boot.module.hygf.api.dto.IdsDTO;
import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingInfoHistory;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -89,7 +90,8 @@ public class FinancingInfoHistoryController extends BaseController { ...@@ -89,7 +90,8 @@ public class FinancingInfoHistoryController extends BaseController {
@GetMapping(value = "/{sequenceNbr}") @GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个投融信息", notes = "根据sequenceNbr查询单个投融信息") @ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个投融信息", notes = "根据sequenceNbr查询单个投融信息")
public ResponseModel<FinancingInfoHistoryDto> selectOne(@PathVariable Long sequenceNbr) { public ResponseModel<FinancingInfoHistoryDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(financingInfoHistoryServiceImpl.queryBySeq(sequenceNbr));
return ResponseHelper.buildResponse(financingInfoHistoryServiceImpl.getDataInfo(sequenceNbr));
} }
/** /**
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
...@@ -61,6 +62,13 @@ public class FinancingInfoHistoryServiceImpl extends BaseService<FinancingInfoHi ...@@ -61,6 +62,13 @@ public class FinancingInfoHistoryServiceImpl extends BaseService<FinancingInfoHi
} }
public FinancingInfoHistoryDto getDataInfo(Long houseHoldId){
FinancingInfoHistoryDto financingInfoHistoryDto = this.getBaseMapper().selectDataInfo(houseHoldId);
financingInfoHistoryDto.setFiles(JSONArray.parseArray(financingInfoHistoryDto.getFile()));
return financingInfoHistoryDto;
}
public void upDateMoney(FinancingInfoHistoryDto financingInfoDto) { public void upDateMoney(FinancingInfoHistoryDto financingInfoDto) {
Map<Long, Double> maps = financingInfoDto.getPeasantHouseholds().stream() Map<Long, Double> maps = financingInfoDto.getPeasantHouseholds().stream()
...@@ -85,6 +93,5 @@ public class FinancingInfoHistoryServiceImpl extends BaseService<FinancingInfoHi ...@@ -85,6 +93,5 @@ public class FinancingInfoHistoryServiceImpl extends BaseService<FinancingInfoHi
} }
this.getBaseMapper().updateById(e); this.getBaseMapper().updateById(e);
}); });
} }
} }
\ 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