diff --git a/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExAnswers.java b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExAnswers.java
new file mode 100644
index 0000000..1491c29
--- /dev/null
+++ b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExAnswers.java
@@ -0,0 +1,59 @@
+package com.ccic.safeliab.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("ex_answers")
+public class ExAnswers extends BaseEntity implements Serializable {
+
+ /**
+ * ID
+ */
+ @TableId(value = "id", type = IdType.ID_WORKER)
+ @JsonFormat(shape = JsonFormat.Shape.STRING)
+ private Long id;
+
+ /**
+ * 用户ID
+ */
+ @JsonFormat(shape = JsonFormat.Shape.STRING)
+ private Long userId;
+
+ /**
+ * 试卷ID
+ */
+ @JsonFormat(shape = JsonFormat.Shape.STRING)
+ private Long paperId;
+
+ /**
+ * 考试ID
+ */
+ @JsonFormat(shape = JsonFormat.Shape.STRING)
+ private Long examId;
+
+ /**
+ * 题目ID
+ */
+ @JsonFormat(shape = JsonFormat.Shape.STRING)
+ private Long questionId;
+
+ /**
+ * 用户选择的答案
+ */
+ private String selectedAnswer;
+
+ /**
+ * 是否正确
+ */
+ private Integer isCorrect;
+}
diff --git a/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExExamInfo.java b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExExamInfo.java
new file mode 100644
index 0000000..edea484
--- /dev/null
+++ b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExExamInfo.java
@@ -0,0 +1,66 @@
+package com.ccic.safeliab.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("ex_exam_info")
+public class ExExamInfo extends BaseEntity implements Serializable {
+
+ /**
+ * ID
+ */
+ @TableId(value = "id", type = IdType.ID_WORKER)
+ @JsonFormat(shape = JsonFormat.Shape.STRING)
+ private Long id;
+
+ /**
+ * 考试名称
+ */
+ private String examName;
+
+ /**
+ * 试卷ID
+ */
+ private Long paperId;
+
+ /**
+ * 监管行业ID
+ */
+ private Long industryId;
+
+ /**
+ * 考试区域
+ */
+ private String examRegion;
+
+ /**
+ * 考试有效时间
+ */
+ private String validFrom;
+
+ /**
+ * 考试失效时间
+ */
+ private String validTo;
+
+ /**
+ * 发布状态
+ */
+ private Integer publishStatus;
+
+ /**
+ * 内容描述
+ */
+ private String remark;
+
+}
diff --git a/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExExamScoures.java b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExExamScoures.java
new file mode 100644
index 0000000..245e448
--- /dev/null
+++ b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExExamScoures.java
@@ -0,0 +1,53 @@
+package com.ccic.safeliab.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("ex_exam_scores")
+public class ExExamScoures extends BaseEntity implements Serializable {
+
+ /**
+ * ID
+ */
+ @TableId(value = "id", type = IdType.ID_WORKER)
+ @JsonFormat(shape = JsonFormat.Shape.STRING)
+ private Long id;
+
+ /**
+ * 用户ID
+ */
+ @JsonFormat(shape = JsonFormat.Shape.STRING)
+ private Long userId;
+
+ /**
+ * 试卷ID
+ */
+ @JsonFormat(shape = JsonFormat.Shape.STRING)
+ private Long paperId;
+
+ /**
+ * 考试ID
+ */
+ @JsonFormat(shape = JsonFormat.Shape.STRING)
+ private Long examId;
+
+ /**
+ * 总分
+ */
+ private Integer totalScore;
+
+ /**
+ * 考试用时
+ */
+ private Integer examTimeSpent;
+}
diff --git a/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExOpenUser.java b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExOpenUser.java
new file mode 100644
index 0000000..6a625c5
--- /dev/null
+++ b/ccic-entity/src/main/java/com/ccic/safeliab/entity/ExOpenUser.java
@@ -0,0 +1,51 @@
+package com.ccic.safeliab.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("ex_open_user")
+public class ExOpenUser extends BaseEntity implements Serializable {
+
+ /**
+ * ID
+ */
+ @TableId(value = "id", type = IdType.ID_WORKER)
+ @JsonFormat(shape = JsonFormat.Shape.STRING)
+ private Long id;
+
+ /**
+ * 小程序唯一标识
+ */
+ private String openid;
+
+ /**
+ * 用户昵称
+ */
+ private String nickname;
+
+ /**
+ * 用户头像URL
+ */
+ private String avatarUrl;
+
+ /**
+ * 用户性别
+ */
+ private Integer gender;
+
+ /**
+ * 用户电话
+ */
+ private String phoneNumber;
+
+}
diff --git a/ccic-exam/pom.xml b/ccic-exam/pom.xml
index 2cce39f..7f62376 100644
--- a/ccic-exam/pom.xml
+++ b/ccic-exam/pom.xml
@@ -182,6 +182,12 @@
+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *
+ * http://www.apache.org/licenses/LICENSE-2.0 + *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.ccic.safeliab.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ccic.safeliab.entity.ExAnswers;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * Mapper 接口
+ *
+ * @author edwong
+ */
+@Mapper
+public interface AnswersMapper extends BaseMapper
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.ccic.safeliab.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ccic.safeliab.entity.ExExamInfo;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * Mapper 接口
+ *
+ * @author edwong
+ */
+@Mapper
+public interface ExamInfoMapper extends BaseMapper
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.ccic.safeliab.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ccic.safeliab.entity.ExExamScoures;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * Mapper 接口
+ *
+ * @author edwong
+ */
+@Mapper
+public interface ExamScouresMapper extends BaseMapper
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.ccic.safeliab.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ccic.safeliab.entity.ExOpenUser;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * Mapper 接口
+ *
+ * @author edwong
+ */
+@Mapper
+public interface OpenUserMapper extends BaseMapper
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.ccic.safeliab.dao;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ccic.safeliab.excel.ServiceStatExcel;
+import com.ccic.safeliab.vo.ServiceStatVO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * Mapper 接口
+ *
+ * @author edwong
+ */
+@Mapper
+public interface ServiceStatMapper {
+
+ List
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.ccic.safeliab.excel;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * model 保单服务统计
+ *
+ * @author edwong
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class ServiceStatExcel implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @ColumnWidth(23)
+ @ExcelProperty("保单号")
+ private String policyNumber;
+
+ @ColumnWidth(40)
+ @ExcelProperty("归属机构")
+ private String insuranceName;
+
+ @ColumnWidth(23)
+ @ExcelProperty("事故预防状态")
+ private String serviceStatusName;
+
+ @ColumnWidth(20)
+ @ExcelProperty("备注")
+ private String remarks;
+
+}
diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/service/AnswersService.java b/ccic-exam/src/main/java/com/ccic/safeliab/service/AnswersService.java
new file mode 100644
index 0000000..0f76202
--- /dev/null
+++ b/ccic-exam/src/main/java/com/ccic/safeliab/service/AnswersService.java
@@ -0,0 +1,13 @@
+package com.ccic.safeliab.service;
+
+import com.ccic.safeliab.entity.ExAnswers;
+import com.ccic.safeliab.support.BaseService;
+
+/**
+ * 服务类
+ *
+ * @author edwong
+ */
+public interface AnswersService extends BaseService
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.ccic.safeliab.service;
+
+import com.ccic.safeliab.util.R;
+import com.ccic.safeliab.vo.UserAnswersVO;
+
+/**
+ * 服务类
+ *
+ * @author edwong
+ */
+public interface ExamService {
+
+ R findExamPageData(Long examId);
+
+ R saveUserAnswers(UserAnswersVO userAnswersVO);
+
+}
diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamServiceImpl.java b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamServiceImpl.java
new file mode 100644
index 0000000..8462cc8
--- /dev/null
+++ b/ccic-exam/src/main/java/com/ccic/safeliab/service/ExamServiceImpl.java
@@ -0,0 +1,136 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.ccic.safeliab.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.ccic.safeliab.dao.AnswersMapper;
+import com.ccic.safeliab.dao.ExamInfoMapper;
+import com.ccic.safeliab.dao.ExamScouresMapper;
+import com.ccic.safeliab.dao.QuestionMapper;
+import com.ccic.safeliab.entity.ExAnswers;
+import com.ccic.safeliab.entity.ExExamInfo;
+import com.ccic.safeliab.entity.ExExamScoures;
+import com.ccic.safeliab.entity.ExamPapers;
+import com.ccic.safeliab.vo.ExamPageDataVO;
+import com.ccic.safeliab.vo.PageQuestionCategoriesVO;
+import com.ccic.safeliab.vo.UserAnswersVO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import com.ccic.safeliab.util.R;
+
+
+/**
+ * 服务实现类
+ *
+ * @author edwong
+ */
+@Slf4j
+@Service
+public class ExamServiceImpl implements ExamService {
+
+ @Autowired
+ private ExamInfoMapper examInfoMapper;
+
+ @Autowired
+ private QuestionMapper questionCategoriesMapper;
+
+ @Autowired
+ private AnswersService answersService;
+
+ @Autowired
+ private ExamScouresMapper examScouresMapper;
+
+ @Autowired
+ private ExamPaperService paperService;
+
+ @Override
+ public R findExamPageData(Long examId) {
+ QueryWrapper
- * 客户留存表
+ * 客户留存视图
*
+ * 试卷题目视图
+ *
+ * 服务统计视图
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.ccic.safeliab.web;
+
+import com.ccic.safeliab.service.ExamService;
+import com.ccic.safeliab.service.QuestionService;
+import com.ccic.safeliab.util.R;
+import com.ccic.safeliab.vo.UserAnswersVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * 控制器
+ *
+ * @author edwong
+ */
+@RestController
+@RequestMapping("/ex/exam")
+public class ExamController {
+
+
+ @Autowired
+ private ExamService examService;
+
+ @Autowired
+ private QuestionService questionService;
+
+ /**
+ * 获取考试与试卷信息
+ * @param examId
+ * @return
+ */
+ @GetMapping("/findExamPageData")
+ public R findExamPageData(Long examId) {
+ return examService.findExamPageData(examId);
+ }
+
+ /**
+ * 保存用户考试记录
+ * @param userAnswersVO
+ * @return
+ */
+ @PostMapping("/submitUserAnswers")
+ public R submitUserAnswers(@RequestBody UserAnswersVO userAnswersVO) {
+ return examService.saveUserAnswers(userAnswersVO);
+ }
+
+
+}
diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/web/OpenUserController.java b/ccic-exam/src/main/java/com/ccic/safeliab/web/OpenUserController.java
new file mode 100644
index 0000000..08cef63
--- /dev/null
+++ b/ccic-exam/src/main/java/com/ccic/safeliab/web/OpenUserController.java
@@ -0,0 +1,31 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.ccic.safeliab.web;
+
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * 控制器
+ *
+ * @author edwong
+ */
+@RestController
+@RequestMapping("/ex/openUser")
+public class OpenUserController {
+
+
+}
diff --git a/ccic-exam/src/main/java/com/ccic/safeliab/web/StatisticsController.java b/ccic-exam/src/main/java/com/ccic/safeliab/web/StatisticsController.java
index b6f8f09..0f70c6d 100644
--- a/ccic-exam/src/main/java/com/ccic/safeliab/web/StatisticsController.java
+++ b/ccic-exam/src/main/java/com/ccic/safeliab/web/StatisticsController.java
@@ -1,21 +1,31 @@
package com.ccic.safeliab.web;
+import com.alibaba.excel.EasyExcel;
import com.ccic.safeliab.entity.ExCustomerRetention;
+import com.ccic.safeliab.excel.ServiceStatExcel;
import com.ccic.safeliab.service.CustomerRetService;
import com.ccic.safeliab.service.StatisticsService;
import com.ccic.safeliab.util.R;
import com.ccic.safeliab.vo.CustomerRetentionVO;
import com.ccic.safeliab.vo.CustomerVO;
+import com.ccic.safeliab.vo.ServiceStatVO;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.Charsets;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.net.URLEncoder;
import java.util.Date;
+import java.util.List;
/**
* 客户统计控制器
*
* @author edwong
*/
+@Slf4j
@RestController
@RequestMapping("/ex/statistics")
public class StatisticsController {
@@ -27,23 +37,25 @@ public class StatisticsController {
/**
* 分页 客户列表(统计动态看板)
+ *
* @param customer
* @return
*/
@PostMapping("/page")
public R page(@RequestBody CustomerVO customer,
- @RequestParam int page,@RequestParam int num) {
+ @RequestParam int page, @RequestParam int num) {
return R.ok().dataPage(statisticsService.findPage(customer, page, num));
}
/**
* 分页 客户留存
+ *
* @param customerRetention
* @return
*/
@PostMapping("/customerRetPage")
public R customerRetPage(@RequestBody CustomerRetentionVO customerRetention,
- @RequestParam int page,@RequestParam int num) {
+ @RequestParam int page, @RequestParam int num) {
return R.ok().data(customerRetService.findPage(customerRetention, page, num));
}
@@ -56,5 +68,32 @@ public class StatisticsController {
return R.ok().data(customerRetService.save(customerRetention));
}
+ /**
+ * 分页 保单服务统计
+ *
+ * @param serviceStatVO
+ * @return
+ */
+ @PostMapping("/serviceStatPage")
+ public R serviceStatPage(@RequestBody ServiceStatVO serviceStatVO,
+ @RequestParam int page, @RequestParam int num) {
+ return R.ok().data(statisticsService.findServiceStatPage(serviceStatVO, page, num));
+ }
+ /**
+ * 导出 保单服务统计
+ */
+ @GetMapping("exportServiceStatList")
+ public void exportServiceStatList(ServiceStatVO serviceStatVO, HttpServletResponse response) {
+ List