From 9ef519a95a85ff6c7bccd8bca01d1836728b42e9 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Fri, 19 Mar 2021 09:57:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=90=8E=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AlInsuranceListController.java | 74 ++++++++++- .../AlRepaymentEntryController.java | 116 ++++++++++++++++- .../DgApplyAmountInfoController.java | 22 +++- .../mapper/AlInsuranceListMapper.java | 4 + .../mapper/AlRepaymentEntryMapper.java | 3 + .../model/request/AlRepaymentEntryReq.java | 115 +++++++++++++++++ .../model/response/AlInsuranceListRes.java | 118 ++++++++++++++++++ .../service/IAlInsuranceListService.java | 12 ++ .../service/IAlRepaymentEntryService.java | 19 +++ .../impl/AlInsuranceListServiceImpl.java | 54 ++++++++ .../impl/AlRepaymentEntryServiceImpl.java | 81 ++++++++++++ .../guarantee/AlInsuranceListMapper.xml | 13 ++ .../guarantee/AlRepaymentEntryMapper.xml | 10 ++ .../financial/hrauth/enums/OperationUnit.java | 2 + .../service/impl/UserLoginServiceImpl.java | 6 +- .../hrauth/service/impl/UserServiceImpl.java | 6 + .../mapper/hrauth/UserLoginMapper.xml | 2 +- .../domain/guarantee/AlInsuranceList.java | 19 ++- .../domain/guarantee/AlRepaymentEntry.java | 21 +++- 19 files changed, 680 insertions(+), 17 deletions(-) create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlRepaymentEntryReq.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlInsuranceListRes.java diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlInsuranceListController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlInsuranceListController.java index f9106d7b..c41e66f0 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlInsuranceListController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlInsuranceListController.java @@ -1,9 +1,21 @@ package com.daqing.financial.guarantee.controller; -import org.springframework.web.bind.annotation.RequestMapping; +import com.daqing.financial.guarantee.model.response.AlInsuranceListRes; +import com.daqing.financial.guarantee.service.IAlInsuranceListService; +import com.daqing.financial.hrauth.annotation.Log; +import com.daqing.financial.hrauth.enums.OperationType; +import com.daqing.financial.hrauth.enums.OperationUnit; +import com.daqing.framework.model.response.ResponseResult; +import com.daqing.framework.utils.PageUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; -import org.springframework.web.bind.annotation.RestController; /** *

@@ -13,8 +25,66 @@ import org.springframework.web.bind.annotation.RestController; * @author Qyq * @since 2021-03-17 */ +@Api(tags = {"保后管理"}) @RestController @RequestMapping("/al-insurance-list") public class AlInsuranceListController { + @Autowired + private IAlInsuranceListService alInsuranceListService; + + /** + * 保后管理列表 + * @param + * @return + */ + @Log(detail = "保后管理列表",level = 3,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) + @GetMapping("/insuranceList") + @ApiOperation(value = "保后管理列表") + public ResponseResult insuranceList(@RequestParam(value="page",required=false) Integer page, @RequestParam(value="size",required=false) Integer size, + @RequestParam(value = "CustomerNumberOrName", required = false) String CustomerNumberOrName){ + + PageUtils data = alInsuranceListService.queryPage(page, size, CustomerNumberOrName); + + return new ResponseResult().SUCCESS(data); + } + + /** + * 担保详细 + * @param id + * @return + */ + @Log(detail = "担保详细",level = 4,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) + @GetMapping("/insuranceDetail") + @ApiOperation(value = "担保详细") + public ResponseResult insuranceDetail(Integer id){ + AlInsuranceListRes response = alInsuranceListService.insuranceDetail(id); + return ResponseResult.SUCCESS(response); + } + + /** + * 导出 + */ + @Log(detail = "导出保后管理列表",level = 4,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) + @GetMapping("/excelExport") + @ApiOperation(value = "导出保后管理列表") + public ResponseResult excelExport(@RequestParam("ids") List ids, HttpServletResponse response) { + + Boolean result = alInsuranceListService.excelExport(ids,response); + + return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL(); + } + + /** + * 办理结项 + * @param id + * @return + */ + @Log(detail = "办理结项",level = 4,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.UPDATE) + @GetMapping("/updateStatus") + @ApiOperation(value = "办理结项") + public ResponseResult updateStatus(@RequestParam("id") Integer id){ + int result = alInsuranceListService.updateStatus(id); + return result>0 ? ResponseResult.SUCCESS("编辑成功!"):ResponseResult.FAIL(60007,"编辑失败!"); + } } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlRepaymentEntryController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlRepaymentEntryController.java index 379edfab..233b6aa3 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlRepaymentEntryController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlRepaymentEntryController.java @@ -1,9 +1,23 @@ package com.daqing.financial.guarantee.controller; -import org.springframework.web.bind.annotation.RequestMapping; +import com.daqing.financial.guarantee.model.request.AlRepaymentEntryReq; +import com.daqing.financial.guarantee.service.IAlRepaymentEntryService; +import com.daqing.financial.hrauth.annotation.Log; +import com.daqing.financial.hrauth.enums.OperationType; +import com.daqing.financial.hrauth.enums.OperationUnit; +import com.daqing.framework.domain.guarantee.AlRepaymentEntry; +import com.daqing.framework.model.response.ResponseResult; +import com.daqing.framework.utils.PageUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; -import org.springframework.web.bind.annotation.RestController; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.util.List; +import java.util.Map; /** *

@@ -13,8 +27,106 @@ import org.springframework.web.bind.annotation.RestController; * @author Qyq * @since 2021-03-17 */ +@Api(tags = {"还款记录"}) @RestController @RequestMapping("/al-repayment-entry") public class AlRepaymentEntryController { + @Autowired + private IAlRepaymentEntryService alRepaymentEntryService; + + /** + * 还款录入 + * @param alRepaymentEntryReq + * @return + */ + @Log(detail = "还款录入",level = 3,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.INSERT) + @PostMapping("/repaymentEntry") + @ApiOperation(value = "还款录入") + public ResponseResult repaymentEntry(@RequestBody @Valid AlRepaymentEntryReq alRepaymentEntryReq){ + int result = alRepaymentEntryService.repaymentEntry(alRepaymentEntryReq); + return result>0 ? ResponseResult.SUCCESS("录入成功"):ResponseResult.FAIL(60006,"录入失败"); + } + + /** + * 还款详细 + * @param id + * @return + */ + @Log(detail = "还款详细",level = 4,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) + @GetMapping("/repaymentDetail") + @ApiOperation(value = "还款详细") + public ResponseResult repaymentDetail(Integer id){ + AlRepaymentEntry response = alRepaymentEntryService.repaymentDetail(id); + return ResponseResult.SUCCESS(response); + } + + /** + * 还款记录列表 + * @param + * @return + */ + @Log(detail = "还款记录列表",level = 3,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) + @GetMapping("/repaymentList") + @ApiOperation(value = "还款记录列表") + public ResponseResult repaymentList(@RequestParam(value="page",required=false) Integer page, @RequestParam(value="size",required=false) Integer size, + @RequestParam(value = "CustomerNumberOrName", required = false) String CustomerNumberOrName, @RequestParam(value="status",required=false) Integer status){ + + PageUtils data = alRepaymentEntryService.queryPage(page, size, CustomerNumberOrName,status); + + return new ResponseResult().SUCCESS(data); + } + + /** + * 编辑还款信息 + * @param alRepaymentEntryReq + * @return + */ + @Log(detail = "编辑还款信息",level = 4,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.UPDATE) + @PostMapping("/updateRepayment") + @ApiOperation(value = "编辑还款信息") + public ResponseResult updateRepayment(@RequestBody @Valid AlRepaymentEntryReq alRepaymentEntryReq){ + int result = alRepaymentEntryService.updateRepayment(alRepaymentEntryReq); + return result>0 ? ResponseResult.SUCCESS("编辑成功!"):ResponseResult.FAIL(60007,"编辑失败!"); + } + + /** + * 批量删除还款信息 + * @param ids + * @return + */ + @Log(detail = "批量删除还款信息",level = 4,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.DELETE) + @PostMapping("/delRepayment") + @ApiOperation(value = "批量删除还款信息") + public ResponseResult delRepayment(@RequestBody List ids){ + int result = alRepaymentEntryService.delRepayment(ids); + return result>0 ? ResponseResult.SUCCESS("删除成功!"):ResponseResult.FAIL(60008,"删除失败!"); + } + + /** + * 导出 + */ + @Log(detail = "导出还款记录列表",level = 4,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) + @GetMapping("/excelExport") + @ApiOperation(value = "导出还款记录列表") + public ResponseResult excelExport(@RequestParam("ids") List ids, HttpServletResponse response) { + + Boolean result = alRepaymentEntryService.excelExport(ids,response); + + return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL(); + } + + /** + * 还款统计 + * @param + * @return + */ + @Log(detail = "还款统计",level = 4,operationUnit = OperationUnit.INSURANCE,operationType = OperationType.SELECT) + @GetMapping("/repaymentStatistics") + @ApiOperation(value = "还款统计") + public ResponseResult repaymentStatistics(){ + Map map = alRepaymentEntryService.repaymentStatistics(); + return ResponseResult.SUCCESS(map); + } + } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java index a3d5c114..c03a317d 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java @@ -226,7 +226,7 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA * @param id * @return */ - @Log(detail = "业务申请列表",level = 3,operationUnit = OperationUnit.APPLYAMOUNTINFO,operationType = OperationType.SELECT) + @Log(detail = "业务申请详情",level = 3,operationUnit = OperationUnit.APPLYAMOUNTINFO,operationType = OperationType.SELECT) @GetMapping("/businessApplicationDetail") @ApiOperation(value = "根据业务id查询业务申请详情") public ResponseResult businessApplicationDetail(Integer id){ @@ -331,6 +331,26 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA return claims.getIssuer(); } + /** + * 获取当前登录用户名称 + */ + public static Map getUserIdAndName() { + Map map = new HashMap(); + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String token = request.getHeader("token"); + Claims claims = null; + try { + claims = JwtUtils.parseJWT(token); + } catch (Exception e) { + e.printStackTrace(); + } + String userId = RedisUtil.get("dq:token:"+token); + + map.put("name", claims.getIssuer()); + map.put("userId",userId); + return map; + } + /** * 获取业务申请所有字段 diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlInsuranceListMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlInsuranceListMapper.java index 81fadea5..b22fd43b 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlInsuranceListMapper.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlInsuranceListMapper.java @@ -1,6 +1,9 @@ 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.AlInsuranceListRes; import com.daqing.framework.domain.guarantee.AlInsuranceList; import org.apache.ibatis.annotations.Mapper; @@ -15,4 +18,5 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface AlInsuranceListMapper extends BaseMapper { + IPage pageByCondition(Page page, String customerNumberOrName); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlRepaymentEntryMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlRepaymentEntryMapper.java index 9bb15b63..913f2f53 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlRepaymentEntryMapper.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlRepaymentEntryMapper.java @@ -1,6 +1,8 @@ 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.framework.domain.guarantee.AlRepaymentEntry; import org.apache.ibatis.annotations.Mapper; @@ -15,4 +17,5 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface AlRepaymentEntryMapper extends BaseMapper { + IPage pageByCondition(Page page, String customerNumberOrName, Integer status); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlRepaymentEntryReq.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlRepaymentEntryReq.java new file mode 100644 index 00000000..87c83bf7 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlRepaymentEntryReq.java @@ -0,0 +1,115 @@ +package com.daqing.financial.guarantee.model.request; + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + *

+ * 还款记录表 + *

+ * + * @author Qyq + * @since 2021-03-17 + */ +@Data +@TableName("al_repayment_entry") +public class AlRepaymentEntryReq implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + @ApiModelProperty(value = "主键id") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 保后外键id + */ + @ApiModelProperty(value = "保后外键id") + private Integer insuranceId; + + /** + * 应还款日 + */ + @NotNull(message = "应还款日不能为空") + @ApiModelProperty(value = "应还款日") + private Date repaymentDate; + + /** + * 实际还款日 + */ + @ApiModelProperty(value = "实际还款日") + private Date actualRepaymentDate; + + /** + * 逾期天数 + */ + @ApiModelProperty(value = "逾期天数") + private Integer overdueDays; + + /** + * 还款总额(元) + */ + @ApiModelProperty(value = "还款总额(元)") + private BigDecimal totalRepayment; + + /** + * 本次还款(元) + */ + @NotNull(message = "本次还款不能为空") + @ApiModelProperty(value = "本次还款(元)") + private BigDecimal currentRepayment; + + /** + * 利息(元) + */ + @NotNull(message = "利息不能为空") + @ApiModelProperty(value = "利息(元)") + private BigDecimal interest; + + /** + * 其他费用(元) + */ + @ApiModelProperty(value = "其他费用(元)") + private BigDecimal otherExpenses; + + /** + * 减免金额(元) + */ + @ApiModelProperty(value = "减免金额(元)") + private BigDecimal deductionAmount; + + /** + * 还款备注 + */ + @ApiModelProperty(value = "还款备注") + private String repaymentNotes; + + /** + * 还款状态:1->待还款;2->已还款;3->已逾期;4->未到期; + */ +/* @ApiModelProperty(value = "还款状态:1->待还款;2->已还款;3->已逾期;4->未到期;") + private Integer repaymentStatus;*/ + + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + @TableField(fill= FieldFill.INSERT) + private Date createTime; + + /** + * 修改时间 + */ + @ApiModelProperty(value = "修改时间") + @TableField(fill= FieldFill.INSERT_UPDATE) + private Date updateTime; +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlInsuranceListRes.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlInsuranceListRes.java new file mode 100644 index 00000000..3f603d72 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlInsuranceListRes.java @@ -0,0 +1,118 @@ +package com.daqing.financial.guarantee.model.response; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.ToString; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + *

+ * 保后管理列表 + *

+ * + * @author Qyq + * @since 2021-03-17 + */ +@Data +@ToString +public class AlInsuranceListRes implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + @ApiModelProperty(value = "企业id") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 业务编号 + */ + @ApiModelProperty(value = "业务编号") + private String businessCode; + + /** + * 客户名称 + */ + @ApiModelProperty(value = "客户名称") + private String customerName; + + /** + * 联系电话 + */ + @ApiModelProperty(value = "联系电话") + private String phone; + + /** + * 业务类别 + */ + @ApiModelProperty(value = "业务类别") + private String businessType; + + /** + * 担保额度(元) + */ + @ApiModelProperty(value = "担保额度(元)") + private BigDecimal guaranteeAmount; + + /** + * 担保期限 + */ + @ApiModelProperty(value = "担保期限") + private String guaranteeTime; + + /** + * 申请日期 + */ + @ApiModelProperty(value = "申请日期") + private Date applyTime; + + /** + * 还款额度(元) + */ + @ApiModelProperty(value = "还款额度(元)") + private BigDecimal repaymentAmount; + + /** + * 剩余额度(元) + */ + @ApiModelProperty(value = "剩余额度(元)") + private BigDecimal remainAmount; + + /** + * 还款期数 + */ + @ApiModelProperty(value = "还款期数") + private String repaymentTime; + + /** + * 所属部门 + */ + @ApiModelProperty(value = "所属部门") + private String department; + + /** + * 还款状态:1->还款中;2->已逾期;3->已还清;4->已结项; + */ + @ApiModelProperty(value = "还款状态:1->还款中;2->已逾期;3->已还清;4->已结项;") + private Integer paymentStatus; + + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + private Date createTime; + + /** + * 修改时间 + */ + @ApiModelProperty(value = "修改时间") + private Date updateTime; +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlInsuranceListService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlInsuranceListService.java index 765217e2..aef1b137 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlInsuranceListService.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlInsuranceListService.java @@ -2,7 +2,12 @@ package com.daqing.financial.guarantee.service; import com.baomidou.mybatisplus.extension.service.IService; +import com.daqing.financial.guarantee.model.response.AlInsuranceListRes; import com.daqing.framework.domain.guarantee.AlInsuranceList; +import com.daqing.framework.utils.PageUtils; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; /** *

@@ -14,4 +19,11 @@ import com.daqing.framework.domain.guarantee.AlInsuranceList; */ public interface IAlInsuranceListService extends IService { + PageUtils queryPage(Integer page, Integer size, String customerNumberOrName); + + AlInsuranceListRes insuranceDetail(Integer id); + + Boolean excelExport(List ids, HttpServletResponse response); + + int updateStatus(Integer id); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlRepaymentEntryService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlRepaymentEntryService.java index 24d5b232..4aee8c34 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlRepaymentEntryService.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlRepaymentEntryService.java @@ -2,7 +2,13 @@ package com.daqing.financial.guarantee.service; import com.baomidou.mybatisplus.extension.service.IService; +import com.daqing.financial.guarantee.model.request.AlRepaymentEntryReq; import com.daqing.framework.domain.guarantee.AlRepaymentEntry; +import com.daqing.framework.utils.PageUtils; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; /** *

@@ -14,4 +20,17 @@ import com.daqing.framework.domain.guarantee.AlRepaymentEntry; */ public interface IAlRepaymentEntryService extends IService { + int repaymentEntry(AlRepaymentEntryReq alRepaymentEntryReq); + + AlRepaymentEntry repaymentDetail(Integer id); + + PageUtils queryPage(Integer page, Integer size, String customerNumberOrName, Integer status); + + int updateRepayment(AlRepaymentEntryReq alRepaymentEntryReq); + + int delRepayment(List ids); + + Boolean excelExport(List ids, HttpServletResponse response); + + Map repaymentStatistics(); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlInsuranceListServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlInsuranceListServiceImpl.java index 3cbf289a..57cc99a1 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlInsuranceListServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlInsuranceListServiceImpl.java @@ -1,11 +1,24 @@ 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.daqing.financial.guarantee.mapper.AlInsuranceListMapper; +import com.daqing.financial.guarantee.model.response.AlInsuranceListRes; import com.daqing.financial.guarantee.service.IAlInsuranceListService; +import com.daqing.framework.domain.crms.response.CrmsCode; import com.daqing.framework.domain.guarantee.AlInsuranceList; +import com.daqing.framework.exception.ExceptionCast; +import com.daqing.framework.utils.PageUtils; +import com.daqing.framework.utils.excel.ExcelUtil; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; +import javax.servlet.http.HttpServletResponse; +import java.util.List; + + /** *

* 保后管理列表 服务实现类 @@ -17,4 +30,45 @@ import org.springframework.stereotype.Service; @Service public class AlInsuranceListServiceImpl extends ServiceImpl implements IAlInsuranceListService { + @Override + public PageUtils queryPage(Integer page, Integer size, String customerNumberOrName) { + //分页参数 + if (page <= 0) { + page = 1; + } + if (size <= 0) { + size = 10; + } + IPage positionVO = this.getBaseMapper().pageByCondition(new Page(page, size),customerNumberOrName); + + return new PageUtils(positionVO); + } + + @Override + public AlInsuranceListRes insuranceDetail(Integer id) { + AlInsuranceList alInsuranceList = this.baseMapper.selectById(id); + AlInsuranceListRes res = new AlInsuranceListRes(); + BeanUtils.copyProperties(alInsuranceList,res); + return res; + } + + @Override + public Boolean excelExport(List ids, HttpServletResponse response) { + ListalInsuranceList = this.baseMapper.selectBatchIds(ids); + try { + ExcelUtil.writeExcelWithSheets(response, alInsuranceList, "还款记录一览表", "repaymentEntry", new AlInsuranceList()) + .finish(); + return true; + } catch (Exception e) { + ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT); + return false; + } + } + + @Override + public int updateStatus(Integer id) { + AlInsuranceList alInsuranceList = new AlInsuranceList(); + alInsuranceList.setPaymentStatus(4);//已结项 + return this.baseMapper.update(alInsuranceList,new QueryWrapper().eq("id",id)); + } } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlRepaymentEntryServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlRepaymentEntryServiceImpl.java index 04bd8f3e..d5a8dffb 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlRepaymentEntryServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlRepaymentEntryServiceImpl.java @@ -1,11 +1,24 @@ package com.daqing.financial.guarantee.service.impl; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.daqing.financial.guarantee.controller.DgApplyAmountInfoController; import com.daqing.financial.guarantee.mapper.AlRepaymentEntryMapper; +import com.daqing.financial.guarantee.model.request.AlRepaymentEntryReq; import com.daqing.financial.guarantee.service.IAlRepaymentEntryService; +import com.daqing.framework.domain.crms.response.CrmsCode; import com.daqing.framework.domain.guarantee.AlRepaymentEntry; +import com.daqing.framework.exception.ExceptionCast; +import com.daqing.framework.utils.PageUtils; +import com.daqing.framework.utils.excel.ExcelUtil; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + /** *

* 还款记录表 服务实现类 @@ -17,4 +30,72 @@ import org.springframework.stereotype.Service; @Service public class AlRepaymentEntryServiceImpl extends ServiceImpl implements IAlRepaymentEntryService { + @Override + public int repaymentEntry(AlRepaymentEntryReq alRepaymentEntryReq) { + AlRepaymentEntry alRepaymentEntry = new AlRepaymentEntry(); + BeanUtils.copyProperties(alRepaymentEntryReq,alRepaymentEntry); + + Map map = DgApplyAmountInfoController.getUserIdAndName(); + String name = map.get("name").toString(); + Integer userId = Integer.parseInt(map.get("userId").toString()); + alRepaymentEntry.setSubmitterId(userId); + alRepaymentEntry.setSubmitterName(name); + return this.baseMapper.insert(alRepaymentEntry); + } + + @Override + public AlRepaymentEntry repaymentDetail(Integer id) { + AlRepaymentEntry alRepaymentEntry = this.baseMapper.selectById(id); + return alRepaymentEntry; + } + + @Override + public PageUtils queryPage(Integer page, Integer size, String customerNumberOrName, Integer status) { + //分页参数 + if (page <= 0) { + page = 1; + } + if (size <= 0) { + size = 10; + } + IPage positionVO = this.getBaseMapper().pageByCondition(new Page(page, size),customerNumberOrName,status); + + return new PageUtils(positionVO); + } + + @Override + public int updateRepayment(AlRepaymentEntryReq alRepaymentEntryReq) { + AlRepaymentEntry entry = new AlRepaymentEntry(); + BeanUtils.copyProperties(alRepaymentEntryReq,entry); + Map map = DgApplyAmountInfoController.getUserIdAndName(); + String name = map.get("name").toString(); + Integer userId = Integer.parseInt(map.get("userId").toString()); + entry.setSubmitterId(userId); + entry.setSubmitterName(name); + return this.baseMapper.updateById(entry); + } + + @Override + public int delRepayment(List ids) { + return this.baseMapper.deleteBatchIds(ids); + } + + @Override + public Boolean excelExport(List ids, HttpServletResponse response) { + ListrepaymentList = this.baseMapper.selectBatchIds(ids); + try { + ExcelUtil.writeExcelWithSheets(response, repaymentList, "还款记录一览表", "repaymentEntry", new AlRepaymentEntry()) + .finish(); + return true; + } catch (Exception e) { + ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT); + return false; + } + } + + @Override + public Map repaymentStatistics() { + + return null; + } } diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlInsuranceListMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlInsuranceListMapper.xml index a510e939..7baf74a6 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlInsuranceListMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlInsuranceListMapper.xml @@ -12,6 +12,8 @@ + + @@ -21,4 +23,15 @@ + + diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml index 25e76d13..6a78ffe4 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml @@ -20,4 +20,14 @@ + + diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/enums/OperationUnit.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/enums/OperationUnit.java index 40e74d8c..6212f0cf 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/enums/OperationUnit.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/enums/OperationUnit.java @@ -25,6 +25,8 @@ public enum OperationUnit { EMPLOYEE("员工信息"), COMPANY("企业信息"), SYSLOG("日志管理"), + INSURANCE("保后管理"), + COLLECTION("催收管理"), USER("user"), LOG("log"), PERMISSION("permission"), diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java index 3708f68c..2f0e3f2c 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java @@ -391,13 +391,15 @@ public class UserLoginServiceImpl extends ServiceImpl loginRequest.setWechatId(md5UnionId); loginRequest.setType(2); loginRequest.setTenDayEffective(2); + //查询员工数据 + int count2 = userLoginDao.selectUserEmpCount(md5UnionId); if(identify==0){//员工小程序登录 - if(count<=0){ + if(count<=0 || count2<=0){//如果微信绑定的不是员工 return ResponseResult.FAIL(60001,"您的账号没有权限,无法登录!"); } }else{//客户小程序登录 //如果员工使用客户小程序登录的情况,关联用户表和员工表查询,如果有数据则代表是员工的数据 - int count2 = userLoginDao.selectUserEmpCount(md5UnionId); + if(count2>0 || count <=0){//代表员工或者新用户 UserEntity userEntity = new UserEntity(); userEntity.setAccount(userMap.get("nickName").toString());//账号默认为微信名称 diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserServiceImpl.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserServiceImpl.java index 83ddf5ce..c0dc1fc5 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserServiceImpl.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserServiceImpl.java @@ -87,6 +87,12 @@ public class UserServiceImpl extends ServiceImpl imple userInfo.getCurrentUserInfo().setToken(data.getToken()); new UsernamePasswordAuthenticationToken(userInfo, null, userInfo.getAuthorities());*/ return dbUser; + }else if(dbUser.getPhoneAccount()==null){ + try { + response.sendRedirect("https://www.huorantech.cn/index"); + } catch (IOException e) { + e.printStackTrace(); + } } if(dbUser == null){//openId不存在,返回绑定手机号页面,须另写绑定手机号接口 diff --git a/dq-financial-hrms-auth/src/main/resources/mapper/hrauth/UserLoginMapper.xml b/dq-financial-hrms-auth/src/main/resources/mapper/hrauth/UserLoginMapper.xml index cbba8d33..eee85a81 100644 --- a/dq-financial-hrms-auth/src/main/resources/mapper/hrauth/UserLoginMapper.xml +++ b/dq-financial-hrms-auth/src/main/resources/mapper/hrauth/UserLoginMapper.xml @@ -75,7 +75,7 @@ \ No newline at end of file diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/AlInsuranceList.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/AlInsuranceList.java index e4526b71..0696c2a2 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/AlInsuranceList.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/AlInsuranceList.java @@ -1,8 +1,7 @@ package com.daqing.framework.domain.guarantee; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.alibaba.excel.metadata.BaseRowModel; +import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import java.io.Serializable; @@ -19,7 +18,7 @@ import java.util.Date; */ @Data @TableName("al_insurance_list") -public class AlInsuranceList implements Serializable { +public class AlInsuranceList extends BaseRowModel implements Serializable { private static final long serialVersionUID = 1L; @@ -64,6 +63,16 @@ public class AlInsuranceList implements Serializable { */ private Date applyTime; + /** + * 贷款银行 + */ + private String bank; + + /** + * 贷款用途 + */ + private String amountWide; + /** * 还款额度(元) */ @@ -92,10 +101,12 @@ public class AlInsuranceList implements Serializable { /** * 创建时间 */ + @TableField(fill= FieldFill.INSERT) private Date createTime; /** * 修改时间 */ + @TableField(fill = FieldFill.INSERT_UPDATE) private Date updateTime; } diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/AlRepaymentEntry.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/AlRepaymentEntry.java index f5a79e9b..cb399fd0 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/AlRepaymentEntry.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/AlRepaymentEntry.java @@ -1,8 +1,7 @@ package com.daqing.framework.domain.guarantee; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.alibaba.excel.metadata.BaseRowModel; +import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import java.io.Serializable; @@ -19,7 +18,7 @@ import java.util.Date; */ @Data @TableName("al_repayment_entry") -public class AlRepaymentEntry implements Serializable { +public class AlRepaymentEntry extends BaseRowModel implements Serializable { private static final long serialVersionUID = 1L; @@ -47,7 +46,7 @@ public class AlRepaymentEntry implements Serializable { /** * 逾期天数 */ - private String overdueDays; + private Integer overdueDays; /** * 还款总额(元) @@ -84,13 +83,25 @@ public class AlRepaymentEntry implements Serializable { */ private Integer repaymentStatus; + /** + * 提交人id + */ + private Integer submitterId; + + /** + * 提交人名称 + */ + private String submitterName; + /** * 创建时间 */ + @TableField(fill= FieldFill.INSERT) private Date createTime; /** * 修改时间 */ + @TableField(fill= FieldFill.INSERT_UPDATE) private Date updateTime; }