From e063e588677204185e3fe2bb8570751a31741dc2 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Thu, 25 Mar 2021 14:50:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E8=81=94=E4=BA=BA=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=A0=BC=E5=BC=8F=E5=A4=84=E7=90=86=EF=BC=8C?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=89=AB=E7=A0=81=E7=99=BB=E5=BD=95=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CrmsCompanyPersonalController.java | 47 +++--- .../model/request/CrmsCompanyPersonalReq.java | 147 ++++++++++++++++++ .../hrauth/service/impl/UserServiceImpl.java | 6 - 3 files changed, 172 insertions(+), 28 deletions(-) create mode 100644 dq-financial-crms/src/main/java/com/daqing/financial/crms/model/request/CrmsCompanyPersonalReq.java diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CrmsCompanyPersonalController.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CrmsCompanyPersonalController.java index 507adcad..f3bb7c6b 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CrmsCompanyPersonalController.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CrmsCompanyPersonalController.java @@ -2,6 +2,7 @@ package com.daqing.financial.crms.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.daqing.financial.crms.model.request.CrmsCompanyPersonalReq; import com.daqing.financial.crms.service.ICrmsCompanyPersonalService; import com.daqing.financial.crms.service.ICrmsCustomerRelatedService; import com.daqing.framework.annotation.Log; @@ -13,6 +14,7 @@ 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.BeanUtils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -58,17 +60,17 @@ public class CrmsCompanyPersonalController { @Log(detail = "新增个人/企业关联人",level = 3,operationUnit = OperationUnit.COMPANY,operationType = OperationType.INSERT) @PostMapping("/insertCompanyPersonal") @ApiOperation(value = "新增个人/企业关联人") - public ResponseResult insertCompanyPersonal(@RequestBody @Valid CrmsCompanyPersonal crmsCompanyPersonal) { -// SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); -// String format = sdf.format(crmsCompanyPersonal.getRegisteredTime()); -// Date parse = null; -// try { -// parse = sdf.parse(format); -// } catch (ParseException e) { -// e.printStackTrace(); -// } -// -// crmsCompanyPersonal.setRegisteredTime(parse); + public ResponseResult insertCompanyPersonal(@RequestBody @Valid CrmsCompanyPersonalReq personal) { + SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); + Date parse = null; + try { + parse = sdf.parse(personal.getRegisteredTime()); + } catch (ParseException e) { + e.printStackTrace(); + } + CrmsCompanyPersonal crmsCompanyPersonal = new CrmsCompanyPersonal(); + BeanUtils.copyProperties(personal,crmsCompanyPersonal); + crmsCompanyPersonal.setRegisteredTime(parse); boolean result = crmsCompanyPersonalService.save(crmsCompanyPersonal); CrmsCustomerRelated crmsCustomerRelated = new CrmsCustomerRelated(); crmsCustomerRelated.setRelatedId(crmsCompanyPersonal.getId().intValue());//关联人Id @@ -87,22 +89,23 @@ public class CrmsCompanyPersonalController { /** * 编辑个人/企业关联人 - * @param crmsCompanyPersonal + * @param personal * @return */ @Log(detail = "编辑个人/企业关联人",level = 3,operationUnit = OperationUnit.COMPANY,operationType = OperationType.UPDATE) @PostMapping("/updateCompanyPersonal") @ApiOperation(value = "编辑个人/企业关联人") - public ResponseResult updateCompanyPersonal(@RequestBody CrmsCompanyPersonal crmsCompanyPersonal){ -// SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); -// String format = sdf.format(crmsCompanyPersonal.getRegisteredTime()); -// Date parse = null; -// try { -// parse = sdf.parse(format); -// } catch (ParseException e) { -// e.printStackTrace(); -// } -// crmsCompanyPersonal.setRegisteredTime(parse); + public ResponseResult updateCompanyPersonal(@RequestBody CrmsCompanyPersonalReq personal){ + SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); + Date parse = null; + try { + parse = sdf.parse(personal.getRegisteredTime()); + } catch (ParseException e) { + e.printStackTrace(); + } + CrmsCompanyPersonal crmsCompanyPersonal = new CrmsCompanyPersonal(); + BeanUtils.copyProperties(personal,crmsCompanyPersonal); + crmsCompanyPersonal.setRegisteredTime(parse); boolean result = crmsCompanyPersonalService.updateById(crmsCompanyPersonal); return result ? ResponseResult.SUCCESS(crmsCompanyPersonal) : ResponseResult.FAIL(); } diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/model/request/CrmsCompanyPersonalReq.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/model/request/CrmsCompanyPersonalReq.java new file mode 100644 index 00000000..5d1b7fd6 --- /dev/null +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/model/request/CrmsCompanyPersonalReq.java @@ -0,0 +1,147 @@ +package com.daqing.financial.crms.model.request; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + *
+ * 关联人/关联企业 + *
+ * + * @author Qyq + * @since 2020-11-13 + */ +@Data +public class CrmsCompanyPersonalReq implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @ApiModelProperty(value = "主键") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 关联人名称 + */ + @ApiModelProperty(value = "关联人名称") + private String relatedName; + + /** + * 联系地址 + */ + @ApiModelProperty(value = "联系地址") + private String address; + + /** + * 社会统一代码 + */ + @ApiModelProperty(value = "社会统一代码") + private String socialUnifiedCode; + + /** + * 注册资金(元) + */ + @ApiModelProperty(value = "注册资金(元)") + private String registeredCapital; + + /** + * 注册时间 + */ + @ApiModelProperty(value = "注册时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private String registeredTime; + + /** + * 所属行业 + */ + @ApiModelProperty(value = "所属行业") + private String industry; + + /** + * 法人姓名 + */ + @ApiModelProperty(value = "法人姓名") + private String legalPersonName; + + /** + * 联系电话 + */ + @ApiModelProperty(value = "联系电话") + private String phone; + + /** + * 关联关系 + */ + @ApiModelProperty(value = "关联关系") + private String relationship; + + /** + * 股东情况 + */ + @ApiModelProperty(value = "股东情况") + private String shareholdersSituation; + + /** + * 婚姻状况,0:未婚,1:已婚,2:离异,3:再婚 + */ + @ApiModelProperty(value = "婚姻状况,0:未婚,1:已婚,2:离异,3:再婚") + private Integer maritalStatus; + + /** + * 身份证号 + */ + @ApiModelProperty(value = "身份证号") + private String idCard; + + /** + * 年龄 + */ + @ApiModelProperty(value = "年龄") + private Integer age; + + /** + * 性别:1、男,0、女 + */ + @ApiModelProperty(value = "性别:1、男,0、女") + private Integer gender; + + /** + * 学历,0:本科,1:大专,2:高职,3:中专,4:其他 + */ + @ApiModelProperty(value = "学历,0:本科,1:大专,2:高职,3:中专,4:其他") + private Integer education; + + /** + * 工作单位 + */ + @ApiModelProperty(value = "工作单位") + private String employer; + + /** + * 职务 + */ + @ApiModelProperty(value = "职务") + private String position; + + /** + * 关联人类型 + */ + @ApiModelProperty(value = "关联人类型") + private String type; + + /** + * 企业id + */ + @ApiModelProperty(value = "企业id") + private Integer relatedCompanyId; +} 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 d3a66ee5..b99ad50f 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,12 +87,6 @@ public class UserServiceImpl extends ServiceImpl