申请日期统一为业务申请模块日期,申请额度格式校验

master
shijie 4 years ago
parent 7aaf0a799a
commit f289467691
  1. 9
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java
  2. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/BusinessApplicationRequest.java
  3. 26
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/MoneyUtil.java
  4. 2
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgApplyAmountListMapper.xml
  5. 4
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgAssetsInvestigationMapper.xml
  6. 4
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeAssignUserMapper.xml
  7. 4
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgMessageInvestigationMapper.xml

@ -12,6 +12,7 @@ import com.daqing.financial.guarantee.model.response.BusinessApplicationExportRe
import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse; import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse;
import com.daqing.financial.guarantee.service.IDgApplyAmountInfoService; import com.daqing.financial.guarantee.service.IDgApplyAmountInfoService;
import com.daqing.financial.guarantee.service.IDgApplyAmountListService; import com.daqing.financial.guarantee.service.IDgApplyAmountListService;
import com.daqing.financial.guarantee.util.MoneyUtil;
import com.daqing.framework.annotation.Log; import com.daqing.framework.annotation.Log;
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest; import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest;
import com.daqing.framework.domain.guarantee.DgApplyField; import com.daqing.framework.domain.guarantee.DgApplyField;
@ -100,9 +101,15 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA
@Log(detail = "业务申请",level = 3,operationUnit = OperationUnit.APPLYAMOUNTINFO,operationType = OperationType.INSERT) @Log(detail = "业务申请",level = 3,operationUnit = OperationUnit.APPLYAMOUNTINFO,operationType = OperationType.INSERT)
@PostMapping("/businessApplication") @PostMapping("/businessApplication")
@ApiOperation(value = "业务申请") @ApiOperation(value = "业务申请")
public ResponseResult businessApplication(@RequestBody @Valid BusinessApplicationRequest businessApplication){ public ResponseResult businessApplication(@RequestBody BusinessApplicationRequest businessApplication){
boolean legal = MoneyUtil.judgeTwoDecimal(businessApplication.getApplyAmount());
if(legal==true){
int result = applyAmountInfoService.businessApplication(businessApplication); int result = applyAmountInfoService.businessApplication(businessApplication);
return result>0 ? ResponseResult.SUCCESS("上传成功"):ResponseResult.FAIL(40004,"上传失败"); return result>0 ? ResponseResult.SUCCESS("上传成功"):ResponseResult.FAIL(40004,"上传失败");
}else{
return ResponseResult.FAIL(40009,"申请额度格式错误!");
}
} }
/** /**

@ -44,7 +44,7 @@ public class BusinessApplicationRequest implements Serializable {
/** /**
* 申请额度 * 申请额度
*/ */
@Pattern(regexp = "^(([1-9]{1}\\d*)|(0{1}))(\\.\\d{1,2})?$", message = "申请额度格式错误!") //@Pattern(regexp = "^(([1-9]{1}\\d*)|(0{1}))(\\.\\d{1,2})?$", message = "申请额度格式错误!")
@ApiModelProperty(value = "申请额度") @ApiModelProperty(value = "申请额度")
private BigDecimal applyAmount; private BigDecimal applyAmount;

@ -0,0 +1,26 @@
package com.daqing.financial.guarantee.util;
import java.util.regex.Pattern;
public class MoneyUtil {
//两位小数金额校验
public static boolean judgeTwoDecimal(Object obj) {
boolean flag = false;
try {
if (obj != null) {
String source = obj.toString();
// 判断是否是整数或者是携带一位或者两位的小数
Pattern pattern = Pattern.compile("^[+]?([0-9]+(.[0-9]{1,2})?)$");
if (pattern.matcher(source).matches()) {
flag = true;
}
}
} catch (Exception e) {
e.getMessage();
}
return flag;
}
}

@ -17,7 +17,7 @@
</resultMap> </resultMap>
<select id="pageByCondition" resultType="com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse"> <select id="pageByCondition" resultType="com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse">
select au.id,au.role_id,ai.company_id,au.business_id,ai.presenter_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,au.create_time, select au.id,au.role_id,ai.company_id,au.business_id,ai.presenter_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,ai.create_time,
au.status,au.operating_status,cc.name,cc.phone,ps.business_status au.status,au.operating_status,cc.name,cc.phone,ps.business_status
from dg_apply_amount_list au from dg_apply_amount_list au
left join dg_apply_amount_info ai on au.business_id = ai.id left join dg_apply_amount_info ai on au.business_id = ai.id

@ -33,7 +33,7 @@
</resultMap> </resultMap>
<select id="pageByCondition" resultType="com.daqing.financial.guarantee.model.response.AssetsInvestigationListResponse"> <select id="pageByCondition" resultType="com.daqing.financial.guarantee.model.response.AssetsInvestigationListResponse">
select au.id,au.role_id,au.company_id,au.business_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,au.create_time, select au.id,au.role_id,au.company_id,au.business_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,ai.create_time,
au.status,au.operating_status,cc.name,cc.phone,ps.business_status au.status,au.operating_status,cc.name,cc.phone,ps.business_status
from dg_assets_investigation au from dg_assets_investigation au
left join dg_apply_amount_info ai on au.business_id = ai.id left join dg_apply_amount_info ai on au.business_id = ai.id
@ -64,7 +64,7 @@
</select> </select>
<select id="selectListByIds" resultType="com.daqing.financial.guarantee.model.response.AssetsInvestigationListResponse"> <select id="selectListByIds" resultType="com.daqing.financial.guarantee.model.response.AssetsInvestigationListResponse">
select au.id,au.company_id,au.business_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,au.create_time, select au.id,au.company_id,au.business_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,ai.create_time,
au.status,au.operating_status,cc.name,cc.phone,ps.business_status au.status,au.operating_status,cc.name,cc.phone,ps.business_status
from dg_assets_investigation au from dg_assets_investigation au
left join dg_apply_amount_info ai on au.business_id = ai.id left join dg_apply_amount_info ai on au.business_id = ai.id

@ -20,7 +20,7 @@
</resultMap> </resultMap>
<select id="pageByCondition" resultType="com.daqing.financial.guarantee.model.response.GuaranteeListResponse"> <select id="pageByCondition" resultType="com.daqing.financial.guarantee.model.response.GuaranteeListResponse">
select au.id,au.role_id,au.company_id,au.business_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,au.create_time, select au.id,au.role_id,au.company_id,au.business_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,ai.create_time,
au.status,au.operating_status,cc.name,cc.phone,ps.business_status au.status,au.operating_status,cc.name,cc.phone,ps.business_status
from dg_guarantee_assign_user au from dg_guarantee_assign_user au
left join dg_apply_amount_info ai on au.business_id = ai.id left join dg_apply_amount_info ai on au.business_id = ai.id
@ -47,7 +47,7 @@
</select> </select>
<select id="selectListByIds" resultType="com.daqing.financial.guarantee.model.response.GuaranteeListResponse"> <select id="selectListByIds" resultType="com.daqing.financial.guarantee.model.response.GuaranteeListResponse">
select au.id,au.company_id,au.business_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,au.create_time, select au.id,au.company_id,au.business_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,ai.create_time,
au.status,au.operating_status,cc.name,cc.phone,ps.business_status au.status,au.operating_status,cc.name,cc.phone,ps.business_status
from dg_guarantee_assign_user au from dg_guarantee_assign_user au
left join dg_apply_amount_info ai on au.business_id = ai.id left join dg_apply_amount_info ai on au.business_id = ai.id

@ -19,7 +19,7 @@
</resultMap> </resultMap>
<select id="pageByCondition" resultType="com.daqing.financial.guarantee.model.response.MessageInvestigationListResponse"> <select id="pageByCondition" resultType="com.daqing.financial.guarantee.model.response.MessageInvestigationListResponse">
select au.id,au.role_id,au.company_id,au.business_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,au.create_time, select au.id,au.role_id,au.company_id,au.business_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,ai.create_time,
au.status,au.operating_status,cc.name,cc.phone,ps.business_status au.status,au.operating_status,cc.name,cc.phone,ps.business_status
from dg_message_investigation au from dg_message_investigation au
left join dg_apply_amount_info ai on au.business_id = ai.id left join dg_apply_amount_info ai on au.business_id = ai.id
@ -46,7 +46,7 @@
</select> </select>
<select id="selectListByIds" resultType="com.daqing.financial.guarantee.model.response.MessageInvestigationListResponse"> <select id="selectListByIds" resultType="com.daqing.financial.guarantee.model.response.MessageInvestigationListResponse">
select au.id,au.company_id,au.business_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,au.create_time, select au.id,au.company_id,au.business_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,ai.create_time,
au.status,au.operating_status,cc.name,cc.phone,ps.business_status au.status,au.operating_status,cc.name,cc.phone,ps.business_status
from dg_message_investigation au from dg_message_investigation au
left join dg_apply_amount_info ai on au.business_id = ai.id left join dg_apply_amount_info ai on au.business_id = ai.id

Loading…
Cancel
Save