Commit ff62fff1 authored by chenzhao's avatar chenzhao

批量放款录入接口

parent 54f896e9
...@@ -12,6 +12,8 @@ import io.swagger.annotations.ApiOperation; ...@@ -12,6 +12,8 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -100,6 +102,27 @@ public class FinancingInfoController extends BaseController { ...@@ -100,6 +102,27 @@ public class FinancingInfoController extends BaseController {
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(model);
} }
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/updateMoney")
@ApiOperation(httpMethod = "PUT", value = "批量放款录入", notes = "批量放款录入")
@Transactional
public ResponseModel<FinancingInfoDto> updateMoney(@RequestParam List<Long> stationIds, @RequestParam Double money , @RequestParam Date date) {
financingInfoServiceImpl.upDateMoney(stationIds,money,date);
return ResponseHelper.buildResponse();
}
/** /**
* 根据sequenceNbr删除 * 根据sequenceNbr删除
* *
......
...@@ -374,10 +374,10 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina ...@@ -374,10 +374,10 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
public void sendBack(Long peasantHouseholdId ){ public void sendBack(Long peasantHouseholdId ){
//删除投融资表数据 //投融资表数据
LambdaUpdateWrapper<FinancingInfo> financingUp = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<FinancingInfo> financingUp = new LambdaUpdateWrapper<>();
financingUp.eq(FinancingInfo::getPeasantHouseholdId,peasantHouseholdId); financingUp.eq(FinancingInfo::getPeasantHouseholdId,peasantHouseholdId);
financingUp.set(BaseEntity::getIsDelete,true); financingUp.set(FinancingInfo::getStatus,"重新验收");
this.update(null,financingUp); this.update(null,financingUp);
//删除验收审核数据 //删除验收审核数据
...@@ -409,4 +409,30 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina ...@@ -409,4 +409,30 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
} }
public void upDateMoney(List<Long> stationIds, Double money, Date date) {
LambdaQueryWrapper<FinancingInfo> up = new LambdaQueryWrapper<>();
up.in(FinancingInfo::getPeasantHouseholdId,stationIds);
List<FinancingInfo> financingInfos = this.getBaseMapper().selectList(up);
financingInfos.forEach(e->{
e.setDisbursementMoney(money);
e.setDisbursementTime(date);
this.getBaseMapper().updateById(e);
LambdaQueryWrapper<FinancingAuditing> query = new LambdaQueryWrapper<>();
query.eq(FinancingAuditing::getPeasantHouseholdId, e.getPeasantHouseholdId());
query.orderByDesc(BaseEntity::getRecDate);
query.last("limit 1");
FinancingAuditing financingAuditing = financingAuditingService.getBaseMapper().selectOne(query);
Map<String, Object> map = BeanUtil.beanToMap(e);
map.put("approvalStatus","0");
map.put("instanceId",financingAuditing.getInstanceId());
this.execueFlow(map);
});
}
} }
\ 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