业务申请,详情,修改,撤销操作

master
shijie 4 years ago
parent 10177e0a23
commit 14003b8bd6
  1. 3
      dq-financial-crms/src/main/resources/mapper/crms/CompanyCustomerDao.xml
  2. 38
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java
  3. 8
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/CrmsFeignService.java
  4. 1
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgApplyAmountInfoMapper.java
  5. 1
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgEnclosureInfoMapper.java
  6. 45
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/BusinessApplicationDetailResponse.java
  7. 7
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgApplyAmountInfoService.java
  8. 99
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java
  9. 6
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgApplyAmountInfoMapper.xml
  10. 5
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgEnclosureInfoMapper.xml
  11. 3
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/request/DgApplyAmountInfoRequest.java
  12. 5
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgEnclosureInfo.java

@ -53,6 +53,9 @@
<if test="applyAmountInfo.name != null and applyAmountInfo.name != '' ">
AND cc.name LIKE CONCAT('%',#{applyAmountInfo.name},'%')
</if>
<if test="applyAmountInfo.companyId != null and applyAmountInfo.companyId != '' ">
AND cu.id = #{applyAmountInfo.companyId}
</if>
</where>
</select>

@ -5,6 +5,7 @@ import com.daqing.financial.guarantee.DgApplyAmountInfoControllerApi;
import com.daqing.financial.guarantee.feign.CrmsFeignService;
import com.daqing.financial.guarantee.feign.HrmsFeignService;
import com.daqing.financial.guarantee.model.request.BusinessApplicationRequest;
import com.daqing.financial.guarantee.model.response.BusinessApplicationDetailResponse;
import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse;
import com.daqing.financial.guarantee.service.IDgApplyAmountInfoService;
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest;
@ -179,14 +180,39 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA
}
/**
* 业务申请列表测试
* @param
* 根据业务id查询业务申请详情
* @param id
* @return
*/
@GetMapping("/businessApplicationDetail")
@ApiOperation(value = "根据业务id查询业务申请详情")
public ResponseResult businessApplicationDetail(Integer id){
BusinessApplicationDetailResponse response = applyAmountInfoService.businessApplicationDetail(id);
return ResponseResult.SUCCESS(response);
}
/**
* 根据业务id修改业务申请内容
* @param businessApplication
* @return
*/
@PostMapping("/updateBusinessApplication")
@ApiOperation(value = "根据业务id修改业务申请内容")
public ResponseResult updateBusinessApplication(@RequestBody BusinessApplicationRequest businessApplication){
int result = applyAmountInfoService.updateBusinessApplication(businessApplication);
return result>0 ? ResponseResult.SUCCESS("修改成功!"):ResponseResult.FAIL(40005,"修改失败!");
}
/**
* 根据业务id撤销业务申请内容
* @param id
* @return
*/
@PostMapping("/businessApplicationList2")
public ResponseResult businessApplicationList2(){
List<DgApplyAmountInfo> data = applyAmountInfoService.selectList();
return new ResponseResult().SUCCESS(data);
@PostMapping("/revokeBusinessApplication")
@ApiOperation(value = "根据业务id撤销业务申请内容")
public ResponseResult revokeBusinessApplication(@RequestParam("id") Integer id){
int result = applyAmountInfoService.revokeBusinessApplication(id);
return result>0 ? ResponseResult.SUCCESS("撤销成功!"):ResponseResult.FAIL(40006,"撤销失败!");
}
}

@ -3,8 +3,8 @@ package com.daqing.financial.guarantee.feign;
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest;
import com.daqing.framework.model.response.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
@ -16,7 +16,7 @@ public interface CrmsFeignService {
/**
* 根据客户编号/客户名称获取企业信息
*/
@GetMapping("/crms/customer/queryCustomerInfoById")
ResponseResult queryCustomerInfoById(@RequestParam DgApplyAmountInfoRequest applyAmountInfo);
@PostMapping("/crms/customer/queryCustomerInfoById")
ResponseResult queryCustomerInfoById(@RequestBody DgApplyAmountInfoRequest applyAmountInfo);
}

@ -23,5 +23,4 @@ public interface DgApplyAmountInfoMapper extends BaseMapper<DgApplyAmountInfo> {
IPage<BusinessApplicationListResponse> pageByCondition(Page page, @Param("CustomerNumberOrName")String CustomerNumberOrName);
List<DgApplyAmountInfo> selectAmountList();
}

@ -15,4 +15,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface DgEnclosureInfoMapper extends BaseMapper<DgEnclosureInfo> {
DgEnclosureInfo selectByCompanyId(Integer id);
}

@ -0,0 +1,45 @@
package com.daqing.financial.guarantee.model.response;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo;
import com.daqing.framework.domain.guarantee.DgEnclosureInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.util.LinkedHashMap;
@Data
@ToString
public class BusinessApplicationDetailResponse implements Serializable {
/**
* 主键id
*/
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 业务申请详细
*/
@ApiModelProperty(value = "业务申请详细")
private DgApplyAmountInfo dgApplyAmountInfo;
/**
* 企业详细
*/
@ApiModelProperty(value = "企业详细")
private LinkedHashMap linkedHashMap;
/**
* 附件详细
*/
@ApiModelProperty(value = "附件详细")
private DgEnclosureInfo dgEnclosureInfo;
}

@ -2,6 +2,7 @@ package com.daqing.financial.guarantee.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.daqing.financial.guarantee.model.request.BusinessApplicationRequest;
import com.daqing.financial.guarantee.model.response.BusinessApplicationDetailResponse;
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo;
import com.daqing.framework.utils.PageUtils;
@ -21,5 +22,9 @@ public interface IDgApplyAmountInfoService extends IService<DgApplyAmountInfo> {
PageUtils queryPage(Integer page, Integer size, String CustomerNumberOrName);
List<DgApplyAmountInfo> selectList();
BusinessApplicationDetailResponse businessApplicationDetail(Integer id);
int updateBusinessApplication(BusinessApplicationRequest id);
int revokeBusinessApplication(Integer id);
}

@ -1,18 +1,26 @@
package com.daqing.financial.guarantee.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.daqing.financial.guarantee.feign.CrmsFeignService;
import com.daqing.financial.guarantee.mapper.DgApplyAmountInfoMapper;
import com.daqing.financial.guarantee.mapper.DgEnclosureInfoMapper;
import com.daqing.financial.guarantee.model.request.BusinessApplicationRequest;
import com.daqing.financial.guarantee.model.response.BusinessApplicationDetailResponse;
import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse;
import com.daqing.financial.guarantee.service.IDgApplyAmountInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest;
import com.daqing.framework.domain.crms.response.CompanyCustomerResponse;
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo;
import com.daqing.framework.domain.guarantee.DgEnclosureInfo;
import com.daqing.framework.domain.hrms.ext.PositionVO;
import com.daqing.framework.domain.hrms.DeptEntity;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.util.RedisUtil;
import com.daqing.framework.utils.PageUtils;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
@ -22,6 +30,8 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
/**
@ -44,6 +54,9 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
@Resource
private RedisTemplate<String,String> redisTemplate;
@Resource
private CrmsFeignService crmsFeignService;
@Override
@Transactional
@ -63,7 +76,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
//申请贷款相关信息
DgApplyAmountInfo dgApplyAmountInfo = new DgApplyAmountInfo();
dgApplyAmountInfo.setCompanyId(dgApplyAmountInfo.getCompanyId());
dgApplyAmountInfo.setPresenterId(Integer.parseInt(userId));
dgApplyAmountInfo.setPresenterId(5);//Integer.parseInt(userId)
dgApplyAmountInfo.setApplyAmount(businessApplication.getApplyAmount());//申请额度
dgApplyAmountInfo.setApplyTime(businessApplication.getApplyTime());//申请期限
dgApplyAmountInfo.setBank(businessApplication.getBank());//贷款银行
@ -71,6 +84,8 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
dgApplyAmountInfo.setEnGuaranteeMeasures(businessApplication.getEnGuaranteeMeasures());//反担保措施
dgApplyAmountInfo.setDescription(businessApplication.getDescription());//反担保措施描述
dgApplyAmountInfo.setBusinessType(businessApplication.getBusinessType());//业务类型
dgApplyAmountInfo.setCreateTime(new Date());
dgApplyAmountInfo.setUpdateTime(new Date());
if(businessApplication.isSaveOrCommit()==true){
dgApplyAmountInfo.setStatus(1);//状态设置为审核中
}else{
@ -81,6 +96,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
//上传附件信息
DgEnclosureInfo dgEnclosureInfo = new DgEnclosureInfo();
dgEnclosureInfo.setBusinessId(dgApplyAmountInfo.getId());//业务id
dgEnclosureInfo.setCompanyId(businessApplication.getCompanyId());//企业Id
dgEnclosureInfo.setBusinessLicense(businessApplication.getBusinessLicense());//营业执照复印件
dgEnclosureInfo.setLegalCardCopy(businessApplication.getLegalCardCopy());//上传法定代表人夫妻及企业实际经营者身份证复印件
@ -113,9 +129,82 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
}
@Override
public List<DgApplyAmountInfo> selectList() {
List<DgApplyAmountInfo>list = dgApplyAmountInfoMapper.selectAmountList();
return list;
public BusinessApplicationDetailResponse businessApplicationDetail(Integer id) {
//根据主键id查询业务申请详细信息
DgApplyAmountInfo dgApplyAmountInfo = this.baseMapper.selectById(id);
System.out.println("业务申请详细========="+dgApplyAmountInfo);
DgApplyAmountInfoRequest applyAmountInfo = new DgApplyAmountInfoRequest();
applyAmountInfo.setCompanyId(dgApplyAmountInfo.getCompanyId());
//根据企业id查询企业详情
ResponseResult result = crmsFeignService.queryCustomerInfoById(applyAmountInfo);
LinkedHashMap linkedList = (LinkedHashMap)result.getData();
/* ObjectMapper mapper = new ObjectMapper();
List<LinkedHashMap> pojos = mapper.convertValue(linkedList, new TypeReference<List<LinkedHashMap>>() {});*/
System.out.println("企业详细============"+linkedList);
//查询附件详细,附件关联业务主键id
DgEnclosureInfo dgEnclosureInfo = dgEnclosureInfoMapper.selectByCompanyId(id);
System.out.println("附件详细=============="+dgEnclosureInfo);
BusinessApplicationDetailResponse businessApplicationDetail= new BusinessApplicationDetailResponse();
businessApplicationDetail.setDgApplyAmountInfo(dgApplyAmountInfo);
businessApplicationDetail.setDgEnclosureInfo(dgEnclosureInfo);
businessApplicationDetail.setLinkedHashMap(linkedList);
return businessApplicationDetail;
}
@Override
public int updateBusinessApplication(BusinessApplicationRequest businessApplication) {
//申请贷款相关信息
DgApplyAmountInfo dgApplyAmountInfo = new DgApplyAmountInfo();
dgApplyAmountInfo.setId(businessApplication.getId());
dgApplyAmountInfo.setCompanyId(dgApplyAmountInfo.getCompanyId());
dgApplyAmountInfo.setApplyAmount(businessApplication.getApplyAmount());//申请额度
dgApplyAmountInfo.setApplyTime(businessApplication.getApplyTime());//申请期限
dgApplyAmountInfo.setBank(businessApplication.getBank());//贷款银行
dgApplyAmountInfo.setAmountWide(businessApplication.getAmountWide());//贷款用途
dgApplyAmountInfo.setEnGuaranteeMeasures(businessApplication.getEnGuaranteeMeasures());//反担保措施
dgApplyAmountInfo.setDescription(businessApplication.getDescription());//反担保措施描述
dgApplyAmountInfo.setBusinessType(businessApplication.getBusinessType());//业务类型
dgApplyAmountInfo.setUpdateTime(new Date());
//根据业务id修改申请贷款信息
this.baseMapper.updateById(dgApplyAmountInfo);
//上传附件信息
DgEnclosureInfo dgEnclosureInfo = new DgEnclosureInfo();
dgEnclosureInfo.setBusinessId(businessApplication.getId());//业务id
dgEnclosureInfo.setCompanyId(businessApplication.getCompanyId());//企业Id
dgEnclosureInfo.setBusinessLicense(businessApplication.getBusinessLicense());//营业执照复印件
dgEnclosureInfo.setLegalCardCopy(businessApplication.getLegalCardCopy());//上传法定代表人夫妻及企业实际经营者身份证复印件
dgEnclosureInfo.setMarriageCopy(businessApplication.getMarriageCopy());//法定代表人夫妻户口本,结婚证(离婚证)复印件
dgEnclosureInfo.setLegalCopy(businessApplication.getLegalCopy());//法定代表人身份证明
dgEnclosureInfo.setCompanyConstitution(businessApplication.getCompanyConstitution());//公司章程
dgEnclosureInfo.setAccountingFirm(businessApplication.getAccountingFirm());//会计师事务所审计的上一年度及本年度审计报告
dgEnclosureInfo.setCompanyCredit(businessApplication.getCompanyCredit());//企业信用报告
dgEnclosureInfo.setCreditReport(businessApplication.getCreditReport());//企业法人夫妇信用报告,实际经营者信用报告
dgEnclosureInfo.setCertificateAuthorization(businessApplication.getCertificateAuthorization());//征信业务授权书,承诺书
dgEnclosureInfo.setTaxCertificate(businessApplication.getTaxCertificate());//增值税纳税申报表首表复印件/完税证明
dgEnclosureInfo.setMeetingMinutes(businessApplication.getMeetingMinutes());//股东会会议纪要
dgEnclosureInfo.setAssessmentReport(businessApplication.getAssessmentReport());//反担保资料和评估报告
//根据业务id删除对应的附件信息
dgEnclosureInfoMapper.delete(new QueryWrapper<DgEnclosureInfo>().eq("business_id",businessApplication.getId()));
System.out.println("来了附件删除操作=================================");
//附件新增
return dgEnclosureInfoMapper.insert(dgEnclosureInfo);
}
@Override
public int revokeBusinessApplication(Integer id) {
//根据id修改当前业务状态
DgApplyAmountInfo dgApplyAmountInfo = new DgApplyAmountInfo();
dgApplyAmountInfo.setStatus(5);//状态为已撤销
dgApplyAmountInfo.setUpdateTime(new Date());
return this.baseMapper.update(dgApplyAmountInfo, new QueryWrapper<DgApplyAmountInfo>().eq("id", id));
}

@ -18,7 +18,7 @@
<result column="update_time" property="updateTime" />
</resultMap>
<select id="pageByCondition" resultType="com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse">
select ai.company_id,ai.presenter_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,ai.create_time,
select ai.id,ai.company_id,ai.presenter_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,ai.create_time,
ai.status,cc.name,cc.phone
from dg_apply_amount_info ai
left join crms_company_customer ccl on ai.company_id = ccl.id
@ -30,8 +30,4 @@
</where>
</select>
<select id="selectAmountList" resultMap="BaseResultMap">
select *
from dg_apply_amount_info
</select>
</mapper>

@ -5,6 +5,7 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.daqing.framework.domain.guarantee.DgEnclosureInfo">
<id column="id" property="id" />
<result column="business_id" property="businessId" />
<result column="company_id" property="companyId" />
<result column="business_license" property="businessLicense" />
<result column="legal_card_copy" property="legalCardCopy" />
@ -20,4 +21,8 @@
<result column="assessment_report" property="assessmentReport" />
</resultMap>
<select id="selectByCompanyId" resultType="com.daqing.framework.domain.guarantee.DgEnclosureInfo">
select * from dg_enclosure_info where business_id=#{id}
</select>
</mapper>

@ -16,5 +16,8 @@ public class DgApplyAmountInfoRequest implements Serializable {
@ApiModelProperty(value = "客户名称")
private String name;
@ApiModelProperty(value = "企业Id")
private Integer companyId;
}

@ -27,6 +27,11 @@ public class DgEnclosureInfo implements Serializable {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 业务id
*/
private Integer businessId;
/**
* 企业id
*/

Loading…
Cancel
Save