业务申请

master
shijie 4 years ago
parent 6ae5e756a5
commit bacc013196
  1. 7
      dq-financial-api/src/main/java/com/daqing/financial/guarantee/DgApplyAmountInfoControllerApi.java
  2. 5
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/DqFinancialGuaranteeApplication.java
  3. 13
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/config/IPageConfig.java
  4. 66
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java
  5. 11
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgApplyAmountInfoMapper.java
  6. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/BusinessApplicationRequest.java
  7. 67
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/BusinessApplicationListResponse.java
  8. 7
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgApplyAmountInfoService.java
  9. 35
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java
  10. 20
      dq-financial-guarantee/src/main/resources/bootstrap.properties
  11. 15
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgApplyAmountInfoMapper.xml
  12. 80
      dq-financial-hrms/src/main/resources/bootstrap.properties
  13. 4
      dq-framework-common/src/main/java/com/daqing/framework/model/response/PromptSuccess.java
  14. 5
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgApplyAmountInfo.java
  15. 4
      pom.xml

@ -1,10 +1,6 @@
package com.daqing.financial.guarantee;
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest;
import com.daqing.framework.domain.hrms.request.LoginRequest;
import com.daqing.framework.domain.hrms.request.ResetPwdRequest;
import com.daqing.framework.domain.hrms.request.UpdatePwdRequest;
import com.daqing.framework.domain.hrms.request.UserLoginRequest;
import com.daqing.framework.model.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -33,4 +29,7 @@ public interface DgApplyAmountInfoControllerApi {
@ApiOperation(value = "上传文件")
ResponseResult uploadFile(MultipartFile[] files)throws IOException;
@ApiOperation(value = "删除服务器文件")
boolean deleteServerFile(String filePath);
}

@ -9,10 +9,11 @@ import org.springframework.scheduling.annotation.EnableScheduling;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@EnableFeignClients(basePackages = "com.daqing.financial.guarantee.feign")
@EnableDiscoveryClient
//@EnableDiscoveryClient
@SpringBootApplication
@EnableScheduling
//@EnableScheduling
@EnableSwagger2
//@ComponentScan(basePackages = "com.daqing.financial.guarantee.mapper")
@ComponentScan(basePackages = "com.daqing")
public class DqFinancialGuaranteeApplication {

@ -0,0 +1,13 @@
package com.daqing.financial.guarantee.config;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class IPageConfig {
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
}

@ -8,7 +8,9 @@ import com.daqing.financial.guarantee.service.IDgApplyAmountInfoService;
import com.daqing.financial.guarantee.service.impl.DgApplyAmountInfoServiceImpl;
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest;
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo;
import com.daqing.framework.model.response.PromptSuccess;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.utils.PageUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@ -22,7 +24,9 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* <p>
@ -87,19 +91,75 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA
* void transferTo(File dest) //保存到一个目标文件中。
*/
List<String> list = new ArrayList<String>();
for (MultipartFile file : files) { //因为有上传多个文件,所以用的是MultipartFile[]数组,所以要遍历数组保存里面的每一个文件
String filePath = "D:\\myfile\\i\\"; // 暂时设置保存在D盘的files目录下
//String filePath = "http:"+File.separator+File.separator+"www.huorantech.cn"+File.separator+"enclosureFile"+File.separator;// "D:\\myfile\\i\\"; // 暂时设置保存在D盘的files目录下
String filePath =PromptSuccess.FILE_URL_PATH;
System.out.println(" 文件名称: " + file.getOriginalFilename());
System.out.println(" 文件大小: " + file.getSize() / 1024D + "Kb");
System.out.println(" 文件类型: " + file.getContentType());
System.out.println(" 属性名称: " + file.getName());
System.out.println();
//在这里执行调用文件保存的方法....
filePath = filePath + file.getOriginalFilename();
String randomId = UUID.randomUUID().toString().replaceAll("-", "").substring(0, 16);
filePath = filePath + randomId+file.getOriginalFilename();
file.transferTo(new File(filePath));
filePath = "";
list.add(PromptSuccess.ENCLOSUREFILE_URL_PATH+randomId+file.getOriginalFilename());
}
return ResponseResult.SUCCESS(list);
}
/**
* 删除服务上的文件
* @param filePath 路径
* @return
*/
@GetMapping("/deleteServerFile")
public boolean deleteServerFile(@RequestParam("filePath")String filePath){
log.info("filePath=========="+filePath);
boolean delete_flag = false;
String certainPath =PromptSuccess.FILE_URL_PATH;
filePath = certainPath + filePath;
System.out.println("filePath============"+filePath);
File file = new File(filePath);
if (!file.exists()) {
System.out.println("file==============="+file.getName());
return delete_flag;
}
try{
delete_flag = file.delete();
}catch (Exception e){
e.printStackTrace();
}
return ResponseResult.SUCCESS("上传成功");
return delete_flag;
}
/**
* 业务申请列表
* @param
* @return
*/
@PostMapping("/businessApplicationList")
@ApiOperation(value = "业务申请列表")
public ResponseResult businessApplicationList(@RequestParam("page") Integer page,@RequestParam("size") Integer size
/* @RequestParam(value = "CustomerNumberOrName", required = false) String CustomerNumberOrName*/){
PageUtils data = applyAmountInfoService.queryPage(page, size);
return new ResponseResult<PageUtils>().SUCCESS(data);
}
/**
* 业务申请列表
* @param
* @return
*/
@PostMapping("/businessApplicationList2")
@ApiOperation(value = "业务申请列表")
public ResponseResult businessApplicationList2(){
List<DgApplyAmountInfo> data = applyAmountInfoService.selectList();
return new ResponseResult().SUCCESS(data);
}
}

@ -1,8 +1,14 @@
package com.daqing.financial.guarantee.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse;
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
@ -15,4 +21,9 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface DgApplyAmountInfoMapper extends BaseMapper<DgApplyAmountInfo> {
//IPage<DgApplyAmountInfo> pageByCondition(Page page, @Param("queryMsg")String queryMsg);
IPage<DgApplyAmountInfo> pageByCondition(Page page);
List<DgApplyAmountInfo> selectAmountList();
}

@ -160,4 +160,10 @@ public class BusinessApplicationRequest implements Serializable {
@ApiModelProperty(value = "反担保资料和评估报告")
private String assessmentReport;
/**
* 区分保存和提交按钮 true->commit
*/
@ApiModelProperty(value = "区分保存和提交按钮")
private boolean isSaveOrCommit;
}

@ -0,0 +1,67 @@
package com.daqing.financial.guarantee.model.response;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ToString
public class BusinessApplicationListResponse implements Serializable {
/**
* 主键id
*/
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 企业id
*/
@ApiModelProperty(value = "企业id")
private Integer companyId;
/**
* 提单人id
*/
@ApiModelProperty(value = "提单人id")
private Integer presenterId;
/**
* 申请额度
*/
@ApiModelProperty(value = "申请额度")
private BigDecimal applyAmount;
/**
* 申请期限
*/
@ApiModelProperty(value = "申请期限")
private String applyTime;
/**
* 申请时间
*/
@ApiModelProperty(value = "申请时间")
private Date createTime;
/**
* 业务类型
*/
@ApiModelProperty(value = "业务类型")
private String businessType;
/**
* 业务编号
*/
@ApiModelProperty(value = "业务编号")
private String businessCode;
}

@ -3,6 +3,9 @@ package com.daqing.financial.guarantee.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.daqing.financial.guarantee.model.request.BusinessApplicationRequest;
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo;
import com.daqing.framework.utils.PageUtils;
import java.util.List;
/**
* <p>
@ -15,4 +18,8 @@ import com.daqing.framework.domain.guarantee.DgApplyAmountInfo;
public interface IDgApplyAmountInfoService extends IService<DgApplyAmountInfo> {
int businessApplication(BusinessApplicationRequest businessApplication);
PageUtils queryPage(Integer page, Integer size);
List<DgApplyAmountInfo> selectList();
}

@ -1,13 +1,18 @@
package com.daqing.financial.guarantee.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.BusinessApplicationListResponse;
import com.daqing.financial.guarantee.service.IDgApplyAmountInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.util.RedisUtil;
import com.daqing.framework.utils.PageUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
@ -17,6 +22,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* <p>
@ -65,6 +71,11 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
dgApplyAmountInfo.setEnGuaranteeMeasures(businessApplication.getEnGuaranteeMeasures());//反担保措施
dgApplyAmountInfo.setDescription(businessApplication.getDescription());//反担保措施描述
dgApplyAmountInfo.setBusinessType(businessApplication.getBusinessType());//业务类型
if(businessApplication.isSaveOrCommit()==true){
dgApplyAmountInfo.setStatus(1);//状态设置为审核中
}else{
dgApplyAmountInfo.setStatus(0);//保存为草稿
}
dgApplyAmountInfoMapper.insert(dgApplyAmountInfo);
@ -84,8 +95,28 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
dgEnclosureInfo.setMeetingMinutes(businessApplication.getMeetingMinutes());//股东会会议纪要
dgEnclosureInfo.setAssessmentReport(businessApplication.getAssessmentReport());//反担保资料和评估报告
dgEnclosureInfoMapper.insert(dgEnclosureInfo);
return dgEnclosureInfoMapper.insert(dgEnclosureInfo);
}
@Override
public PageUtils queryPage(Integer page, Integer size) {
//分页参数
if (page <= 0) {
page = 1;
}
if (size <= 0) {
size = 10;
}
IPage<DgApplyAmountInfo> positionVO = this.getBaseMapper().pageByCondition(new Page(page, size));
return 0;
return new PageUtils(positionVO);
}
@Override
public List<DgApplyAmountInfo> selectList() {
List<DgApplyAmountInfo>list = dgApplyAmountInfoMapper.selectAmountList();
return list;
}
}

@ -29,33 +29,21 @@ spring.servlet.multipart.max-request-size=10MB
# 单个文件的最大值
spring.servlet.multipart.max-file-size=10MB
## jsp
spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.jsp
# 正式环境(prod)
#服务名称
#spring.application.name=dq-financial-hrms
#spring.application.name=dq-financial-guarantee
##配置中心地址
#spring.cloud.nacos.config.server-addr=120.78.127.12:8848
#spring.cloud.nacos.config.namespace=69614b55-1521-421c-ac58-dbe4a5b01b43
##spring.cloud.nacos.config.group=prod
#spring.cloud.nacos.config.namespace=502bfc93-6e2f-44aa-93ad-f074664c6826
#
#spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml
#spring.cloud.nacos.config.ext-config[0].data-id=dq-financial-guarantee.yml
#spring.cloud.nacos.config.ext-config[0].group=prod
#spring.cloud.nacos.config.ext-config[0].refresh=true
#
#spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml
#spring.cloud.nacos.config.ext-config[1].data-id=datasource.yml
#spring.cloud.nacos.config.ext-config[1].group=prod
#spring.cloud.nacos.config.ext-config[1].refresh=true
#
#spring.cloud.nacos.config.ext-config[2].data-id=other.yml
#spring.cloud.nacos.config.ext-config[2].group=prod
#spring.cloud.nacos.config.ext-config[2].refresh=true
#
#spring.redis.host=127.0.0.1
#spring.redis.port=6379
#spring.redis.password=dq123456

@ -17,5 +17,20 @@
<result column="create_time" property="createTime" />
<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,
ai.status,cc.name,cc.phone
from dg_apply_amount_info ai
left join crms_company_customer ccl on ai.company_id = ccl.id
left join crms_customer cc on cc.id = ccl.customer_id
</select>-->
<select id="pageByCondition" resultMap="BaseResultMap">
select *
from dg_apply_amount_info
</select>
<select id="selectAmountList" resultMap="BaseResultMap">
select *
from dg_apply_amount_info
</select>
</mapper>

@ -1,61 +1,61 @@
#服务名称
#spring.application.name=dq-financial-hrms
##配置中心地址
#spring.cloud.nacos.config.server-addr=192.168.31.142:8848
#spring.cloud.nacos.config.namespace=4c56c2f9-b6a3-4e7b-88b8-b1001e86dfd6
##spring.cloud.nacos.config.group=prod
#
#spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml
#spring.cloud.nacos.config.ext-config[0].group=dev
#spring.cloud.nacos.config.ext-config[0].refresh=true
#
#spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml
#spring.cloud.nacos.config.ext-config[1].group=dev
#spring.cloud.nacos.config.ext-config[1].refresh=true
#
#spring.cloud.nacos.config.ext-config[2].data-id=other.yml
#spring.cloud.nacos.config.ext-config[2].group=dev
#spring.cloud.nacos.config.ext-config[2].refresh=true
#
#spring.redis.host=127.0.0.1
#spring.redis.port=6379
#spring.redis.password=123456
#spring.redis.database=0
#spring.redis.timeout=30000
#spring.redis.jedis.pool.max-active=8
#spring.redis.jedis.pool.max-wait=-1
#spring.redis.jedis.pool.max-idle=8
#spring.redis.jedis.pool.min-idle=0
#
#spring.servlet.multipart.max-file-size=10MB
#spring.servlet.multipart.max-request-size=10MB
# 正式环境(prod)
#服务名称
spring.application.name=dq-financial-hrms
#配置中心地址
spring.cloud.nacos.config.server-addr=120.78.127.12:8848
spring.cloud.nacos.config.namespace=69614b55-1521-421c-ac58-dbe4a5b01b43
spring.cloud.nacos.config.server-addr=192.168.31.142:8848
spring.cloud.nacos.config.namespace=4c56c2f9-b6a3-4e7b-88b8-b1001e86dfd6
#spring.cloud.nacos.config.group=prod
spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml
spring.cloud.nacos.config.ext-config[0].group=prod
spring.cloud.nacos.config.ext-config[0].group=dev
spring.cloud.nacos.config.ext-config[0].refresh=true
spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml
spring.cloud.nacos.config.ext-config[1].group=prod
spring.cloud.nacos.config.ext-config[1].group=dev
spring.cloud.nacos.config.ext-config[1].refresh=true
spring.cloud.nacos.config.ext-config[2].data-id=other.yml
spring.cloud.nacos.config.ext-config[2].group=prod
spring.cloud.nacos.config.ext-config[2].group=dev
spring.cloud.nacos.config.ext-config[2].refresh=true
spring.redis.host=127.0.0.1
spring.redis.port=6379
spring.redis.password=dq123456
spring.redis.password=123456
spring.redis.database=0
spring.redis.timeout=30000
spring.redis.jedis.pool.max-active=8
spring.redis.jedis.pool.max-wait=-1
spring.redis.jedis.pool.max-idle=8
spring.redis.jedis.pool.min-idle=0
spring.redis.jedis.pool.min-idle=0
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB
# 正式环境(prod)
#服务名称
#spring.application.name=dq-financial-hrms
##配置中心地址
#spring.cloud.nacos.config.server-addr=120.78.127.12:8848
#spring.cloud.nacos.config.namespace=69614b55-1521-421c-ac58-dbe4a5b01b43
##spring.cloud.nacos.config.group=prod
#
#spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml
#spring.cloud.nacos.config.ext-config[0].group=prod
#spring.cloud.nacos.config.ext-config[0].refresh=true
#
#spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml
#spring.cloud.nacos.config.ext-config[1].group=prod
#spring.cloud.nacos.config.ext-config[1].refresh=true
#
#spring.cloud.nacos.config.ext-config[2].data-id=other.yml
#spring.cloud.nacos.config.ext-config[2].group=prod
#spring.cloud.nacos.config.ext-config[2].refresh=true
#
#spring.redis.host=127.0.0.1
#spring.redis.port=6379
#spring.redis.password=dq123456
#spring.redis.database=0
#spring.redis.timeout=30000
#spring.redis.jedis.pool.max-active=8
#spring.redis.jedis.pool.max-wait=-1
#spring.redis.jedis.pool.max-idle=8
#spring.redis.jedis.pool.min-idle=0

@ -35,4 +35,8 @@ public class PromptSuccess {
public static final String IMAGE_URL_PATH = "http://www.huorantech.cn/headImg/"; // 数据库/预加载图片路径
public static final String[] LETTERS = {"A","B","C","D","E"}; // 员工姓名重复时自动加的字母,可再添加
public static final String ENCLOSUREFILE_URL_PATH = "http://www.huorantech.cn/enclosureFile/"; // 附件文件存放路径
public static final String FILE_URL_PATH = "//usr//local//nginx//html//admin//enclosureFile//"; // 附件文件存放路径
}

@ -84,4 +84,9 @@ public class DgApplyAmountInfo implements Serializable {
*/
private String description;
/**
* 状态 1->审核中2->已审核3->拒绝4->驳回
*/
private Integer status;
}

@ -18,7 +18,7 @@
<module>dq-financial-hrms-auth</module>
<module>dq-financial-crms</module>
<module>dq-govern-gateway</module>
<!-- <module>dq-financial-workflow</module>
<module>dq-financial-guarantee</module>-->
<!--<module>dq-financial-workflow</module>-->
<module>dq-financial-guarantee</module>
</modules>
</project>

Loading…
Cancel
Save