Commit a1a031a6 by 284718418@qq.com

Merge remote-tracking branch 'origin/feature_20220317_policy' into develop

# Conflicts:
#	src/main/java/cn/timer/api/bean/yggl/YgglMainEmp.java
#	src/main/java/cn/timer/api/controller/insure/InsureContorll.java
#	src/main/java/cn/timer/api/utils/HttpUtils.java
#	src/main/resources/application-pro.yml
#	src/main/resources/application.yml
parents 2f548a67 d669820f
/*
Navicat Premium Data Transfer
Source Server : 120.78.162.177
Source Server Type : MySQL
Source Server Version : 50734
Source Host : 120.78.162.177:3306
Source Schema : timer_test
Target Server Type : MySQL
Target Server Version : 50734
File Encoding : 65001
Date: 09/04/2022 18:43:18
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for insure_applicant
-- ----------------------------
DROP TABLE IF EXISTS `insure_applicant`;
CREATE TABLE `insure_applicant` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`applicant_e_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '企业/网点名称',
`applicant_e_address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '企业/网点地址',
`applicant_employee_list` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '人员清单',
`applicant_e_contacts` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '企业授权操作人姓名',
`applicant_e_phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作人的联系电话',
`applicant_e_no_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '企业证件类型:3646、统一社会信用代码 3924、组织机构代码',
`applicant_e_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '企业证件号码',
`applicant_e_mail` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '企业邮箱',
`applicant_province_city` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '省市区',
`applicant_invoice_receiving_address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发票收件地址',
`applicant_invoice_billing_phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发票开票电话',
`applicant_business_bank_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '企业开户行名称',
`policy_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保单号',
`applicant_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '投保类型:1个人 2 企业',
`trans_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '报价请求流水号',
`currency` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '报价号',
`applicant_invoiced_amount` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发票开票金额',
`org_code` int(11) NULL DEFAULT NULL,
`applicant_corporate_bank_account` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '银行账号',
`applicanteaddress` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`applicantecontacts` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`applicantemail` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`applicantename` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`applicanteno` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`applicanteno_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`applicantephone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '投保人' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for insure_log
-- ----------------------------
DROP TABLE IF EXISTS `insure_log`;
CREATE TABLE `insure_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`request_path` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '请求路径',
`request_data` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '请求参数',
`request_param` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '请求参数',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '请求时间',
`return_time` datetime(0) NULL DEFAULT NULL COMMENT '返回时间',
`return_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '返回编码',
`return_body` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '返回参数',
`return_msg` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '返回编码文本',
`trans_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '请求流水号',
`type` int(11) NULL DEFAULT NULL COMMENT '日志类型:1投保 2增员 3替换 4投保上传文件 5增员上传文件 6替换上传文件 7增员回调 8替换回调 9校验',
`request_type` tinyint(11) NULL DEFAULT NULL COMMENT '请求方式1 post 2get 3put',
`policy_id` int(11) NULL DEFAULT NULL COMMENT '保单id',
`file_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件地址',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 782 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for insure_policy
-- ----------------------------
DROP TABLE IF EXISTS `insure_policy`;
CREATE TABLE `insure_policy` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`scheme_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '方案名称(必选)',
`policy_date_start` datetime(0) NULL DEFAULT NULL COMMENT '保单生效日',
`policy_date_end` datetime(0) NULL DEFAULT NULL COMMENT '保单终止日',
`product_code_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品代码',
`plan_code_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '计划代码',
`partner_pid` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分销商pid',
`policy_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保单号',
`type` int(11) NULL DEFAULT NULL COMMENT '保单类型:1、年单 2、月单',
`currency` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '5-人民币,其他币种请参见全局数据字典',
`total_premium` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '总保费\r\n\r\n',
`status` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '1-正常 2-等待校验 3-失效',
`policy_file` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '电子保单',
`kit_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保单kit的地址',
`insure_applicant_id` int(11) NULL DEFAULT NULL COMMENT '投保人id',
`org_code` int(11) NULL DEFAULT NULL COMMENT '企业id',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '投保时间',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '最新操作时间',
`product_id` int(11) NULL DEFAULT NULL COMMENT '保险产品id',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_polivy_no`(`policy_no`) USING BTREE COMMENT '保单唯一索引'
) ENGINE = InnoDB AUTO_INCREMENT = 104 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '保单信息' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for insure_product
-- ----------------------------
DROP TABLE IF EXISTS `insure_product`;
CREATE TABLE `insure_product` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品名称',
`plan_code_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '计划代码',
`product_code_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品代码',
`type` int(11) NULL DEFAULT NULL COMMENT '类型:1年单 2月单',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`is_del` int(11) NULL DEFAULT 0 COMMENT '是否删除 0否 1是',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '保险产品' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for insure_province
-- ----------------------------
DROP TABLE IF EXISTS `insure_province`;
CREATE TABLE `insure_province` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`value` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '值',
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名字',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3066 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '省市区' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for insure_user
-- ----------------------------
DROP TABLE IF EXISTS `insure_user`;
CREATE TABLE `insure_user` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`trans_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '被保险人请求流水号',
`price` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单价',
`insured_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '姓名',
`batch_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '被保险人批次号',
`premium` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保单批次保费',
`insured_mobile` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '被保险人联系电话',
`insured_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '证件号码',
`insured_e_contact` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '联系人姓名',
`benefit_basic_plan` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '基础计划\r\n30万雇主/3万医疗 36968,50万雇主/5万医疗 36969,80万雇主/10万医疗 36970,80万雇主/20万医疗 36971,100万雇主/10万医疗 36972\r\n',
`benefit_occupation_category` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '职业类别\r\nA类 63119\r\nB类 63120\r\nC类 63121\r\n',
`benefit_EL_employee_number_t` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参保人数',
`Tricycle_frame_number` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '二、三轮车车架号(必选)',
`policy_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保单号',
`status` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '1' COMMENT '参保状态:1参保中 2已失效',
`type` tinyint(4) NULL DEFAULT NULL COMMENT '被保人类型:1个人 2企业',
`org_code` int(11) NULL DEFAULT NULL COMMENT '企业id',
`user_id` int(11) NULL DEFAULT NULL COMMENT '个人id',
`applicant_employee_list` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '人员清单',
`policy_date_start` datetime(0) NULL DEFAULT NULL COMMENT '生效日期',
`policy_date_end` datetime(0) NULL DEFAULT NULL COMMENT '失效日期',
`insure_status` int(11) NULL DEFAULT NULL COMMENT '投保状态:1成功 2失效 3待更新 4已被替换',
`policy_id` int(11) NULL DEFAULT NULL COMMENT '保单id',
`replace_trans_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '替换流水号,使用trans_id,RP_开头',
`apply_type` int(11) NULL DEFAULT NULL COMMENT '申请类型:1新增 2投保 3批增',
`benefit_el_employee_numbert` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`insuredecontact` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 715 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '被保人' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
INSERT INTO `timer_test`.`admin_menu_template`(`id`, `parentId`, `menu_code`, `menu_name`, `sort_number`, `path`, `enable`, `distribution`) VALUES (23, 0, 'policy', '保单管理', 23, '/policy', 1, 1);
INSERT INTO `timer_test`.`qyzx_admin_menu`(`id`, `menu_code`, `menu_name`, `sort_number`, `org_code`, `addtime`) VALUES (364, 'policy', '保单管理', 17, 1, 1648712195019);
package cn.timer.api.bean.adminaccount;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Table;
import java.util.Date;
/**
* 管理员列表
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-14 18:24:20
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "admin_account")
@ApiModel("APP更新记录")
public class AdminAccount extends Model<AdminAccount> {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
* 姓名
*/
private String realname;
/**
* 电话
*/
private String tel;
/**
* 级别 1超级管理员 2普通管理员
*/
private Integer types;
/**
* 创建者id,0表示系统创建
*/
private Integer createrid;
/**
* 创建日期
*/
private Date createtime;
/**
* 所属部门
*/
private String department;
/**
* 分组
*/
private Integer groupid;
/**
* 状态 1 正常 0 禁用
*/
private Integer statu;
/**
* 标注
*/
private String mark;
/**
* 帐号,首次注册手机号码
*/
private String account;
/**
* 登录密码
*/
private String pwd;
/**
* 头像名称,访问地址需要拼接
*/
private String avatar;
/**
* 1 内部(优领) 2外部(分销商)
*/
private Integer category;
/**
* 登录密码错误次数,大于5次将禁用
*/
private Integer lfc;
/**
* 禁用时间
*/
private Date prohibittime;
/**
* 登录ip
*/
private String ip;
/**
* 登录时间
*/
private Date logintime;
/**
* 更新时间
*/
private Date updatetime;
/**
* 设置:
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取:
*/
public Integer getId() {
return id;
}
/**
* 设置:姓名
*/
public void setRealname(String realname) {
this.realname = realname;
}
/**
* 获取:姓名
*/
public String getRealname() {
return realname;
}
/**
* 设置:电话
*/
public void setTel(String tel) {
this.tel = tel;
}
/**
* 获取:电话
*/
public String getTel() {
return tel;
}
/**
* 设置:级别 1超级管理员 2普通管理员
*/
public void setTypes(Integer types) {
this.types = types;
}
/**
* 获取:级别 1超级管理员 2普通管理员
*/
public Integer getTypes() {
return types;
}
/**
* 设置:创建者id,0表示系统创建
*/
public void setCreaterid(Integer createrid) {
this.createrid = createrid;
}
/**
* 获取:创建者id,0表示系统创建
*/
public Integer getCreaterid() {
return createrid;
}
/**
* 设置:创建日期
*/
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
/**
* 获取:创建日期
*/
public Date getCreatetime() {
return createtime;
}
/**
* 设置:所属部门
*/
public void setDepartment(String department) {
this.department = department;
}
/**
* 获取:所属部门
*/
public String getDepartment() {
return department;
}
/**
* 设置:分组
*/
public void setGroupid(Integer groupid) {
this.groupid = groupid;
}
/**
* 获取:分组
*/
public Integer getGroupid() {
return groupid;
}
/**
* 设置:状态 1 正常 0 禁用
*/
public void setStatu(Integer statu) {
this.statu = statu;
}
/**
* 获取:状态 1 正常 0 禁用
*/
public Integer getStatu() {
return statu;
}
/**
* 设置:标注
*/
public void setMark(String mark) {
this.mark = mark;
}
/**
* 获取:标注
*/
public String getMark() {
return mark;
}
/**
* 设置:帐号,首次注册手机号码
*/
public void setAccount(String account) {
this.account = account;
}
/**
* 获取:帐号,首次注册手机号码
*/
public String getAccount() {
return account;
}
/**
* 设置:登录密码
*/
public void setPwd(String pwd) {
this.pwd = pwd;
}
/**
* 获取:登录密码
*/
public String getPwd() {
return pwd;
}
/**
* 设置:头像名称,访问地址需要拼接
*/
public void setAvatar(String avatar) {
this.avatar = avatar;
}
/**
* 获取:头像名称,访问地址需要拼接
*/
public String getAvatar() {
return avatar;
}
/**
* 设置:1 内部(优领) 2外部(分销商)
*/
public void setCategory(Integer category) {
this.category = category;
}
/**
* 获取:1 内部(优领) 2外部(分销商)
*/
public Integer getCategory() {
return category;
}
/**
* 设置:登录密码错误次数,大于5次将禁用
*/
public void setLfc(Integer lfc) {
this.lfc = lfc;
}
/**
* 获取:登录密码错误次数,大于5次将禁用
*/
public Integer getLfc() {
return lfc;
}
/**
* 设置:禁用时间
*/
public void setProhibittime(Date prohibittime) {
this.prohibittime = prohibittime;
}
/**
* 获取:禁用时间
*/
public Date getProhibittime() {
return prohibittime;
}
/**
* 设置:登录ip
*/
public void setIp(String ip) {
this.ip = ip;
}
/**
* 获取:登录ip
*/
public String getIp() {
return ip;
}
/**
* 设置:登录时间
*/
public void setLogintime(Date logintime) {
this.logintime = logintime;
}
/**
* 获取:登录时间
*/
public Date getLogintime() {
return logintime;
}
/**
* 设置:更新时间
*/
public void setUpdatetime(Date updatetime) {
this.updatetime = updatetime;
}
/**
* 获取:更新时间
*/
public Date getUpdatetime() {
return updatetime;
}
}
package cn.timer.api.bean.insure;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/3 8:48
*/
@Data
public class CallBack implements Serializable {
private static final long serialVersionUID = 61499950876094044L;
private String status;
private String policy_status;
private String err_msg;
private String policy_no;
private String serial_number;
private String quote_trans_id;
private String serial_no;
private String policy_file;
private String total_expenditure;
private String endorsement_file;
private OrderImportInfo order_import_info;
}
package cn.timer.api.bean.insure;
import cn.timer.api.bean.htzz.HtzzAssoZztx;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
* 投保人
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-08 16:05:26
*/
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "insure_applicant")
@ApiModel("投保人")
public class InsureApplicant extends Model<InsureApplicant> {
private static final long serialVersionUID = 1L;
/**
* id
*/
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号")
private Integer id;
/**
* 企业/网点名称
*/
@ApiModelProperty(value = "企业/网点名称")
private String applicantEName;
/**
* 企业/网点地址
*/
@ApiModelProperty(value = "企业/网点地址")
private String applicantEAddress;
/**
* 人员清单
*/
@ApiModelProperty(value = "人员清单")
private String applicantEmployeeList;
/**
* 企业授权操作人姓名
*/
@ApiModelProperty(value = "企业授权操作人姓名")
private String applicantEContacts;
/**
* 操作人的联系电话
*/
@ApiModelProperty(value = "操作人的联系电话")
private String applicantEPhone;
/**
* 企业证件类型:3646、统一社会信用代码 3924、组织机构代码
*/
@ApiModelProperty(value = "企业证件类型")
private String applicantENoType;
/**
* 企业证件号码
*/
@ApiModelProperty(value = "企业证件号码")
private String applicantENo;
/**
* 企业邮箱
*/
@ApiModelProperty(value = "企业邮箱")
private String applicantEMail;
/**
* 省市区
*/
@ApiModelProperty(value = "省市区")
private String applicantProvinceCity;
/**
* 发票收件地址
*/
@ApiModelProperty(value = "发票收件地址")
private String applicantInvoiceReceivingAddress;
/**
* 发票开票电话
*/
@ApiModelProperty(value = "发票开票电话")
private String applicantInvoiceBillingPhone;
/**
* 企业开户行名称
*/
@ApiModelProperty(value = "企业开户行名称")
private String applicantBusinessBankName;
/**
* 保单号
*/
@ApiModelProperty(value = "保单号")
private String policyNo;
/**
* 投保类型:1个人 2 企业
*/
@ApiModelProperty(value = "投保类型")
private String applicantType;
/**
* 报价请求流水号
*/
@ApiModelProperty(value = "报价请求流水号")
private String transId;
/**
* 报价号
*/
@ApiModelProperty(value = "报价号")
private String currency;
/**
* 发票开票金额
*/
@ApiModelProperty(value = "发票开票金额")
private String applicantInvoicedAmount;
@ApiModelProperty(value = "企业id", example = "")
private Integer orgCode;
@ApiModelProperty(value="银行账号")
private String applicantCorporateBankAccount;
/**
* 设置:id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 设置:企业/网点名称
*/
public void setApplicantEName(String applicantEName) {
this.applicantEName = applicantEName;
}
/**
* 获取:企业/网点名称
*/
public String getApplicantEName() {
return applicantEName;
}
/**
* 设置:企业/网点地址
*/
public void setApplicantEAddress(String applicantEAddress) {
this.applicantEAddress = applicantEAddress;
}
/**
* 获取:企业/网点地址
*/
public String getApplicantEAddress() {
return applicantEAddress;
}
/**
* 设置:人员清单
*/
public void setApplicantEmployeeList(String applicantEmployeeList) {
this.applicantEmployeeList = applicantEmployeeList;
}
/**
* 获取:人员清单
*/
public String getApplicantEmployeeList() {
return applicantEmployeeList;
}
/**
* 设置:企业授权操作人姓名
*/
public void setApplicantEContacts(String applicantEContacts) {
this.applicantEContacts = applicantEContacts;
}
/**
* 获取:企业授权操作人姓名
*/
public String getApplicantEContacts() {
return applicantEContacts;
}
/**
* 设置:操作人的联系电话
*/
public void setApplicantEPhone(String applicantEPhone) {
this.applicantEPhone = applicantEPhone;
}
/**
* 获取:操作人的联系电话
*/
public String getApplicantEPhone() {
return applicantEPhone;
}
/**
* 设置:企业证件类型:3646、统一社会信用代码 3924、组织机构代码
*/
public void setApplicantENoType(String applicantENoType) {
this.applicantENoType = applicantENoType;
}
/**
* 获取:企业证件类型:3646、统一社会信用代码 3924、组织机构代码
*/
public String getApplicantENoType() {
return applicantENoType;
}
/**
* 设置:企业证件号码
*/
public void setApplicantENo(String applicantENo) {
this.applicantENo = applicantENo;
}
/**
* 获取:企业证件号码
*/
public String getApplicantENo() {
return applicantENo;
}
/**
* 设置:企业邮箱
*/
public void setApplicantEMail(String applicantEMail) {
this.applicantEMail = applicantEMail;
}
/**
* 获取:企业邮箱
*/
public String getApplicantEMail() {
return applicantEMail;
}
/**
* 设置:省市区
*/
public void setApplicantProvinceCity(String applicantProvinceCity) {
this.applicantProvinceCity = applicantProvinceCity;
}
/**
* 获取:省市区
*/
public String getApplicantProvinceCity() {
return applicantProvinceCity;
}
/**
* 设置:发票收件地址
*/
public void setApplicantInvoiceReceivingAddress(String applicantInvoiceReceivingAddress) {
this.applicantInvoiceReceivingAddress = applicantInvoiceReceivingAddress;
}
/**
* 获取:发票收件地址
*/
public String getApplicantInvoiceReceivingAddress() {
return applicantInvoiceReceivingAddress;
}
/**
* 设置:发票开票电话
*/
public void setApplicantInvoiceBillingPhone(String applicantInvoiceBillingPhone) {
this.applicantInvoiceBillingPhone = applicantInvoiceBillingPhone;
}
/**
* 获取:发票开票电话
*/
public String getApplicantInvoiceBillingPhone() {
return applicantInvoiceBillingPhone;
}
/**
* 设置:企业开户行名称
*/
public void setApplicantBusinessBankName(String applicantBusinessBankName) {
this.applicantBusinessBankName = applicantBusinessBankName;
}
/**
* 获取:企业开户行名称
*/
public String getApplicantBusinessBankName() {
return applicantBusinessBankName;
}
/**
* 设置:保单号
*/
public void setPolicyNo(String policyNo) {
this.policyNo = policyNo;
}
/**
* 获取:保单号
*/
public String getPolicyNo() {
return policyNo;
}
/**
* 设置:投保类型:1个人 2 企业
*/
public void setApplicantType(String applicantType) {
this.applicantType = applicantType;
}
/**
* 获取:投保类型:1个人 2 企业
*/
public String getApplicantType() {
return applicantType;
}
/**
* 设置:报价请求流水号
*/
public void setTransId(String transId) {
this.transId = transId;
}
/**
* 获取:报价请求流水号
*/
public String getTransId() {
return transId;
}
/**
* 设置:报价号
*/
public void setCurrency(String currency) {
this.currency = currency;
}
/**
* 获取:报价号
*/
public String getCurrency() {
return currency;
}
/**
* 设置:发票开票金额
*/
public void setApplicantInvoicedAmount(String applicantInvoicedAmount) {
this.applicantInvoicedAmount = applicantInvoicedAmount;
}
/**
* 获取:发票开票金额
*/
public String getApplicantInvoicedAmount() {
return applicantInvoicedAmount;
}
public Integer getOrgCode() {
return orgCode;
}
public void setOrgCode(Integer orgCode) {
this.orgCode = orgCode;
}
}
package cn.timer.api.bean.insure;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-22 09:55:46
*/
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "insure_log")
@ApiModel("投保日志")
public class InsureLog extends Model<InsureLog> {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号")
private Integer id;
/**
* 请求路径
*/
private String requestPath;
/**
* 请求参数
*/
private String requestData;
/**
* 请求参数
*/
private String requestParam;
/**
* 请求时间
*/
private Date createTime;
/**
* 返回时间
*/
private Date returnTime;
/**
* 返回编码
*/
private String returnCode;
/**
* 返回参数
*/
private String returnBody;
/**
* 返回编码文本
*/
private String returnMsg;
/**
* 请求流水号
*/
private String transId;
/**
* 类型:1成功 2失败 3等待
*/
private Integer type;
/**
* 请求方式1 post 2get 3put
*/
private Integer requestType;
private Integer policyId;
public String fileUrl;
/**
* 设置:
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取:
*/
public Integer getId() {
return id;
}
/**
* 设置:请求路径
*/
public void setRequestPath(String requestPath) {
this.requestPath = requestPath;
}
/**
* 获取:请求路径
*/
public String getRequestPath() {
return requestPath;
}
/**
* 设置:请求参数
*/
public void setRequestData(String requestData) {
this.requestData = requestData;
}
/**
* 获取:请求参数
*/
public String getRequestData() {
return requestData;
}
/**
* 设置:请求参数
*/
public void setRequestParam(String requestParam) {
this.requestParam = requestParam;
}
/**
* 获取:请求参数
*/
public String getRequestParam() {
return requestParam;
}
/**
* 设置:请求时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取:请求时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 设置:返回时间
*/
public void setReturnTime(Date returnTime) {
this.returnTime = returnTime;
}
/**
* 获取:返回时间
*/
public Date getReturnTime() {
return returnTime;
}
/**
* 设置:返回编码
*/
public void setReturnCode(String returnCode) {
this.returnCode = returnCode;
}
/**
* 获取:返回编码
*/
public String getReturnCode() {
return returnCode;
}
/**
* 设置:返回参数
*/
public void setReturnBody(String returnBody) {
this.returnBody = returnBody;
}
/**
* 获取:返回参数
*/
public String getReturnBody() {
return returnBody;
}
/**
* 设置:返回编码文本
*/
public void setReturnMsg(String returnMsg) {
this.returnMsg = returnMsg;
}
/**
* 获取:返回编码文本
*/
public String getReturnMsg() {
return returnMsg;
}
/**
* 设置:请求流水号
*/
public void setTransId(String transId) {
this.transId = transId;
}
/**
* 获取:请求流水号
*/
public String getTransId() {
return transId;
}
/**
* 设置:类型:1成功 2失败 3等待
*/
public void setType(Integer type) {
this.type = type;
}
/**
* 获取:类型:1成功 2失败 3等待
*/
public Integer getType() {
return type;
}
}
package cn.timer.api.bean.insure;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
* 保单信息
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-14 08:53:04
*/
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "insure_policy")
@ApiModel("保单信息")
public class InsurePolicy extends Model<InsurePolicy> {
private static final long serialVersionUID = 1L;
/**
*
*/
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号")
private Integer id;
/**
* 方案名称(必选)
*/
private String schemeName;
/**
* 保单生效日
*/
private Date policyDateStart;
/**
* 保单终止日
*/
private Date policyDateEnd;
/**
* 产品代码
*/
private String productCodeId;
/**
* 计划代码
*/
private String planCodeId;
/**
* 分销商pid
*/
private String partnerPid;
/**
* 保单号
*/
private String policyNo;
/**
* 保单类型:1、年单 2、月单
*/
private Integer type;
/**
* 5-人民币,其他币种请参见全局数据字典
*/
private String currency;
/**
* 总保费
*/
private String totalPremium;
/**
* 1-正常
*/
private String status;
/**
* 电子保单
*/
private String policyFile;
/**
* 保单kit的地址
*/
private String kitUrl;
/**
* 投保人id
*/
private Integer insureApplicantId;
/**
* 企业id
*/
private Integer orgCode;
/**
* 投保时间
*/
private Date createTime;
/**
* 最近操作时间
*/
private Date updateTime;
private Integer productId;
}
package cn.timer.api.bean.insure;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
* 保险产品
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-30 11:36:30
*/
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "insure_product")
@ApiModel("保险产品")
public class InsureProduct extends Model<InsureProduct> {
private static final long serialVersionUID = 1L;
/**
* id
*/
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号")
private Integer id;
/**
* 产品名称
*/
private String name;
/**
* 计划代码
*/
private String planCodeId;
/**
* 产品代码
*/
private String productCodeId;
/**
* 类型:1年单 2月单
*/
private Integer type;
/**
* 创建时间
*/
private Date createTime;
/**
* 是否删除 0否 1是
*/
private Integer isDel;
/**
* 设置:id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取:id
*/
public Integer getId() {
return id;
}
/**
* 设置:产品名称
*/
public void setName(String name) {
this.name = name;
}
/**
* 获取:产品名称
*/
public String getName() {
return name;
}
/**
* 设置:计划代码
*/
public void setPlanCodeId(String planCodeId) {
this.planCodeId = planCodeId;
}
/**
* 获取:计划代码
*/
public String getPlanCodeId() {
return planCodeId;
}
/**
* 设置:产品代码
*/
public void setProductCodeId(String productCodeId) {
this.productCodeId = productCodeId;
}
/**
* 获取:产品代码
*/
public String getProductCodeId() {
return productCodeId;
}
/**
* 设置:类型:1年单 2月单
*/
public void setType(Integer type) {
this.type = type;
}
/**
* 获取:类型:1年单 2月单
*/
public Integer getType() {
return type;
}
/**
* 设置:创建时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取:创建时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 设置:是否删除 0否 1是
*/
public void setIsDel(Integer isDel) {
this.isDel = isDel;
}
/**
* 获取:是否删除 0否 1是
*/
public Integer getIsDel() {
return isDel;
}
}
package cn.timer.api.bean.insure;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Transient;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
* 被保人
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-11 09:06:53
*/
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "insure_user")
@ApiModel("被保人")
public class InsureUser extends Model<InsureUser> {
private static final long serialVersionUID = 1L;
/**
* id
*/
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号")
private Integer id;
/**
* 被保险人请求流水号
*/
@ApiModelProperty(value = "被保险人请求流水号")
private String transId;
/**
* 批次核算保费
*/
@ApiModelProperty(value = "批次核算保费")
private String price;
/**
* 姓名
*/
@ApiModelProperty(value = "姓名")
private String insuredName;
/**
* 被保险人批次号
*/
@ApiModelProperty(value = "被保险人批次号")
private String batchNo;
/**
* 保单批次保费
*/
@ApiModelProperty(value = "保单批次保费")
private String premium;
/**
* 被保险人联系电话
*/
@ApiModelProperty(value = "被保险人联系电话")
private String insuredMobile;
/**
* 证件号码
*/
@ApiModelProperty(value = "证件号码")
private String insuredNo;
/**
* 联系人姓名
*/
@ApiModelProperty(value = "联系人姓名")
private String insuredEContact;
/**
* 基础计划 30万雇主/3万医疗 36968,50万雇主/5万医疗 36969,80万雇主/10万医疗 36970,80万雇主/20万医疗 36971,100万雇主/10万医疗 36972
*/
@ApiModelProperty(value = "基础计划")
private String benefitBasicPlan;
/**
* 职业类别 A类 63119 B类 63120 C类 63121
*/
@ApiModelProperty(value = "职业类别")
private String benefitOccupationCategory;
/**
* 参保人数
*/
@ApiModelProperty(value = "参保人数")
private String benefitElEmployeeNumberT;
/**
* 二、三轮车车架号(必选)
*/
@ApiModelProperty(value = "二、三轮车车架号")
private String tricycleFrameNumber;
/**
* 保单号
*/
@ApiModelProperty(value = "保单号")
private String policyNo;
/**
* 参保状态:1参保中 2已失效
*/
@ApiModelProperty(value = "参保状态")
private String status;
/**
* 被保人类型:1个人 2企业
*/
@ApiModelProperty(value = "被保人类型")
private Integer type;
/**
* 企业id
*/
@ApiModelProperty(value = "企业id")
private Integer orgCode;
/**
* 个人id
*/
@ApiModelProperty(value = "个人id")
private Integer userId;
/**
* 人员清单
*/
@ApiModelProperty(value = "人员清单")
private String applicantEmployeeList;
@ApiModelProperty(value = "生效日期")
private Date policyDateStart;
@ApiModelProperty(value = "失效日期")
private Date policyDateEnd;
@ApiModelProperty(value = "投保状态:1成功 2失败 3待更新")
private Integer insureStatus;
@ApiModelProperty(value = "保单id")
private Integer policyId;
@ApiModelProperty(value = "替换流水号,使用trans_id,RP_开头")
private String replaceTransId;
@ApiModelProperty(value = "申请类型:1新增 2投保 3批增")
private Integer applyType;
}
package cn.timer.api.bean.insure;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/3 18:01
*/
import java.io.Serializable;
/**
* 投保订单详情
*/
public class InsuredOrderDetail implements Serializable {
private static final long serialVersionUID = -1695869258491138853L;
private String is_ss;
/**
*
*/
private String transId;
private String serialNumber;
}
package cn.timer.api.bean.insure;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/22 17:02
*/
@Data
public class OrderImportInfo implements Serializable {
private static final long serialVersionUID = -6208327653541160864L;
private String uuid;
private String single_serial_no;
private String third_uuid;
private String total_money;
private String endorsement_file;
private String err_msg;
private List<Map> err_list;
private String err_content;
}
......@@ -223,8 +223,7 @@ public class YgglMainEmp extends Model<YgglMainEmp> {
@TableField(exist = false)
@ApiModelProperty(value="员工登陆账号(手机号)",example="员工登陆账号(手机号)")
private String empLoginPhone;
@ApiModelProperty(value="是否已投保:0否 1是",example="")
private int isInsure;
}
......@@ -27,22 +27,22 @@ public class RedisSessionInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws Exception {
// response.setHeader("Access-Control-Allow-Origin","http://120.24.24.239:8088");
//// response.setHeader("Access-Control-Allow-Origin",request.getHeader("Origin"));
// response.setHeader("Access-Control-Allow-Methods", "*");
// response.setHeader("Access-Control-Allow-Credentials", "true");
// response.setHeader("Access-Control-Allow-Headers", "*");
//
//
// System.out.print("request.Origin>"+request.getHeader("Origin"));
// //option预检查,直接通过请求
// if ("OPTIONS".equals(request.getMethod())){
// return true;
// }
/*
* Enumeration<String> names = request.getHeaderNames();
* while(names.hasMoreElements()) { String name = (String)names.nextElement();
......@@ -50,8 +50,10 @@ public class RedisSessionInterceptor implements HandlerInterceptor {
* value); }
*/
// 无论访问的地址是不是正确的,都进行登录验证,登录成功后的访问再进行分发,404的访问自然会进入到错误控制器中
HttpSession session = request.getSession();
if(session.getAttribute("ui")==null) {
HttpSession session = request.getSession();
Object ai = session.getAttribute("ai");
Object ui = session.getAttribute("ui");
if(session.getAttribute("ui")==null&&session.getAttribute("ai")==null) {
response401(response);
return false;
}
......@@ -71,7 +73,7 @@ public class RedisSessionInterceptor implements HandlerInterceptor {
// response401(response);
return true;
}
private void response401(HttpServletResponse response) {
......
......@@ -19,10 +19,10 @@ import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
@Configuration
public class WebSecurityConfig implements WebMvcConfigurer {
@Resource
private UserMethodArgumentResolver userMethodArgumentResolver;
@Bean
public RedisSessionInterceptor getSessionInterceptor() {
return new RedisSessionInterceptor();
......@@ -30,12 +30,15 @@ public class WebSecurityConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
// 所有已api开头的访问都要进入RedisSessionInterceptor拦截器进行登录验证,并排除login接口(全路径)。必须写成链式,分别设置的话会创建多个拦截器。
// 所有已api开头的访问都要进入RedilsSessionInterceptor拦截器进行登录验证,并排除login接口(全路径)。必须写成链式,分别设置的话会创建多个拦截器。
// 必须写成getSessionInterceptor(),否则SessionInterceptor中的@Autowired会无效
//.excludePathPatterns("/")
registry.addInterceptor(getSessionInterceptor())
.addPathPatterns("/**")
.excludePathPatterns("/callback/**")
.excludePathPatterns("/callBack/policy/CallBack")
.excludePathPatterns("/callBack/policy/insuredCallBack")
.excludePathPatterns("/superLogin/**")
.excludePathPatterns("/actuator/*")
.excludePathPatterns("/doc*")
.excludePathPatterns("/v2/**")
......@@ -53,14 +56,14 @@ public class WebSecurityConfig implements WebMvcConfigurer {
.excludePathPatterns("/check/**");
// registry.addInterceptor(getSessionInterceptor()).addPathPatterns("/**").excludePathPatterns("/swagger-ui*");
}
/**
* 配置消息转换器--这里我用的是alibaba 开源的 fastjson
* @param converters
*/
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
// Iterator<HttpMessageConverter<?>> iterator = converters.iterator();
// while(iterator.hasNext()){
// HttpMessageConverter<?> converter = iterator.next();
......@@ -107,12 +110,12 @@ public class WebSecurityConfig implements WebMvcConfigurer {
converters.add(0,fastConverter);
}
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
argumentResolvers.add(userMethodArgumentResolver);
}
// @Override
// public void addCorsMappings(CorsRegistry registry) {
//// System.out.println("我是MyWebConfig跨域");
......
package cn.timer.api.controller.insure;
import cn.timer.api.bean.insure.CallBack;
import cn.timer.api.bean.insure.InsureLog;
import cn.timer.api.bean.insure.InsurePolicy;
import cn.timer.api.bean.insure.InsureUser;
import cn.timer.api.bean.yggl.YgglMainEmp;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.google.common.collect.Maps;
import com.mysql.cj.util.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.codec.digest.DigestUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/3 8:45
*/
@Api(tags = "8.0回调接口")
@RestController
@Transactional
@RequestMapping(value = "/callBack/policy", produces = {"application/json"})
public class CallBackContorll {
private static final Logger log = LoggerFactory.getLogger(CallBackContorll.class);
/*保全测试用*/
@Value("${insure.appidq}")
private String appidq;
@Value("${insure.secretq}")
private String secretq;
@Value("${BASE_API_URL}")
private String base_api_url;
@PostMapping(value = "/insuredCallBack")
@ApiOperation(value = "6.投保申请回调", httpMethod = "Post", notes = "投保申请回调")
@ApiOperationSupport(order = 2)
private Map insuredCallBack(HttpServletRequest request, @RequestParam String pid, @RequestParam String sign, @RequestParam String timestamp) throws IOException {
Map map = Maps.newHashMap();
map.put("status", "error");
if (StringUtils.isNullOrEmpty(pid) || StringUtils.isNullOrEmpty(sign) && StringUtils.isNullOrEmpty(timestamp)) {
return map;
}
if (!pid.equals(appidq)) {
return map;
}
InputStream is = null;
is = request.getInputStream();
StringBuilder sb = new StringBuilder();
byte[] b = new byte[4096];
for (int n; (n = is.read(b)) != -1; ) {
sb.append(new String(b, 0, n));
}
String value = DigestUtils.md5Hex(appidq + secretq + timestamp + sb.toString());
if (!value.equals(sign)) {
return map;
}
CallBack callBack = JSONObject.parseObject(sb.toString(), CallBack.class);
Map trueMap = Maps.newHashMap();
trueMap.put("status", "1");
return trueMap;
}
@PostMapping(value = "/CallBack")
@ApiOperation(value = "7.保全增员申请回调", httpMethod = "Post", notes = "投保申请回调")
@ApiOperationSupport(order = 2)
private Map callBack(HttpServletRequest request, @RequestParam String pid, @RequestParam String sign, @RequestParam String timestamp) throws IOException {
Map map = Maps.newHashMap();
map.put("status", "error");
if (StringUtils.isNullOrEmpty(pid) || StringUtils.isNullOrEmpty(sign) && StringUtils.isNullOrEmpty(timestamp)) {
return map;
}
if (!pid.equals(appidq)) {
return map;
}
InputStream is = null;
is = request.getInputStream();
StringBuilder sb = new StringBuilder();
byte[] b = new byte[4096];
for (int n; (n = is.read(b)) != -1; ) {
sb.append(new String(b, 0, n));
}
String value = DigestUtils.md5Hex(appidq + secretq + timestamp + sb.toString());
if (!value.equals(sign)) {
return map;
}
Map paramsMap = Maps.newHashMap();
paramsMap.put("pid", pid);
paramsMap.put("timestamp", timestamp);
paramsMap.put("sign", sign);
CallBack callBack = JSONObject.parseObject(sb.toString(), CallBack.class);
log.info("callBack=====" + sb.toString());
if (callBack.getStatus().equals("1")) {
List<InsureUser> list = InsureUser.builder().build().selectList(new QueryWrapper<InsureUser>().lambda().eq(InsureUser::getBatchNo, callBack.getOrder_import_info().getUuid()).eq(InsureUser::getInsureStatus, 3));
list.forEach(i -> {
i.setInsureStatus(1);
i.updateById();
YgglMainEmp.builder().isInsure(1).build().update(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getId, i.getUserId()));
});
List<InsureUser> oldlist = InsureUser.builder().build().selectList(new QueryWrapper<InsureUser>().lambda().eq(InsureUser::getReplaceTransId, callBack.getOrder_import_info().getUuid()));
if (oldlist != null && oldlist.size() > 0) {
oldlist.forEach(i -> {
i.setInsureStatus(4);
i.setStatus("2");
i.updateById();
YgglMainEmp.builder().isInsure(0).build().update(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getId, i.getUserId()));
});
}
InsurePolicy insurePolicy = InsurePolicy.builder().build().selectOne(new QueryWrapper<InsurePolicy>().lambda().eq(InsurePolicy::getPolicyNo, list.get(0).getPolicyNo()));
if (oldlist == null || oldlist.size() == 0) {
insurePolicy.setTotalPremium(String.valueOf(Double.valueOf(insurePolicy.getTotalPremium()) + Double.valueOf(callBack.getOrder_import_info().getTotal_money())));
}
insurePolicy.setPolicyFile(callBack.getOrder_import_info().getEndorsement_file());
insurePolicy.setUpdateTime(new Date());
insurePolicy.updateById();
InsureLog.builder().requestParam(JSONObject.toJSONString(paramsMap)).type(7)
.requestData(sb.toString()).createTime(new Date()).requestType(1).returnBody(JSONObject.toJSONString(callBack)).requestPath(base_api_url + "/callBack/policy/CallBack")
.returnCode(callBack.getStatus()).returnMsg("更新成功").policyId(insurePolicy.getId()).build().insert();
} else {
String errorMsg = "";
InsureLog insureLog = InsureLog.builder().build().selectOne(new QueryWrapper<InsureLog>().lambda().eq(InsureLog::getTransId, callBack.getOrder_import_info().getThird_uuid()));
List<Map> errMap = callBack.getOrder_import_info().getErr_list();
if (errMap.size() > 0) {
for (int i = 0; i < errMap.size(); i++) {
errorMsg = errorMsg + ("姓名:"+errMap.get(i).get("name").toString()+",错误:"+errMap.get(i).get("err_content").toString() + ',');
}
} else {
errorMsg = callBack.getErr_msg();
}
//TODO 写入日志
InsureLog.builder().requestParam(JSONObject.toJSONString(paramsMap)).type(7)
.requestData(sb.toString()).createTime(new Date()).requestType(1).returnBody(JSONObject.toJSONString(callBack)).requestPath(base_api_url + "/callBack/policy/CallBack")
.returnCode(callBack.getStatus()).returnMsg(errorMsg).policyId(insureLog.getPolicyId()).build().insert();
}
Map trueMap = Maps.newHashMap();
trueMap.put("status", "1");
return trueMap;
}
}
package cn.timer.api.controller.insure;
import java.io.IOException;
import java.util.Map;
import java.util.Optional;
import java.util.Random;
import cn.timer.api.bean.insure.InsureApplicant;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.dao.insure.InsureApplicantMapper;
import cn.timer.api.dto.insure.InsureDto;
import cn.timer.api.utils.HttpUtils;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import com.alibaba.druid.util.Base64;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Maps;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.apache.commons.codec.digest.DigestUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
/**
* 投保人
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-07 17:02:46
*/
@Api(tags = "8.0保险列表")
@RestController
@Transactional
@RequestMapping(value = "/insureApplicant", produces = {"application/json"})
public class InsureApplicantController {
@PostMapping("/insureApplicationSetting")
@ApiOperation(value = "设置投保人", httpMethod = "POST", notes = "投保申请")
private Result<Object> insureApplicationSetting(@RequestBody InsureApplicant params) {
InsureApplicant insureApplicant = InsureApplicant.builder().id(1).build().selectById();if(insureApplicant==null){
params.insert();
return ResultUtil.data(params);
}
params.setId(insureApplicant.getId());
params.updateById();
return ResultUtil.data(params);
}
@GetMapping("/getApplicant")
@ApiOperation(value = "获取投保人", httpMethod = "Get", notes = "获取投保人")
private Result<Object> getApplicant() {
InsureApplicant insureApplicant = InsureApplicant.builder().id(1).build().selectById();
if(insureApplicant==null){
return ResultUtil.data(null);
}
return ResultUtil.data(insureApplicant);
}
}
package cn.timer.api.controller.insure;
//import cn.timer.api.bean.insure.InsuredUser;
import cn.timer.api.bean.insure.*;
import cn.timer.api.bean.kqmk.KqglAssoLeaveEmployeeBalance;
import cn.timer.api.bean.kqmk.KqglAssoLeaveRules;
import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.controller.insure.bean.ExcelBean;
import cn.timer.api.utils.*;
import com.alibaba.druid.util.Base64;
import com.aliyun.oss.common.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.beust.jcommander.internal.Lists;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.ibatis.annotations.Param;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.net.URLEncoder;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
......@@ -43,147 +56,164 @@ import javax.servlet.http.HttpServletResponse;
@Transactional
@RequestMapping(value = "/insure", produces = {"application/json"})
public class InsureContorll {
@Value("${BASE_API_URL}")
private String base_api_url;
private static final Logger log = LoggerFactory.getLogger(InsureContorll.class);
/*测试用*/
private static String appid = "1002303100602312445";
/*测试用*/
private static String secret = "acb329868c31d5b3ba03de40dac13dd9";
/*保全测试用*/
private static String appidq="1000115041006006938";
/*保全测试用*/
private static String secretq="6ba1bf4aa0bd14368c95ff0b9934a17b";
@Value("${insure.appid}")
private String appid;
@Value("${insure.secret}")
private String secret;
@Value("${insure.appidq}")
private String appidq;
@Value("${insure.secretq}")
private String secretq;
@Value("${insure.uploadUrl}")
private String uploadUrl;
@Value("${insure.insuredUrl}")
private String insuredUrl;
@Value("${insure.uploadUrlq}")
private String uploadUrl2;
@Value("${insure.batchUrl}")
private String batchUrl;
private static SimpleDateFormat dtf3 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@Autowired
private YgglMainEmpMapper ygglMainEmpMapper;
@Autowired
private InsureUserMapper insureUserMapper;
@Autowired
private InsurePolicyMapper insurePolicyMapper;
/*测试用投保上传文件地址*/
private static String uploadUrl = " http://sandbox.portal.unistar-ins.com/service/Home/Index/fileUpload";
/*测试用投保申请地址*/
private static String insuredUrl = "http://sandbox.portal.unistar-ins.com/mall/Home/Index/createQuotePolicy";
/*测试用保全上传文件地址*/
private static String uploadUrl2 = "http://sandbox.portal.unistar-ins.com/fuli/Home/Index/file_upload";
@Autowired
private InsureLogMapper insureLogMapper;
/**
* 设置请求参数
*
* @param sign
* @return
*/
private Map setParams(String sign){
private Map setParams(String sign, String appid, String secret) {
/*当前时间戳*/
long timestamp =System.currentTimeMillis()/1000;
log.info("时间戳"+timestamp);
long timestamp = System.currentTimeMillis() / 1000;
log.info("时间戳" + timestamp);
Map paramsMap = Maps.newHashMap();
paramsMap.put("pid",appid);
paramsMap.put("timestamp",String.valueOf(timestamp));
paramsMap.put("trace_id",appid+timestamp+ new Random().nextInt((9999 - 100) + 1) + 10);
paramsMap.put("pid", appid);
paramsMap.put("timestamp", String.valueOf(timestamp));
paramsMap.put("trace_id", appid + timestamp + new Random().nextInt((9999 - 100) + 1) + 10);
// paramsMap.put("sign",Md5.md5(appid+secret+timestamp+sign.trim()));
String value=appid+secret+timestamp+sign;
log.info("body参数======"+sign);
paramsMap.put("sign", DigestUtils.md5Hex(value));
log.info("params参数======"+JSONObject.toJSONString(paramsMap));
return paramsMap;
}
/*保全*/
private Map setParams2(String sign){
/*当前时间戳*/
long timestamp =System.currentTimeMillis()/1000;
log.info("时间戳"+timestamp);
Map paramsMap = Maps.newHashMap();
paramsMap.put("pid",appidq);
paramsMap.put("timestamp",String.valueOf(timestamp/1000));
paramsMap.put("trace_id",appidq+timestamp+ new Random().nextInt((9999 - 100) + 1) + 10);
// paramsMap.put("sign",Md5.md5(appidq+secret+timestamp+sign.trim()));
String value=appidq+secretq+timestamp+sign;
log.info("body参数======"+sign);
String value = appid + secret + timestamp + sign;
log.info("body参数======" + sign);
paramsMap.put("sign", DigestUtils.md5Hex(value));
log.info("params参数======"+JSONObject.toJSONString(paramsMap));
log.info("params参数======" + JSONObject.toJSONString(paramsMap));
return paramsMap;
}
@PostMapping(value = "/insured_add")
@ApiOperation(value = "1.投保申请", httpMethod = "Post", notes = "投保申请")
@ApiOperationSupport(order = 2)
public Result<Object> insured_add(@CurrentUser UserBean userBean, @RequestParam(required = true) String url) {
QyzxEntInfoM qyzxEntInfoM = QyzxEntInfoM.builder().id(userBean.getOrgCode()).build().selectById(); // 企业信息
public Result<Object> insured_add(@RequestBody InsureDto insureDto) throws ParseException {
InsureProduct insureProduct = InsureProduct.builder().id(Integer.parseInt(insureDto.getProductId())).build().selectById();
if (insureProduct == null) {
return ResultUtil.error("产品不存在");
}
QyzxEntInfoM qyzxEntInfoM = QyzxEntInfoM.builder().id(Integer.parseInt(insureDto.getOrgCode())).build().selectById(); // 企业信息
DateTimeFormatter dtf2 = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
LocalDateTime now = LocalDateTime.now();
Date date = Date.from(now.atZone(ZoneId.systemDefault()).toInstant());
Map bodyMap = Maps.newHashMap();
ArrayList<Map> quotationsArry = new ArrayList<Map>();
bodyMap.put("is_ss",0);
Map quotations=Maps.newHashMap();
quotations.put("trans_id","MB_"+dtf2.format(now));/*报价请求流水号*/
quotations.put("applicant_type","2");/*投保人类型:2-企业*/
quotations.put("quotation_type",3);/*报价类型:3-投保申请*/
quotations.put("currency","5");/*币种:5人民币*/
quotations.put("source_type","");/*币种:5人民币*/
quotations.put("cps_email","");/*币种:5人民币*/
quotations.put("cps_tel","");/*币种:5人民币*/
quotations.put("last_serial_number","");/*币种:5人民币*/
quotations.put("from_source","");/*币种:5人民币*/
quotations.put("operator_name","");/*币种:5人民币*/
bodyMap.put("is_ss", 0);
Map quotations = Maps.newHashMap();
insureDto.getPlans().forEach(i -> {
i.setPrice(getPrice(i.getBenefitBasicPlan(), i.getBenefitOccupationCategory()));
insureDto.setTotalPrice(i.getPrice() * i.getUserIds().length + (insureDto.getTotalPrice() == null ? 0 : insureDto.getTotalPrice()));
});
quotations.put("trans_id", "MB_" + dtf2.format(now));/*报价请求流水号*/
quotations.put("applicant_type", "2");/*投保人类型:2-企业*/
quotations.put("quotation_type", 3);/*报价类型:3-投保申请*/
quotations.put("currency", "5");/*币种:5人民币*/
Map basicMap = Maps.newHashMap();
basicMap.put("partner_pid","1231");/*分销商pid*/
basicMap.put("plan_code_id","61b85207b73d2ab09fb2959");/*计划代码,选项值:61b85207b73d2ab09fb2959 (生产环境) 61b85207b73d2ab09fb2959 (沙箱环境)*/
basicMap.put("product_code_id","61b85207a9f87da19fb5986");/*产品代码,选项值:61b85207a9f87da19fb5986 (生产环境) 61b85207a9f87da19fb5986 (沙箱环境)*/
basicMap.put("policy_date_start","2022-04-01 00:00:00");
basicMap.put("policy_date_end","2022-4-30 23:59:59");
basicMap.put("channel","");
basicMap.put("fee","");
basicMap.put("partner_user_rate","");
basicMap.put("promotion_fee","");
basicMap.put("agent_id","");
basicMap.put("policy_insure_notify","");
basicMap.put("promotion_id",0);
basicMap.put("policy_number_last_year","");
quotations.put("basic",basicMap);
quotations.put("individual_applicant",Maps.newHashMap());
quotations.put("source_type", "");//*币种:5人民币*//*
quotations.put("cps_email", "");//*币种:5人民币*//*
quotations.put("cps_tel", "");//*币种:5人民币*//*
quotations.put("last_serial_number", "");//*币种:5人民币*//*
quotations.put("from_source", "");//*币种:5人民币*//*
quotations.put("operator_name", "");//*币种:5人民币
/*企业信息*/
InsureApplicant insureApplicant = InsureApplicant.builder().id(1).build().selectById();
if (insureApplicant == null) {
return ResultUtil.error("未设置投保人");
}
Map companyApplicantMap = Maps.newHashMap();
companyApplicantMap.put("applicant_e_name","测试企业一");/*企业/网点名称*/
companyApplicantMap.put("applicant_e_address", "测试地址");/*企业/网点地址*/
companyApplicantMap.put("applicant_e_contacts", "测试人");/*企业授权操作人姓名*/
companyApplicantMap.put("applicant_e_phone", "13800138000");/*操作人的联系电话*/
companyApplicantMap.put("applicant_e_no_type", "3646");/*企业证件类型*/
companyApplicantMap.put("applicant_e_no", "91310230MA1JXL5059");/*企业证件号码*/
companyApplicantMap.put("applicant_e_mail", "123@123.com");/*企业邮箱*/
companyApplicantMap.put("applicant_province_city", "21721");/*省市区*/
companyApplicantMap.put("applicant_e_name", insureApplicant.getApplicantEName());/*企业/网点名称*/
companyApplicantMap.put("applicant_e_address", insureApplicant.getApplicantEAddress());/*企业/网点地址*/
companyApplicantMap.put("applicant_e_contacts", insureApplicant.getApplicantEContacts());/*企业授权操作人姓名*/
companyApplicantMap.put("applicant_e_phone", insureApplicant.getApplicantEPhone());/*操作人的联系电话*/
companyApplicantMap.put("applicant_e_no_type", insureApplicant.getApplicantENoType());/*企业证件类型*/
companyApplicantMap.put("applicant_e_no", insureApplicant.getApplicantENo());/*企业证件号码*/
companyApplicantMap.put("applicant_e_mail", insureApplicant.getApplicantEMail());/*企业邮箱*/
companyApplicantMap.put("applicant_province_city", "21024");/*省市区*/
/*人员清单填被保人员*/
companyApplicantMap.put("applicant_employee_list",url);
quotations.put("company_applicant",companyApplicantMap);
String url = creaXSSFWorkbook(insureDto.getPlans(), insureDto.getPolicyDateStart());
if (!StringUtil.isNotBlank(url)) {
return ResultUtil.error("文件错误");
}
companyApplicantMap.put("applicant_employee_list", url);
quotations.put("company_applicant", companyApplicantMap);
Map basicMap = Maps.newHashMap();
basicMap.put("partner_pid", appid);/*分销商pid*/
basicMap.put("plan_code_id", insureProduct.getPlanCodeId());/*计划代码,选项值:61b85207b73d2ab09fb2959 (生产环境) 61b85207b73d2ab09fb2959 (沙箱环境)*/
basicMap.put("product_code_id", insureProduct.getProductCodeId());/*产品代码,选项值:61b85207a9f87da19fb5986 (生产环境) 61b85207a9f87da19fb5986 (沙箱环境)*/
basicMap.put("policy_date_start", insureDto.getPolicyDateStart());
basicMap.put("policy_date_end", insureDto.getPolicyDateEnd());
basicMap.put("channel", "");
basicMap.put("fee", "");
basicMap.put("partner_user_rate", "");
basicMap.put("promotion_fee", "");
basicMap.put("agent_id", "");
basicMap.put("policy_insure_notify", "");
basicMap.put("promotion_id", 0);
basicMap.put("policy_number_last_year", "");
quotations.put("basic", basicMap);
quotations.put("individual_applicant", Maps.newHashMap());
/*被保人员 填被保企业信息*/
ArrayList<Map> insuredArray = new ArrayList<>();
Map insured = Maps.newHashMap();
insured.put("trans_id","P_"+qyzxEntInfoM.getId()+"_"+dtf2.format(now));
insured.put("price","75");
insured.put("insured_applicant_relations", "36960");
insured.put("insured_mobile", qyzxEntInfoM.getLinkManPhone());
insured.put("insured_e_contact", qyzxEntInfoM.getLinkMan());
insured.put("insured_name", qyzxEntInfoM.getName());
insured.put("insured_no_type", "3306");
insured.put("insured_no", qyzxEntInfoM.getCreditCode());
insured.put("insured_zm_openid", "");
insured.put("benefit_basic_plan", "36969");
insured.put("benefit_occupation_category", "63119");
insured.put("benefit_EL_employee_number_t", "5");
insuredArray.add(insured);
quotations.put("insured",insuredArray);
/*quotations.put("bd_id","");不需要*/
quotations.put("file",Lists.newArrayList());
insureDto.getPlans().forEach(p -> {
Map insured = Maps.newHashMap();
insured.put("trans_id", "PI_" + qyzxEntInfoM.getId() + "_" + dtf2.format(now) + "_" + UUID.randomUUID().toString().replace("-", ""));
insured.put("price", p.getUserIds().length * p.getPrice());/*根据基础计划生成*/
insured.put("insured_applicant_relations", "36960");
insured.put("insured_mobile", insureApplicant.getApplicantEPhone());
insured.put("insured_e_contact", insureApplicant.getApplicantEContacts());
insured.put("insured_name", qyzxEntInfoM.getName());
insured.put("insured_no_type", "3306");
insured.put("insured_no", qyzxEntInfoM.getCreditCode());
insured.put("insured_zm_openid", "");
insured.put("benefit_basic_plan", p.getBenefitBasicPlan());/*基础计划写死*/
insured.put("benefit_occupation_category", p.getBenefitOccupationCategory());
insured.put("benefit_EL_employee_number_t", p.getUserIds().length);
insuredArray.add(insured);
});
quotations.put("insured", insuredArray);
quotations.put("file", Lists.newArrayList());
quotations.put("specifically_agreed_file", Lists.newArrayList());
quotations.put("policy_no", "");
quotations.put("callback_policy", "/callBack/insuredCallBack");
quotations.put("insured",insuredArray);
quotationsArry.add(quotations);
bodyMap.put("quotations",quotationsArry);
bodyMap.put("quotations", quotationsArry);
log.info(JSONObject.toJSONString(bodyMap));
Object o=requestAgent(bodyMap);
return ResultUtil.data(o);
......@@ -191,7 +221,7 @@ public class InsureContorll {
}
/*测试用生产环境不需要*/
synchronized private Object requestAgent(Map bodyMap ){
String data= HttpUtils.sendPost(insuredUrl,setParams(JSONObject.toJSONString(bodyMap)),bodyMap);
String data=HttpUtils.sendPost(insuredUrl,setParams(JSONObject.toJSONString(bodyMap)),bodyMap);
Map<String,Object> dataMap = JSONObject.parseObject(data);
if (dataMap.get("errcode").toString().equals("suc")) {
return dataMap.get("data");
......@@ -204,21 +234,46 @@ public class InsureContorll {
e.printStackTrace();
}
insureUser.insert();
if (dataMap.get("errcode").toString().equals("suc")) {
y.setIsInsure(1);
y.insertOrUpdate();
}
}
}
return ResultUtil.success(dataMap.get("errmsg").toString());
}
return dataMap.get("data");
return ResultUtil.error(dataMap.get("errmsg").toString());
}
}
return ResultUtil.error("网络异常");
}
@PostMapping (value = "/file_upload")
@ApiOperation(value = "3.投保上传文件", httpMethod = "Post", notes = "上传文件")
@ApiOperationSupport(order = 2)
public Result<Object> fileUpload(@CurrentUser UserBean userBean, @RequestParam(required = true) MultipartFile file) {
if (file == null) {
return ResultUtil.error("上传失败,请选择上传文件");
/**
* 生成投保文件
*
* @param ids
* @return
*/
public String creaXSSFWorkbook(List<PlansDto> plansList, String createDate) {
if (plansList.size() <= 0) {
return "error";
}
byte[] bytes =null;
LocalDate localDate = LocalDate.now();
Date date = new Date();
List list = Lists.newArrayList();
plansList.forEach(p -> {
List<YgglMainEmp> ygglMainEmpList = ygglMainEmpMapper.selectListByIds(p.getUserIds());
for (YgglMainEmp y : ygglMainEmpList) {
String[] arr = new String[]{String.valueOf(y.getId()), y.getName(), "身份证", y.getZjNum(), InsuranceEnum.getEnum(p.getBenefitBasicPlan(), p.getBenefitOccupationCategory()).getName(), createDate, "深圳名邦人力资源管理有限公司", StringUtils.isNullOrEmpty(p.getTricycleFrameNumber()) ? "无" : p.getTricycleFrameNumber(), InsuranceEnum.getEnum(p.getBenefitBasicPlan(), p.getBenefitOccupationCategory()).getType()};
list.add(arr);
}
});
String[] rowName = new String[]{"ID", "name", "ID_type", "ID_number", "Scheme_name", "Date_start", "Branch", "Tricycle_frame_number", "benefit_occupation_category"};
XSSFWorkbook xssfWorkbook = ExcelUtils.exportExcel(localDate + "_投保" + list.size() + "名人员清单.xlsx", rowName, list);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
String url = "";
try {
bytes=file.getBytes();
} catch (IOException e) {
......@@ -232,7 +287,7 @@ public class InsureContorll {
bodyMap.put("name",file.getName());
bodyMap.put("file",fileBase64);
/*end*/
String data= HttpUtils.sendPost(uploadUrl,setParams(JSONObject.toJSONString(bodyMap)),bodyMap);
String data=HttpUtils.sendPost(uploadUrl,setParams(JSONObject.toJSONString(bodyMap)),bodyMap);
log.info("请求返回的结果====="+data);
/*文件流base64*/
return ResultUtil.data(message(data));
......@@ -258,66 +313,523 @@ public class InsureContorll {
// bodyMap.put("name","劳务公司批增-月单(1).xlsx");
bodyMap.put("file",fileBase64);
/*end*/
String data= HttpUtils.sendPost(uploadUrl2,setParams2(JSONObject.toJSONString(bodyMap)),bodyMap);
String data=HttpUtils.sendPost(uploadUrl2,setParams2(JSONObject.toJSONString(bodyMap)),bodyMap);
log.info("请求返回的结果====="+data);
/*文件流base64*/
return ResultUtil.data(message(data));
};
// @PostMapping(value = "/baoquan")
// @ApiOperation(value = "2.单个添加保全", httpMethod = "Post", notes = "上传文件")
// @ApiOperationSupport(order = 2)
// public Result<Object> baoquan_add(InsuredUser user) {
//return null;
// }
@PostMapping(value = "/replaceUser")
@ApiOperation(value = "6.保全替换", httpMethod = "Post", notes = "保全替换")
public Result<Object> replaceUser(@RequestBody InsureDto insureDto) {
InsurePolicy insurePolicy = InsurePolicy.builder().id(Integer.parseInt(insureDto.getId())).build().selectById();
if (insurePolicy == null) {
return ResultUtil.error("保单不存在");
}
List<InsureUser> oldInsureUserList = insureUserMapper.selectListByIds(insureDto.getOldIds());
String[] oldUser = new String[oldInsureUserList.size()];
for (int i = 0; i < oldInsureUserList.size(); i++) {
oldUser[i] = oldInsureUserList.get(i).getUserId().toString();
}
Integer price = getPrice(insureDto.getBenefitBasicPlan(), insureDto.getBenefitOccupationCategory());
LocalDateTime now = LocalDateTime.now();
String url = creaXSSFWorkbook2(insureDto.getUserIds(), insureDto.getPolicyDateStart(), oldUser, insureDto.getBenefitOccupationCategory(), insureDto.getTricycleFrameNumber());
log.info("保全替换文件地址", url);
DateTimeFormatter dtf2 = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
Map bodyMap = Maps.newHashMap();
bodyMap.put("contract_no", insurePolicy.getPolicyNo());
bodyMap.put("order_status", "3");
bodyMap.put("callback_plan", "");
bodyMap.put("file_url", url);
bodyMap.put("from_source", "API");
bodyMap.put("import_review_callback", "");
bodyMap.put("import_callback", base_api_url + "/callBack/policy/CallBack");
bodyMap.put("third_uuid", "RP_" + insurePolicy.getOrgCode() + "_" + dtf2.format(now));
String responData = HttpUtils.sendPost(batchUrl, setParams(JSONObject.toJSONString(bodyMap), appidq, secretq), bodyMap);
Map<String, Object> dataMap = JSONObject.parseObject(responData);
InsureLog.builder().requestParam(JSONObject.toJSONString(setParams(JSONObject.toJSONString(bodyMap), appid, secret))).type(3)
.requestData(JSONObject.toJSONString(bodyMap)).createTime(new Date()).requestType(1).returnBody(responData).requestPath(batchUrl)
.returnCode(dataMap.get("errcode").toString()).returnMsg(dataMap.get("errmsg").toString()).policyId(insurePolicy.getId()).fileUrl(url).build().insert();
if (dataMap.get("errcode").toString().equals("suc")) {
Map<String, Object> data = JSONObject.parseObject(JSONObject.toJSONString(dataMap.get("data")));
Map<String, Object> orderImportInfo = JSONObject.parseObject(JSONObject.toJSONString(data.get("order_import_info")));
String status = orderImportInfo.get("status").toString();
if (status.equals("5") || status.equals("6") || status.equals("7")) {
InsureLog.builder().requestParam(JSONObject.toJSONString(setParams(JSONObject.toJSONString(bodyMap), appid, secret))).type(2)
.requestData(JSONObject.toJSONString(bodyMap)).createTime(new Date()).requestType(1).returnBody(responData).requestPath(batchUrl)
.returnCode(dataMap.get("errcode").toString()).returnMsg(dataMap.get("errmsg").toString()).policyId(insurePolicy.getId()).transId("RP_" + insurePolicy.getOrgCode() + "_" + dtf2.format(now)).fileUrl(data.get("file_url").toString()).build().insert();
//TODO 写入日志
return ResultUtil.error("信息填写错误,请查看日志");
} else {
List<YgglMainEmp> ygglMainEmpList = ygglMainEmpMapper.selectListByIds(insureDto.getUserIds());
QyzxEntInfoM qyzxEntInfoM = QyzxEntInfoM.builder().id(Integer.parseInt(insureDto.getOrgCode())).build().selectById();
ygglMainEmpList.forEach(y -> {
try {
InsureUser.builder()
.transId("RP_" + insurePolicy.getOrgCode() + "_" + dtf2.format(now))
.insuredName(qyzxEntInfoM.getName())
.price(price.toString())/*前端获取的保费*/
.premium(String.valueOf(price * ygglMainEmpList.size()))
.batchNo(data.get("import_uuid").toString())
.benefitBasicPlan(insureDto.getBenefitBasicPlan())
.policyNo(orderImportInfo.get("contract_no").toString())
.userId(y.getId())
.orgCode(y.getOrgCode())
.benefitOccupationCategory(insureDto.getBenefitOccupationCategory())
.insuredMobile(y.getPhone())
.benefitOccupationCategory(insureDto.getBenefitOccupationCategory())
.insuredNo(y.getZjNum())
.tricycleFrameNumber(insureDto.getTricycleFrameNumber())
.insuredEContact(y.getName())
.applicantEmployeeList(data.get("file_url").toString())
.policyDateStart(dtf3.parse(insureDto.getPolicyDateStart()))
.policyDateEnd(dtf3.parse(insureDto.getPolicyDateEnd()))
.applyType(3)
.status("1").insureStatus(3).policyId(insurePolicy.getId()).build().insert();
} catch (ParseException e) {
e.printStackTrace();
}
y.setIsInsure(1);
y.insertOrUpdate();
});
oldInsureUserList.forEach(o -> {
o.setReplaceTransId(data.get("import_uuid").toString());
o.updateById();
});
return ResultUtil.data("核保成功,等待系统更新");
}
}
return ResultUtil.data("成功");
}
/**
* 设置错误信息
* @param data
* 生成保全替换文件
*
* @param ids
* @return
*/
private Object message(String data){
Map<String,Object> dataMap = JSONObject.parseObject(data);
if (dataMap.get("errcode").toString().equals("suc")) {
return dataMap.get("data");
}
return dataMap.get("errmsg");
public String creaXSSFWorkbook2(String[] ids, String date, String[] oldIds, String type, String tricycleFrameNumber) {
if (ids.length <= 0 || oldIds.length <= 0) {
return "error";
}
@GetMapping(value = "/downExcel")
@ApiOperation(value = "2.下载投保文件", httpMethod = "Get", notes = "下载投保文件")
@ApiOperationSupport(order = 2)
public void downExcel(@CurrentUser UserBean userBean, HttpServletRequest request, HttpServletResponse resp){
LocalDate localDate = LocalDate.now();
/*获取该企业下所有未投保员工*/
List<YgglMainEmp> ygglMainEmpList = YgglMainEmp.builder().build().selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode,userBean.getOrgCode())
List<YgglMainEmp> ygglMainEmpList =YgglMainEmp.builder().build().selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode,userBean.getOrgCode())
.eq(YgglMainEmp::getIsInsure,0));
ExcelBean excelBean;
List list=Lists.newArrayList();
for (YgglMainEmp y:ygglMainEmpList.subList(0,5)) {
String[] arr =new String[]{String.valueOf(y.getId()),y.getName(),"身份证",y.getZjNum(),"50万意外/5万医疗/扩展24小时(A类)","","深圳名邦人力资源管理有限公司","无","A类"};
list.add(arr);
}
String[] rowName=new String[]{"ID","name","ID_type","ID_number","Scheme_name","Date_start","Branch","Tricycle_frame_number","benefit_occupation_category"};
/*随机抽取五名幸运用户投保*/
OutputStream os = null;
String[] rowName = new String[]{"ID", "name", "ID_type", "ID_number", "Update_date", "replace_name", "replace_ID_type",
"replace_ID_number", "Date_of_birth", "insured_type", "insured_relationship", "cert_type_related_insured", "insured_relationship_id", "Branch",
"Tricycle_frame_number", "insured_number", "benefit_occupation_category"};
XSSFWorkbook xssfWorkbook = ExcelUtils.exportExcel(localDate + "_替换" + list.size() + "名人员清单.xlsx", rowName, list);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
String url = "";
try {
resp.setContentType("application/octet-stream");
resp.setHeader("content-disposition", "attachment; filename=" + URLEncoder.encode(localDate+"_"+list.size()+"名人员清单.xlsx", "UTF-8"));
resp.setCharacterEncoding("UTF-8");
os = resp.getOutputStream();
ExcelUtils.exportExcel(localDate+"_"+list.size()+"名人员清单.xlsx",rowName,list,os);
} catch (FileNotFoundException e) {
e.printStackTrace();
xssfWorkbook.write(byteArrayOutputStream);
byte[] bytes = byteArrayOutputStream.toByteArray();
String fileBase64 = Base64.byteArrayToBase64(bytes);
/*body参数 begin*/
Map bodyMap = Maps.newHashMap();
bodyMap.put("media", fileBase64);
/*end*/
String data = HttpUtils.sendPost(uploadUrl2, setParams(JSONObject.toJSONString(bodyMap), appidq, secretq), bodyMap);
Map<String, Object> dataMap = JSONObject.parseObject(data);
if (dataMap.get("errcode").toString().equals("suc")) {
Object o = dataMap.get("data");
Map<String, Object> map = JSONObject.parseObject(JSONObject.toJSONString(o));
url = map.get("file_url").toString();
}
InsureLog.builder().requestParam(JSONObject.toJSONString(setParams(JSONObject.toJSONString(bodyMap), appid, secret))).type(6)
.requestData(JSONObject.toJSONString(bodyMap)).createTime(new Date()).requestType(1).returnBody(data).requestPath(uploadUrl2)
.returnCode(dataMap.get("errcode").toString()).returnMsg(dataMap.get("errmsg").toString()).fileUrl(url).build().insert();
/*文件流base64*/
} catch (IOException e) {
e.printStackTrace();
}finally {
} finally {
try {
os.close();
xssfWorkbook.close();
byteArrayOutputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return url;
}
/*获取基础计划的价格*/
private Integer getPrice(String plan, String type) {
/*
基础计划
30万雇主/3万医疗 36968,
50万雇主/5万医疗 36969,
80万雇主/10万医疗 36970,
80万雇主/20万医疗 36971,
100万雇主/10万医疗 36972
*/
/*行业类型
* A类 63119
* B类 63120
* C类 63121\
* */
switch (plan) {
case "36968":
if (type.equals("63119")) {
return InsuranceEnum.A_30.getPrice();
} else if (type.equals("63120")) {
return InsuranceEnum.B_30.getPrice();
}
break;
case "36969":
if (type.equals("63119")) {
return InsuranceEnum.A_30.getPrice();
} else if (type.equals("63120")) {
return InsuranceEnum.B_50.getPrice();
} else if (type.equals("63121")) {
return InsuranceEnum.C_50.getPrice();
}
break;
case "36970":
if (type.equals("63119")) {
return InsuranceEnum.A_80.getPrice();
} else if (type.equals("63120")) {
return InsuranceEnum.B_80.getPrice();
} else if (type.equals("63121")) {
return InsuranceEnum.C_80.getPrice();
}
break;
case "36971":
if (type.equals("63119")) {
return InsuranceEnum.A_80_20.getPrice();
} else if (type.equals("63120")) {
return InsuranceEnum.B_80_20.getPrice();
}
break;
case "36972":
if (type.equals("63119")) {
return InsuranceEnum.A_100.getPrice();
} else if (type.equals("63120")) {
return InsuranceEnum.B_100.getPrice();
}
break;
}
return 0;
}
@PostMapping(value = "/policyTotal")
@ApiOperation(value = "11.保单统计列表", httpMethod = "Post", notes = "保单统计列表")
public Result<Object> policyTotal() {
List<PolicyDto> list = insurePolicyMapper.policyTotalList();
return ResultUtil.data(list);
}
@GetMapping(value = "/isInsured")
@ApiOperation(value = "10.企业是否已投保", httpMethod = "Post", notes = "企业是否已投保")
public Result<Object> isInsured(@RequestParam("orgCode") String orgCode) {
InsurePolicy insurePolicy = InsurePolicy.builder().build().selectOne(new QueryWrapper<InsurePolicy>().lambda().eq(InsurePolicy::getOrgCode, orgCode).eq(InsurePolicy::getStatus, 1));
if (insurePolicy != null) {
return ResultUtil.error("该企业已经投过保,保单号为" + insurePolicy.getPolicyNo());
}
return ResultUtil.success();
}
@GetMapping(value = "/verification")
@ApiOperation(value = "一键校验", httpMethod = "Post", notes = "一键校验")
public Result<Object> verification() {
/*校验投保*/
List<InsurePolicy> insurePolicies = InsurePolicy.builder().build().selectList(new QueryWrapper<InsurePolicy>().lambda().eq(InsurePolicy::getStatus, 2));
insurePolicies.forEach(i -> {
InsureLog insureLog = InsureLog.builder().build().selectOne(new QueryWrapper<InsureLog>().lambda().eq(InsureLog::getPolicyId, i.getId()).eq(InsureLog::getType, 1));
Map bodyMap = JSONObject.parseObject(insureLog.getRequestData(), Map.class);
String data = HttpUtils.sendPost(insuredUrl, setParams(JSONObject.toJSONString(bodyMap), appid, secret), bodyMap);
log.info("校验结果:{}", data);
Map dataMap = JSONObject.parseObject(data, Map.class);
InsureLog.builder().requestParam(JSONObject.toJSONString(setParams(JSONObject.toJSONString(bodyMap), appid, secret))).type(9)
.requestData(JSONObject.toJSONString(bodyMap)).createTime(new Date()).requestType(1).returnBody(JSONObject.toJSONString(dataMap)).requestPath(insuredUrl)
.returnCode(dataMap.get("errcode").toString()).returnMsg(dataMap.get("errmsg").toString()).policyId(i.getId()).build().insert();
if (dataMap != null) {
if ((dataMap.get("errcode").toString().equals("suc"))) {
Map<String, Object> map = JSONObject.parseObject(JSONObject.toJSONString(dataMap.get("data")));
Map policyMap = JSONObject.parseObject(JSONObject.toJSONString(map.get("policy")), Map.class);
i.setPolicyNo(policyMap.get("policy_no").toString());
i.setPolicyFile(policyMap.get("policy_file").toString());
i.setKitUrl(policyMap.get("kit_url").toString());
i.setStatus("1");
i.updateById();
/*批次信息*/
List<Map> batchMap = JSONObject.parseObject(JSONObject.toJSONString(policyMap.get("batch")), List.class);
List<InsureUser> insureUserList = InsureUser.builder().build().selectList(new QueryWrapper<InsureUser>().lambda().eq(InsureUser::getPolicyId, i.getId())
.eq(InsureUser::getApplyType, 2));
insureUserList.forEach(user -> {
user.setBatchNo(batchMap.get(0).get("batch_no").toString());
user.setPolicyNo(policyMap.get("policy_no").toString());
user.setInsureStatus(1);
user.setStatus("1");
user.updateById();
YgglMainEmp.builder().isInsure(1).build().update(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getId, user.getUserId()));
});
}
}
});
/*校验人员*/
return ResultUtil.success();
}
;
@PostMapping(value = "/policyTotalList")
@ApiOperation(value = "11.保单统计列表 -- 8小时端", httpMethod = "Post", notes = "保单统计列表")
public Result<Object> policyTotal(@CurrentUser UserBean userBean, @RequestBody Page page) {
List<InsureUserDto> list = insurePolicyMapper.selectPlansListByorgCode(userBean.getOrgCode());
return ResultUtil.data(list);
}
@PostMapping(value = "/importUser")
@ApiOperation(value = "导入用户--运营后台", httpMethod = "post", notes = "导入用户")
public Result<Object> importUser(@RequestParam("orgCode") String orgCode, @RequestParam("file") MultipartFile file) {
SimpleDateFormat dtf = new SimpleDateFormat("yyyyMMdd");
QyzxEntInfoM company = QyzxEntInfoM.builder().id(Integer.valueOf(orgCode)).build().selectById();
if (company == null) {
return ResultUtil.error("该企业不存在");
}
if (file.getSize() <= 0) {
return ResultUtil.error("请上传文件");
}
List<YgglMainEmp> yg = Lists.newArrayList();
try {
XSSFWorkbook xw = new XSSFWorkbook(file.getInputStream());
XSSFSheet sheetAt = xw.getSheetAt(0);
//默认第一行为标题行,i = 0
XSSFRow titleRow = sheetAt.getRow(0);
YgglMainEmp y;
// 循环获取每一行数据
for (int i = 1; i < sheetAt.getPhysicalNumberOfRows(); i++) {
XSSFRow row = sheetAt.getRow(i);
y = YgglMainEmp.builder().build();
y.setOrgCode(Integer.parseInt(orgCode));
// 读取每一格内容
for (int index = 0; index < row.getPhysicalNumberOfCells(); index++) {
XSSFCell titleCell = titleRow.getCell(index);
XSSFCell cell = row.getCell(index);
cell.setCellType(CellType.STRING);
if (cell.getStringCellValue().equals("")) {
continue;
}
switch (ExcelUtils.getString(titleCell)) {
case "姓名":
y.setName(Optional.ofNullable(ExcelUtils.getString(cell)).orElse(""));
break;
case "手机号码":
y.setPhone(Optional.ofNullable(ExcelUtils.getString(cell)).orElse(""));
break;
// case "性别":
// y.setSex(Optional.ofNullable(ExcelUtils.getString(cell)).orElse(""));
// break;
// case "证件类型":
// y.setZjType(Optional.ofNullable(ExcelUtils.getString(cell)).orElse(""));
// break;
case "证件号":
String idNo = Optional.ofNullable(ExcelUtils.getString(cell)).orElse("");
if (Strings.isNullOrEmpty(idNo) && idNo.length() != 18) {
return ResultUtil.error(y.getName() + "身份证格式不正确");
}
if (!idNo.matches("^(\\d{6})(\\d{4})(\\d{2})(\\d{2})(\\d{3})([0-9]|X)$")) {
return ResultUtil.error(y.getName() + "身份证格式不正确");
}
try {
y.setBirthday(dtf.parse(idNo.substring(6, 14)));
} catch (ParseException e) {
e.printStackTrace();
}
y.setZjNum(idNo);
break;
// case "工作性质":
// y.setJobType(Optional.ofNullable(ExcelUtils.getString(cell)).orElse(""));
// break;
// case "试用期":
// y.setSyq(Optional.ofNullable(ExcelUtils.getString(cell)).orElse(""));
// break;
// case "入职日期":
// y.setRzTime(Optional.ofNullable(ExcelUtils.getString(cell)).orElse(""));
// break;
default:
break;
}
}
if (StringUtils.isNullOrEmpty(y.getName()) || StringUtils.isNullOrEmpty(y.getZjNum())) {
continue;
}
yg.add(y);
}
List<YgglMainEmp> userList = YgglMainEmp.builder().build().selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, orgCode));
List<String> idNumList = userList.stream().map(YgglMainEmp::getZjNum).collect(Collectors.toList());
List<YgglMainEmp> newList = yg.stream().filter(v -> !idNumList.contains(v.getZjNum())).collect(Collectors.toList());
if (newList.size() > 0) {
newList.forEach(u -> u.insert());
}
//假期规则初始化
String current_time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
List<KqglAssoLeaveRules> rul = KqglAssoLeaveRules.builder().build().selectList(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, orgCode));
} catch (IOException e) {
e.printStackTrace();
}
return ResultUtil.data("成功添加");
}
@PostMapping(value = "/importPolicy")
@ApiOperation(value = "导入保单--运营后台", httpMethod = "post", notes = "导入用户")
public Result<Object> importPolicy(@RequestParam("file") MultipartFile file) {
SimpleDateFormat dtf = new SimpleDateFormat("yyyyMMdd");
if (file.getSize() <= 0) {
return ResultUtil.error("请上传文件");
}
try {
XSSFWorkbook xw = new XSSFWorkbook(file.getInputStream());
XSSFSheet sheetAt = xw.getSheetAt(0);
//默认第一行为标题行,i = 0
XSSFRow titleRow = sheetAt.getRow(0);
InsurePolicy policy = InsurePolicy.builder().build();
QyzxEntInfoM company = null;
InsureUser user;
List<InsureUser> userList = Lists.newArrayList();
// 循环获取每一行数据
for (int i = 1; i < sheetAt.getPhysicalNumberOfRows(); i++) {
XSSFRow row = sheetAt.getRow(i);
user = InsureUser.builder().build();
// 读取每一格内容
for (int index = 0; index < row.getPhysicalNumberOfCells(); index++) {
XSSFCell titleCell = titleRow.getCell(index);
XSSFCell cell = row.getCell(index);
cell.setCellType(CellType.STRING);
switch (ExcelUtils.getString(titleCell)) {
case "申报日期":
Date createTime = null;
try {
createTime = dtf3.parse(ExcelUtils.getString(cell));
} catch (ParseException e) {
e.printStackTrace();
}
policy.setCreateTime(createTime);
break;
case "保单号":
policy.setPolicyNo(Optional.ofNullable(ExcelUtils.getString(cell)).orElse(""));
user.setPolicyNo(Optional.ofNullable(ExcelUtils.getString(cell)).orElse(""));
break;
case "申报类型":
if (ExcelUtils.getString(cell).equals("新增")) {
user.setApplyType(1);
} else if (ExcelUtils.getString(cell).equals("批改")) {
user.setApplyType(3);
}
break;
case "方案名称":
break;
case "有效时间":
Date start = null;
try {
start = dtf3.parse(ExcelUtils.getString(cell));
} catch (ParseException e) {
e.printStackTrace();
}
user.setPolicyDateStart(start);
policy.setPolicyDateStart(start);
break;
case "有效期止":
Date end = null;
try {
end = dtf3.parse(ExcelUtils.getString(cell));
} catch (ParseException e) {
e.printStackTrace();
}
user.setPolicyDateStart(end);
policy.setPolicyDateStart(end);
break;
case "被保险人姓名":
user.setInsuredEContact(ExcelUtils.getString(cell));
break;
case "证件类型":
if (ExcelUtils.getString(cell).equals("身份证")) {
}
break;
case "证件号码":
user.setInsuredNo(ExcelUtils.getString(cell));
break;
case "二、三轮车车架号":
user.setTricycleFrameNumber(!ExcelUtils.getString(cell).equals("无") ? ExcelUtils.getString(cell) : null);
break;
case "职业类别":
if (ExcelUtils.getString(cell).equals("A类")) {
user.setBenefitOccupationCategory("63119");
} else if (ExcelUtils.getString(cell).equals("B类")) {
user.setBenefitOccupationCategory("63120");
} else if (ExcelUtils.getString(cell).equals("C类")) {
user.setBenefitOccupationCategory("63121");
}
break;
case "企业全称":
company = QyzxEntInfoM.builder().build().selectOne(new QueryWrapper<QyzxEntInfoM>().lambda().eq(QyzxEntInfoM::getAttestName, ExcelUtils.getString(cell)));
if (company == null) {
return ResultUtil.error("企业不存在");
}
user.setOrgCode(company.getId());
break;
case "总保费":
user.setPrice(ExcelUtils.getString(cell));
break;
}
}
userList.add(user);
}
InsurePolicy oldPolicy = InsurePolicy.builder().build().selectOne(new QueryWrapper<InsurePolicy>().lambda().eq(InsurePolicy::getPolicyNo, policy.getPolicyNo()));
if (oldPolicy == null) {
policy.insert();
} else {
policy = oldPolicy;
}
if (userList.size() <= 0) {
return ResultUtil.error("导入错误,保单已存在");
}
for (InsureUser insureUser : userList) {
/*根据名字,身份,所属企业获取员工*/
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getName, insureUser.getInsuredEContact())
.eq(YgglMainEmp::getZjNum, insureUser.getInsuredNo())
.eq(YgglMainEmp::getOrgCode, insureUser.getOrgCode()));
if (ygglMainEmp != null) {
ygglMainEmp.setIsInsure(1);
} else {
/*如果不存在员工就创建一名员工*/
ygglMainEmp.builder().build();
ygglMainEmp.setName(insureUser.getInsuredEContact());
ygglMainEmp.setZjType(0);
ygglMainEmp.setZjNum(insureUser.getInsuredNo());
ygglMainEmp.setOrgCode(insureUser.getOrgCode());
}
insureUser.setPolicyId(policy.getId());
ygglMainEmp.insertOrUpdate();
insureUser.insert();
}
} catch (IOException e) {
e.printStackTrace();
}
return ResultUtil.data("成功导入");
}
}
package cn.timer.api.controller.insure;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;
import java.util.Map;
import cn.timer.api.bean.insure.InsureLog;
import cn.timer.api.bean.insure.InsureProduct;
import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.dao.insure.InsureLogMapper;
import cn.timer.api.dto.insure.InsureDto;
import cn.timer.api.dto.insure.PolicyLogDto;
import cn.timer.api.utils.Page;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import com.alibaba.fastjson.JSONObject;
import com.aliyun.oss.common.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Maps;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-22 09:55:46
*/
@Api(tags = "8.0保险列表")
@RestController
@Transactional
@RequestMapping(value = "/insureLog", produces = {"application/json"})
public class InsureLogController {
@Autowired
private InsureLogMapper insureLogMapper;
@GetMapping(value = "/logList")
@ApiOperation(value = "12.日志列表", httpMethod = "Get", notes = "日志列表")
public Result<Object> logList(@RequestParam("policyId") String policyId) {
List<InsureLog> list = insureLogMapper.selectListById(policyId);
if (list.size() > 0) {
return ResultUtil.data(list);
}
return ResultUtil.error("暂无日志");
}
@GetMapping(value = "/downUserExcel")
@ApiOperation(value = "12.人员清单", httpMethod = "Get", notes = "人员清单")
public void downUserExcel(@RequestParam("logId") String logId, HttpServletRequest request, HttpServletResponse response) {
InsureLog insureLog = InsureLog.builder().id(Integer.parseInt(logId)).build().selectById();
if (insureLog == null || StringUtils.isNullOrEmpty(insureLog.getFileUrl())) {
return;
}
DateTimeFormatter dtf2 = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
OutputStream sos = null;
BufferedInputStream bis = null;
try {
response.setContentType("application/octet-stream");
response.setHeader("content-disposition", "attachment; filename=" + new String((dtf2.format(LocalDateTime.now()) + ".xlsx").getBytes("UTF8"), "ISO-8859-1"));
response.setCharacterEncoding("UTF-8");
sos = response.getOutputStream();
String destUrl = "http:" + insureLog.getFileUrl();
URL url = new URL(destUrl);
HttpURLConnection httpUrl = (HttpURLConnection) url.openConnection();
//连接指定的网络资源
httpUrl.connect();
//获取网络输入流
bis = new BufferedInputStream(httpUrl.getInputStream());
int b;
while ((b = bis.read()) != -1) {
sos.write(b);
}
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
sos.close();
} catch (IOException e) {
e.printStackTrace();
}
try {
bis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
@PostMapping(value = "/insureLogList")
@ApiOperation(value = "日志列表--8小时端", httpMethod = "Get", notes = "日志列表")
public Result<Object> insureLogList(@CurrentUser UserBean userBean, @RequestBody Page page) {
Map map = Maps.newHashMap();
List<PolicyLogDto> list = insureLogMapper.selectLogListByOrgCode(userBean.getOrgCode(),page);
map.put("list", list);
map.put("total", insureLogMapper.selectLogTotalByOrgCode(userBean.getOrgCode()));
return ResultUtil.data(map);
}
}
package cn.timer.api.controller.insure;
import java.util.List;
import java.util.Map;
import cn.timer.api.bean.insure.InsureProduct;
import cn.timer.api.dao.insure.InsureProductMapper;
import cn.timer.api.dto.insure.PolicyDto;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.beust.jcommander.internal.Lists;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
/**
* 保险产品
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-30 11:36:30
*/
@Api(tags = "8.0保险列表")
@RestController
@Transactional
@RequestMapping(value = "/insureProduct", produces = {"application/json"})
public class InsureProductController{
@Autowired
private InsureProductMapper insureProductMapper;
@GetMapping(value = "/productList")
@ApiOperation(value = "12.产品列表", httpMethod = "Get", notes = "产品列表")
public Result<Object> productList() {
List<InsureProduct> productList = InsureProduct.builder().build().selectList(new QueryWrapper<InsureProduct>().lambda().eq(InsureProduct::getIsDel,0));
if (productList.size()>0) {
return ResultUtil.data(productList);
}
return ResultUtil.error("暂无产品");
}
}
package cn.timer.api.controller.insure;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import cn.timer.api.bean.insure.InsurePolicy;
import cn.timer.api.bean.insure.InsureUser;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.dao.insure.InsureUserMapper;
import cn.timer.api.dto.insure.InsureDto;
import cn.timer.api.dto.insure.InsureUserDto;
import cn.timer.api.dto.insure.PolicyDto;
import cn.timer.api.utils.Page;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.beust.jcommander.internal.Lists;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.google.common.collect.Maps;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
/**
* 被保人
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-11 09:06:53
*/
@Api(tags = "8.0保险列表")
@RestController
@Transactional
@RequestMapping(value ="/insureUser", produces = {"application/json"})
public class InsureUserController{
@Autowired
private InsureUserMapper insureUserMapper;
@PostMapping(value = "/policyList")
@ApiOperation(value = "3.保单列表--运营后台", httpMethod = "Post", notes = "保单列表")
public Result<Object> policyList(@RequestBody PolicyDto policyDto) {
Map map = Maps.newHashMap();
List<PolicyDto> list = insureUserMapper.selectPolicyList(policyDto);
map.put("list", Optional.ofNullable(list).orElse(Lists.newArrayList()));
map.put("total", insureUserMapper.totalUser(policyDto));
return ResultUtil.data(map);
}
@GetMapping(value = "/userDetial")
@ApiOperation(value = "被保人详情", httpMethod = "Post", notes = "保单列表")
public Result<Object> userDetial(@RequestParam("userId") String userId) {
InsureUser user = InsureUser.builder().id(Integer.parseInt(userId)).build().selectById();
return ResultUtil.data(user);
}
@PostMapping(value = "/userPolicyList")
@ApiOperation(value = "3.保单列表--8小时端", httpMethod = "Post", notes = "保单列表")
public Result<Object> userPolicyList(@CurrentUser UserBean userBean, @RequestBody PolicyDto policyDto) {
Map map = Maps.newHashMap();
InsurePolicy insurePolicy = InsurePolicy.builder().build().selectOne(new QueryWrapper<InsurePolicy>().lambda().eq(InsurePolicy::getOrgCode,userBean.getOrgCode()).eq(InsurePolicy::getStatus,1));
if(insurePolicy==null){
return ResultUtil.error("保单号不存在");
}
policyDto.setId(insurePolicy.getId());
List<PolicyDto> list = insureUserMapper.selectPolicyList(policyDto);
map.put("list", Optional.ofNullable(list).orElse(Lists.newArrayList()));
map.put("total", insureUserMapper.totalUser(policyDto));
return ResultUtil.data(map);
}
@PostMapping(value = "/getPolicyUserList")
@ApiOperation(value = "获取选中用户方案信息", httpMethod = "Post", notes = "获取选中用户方案信息")
public Result<Object> getPolicyUserList(@RequestBody InsureDto dto){
List<InsureUserDto> userList= insureUserMapper.selectPlansListByIds(dto.getOldIds());
if(userList.size()<=0){
return ResultUtil.error("用户方案错误");
}
return ResultUtil.data(userList);
}
@GetMapping(value = "/getPolicyPlansList")
@ApiOperation(value = "获取方案列表", httpMethod = "Get", notes = "获取选中用户方案信息")
public Result<Object> getPolicyUserList(@RequestParam("policyId") String policyId){
List<InsureUserDto> userList= insureUserMapper.selectPlansListById(policyId);
if(userList.size()<=0){
return ResultUtil.error("用户方案错误");
}
return ResultUtil.data(userList);
}
}
package cn.timer.api.controller.insure.bean;
import lombok.Data;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/10 14:28
*/
@Data
public class ExcelBean {
private String id;
private String name;
private String idType;
private String idNumber;
private String schemeName;
private String dateStart;
private String branch;
private String tricycleFrameNumber;
private String benefitOccupationCategory;
}
package cn.timer.api.controller.insure.enums;
import io.swagger.models.auth.In;
import lombok.Data;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/24 17:20
*/
public enum InsuranceEnum {
A_30(12,"30万意外/3万医疗/扩展24小时(A类)","A类","36968","63119"),
A_50(15,"50万意外/5万医疗/扩展24小时(A类)","A类","36969","63119"),
A_80(18,"80万意外/10万医疗/扩展24小时(A类)","A类","36970","63119"),
A_80_20(25,"80万意外/20万医疗/扩展24小时(A类)","A类","36971","63119"),
A_100(28,"100万意外/10万医疗/扩展24小时(A类)","A类","36972","63119"),
B_30(18,"30万意外/3万医疗/扩展24小时(B类)","B类","36968","63120"),
B_50(20,"50万意外/5万医疗/扩展24小时(B类)","B类","36969","63120"),
B_80(35,"80万意外/10万医疗/扩展24小时(B类)","B类","36970","63120"),
B_80_20(38,"80万意外/20万医疗/扩展24小时(B类)","B类","36971","63120"),
B_100(40,"100万意外/10万医疗/扩展24小时(B类)","B类","36972","63120"),
C_50(60,"50万意外/5万医疗/扩展24小时(C类)","C类","36969","63121"),
C_80(75,"80万意外/10万医疗/扩展24小时(C类)","C类","36970","63121");
private Integer price;
private String name;
private String type;
private String plan;
private String category;
InsuranceEnum(Integer price, String name,String type,String plan,String category) {
this.price = price;
this.name = name;
this.type=type;
this.plan=plan;
this.category=category;
}
public Integer getPrice() {
return price;
}
public void setPrice(Integer price) {
this.price = price;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getPlan() {
return plan;
}
public void setPlan(String plan) {
this.plan = plan;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public static InsuranceEnum getEnum(String plan,String category) {
for(InsuranceEnum v : values())
if(v.getPlan().equals(plan)&&v.getCategory().equals(category)) return v;
throw new IllegalArgumentException();
}
}
package cn.timer.api.controller.qyzx;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.servlet.http.HttpSession;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.timer.api.bean.jxgl.JxglBasicSetting;
import cn.timer.api.bean.kqmk.*;
import cn.timer.api.bean.qyxx.CmsContent;
import cn.timer.api.bean.xcgl.XcglAssoBszqsz;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.enuminterface.YgEnumInterface;
import cn.timer.api.config.exception.CustomException;
import cn.timer.api.controller.jxgl.service.JxglService;
import cn.timer.api.controller.qyzx.service.RegisterHelper;
import cn.timer.api.controller.spmk.service.SpmkServiceImpl;
import cn.timer.api.dao.kqmk.KqglAssoLeaveRulesMapper;
import cn.timer.api.dto.qyzx.*;
import cn.timer.api.utils.Md5;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -57,12 +70,6 @@ import cn.timer.api.dao.qyzx.QyzxOperLogMapper;
import cn.timer.api.dao.qyzx.QyzxPayServeMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.login.QysDto;
import cn.timer.api.dto.qyzx.AdminListDto;
import cn.timer.api.dto.qyzx.AttaFpglQueryDto;
import cn.timer.api.dto.qyzx.EntauthDto;
import cn.timer.api.dto.qyzx.LogBuyDto;
import cn.timer.api.dto.qyzx.MenuStructureDto;
import cn.timer.api.dto.qyzx.QyzxOperLogQuaryDto;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.Api;
......@@ -98,9 +105,29 @@ public class QyzxController {
@Autowired
private QyzxInvoiceUsualMapper qyzxInvoiceUsualMapper;
@Value("${config-8timer.register-company-max-num}")
public Integer max;
@Value("${config-8timer.qyxx.title}")
private String title;
@Value("${config-8timer.qyxx.author}")
private String author;
@Value("${config-8timer.qyxx.cover}")
private String cover;
@Value("${config-8timer.qyxx.summary}")
private String summary;
@Value("${config-8timer.environmental-science}")
public String environmental_science;
@Autowired
SpmkServiceImpl SpmkService;
@Autowired
private KqglAssoLeaveRulesMapper kqglassoleaverulesmapper;
@Autowired
JxglService jxglService;
/**
* 获取企业信息
*
*
* @param
* @return
*/
......@@ -115,7 +142,7 @@ public class QyzxController {
/**
* 添加/修改企业信息
*
*
* @param
* @return
*/
......@@ -136,7 +163,7 @@ public class QyzxController {
/**
* 企业认证-申请
*
*
* @param qyzxEntAuth
* @return
*/
......@@ -154,7 +181,7 @@ public class QyzxController {
/**
* 运营管理 企业认证-审核-通过/不通过(weng)
*
*
* @param qyzxEntAuth
* @return
*/
......@@ -179,7 +206,7 @@ public class QyzxController {
/**
* 新增/编辑常用企业开票资料
*
*
* @param QyzxInvoiceUsual
* @return
*/
......@@ -198,7 +225,7 @@ public class QyzxController {
/**
* 显示常用的企业开票资料
*
*
* @param QyzxInvoiceUsual
* @return
*/
......@@ -220,7 +247,7 @@ public class QyzxController {
/**
* 显示企业的超级管理员
*
*
* @param qyzxEntAuth
* @return
*/
......@@ -240,7 +267,7 @@ public class QyzxController {
* 获取企业的到期时间和版本号
*//*
* @GetMapping(value = "/endtimeversion")
*
*
* @ApiOperation(value = "获取企业的到期时间和版本号", httpMethod = "GET", notes = "接口发布说明")
* public Result<QyzxEntInfoM> endtimeversion(@CurrentUser UserBean userBean) {
* QyzxEntInfoM qyzxEntInfoM = new
......@@ -252,7 +279,7 @@ public class QyzxController {
/**
* 当前用户企业列表
*
*
* @param
* @return
*/
......@@ -283,7 +310,7 @@ public class QyzxController {
/**
* 切换企业
*
*
* @param org_num
* @return
*/
......@@ -369,7 +396,7 @@ public class QyzxController {
/**
* 购买服务(添加服务计算,添加购买记录)
*
*
* @param
* @return
*/
......@@ -412,7 +439,7 @@ public class QyzxController {
// 使用系统购买服务
/**
* 获取服务计算
*
*
* @param
* @return
*/
......@@ -426,7 +453,7 @@ public class QyzxController {
/**
* 获取购买记录
*
*
* @param
* @return
*/
......@@ -440,7 +467,7 @@ public class QyzxController {
/**
* 查询购买记录
*
*
* @param
* @return
*/
......@@ -462,7 +489,7 @@ public class QyzxController {
/**
* 账号管理 获取账号
*
*
* @param
* @return
*/
......@@ -479,7 +506,7 @@ public class QyzxController {
/**
* 查询-操作日志
*
*
* @param
* @return
*/
......@@ -513,11 +540,11 @@ public class QyzxController {
return ResultUtil.data(pages, listOl, "操作成功!");
}
@PostMapping(value = "/menusequencedata")
@ApiOperation(value = "菜单顺序数据", httpMethod = "POST", notes = "")
public Result<Object> menusequencedata(@CurrentUser UserBean userBean) {
List<MenuStructureDto> mestrs = new ArrayList<MenuStructureDto>();
List<QyzxAdminMenu> qyme = QyzxAdminMenu.builder().build().selectList(new QueryWrapper<QyzxAdminMenu>().lambda().eq(QyzxAdminMenu::getOrgCode, userBean.getOrgCode()).orderByAsc(QyzxAdminMenu::getSortNumber));
String[] zdy = new String[qyme.size()];
......@@ -531,11 +558,11 @@ public class QyzxController {
mestrs.add(metr);
zdy[i] = me.getMenuCode();
i++;
}
}
//
List<AdminMenuTemplate> adtes = AdminMenuTemplate.builder().build().selectList(new QueryWrapper<AdminMenuTemplate>().lambda().eq(AdminMenuTemplate::getEnable, 1).orderByAsc(AdminMenuTemplate::getSortNumber));
for(AdminMenuTemplate adm : adtes) {
if(!ClockInTool.useArrayUtils(ClockInTool.deleteArrayNull(zdy), adm.getMenuCode())) {
if(adm.getDistribution() == 0 && userBean.getOrgCode() == 3) {
MenuStructureDto metr = MenuStructureDto.builder().build();
......@@ -554,17 +581,17 @@ public class QyzxController {
}
}
}
return ResultUtil.data(mestrs, "成功");
}
@PostMapping(value = "/menustructure")
@ApiOperation(value = "菜单结构", httpMethod = "POST", notes = "")
public Result<Object> menustructure(@CurrentUser UserBean userBean,@RequestBody List<QyzxAdminMenu> qymu) {
QyzxAdminMenu.builder().build().delete(new QueryWrapper<QyzxAdminMenu>().lambda().eq(QyzxAdminMenu::getOrgCode, userBean.getOrgCode()));
for(QyzxAdminMenu me : qymu) {
QyzxAdminMenu meu = QyzxAdminMenu.builder().build();
meu.setMenuCode(me.getMenuCode());
......@@ -574,36 +601,36 @@ public class QyzxController {
meu.setAddtime(new Date().getTime());
meu.insert();
}
return ResultUtil.data(qymu, "修改成功");
}
@PostMapping(value = "/corporatecolor")
@ApiOperation(value = "菜单自定义颜色", httpMethod = "POST", notes = "")
public Result<Object> corporatecolor(@CurrentUser UserBean userBean) {
QyzxAdminColour cdys = QyzxAdminColour.builder().build().selectOne(new QueryWrapper<QyzxAdminColour>().lambda().eq(QyzxAdminColour::getOrgCode, userBean.getOrgCode()));
return ResultUtil.data(cdys, "查询成功");
}
@PostMapping(value = "/customcolor")
@ApiOperation(value = "菜单自定义颜色", httpMethod = "POST", notes = "")
public Result<Object> customcolor(@CurrentUser UserBean userBean,@RequestBody QyzxAdminColour cdys) {
cdys.setOrgCode(userBean.getOrgCode());
cdys.setAddtime(new Date().getTime());
cdys.insertOrUpdate();
return ResultUtil.data(cdys, "保存成功");
}
/**
* 删除-操作日志
*
*
* @param
* @return
*/
......@@ -617,4 +644,195 @@ public class QyzxController {
return ResultUtil.data(delCount, "操作成功!");
}
/**
* 运营后台---企业信息列表
* @param
* @param cdys
* @return
*/
@PostMapping(value = "/companyAdminList")
@ApiOperation(value = "运营后台---企业信息列表", httpMethod = "POST", notes = "")
public Result<Object> companyAdminList(@RequestBody cn.timer.api.utils.Page page) {
Map map = Maps.newHashMap();
List<EntInfoDto> list = Optional.ofNullable(qyzxEntInfoMMapper.companyAdminList(page)).orElse(Lists.newArrayList());
Integer count = qyzxEntInfoMMapper.companyAdminCount();
map.put("list",list);
map.put("count",count);
return ResultUtil.data(map);
}
@GetMapping(value = "/selectentbyId")
@ApiOperation(value = "运营后台---获取企业信息", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> selectentbyId(@RequestParam("id") String id) {
QyzxEntInfoM qyzxEntInfoM = QyzxEntInfoM.builder().id(Integer.parseInt(id)).build().selectById();
return ResultUtil.data(qyzxEntInfoM, "获取企业信息成功");
}
@PostMapping(value = "/aeCompamy")
@ApiOperation(value = "运营后台---添加/修改企业信息", httpMethod = "POST", notes = "接口发布说明")
@Log(title = "运营后台---添加/修改-企业信息", businessType = BusinessType.UPDATE)
public Result<QyzxEntInfoM> aeCompamy(@RequestBody QyzxEntInfoM qyzxEntInfoM) {
QyzxEntInfoM q = new LambdaQueryChainWrapper<QyzxEntInfoM>(qyzxEntInfoMMapper)
.eq(QyzxEntInfoM::getId, qyzxEntInfoM.getId()).one();
boolean b1;
if (q == null) {
try {
qyzxEntInfoM.setRegisterTime(new Date());
QyzxEmpLogin login = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper)
.eq(!StrUtil.hasBlank(qyzxEntInfoM.getPhone()), QyzxEmpLogin::getPhone, qyzxEntInfoM.getPhone()).one();
if (login != null) {
Integer count = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, login.getId())
.eq(QyzxEmpEntAsso::getUserType, SysRoleType.U_TYPE_ADMIN.getType()).count();
//将密码改为注册企业输入的密码 2021//11/11 wgd
login.setPw(Md5.md5("123456"));
if (count > max) {
return ResultUtil.error("已注册过企业");
}
}
b1 =qyzxEntInfoM.insert();
Integer qyId = qyzxEntInfoM.getId();
if (login == null) {
// 员工信息
QyzxEmpLogin qyzxEmpLogin = QyzxEmpLogin.builder().phone(qyzxEntInfoM.getPhone()).pw(Md5.md5("123456"))
.sts(CommonEnum.U_STS_ON.getType()).orgId(qyId).regTime(DateUtil.date()).build();
boolean b2 = qyzxEmpLogin.insert();
if (!b2) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ResultUtil.error("注册企业失败2");
}
login = qyzxEmpLogin;
} else {
login.setOrgId(qyId);
login.updateById();
}
// 员工信息
boolean b4 = YgglMainEmp.builder().orgCode(qyId).empNum(login.getId()).rzTime(new Date()).name(qyzxEntInfoM.getLinkMan())
.phone(qyzxEntInfoM.getPhone()).jobType(YgEnumInterface.YgJobType.QUANZHI.getType())
.jobStatus(YgEnumInterface.jobStatus.ZHENSHI.getType()).build().insert();
if (!b4) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ResultUtil.error("注册企业失败3");
}
QyzxEmpEntAsso qyzxEmpEntAsso = QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(qyzxEntInfoM.getId())
.status(1).userType(SysRoleType.U_TYPE_ADMIN.getType()).build();
boolean b3 = qyzxEmpEntAsso.insert();
if (!b3) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ResultUtil.error("注册企业失败4");
}
SpmkService.createCustomApproval(qyzxEntInfoM.getId());
//企业注册添加10条短信
RegisterHelper.companyRegister(qyId,login.getId());
// *****************************考勤假期初始化
// 获取模板数据
// List<KqglAssoLeaveRules> ruless = new LambdaQueryChainWrapper<KqglAssoLeaveRules>(kqglassoleaverulesmapper)
// .eq(KqglAssoLeaveRules::getOrgCode, 0).list();
List<KqglAssoLeaveRulesT> ruless = KqglAssoLeaveRulesT.builder().build().selectAll();
// 查询当前公司是否已初始化
KqglAssoLeaveRules rule = kqglassoleaverulesmapper.selectOne(new QueryWrapper<KqglAssoLeaveRules>().lambda()
.eq(KqglAssoLeaveRules::getOrgCode, qyzxEntInfoM.getId()).eq(KqglAssoLeaveRules::getLeaveType, 1)
.last("LIMIT 1"));
if (rule == null) {
List<KqglAssoLeaveRules> rullist = new ArrayList<KqglAssoLeaveRules>();
for (KqglAssoLeaveRulesT rul : ruless) {
KqglAssoLeaveRules vice = KqglAssoLeaveRules.builder().name(rul.getName()).company(rul.getCompany())
.leaveType(rul.getLeaveType()).apply(rul.getApply()).createTime(new Date().getTime())
.createUserid(999).orgCode(qyzxEntInfoM.getId()).isOpen(rul.getIsOpen())
.leaveBalance(rul.getLeaveBalance()).rulesType(rul.getRulesType()).build();
rullist.add(vice);
}
if (rullist.size() > 0) {
kqglassoleaverulesmapper.insertleaverulesList(rullist);
}
Logoutput("操作成功!");
} else {
Logoutput("重复初始化数据!");
}
//建立初始化的加班规则
KqglAssoOvertimeRulesM jbgzdef = KqglAssoOvertimeRulesM.builder().build().selectOne(new QueryWrapper<KqglAssoOvertimeRulesM>().lambda().eq(KqglAssoOvertimeRulesM::getOvertimeruledefault, 1));
KqglAssoOvertimeRules Rules = KqglAssoOvertimeRules.builder().build();
Rules.setOrgCode(qyzxEntInfoM.getId());
BeanUtil.copyProperties(jbgzdef, Rules , "orgCode");
Rules.insert();
//假期规则初始化
String current_time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
List<KqglAssoLeaveRules> rul = KqglAssoLeaveRules.builder().build().selectList(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, qyId));
for(KqglAssoLeaveRules r : rul) {
if(r.getLeaveBalance() == 0) {
KqglAssoLeaveEmployeeBalance.builder().leaveRulesId(r.getId()).userid(login.getId()).balanceDays(-1).modifyUserid(login.getId()).modifyTimer(current_time).orgCode(qyId).build().insert();
}else {
KqglAssoLeaveEmployeeBalance.builder().leaveRulesId(r.getId()).userid(login.getId()).balanceDays(0.0).modifyUserid(login.getId()).modifyTimer(current_time).orgCode(qyId).build().insert();
}
}
//加班基础设置
KqglAssoOvertimeBasics.builder().minimumUnit(3).modifyUserid(999).modifyTime(new Date().getTime()).orgCode(qyzxEntInfoM.getId()).build().insert();
//报税周期设置
XcglAssoBszqsz.builder().taxReturnCycle(2).qyid(qyzxEntInfoM.getId()).build().insert();
// 绩效设置初始化
JxglBasicSetting bS = jxglService.selectAT(qyId);
if (bS == null) {
boolean res = jxglService.initJxglBasicSetting(qyId);
if (!res) {
throw new CustomException("绩效设置异常");
}
}
/********** 默认企业讯息添加 ***********/
CmsContent cmsContent = CmsContent.builder().build();
cmsContent.setTitle(title);
cmsContent.setPublisherName(author);
cmsContent.setAuthor(author);
cmsContent.setModularid(1);
cmsContent.setFmtpath(cover);
cmsContent.setSummary(summary);
cmsContent.setStatus(1);
cmsContent.setOrganizationId(qyId);
cmsContent.setReleasestate(0);
cmsContent.setAddeddate(new Date().getTime());
cmsContent.setReleasetime(String.valueOf(new Date().getTime()));
cmsContent.insert();
/********** 默认企业讯息添加 ***********/
return ResultUtil.success("注册企业成功");
} catch (Exception e) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
e.printStackTrace();
return ResultUtil.error("注册异常");
}
}
b1 =qyzxEntInfoM.updateById();
if (!b1) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ResultUtil.error("注册企业失败1");
}
return ResultUtil.data(qyzxEntInfoM, "添加/修改企业");
}
@GetMapping(value = "/getCompanySelect")
@ApiOperation(value = "运营后台---获取选择框下的企业信息", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> getCompanySelect() {
return ResultUtil.data(qyzxEntInfoMMapper.getCompanyList(), "获取成功");
}
public void Logoutput(String science) {
if(!("pro").equals(environmental_science)) {
System.out.println(science);
}else {
System.out.println("");
}
}
}
package cn.timer.api.controller.superadmin;
import cn.timer.api.bean.adminaccount.AdminAccount;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.dto.qyzx.EntRegisterDto;
import cn.timer.api.utils.Md5;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import cn.timer.api.utils.UserIp;
import cn.timer.api.utils.redis.RedisConfig;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/14 18:14
*/
@RestController
@Api(tags = "33.0运营后台登录")
@Transactional
@RequestMapping(value = "/superLogin", produces = { "application/json" })
public class SuperLoginController {
@Autowired
private HttpSession session;
@PostMapping(value = "/adminLogin")
@ApiOperation(value = "运营后台登录", httpMethod = "Post", notes = "接口发布说明")
public Result<Object> adminLogin(@RequestBody EntRegisterDto entRegisterDto, HttpServletRequest request){
String ip = UserIp.getIpAddr(request);
AdminAccount adminAccount = AdminAccount.builder().build().selectOne(new QueryWrapper<AdminAccount>().lambda()
.eq(AdminAccount::getAccount,entRegisterDto.getPhone())
.eq(AdminAccount::getPwd,entRegisterDto.getPw()
));
if(adminAccount==null){
return ResultUtil.error("用户不存在或密码错误");
}
session=request.getSession();
session.setAttribute("ai", adminAccount);
System.err.println(session.getId());
return ResultUtil.data(adminAccount);
};
@PostMapping(value = "/adminOutLogin")
@ApiOperation(value = "运营后台退出", httpMethod = "Post", notes = "接口发布说明")
public Result<String> adminOutLogin(HttpServletRequest request){
session= request.getSession();
session.removeAttribute("ai");
return ResultUtil.data("退出成功");
}
}
/**
* @date 2019年11月15日
* @date 2019年11月15日
* @author 翁东州
* @方法中文名称:
*/
......@@ -33,13 +33,7 @@ import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
......@@ -180,7 +174,7 @@ public class YgglController {
/**
* 获取员工档案
*
*
* @param
* @return
*/
......@@ -220,7 +214,7 @@ public class YgglController {
/**
* 根据岗位id获取员工档案部门岗位名称
*
*
* @param
* @return
*/
......@@ -250,20 +244,20 @@ public class YgglController {
return ResultUtil.data(bmgw);
}
@Autowired
private RealTimeUpdate realtimeupdate;
@Autowired
private KqglAssoKqzdkfsMapper kqglassokqzdkfsmapper;
@Value("${config-8timer.machine8timerUrl}")
public String mac_command; // 回调地址
@Autowired
private UserEquiRelationMapper userequirelationmapper;
/**
* 添加员工档案
*
*
* @param userBean
* @param addygdaDto
* @return
......@@ -312,7 +306,7 @@ public class YgglController {
Integer syq = addygdaDto.getSyq();
Integer sex = addygdaDto.getSex();
Integer bmgwId = addygdaDto.getBmgwId();
QyzxEmpLogin login = new LambdaQueryChainWrapper<QyzxEmpLogin>(qyzxEmpLoginMapper)
.eq(!StrUtil.hasBlank(phone), QyzxEmpLogin::getPhone, phone).one();
......@@ -335,17 +329,17 @@ public class YgglController {
ygglMainEmp = YgglMainEmp.builder().name(name).phone(phone).zjType(zjType).zjNum(zjNum).jobType(jobType)
.jobStatus(jobStatus.SHIYONG.getType()).rzTime(rzTime).syq(syq).sex(sex)
.empNum(login.getId()).orgCode(orgCode).bmgwId(bmgwId).customNum(customNum).build();
if(addygdaDto.getAttgroupid() != null) {
KqglAssoYhkqz.builder().kqzid(attgroupid).userid(login.getId()).qyid(userBean.getOrgCode()).build().insert();
List<KqglAssoKqzdkfs> kqjs = kqglassokqzdkfsmapper.selectList(new QueryWrapper<KqglAssoKqzdkfs>().lambda().eq(KqglAssoKqzdkfs::getKqzId, addygdaDto.getAttgroupid()).eq(KqglAssoKqzdkfs::getType, 1));
for(KqglAssoKqzdkfs abp:kqjs) {
KqglAssoKqj kqj = KqglAssoKqj.builder().id(abp.getDkfsid()).build().selectById();
KqglAssoYhsb kqjry = KqglAssoYhsb.builder().build().selectOne(new QueryWrapper<KqglAssoYhsb>().lambda().eq(KqglAssoYhsb::getUserId, login.getId()).eq(KqglAssoYhsb::getKqjid, kqj.getId()));
if(kqjry == null) {
// YgglMainEmp yggluser = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).eq(YgglMainEmp::getEmpNum, login.getId()));
String url = mac_command+"/addUserName";
HttpHeaders headers = new HttpHeaders();
......@@ -356,37 +350,37 @@ public class YgglController {
RestTemplate restTemplate = new RestTemplate();
HttpEntity httpEntity = new HttpEntity(params, headers);
ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
KqglAssoYhsb.builder().build().delete(new QueryWrapper<KqglAssoYhsb>().lambda().eq(KqglAssoYhsb::getUserId, login.getId()).eq(KqglAssoYhsb::getKqjid, kqj.getId()));
KqglAssoYhsb uskqj = KqglAssoYhsb.builder().userId(login.getId()).kqjid(kqj.getId()).type(1).build();
UserEquiRelation isgly = userequirelationmapper.selectByuserId(login.getId());
if(isgly != null) {
uskqj.setIsGly(isgly.getIsGly());
}else {
uskqj.setIsGly(0);
}
if (!uskqj.insert())
if (!uskqj.insert())
return ResultUtil.error("操作失败--新增用户与设备关系");
}
}
}
if(syq == 0) {
ygglMainEmp.setZzTime(rzTime);
}else {
String sdf = new SimpleDateFormat("yyyy-MM-dd").format(rzTime);
String zztime = ClockInTool.requires_extra_times(sdf, syq, 4, 1);
ygglMainEmp.setZzTime(ClockInTool.strToDateLong(zztime));
}
ygglMainEmp.insert();
//假期规则初始化
String current_time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
List<KqglAssoLeaveRules> rul = KqglAssoLeaveRules.builder().build().selectList(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, orgCode));
......@@ -397,14 +391,14 @@ public class YgglController {
KqglAssoLeaveEmployeeBalance.builder().leaveRulesId(r.getId()).userid(ygglMainEmp.getEmpNum()).balanceDays(0.0).modifyUserid(userBean.getEmpNum()).modifyTimer(current_time).orgCode(userBean.getOrgCode()).build().insert();
}
}
try {
realtimeupdate.AttendanceTask(userBean.getOrgCode(), ygglMainEmp.getEmpNum(), 2,null);
} catch (ParseException e) {
e.printStackTrace();
}
return ResultUtil.data(ygglMainEmp, "添加员工成功!");
} else {
return ResultUtil.error("该手机号已被使用,请输入正确手机号");
......@@ -414,7 +408,7 @@ public class YgglController {
/**
* 修改员工档案
*
*
* @param
* @return
*/
......@@ -453,7 +447,7 @@ public class YgglController {
/**
* 员工搜索
*
*
* @param
* @return
*/
......@@ -486,13 +480,13 @@ public class YgglController {
return ResultUtil.data(ygglMainEmpPage);
}
@Autowired
private ZzglBmgwMService zzglBmgwMService;
/**
* 员工列表-分页
*
*
* @param
* @return
*/
......@@ -504,7 +498,7 @@ public class YgglController {
Integer bmgwId = empQuery.getBmgwid();
Page<YgglMainEmp> page = new Page<YgglMainEmp>(empQuery.getCurrentPage(), empQuery.getTotalPage());
List<Integer> empNums = CollUtil.toList();
if (bmgwId != null) {
List<YgglMainEmp> usersQuery = zzglBmgwMService.selectOtherlistent(userBean.getOrgCode(), bmgwId);
if (CollectionUtil.isNotEmpty(usersQuery)) {
......@@ -512,7 +506,7 @@ public class YgglController {
}else {
return ResultUtil.data(null);
}
if (CollectionUtil.isEmpty(empNums)) {
return ResultUtil.data(null);
}
......@@ -522,7 +516,7 @@ public class YgglController {
IPage<YgglMainEmp> ygglMainEmpPage = ygglMainEmpMapper.selectME(page, empQuery);
List<YgglMainEmp> ygglMainEmps = ygglMainEmpPage.getRecords();
return ResultUtil.data(page, ygglMainEmps);
}
......@@ -559,7 +553,7 @@ public class YgglController {
// List<AddygdaDto> list = listAddygdaDto.stream()
// .filter(o -> o != null && !listPhone.contains(o.getPhone()) && !listzjNum.contains(o.getZjNum()))
// .collect(Collectors.toList());
// 过滤掉 导入数据中, listPhone已存在 的 phone 的对象集合
List<AddygdaDto> list = listAddygdaDto.stream()
.filter(o -> o != null && !listPhone.contains(o.getPhone())).collect(Collectors.toList());
......@@ -636,9 +630,9 @@ public class YgglController {
// 存放 插入失败的 数据
insertErrors.add(yme);
}
//假期规则初始化
String current_time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
List<KqglAssoLeaveRules> rul = KqglAssoLeaveRules.builder().build().selectList(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, orgCode));
......@@ -649,8 +643,8 @@ public class YgglController {
KqglAssoLeaveEmployeeBalance.builder().leaveRulesId(r.getId()).userid(login.getId()).balanceDays(0.0).modifyUserid(userBean.getEmpNum()).modifyTimer(current_time).orgCode(userBean.getOrgCode()).build().insert();
}
}
}
JSONObject obj = JSONUtil.createObj();
......@@ -666,7 +660,7 @@ public class YgglController {
/**
* 获取导入模板
*
*
* @param
* @return
* @throws IOException
......@@ -723,7 +717,7 @@ public class YgglController {
/**
* 导出员工
*
*
* @param
* @return
*/
......@@ -738,7 +732,7 @@ public class YgglController {
/**
* 获取员工教育经历表
*
*
* @param
* @return
*/
......@@ -765,7 +759,7 @@ public class YgglController {
/**
* 添加/修改员工教育经历表
*
*
* @param
* @return
*/
......@@ -781,7 +775,7 @@ public class YgglController {
/**
* 删除员工教育经历表
*
*
* @param
* @return
*/
......@@ -796,7 +790,7 @@ public class YgglController {
/**
* 获取员工培训经历信息表
*
*
* @param
* @return
*/
......@@ -824,7 +818,7 @@ public class YgglController {
/**
* 添加/修改员工培训经历信息表
*
*
* @param
* @return
*/
......@@ -841,7 +835,7 @@ public class YgglController {
/**
* 删除员工培训经历信息表
*
*
* @param
* @return
*/
......@@ -856,7 +850,7 @@ public class YgglController {
/**
* 获取员工工作经历表
*
*
* @param
* @return
*/
......@@ -883,7 +877,7 @@ public class YgglController {
/**
* 添加/修改员工工作经历表
*
*
* @param
* @return
*/
......@@ -899,7 +893,7 @@ public class YgglController {
/**
* 删除员工工作经历表
*
*
* @param
* @return
*/
......@@ -914,7 +908,7 @@ public class YgglController {
/**
* 获取员工职称信息表
*
*
* @param
* @return
*/
......@@ -941,7 +935,7 @@ public class YgglController {
/**
* 添加/修改员工职称信息表
*
*
* @param
* @return
*/
......@@ -957,7 +951,7 @@ public class YgglController {
/**
* 删除员工职称信息表
*
*
* @param
* @return
*/
......@@ -972,7 +966,7 @@ public class YgglController {
/**
* 获取员工证书证件表
*
*
* @param
* @return
*/
......@@ -999,7 +993,7 @@ public class YgglController {
/**
* 添加/修改员工证书证件表
*
*
* @param
* @return
*/
......@@ -1015,7 +1009,7 @@ public class YgglController {
/**
* 删除员工证书证件表
*
*
* @param
* @return
*/
......@@ -1030,7 +1024,7 @@ public class YgglController {
/**
* 获取员工联系信息表
*
*
* @param
* @return
*/
......@@ -1057,7 +1051,7 @@ public class YgglController {
/**
* 添加/修改员工联系信息表
*
*
* @param
* @return
*/
......@@ -1073,7 +1067,7 @@ public class YgglController {
/**
* 删除员工联系信息表
*
*
* @param
* @return
*/
......@@ -1088,7 +1082,7 @@ public class YgglController {
/**
* 获取员工紧急联系人表
*
*
* @param
* @return
*/
......@@ -1115,7 +1109,7 @@ public class YgglController {
/**
* 添加/修改员工紧急联系人表
*
*
* @param
* @return
*/
......@@ -1131,7 +1125,7 @@ public class YgglController {
/**
* 删除员工紧急联系人表
*
*
* @param
* @return
*/
......@@ -1147,7 +1141,7 @@ public class YgglController {
// 获取工资卡信息
/**
* 获取员工工资卡信息
*
*
* @param
* @return
*/
......@@ -1173,7 +1167,7 @@ public class YgglController {
/**
* 添加/修改工资卡信息
*
*
* @param
* @return
*/
......@@ -1189,7 +1183,7 @@ public class YgglController {
/**
* 删除工资卡信息
*
*
* @param
* @return
*/
......@@ -1204,7 +1198,7 @@ public class YgglController {
/**
* 获取员工合同信息表
*
*
* @param
* @return
*/
......@@ -1231,7 +1225,7 @@ public class YgglController {
/**
* 添加/修改员工合同信息表
*
*
* @param
* @return
*/
......@@ -1247,7 +1241,7 @@ public class YgglController {
/**
* 删除员工合同信息表
*
*
* @param
* @return
*/
......@@ -1262,7 +1256,7 @@ public class YgglController {
/**
* 获取员工材料附件表
*
*
* @param
* @return
*/
......@@ -1289,7 +1283,7 @@ public class YgglController {
/**
* 添加/修改员工材料附件表
*
*
* @param
* @return
*/
......@@ -1305,7 +1299,7 @@ public class YgglController {
/**
* 删除员工材料附件表
*
*
* @param
* @return
*/
......@@ -1320,7 +1314,7 @@ public class YgglController {
/**
* 获取成长记录表
*
*
* @param
* @return
*/
......@@ -1347,7 +1341,7 @@ public class YgglController {
/**
* 添加/修改成长记录表
*
*
* @param
* @return
*/
......@@ -1363,7 +1357,7 @@ public class YgglController {
/**
* 获取单个离职员工信息(管)
*
*
* @param
* @return
*/
......@@ -1378,7 +1372,7 @@ public class YgglController {
/**
* 员工转正 0-1
*
*
* @param
* @return
*/
......@@ -1395,7 +1389,7 @@ public class YgglController {
/**
* 计划离职 type1-2
*
*
* @param
* @return
*/
......@@ -1409,11 +1403,11 @@ public class YgglController {
YgglMainEmp ygglMainEmp = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getEmpNum, empNum)
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
if (ygglMainEmp.getJobStatus() == jobStatus.LIZHIZHONG.getType()) {
return ResultUtil.success("你已在离职中");
}
YgglMainLzb ygglMainLzb = YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).build();
// 移动员工表数据到离职表
BeanUtil.copyProperties(ygglMainEmp, ygglMainLzb, "before_leaving_sts");
......@@ -1437,7 +1431,7 @@ public class YgglController {
/**
* 确认离职 type2-3
*
*
* @param
* @return
*/
......@@ -1475,11 +1469,11 @@ public class YgglController {
if (listEEA != null && listEEA.size() > 0) {
QyzxEmpLogin.builder().id(empNum).orgId(CollUtil.getFirst(listEEA).getOrgCode()).build().updateById();
}
QyzxEmpLogin.builder().build().delete(new QueryWrapper<QyzxEmpLogin>().lambda().eq(QyzxEmpLogin::getOrgId, userBean.getOrgCode()).eq(QyzxEmpLogin::getId, empNum));
KqglAssoYhkqz.builder().build().delete(new QueryWrapper<KqglAssoYhkqz>().lambda().eq(KqglAssoYhkqz::getUserid, empNum).eq(KqglAssoYhkqz::getQyid, userBean.getOrgCode()));
try {
realtimeupdate.AttendanceTask(userBean.getOrgCode(), empNum, 2,null);
......@@ -1487,13 +1481,13 @@ public class YgglController {
} catch (ParseException e) {
e.printStackTrace();
}
return ResultUtil.success("确认离职员工成功");
}
/**
* 放弃离职 type 2-1
*
*
* @param
* @return
*/
......@@ -1532,7 +1526,7 @@ public class YgglController {
/**
* 查询离职员工列表
*
*
* @param
* @return
*/
......@@ -1551,7 +1545,7 @@ public class YgglController {
/**
* 展示民族/展示所有民族
*
*
* @param
* @return
*/
......@@ -1572,7 +1566,7 @@ public class YgglController {
/**
* 籍贯树
*
*
* @param
* @return
*/
......@@ -1588,7 +1582,7 @@ public class YgglController {
/**
* 查询员工列表
*
*
* @param
* @return
*/
......@@ -1596,7 +1590,7 @@ public class YgglController {
@ApiOperation(value = "62.查询员工列表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 62)
public Result<List<YgQueryDto>> queryEmpMessage(@CurrentUser UserBean userBean) {
List<YgQueryDto> ygQueryDto = ygglMainEmpMapper.queryEmpMessage(userBean.getOrgCode());
List<YgQueryDto> ygQueryDto = ygglMainEmpMapper.queryEmpMessage(userBean.getOrgCode(),null);
for (YgQueryDto yg : ygQueryDto) {
if (StringUtil.isEmpty(yg.getHeadUrl())) {
yg.setHeadUrl("");
......@@ -1608,7 +1602,7 @@ public class YgglController {
/*************** 统计图 ***************/
/**
* 查询统计图
*
*
* @return 成功信息
*/
@GetMapping("/yggl")
......@@ -1651,7 +1645,7 @@ public class YgglController {
/**
* 员工信息统计图
*
*
* @return 成功信息(weng)
*/
@GetMapping("/Cartogram")
......@@ -1729,7 +1723,7 @@ public class YgglController {
/**
* 获取员工社保公积金
*
*
* @param
* @return
*/
......@@ -1745,7 +1739,7 @@ public class YgglController {
/**
* 获取员工社保公积金
*
*
* @param
* @return
*/
......@@ -1762,7 +1756,7 @@ public class YgglController {
/**
* 添加/修改员工社保公积金
*
*
* @param
* @return
*/
......@@ -1787,7 +1781,7 @@ public class YgglController {
/**
* 删除员工社保公积金
*
*
* @param
* @return
*/
......@@ -1829,7 +1823,7 @@ public class YgglController {
/**
* 获取登录人的相关信息
*
*
* @param
* @return
*/
......@@ -1864,22 +1858,22 @@ public class YgglController {
loginInfo.setGwId(gw);
loginInfo.setGwName(gwObj != null ? gwObj.getName() : "");
loginInfo.setEntryTime(ygglMainEmp.getRzTime());
if(ygglMainEmp.getSyq()!=null) {
// System.out.println(ygglMainEmp.getSyq());
Date expireDate = DateUtil.offsetMonth(ygglMainEmp.getRzTime(), ygglMainEmp.getSyq()); // 时间偏移
loginInfo.setRegularTime(expireDate);
loginInfo.setRegularTime(expireDate);
}else {
loginInfo.setRegularTime(new Date());
loginInfo.setRegularTime(new Date());
}
}
return ResultUtil.data(loginInfo);
}
/**
* 获取登录人和上级主管的empNum和名称
*
*
* @param
* @return
*/
......@@ -1887,16 +1881,16 @@ public class YgglController {
@ApiOperation(value = "70.获取登录人和上级主管的empNum和名称", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 70)
public Result<List<LoginerChargeDto>> loginerChargers(@CurrentUser UserBean userBean) {
List<LoginerChargeDto> loginerChargeDtos = new ArrayList<LoginerChargeDto>();
Integer orgCode = userBean.getOrgCode();
ArrayList<Integer> list = new ArrayList<Integer>();
Integer empNum = userBean.getEmpNum();
Integer gw = empNumConfirm(orgCode, empNum).getBmgwId();
if(gw != null && gw > 0) {
ZzglBmgwM buid = ZzglBmgwM.builder().id(gw).build().selectById();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).eq(ZzglBmgwM::getType, 0).list();
// 获取该员工的上级部门id 的数组list
......@@ -1912,7 +1906,7 @@ public class YgglController {
}
List<YgglMainEmp> ygglMainEmps = empNumsConfirm(orgCode, leaderList);
// List<LoginerChargeDto> loginerChargeDtos = new ArrayList<LoginerChargeDto>();
for (Integer leaderId : leaderList) {
for (YgglMainEmp m : ygglMainEmps) {
if(leaderId.equals(m.getEmpNum())) {
......@@ -1922,10 +1916,10 @@ public class YgglController {
loginerChargeDtos.add(new LoginerChargeDto(m.getEmpNum(), m.getName(), m.getHeadUrl()));
}
}
}
Collections.reverse(loginerChargeDtos);
if(loginerChargeDtos.size()>0) {
if((userBean.getEmpNum()).equals(loginerChargeDtos.get(loginerChargeDtos.size()-1).getLeaderEmpNum())) {
......@@ -1935,7 +1929,7 @@ public class YgglController {
return ResultUtil.data(loginerChargeDtos);
}
return ResultUtil.data(loginerChargeDtos);
}
// 根据传来的empNum获取该人员信息,没有则传全部
......@@ -1965,7 +1959,7 @@ public class YgglController {
/**
* 获取用户头像
*
*
* @param
* @return
*/
......@@ -1987,52 +1981,65 @@ public class YgglController {
}
return ResultUtil.data(yglList);
}
@Autowired
private KqglAssoLeaveBalanceMapper kqglassoleavebalancemapper;
@GetMapping(value = "/address_book")
@ApiOperation(value = "APP 获取通讯录", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 70)
public Result<Object> Getaddressbook(@CurrentUser UserBean userBean) {
List<AdditionalDto> userlist = kqglassoleavebalancemapper.selectAdditionalList(userBean.getOrgCode());
return ResultUtil.data(userlist);
}
@PostMapping(value = "/modify_avatar")
@ApiOperation(value = "APP_修改头像", httpMethod = "POST", notes = "接口发布说明")
public Result<YgglAttaSbgjj> Modify_Avatar(@CurrentUser UserBean userBean, @RequestBody ModifyAvatarDto modifyavatardto) {
YgglMainEmp.builder().headUrl(modifyavatardto.getAvatar_path()).build().update(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
.eq(YgglMainEmp::getEmpNum, userBean.getEmpNum()));
QyzxEmpLogin.builder().headUrl(modifyavatardto.getAvatar_path()).build().update(new QueryWrapper<QyzxEmpLogin>().lambda().eq(QyzxEmpLogin::getOrgId, userBean.getOrgCode())
.eq(QyzxEmpLogin::getPhone, userBean.getQyzxEmpLogin().getPhone()));
return ResultUtil.success("上传成功");
}
@PostMapping(value = "/new_account")
@ApiOperation(value = "修改账号", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> New_account(@CurrentUser UserBean userBean, @RequestBody UserInfo userinfo) {
YgglMainEmp sjhpd = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getPhone, userinfo.getPhone())
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
if(sjhpd == null) {
YgglMainEmp.builder().phone(userinfo.getPhone()).build().update(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, userinfo.getName()).eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
QyzxEmpLogin.builder().phone(userinfo.getPhone()).build().update(new QueryWrapper<QyzxEmpLogin>().lambda().eq(QyzxEmpLogin::getId,userinfo.getName()).eq(QyzxEmpLogin::getOrgId, userBean.getOrgCode()));
return ResultUtil.success("修改成功");
}else {
return ResultUtil.error("该号码已存在");
}
}
@GetMapping(value = "/getUserList")
@ApiOperation(value = "62-1.运营后台--查询员工列表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 62)
public Result<List<YgQueryDto>> getUserList(@RequestParam("companyId") String companyId) {
List<YgQueryDto> ygQueryDto = ygglMainEmpMapper.queryEmpMessage(Integer.parseInt(companyId),0);
for (YgQueryDto yg : ygQueryDto) {
if (StringUtil.isEmpty(yg.getHeadUrl())) {
yg.setHeadUrl("");
}
}
return ResultUtil.data(ygQueryDto);
}
}
package cn.timer.api.dao.adminaccount;
import cn.timer.api.bean.adminaccount.AdminAccount;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* 管理员列表
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-14 18:24:20
*/
@Repository
public interface AdminAccountMapper extends BaseMapper<AdminAccount> {
}
package cn.timer.api.dao.insure;
import cn.timer.api.bean.insure.InsureApplicant;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* 投保人
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-07 17:02:46
*/
@Repository
public interface InsureApplicantMapper extends BaseMapper<InsureApplicant> {
}
package cn.timer.api.dao.insure;
import cn.timer.api.bean.insure.InsureLog;
import cn.timer.api.dto.insure.PolicyLogDto;
import cn.timer.api.utils.Page;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
*
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-22 09:55:46
*/
@Repository
public interface InsureLogMapper extends BaseMapper<InsureLog> {
List<InsureLog> selectListById(@Param("policyId")String policyId);
List<InsureLog> selectListByIds(@Param("array")Integer[] ids);
List<PolicyLogDto> selectLogListByOrgCode(@Param("orgCode") Integer orgCode, @Param("page") Page page);
Integer selectLogTotalByOrgCode(@Param("orgCode") Integer orgCode);
}
package cn.timer.api.dao.insure;
import cn.timer.api.bean.insure.InsurePolicy;
import cn.timer.api.dto.insure.InsureUserDto;
import cn.timer.api.dto.insure.PolicyDto;
import cn.timer.api.utils.Page;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 保单信息
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-14 08:53:04
*/
@Repository
public interface InsurePolicyMapper extends BaseMapper<InsurePolicy> {
List<PolicyDto> policyList(@Param("policy") PolicyDto policyDto);
PolicyDto getPolicyDetail(@Param("id")Integer id);
Integer totalPolicy(@Param("policy")PolicyDto policyDto);
List<PolicyDto> policyTotalList();
List<InsureUserDto> selectPlansListByorgCode(@Param("orgCode")Integer id);
}
package cn.timer.api.dao.insure;
import cn.timer.api.bean.insure.InsureProduct;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* 保险产品
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-30 11:36:30
*/
@Repository
public interface InsureProductMapper extends BaseMapper<InsureProduct> {
}
package cn.timer.api.dao.insure;
import cn.timer.api.bean.insure.InsureUser;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.dto.insure.InsureUserDto;
import cn.timer.api.dto.insure.PolicyDto;
import cn.timer.api.utils.Page;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 被保人
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-11 09:06:53
*/
@Repository
public interface InsureUserMapper extends BaseMapper<InsureUser> {
List<PolicyDto> selectPolicyList(@Param("policyDto") PolicyDto policyDto );
Integer totalUser(@Param("policyDto") PolicyDto policyDto);
List<InsureUser> selectListByIds(@Param("array")String[] ids);
List<InsureUserDto> selectPlansListByIds(@Param("array")String[] ids);
List<InsureUserDto> selectPlansListById(@Param("policyId")String id);
}
package cn.timer.api.dao.qyzx;
import cn.timer.api.dto.qyzx.EntInfoDto;
import cn.timer.api.utils.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import java.util.List;
import java.util.Map;
/**
......@@ -14,6 +18,11 @@ import cn.timer.api.bean.qyzx.QyzxEntInfoM;
*/
@Repository
public interface QyzxEntInfoMMapper extends BaseMapper<QyzxEntInfoM> {
public List<EntInfoDto> companyAdminList(@Param("page")Page page);
public Integer companyAdminCount();
public List<Map<String,String>> getCompanyList();
......
......@@ -19,7 +19,7 @@ import cn.timer.api.dto.zzgl.DepartmentStaffDto;
/**
* 员工档案+统计图查询
*
*
* @author dsc 2019-11-23
*/
@Repository
......@@ -30,17 +30,17 @@ public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> {
* @return
*/
List<YgbintuDto> rsybp(Integer orgCode);
/**
* 查询当月离职人数
* @param userBean
* @param userBean
* @return
*/
Integer benyueLz(Integer orgCode);
/**
* 查询当月转正人数
* @param userBean
* @param userBean
* @return
*/
Integer benyueZz(Integer orgCode);
......@@ -49,75 +49,75 @@ public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> {
* @param userBean
* @return
*/
List<YgQueryDto> queryEmpMessage(@Param("orgCode") Integer orgCode);
List<YgQueryDto> queryEmpMessage(@Param("orgCode") Integer orgCode,@Param("isInsure")Integer isInsure);
/**
* 查询在职员工(试用员工人数+正式员工人数)
* @param userBean
* @param userBean
* @return
*/
YgglCartogramDto queryInservice(UserBean userBean);
/**
* 查询当月入职人数
* @param userBean
* @param userBean
* @return
*/
YgglCartogramDto queryInduction(UserBean userBean);
/**
* 查询本月转正人数
* @param userBean
* @param userBean
* @return
*/
YgglCartogramDto queryPositive(UserBean userBean);
/**
* 查询员工平均年龄
* @param userBean
* @param userBean
* @return
*/
YgglCartogramDto queryAvgAge(UserBean userBean);
/**
* 查询部门名称及人数
* @param userBean
* @param userBean
* @return
*/
List<YgglCartogramDto> queryDepartmentNum(UserBean userBean);
/**
* 查询岗位名称及人数
* @param userBean
* @param userBean
* @return
*/
List<YgglCartogramDto> queryJobsNum(UserBean userBean);
/**
* 学历及人数查询
* @param userBean
* @param userBean
* @return
*/
List<YgglCartogramDto> queryEducation(UserBean userBean);
/**
* 员工年龄分布查询
* @param userBean
* @param userBean
* @return
*/
List<YgglCartogramDto> queryEmpAge(UserBean userBean);
/**
* 籍贯统计(省份)人数分布查询
* @param userBean
* @param userBean
* @return
*/
List<YgglCartogramDto> queryNativeplace(UserBean userBean);
/**
* 员工工龄分布查询
* @param userBean
* @param userBean
* @return
*/
List<YgglCartogramDto> queryWorkingAge(UserBean userBean);
......@@ -129,6 +129,8 @@ public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> {
* @return
*/
IPage<YgglMainEmp> selectME(Page<YgglMainEmp> page,@Param("param") EmpQuery empQuery);
List<DepartmentStaffDto> DepartmentStaff(Integer orgcode,Integer upid);
List<YgglMainEmp> selectListByIds(@Param("array")String[] ids);
}
package cn.timer.api.dto.insure;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/7 18:15
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class InsureDto {
private String id;
private String orgCode;/*企业id*/
private String companyName;/*用工单位实际工作单位*/
private String policyDateStart;
private String policyDateEnd;
private Integer type;/*类型 1是新增 3是替换*/
private String productId;
private List<PlansDto> plans;
private String benefitBasicPlan;/*方案名称*/
private String benefitOccupationCategory;
private String tricycleFrameNumber;
private String[] oldIds;
private String[] userIds;
private Double totalPrice;
private MultipartFile file;
// private String
}
package cn.timer.api.dto.insure;
import lombok.Data;
/**
* @Description TODO
* @Author wgd
* @Date 2022/4/7 17:13
*/
@Data
public class InsureUserDto {
private Integer policyId;
private String benefitBasicPlan;
private String benefitOccupationCategory;
private Integer totalUser;
private String[] oldIds;
private String policyNo;
}
package cn.timer.api.dto.insure;
import lombok.Data;
/**
* @Description TODO
* @Author wgd
* @Date 2022/4/6 9:14
*/
@Data
public class PlansDto{
private int index;
private String[] userIds;
private String benefitBasicPlan;/*方案名称*/
private String benefitOccupationCategory;
private String tricycleFrameNumber;
private Integer price;
}
package cn.timer.api.dto.insure;
import cn.timer.api.utils.Page;
import lombok.Data;
import java.util.Date;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/14 11:01
*/
@Data
public class PolicyDto {
private long id;
private String name;
private Integer zjType;
private String zjNum;
private String policyNo;
private String status;
private String schemeName;
private String policyDateStart;
private String policyDateEnd;
private String createTime;
private Integer type;
private Integer totaPolicy;
private Integer totalCompany;
private Integer totalUser;
private Double totalPremium;
private Date updateTime;
private String insuredName;
private String benefitBasicPlan;
private String price;
private String orgCode;
private Page page;
private String policyFile;
private String benefitOccupationCategory;
private Integer userId;
private Integer insureStatus;
private String planId;
private String categoryId;
}
package cn.timer.api.dto.insure;
import lombok.Data;
import java.util.Date;
/**
* @Description TODO
* @Author wgd
* @Date 2022/4/11 16:39
*/
@Data
public class PolicyLogDto {
private Integer id;
private String policyNo;
private String returnCode;
private String returnMsg;
private Integer type;
private Date createTime;
}
package cn.timer.api.dto.qyzx;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/17 10:09
*/
@Data
public class EntInfoDto {
private Integer id;
private String name;
private String linkMan;
private String linkManPhone;
private String areaName;
private String totalNum;
private String logoUrl;
private String registerTime;
private String endTime;
private Integer totlaSpmk;
private Integer totlaCc;
}
/**
* @date 2019年11月16日
* @date 2019年11月16日
* @author 翁东州
* @方法中文名称:
*/
......@@ -27,6 +27,8 @@ import lombok.NoArgsConstructor;
public class YgQueryDto extends Page {
// private static final long serialVersionUID = -1230023773946170942L;
@ApiModelProperty
private Integer id;
@ApiModelProperty(value = "员工姓名", example = "华仔")
private String empName;
......@@ -72,4 +74,7 @@ public class YgQueryDto extends Page {
@ApiModelProperty(value = "性别", example = "1")
private Integer sex;
@ApiModelProperty(value="是否已购买保险",example = "0")
private Integer isInsure;
}
......@@ -41,27 +41,25 @@ public class ExcelUtils {
* @param sheetNum 开始解析的sheet序号,如果不指定,默认传值为-1,则会解析所有sheet
* @return
*/
public static List<List<Map<String, Object>>> importExcel(String filePath, int startRow, int startCol, int sheetNum) {
public static List<List<Map<String, Object>>> importExcel(XSSFWorkbook workbook, int startRow, int startCol, int sheetNum) {
logger.info("========================= ExcelUtils.java ->> importExcel()从Excel表格中获取数据 ->> 开始 =========================");
// 用于存储最终整个Excel表格的数据
// // 用于存储最终整个Excel表格的数据
List<List<Map<String, Object>>> resultList = new ArrayList<>();
// 得到指定路径的文件File对象
File file = new File(filePath);
// 如果不存在
if (!file.exists()) {
logger.info("ExcelUtils.java ->> importExcel() ->> 错误操作:要读取Excel文件在指定路径(" + filePath + ")下找不到");
throw new RuntimeException("错误操作:要读取Excel文件在指定路径(" + filePath + ")下找不到");
}
//
// // 得到指定路径的文件File对象
// File file = new File(filePath);
// // 如果不存在
// if (!file.exists()) {
// logger.info("ExcelUtils.java ->> importExcel() ->> 错误操作:要读取Excel文件在指定路径(" + filePath + ")下找不到");
// throw new RuntimeException("错误操作:要读取Excel文件在指定路径(" + filePath + ")下找不到");
// }
InputStream input = null;
Workbook workbook = null;
try {
// 得到文件的资源输入流
input = new FileInputStream(file);
// input = new FileInputStream(file);
// 得到处理excel的Workbook对象
workbook = ExcelUtils.getWorkbookByExtensionName(input, filePath);
// 创建一个公式计算器,用于计算并得到Excel中的公式结果
FormulaEvaluator formulaEvaluator = workbook.getCreationHelper().createFormulaEvaluator();
......@@ -291,11 +289,11 @@ public class ExcelUtils {
* @param out 输出流
* @throws Exception
*/
public static void exportExcel(String title, String[] rowName, List<Object[]> dataList, OutputStream out) {
public static XSSFWorkbook exportExcel(String title, String[] rowName, List<Object[]> dataList) {
logger.info("========================= ExcelUtils.java ->> exportExcel()导出数据到Excel中 ->> 开始 =========================");
XSSFWorkbook workbook = null;
try {
/*
1,创建工作簿对象,然后创建大标题行,并设置标题
*/
......@@ -417,22 +415,7 @@ public class ExcelUtils {
sheet.setColumnWidth(colNum, (columnWidth + 4) * 256);
}
}
workbook.write(out);
} catch (Exception e) {
logger.info("ExcelUtils.java ->> exportExcel() ->> 异常信息:" + e);
throw new RuntimeException(e);
} finally {
try {
if (workbook != null) {
workbook.close();
logger.info("ExcelUtils.java ->> exportExcel() ->> 关闭Workbook资源");
}
} catch (Exception e) {
e.printStackTrace();
}
logger.info("========================= ExcelUtils.java ->> exportExcel()导出数据到Excel中 ->> 结束 =========================");
}
return workbook;
}
/**
......@@ -506,6 +489,23 @@ public class ExcelUtils {
// 设置垂直对齐的样式为居中对齐
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
}
/**
* 把单元格的内容转为字符串
*
* @param xssfCell 单元格
* @return String
*/
public static String getString(XSSFCell xssfCell) {
if (xssfCell == null) {
return "";
}
if (xssfCell.getCellTypeEnum() == CellType.NUMERIC) {
return String.valueOf(xssfCell.getNumericCellValue());
} else if (xssfCell.getCellTypeEnum() == CellType.BOOLEAN) {
return String.valueOf(xssfCell.getBooleanCellValue());
} else {
return xssfCell.getStringCellValue();
}
}
}
......@@ -14,8 +14,6 @@ import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
package cn.timer.api.utils;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;
//import org.apache.shiro.crypto.hash.SimpleHash;
/**
*
* @ClassName: Md5
* @Description: TODO(Md5加密)
* @author TZQ chess222_com
* @date 2019年3月2日 下午12:34:50
*
* @ClassName: Md5
* @Description: TODO(Md5加密)
* @author TZQ chess222_com
* @date 2019年3月2日 下午12:34:50
*
*/
public class Md5 {
......@@ -29,7 +33,8 @@ public class Md5 {
// 生成一个MD5加密计算摘要
MessageDigest md = MessageDigest.getInstance("MD5");
// 对字符串进行加密
md.update(plainText.getBytes());
secretBytes=plainText.getBytes(StandardCharsets.ISO_8859_1);
md.update(secretBytes);
// 获得加密后的数据
secretBytes = md.digest();
} catch (NoSuchAlgorithmException e) {
......@@ -40,10 +45,9 @@ public class Md5 {
// 如果生成数字未满32位,需要前面补0
for (int i = 0; i < 32 - md5code.length(); i++) {
md5code = "0" + md5code;
}
}
return md5code;
}
public static void main(String[] args) {
}
......
#生产环境
server:
port: 8089
port: 8866
servlet:
# context-path: /YoulinghrApiV100
session:
......@@ -31,7 +31,7 @@ spring:
# username: tang
# password: Tang123456!
# url: jdbc:mysql://120.24.172.51:3306/youlingrc_tang?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
url: jdbc:mysql://120.78.162.177:3306/8timer_20210904?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
url: jdbc:mysql://120.78.162.177:3306/timer_test?useUnicode=SpmkApproveSummaryMappertrue&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
# url: jdbc:mysql://192.168.172.200:3306/youlingrc_8timer201?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
# url: jdbc:mysql://db.hhlsz.com:3306/youlingrc_8timer201?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
driver-class-name: com.mysql.cj.jdbc.Driver
......@@ -238,3 +238,17 @@ config-8timer:
zip:
path: 'D:/zip/'
insure:
#投保
appid: '1002303100602312445'
secret: 'acb329868c31d5b3ba03de40dac13dd9'
uploadUrl: 'http://sandbox.portal.unistar-ins.com/service/Home/Index/fileUpload'
insuredUrl: 'http://sandbox.portal.unistar-ins.com/mall/Home/Index/createQuotePolicy'
#保全
appidq: '1000115041006006938'
secretq: '6ba1bf4aa0bd14368c95ff0b9934a17b'
uploadUrlq: 'http://sandbox.portal.unistar-ins.com/fuli/Home/Index/file_upload'
batchUrl: 'http://sandbox.portal.unistar-ins.com/fuli/Home/WelfareProduct/batch_declare'
# base_api_url
BASE_API_URL: 'http://test-8timer-api.youlingrc.com'
......@@ -23,14 +23,14 @@ spring:
jpa:
# 配置生成表 存储引擎InnoDB
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
# database:
# database:
open-in-view: false
# naming:
# spring boot jpa hibernate 根据实体类生成表以及字段的命名策略
# 无修改命名 org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
# 遇到大写字母 加”_”的命名 org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
# physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
hibernate:
# physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
hibernate:
ddl-auto: update
show-sql: true
datasource:
......@@ -85,36 +85,36 @@ spring:
exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
# 时间戳统一转换
jackson:
date-format: yyyy-MM-dd HH:mm:ss
date-format: yyyy-MM-dd HH:mm:ss
# spring boot启动打印横幅 配置
banner:
charset: UTF-8 # Banner file encoding.
location: banner.txt # Banner text resource location.
image:
location: banner.gif # Banner image file location (jpg or png can also be used).
width: 76 # Width of the banner image in chars.
height: 76 # Height of the banner image in chars (default based on image height).
margin: 2 # Left hand image margin in chars.
invert: false # Whether images should be inverted for dark terminal themes.
mail:
port: 465
protocol: smtp
host: smtp.youlingrc.com
username: postmaster@youlingrc.com
password: YoulingRC2020
default-encoding: utf-8
properties:
mail:
smtp:
auth: true
starttls:
enable: true
required: true
ssl: # SSL Config
enable: true
socketFactory:
port: 465
class: javax.net.ssl.SSLSocketFactory
charset: UTF-8 # Banner file encoding.
location: banner.txt # Banner text resource location.
image:
location: banner.gif # Banner image file location (jpg or png can also be used).
width: 76 # Width of the banner image in chars.
height: 76 # Height of the banner image in chars (default based on image height).
margin: 2 # Left hand image margin in chars.
invert: false # Whether images should be inverted for dark terminal themes.
mail:
port: 465
protocol: smtp
host: smtp.youlingrc.com
username: postmaster@youlingrc.com
password: YoulingRC2020
default-encoding: utf-8
properties:
mail:
smtp:
auth: true
starttls:
enable: true
required: true
ssl: # SSL Config
enable: true
socketFactory:
port: 465
class: javax.net.ssl.SSLSocketFactory
redis:
database: 5 # Redis数据库索引(默认为0),如果设置为1,那么存入的key-value都存放在select 1中
host: r-wz9p8pve7uem63b10upd.redis.rds.aliyuncs.com
......@@ -126,7 +126,7 @@ spring:
min-idle: 0 # 连接池中的最小空闲连接
timeout: 5000 # 连接超时
#password: 123456 # 密码,默认密码为空
#cluster: # 集群配置
#cluster: # 集群配置
#nodes: 127.0.0.1:6381,127.0.0.1:6382,127.0.0.1:6383,127.0.0.1:6384,127.0.0.1:6385,127.0.0.1:6386
#max-redirects: 2 # 最大重定向次数
devtools:
......@@ -134,7 +134,7 @@ spring:
poll-interval: 3000ms
quiet-period: 2999ms
# mybatis-plus
# mybatis-plus
mybatis-plus:
mapper-locations: classpath:mapping/**/*Mapper.xml # dao到xml文件映射
type-aliases-package: cn.timer.api.bean # xml中#全局类名别名
......@@ -154,7 +154,7 @@ mybatis-plus:
#逻辑删除配置
#logic-delete-value: 0
#logic-not-delete-value: 1
# 分页插件
# 分页插件
pagehelper:
helperDialect: mysql
reasonable: true
......@@ -195,11 +195,11 @@ config-8timer:
expirationTime: 3153600000000L
expirationTime_pri: 600000L
esign: # e签宝
callbackUrl: 'https://client.8timer.cn/callback/esign/dev'
redirectUrl: 'http://client.8timer.cn/#/ElecCon/index'
# host: https://openapi.esign.cn
# PROJECT_ID: 4438775940
# PROJECT_SECRET: 7b100813cca2746081c57837855ac5af
callbackUrl: 'https://client.8timer.cn/callback/esign/dev'
redirectUrl: 'http://client.8timer.cn/#/ElecCon/index'
# host: https://openapi.esign.cn
# PROJECT_ID: 4438775940
# PROJECT_SECRET: 7b100813cca2746081c57837855ac5af
remind: #合同提醒时间 默认小于等于1天会提醒+三个配置项
one: 3
two: 7
......@@ -208,19 +208,21 @@ config-8timer:
# 创建企业默认添加讯息
qyxx:
title: '欢迎来到8小时'
cover: 'https://8time-v2.oss-cn-shenzhen.aliyuncs.com/8timer2.0/common/qyxx/welcome/%E6%AC%A2%E8%BF%8E%E5%9B%BE.png'
summary: '<h1>欢迎来到8小时!可先前往组织管理-组织架构添加公司架构及岗位,再前往员工管理-员工名册添加企业员工。</h1>'
author: 'System'
title: '欢迎来到8小时'
cover: 'https://8time-v2.oss-cn-shenzhen.aliyuncs.com/8timer2.0/common/qyxx/welcome/%E6%AC%A2%E8%BF%8E%E5%9B%BE.png'
summary: '<h1>欢迎来到8小时!可先前往组织管理-组织架构添加公司架构及岗位,再前往员工管理-员工名册添加企业员工。</h1>'
author: 'System'
# 客户管理导入服务器保存路径
crm-excel:
realPath: '/data/crm-excel/'
realPath: '/data/crm-excel/'
#导出zip临时地址
zip:
path: '/data/crm-zip/'
# base_api_url
BASE_API_URL: 'http://api.8timer.cn'
#sftp 配置
sftp:
client:
......@@ -235,4 +237,16 @@ sftp:
channelConnectedTimeout: '15000'
serverUrl: 'https://img.8timer.cn'
targetPath: '/disk'
reservedName: false
\ No newline at end of file
reservedName: false
insure:
#投保
appid: '1002209110212305335'
secret: '1ef7b79471be7f6b5489832c65109f81'
uploadUrl: 'https://portal-unistar-ins.com /service/Home/Index/fileUpload'
insuredUrl: 'https://portal.unistar-ins.com/mall/Home/Index/createQuotePolicy'
#保全
appidq: '1000711000604326196'
secretq: 'a2da17a2797c63dff9172df50af9da65'
uploadUrlq: 'https://portal-unistar-ins.com /fuli/Home/Index/file_upload'
batchUrl: 'https://portal. unistar-ins.com /fuli/Home/WelfareProduct/batch_declare'
......@@ -3,7 +3,7 @@ server:
port: 8189
servlet:
# context-path: /YoulinghrApiV100
session:
session:
timeout: 2592000 # session会话过期时间
tomcat:
# 最大连接数,默认值是10000
......@@ -15,21 +15,21 @@ tomcat:
max-http-post-size: 50MB
min-spare-threads: 100
spring:
servlet:
multipart:
max-file-size: 500MB
servlet:
multipart:
max-file-size: 500MB
max-request-size: 500MB
jpa:
# 配置生成表 存储引擎InnoDB
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
# database:
# database:
open-in-view: false
# naming:
# naming:
# spring boot jpa hibernate 根据实体类生成表以及字段的命名策略
# 无修改命名 org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
# 遇到大写字母 加”_”的命名 org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
# physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
hibernate:
hibernate:
ddl-auto: update
show-sql: true
datasource:
......@@ -64,7 +64,7 @@ spring:
#max-pool-prepared-statement-per-connection-size: 20
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
#connect-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
druid:
druid:
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 ,不能用log4j,不然报错:Failed to bind properties under 'spring.datasource.druid' to javax.sql.DataSource:
filters: stat,slf4j
# 配置监控服务器
......@@ -87,30 +87,30 @@ spring:
date-format: yyyy-MM-dd HH:mm:ss
# spring boot启动打印横幅 配置
banner:
charset: UTF-8 # Banner file encoding.
charset: UTF-8 # Banner file encoding.
location: banner.txt # Banner text resource location.
image:
image:
location: banner.gif # Banner image file location (jpg or png can also be used).
width: 76 # Width of the banner image in chars.
height: 76 # Height of the banner image in chars (default based on image height).
margin: 2 # Left hand image margin in chars.
invert: false # Whether images should be inverted for dark terminal themes.
mail:
mail:
port: 465
host: smtp.youlingrc.com
username: postmaster@youlingrc.com
password: YoulingRC2020
default-encoding: utf-8
properties:
mail:
mail:
smtp:
auth: true
starttls:
starttls:
enable: true
required: true
ssl: # SSL Config
enable: true
socketFactory:
socketFactory:
port: 465
class: javax.net.ssl.SSLSocketFactor
redis:
......@@ -158,7 +158,7 @@ pagehelper:
reasonable: true
supportMethodsArguments: true
params: count=countSql
#showSql
logging:
level:
......@@ -166,7 +166,7 @@ logging:
cn.timer.api.dao: info
pattern:
console: '--%p--%m%n'
#swagger:
# ui-config:
# operations-sorter: method # 它提供了两个配置项:alpha和method,分别代表了按字母表排序以及按方法定义顺序排序
......@@ -204,14 +204,14 @@ config-8timer:
two: 7
three: 30
init-password: 123456
# 创建企业默认添加讯息
qyxx:
title: '欢迎来到8小时'
cover: 'https://8time-v2.oss-cn-shenzhen.aliyuncs.com/8timer2.0/common/qyxx/welcome/%E6%AC%A2%E8%BF%8E%E5%9B%BE.png'
summary: '<h1>欢迎来到8小时!可先前往组织管理-组织架构添加公司架构及岗位,再前往员工管理-员工名册添加企业员工。</h1>'
author: 'System'
# 客户管理导入服务器保存路径
crm-excel:
realPath: '/data/crm-excel/'
......@@ -219,6 +219,9 @@ config-8timer:
#导出zip临时地址
zip:
path: '/data/crm-zip/'
# base_api_url
BASE_API_URL: 'http://test-8timer-api.youlingrc.com'
#sftp 配置
sftp:
client:
......@@ -234,4 +237,16 @@ sftp:
serverUrl: 'https://test-img.8timer.cn'
targetPath: '/disk'
reservedName: false
insure:
#投保
appid: '1002303100602312445'
secret: 'acb329868c31d5b3ba03de40dac13dd9'
uploadUrl: 'http://sandbox.portal.unistar-ins.com/service/Home/Index/fileUpload'
insuredUrl: 'http://sandbox.portal.unistar-ins.com/mall/Home/Index/createQuotePolicy'
#保全
appidq: '1000115041006006938'
secretq: '6ba1bf4aa0bd14368c95ff0b9934a17b'
uploadUrlq: 'http://sandbox.portal.unistar-ins.com/fuli/Home/Index/file_upload'
batchUrl: 'http://sandbox.portal.unistar-ins.com/fuli/Home/WelfareProduct/batch_declare'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.adminaccount.AdminAccountMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.adminaccount.AdminAccount" id="adminAccountMap">
<result property="id" column="id"/>
<result property="realname" column="realname"/>
<result property="tel" column="tel"/>
<result property="types" column="types"/>
<result property="createrid" column="createrid"/>
<result property="createtime" column="createtime"/>
<result property="department" column="department"/>
<result property="groupid" column="groupid"/>
<result property="statu" column="statu"/>
<result property="mark" column="mark"/>
<result property="account" column="account"/>
<result property="pwd" column="pwd"/>
<result property="avatar" column="avatar"/>
<result property="category" column="category"/>
<result property="lfc" column="lfc"/>
<result property="prohibittime" column="prohibittime"/>
<result property="ip" column="ip"/>
<result property="logintime" column="logintime"/>
<result property="updatetime" column="updatetime"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.adminaccount.AdminAccount">
select *
from admin_account
where id = #{value}
</select>
<select id="queryList" resultType="cn.timer.api.bean.adminaccount.AdminAccount">
select * from admin_account
<where>
<if test="realname != null and realname != ''">AND `realname` = #{realname}</if>
<if test="tel != null and tel != ''">AND `tel` = #{tel}</if>
<if test="types != null and types != ''">AND `types` = #{types}</if>
<if test="createrid != null and createrid != ''">AND `createrid` = #{createrid}</if>
<if test="createtime != null and createtime != ''">AND `createtime` = #{createtime}</if>
<if test="department != null and department != ''">AND `department` = #{department}</if>
<if test="groupid != null and groupid != ''">AND `groupid` = #{groupid}</if>
<if test="statu != null and statu != ''">AND `statu` = #{statu}</if>
<if test="mark != null and mark != ''">AND `mark` = #{mark}</if>
<if test="account != null and account != ''">AND `account` = #{account}</if>
<if test="pwd != null and pwd != ''">AND `pwd` = #{pwd}</if>
<if test="avatar != null and avatar != ''">AND `avatar` = #{avatar}</if>
<if test="category != null and category != ''">AND `category` = #{category}</if>
<if test="lfc != null and lfc != ''">AND `lfc` = #{lfc}</if>
<if test="prohibittime != null and prohibittime != ''">AND `prohibittime` = #{prohibittime}</if>
<if test="ip != null and ip != ''">AND `ip` = #{ip}</if>
<if test="logintime != null and logintime != ''">AND `logintime` = #{logintime}</if>
<if test="updatetime != null and updatetime != ''">AND `updatetime` = #{updatetime}</if>
</where>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from admin_account
<where>
<if test="realname != null and realname != ''">AND `realname` = #{realname}</if>
<if test="tel != null and tel != ''">AND `tel` = #{tel}</if>
<if test="types != null and types != ''">AND `types` = #{types}</if>
<if test="createrid != null and createrid != ''">AND `createrid` = #{createrid}</if>
<if test="createtime != null and createtime != ''">AND `createtime` = #{createtime}</if>
<if test="department != null and department != ''">AND `department` = #{department}</if>
<if test="groupid != null and groupid != ''">AND `groupid` = #{groupid}</if>
<if test="statu != null and statu != ''">AND `statu` = #{statu}</if>
<if test="mark != null and mark != ''">AND `mark` = #{mark}</if>
<if test="account != null and account != ''">AND `account` = #{account}</if>
<if test="pwd != null and pwd != ''">AND `pwd` = #{pwd}</if>
<if test="avatar != null and avatar != ''">AND `avatar` = #{avatar}</if>
<if test="category != null and category != ''">AND `category` = #{category}</if>
<if test="lfc != null and lfc != ''">AND `lfc` = #{lfc}</if>
<if test="prohibittime != null and prohibittime != ''">AND `prohibittime` = #{prohibittime}</if>
<if test="ip != null and ip != ''">AND `ip` = #{ip}</if>
<if test="logintime != null and logintime != ''">AND `logintime` = #{logintime}</if>
<if test="updatetime != null and updatetime != ''">AND `updatetime` = #{updatetime}</if>
</where>
</select>
<insert id="save" parameterType="cn.timer.api.bean.adminaccount.AdminAccount" useGeneratedKeys="true" keyProperty="id">
insert into admin_account
(`realname`,
`tel`,
`types`,
`createrid`,
`createtime`,
`department`,
`groupid`,
`statu`,
`mark`,
`account`,
`pwd`,
`avatar`,
`category`,
`lfc`,
`prohibittime`,
`ip`,
`logintime`,
`updatetime`)
values (#{realname},
#{tel},
#{types},
#{createrid},
#{createtime},
#{department},
#{groupid},
#{statu},
#{mark},
#{account},
#{pwd},
#{avatar},
#{category},
#{lfc},
#{prohibittime},
#{ip},
#{logintime},
#{updatetime})
</insert>
<insert id="saveSelective" parameterType="cn.timer.api.bean.adminaccount.AdminAccount" useGeneratedKeys="true"
keyProperty="id">
insert into admin_account
(
<if test="realname != null">,`realname`</if>
<if test="tel != null">,`tel`</if>
<if test="types != null">,`types`</if>
<if test="createrid != null">,`createrid`</if>
<if test="createtime != null">,`createtime`</if>
<if test="department != null">,`department`</if>
<if test="groupid != null">,`groupid`</if>
<if test="statu != null">,`statu`</if>
<if test="mark != null">,`mark`</if>
<if test="account != null">,`account`</if>
<if test="pwd != null">,`pwd`</if>
<if test="avatar != null">,`avatar`</if>
<if test="category != null">,`category`</if>
<if test="lfc != null">,`lfc`</if>
<if test="prohibittime != null">,`prohibittime`</if>
<if test="ip != null">,`ip`</if>
<if test="logintime != null">,`logintime`</if>
<if test="updatetime != null">,`updatetime`</if>
)
values
(
<if test="realname != null">,#{realname}</if>
<if test="tel != null">,#{tel}</if>
<if test="types != null">,#{types}</if>
<if test="createrid != null">,#{createrid}</if>
<if test="createtime != null">,#{createtime}</if>
<if test="department != null">,#{department}</if>
<if test="groupid != null">,#{groupid}</if>
<if test="statu != null">,#{statu}</if>
<if test="mark != null">,#{mark}</if>
<if test="account != null">,#{account}</if>
<if test="pwd != null">,#{pwd}</if>
<if test="avatar != null">,#{avatar}</if>
<if test="category != null">,#{category}</if>
<if test="lfc != null">,#{lfc}</if>
<if test="prohibittime != null">,#{prohibittime}</if>
<if test="ip != null">,#{ip}</if>
<if test="logintime != null">,#{logintime}</if>
<if test="updatetime != null">,#{updatetime}</if>
)
</insert>
<insert id="saveList" parameterType="cn.timer.api.bean.adminaccount.AdminAccount" useGeneratedKeys="true"
keyProperty="id">
insert into admin_account
(
`realname`,
`tel`,
`types`,
`createrid`,
`createtime`,
`department`,
`groupid`,
`statu`,
`mark`,
`account`,
`pwd`,
`avatar`,
`category`,
`lfc`,
`prohibittime`,
`ip`,
`logintime`,
`updatetime`
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.realname},
#{item.tel},
#{item.types},
#{item.createrid},
#{item.createtime},
#{item.department},
#{item.groupid},
#{item.statu},
#{item.mark},
#{item.account},
#{item.pwd},
#{item.avatar},
#{item.category},
#{item.lfc},
#{item.prohibittime},
#{item.ip},
#{item.logintime},
#{item.updatetime}
)
</foreach>
</insert>
<update id="update" parameterType="cn.timer.api.bean.adminaccount.AdminAccount">
update admin_account
<set>
<if test="realname != null">`realname` = #{realname},</if>
<if test="tel != null">`tel` = #{tel},</if>
<if test="types != null">`types` = #{types},</if>
<if test="createrid != null">`createrid` = #{createrid},</if>
<if test="createtime != null">`createtime` = #{createtime},</if>
<if test="department != null">`department` = #{department},</if>
<if test="groupid != null">`groupid` = #{groupid},</if>
<if test="statu != null">`statu` = #{statu},</if>
<if test="mark != null">`mark` = #{mark},</if>
<if test="account != null">`account` = #{account},</if>
<if test="pwd != null">`pwd` = #{pwd},</if>
<if test="avatar != null">`avatar` = #{avatar},</if>
<if test="category != null">`category` = #{category},</if>
<if test="lfc != null">`lfc` = #{lfc},</if>
<if test="prohibittime != null">`prohibittime` = #{prohibittime},</if>
<if test="ip != null">`ip` = #{ip},</if>
<if test="logintime != null">`logintime` = #{logintime},</if>
<if test="updatetime != null">`updatetime` = #{updatetime}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete
from admin_account
where id = #{value}
</delete>
<delete id="deleteBatch">
delete from admin_account where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.insure.InsureApplicantMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.insure.InsureApplicant" id="insureApplicantMap">
<result property="id" column="id"/>
<result property="applicantEName" column="applicant_e_name"/>
<result property="applicantEAddress" column="applicant_e_address"/>
<result property="applicantEmployeeList" column="applicant_employee_list"/>
<result property="applicantEContacts" column="applicant_e_contacts"/>
<result property="applicantEPhone" column="applicant_e_phone"/>
<result property="applicantENoType" column="applicant_e_no_type"/>
<result property="applicantENo" column="applicant_e_no"/>
<result property="applicantEMail" column="applicant_e_mail"/>
<result property="applicantProvinceCity" column="applicant_province_city"/>
<result property="applicantInvoiceReceivingAddress" column="applicant_invoice_receiving_address"/>
<result property="applicantInvoiceBillingPhone" column="applicant_invoice_billing_phone"/>
<result property="applicantBusinessBankName" column="applicant_business_bank_name"/>
<result property="policyNo" column="policy_no"/>
<result property="applicantType" column="applicant_type"/>
<result property="transId" column="trans_id"/>
<result property="currency" column="currency"/>
<result property="applicantInvoicedAmount" column="applicant_invoiced_amount"/>
<result property="applicantCorporateBankAccount" column="applicant_corporate_bank_account"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.insure.InsureApplicant">
select *
from insure_applicant
where id = #{value}
</select>
<select id="queryList" resultType="cn.timer.api.bean.insure.InsureApplicant">
select * from insure_applicant
<where>
<if test="applicantEName != null and applicantEName != ''">AND `applicant_e_name` = #{applicantEName}</if>
<if test="applicantEAddress != null and applicantEAddress != ''">AND `applicant_e_address` =
#{applicantEAddress}
</if>
<if test="applicantEmployeeList != null and applicantEmployeeList != ''">AND `applicant_employee_list` =
#{applicantEmployeeList}
</if>
<if test="applicantEContacts != null and applicantEContacts != ''">AND `applicant_e_contacts` =
#{applicantEContacts}
</if>
<if test="applicantEPhone != null and applicantEPhone != ''">AND `applicant_e_phone` = #{applicantEPhone}
</if>
<if test="applicantENoType != null and applicantENoType != ''">AND `applicant_e_no_type` =
#{applicantENoType}
</if>
<if test="applicantENo != null and applicantENo != ''">AND `applicant_e_no` = #{applicantENo}</if>
<if test="applicantEMail != null and applicantEMail != ''">AND `applicant_e_mail` = #{applicantEMail}</if>
<if test="applicantProvinceCity != null and applicantProvinceCity != ''">AND `applicant_province_city` =
#{applicantProvinceCity}
</if>
<if test="applicantInvoiceReceivingAddress != null and applicantInvoiceReceivingAddress != ''">AND
`applicant_invoice_receiving_address` = #{applicantInvoiceReceivingAddress}
</if>
<if test="applicantInvoiceBillingPhone != null and applicantInvoiceBillingPhone != ''">AND
`applicant_invoice_billing_phone` = #{applicantInvoiceBillingPhone}
</if>
<if test="applicantBusinessBankName != null and applicantBusinessBankName != ''">AND
`applicant_business_bank_name` = #{applicantBusinessBankName}
</if>
<if test="policyNo != null and policyNo != ''">AND `policy_no` = #{policyNo}</if>
<if test="applicantType != null and applicantType != ''">AND `applicant_type` = #{applicantType}</if>
<if test="transId != null and transId != ''">AND `trans_id` = #{transId}</if>
<if test="currency != null and currency != ''">AND `currency` = #{currency}</if>
<if test="applicantInvoicedAmount != null and applicantInvoicedAmount != ''">AND `applicant_invoiced_amount`
= #{applicantInvoicedAmount}
</if>
</where>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from insure_applicant
<where>
<if test="applicantEName != null and applicantEName != ''">AND `applicant_e_name` = #{applicantEName}</if>
<if test="applicantEAddress != null and applicantEAddress != ''">AND `applicant_e_address` =
#{applicantEAddress}
</if>
<if test="applicantEmployeeList != null and applicantEmployeeList != ''">AND `applicant_employee_list` =
#{applicantEmployeeList}
</if>
<if test="applicantEContacts != null and applicantEContacts != ''">AND `applicant_e_contacts` =
#{applicantEContacts}
</if>
<if test="applicantEPhone != null and applicantEPhone != ''">AND `applicant_e_phone` = #{applicantEPhone}
</if>
<if test="applicantENoType != null and applicantENoType != ''">AND `applicant_e_no_type` =
#{applicantENoType}
</if>
<if test="applicantENo != null and applicantENo != ''">AND `applicant_e_no` = #{applicantENo}</if>
<if test="applicantEMail != null and applicantEMail != ''">AND `applicant_e_mail` = #{applicantEMail}</if>
<if test="applicantProvinceCity != null and applicantProvinceCity != ''">AND `applicant_province_city` =
#{applicantProvinceCity}
</if>
<if test="applicantInvoiceReceivingAddress != null and applicantInvoiceReceivingAddress != ''">AND
`applicant_invoice_receiving_address` = #{applicantInvoiceReceivingAddress}
</if>
<if test="applicantInvoiceBillingPhone != null and applicantInvoiceBillingPhone != ''">AND
`applicant_invoice_billing_phone` = #{applicantInvoiceBillingPhone}
</if>
<if test="applicantBusinessBankName != null and applicantBusinessBankName != ''">AND
`applicant_business_bank_name` = #{applicantBusinessBankName}
</if>
<if test="policyNo != null and policyNo != ''">AND `policy_no` = #{policyNo}</if>
<if test="applicantType != null and applicantType != ''">AND `applicant_type` = #{applicantType}</if>
<if test="transId != null and transId != ''">AND `trans_id` = #{transId}</if>
<if test="currency != null and currency != ''">AND `currency` = #{currency}</if>
<if test="applicantInvoicedAmount != null and applicantInvoicedAmount != ''">AND `applicant_invoiced_amount`
= #{applicantInvoicedAmount}
</if>
</where>
</select>
<insert id="save" parameterType="cn.timer.api.bean.insure.InsureApplicant" useGeneratedKeys="true"
keyProperty="id">
insert into insure_applicant
(`applicant_e_name`,
`applicant_e_address`,
`applicant_employee_list`,
`applicant_e_contacts`,
`applicant_e_phone`,
`applicant_e_no_type`,
`applicant_e_no`,
`applicant_e_mail`,
`applicant_province_city`,
`applicant_invoice_receiving_address`,
`applicant_invoice_billing_phone`,
`applicant_business_bank_name`,
`policy_no`,
`applicant_type`,
`trans_id`,
`currency`,
`applicant_invoiced_amount`,
`applicant_corporate_bank_account`)
values (#{applicantEName},
#{applicantEAddress},
#{applicantEmployeeList},
#{applicantEContacts},
#{applicantEPhone},
#{applicantENoType},
#{applicantENo},
#{applicantEMail},
#{applicantProvinceCity},
#{applicantInvoiceReceivingAddress},
#{applicantInvoiceBillingPhone},
#{applicantBusinessBankName},
#{policyNo},
#{applicantType},
#{transId},
#{currency},
#{applicantCorporateBankAccount})
</insert>
<insert id="saveSelective" parameterType="cn.timer.api.bean.insure.InsureApplicant" useGeneratedKeys="true"
keyProperty="id">
insert into insure_applicant
(
<if test="applicantEName != null">,`applicant_e_name`</if>
<if test="applicantEAddress != null">,`applicant_e_address`</if>
<if test="applicantEmployeeList != null">,`applicant_employee_list`</if>
<if test="applicantEContacts != null">,`applicant_e_contacts`</if>
<if test="applicantEPhone != null">,`applicant_e_phone`</if>
<if test="applicantENoType != null">,`applicant_e_no_type`</if>
<if test="applicantENo != null">,`applicant_e_no`</if>
<if test="applicantEMail != null">,`applicant_e_mail`</if>
<if test="applicantProvinceCity != null">,`applicant_province_city`</if>
<if test="applicantInvoiceReceivingAddress != null">,`applicant_invoice_receiving_address`</if>
<if test="applicantInvoiceBillingPhone != null">,`applicant_invoice_billing_phone`</if>
<if test="applicantBusinessBankName != null">,`applicant_business_bank_name`</if>
<if test="policyNo != null">,`policy_no`</if>
<if test="applicantType != null">,`applicant_type`</if>
<if test="transId != null">,`trans_id`</if>
<if test="currency != null">,`currency`</if>
<if test="applicantInvoicedAmount != null">,`applicant_invoiced_amount`</if>
<if test="applicantCorporateBankAccount != null">,`applicant_corporate_bank_account`</if>
)
values
(
<if test="applicantEName != null">,#{applicantEName}</if>
<if test="applicantEAddress != null">,#{applicantEAddress}</if>
<if test="applicantEmployeeList != null">,#{applicantEmployeeList}</if>
<if test="applicantEContacts != null">,#{applicantEContacts}</if>
<if test="applicantEPhone != null">,#{applicantEPhone}</if>
<if test="applicantENoType != null">,#{applicantENoType}</if>
<if test="applicantENo != null">,#{applicantENo}</if>
<if test="applicantEMail != null">,#{applicantEMail}</if>
<if test="applicantProvinceCity != null">,#{applicantProvinceCity}</if>
<if test="applicantInvoiceReceivingAddress != null">,#{applicantInvoiceReceivingAddress}</if>
<if test="applicantInvoiceBillingPhone != null">,#{applicantInvoiceBillingPhone}</if>
<if test="applicantBusinessBankName != null">,#{applicantBusinessBankName}</if>
<if test="policyNo != null">,#{policyNo}</if>
<if test="applicantType != null">,#{applicantType}</if>
<if test="transId != null">,#{transId}</if>
<if test="currency != null">,#{currency}</if>
<if test="applicantCorporateBankAccount != null">,#{applicantCorporateBankAccount}</if>
)
</insert>
<insert id="saveList" parameterType="cn.timer.api.bean.insure.InsureApplicant" useGeneratedKeys="true"
keyProperty="id">
insert into insure_applicant
(
`applicant_e_name`,
`applicant_e_address`,
`applicant_employee_list`,
`applicant_e_contacts`,
`applicant_e_phone`,
`applicant_e_no_type`,
`applicant_e_no`,
`applicant_e_mail`,
`applicant_province_city`,
`applicant_invoice_receiving_address`,
`applicant_invoice_billing_phone`,
`applicant_business_bank_name`,
`policy_no`,
`applicant_type`,
`trans_id`,
`currency`,
`applicant_invoiced_amount`
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.applicantEName},
#{item.applicantEAddress},
#{item.applicantEmployeeList},
#{item.applicantEContacts},
#{item.applicantEPhone},
#{item.applicantENoType},
#{item.applicantENo},
#{item.applicantEMail},
#{item.applicantProvinceCity},
#{item.applicantInvoiceReceivingAddress},
#{item.applicantInvoiceBillingPhone},
#{item.applicantBusinessBankName},
#{item.policyNo},
#{item.applicantType},
#{item.transId},
#{item.currency},
#{item.applicantInvoicedAmount}
)
</foreach>
</insert>
<delete id="deleteBatch">
delete from insure_applicant where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.insure.InsureLogMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.insure.InsureLog" id="insureLogMap">
<result property="id" column="id"/>
<result property="requestPath" column="request_path"/>
<result property="requestData" column="request_data"/>
<result property="requestParam" column="request_param"/>
<result property="createTime" column="create_time"/>
<result property="returnTime" column="return_time"/>
<result property="returnCode" column="return_code"/>
<result property="returnBody" column="return_body"/>
<result property="returnMsg" column="return_msg"/>
<result property="transId" column="trans_id"/>
<result property="type" column="type"/>
<result property="requestType" column="request_type"/>
<result property="policyId" column="policy_id"/>
<result property="fileUrl" column="file_url"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.insure.InsureLog">
select *
from insure_log
where id = #{value}
</select>
<select id="queryList" resultType="cn.timer.api.bean.insure.InsureLog">
select * from insure_log
<where>
<if test="id != null and id != ''">AND `id` = #{id}</if>
<if test="requestPath != null and requestPath != ''">AND `request_path` = #{requestPath}</if>
<if test="requestData != null and requestData != ''">AND `request_data` = #{requestData}</if>
<if test="requestParam != null and requestParam != ''">AND `request_param` = #{requestParam}</if>
<if test="createTime != null and createTime != ''">AND `create_time` = #{createTime}</if>
<if test="returnTime != null and returnTime != ''">AND `return_time` = #{returnTime}</if>
<if test="returnCode != null and returnCode != ''">AND `return_code` = #{returnCode}</if>
<if test="returnBody != null and returnBody != ''">AND `return_body` = #{returnBody}</if>
<if test="returnMsg != null and returnMsg != ''">AND `return_msg` = #{returnMsg}</if>
<if test="transId != null and transId != ''">AND `trans_id` = #{transId}</if>
<if test="type != null and type != ''">AND `type` = #{type}</if>
</where>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from insure_log
<where>
<if test="id != null and id != ''">AND `id` = #{id}</if>
<if test="requestPath != null and requestPath != ''">AND `request_path` = #{requestPath}</if>
<if test="requestData != null and requestData != ''">AND `request_data` = #{requestData}</if>
<if test="requestParam != null and requestParam != ''">AND `request_param` = #{requestParam}</if>
<if test="createTime != null and createTime != ''">AND `create_time` = #{createTime}</if>
<if test="returnTime != null and returnTime != ''">AND `return_time` = #{returnTime}</if>
<if test="returnCode != null and returnCode != ''">AND `return_code` = #{returnCode}</if>
<if test="returnBody != null and returnBody != ''">AND `return_body` = #{returnBody}</if>
<if test="returnMsg != null and returnMsg != ''">AND `return_msg` = #{returnMsg}</if>
<if test="transId != null and transId != ''">AND `trans_id` = #{transId}</if>
<if test="type != null and type != ''">AND `type` = #{type}</if>
</where>
</select>
<insert id="save" parameterType="cn.timer.api.bean.insure.InsureLog">
insert into insure_log
(`id`,
`request_path`,
`request_data`,
`request_param`,
`create_time`,
`return_time`,
`return_code`,
`return_body`,
`return_msg`,
`trans_id`,
`type`)
values (#{id},
#{requestPath},
#{requestData},
#{requestParam},
#{createTime},
#{returnTime},
#{returnCode},
#{returnBody},
#{returnMsg},
#{transId},
#{type})
</insert>
<insert id="saveSelective" parameterType="cn.timer.api.bean.insure.InsureLog">
insert into insure_log
(
<if test="id != null">`id`</if>
<if test="requestPath != null">,`request_path`</if>
<if test="requestData != null">,`request_data`</if>
<if test="requestParam != null">,`request_param`</if>
<if test="createTime != null">,`create_time`</if>
<if test="returnTime != null">,`return_time`</if>
<if test="returnCode != null">,`return_code`</if>
<if test="returnBody != null">,`return_body`</if>
<if test="returnMsg != null">,`return_msg`</if>
<if test="transId != null">,`trans_id`</if>
<if test="type != null">,`type`</if>
)
values
(
<if test="id != null">#{id}</if>
<if test="requestPath != null">,#{requestPath}</if>
<if test="requestData != null">,#{requestData}</if>
<if test="requestParam != null">,#{requestParam}</if>
<if test="createTime != null">,#{createTime}</if>
<if test="returnTime != null">,#{returnTime}</if>
<if test="returnCode != null">,#{returnCode}</if>
<if test="returnBody != null">,#{returnBody}</if>
<if test="returnMsg != null">,#{returnMsg}</if>
<if test="transId != null">,#{transId}</if>
<if test="type != null">,#{type}</if>
)
</insert>
<insert id="saveList" parameterType="cn.timer.api.bean.insure.InsureLog">
insert into insure_log
(
`id`,
`request_path`,
`request_data`,
`request_param`,
`create_time`,
`return_time`,
`return_code`,
`return_body`,
`return_msg`,
`trans_id`,
`type`
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.id},
#{item.requestPath},
#{item.requestData},
#{item.requestParam},
#{item.createTime},
#{item.returnTime},
#{item.returnCode},
#{item.returnBody},
#{item.returnMsg},
#{item.transId},
#{item.type}
)
</foreach>
</insert>
<delete id="deleteBatch">
delete from insure_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectListById" resultType="cn.timer.api.bean.insure.InsureLog">
select id,return_msg,`type`,create_time,file_url from insure_log
where policy_id = #{policyId}
ORDER BY create_time DESC
</select>
<select id="selectListByIds" resultType="cn.timer.api.bean.insure.InsureLog">
select * from insure_log
where type = 1 and policy_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="selectLogListByOrgCode" resultType="cn.timer.api.dto.insure.PolicyLogDto">
select ip.policy_no as policyNo,il.return_code as returnCode,il.return_msg as returnMsg,il.type as type,il.create_time as createTime from insure_log il
LEFT JOIN insure_policy ip on ip.id=il.policy_id
WHERE ip.org_code = #{orgCode}
order by ip.create_time desc
<if test="page.currentPage != null and page.totalPage != null">
limit #{page.offset}, #{page.totalPage}
</if>
</select>
<select id="selectLogTotalByOrgCode" resultType="java.lang.Integer">
select count(il.id) from insure_log il
LEFT JOIN insure_policy ip on ip.id=il.policy_id
WHERE ip.org_code = #{orgCode}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.insure.InsurePolicyMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.insure.InsurePolicy" id="insurePolicyMap">
<result property="id" column="id"/>
<result property="schemeName" column="scheme_name"/>
<result property="policyDateStart" column="policy_date_start"/>
<result property="policyDateEnd" column="policy_date_end"/>
<result property="productCodeId" column="product_code_id"/>
<result property="planCodeId" column="plan_code_id"/>
<result property="partnerPid" column="partner_pid"/>
<result property="policyNo" column="policy_no"/>
<result property="type" column="type"/>
<result property="currency" column="currency"/>
<result property="totalPremium" column="total_premium"/>
<result property="status" column="status"/>
<result property="policyFile" column="policy_file"/>
<result property="kitUrl" column="kit_url"/>
<result property="insureApplicantId" column="insure_applicant_id"/>
<result property="orgCode" column="org_code"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.insure.InsurePolicy">
select *
from insure_policy
where id = #{value}
</select>
<select id="queryList" resultType="cn.timer.api.bean.insure.InsurePolicy">
select * from insure_policy
<where>
<if test="schemeName != null and schemeName != ''">AND `scheme_name` = #{schemeName}</if>
<if test="policyDateStart != null and policyDateStart != ''">AND `policy_date_start` = #{policyDateStart}
</if>
<if test="policyDateEnd != null and policyDateEnd != ''">AND `policy_date_end` = #{policyDateEnd}</if>
<if test="productCodeId != null and productCodeId != ''">AND `product_code_id` = #{productCodeId}</if>
<if test="planCodeId != null and planCodeId != ''">AND `plan_code_id` = #{planCodeId}</if>
<if test="partnerPid != null and partnerPid != ''">AND `partner_pid` = #{partnerPid}</if>
<if test="policyNo != null and policyNo != ''">AND `policy_no` = #{policyNo}</if>
<if test="type != null and type != ''">AND `type` = #{type}</if>
<if test="currency != null and currency != ''">AND `currency` = #{currency}</if>
<if test="totalPremium != null and totalPremium != ''">AND `total_premium` = #{totalPremium}</if>
<if test="status != null and status != ''">AND `status` = #{status}</if>
<if test="policyFile != null and policyFile != ''">AND `policy_file` = #{policyFile}</if>
<if test="kitUrl != null and kitUrl != ''">AND `kit_url` = #{kitUrl}</if>
<if test="insureApplicantId != null and insureApplicantId != ''">AND `insure_applicant_id` =
#{insureApplicantId}
</if>
<if test="orgCode != null and orgCode != ''">AND `org_code` = #{orgCode}</if>
<if test="createTime != null and createTime != ''">AND `create_time` = #{createTime}</if>
<if test="updateTime != null and updateTime != ''">AND `update_time` = #{updateTime}</if>
</where>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from insure_policy
<where>
<if test="schemeName != null and schemeName != ''">AND `scheme_name` = #{schemeName}</if>
<if test="policyDateStart != null and policyDateStart != ''">AND `policy_date_start` = #{policyDateStart}
</if>
<if test="policyDateEnd != null and policyDateEnd != ''">AND `policy_date_end` = #{policyDateEnd}</if>
<if test="productCodeId != null and productCodeId != ''">AND `product_code_id` = #{productCodeId}</if>
<if test="planCodeId != null and planCodeId != ''">AND `plan_code_id` = #{planCodeId}</if>
<if test="partnerPid != null and partnerPid != ''">AND `partner_pid` = #{partnerPid}</if>
<if test="policyNo != null and policyNo != ''">AND `policy_no` = #{policyNo}</if>
<if test="type != null and type != ''">AND `type` = #{type}</if>
<if test="currency != null and currency != ''">AND `currency` = #{currency}</if>
<if test="totalPremium != null and totalPremium != ''">AND `total_premium` = #{totalPremium}</if>
<if test="status != null and status != ''">AND `status` = #{status}</if>
<if test="policyFile != null and policyFile != ''">AND `policy_file` = #{policyFile}</if>
<if test="kitUrl != null and kitUrl != ''">AND `kit_url` = #{kitUrl}</if>
<if test="insureApplicantId != null and insureApplicantId != ''">AND `insure_applicant_id` =
#{insureApplicantId}
</if>
<if test="orgCode != null and orgCode != ''">AND `org_code` = #{orgCode}</if>
<if test="createTime != null and createTime != ''">AND `create_time` = #{createTime}</if>
<if test="updateTime != null and updateTime != ''">AND `update_time` = #{updateTime}</if>
</where>
</select>
<insert id="save" parameterType="cn.timer.api.bean.insure.InsurePolicy" useGeneratedKeys="true" keyProperty="id">
insert into insure_policy
(`scheme_name`,
`policy_date_start`,
`policy_date_end`,
`product_code_id`,
`plan_code_id`,
`partner_pid`,
`policy_no`,
`type`,
`currency`,
`total_premium`,
`status`,
`policy_file`,
`kit_url`,
`insure_applicant_id`,
`org_code`,
`create_time`,
`update_time`)
values (#{schemeName},
#{policyDateStart},
#{policyDateEnd},
#{productCodeId},
#{planCodeId},
#{partnerPid},
#{policyNo},
#{type},
#{currency},
#{totalPremium},
#{status},
#{policyFile},
#{kitUrl},
#{insureApplicantId},
#{orgCode},
#{createTime},
#{updateTime})
</insert>
<insert id="saveSelective" parameterType="cn.timer.api.bean.insure.InsurePolicy" useGeneratedKeys="true"
keyProperty="id">
insert into insure_policy
(
<if test="schemeName != null">,`scheme_name`</if>
<if test="policyDateStart != null">,`policy_date_start`</if>
<if test="policyDateEnd != null">,`policy_date_end`</if>
<if test="productCodeId != null">,`product_code_id`</if>
<if test="planCodeId != null">,`plan_code_id`</if>
<if test="partnerPid != null">,`partner_pid`</if>
<if test="policyNo != null">,`policy_no`</if>
<if test="type != null">,`type`</if>
<if test="currency != null">,`currency`</if>
<if test="totalPremium != null">,`total_premium`</if>
<if test="status != null">,`status`</if>
<if test="policyFile != null">,`policy_file`</if>
<if test="kitUrl != null">,`kit_url`</if>
<if test="insureApplicantId != null">,`insure_applicant_id`</if>
<if test="orgCode != null">,`org_code`</if>
<if test="createTime != null">,`create_time`</if>
<if test="updateTime != null">,`update_time`</if>
)
values
(
<if test="schemeName != null">,#{schemeName}</if>
<if test="policyDateStart != null">,#{policyDateStart}</if>
<if test="policyDateEnd != null">,#{policyDateEnd}</if>
<if test="productCodeId != null">,#{productCodeId}</if>
<if test="planCodeId != null">,#{planCodeId}</if>
<if test="partnerPid != null">,#{partnerPid}</if>
<if test="policyNo != null">,#{policyNo}</if>
<if test="type != null">,#{type}</if>
<if test="currency != null">,#{currency}</if>
<if test="totalPremium != null">,#{totalPremium}</if>
<if test="status != null">,#{status}</if>
<if test="policyFile != null">,#{policyFile}</if>
<if test="kitUrl != null">,#{kitUrl}</if>
<if test="insureApplicantId != null">,#{insureApplicantId}</if>
<if test="orgCode != null">,#{orgCode}</if>
<if test="createTime != null">,#{createTime}</if>
<if test="updateTime != null">,#{update_time}</if>
)
</insert>
<insert id="saveList" parameterType="cn.timer.api.bean.insure.InsurePolicy" useGeneratedKeys="true"
keyProperty="id">
insert into insure_policy
(
`scheme_name`,
`policy_date_start`,
`policy_date_end`,
`product_code_id`,
`plan_code_id`,
`partner_pid`,
`policy_no`,
`type`,
`currency`,
`total_premium`,
`status`,
`policy_file`,
`kit_url`,
`insure_applicant_id`,
`org_code`,
`create_time`,
`update_time`
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.schemeName},
#{item.policyDateStart},
#{item.policyDateEnd},
#{item.productCodeId},
#{item.planCodeId},
#{item.partnerPid},
#{item.policyNo},
#{item.type},
#{item.currency},
#{item.totalPremium},
#{item.status},
#{item.policyFile},
#{item.kitUrl},
#{item.insureApplicantId},
#{item.orgCode},
#{item.createTime},
#{item.updateTime}
)
</foreach>
</insert>
<delete id="deleteBatch">
delete from insure_policy where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="policyList" resultType="cn.timer.api.dto.insure.PolicyDto">
SELECT
ip.id AS id,
ip.policy_no AS policyNo,
ip.create_time as createTime,
ip.scheme_name AS schemeName,
qy.`name` as `name`,
count( iu.id ) AS totalUser,
ip.policy_date_start as policyDateStart,
ip.policy_date_end as policyDateEnd,
sum(iu.price) AS totalPremium,
ip.update_time AS updateTime,
ip.`status` as `status`
FROM
insure_policy ip
LEFT JOIN insure_user iu ON iu.policy_id = ip.id
LEFT JOIN qyzx_ent_info_m qy on qy.id=ip.org_code
<where>
<if test="policy.status!=null and policy.status!=''">
and ip.status = #{policy.status}
</if>
<if test="policy.orgCode!=null and policy.orgCode!=''">
and ip.org_code = #{policy.orgCode}
</if>
<if test="policy.benefitBasicPlan!=null and policy.benefitBasicPlan!=''">
and iu.benefit_basic_plan = #{policy.benefitBasicPlan}
</if>
<if test="policy.policyDateStart!=null and policy.policyDateStart!=''">
and ip.policy_date_start <![CDATA[ >= ]]> #{policy.policyDateStart}
</if>
</where>
GROUP BY ip.id
order by ip.create_time desc
<if test="policy.page.offset != null and policy.page.totalPage !=null">
limit #{policy.page.offset},#{policy.page.totalPage}
</if>
</select>
<select id="totalPolicy" resultType="java.lang.Integer">
select count(ip.id)
from insure_policy ip
<where>
<if test="policy.status!=null and policy.status!=''">
and ip.status = #{policy.status}
</if>
<if test="policy.orgCode!=null and policy.orgCode!=''">
and ip.org_code = #{policy.orgCode}
</if>
<if test="policy.policyDateStart!=null and policy.policyDateStart!=''">
and ip.policy_date_start <![CDATA[ >= ]]> #{policy.policyDateStart}
</if>
</where>
</select>
<select id="getPolicyDetail" resultType="cn.timer.api.dto.insure.PolicyDto">
SELECT
ip.id as id,
ip.scheme_name as schemeName,
ip.policy_date_start as policyDateStart,
ip.policy_date_end as policyDateEnd,
ip.policy_no as policyNo,
ip.org_code as orgCode,
iu.insured_name as insuredName,
iu.benefit_basic_plan as benefitBasicPlan,
iu.benefit_occupation_category as benefitOccupationCategory
FROM
insure_policy ip
LEFT JOIN insure_user iu ON iu.policy_id = ip.id
WHERE
ip.id = #{id}
LIMIT 1
</select>
<select id="policyTotalList" resultType="cn.timer.api.dto.insure.PolicyDto">
SELECT
ip.name AS schemeName,
ip.type AS type,
(select count(id) from insure_policy) AS totaPolicy,
(select count(org_code) from insure_policy) AS totalCompany,
count( iu.id ) AS totalUser,
IFNULL((select sum(price) from insure_user),0) as totalPremium,
ipp.update_time AS updateTime
FROM
insure_product ip
LEFT JOIN insure_policy ipp ON ipp.product_id = ip.id
LEFT JOIN insure_user iu ON iu.policy_id = ipp.id
WHERE
ip.is_del = 0
GROUP BY
ip.id
</select>
<select id="selectPlansListByorgCode" resultType="cn.timer.api.dto.insure.InsureUserDto">
SELECT
ip.id as policyId,
ip.policy_no as policyNo,
iu.benefit_basic_plan as benefitBasicPlan,
iu.benefit_occupation_category as benefitOccupationCategory,
count(iu.id) as totalUser
FROM
insure_policy ip
LEFT JOIN insure_user iu ON iu.policy_id = ip.id
WHERE ip.org_code=#{orgCode}
GROUP BY
ip.id,
iu.benefit_basic_plan,
iu.benefit_occupation_category
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.core.db.dao.InsureProductMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.insure.InsureProduct" id="insureProductMap">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="planCodeId" column="plan_code_id"/>
<result property="productCodeId" column="product_code_id"/>
<result property="type" column="type"/>
<result property="createTime" column="create_time"/>
<result property="isDel" column="is_del"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.insure.InsureProduct">
select *
from insure_product
where id = #{value}
</select>
<select id="queryList" resultType="cn.timer.api.bean.insure.InsureProduct">
select * from insure_product
<where>
<if test="name != null and name != ''">AND `name` = #{name}</if>
<if test="planCodeId != null and planCodeId != ''">AND `plan_code_id` = #{planCodeId}</if>
<if test="productCodeId != null and productCodeId != ''">AND `product_code_id` = #{productCodeId}</if>
<if test="type != null and type != ''">AND `type` = #{type}</if>
<if test="createTime != null and createTime != ''">AND `create_time` = #{createTime}</if>
<if test="isDel != null and isDel != ''">AND `is_del` = #{isDel}</if>
</where>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from insure_product
<where>
<if test="name != null and name != ''">AND `name` = #{name}</if>
<if test="planCodeId != null and planCodeId != ''">AND `plan_code_id` = #{planCodeId}</if>
<if test="productCodeId != null and productCodeId != ''">AND `product_code_id` = #{productCodeId}</if>
<if test="type != null and type != ''">AND `type` = #{type}</if>
<if test="createTime != null and createTime != ''">AND `create_time` = #{createTime}</if>
<if test="isDel != null and isDel != ''">AND `is_del` = #{isDel}</if>
</where>
</select>
<insert id="save" parameterType="cn.timer.api.bean.insure.InsureProduct" useGeneratedKeys="true" keyProperty="id">
insert into insure_product
(`name`,
`plan_code_id`,
`product_code_id`,
`type`,
`create_time`,
`is_del`)
values (#{name},
#{planCodeId},
#{productCodeId},
#{type},
#{createTime},
#{isDel})
</insert>
<insert id="saveSelective" parameterType="cn.timer.api.bean.insure.InsureProduct" useGeneratedKeys="true"
keyProperty="id">
insert into insure_product
(
<if test="name != null">,`name`</if>
<if test="planCodeId != null">,`plan_code_id`</if>
<if test="productCodeId != null">,`product_code_id`</if>
<if test="type != null">,`type`</if>
<if test="createTime != null">,`create_time`</if>
<if test="isDel != null">,`is_del`</if>
)
values
(
<if test="name != null">,#{name}</if>
<if test="planCodeId != null">,#{planCodeId}</if>
<if test="productCodeId != null">,#{productCodeId}</if>
<if test="type != null">,#{type}</if>
<if test="createTime != null">,#{createTime}</if>
<if test="isDel != null">,#{isDel}</if>
)
</insert>
<insert id="saveList" parameterType="cn.timer.api.bean.insure.InsureProduct" useGeneratedKeys="true"
keyProperty="id">
insert into insure_product
(
`name`,
`plan_code_id`,
`product_code_id`,
`type`,
`create_time`,
`is_del`
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.name},
#{item.planCodeId},
#{item.productCodeId},
#{item.type},
#{item.createTime},
#{item.isDel}
)
</foreach>
</insert>
<update id="update" parameterType="cn.timer.api.bean.insure.InsureProduct">
update insure_product
<set>
<if test="name != null">`name` = #{name},</if>
<if test="planCodeId != null">`plan_code_id` = #{planCodeId},</if>
<if test="productCodeId != null">`product_code_id` = #{productCodeId},</if>
<if test="type != null">`type` = #{type},</if>
<if test="createTime != null">`create_time` = #{createTime},</if>
<if test="isDel != null">`is_del` = #{isDel}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete
from insure_product
where id = #{value}
</delete>
<delete id="deleteBatch">
delete from insure_product where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.insure.InsureUserMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.insure.InsureUser" id="insureUserMap">
<result property="id" column="id"/>
<result property="transId" column="trans_id"/>
<result property="price" column="price"/>
<result property="insuredName" column="insured_name"/>
<result property="batchNo" column="batch_no"/>
<result property="premium" column="premium"/>
<result property="insuredMobile" column="insured_mobile"/>
<result property="insuredNo" column="insured_no"/>
<result property="insuredEContact" column="insured_e_contact"/>
<result property="benefitBasicPlan" column="benefit_basic_plan"/>
<result property="benefitOccupationCategory" column="benefit_occupation_category"/>
<result property="benefitElEmployeeNumberT" column="benefit_EL_employee_number_t"/>
<result property="tricycleFrameNumber" column="Tricycle_frame_number"/>
<result property="policyNo" column="policy_no"/>
<result property="status" column="status"/>
<result property="type" column="type"/>
<result property="orgCode" column="org_code"/>
<result property="userId" column="user_id"/>
<result property="applicantEmployeeList" column="applicant_employee_list"/>
<result property="policyDateStart" column="policy_date_start"/>
<result property="policyDateEnd" column="policy_date_end"/>
<result property="insureStatus" column="insure_status"/>
<result property="policyId" column="policy_id"/>
<result property="replaceTransId" column="replace_trans_id"/>
<result property="applyType" column="apply_type"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.insure.InsureUser">
select *
from insure_user
where id = #{value}
</select>
<select id="queryList" resultType="cn.timer.api.bean.insure.InsureUser">
select * from insure_user
<where>
<if test="transId != null and transId != ''">AND `trans_id` = #{transId}</if>
<if test="price != null and price != ''">AND `price` = #{price}</if>
<if test="insuredName != null and insuredName != ''">AND `insured_name` = #{insuredName}</if>
<if test="batchNo != null and batchNo != ''">AND `batch_no` = #{batchNo}</if>
<if test="premium != null and premium != ''">AND `premium` = #{premium}</if>
<if test="insuredMobile != null and insuredMobile != ''">AND `insured_mobile` = #{insuredMobile}</if>
<if test="insuredNo != null and insuredNo != ''">AND `insured_no` = #{insuredNo}</if>
<if test="insuredEContact != null and insuredEContact != ''">AND `insured_e_contact` = #{insuredEContact}
</if>
<if test="benefitBasicPlan != null and benefitBasicPlan != ''">AND `benefit_basic_plan` =
#{benefitBasicPlan}
</if>
<if test="benefitOccupationCategory != null and benefitOccupationCategory != ''">AND
`benefit_occupation_category` = #{benefitOccupationCategory}
</if>
<if test="benefitElEmployeeNumberT != null and benefitElEmployeeNumberT != ''">AND
`benefit_EL_employee_number_t` = #{benefitElEmployeeNumberT}
</if>
<if test="tricycleFrameNumber != null and tricycleFrameNumber != ''">AND `Tricycle_frame_number` =
#{tricycleFrameNumber}
</if>
<if test="policyNo != null and policyNo != ''">AND `policy_no` = #{policyNo}</if>
<if test="status != null and status != ''">AND `status` = #{status}</if>
<if test="type != null and type != ''">AND `type` = #{type}</if>
<if test="orgCode != null and orgCode != ''">AND `org_code` = #{orgCode}</if>
<if test="userId != null and userId != ''">AND `user_id` = #{userId}</if>
<if test="applicantEmployeeList != null and applicantEmployeeList != ''">AND `applicant_employee_list` =
#{applicantEmployeeList}
</if>
<if test="insureStatus != null and insureStatus != ''">AND `insure_status` = #{insureStatus}</if>
<if test="policyId != null and policyId != ''">AND `policy_id` = #{policyId}</if>
</where>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from insure_user
<where>
<if test="transId != null and transId != ''">AND `trans_id` = #{transId}</if>
<if test="price != null and price != ''">AND `price` = #{price}</if>
<if test="insuredName != null and insuredName != ''">AND `insured_name` = #{insuredName}</if>
<if test="batchNo != null and batchNo != ''">AND `batch_no` = #{batchNo}</if>
<if test="premium != null and premium != ''">AND `premium` = #{premium}</if>
<if test="insuredMobile != null and insuredMobile != ''">AND `insured_mobile` = #{insuredMobile}</if>
<if test="insuredNo != null and insuredNo != ''">AND `insured_no` = #{insuredNo}</if>
<if test="insuredEContact != null and insuredEContact != ''">AND `insured_e_contact` = #{insuredEContact}
</if>
<if test="benefitBasicPlan != null and benefitBasicPlan != ''">AND `benefit_basic_plan` =
#{benefitBasicPlan}
</if>
<if test="benefitOccupationCategory != null and benefitOccupationCategory != ''">AND
`benefit_occupation_category` = #{benefitOccupationCategory}
</if>
<if test="benefitElEmployeeNumberT != null and benefitElEmployeeNumberT != ''">AND
`benefit_EL_employee_number_t` = #{benefitElEmployeeNumberT}
</if>
<if test="tricycleFrameNumber != null and tricycleFrameNumber != ''">AND `Tricycle_frame_number` =
#{tricycleFrameNumber}
</if>
<if test="policyNo != null and policyNo != ''">AND `policy_no` = #{policyNo}</if>
<if test="status != null and status != ''">AND `status` = #{status}</if>
<if test="type != null and type != ''">AND `type` = #{type}</if>
<if test="orgCode != null and orgCode != ''">AND `org_code` = #{orgCode}</if>
<if test="userId != null and userId != ''">AND `user_id` = #{userId}</if>
<if test="applicantEmployeeList != null and applicantEmployeeList != ''">AND `applicant_employee_list` =
#{applicantEmployeeList}
</if>
<if test="insureStatus != null and insureStatus != ''">AND `insure_status` = #{insureStatus}</if>
<if test="policyId != null and policyId != ''">AND `policy_id` = #{policyId}</if>
</where>
</select>
<insert id="save" parameterType="cn.timer.api.bean.insure.InsureUser" useGeneratedKeys="true" keyProperty="id">
insert into insure_user
(`trans_id`,
`price`,
`insured_name`,
`batch_no`,
`premium`,
`insured_mobile`,
`insured_no`,
`insured_e_contact`,
`benefit_basic_plan`,
`benefit_occupation_category`,
`benefit_EL_employee_number_t`,
`Tricycle_frame_number`,
`policy_no`,
`status`,
`type`,
`org_code`,
`user_id`,
`applicant_employee_list`,
`insure_status`,
`policy_id`)
values (#{transId},
#{price},
#{insuredName},
#{batchNo},
#{premium},
#{insuredMobile},
#{insuredNo},
#{insuredEContact},
#{benefitBasicPlan},
#{benefitOccupationCategory},
#{benefitElEmployeeNumberT},
#{tricycleFrameNumber},
#{policyNo},
#{status},
#{type},
#{orgCode},
#{userId},
#{applicantEmployeeList},
#{policyId})
</insert>
<insert id="saveSelective" parameterType="cn.timer.api.bean.insure.InsureUser" useGeneratedKeys="true"
keyProperty="id">
insert into insure_user
(
<if test="transId != null">,`trans_id`</if>
<if test="price != null">,`price`</if>
<if test="insuredName != null">,`insured_name`</if>
<if test="batchNo != null">,`batch_no`</if>
<if test="premium != null">,`premium`</if>
<if test="insuredMobile != null">,`insured_mobile`</if>
<if test="insuredNo != null">,`insured_no`</if>
<if test="insuredEContact != null">,`insured_e_contact`</if>
<if test="benefitBasicPlan != null">,`benefit_basic_plan`</if>
<if test="benefitOccupationCategory != null">,`benefit_occupation_category`</if>
<if test="benefitElEmployeeNumberT != null">,`benefit_EL_employee_number_t`</if>
<if test="tricycleFrameNumber != null">,`Tricycle_frame_number`</if>
<if test="policyNo != null">,`policy_no`</if>
<if test="status != null">,`status`</if>
<if test="type != null">,`type`</if>
<if test="orgCode != null">,`org_code`</if>
<if test="userId != null">,`user_id`</if>
<if test="applicantEmployeeList != null">,`applicant_employee_list`</if>
<if test="insureStatus != null">,`insure_status`</if>
<if test="policyId != null">,`policy_id`</if>
)
values
(
<if test="transId != null">,#{transId}</if>
<if test="price != null">,#{price}</if>
<if test="insuredName != null">,#{insuredName}</if>
<if test="batchNo != null">,#{batchNo}</if>
<if test="premium != null">,#{premium}</if>
<if test="insuredMobile != null">,#{insuredMobile}</if>
<if test="insuredNo != null">,#{insuredNo}</if>
<if test="insuredEContact != null">,#{insuredEContact}</if>
<if test="benefitBasicPlan != null">,#{benefitBasicPlan}</if>
<if test="benefitOccupationCategory != null">,#{benefitOccupationCategory}</if>
<if test="benefitElEmployeeNumberT != null">,#{benefitElEmployeeNumberT}</if>
<if test="tricycleFrameNumber != null">,#{tricycleFrameNumber}</if>
<if test="policyNo != null">,#{policyNo}</if>
<if test="status != null">,#{status}</if>
<if test="type != null">,#{type}</if>
<if test="orgCode != null">,#{orgCode}</if>
<if test="userId != null">,#{userId}</if>
<if test="applicantEmployeeList != null">,#{applicantEmployeeList}</if>
<if test="insureStatus != null">,#{insureStatus}</if>
<if test="policyId != null">,#{policyId}</if>
)
</insert>
<insert id="saveList" parameterType="cn.timer.api.bean.insure.InsureUser" useGeneratedKeys="true" keyProperty="id">
insert into insure_user
(
`trans_id`,
`price`,
`insured_name`,
`batch_no`,
`premium`,
`insured_mobile`,
`insured_no`,
`insured_e_contact`,
`benefit_basic_plan`,
`benefit_occupation_category`,
`benefit_EL_employee_number_t`,
`Tricycle_frame_number`,
`policy_no`,
`status`,
`type`,
`org_code`,
`user_id`,
`applicant_employee_list`,
`insure_status`,
`policy_id`
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.transId},
#{item.price},
#{item.insuredName},
#{item.batchNo},
#{item.premium},
#{item.insuredMobile},
#{item.insuredNo},
#{item.insuredEContact},
#{item.benefitBasicPlan},
#{item.benefitOccupationCategory},
#{item.benefitElEmployeeNumberT},
#{item.tricycleFrameNumber},
#{item.policyNo},
#{item.status},
#{item.type},
#{item.orgCode},
#{item.userId},
#{item.applicantEmployeeList},
#{item.insureStatus},
#{item.policyId}
)
</foreach>
</insert>
<delete id="deleteBatch">
delete from insure_user where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectPolicyList" resultType="cn.timer.api.dto.insure.PolicyDto">
select
iu.id,yme.`name`,yme.zj_type,yme.zj_num,iu.policy_no,iu.`status`,ip.scheme_name,iu.policy_date_start,iu.insure_status,
iu.policy_date_end,ip.create_time,iu.insured_name,iu.benefit_basic_plan AS benefitBasicPlan,iu.price AS price,
iu.user_id as userId,iu.batch_no as batchNo,iu.benefit_occupation_category as benefitOccupationCategory
from insure_user iu
LEFT JOIN yggl_main_emp yme on yme.id=iu.user_id
LEFT JOIN insure_policy ip on ip.id=iu.policy_id
<where>
<if test="policyDto.orgCode !=null and policyDto.orgCode !=''">
and ip.org_code=#{policyDto.orgCode}
</if>
<if test="policyDto.id !=null and policyDto.id !=''">
and ip.id=#{policyDto.id}
</if>
<if test="policyDto.planId !=null and policyDto.planId !=''">
and iu.benefit_basic_plan = #{policyDto.planId}
</if>
<if test="policyDto.categoryId !=null and policyDto.categoryId !=''">
and iu.benefit_occupation_category = #{policyDto.categoryId}
</if>
<if test="policyDto.name !=null and policyDto.name !=''">
and iu.insured_e_contact like CONCAT('%',#{policyDto.name},'%')
</if>
<if test="policyDto.policyDateStart !=null and policyDto.policyDateStart !=''">
and iu.policy_date_start <![CDATA[>=]]> #{policyDto.policyDateStart}
</if>
<if test="policyDto.policyDateEnd !=null and policyDto.policyDateEnd !=''">
and iu.policy_date_end <![CDATA[<=]]> #{policyDto.policyDateEnd}
</if>
<if test="policyDto.status !=null and policyDto.status !=''">
and iu.insure_status = #{policyDto.status}
</if>
</where>
<if test="policyDto.page.offset != null and policyDto.page.totalPage !=null">
LIMIT #{policyDto.page.offset},#{policyDto.page.totalPage}
</if>
</select>
<select id="totalUser" resultType="java.lang.Integer">
select count(iu.id) from insure_user iu
LEFT JOIN yggl_main_emp yme on yme.id=iu.user_id
LEFT JOIN insure_policy ip on ip.id=iu.policy_id
<where>
<if test="policyDto.orgCode !=null and policyDto.orgCode !=''">
and ip.org_code=#{policyDto.orgCode}
</if>
<if test="policyDto.id !=null and policyDto.id !=''">
and ip.id=#{policyDto.id}
</if>
<if test="policyDto.planId !=null and policyDto.planId !=''">
and iu.benefit_basic_plan = #{policyDto.planId}
</if>
<if test="policyDto.categoryId !=null and policyDto.categoryId !=''">
and iu.benefit_occupation_category = #{policyDto.categoryId}
</if>
<if test="policyDto.name !=null and policyDto.name !=''">
and iu.insured_e_contact like CONCAT('%',#{policyDto.name},'%')
</if>
<if test="policyDto.policyDateStart !=null and policyDto.policyDateStart !=''">
and iu.policy_date_start <![CDATA[>=]]> #{policyDto.policyDateStart}
</if>
</where>
</select>
<!--根据id数组查询员工-->
<select id="selectListByIds" resultType="cn.timer.api.bean.insure.InsureUser">
SELECT
*
FROM insure_user
WHERE id IN
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<!--根据id数组查询员工-->
<select id="selectPlansListByIds" resultType="cn.timer.api.dto.insure.InsureUserDto">
SELECT
policy_id as policyId,
benefit_basic_plan as benefitBasicPlan,
benefit_occupation_category as benefitOccupationCategory,
count(id) as totalUser
FROM insure_user
WHERE id IN
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
group by benefit_basic_plan,benefit_occupation_category
</select>
<select id="selectPlansListById" resultType="cn.timer.api.dto.insure.InsureUserDto">
SELECT policy_id as policyId,
benefit_basic_plan as benefitBasicPlan,
benefit_occupation_category as benefitOccupationCategory,
count(id) as totalUser
FROM insure_user
WHERE policy_id = #{policyId}
group by benefit_basic_plan, benefit_occupation_category
</select>
</mapper>
......@@ -53,7 +53,7 @@
attest_time
</sql>
<!--
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.qyzx.QyzxEntInfoM">
INSERT INTO qyzx_ent_info_m
......@@ -199,5 +199,37 @@
</select>
-->
<select id="companyAdminList" resultType="cn.timer.api.dto.qyzx.EntInfoDto">
SELECT
qeim.id AS id,
qeim.logo_url AS logoUrl,
qeim.NAME AS NAME,
qeim.link_man AS linkMan,
qeim.phone AS linkManPhone,
qeim.area_name AS areaName,
count( yme.id ) AS totalNum,
qeim.register_time AS registerTime,
qeim.end_time AS endTime,
IFNULL(a.totlaSpmk,0) as totlaSpmk,
IFNULL(b.totlaCc,0) as totlaCc
FROM
qyzx_ent_info_m qeim
LEFT JOIN yggl_main_emp yme ON yme.org_code = qeim.id
LEFT JOIN ( SELECT sas.org_code AS oid, count( sas.id ) AS totlaSpmk FROM spmk_approve_summary sas GROUP BY sas.org_code ) AS a ON a.oid = qeim.id
LEFT JOIN ( SELECT cc.organization_id AS oid, count( cc.id ) AS totlaCc FROM cms_content cc GROUP BY cc.organization_id ) AS b ON b.oid = qeim.id
GROUP BY
qeim.id
<if test="page.offset != null and page.totalPage !=null">
limit #{page.offset},#{page.totalPage}
</if>
</select>
<select id="companyAdminCount" resultType="java.lang.Integer">
select count(qeim.id) from qyzx_ent_info_m qeim
</select>
<select id ="getCompanyList" resultType="java.util.HashMap">
select id as value , name as label from qyzx_ent_info_m
</select>
</mapper>
\ No newline at end of file
</mapper>
......@@ -49,14 +49,15 @@
<result column="bmgw_id" property="bmgwId" />
<result column="bmgw_name" property="bmgwName" />
<result column="custom_num" property="customNum" />
<result column="org_code" property="orgCode" />
<result column="unionid" property="unionid" />
<result column="openid" property="openid" />
<result column="mpopenid" property="mpopenid" />
<result column="appopenid" property="appopenid" />
<result column="is_insure" property="isInsure"/>
</resultMap>
<resultMap id="Bintu" type="cn.timer.api.dto.yggl.YgbintuDto" >
<id column="id" property="id" />
<result column="age" property="age" />
......@@ -68,7 +69,7 @@
<result column="jobStatus" property="jobStatus" />
<result column="workage" property="workage" />
</resultMap>
<resultMap id="DepartmentStaffMap" type="cn.timer.api.dto.zzgl.DepartmentStaffDto" >
<id column="id" property="id" />
<result column="empNum" property="empNum" />
......@@ -126,9 +127,10 @@
openid,
mpopenid,
appopenid,
custom_num
custom_num,
is_insure
</sql>
<sql id="Base_Column_List_a">
a.id,
a.emp_num,
......@@ -148,37 +150,38 @@
a.zj_num,
a.syq,
a.zz_time,
a.custom_num
a.custom_num,
a.is_insure
</sql>
<!-- rsybp人事仪表盘 -->
<select id="rsybp" resultMap="Bintu">
SELECT e.id AS id,IFNULL(e.age,0) AS age,IFNULL(e.bmgw_id,0) AS bmgwId,IFNULL(b.`name`,'null') AS gw,
IFNULL(bb.`name`,'null') AS bm,IFNULL( p.`name`,'null') AS proname,IFNULL(d.`name` ,'null')AS eduname,
IFNULL(e.job_status,0) AS jobStatus,IFNULL(datediff(CURDATE(),e.rz_time),0)AS workage
FROM yggl_main_emp e
LEFT JOIN zzgl_bmgw_m b ON b.id = e.bmgw_id
FROM yggl_main_emp e
LEFT JOIN zzgl_bmgw_m b ON b.id = e.bmgw_id
LEFT JOIN zzgl_bmgw_m bb ON bb.id = b.up_id
LEFT JOIN province_class p ON left (e.`jg`,2) = p.province
LEFT JOIN education_class d ON d.number = e.edu
WHERE e.org_code = #{orgCode}
</select>
<select id="DepartmentStaff" resultMap="DepartmentStaffMap">
select em.emp_num as empNum,
em.`name` as empname,
bm.`name` as bmgwname,
em.phone
from yggl_main_emp em
em.phone
from yggl_main_emp em
LEFT JOIN zzgl_bmgw_m as bm on bm.id = em.bmgw_id
where em.org_code = #{orgcode}
and em.bmgw_id in (select bm.id from zzgl_bmgw_m bm
WHERE bm.up_id = #{upid})
</select>
<select id="selectME" resultMap="BaseResultMap">
SELECT
SELECT
<include refid="Base_Column_List_a" />,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = a.bmgw_id limit 1) limit 1) as bmgw_name
FROM yggl_main_emp a
......@@ -205,7 +208,7 @@
<foreach item="it" index="index" collection="param.empNums" separator="," close="" >
#{it}
</foreach>
)
)
</when>
<otherwise>
AND a.emp_num = #{param.empNums[0]}
......@@ -214,20 +217,21 @@
</if>
</where>
</select>
<!-- benyueLz本月离职人数 -->
<select id="benyueLz" resultType="Integer">
SELECT COUNT(datediff(CURDATE(),l.sjlz_time)) FROM yggl_main_lzb l WHERE datediff(CURDATE(),l.sjlz_time) <![CDATA[ <= ]]> 30 AND org_code = #{orgCode};
</select>
<!-- benyueZz本月转正人数 -->
<select id="benyueZz" resultType="Integer">
SELECT COUNT(datediff(CURDATE(),e.sjzz_time)) FROM yggl_main_emp e WHERE datediff(CURDATE(),e.sjzz_time) <![CDATA[ <= ]]> 30 AND org_code = #{orgCode};
</select>
<!-- 查询员工信息 搜索 分页 -->
<select id="queryEmpMessage" resultType="cn.timer.api.dto.yggl.YgQueryDto">
SELECT
a.id,
a.name empName,
a.emp_num empNum,
b.name deptName,
......@@ -236,7 +240,8 @@
a.phone phone,
a.job_status jobStatus,
a.head_url headUrl,
a.sex sex
a.sex sex,
a.is_insure isInsure
FROM
yggl_main_emp a
LEFT JOIN zzgl_bmgw_m b ON a.bmgw_id = b.id
......@@ -244,44 +249,47 @@
a.org_code = #{orgCode}
AND
a.job_status in (0,1,2)
<if test="isInsure!=null and isInsure != ''">
AND a.is_insure in (1,2)
</if>
ORDER BY
emp_num DESC
</select>
<!-- 查询在职员工(试用员工人数+正式员工人数) -->
<select id="queryInservice" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
SUM(job_status=1) AS probation,
SUM(job_status=2) AS regular
FROM
FROM
yggl_main_emp
WHERE
org_code=#{orgCode}
</select>
<!-- 查询当月入职人数 -->
<select id="queryInduction" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
EXTRACT(MONTH FROM rz_time) AS month,
COUNT(emp_num) induction
FROM
FROM
yggl_main_emp
WHERE
org_code=#{orgCode}
</select>
<!-- 查询本月转正人数 -->
<select id="queryPositive" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
EXTRACT(MONTH FROM sjzz_time) AS month,
COUNT(emp_num) positive
FROM
COUNT(emp_num) positive
FROM
yggl_main_emp
WHERE
org_code=#{orgCode}
</select>
<!-- 查询员工平均年龄 -->
<select id="queryAvgAge" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
......@@ -291,7 +299,7 @@
WHERE
org_code=#{orgCode}
</select>
<!-- 查询岗位上级部门id及名称及人数 -->
<select id="queryDepartmentNum" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
......@@ -308,7 +316,7 @@
c.name,
b.up_id
</select>
<!-- 查询岗位名称及人数 -->
<select id="queryJobsNum" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
......@@ -324,7 +332,7 @@
y.bmgw_id,
b.name;
</select>
<!-- 学历及人数查询 -->
<select id="queryEducation" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
......@@ -342,24 +350,24 @@
ORDER BY
e.id ASC
</select>
<!-- 员工年龄分布查询 -->
<select id="queryEmpAge" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
<![CDATA[
SELECT
SELECT
SUM((CASE WHEN age < 0.5 THEN 1 ELSE 0 END)) AS lowerEighteen,
SUM((CASE WHEN age >= 18 AND age < 25 THEN 1 ELSE 0 END)) AS eighteenToTwentyfive,
SUM((CASE WHEN age >= 25 AND age < 32 THEN 1 ELSE 0 END)) AS twentyfiveToThirtytwo,
SUM((CASE WHEN age >= 32 AND age < 38 THEN 1 ELSE 0 END)) AS thirtytwoToThirtyeight,
SUM((CASE WHEN age >= 38 AND age < 45 THEN 1 ELSE 0 END)) AS thirtyeightToFortyfive,
SUM((CASE WHEN age >=45 THEN 1 ELSE 0 END)) AS higherFortyfive
FROM
FROM
yggl_main_emp
WHERE
org_code = #{orgCode}
]]>
</select>
<!-- 籍贯统计(省份)查询 -->
<select id="queryNativeplace" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
......@@ -375,22 +383,33 @@
GROUP BY
c.city_name
</select>
<!-- 员工工龄分布查询 -->
<select id="queryWorkingAge" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
<![CDATA[
SELECT
SELECT
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 < 0.5 THEN 1 ELSE 0 END)) AS lowerHalfyear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 0.5 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 1 THEN 1 ELSE 0 END)) AS halfYear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 1 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 1.5 THEN 1 ELSE 0 END)) AS oneYear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 1.5 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 2 THEN 1 ELSE 0 END)) AS onehalfYear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 2 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 2.5 THEN 1 ELSE 0 END)) AS twoYear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >=2.5 THEN 1 ELSE 0 END)) AS higherTwohalfYear
FROM
FROM
yggl_main_emp
WHERE
org_code = #{orgCode}
]]>
</select>
</mapper>
\ No newline at end of file
<!--根据id数组查询员工-->
<select id="selectListByIds" resultType="cn.timer.api.bean.yggl.YgglMainEmp">
SELECT
<include refid="Base_Column_List"/>
FROM yggl_main_emp
WHERE id IN
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment