Merge remote-tracking branch 'origin/master'

master
shijie 4 years ago
commit 05443256b7
  1. 3
      dq-financial-api/src/main/java/com/daqing/financial/hrms/EmployeeControllerApi.java
  2. 16
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java
  3. 14
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgComplianceInvestigationController.java
  4. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java
  5. 42
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java
  6. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/HrmsFeignService.java
  7. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeLetterAssignUserMapper.java
  8. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgLoanCommitteeConsiderMapper.java
  9. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgLoanNoticeMapper.java
  10. 30
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/DgComplianceInvestigationCheckRequest.java
  11. 54
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/DgLoanCommitteeConsiderConsent.java
  12. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/DgLoanCommitteeConsiderRequest.java
  13. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeLetterQueryRequest.java
  14. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/LoanNoticeQueryRequest.java
  15. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/PaymentConfirmationQueryRequest.java
  16. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgComplianceInvestigationInfoResponse.java
  17. 65
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgLoanCommitteeConsiderInfoResponse.java
  18. 4
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/GuaranteeLetterListResponse.java
  19. 4
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/LoanNoticeListResponse.java
  20. 8
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/PaymentConfirmationListResponse.java
  21. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgComplianceInvestigationService.java
  22. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeLetterAssignUserService.java
  23. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgLoanCommitteeConsiderService.java
  24. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgLoanNoticeService.java
  25. 28
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgComplianceInvestigationServiceImpl.java
  26. 16
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeLetterAssignUserServiceImpl.java
  27. 27
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgLoanCommitteeConsiderServiceImpl.java
  28. 5
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgLoanNoticeServiceImpl.java
  29. 8
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgPaymentConfirmationConsiderServiceImpl.java
  30. 56
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgWorkConferenceConsiderServiceImpl.java
  31. 2
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgComplianceInvestigationMapper.xml
  32. 9
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeLetterAssignUserMapper.xml
  33. 2
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgLoanCommitteeConsiderMapper.xml
  34. 16
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgLoanNoticeMapper.xml
  35. 7
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgPaymentConfirmationConsiderMapper.xml
  36. 7
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgLoanCommitteeConsider.java
  37. 127
      dq-framework-utils/src/main/java/com/daqing/framework/utils/NumberToCN.java
  38. 3
      dq-govern-gateway/src/main/resources/jwt.properties

@ -71,4 +71,7 @@ public interface EmployeeControllerApi {
@ApiOperation(value = "给用户赋予一个角色",notes = "给用户赋予一个角色")
ResponseResult saveUserRole(Long userId,Long roleId);
@ApiOperation(value = "根据用户id获取对应的员工名称", notes = "根据用户id获取对应的员工名称")
ResponseResult listEmpNameByUserId(Integer[] userIds);
}

@ -72,6 +72,22 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA
@Autowired
private IDgApplyAmountListService applyAmountListService;
/**
* 获取当前用户角色
*/
@GetMapping("/getRoles")
@ApiOperation(value = "获取当前用户角色")
public ResponseResult getRoles(){
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String token = request.getHeader("token");
String userId = RedisUtil.get("dq:token:" + token);
//获取当前用户拥有的角色ids
String roleIds = RedisUtil.get("dq:userRole:" + userId);
return ResponseResult.SUCCESS(roleIds);
}
/**
* 根据客户编号/客户名称获取企业信息
* @param applyAmountInfo

@ -1,6 +1,7 @@
package com.daqing.financial.guarantee.controller;
import com.daqing.financial.guarantee.model.request.DgComplianceInvestigationCheckRequest;
import com.daqing.financial.guarantee.model.request.DgComplianceInvestigationRequest;
import com.daqing.financial.guarantee.model.response.DgComplianceInvestigationResponse;
import com.daqing.financial.guarantee.service.IDgComplianceInvestigationService;
@ -56,9 +57,10 @@ public class DgComplianceInvestigationController {
*/
@PostMapping("/survey")
@ApiOperation(value = "调查", notes = "调查")
public ResponseResult survey(@RequestParam("iid") Integer iid, @RequestParam("status") Integer status,
@RequestParam("fileUrl") String fileUrl, @RequestParam("opinion") String opinion) {
Boolean result = iDgComplianceInvestigationService.survey(iid, fileUrl, opinion, status);
public ResponseResult survey(@RequestBody DgComplianceInvestigationCheckRequest dgComplianceInvestigationCheckRequest) {
Boolean result = iDgComplianceInvestigationService.survey(dgComplianceInvestigationCheckRequest.getIid(),
iDgComplianceInvestigationService.getFileUrl(dgComplianceInvestigationCheckRequest.getFileUrls()),
dgComplianceInvestigationCheckRequest.getOpinion(), dgComplianceInvestigationCheckRequest.getStatus());
return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL();
}
@ -67,9 +69,9 @@ public class DgComplianceInvestigationController {
*/
@ApiOperation(value = "审核", notes = "审核")
@PostMapping("/check")
public ResponseResult check(@RequestParam("iid") Integer iid, @RequestParam("opinion") String opinion,
@RequestParam("status") Integer status) {
Boolean result = iDgComplianceInvestigationService.check(iid, opinion, status);
public ResponseResult check(@RequestBody DgComplianceInvestigationCheckRequest dgComplianceInvestigationCheckRequest) {
Boolean result = iDgComplianceInvestigationService.check(dgComplianceInvestigationCheckRequest.getIid(),
dgComplianceInvestigationCheckRequest.getOpinion(), dgComplianceInvestigationCheckRequest.getStatus());
return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL();
}

@ -81,8 +81,10 @@ public class DgGuaranteeLetterAssignUserController {
@GetMapping("/exportGuaranteeLetter")
public void guaranteeLetterList(
@ApiParam(name = "businessId", value = "业务id", required = true)
@RequestParam String businessId,HttpServletResponse httpServletResponse){
GuaranteeLetterListResponse response = guaranteeLetterAssignUserService.selectGuaranteeLetter(businessId);
@RequestParam String businessId,
@ApiParam(name = "roleId", value = "角色id", required = true)
@RequestParam String roleId,HttpServletResponse httpServletResponse){
GuaranteeLetterListResponse response = guaranteeLetterAssignUserService.selectGuaranteeLetter(businessId,roleId);
String bank = response.getBank();
String name = response.getName();
Double loanMoney = response.getLoanMoney();

@ -2,10 +2,17 @@ package com.daqing.financial.guarantee.controller;
import com.daqing.financial.guarantee.model.request.*;
import com.daqing.financial.guarantee.model.response.GuaranteeLetterListResponse;
import com.daqing.financial.guarantee.model.response.LoanNoticeListResponse;
import com.daqing.financial.guarantee.service.IDgGuaranteeLetterAssignUserService;
import com.daqing.financial.guarantee.service.IDgLoanNoticeService;
import com.daqing.financial.guarantee.service.impl.DgGuaranteeLetterAssignUserServiceImpl;
import com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.utils.DateUtil;
import com.daqing.framework.utils.NumberToCN;
import com.daqing.framework.utils.PageUtils;
import com.deepoove.poi.XWPFTemplate;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -14,6 +21,9 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
/**
* <p>
@ -61,4 +71,36 @@ public class DgLoanNoticeController {
return result ? ResponseResult.SUCCESS("更新成功!"):ResponseResult.FAIL(40005,"更新失败!");
}
@ApiOperation(value = "导出放款通知")
@GetMapping("/exportLoanNotice")
public void exportLoanNotice(
@ApiParam(name = "businessId", value = "业务id", required = true)
@RequestParam String businessId,
@ApiParam(name = "roleId", value = "角色id", required = true)
@RequestParam String roleId,HttpServletResponse httpServletResponse){
LoanNoticeListResponse response = loanNoticeService.selectLoanNotice(businessId,roleId);
String bank = response.getBank();
String name = response.getName();
Double loanMoney = response.getLoanMoney();
BigDecimal numberOfMoney = new BigDecimal(loanMoney*10000);
String money = NumberToCN.number2CNMontrayUnit(numberOfMoney);
XWPFTemplate template = XWPFTemplate.compile("D:\\template\\templateTwo.docx").render(
new HashMap<String, Object>(){{
put("bankName", bank);
put("clientName", name);
put("loanMoney", money);
}});
try {
httpServletResponse.setContentType("application/msword");
String filePath = name + "放款通知.docx";
String fileName = new String(filePath.getBytes(), "ISO-8859-1");
httpServletResponse.addHeader("Content-Disposition", "filename=" + fileName);
template.write(httpServletResponse.getOutputStream());
} catch (IOException e) {
e.printStackTrace();
}
}
}

@ -58,6 +58,9 @@ public interface HrmsFeignService {
@PostMapping("hrms/employee/insertUsrRole")
ResponseResult insertUsrRole(@RequestBody List<DgGuaranteePO> list);
/**
* 根据用户id获取对应的员工名称
*/
@GetMapping("/hrms/employee/listEmpNameByUserId")
ResponseResult<List<EmployeeVO>> listEmpNameByUserId(@RequestParam("userIds") Integer[] userIds);
}

@ -25,5 +25,5 @@ public interface DgGuaranteeLetterAssignUserMapper extends BaseMapper<DgGuarante
List<GuaranteeLetterListResponse> selectBatchData(List<String> idList);
GuaranteeLetterListResponse selectGuaranteeLetter(String businessId);
GuaranteeLetterListResponse selectGuaranteeLetter(String businessId,String roleId);
}

@ -3,6 +3,7 @@ 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.request.DgLoanCommitteeConsiderConsent;
import com.daqing.financial.guarantee.model.request.DgLoanCommitteeConsiderRequest;
import com.daqing.financial.guarantee.model.response.AuditOpinionResponse;
import com.daqing.financial.guarantee.model.response.DgLoanCommitteeConsiderResponse;
@ -30,7 +31,7 @@ public interface DgLoanCommitteeConsiderMapper extends BaseMapper<DgLoanCommitte
List<DgLoanCommitteeConsiderResponse> excelList(@Param("ids") List<Integer> ids);
Boolean check(@Param("lr") DgLoanCommitteeConsiderRequest dgLoanCommitteeConsiderRequest, @Param("userId") Integer userId,
Boolean check(@Param("lr") DgLoanCommitteeConsiderConsent dgLoanCommitteeConsiderConsent, @Param("userId") Integer userId,
@Param("status") Integer status, @Param("operatingStatus") Integer operatingStatus, @Param("date") Date date);
Boolean TheJudgesDrawn(@Param("businessId") Integer businessId, @Param("agreePerson") String agreePerson);

@ -23,4 +23,6 @@ public interface DgLoanNoticeMapper extends BaseMapper<DgLoanNotice> {
IPage<LoanNoticeListResponse> pageByCondition(Page page, List<String> roleIdList, Integer userId, Integer status, String customerNumberOrName);
List<LoanNoticeListResponse> selectBatchData(List<String> idList);
LoanNoticeListResponse selectLoanNotice(String businessId, String roleId);
}

@ -0,0 +1,30 @@
package com.daqing.financial.guarantee.model.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
/**
* 合规调查调查和审核请求参数
*
* @auther River
* @date 2020/12/2 14:21
*/
@Data
@ToString
public class DgComplianceInvestigationCheckRequest implements Serializable {
@ApiModelProperty("iid")
private Integer iid;
@ApiModelProperty("调查/审核操作,1:同意,2:驳回,3:拒绝")
private Integer status;
@ApiModelProperty("附件,审核没有")
private String[] fileUrls;
@ApiModelProperty("调查/审核意见")
private String opinion;
}

@ -0,0 +1,54 @@
package com.daqing.financial.guarantee.model.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* @auther River
* @date 2020/12/2 17:27
*/
@Data
@ToString
public class DgLoanCommitteeConsiderConsent implements Serializable {
@NotNull(message = "id不能为空")
@ApiModelProperty("id")
private Integer id;
@ApiModelProperty("议定事项")
private String agreedItems;
@ApiModelProperty("附加事项")
private String additionalItems;
@ApiModelProperty("贷款金额")
private Double loanMoney;
@ApiModelProperty("贷款期限")
private String loanTern;
@ApiModelProperty("同意")
private String agreePerson;
@ApiModelProperty("不同意")
private String disagreePerson;
@ApiModelProperty("附件")
private String fileUrl;
@ApiModelProperty("操作,1:通过,2:拒绝,3:驳回")
private Integer status;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty("贷审会通过时间")
private Date passingTime;
@ApiModelProperty("拒绝/驳回意见")
private String refuseOpinion;
}

@ -42,7 +42,7 @@ public class DgLoanCommitteeConsiderRequest implements Serializable {
private String disagreePerson;
@ApiModelProperty("附件")
private String fileUrl;
private String[] fileUrls;
@ApiModelProperty("操作,1:通过,2:拒绝,3:驳回")
private Integer status;

@ -13,7 +13,7 @@ import lombok.Data;
public class GuaranteeLetterQueryRequest {
@ApiModelProperty(value = "当前页码,默认为第一页")
private Integer page = 1;
private Integer page = 0;
@ApiModelProperty(value = "每页记录数,默认显示10条")
private Integer size = 10;

@ -15,7 +15,7 @@ import javax.validation.constraints.NotNull;
public class LoanNoticeQueryRequest {
@ApiModelProperty(value = "当前页码,默认为第一页")
private Integer page = 1;
private Integer page = 0;
@ApiModelProperty(value = "每页记录数,默认显示10条")
private Integer size = 10;

@ -15,7 +15,7 @@ import javax.validation.constraints.NotNull;
public class PaymentConfirmationQueryRequest {
@ApiModelProperty(value = "当前页码,默认为第一页")
private Integer page = 1;
private Integer page = 0;
@ApiModelProperty(value = "每页记录数,默认显示10条")
private Integer size = 10;

@ -23,7 +23,7 @@ public class DgComplianceInvestigationInfoResponse implements Serializable {
private DgAssetsInvestigationResponse assetsResponse;
@ApiModelProperty("合规调查的附件文件")
private String fileUrl;
private String[] fileUrls;
@ApiModelProperty("合规调查的审核(调查)意见")
private String opinion;

@ -0,0 +1,65 @@
package com.daqing.financial.guarantee.model.response;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
/**
* 贷审会查看响应类
*
* @auther River
* @date 2020/12/2 17:34
*/
@Data
@ToString
public class DgLoanCommitteeConsiderInfoResponse implements Serializable {
/**
* 贷审会议定事项
*/
@ApiModelProperty("贷审会议定事项")
private String agreedItems;
/**
* 贷审会附加事项
*/
@ApiModelProperty("贷审会附加事项")
private String additionalItems;
/**
* 贷款金额贷审会意见
*/
@ApiModelProperty("贷款金额(贷审会意见)")
private Integer loanMoney;
/**
* 贷款期限贷审会意见
*/
@ApiModelProperty("贷款期限(贷审会意见)")
private String loanTern;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
@ApiModelProperty("贷审会时间")
private Date time;
/**
* 同意贷审委员
*/
@ApiModelProperty("同意(贷审委员)")
private String agreePerson;
/**
* 不同意贷审委员
*/
@ApiModelProperty("不同意(贷审委员)")
private String disagreePerson;
/**
* 附件会议记录
*/
@ApiModelProperty("附件(会议记录)")
private String[] fileUrls;
}

@ -32,6 +32,10 @@ public class GuaranteeLetterListResponse {
@ApiModelProperty("唯一标识")
private Integer id;
@ExcelIgnore
@ApiModelProperty("角色id")
private Integer roleId;
@ExcelIgnore
@ApiModelProperty("银行名称")
private String bank;

@ -20,6 +20,10 @@ import java.util.Date;
@Data
public class LoanNoticeListResponse {
@ExcelIgnore
@ApiModelProperty("角色id")
private Integer roleId;
@ExcelIgnore
@ApiModelProperty("唯一标识")
private Integer id;

@ -20,6 +20,14 @@ import java.util.Date;
@Data
public class PaymentConfirmationListResponse {
@ExcelIgnore
@ApiModelProperty("法规经理唯一标识")
private Integer isFgJl;
@ExcelIgnore
@ApiModelProperty("角色id")
private Integer roleId;
@ExcelIgnore
@ApiModelProperty("唯一标识")
private Integer id;

@ -30,4 +30,6 @@ public interface IDgComplianceInvestigationService extends IService<DgCompliance
DgComplianceInvestigationInfoResponse query(Integer iid);
Boolean excelExport(HttpServletResponse response, List<String> ids);
String getFileUrl(String[] fileUrls);
}

@ -29,5 +29,5 @@ public interface IDgGuaranteeLetterAssignUserService extends IService<DgGuarante
void batchExport(HttpServletResponse response, String ids) throws IOException;
GuaranteeLetterListResponse selectGuaranteeLetter(String businessId);
GuaranteeLetterListResponse selectGuaranteeLetter(String businessId,String roleId);
}

@ -2,6 +2,7 @@ package com.daqing.financial.guarantee.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.daqing.financial.guarantee.model.request.DgLoanCommitteeConsiderRequest;
import com.daqing.financial.guarantee.model.response.DgLoanCommitteeConsiderInfoResponse;
import com.daqing.framework.domain.guarantee.DgLoanCommitteeConsider;
import com.daqing.framework.utils.PageUtils;
@ -24,7 +25,7 @@ public interface IDgLoanCommitteeConsiderService extends IService<DgLoanCommitte
List<String> getJudges(Integer id);
DgLoanCommitteeConsider query(Integer id);
DgLoanCommitteeConsiderInfoResponse query(Integer id);
Boolean excelExport(HttpServletResponse response, List<String> ids);
}

@ -3,6 +3,7 @@ package com.daqing.financial.guarantee.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.daqing.financial.guarantee.model.request.LoanNoticeQueryRequest;
import com.daqing.financial.guarantee.model.request.LoanNoticeUpdateRequest;
import com.daqing.financial.guarantee.model.response.LoanNoticeListResponse;
import com.daqing.framework.domain.guarantee.DgLoanNotice;
import com.daqing.framework.utils.PageUtils;
@ -25,4 +26,6 @@ public interface IDgLoanNoticeService extends IService<DgLoanNotice> {
boolean updateLoanNotice(LoanNoticeUpdateRequest loanNoticeUpdateRequest);
void batchExport(HttpServletResponse response, String ids) throws IOException;
LoanNoticeListResponse selectLoanNotice(String businessId, String roleId);
}

@ -430,11 +430,16 @@ public class DgComplianceInvestigationServiceImpl extends ServiceImpl<DgComplian
AssetsDetailResponse assetsDetailResponse = dgAssetsInvestigationService.assetsDetail(dgAssetsInvestigationId);
// 合规附件和意见
DgComplianceInvestigation dgComplianceInvestigation = this.getBaseMapper().queryDgComplianceInvestigation(iid);
if (dgComplianceInvestigation.getFile() != null) {
String[] fileUrls = dgComplianceInvestigation.getFile().split(",");
dgComplianceInvestigationInfoResponse.setFileUrls(fileUrls);
}
if (dgComplianceInvestigation.getOpinion() != null) {
dgComplianceInvestigationInfoResponse.setOpinion(dgComplianceInvestigation.getOpinion());
}
// 统一返回
dgComplianceInvestigationInfoResponse.setGuaranteeDetailResponse(guaranteeDetailResponse);
dgComplianceInvestigationInfoResponse.setAssetsResponse(assetsDetailResponse.getAssetsResponse());
dgComplianceInvestigationInfoResponse.setFileUrl(dgComplianceInvestigation.getFile());
dgComplianceInvestigationInfoResponse.setOpinion(dgComplianceInvestigation.getOpinion());
return dgComplianceInvestigationInfoResponse;
}
@ -461,6 +466,25 @@ public class DgComplianceInvestigationServiceImpl extends ServiceImpl<DgComplian
return false;
}
/**
* 将接收的数组图片拼装成字符串类型
*/
@Override
public String getFileUrl(String[] fileUrls) {
StringBuilder fileUrl = new StringBuilder();
if (null == fileUrls || fileUrls.length == 0) {
return fileUrl.toString();
}
for (int i = 0; i < fileUrls.length; i++) {
if (i == fileUrls.length - 1) {
fileUrl.append(fileUrls[i]);
} else {
fileUrl.append(fileUrls[i]).append(",");
}
}
return fileUrl.toString();
}
/**
* 获取当前登录用户信息

@ -57,8 +57,8 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
@Override
public GuaranteeLetterListResponse selectGuaranteeLetter(String businessId) {
GuaranteeLetterListResponse response = baseMapper.selectGuaranteeLetter(businessId);
public GuaranteeLetterListResponse selectGuaranteeLetter(String businessId,String roleId) {
GuaranteeLetterListResponse response = baseMapper.selectGuaranteeLetter(businessId,roleId);
return response;
}
@ -100,7 +100,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
List<GuaranteeLetterListResponse> records = guaranteeLetterVO.getRecords();
records.forEach(guaranteeLetterListResponse -> {
//角色为法规部经理则设置值
if (roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID))){
if (guaranteeLetterListResponse.getRoleId().equals(PromptSuccess.FG_JL_ID)){
guaranteeLetterListResponse.setIsFgJl(1);
}
});
@ -487,19 +487,21 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
AuditProcessUtil.save(businessId,account,"指派A角",auditOpinion,8);
//更新成功后,更新b角数据及更新法规部经理数据
if (i > 0){
//更新b用户的审核状态为驳回
//更新b用户的审核状态为驳回,操作状态为已处理
QueryWrapper<DgGuaranteeLetterAssignUser> tempB = new QueryWrapper<>();
tempB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID);
DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserB = baseMapper.selectOne(tempB);
dgGuaranteeLetterAssignUserB.setStatus(StatusCode.SP_REJECT);
dgGuaranteeLetterAssignUserB.setOperatingStatus(StatusCode.CZ_PROCESSED);
baseMapper.updateById(dgGuaranteeLetterAssignUserB);
//更新法规部经理的审核状态为驳回,操作状态为待处理
//更新法规部经理的审核状态为驳回,操作状态为待处理,清空审批意见
QueryWrapper<DgGuaranteeLetterAssignUser> tempFG = new QueryWrapper<>();
tempFG.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID);
DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserFG = baseMapper.selectOne(tempFG);
dgGuaranteeLetterAssignUserFG.setStatus(StatusCode.SP_REJECT);
dgGuaranteeLetterAssignUserFG.setOperatingStatus(StatusCode.CZ_ON_HAND);
dgGuaranteeLetterAssignUserFG.setAuditOpinion("");
int update = baseMapper.updateById(dgGuaranteeLetterAssignUserFG);
//添加成功,返回操作结果
log.info(update > 0 ? "a角驳回更新成功" : "a角驳回更新失败");
@ -617,11 +619,12 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
AuditProcessUtil.save(businessId,account,"指派B角",auditOpinion,8);
//更新成功后,更新a角数据及更新法规部经理数据
if (i > 0){
//更新a用户的审核状态为驳回
//更新a用户的审核状态为驳回,操作状态为已处理
QueryWrapper<DgGuaranteeLetterAssignUser> tempA = new QueryWrapper<>();
tempA.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID);
DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserA = baseMapper.selectOne(tempA);
dgGuaranteeLetterAssignUserA.setStatus(StatusCode.SP_REJECT);
dgGuaranteeLetterAssignUserA.setStatus(StatusCode.CZ_PROCESSED);
baseMapper.updateById(dgGuaranteeLetterAssignUserA);
//更新法规部经理的审核状态为驳回,操作状态为待处理
@ -629,6 +632,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
tempFG.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID);
DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserFG = baseMapper.selectOne(tempFG);
dgGuaranteeLetterAssignUserFG.setStatus(StatusCode.SP_REJECT);
dgGuaranteeLetterAssignUserFG.setAuditOpinion("");
dgGuaranteeLetterAssignUserFG.setOperatingStatus(StatusCode.CZ_ON_HAND);
int update = baseMapper.updateById(dgGuaranteeLetterAssignUserFG);
//添加成功,返回操作结果

@ -1,10 +1,13 @@
package com.daqing.financial.guarantee.service.impl;
import ch.qos.logback.core.joran.util.beans.BeanUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.daqing.financial.guarantee.mapper.DgComplianceInvestigationMapper;
import com.daqing.financial.guarantee.mapper.DgLoanCommitteeConsiderMapper;
import com.daqing.financial.guarantee.model.request.DgLoanCommitteeConsiderConsent;
import com.daqing.financial.guarantee.model.request.DgLoanCommitteeConsiderRequest;
import com.daqing.financial.guarantee.model.response.DgLoanCommitteeConsiderInfoResponse;
import com.daqing.financial.guarantee.model.response.DgLoanCommitteeConsiderResponse;
import com.daqing.financial.guarantee.service.IDgGuaranteeLetterAssignUserService;
import com.daqing.financial.guarantee.service.IDgLoanCommitteeConsiderService;
@ -20,6 +23,7 @@ import com.daqing.framework.model.response.PromptSuccess;
import com.daqing.framework.util.RedisUtil;
import com.daqing.framework.utils.PageUtils;
import com.daqing.framework.utils.excel.ExcelUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
@ -47,6 +51,9 @@ public class DgLoanCommitteeConsiderServiceImpl extends ServiceImpl<DgLoanCommit
@Autowired
private DgComplianceInvestigationMapper dgComplianceInvestigationMapper;
@Autowired
private DgComplianceInvestigationServiceImpl dgComplianceInvestigationService;
@Autowired
private IDgGuaranteeLetterAssignUserService guaranteeLetterAssignUserService;
@ -92,11 +99,15 @@ public class DgLoanCommitteeConsiderServiceImpl extends ServiceImpl<DgLoanCommit
if (dgLoanCommitteeConsiderRequest.getAdditionalItems() == null || dgLoanCommitteeConsiderRequest.getAdditionalItems().length() == 0
|| dgLoanCommitteeConsiderRequest.getAgreedItems() == null || dgLoanCommitteeConsiderRequest.getAgreedItems().length() == 0
|| dgLoanCommitteeConsiderRequest.getLoanMoney() == null || dgLoanCommitteeConsiderRequest.getLoanTern() == null
|| dgLoanCommitteeConsiderRequest.getLoanTern().length() == 0 || dgLoanCommitteeConsiderRequest.getFileUrl() == null
|| dgLoanCommitteeConsiderRequest.getFileUrl().length() == 0) {
|| dgLoanCommitteeConsiderRequest.getLoanTern().length() == 0 || dgLoanCommitteeConsiderRequest.getFileUrls() == null
|| dgLoanCommitteeConsiderRequest.getFileUrls().length == 0) {
ExceptionCast.cast(GuaranteeCode.LOAN_MESSAGE_NOT_NULL);
}
Boolean result = this.getBaseMapper().check(dgLoanCommitteeConsiderRequest, Integer.getInteger(userId), StatusCode.SP_REVIEWED, StatusCode.CZ_PROCESSED, new Date());
String fileUrl = dgComplianceInvestigationService.getFileUrl(dgLoanCommitteeConsiderRequest.getFileUrls());
DgLoanCommitteeConsiderConsent consent = new DgLoanCommitteeConsiderConsent();
BeanUtils.copyProperties(dgLoanCommitteeConsiderRequest, consent);
consent.setFileUrl(fileUrl);
Boolean result = this.getBaseMapper().check(consent, Integer.getInteger(userId), StatusCode.SP_REVIEWED, StatusCode.CZ_PROCESSED, new Date());
if (result) {
// 在担保函表中插入条数据
DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = new DgGuaranteeLetterAssignUser();
@ -165,11 +176,17 @@ public class DgLoanCommitteeConsiderServiceImpl extends ServiceImpl<DgLoanCommit
* 查看
*/
@Override
public DgLoanCommitteeConsider query(Integer id) {
public DgLoanCommitteeConsiderInfoResponse query(Integer id) {
if (id == null) {
ExceptionCast.cast(CommonCode.INVALID_PARAM);
}
return this.getBaseMapper().query(id);
DgLoanCommitteeConsider dgLoanCommitteeConsider = this.getBaseMapper().query(id);
DgLoanCommitteeConsiderInfoResponse dgLoanCommitteeConsiderInfoResponse = new DgLoanCommitteeConsiderInfoResponse();
if (dgLoanCommitteeConsider.getFile() != null) {
dgLoanCommitteeConsiderInfoResponse.setFileUrls(dgLoanCommitteeConsider.getFile().split(","));
}
BeanUtils.copyProperties(dgLoanCommitteeConsider, dgLoanCommitteeConsiderInfoResponse);
return dgLoanCommitteeConsiderInfoResponse;
}
/**

@ -160,4 +160,9 @@ public class DgLoanNoticeServiceImpl extends ServiceImpl<DgLoanNoticeMapper, DgL
log.info("《《《《《数据更新失败,请确保数据完整》》》》》");
return false;
}
@Override
public LoanNoticeListResponse selectLoanNotice(String businessId, String roleId) {
return baseMapper.selectLoanNotice(businessId,roleId);
}
}

@ -10,6 +10,7 @@ import com.daqing.financial.guarantee.mapper.DgPaymentConfirmationConsiderMapper
import com.daqing.financial.guarantee.model.request.PaymentConfirmationQueryRequest;
import com.daqing.financial.guarantee.model.request.PaymentConfirmationUpdateRequest;
import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse;
import com.daqing.financial.guarantee.model.response.GuaranteeLetterListResponse;
import com.daqing.financial.guarantee.model.response.LoanNoticeListResponse;
import com.daqing.financial.guarantee.model.response.PaymentConfirmationListResponse;
import com.daqing.financial.guarantee.service.IDgPaymentConfirmationConsiderService;
@ -82,6 +83,13 @@ public class DgPaymentConfirmationConsiderServiceImpl extends ServiceImpl<DgPaym
List<String> roleIdList = Arrays.asList(ids);
//分页条件查询
paymentConfirmationVO = baseMapper.pageByCondition(new Page(page,size),roleIdList,userId,status,customerNumberOrName);
List<PaymentConfirmationListResponse> records = paymentConfirmationVO.getRecords();
records.forEach(paymentConfirmationListResponse -> {
//角色为法规部经理则设置值
if (paymentConfirmationListResponse.getRoleId().equals(PromptSuccess.FG_JL_ID)){
paymentConfirmationListResponse.setIsFgJl(1);
}
});
}
return new PageUtils(paymentConfirmationVO);
}

@ -104,8 +104,17 @@ public class DgWorkConferenceConsiderServiceImpl extends ServiceImpl<DgWorkConfe
// 根据userId获取对应的员工姓名
ResponseResult<List<EmployeeVO>> responseResult = hrmsFeignService.listEmpNameByUserId(userIds);
System.out.println(responseResult.getData());
// 将对应的userId转换为name
List<DgWorkConferenceResponse> workConferenceResponses = this.transitionUserName(dgWorkConferencePOS, responseResult.getData());
List<DgWorkConferenceResponse> workConferenceResponses = new ArrayList<>();
if (responseResult.getData() != null) {
// 将对应的userId转换为name
workConferenceResponses = this.transitionUserName(dgWorkConferencePOS, responseResult.getData());
} else {
for (int i = 0; i < dgWorkConferencePOS.size(); i++) {
DgWorkConferenceResponse workConferenceResponse = new DgWorkConferenceResponse();
BeanUtils.copyProperties(dgWorkConferencePOS.get(i),workConferenceResponse);
workConferenceResponses.add(workConferenceResponse);
}
}
IPage<DgWorkConferenceResponse> iPage = new Page<>();
BeanUtils.copyProperties(list, iPage);
iPage.setRecords(workConferenceResponses);
@ -261,21 +270,23 @@ public class DgWorkConferenceConsiderServiceImpl extends ServiceImpl<DgWorkConfe
userIds[4] = auditOpinion.getRegulationEmpId();
ResponseResult<List<EmployeeVO>> responseResult = hrmsFeignService.listEmpNameByUserId(userIds);
List<EmployeeVO> employees = responseResult.getData();
for (EmployeeVO employee : employees) {
if (Objects.equals(employee.getId(), auditOpinion.getAEmpId().longValue())){
auditOpinionResponse.setAName(employee.getName());
}
if (Objects.equals(employee.getId(), auditOpinion.getBEmpId().longValue())){
auditOpinionResponse.setBName(employee.getName());
}
if (Objects.equals(employee.getId(), auditOpinion.getAssetEmpId().longValue())){
auditOpinionResponse.setAssetName(employee.getName());
}
if (Objects.equals(employee.getId(), auditOpinion.getMessageEmpId().longValue())){
auditOpinionResponse.setMessageName(employee.getName());
}
if (Objects.equals(employee.getId(), auditOpinion.getRegulationEmpId().longValue())){
auditOpinionResponse.setRegulationName(employee.getName());
if (employees != null){
for (EmployeeVO employee : employees) {
if (Objects.equals(employee.getId(), auditOpinion.getAEmpId().longValue())) {
auditOpinionResponse.setAName(employee.getName());
}
if (Objects.equals(employee.getId(), auditOpinion.getBEmpId().longValue())) {
auditOpinionResponse.setBName(employee.getName());
}
if (Objects.equals(employee.getId(), auditOpinion.getAssetEmpId().longValue())) {
auditOpinionResponse.setAssetName(employee.getName());
}
if (Objects.equals(employee.getId(), auditOpinion.getMessageEmpId().longValue())) {
auditOpinionResponse.setMessageName(employee.getName());
}
if (Objects.equals(employee.getId(), auditOpinion.getRegulationEmpId().longValue())) {
auditOpinionResponse.setRegulationName(employee.getName());
}
}
}
BeanUtils.copyProperties(auditOpinion, auditOpinionResponse);
@ -327,7 +338,16 @@ public class DgWorkConferenceConsiderServiceImpl extends ServiceImpl<DgWorkConfe
// 根据userId获取对应的员工姓名
ResponseResult<List<EmployeeVO>> responseResult = hrmsFeignService.listEmpNameByUserId(userIds);
System.out.println(responseResult.getData());
List<DgWorkConferenceResponse> excelList = this.transitionUserName(list, responseResult.getData());
List<DgWorkConferenceResponse> excelList = new ArrayList<>();
if (responseResult.getData() != null) {
excelList = this.transitionUserName(list, responseResult.getData());
}else {
for (DgWorkConferencePO dgWorkConferencePO : list) {
DgWorkConferenceResponse workConferenceResponse = new DgWorkConferenceResponse();
BeanUtils.copyProperties(dgWorkConferencePO, workConferenceResponse);
excelList.add(workConferenceResponse);
}
}
try {
ExcelUtil.writeExcelWithSheets(response, excelList, "工作会数据一览表", "NO.1", new DgWorkConferenceResponse())
.finish();

@ -103,7 +103,7 @@
<!-- 根据id查询合规调查表详情 -->
<select id="queryDgComplianceInvestigation" parameterType="integer" resultType="com.daqing.framework.domain.guarantee.DgComplianceInvestigation">
SELECT file_url,opinion
SELECT file_url AS file,opinion AS opinion
FROM dg_compliance_investigation
WHERE id = #{iid}
</select>

@ -30,11 +30,12 @@
<result column="operating_status" property="operatingStatus" />
<result column="business_status" property="businessStatus" />
<result column="business_id" property="businessId" />
<result column="role_id" property="roleId" />
</resultMap>
<select id="pageByCondition" resultMap="GuaranteeLetterListResponseMap">
select lau.id,aai.business_code,cc.name,cc.phone,aai.business_type,lcc.loan_money,lcc.loan_tern,aai.create_time,
lau.status,aai.bank,lcc.passing_time,lcc.file,lau.audit_opinion,lau.operating_status,bps.business_status,lau.business_id
select lau.id,aai.business_code,cc.name,cc.phone,aai.business_type,lcc.loan_money,lcc.loan_tern,aai.create_time,lau.status,
aai.bank,lcc.passing_time,lcc.file,lau.audit_opinion,lau.operating_status,bps.business_status,lau.business_id,lau.role_id
from dg_guarantee_letter_assign_user lau
left join dg_apply_amount_info aai on lau.business_id = aai.id
left join crms_company_customer ccc on lau.company_id = ccc.id
@ -47,7 +48,7 @@
#{id}
</foreach>
<if test="userId != null and userId != ''">
AND (lau.user_id = #{userId} or lau.user_id is null)
AND (lau.user_id = #{userId} or lau.user_id is null OR lau.user_id = '')
</if>
<if test="customerNumberOrName != null and customerNumberOrName != ''">
AND aai.business_code LIKE CONCAT('%',#{customerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{customerNumberOrName},'%')
@ -82,7 +83,7 @@
left join crms_customer cc on ccc.customer_id = cc.id
left join dg_loan_committee_consider lcc on lau.business_id = lcc.business_id
left join dg_business_process_status bps on lau.business_id = bps.business_id
where lau.business_id = #{businessId}
where lau.business_id = #{businessId} and lau.role_id = #{roleId}
</select>
</mapper>

@ -107,7 +107,7 @@
</select>
<select id="query" parameterType="integer" resultType="com.daqing.framework.domain.guarantee.DgLoanCommitteeConsider">
SELECT agreed_items,additional_items,loan_money,loan_tern,agree_person,disagree_person,file,passing_time,refuse_opinion
SELECT agreed_items,additional_items,loan_money,loan_tern,agree_person,disagree_person,file,passing_time AS time,refuse_opinion
FROM dg_loan_committee_consider
WHERE id = #{id}
</select>

@ -28,10 +28,11 @@
<result column="operating_status" property="operatingStatus" />
<result column="business_status" property="businessStatus" />
<result column="business_id" property="businessId" />
<result column="role_id" property="roleId" />
</resultMap>
<select id="pageByCondition" resultMap="LoanNoticeListResponseMap">
select ln.id,aai.business_code,cc.name,cc.phone,aai.business_type,lcc.loan_tern,lcc.loan_money,
select ln.id,aai.business_code,cc.name,cc.phone,aai.business_type,lcc.loan_tern,lcc.loan_money,ln.role_id,
aai.create_time,ln.status,aai.bank,ln.audit_opinion,ln.operating_status,bps.business_status,ln.business_id
from dg_loan_notice ln
left join dg_apply_amount_info aai on ln.business_id = aai.id
@ -45,7 +46,7 @@
#{id}
</foreach>
<if test="userId != null and userId != ''">
AND (ln.consider_id = #{userId} or ln.consider_id is null)
AND (ln.consider_id = #{userId} or ln.consider_id is null OR ln.consider_id = '')
</if>
<if test="customerNumberOrName != null and customerNumberOrName != ''">
AND aai.business_code LIKE CONCAT('%',#{customerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{customerNumberOrName},'%')
@ -72,4 +73,15 @@
</select>
<select id="selectLoanNotice" resultMap="LoanNoticeListResponseMap">
select cc.name,lcc.loan_money,aai.bank
from dg_loan_notice ln
left join dg_apply_amount_info aai on ln.business_id = aai.id
left join crms_company_customer ccc on ln.company_id = ccc.id
left join crms_customer cc on ccc.customer_id = cc.id
left join dg_loan_committee_consider lcc on ln.business_id = lcc.business_id
left join dg_business_process_status bps on ln.business_id = bps.business_id
where ln.business_id = #{businessId} and ln.role_id = #{roleId}
</select>
</mapper>

@ -32,11 +32,12 @@
<result column="business_status" property="businessStatus" />
<result column="business_id" property="businessId" />
<result column="img_file" property="imgFile" />
<result column="role_id" property="roleId" />
</resultMap>
<select id="pageByCondition" resultMap="PaymentConfirmationListResponseMap">
select pcc.id,aai.business_code,cc.name,cc.phone,aai.business_type,lcc.loan_money,lcc.loan_tern,aai.create_time,
pcc.status,aai.bank,lcc.passing_time,lcc.file,pcc.audit_opinion,pcc.operating_status,bps.business_status,pcc.business_id,pcc.img_file
select pcc.id,aai.business_code,cc.name,cc.phone,aai.business_type,lcc.loan_money,lcc.loan_tern,aai.create_time,pcc.status,
aai.bank,lcc.passing_time,lcc.file,pcc.audit_opinion,pcc.operating_status,bps.business_status,pcc.business_id,pcc.img_file,pcc.role_id
from dg_payment_confirmation_consider pcc
left join dg_apply_amount_info aai on pcc.business_id = aai.id
left join crms_company_customer ccc on pcc.company_id = ccc.id
@ -49,7 +50,7 @@
#{id}
</foreach>
<if test="userId != null and userId != ''">
AND (pcc.consider_id = #{userId} or pcc.consider_id is null)
AND (pcc.consider_id = #{userId} or pcc.consider_id is null OR pcc.consider_id = '')
</if>
<if test="customerNumberOrName != null and customerNumberOrName != ''">
AND aai.business_code LIKE CONCAT('%',#{customerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{customerNumberOrName},'%')

@ -1,6 +1,7 @@
package com.daqing.framework.domain.guarantee;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -73,6 +74,12 @@ public class DgLoanCommitteeConsider implements Serializable {
*/
private String loanTern;
/**
* 贷审会时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date time;
/**
* 同意贷审委员
*/

@ -0,0 +1,127 @@
package com.daqing.framework.utils;
import java.math.BigDecimal;
/**
* @Author chen
* @DATE 2020/12/2 16:32
* @Version 1.0
*/
public class NumberToCN {
/**
* 汉语中数字大写
*/
private static final String[] CN_UPPER_NUMBER = { "零", "壹", "贰", "叁", "肆",
"伍", "陆", "柒", "捌", "玖" };
/**
* 汉语中货币单位大写这样的设计类似于占位符
*/
private static final String[] CN_UPPER_MONETRAY_UNIT = { "分", "角", "元",
"拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟", "兆", "拾",
"佰", "仟" };
/**
* 特殊字符
*/
private static final String CN_FULL = "整";
/**
* 特殊字符
*/
private static final String CN_NEGATIVE = "负";
/**
* 金额的精度默认值为2
*/
private static final int MONEY_PRECISION = 2;
/**
* 特殊字符零元整
*/
private static final String CN_ZEOR_FULL = "零元" + CN_FULL;
/**
* 把输入的金额转换为汉语中人民币的大写
*
* @param numberOfMoney
* 输入的金额
* @return 对应的汉语大写
*/
public static String number2CNMontrayUnit(BigDecimal numberOfMoney) {
StringBuffer sb = new StringBuffer();
// -1, 0, or 1 as the value of this BigDecimal is negative, zero, or
// positive.
int signum = numberOfMoney.signum();
// 零元整的情况
if (signum == 0) {
return CN_ZEOR_FULL;
}
// 这里会进行金额的四舍五入
long number = numberOfMoney.movePointRight(MONEY_PRECISION)
.setScale(0, 4).abs().longValue();
// 得到小数点后两位值
long scale = number % 100;
int numUnit = 0;
int numIndex = 0;
boolean getZero = false;
// 判断最后两位数,一共有四中情况:00 = 0, 01 = 1, 10, 11
if (!(scale > 0)) {
numIndex = 2;
number = number / 100;
getZero = true;
}
if ((scale > 0) && (!(scale % 10 > 0))) {
numIndex = 1;
number = number / 10;
getZero = true;
}
int zeroSize = 0;
while (true) {
if (number <= 0) {
break;
}
// 每次获取到最后一个数
numUnit = (int) (number % 10);
if (numUnit > 0) {
if ((numIndex == 9) && (zeroSize >= 3)) {
sb.insert(0, CN_UPPER_MONETRAY_UNIT[6]);
}
if ((numIndex == 13) && (zeroSize >= 3)) {
sb.insert(0, CN_UPPER_MONETRAY_UNIT[10]);
}
sb.insert(0, CN_UPPER_MONETRAY_UNIT[numIndex]);
sb.insert(0, CN_UPPER_NUMBER[numUnit]);
getZero = false;
zeroSize = 0;
} else {
++zeroSize;
if (!(getZero)) {
sb.insert(0, CN_UPPER_NUMBER[numUnit]);
}
if (numIndex == 2) {
if (number > 0) {
sb.insert(0, CN_UPPER_MONETRAY_UNIT[numIndex]);
}
} else if (((numIndex - 2) % 4 == 0) && (number % 1000 > 0)) {
sb.insert(0, CN_UPPER_MONETRAY_UNIT[numIndex]);
}
getZero = true;
}
// 让number每次都去掉最后一个数
number = number / 10;
++numIndex;
}
// 如果signum == -1,则说明输入的数字为负数,就在最前面追加特殊字符:负
if (signum == -1) {
sb.insert(0, CN_NEGATIVE);
}
// 输入的数字小数点后两位为"00"的情况,则要在最后追加特殊字符:整
if (!(scale > 0)) {
sb.append(CN_FULL);
}
return sb.toString();
}
public static void main(String[] args) {
double money = 10;
BigDecimal numberOfMoney = new BigDecimal(money);
String s = NumberToCN.number2CNMontrayUnit(numberOfMoney);
System.out.println("你输入的金额为:【" + money + "】 #--# [" + s.toString() + "]");
}
}

@ -23,7 +23,8 @@ jwt.ignoreUrlList=/apiHrmsAuth/hrms/auth/userlogin/getBackPwd,\
/api-guarantee/dg-guarantee-letter-assign-user/exportGuaranteeLetter,\
/api-guarantee/dg-guarantee-letter-assign-user/guaranteeLetterListExport,\
/api-guarantee/dg-payment-confirmation-consider/paymentConfirmationListExport,\
/api-guarantee/dg-loan-notice/loanNoticeListExport
/api-guarantee/dg-loan-notice/loanNoticeListExport,\
/api-guarantee/dg-loan-notice/exportLoanNotice

Loading…
Cancel
Save