|
@@ -57,7 +57,7 @@ public class FinanceProductControllers extends BaseController {
|
|
|
@Autowired
|
|
|
private IZcFinanceContractService zcFinanceContractService;
|
|
|
|
|
|
- private static final String REGEX = "^([1-9][0-9]*)+(\\.[0-9]{1,2})?$";
|
|
|
+ private static final String REGEX = "^(([1-9]{1}\\d*)|(0{1}))(\\.\\d{1,2})?$";
|
|
|
|
|
|
/**
|
|
|
* 查询融资产品列表
|
|
@@ -247,7 +247,7 @@ public class FinanceProductControllers extends BaseController {
|
|
|
String zfpRate = CommonUtil.objToString(map.get("zfpRate"));
|
|
|
if(CommonUtil.isNotEmpty(zfpRate)){
|
|
|
if(!Pattern.matches(REGEX,zfpRate)){
|
|
|
- return AjaxResult.error("请选择正确德资方融资费率");
|
|
|
+ return AjaxResult.error("请输入正确的资方融资费率");
|
|
|
}
|
|
|
}
|
|
|
//资方是否支持返佣
|
|
@@ -256,6 +256,11 @@ public class FinanceProductControllers extends BaseController {
|
|
|
String zfpProfitType = CommonUtil.objToString(map.get("zfpProfitType"));
|
|
|
//资方返佣费率
|
|
|
String zfpProfitRate = CommonUtil.objToString(map.get("zfpProfitRate"));
|
|
|
+ if(CommonUtil.isNotEmpty(zfpProfitRate)){
|
|
|
+ if(!Pattern.matches(REGEX,zfpProfitRate)){
|
|
|
+ return AjaxResult.error("请输入正确的融资返佣费率");
|
|
|
+ }
|
|
|
+ }
|
|
|
//是否需平台审批
|
|
|
String zfpPlatform = CommonUtil.objToString(map.get("zfpPlatform"));
|
|
|
//主键
|
|
@@ -423,7 +428,7 @@ public class FinanceProductControllers extends BaseController {
|
|
|
String zfpRate = CommonUtil.objToString(map.get("zfpRate"));
|
|
|
if(CommonUtil.isNotEmpty(zfpRate)){
|
|
|
if(!Pattern.matches(REGEX,zfpRate)){
|
|
|
- return AjaxResult.error("请选择正确德资方融资费率");
|
|
|
+ return AjaxResult.error("请输入正确的资方融资费率");
|
|
|
}
|
|
|
}
|
|
|
//资方是否支持返佣
|
|
@@ -432,6 +437,11 @@ public class FinanceProductControllers extends BaseController {
|
|
|
String zfpProfitType = CommonUtil.objToString(map.get("zfpProfitType"));
|
|
|
//资方返佣费率
|
|
|
String zfpProfitRate = CommonUtil.objToString(map.get("zfpProfitRate"));
|
|
|
+ if(CommonUtil.isNotEmpty(zfpProfitRate)){
|
|
|
+ if(!Pattern.matches(REGEX,zfpProfitRate)){
|
|
|
+ return AjaxResult.error("请输入正确的资方返佣费率");
|
|
|
+ }
|
|
|
+ }
|
|
|
//是否需平台审批
|
|
|
String zfpPlatform = CommonUtil.objToString(map.get("zfpPlatform"));
|
|
|
|
|
@@ -519,7 +529,7 @@ public class FinanceProductControllers extends BaseController {
|
|
|
int count = zcFinanceProComRelService.count(queryWrapper);
|
|
|
//若已关联提示不可停用
|
|
|
if(count > 0){
|
|
|
- return AjaxResult.error("不可停用!");
|
|
|
+ return AjaxResult.error("该产品已关联授信,不可停用!");
|
|
|
}else {
|
|
|
zcFinanceProduct.setZfpStatus("00");
|
|
|
}
|
|
@@ -531,5 +541,28 @@ public class FinanceProductControllers extends BaseController {
|
|
|
zcFinanceProductService.updateZcFinanceProduct(zcFinanceProduct);
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 删除产品
|
|
|
+ * @param zfpId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PreAuthorize(hasPermi = "service:financeProduct:delete")
|
|
|
+ @Log(title = "融资产品删除", businessType = BusinessType.UPDATE)
|
|
|
+ @DeleteMapping("/{zfpId}")
|
|
|
+ public AjaxResult delete(@PathVariable String zfpId){
|
|
|
+ ZcFinanceProduct zcFinanceProduct = zcFinanceProductService.getById(zfpId);
|
|
|
+ //查询产品是否关联授信
|
|
|
+ LambdaQueryWrapper<ZcFinanceProComRel> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(ZcFinanceProComRel::getZfpcrProductId,zfpId);
|
|
|
+ int count = zcFinanceProComRelService.count(queryWrapper);
|
|
|
+ //若已关联提示不可删除
|
|
|
+ if(count > 0){
|
|
|
+ return AjaxResult.error("该产品已关联授信,不可删除!");
|
|
|
+ }else {
|
|
|
+ zcFinanceProduct.setZfpStatus("02");
|
|
|
+ }
|
|
|
+ //执行逻辑删除
|
|
|
+ zcFinanceProductService.updateZcFinanceProduct(zcFinanceProduct);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
}
|