| @@ -57,12 +57,11 @@ public class WxActivityController extends BaseController { | |||||
| wxActivity.setStatus(EnumActivityStatus.STATUS_THROW_IN.getCode()); | wxActivity.setStatus(EnumActivityStatus.STATUS_THROW_IN.getCode()); | ||||
| wxActivity.updateTenantInfo(getTenantInfo()); | wxActivity.updateTenantInfo(getTenantInfo()); | ||||
| try { | try { | ||||
| wxActivityService.saveOrUpdate(wxActivity); | |||||
| return wxActivityService.saveOrUpdate(wxActivity); | |||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | return new ResultData(e.getErrorCode(), e.getMessage()); | ||||
| } | } | ||||
| return new ResultData(); | |||||
| } | } | ||||
| @ApiOperation("根据id更新接口") | @ApiOperation("根据id更新接口") | ||||
| @@ -0,0 +1,51 @@ | |||||
| package com.iformall.controller.market; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.annotation.SystemControllerLog; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.domain.po.WxOpinion; | |||||
| import com.iformall.domain.po.base.BaseEntity; | |||||
| import com.iformall.service.WxOpinionService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| @RestController | |||||
| @RequestMapping("wxOpinion") | |||||
| @Api(description="投诉建议") | |||||
| public class WxOpinionController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxOpinionService wxOpinionService; | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true) | |||||
| }) | |||||
| @SystemControllerLog(description = "投诉建议-列表") | |||||
| public ResultData list(@ModelAttribute WxOpinion record, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxOpinionController::list"); | |||||
| if (null == record) { | |||||
| record = new WxOpinion(); | |||||
| } | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| record.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | |||||
| final PageInfo<WxOpinion> page = wxOpinionService.listAsPage(record, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,121 @@ | |||||
| package com.iformall.controller.market; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.annotation.SystemControllerLog; | |||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.domain.po.WxActivity; | |||||
| import com.iformall.domain.po.WxQuestionOneself; | |||||
| import com.iformall.domain.po.base.BaseEntity; | |||||
| import com.iformall.enums.EnumQuestionOneselfStatus; | |||||
| import com.iformall.exception.MallinkException; | |||||
| import com.iformall.service.WxQuestionOneselfService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | |||||
| @RequestMapping("wxQuestionOneself") | |||||
| @Api(description="问券调查") | |||||
| public class WxQuestionOneselfController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxQuestionOneselfService wxQuestionOneselfService; | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true) | |||||
| }) | |||||
| @SystemControllerLog(description = "问券调查-列表") | |||||
| public ResultData list(@ModelAttribute WxQuestionOneself record, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxQuestionOneselfController::list"); | |||||
| if (null == record) { | |||||
| record = new WxQuestionOneself(); | |||||
| } | |||||
| if (record.getStatus() != null && record.getStatus() == -1) { | |||||
| record.setStatus(null); | |||||
| } | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| record.setSortColumns(BaseEntity.SortField.CreateDate_DESC,BaseEntity.SortField.Sort_DESC); | |||||
| final PageInfo<WxQuestionOneself> page = wxQuestionOneselfService.listAsPage(record, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| @SystemControllerLog(description = "问券调查-新增") | |||||
| public ResultData add(@RequestBody WxQuestionOneself record) { | |||||
| logger.debug("[" + getIpAddr() + "] WxQuestionOneselfController::add"); | |||||
| record.setStatus(EnumQuestionOneselfStatus.STATUS_THROW_IN.getCode()); | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| wxQuestionOneselfService.saveOrUpdate(record); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| @SystemControllerLog(description = "问券调查--更新") | |||||
| public ResultData update(@RequestBody WxQuestionOneself record) { | |||||
| logger.debug("[" + getIpAddr() + "] WxQuestionOneselfController::update"); | |||||
| record.setStatus(EnumQuestionOneselfStatus.STATUS_THROW_IN.getCode()); | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| wxQuestionOneselfService.saveOrUpdate(record); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("updateStatus") | |||||
| @SystemControllerLog(description = "问券调查--更新状态") | |||||
| public ResultData updateStatus(@RequestBody WxQuestionOneself record) { | |||||
| logger.debug("[" + getIpAddr() + "] WxQuestionOneselfController::updateStatus"); | |||||
| if(record == null || record.getStatus() == null || record.getId() == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| if(!record.getStatus().equals(EnumQuestionOneselfStatus.STATUS_TAKE_OFFF.getCode()) | |||||
| || !record.getStatus().equals(EnumQuestionOneselfStatus.INJECT_ONLINE.getCode())) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||||
| } | |||||
| return wxQuestionOneselfService.updateStatus(record); | |||||
| } | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "问券调查--查询") | |||||
| public ResultData findById(Long id) { | |||||
| logger.debug("[" + getIpAddr() + "] WxQuestionOneselfController::findById"); | |||||
| return new ResultData(wxQuestionOneselfService.getById(id)); | |||||
| } | |||||
| @ApiOperation("投放到宣传页") | |||||
| @GetMapping("/sendToCampaign") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "问券调查--投放到宣传页") | |||||
| public ResultData sendToCampaign(Long id) { | |||||
| logger.debug("[" + getIpAddr() + "] WxQuestionOneselfController::sendToCampaign"); | |||||
| return wxQuestionOneselfService.sendToCampaign(id); | |||||
| } | |||||
| @ApiOperation("从宣传页下线") | |||||
| @PostMapping("offLineCampaign") | |||||
| @SystemControllerLog(description = "问券调查--从宣传页下线") | |||||
| public ResultData offLineCampaign(@RequestBody WxQuestionOneself record) { | |||||
| logger.debug("[" + getIpAddr() + "] WxQuestionOneselfController::offLineCampaign"); | |||||
| return wxQuestionOneselfService.offLineCampaign(record); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,154 @@ | |||||
| --加问卷投诉菜单 | |||||
| update mall_permission set resource_type = 0,url = null where id = 607; | |||||
| INSERT INTO `mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (60701, '基础问卷', 607, 'Y', NULL, 1, NULL, NULL, 'questionsettinglist', null, 0, 60701); | |||||
| INSERT INTO `mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (60702, '自建问卷', 607, 'Y', NULL, 1, NULL, NULL, 'questiononeselflist', null, 0, 60702); | |||||
| INSERT INTO `mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (613, '投诉建议', 6, 'Y', NULL, 1, NULL, NULL, 'opinionlist', 'icon-tousu', 0, 613); | |||||
| --销售类型加权限 | |||||
| update mall_sale_type set menus = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 251, 299, 300, 301, 302, 303, 304, 305, 306, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 901, 902, 903, 904, 905, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 60701, 60702]' where id=1; | |||||
| update mall_sale_type set menus = '[1, 2, 4, 5, 6, 7, 8, 9, 10, 50, 101, 102, 103, 104, 105, 106, 107, 201, 202, 203, 204, 205, 209, 211, 212, 221, 222, 251, 409, 410, 411, 416, 418, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 901, 902, 903, 904, 905, 931, 932, 951, 961, 60701, 60702]' where id=2; | |||||
| update mall_sale_type set menus = '[2, 4, 5, 6, 7, 10, 50, 201, 202, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 418, 501, 502, 503, 504, 505, 506, 507, 508, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 621, 622, 623, 624, 625, 626, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 901, 902, 903, 904, 905, 931, 932, 60701, 60702]' where id=3; | |||||
| update mall_sale_type set menus = '[2, 4, 5, 6, 7, 10, 50, 201, 202, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 418, 501, 502, 503, 504, 505, 506, 507, 508, 511, 512, 513, 514, 521, 522, 523, 531, 532, 591, 601, 602, 604, 605, 606, 607, 608, 610, 611, 612, 613, 622, 623, 624, 625, 626, 641, 642, 643, 644, 661, 662, 663, 664, 671, 672, 674, 675, 681, 682, 684, 685, 686, 691, 692, 693, 694, 695, 711, 901, 902, 904, 905, 931, 932, 60701, 60702]' where id=4; | |||||
| --所有广场管理员角色加权限 | |||||
| INSERT INTO `mall_role_permission`(`id`, `tenant_id`, `parent_tenant_id`, `permission_id`, `role_id`) | |||||
| select CEILING(RAND()*90000000000+10000000000) ,mui.tenant_id,mui.parent_tenant_id, 613,mur.role_id | |||||
| from mall_user_info mui | |||||
| left join mall_user_role mur on mui.id = mur.uid | |||||
| where mui.is_admin = 1 and mur.role_id is not null GROUP BY mur.role_id; | |||||
| INSERT INTO `mall_role_permission`(`id`, `tenant_id`, `parent_tenant_id`, `permission_id`, `role_id`) | |||||
| select CEILING(RAND()*90000000000+10000000000) ,mui.tenant_id,mui.parent_tenant_id, 60701,mur.role_id | |||||
| from mall_user_info mui | |||||
| left join mall_user_role mur on mui.id = mur.uid | |||||
| where mui.is_admin = 1 and mur.role_id is not null GROUP BY mur.role_id; | |||||
| INSERT INTO `mall_role_permission`(`id`, `tenant_id`, `parent_tenant_id`, `permission_id`, `role_id`) | |||||
| select CEILING(RAND()*90000000000+10000000000) ,mui.tenant_id,mui.parent_tenant_id, 60702,mur.role_id | |||||
| from mall_user_info mui | |||||
| left join mall_user_role mur on mui.id = mur.uid | |||||
| where mui.is_admin = 1 and mur.role_id is not null GROUP BY mur.role_id; | |||||
| /* | |||||
| Navicat Premium Data Transfer | |||||
| Source Server : 101.200.130.134 | |||||
| Source Server Type : MySQL | |||||
| Source Server Version : 50728 | |||||
| Source Host : 101.200.130.134:3306 | |||||
| Source Schema : mallink | |||||
| Target Server Type : MySQL | |||||
| Target Server Version : 50728 | |||||
| File Encoding : 65001 | |||||
| Date: 26/03/2021 15:21:46 | |||||
| */ | |||||
| -- ---------------------------- | |||||
| -- Table structure for wx_question_oneself | |||||
| -- ---------------------------- | |||||
| CREATE TABLE `wx_question_oneself` ( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '租户ID', | |||||
| `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID', | |||||
| `logo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'logo', | |||||
| `top_pic` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头图', | |||||
| `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名称', | |||||
| `top_desc` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '问卷头部描述', | |||||
| `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态(0:保存1:上线2:下线)', | |||||
| `start_date` datetime(0) DEFAULT NULL COMMENT '问卷开始时间', | |||||
| `end_date` datetime(0) DEFAULT NULL COMMENT '问卷结束时间', | |||||
| `reward_credit` int(11) NOT NULL DEFAULT 0 COMMENT '奖励积分', | |||||
| `create_date` datetime(0) NOT NULL COMMENT '创建时间', | |||||
| `update_date` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间', | |||||
| `sort` int(11) NOT NULL DEFAULT 1 COMMENT '排序', | |||||
| `del_status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '删除标记(0:已删除1:未删除)', | |||||
| `qr_code` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '二维码', | |||||
| `count_topic` int(11) NOT NULL DEFAULT 0 COMMENT '题目数量', | |||||
| `count_user` int(11) NOT NULL DEFAULT 0 COMMENT '参与人数', | |||||
| PRIMARY KEY (`id`) USING BTREE | |||||
| ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; | |||||
| -- ---------------------------- | |||||
| -- Table structure for wx_question_oneself_log | |||||
| -- ---------------------------- | |||||
| CREATE TABLE `wx_question_oneself_log` ( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '租户ID', | |||||
| `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID', | |||||
| `wqou_id` bigint(20) DEFAULT NULL COMMENT 'wx_question_oneself_user_id', | |||||
| `topic_id` bigint(20) NOT NULL COMMENT '问题id', | |||||
| `topic_title` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '问题', | |||||
| `answer` json COMMENT '答案id(目前为答案对应的标签id)', | |||||
| `answer_str` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '答案', | |||||
| `create_date` datetime(0) NOT NULL, | |||||
| `update_date` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), | |||||
| PRIMARY KEY (`id`) USING BTREE | |||||
| ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; | |||||
| -- ---------------------------- | |||||
| -- Table structure for wx_question_oneself_topic | |||||
| -- ---------------------------- | |||||
| CREATE TABLE `wx_question_oneself_topic` ( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '租户ID', | |||||
| `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID', | |||||
| `question_id` bigint(20) NOT NULL COMMENT '问卷Id', | |||||
| `title` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '题目标题', | |||||
| `answer` json NOT NULL, | |||||
| `type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '类型(1:单选,2:多选)', | |||||
| `del_status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '删除标记(0:已删除1:未删除)', | |||||
| `sort` int(11) NOT NULL COMMENT '排序', | |||||
| `create_date` datetime(0) NOT NULL COMMENT '创建时间', | |||||
| `update_date` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间', | |||||
| PRIMARY KEY (`id`) USING BTREE | |||||
| ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; | |||||
| -- ---------------------------- | |||||
| -- Table structure for wx_question_oneself_user | |||||
| -- ---------------------------- | |||||
| CREATE TABLE `wx_question_oneself_user` ( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '租户ID', | |||||
| `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID', | |||||
| `user_id` bigint(20) DEFAULT NULL COMMENT '会员用户id', | |||||
| `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, | |||||
| `user_sex` tinyint(1) DEFAULT 0 COMMENT '性别:0:保密 1.男 2女', | |||||
| `user_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, | |||||
| `question_id` bigint(20) NOT NULL COMMENT '问卷Id', | |||||
| `create_date` datetime(0) NOT NULL, | |||||
| `update_date` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), | |||||
| PRIMARY KEY (`id`) USING BTREE | |||||
| ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; | |||||
| -- ---------------------------- | |||||
| -- Table structure for wx_opinion | |||||
| -- ---------------------------- | |||||
| CREATE TABLE `wx_opinion` ( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键', | |||||
| `tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '租户ID', | |||||
| `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID', | |||||
| `user_id` bigint(20) DEFAULT NULL COMMENT '会员用户id', | |||||
| `liaison_man` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '联系人', | |||||
| `liaison_sex` tinyint(1) DEFAULT 0 COMMENT '性别:0:保密 1.男 2女', | |||||
| `liaison_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '联系电话', | |||||
| `liaison_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '联系邮箱', | |||||
| `pictures` json COMMENT '图片数组', | |||||
| `explains` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '说明', | |||||
| `remark` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', | |||||
| `handle_status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '处理状态1:未处理,2已处理', | |||||
| `handle_id` bigint(20) DEFAULT NULL, | |||||
| `create_date` datetime(0) NOT NULL COMMENT '创建时间', | |||||
| `update_date` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间', | |||||
| `del_status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '删除标记0:删除1:未删除', | |||||
| PRIMARY KEY (`id`) USING BTREE | |||||
| ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; | |||||
| @@ -0,0 +1,48 @@ | |||||
| package com.iformall.controller; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxOpinion; | |||||
| import com.iformall.domain.po.base.BaseEntity; | |||||
| import com.iformall.service.WxOpinionService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| @RestController | |||||
| @RequestMapping("wxOpinion") | |||||
| @Api(description="投诉建议") | |||||
| public class WxOpinionController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxOpinionService wxOpinionService; | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true) | |||||
| }) | |||||
| public ResultData list(@ModelAttribute WxOpinion record, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxOpinionController::list"); | |||||
| if (null == record) { | |||||
| record = new WxOpinion(); | |||||
| } | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| record.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | |||||
| final PageInfo<WxOpinion> page = wxOpinionService.listAsPage(record, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,52 @@ | |||||
| package com.iformall.controller; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxQuestionOneself; | |||||
| import com.iformall.domain.po.base.BaseEntity; | |||||
| import com.iformall.enums.EnumQuestionOneselfStatus; | |||||
| import com.iformall.service.WxQuestionOneselfService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| @RestController | |||||
| @RequestMapping("wxQuestionOneself") | |||||
| @Api(description="问券调查") | |||||
| public class WxQuestionOneselfController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxQuestionOneselfService wxQuestionOneselfService; | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true) | |||||
| }) | |||||
| public ResultData list(@ModelAttribute WxQuestionOneself record, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxQuestionOneselfController::list"); | |||||
| if (null == record) { | |||||
| record = new WxQuestionOneself(); | |||||
| } | |||||
| record.setStatus(EnumQuestionOneselfStatus.INJECT_ONLINES.getCode()); | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| record.setSortColumns(BaseEntity.SortField.CreateDate_DESC,BaseEntity.SortField.Sort_DESC); | |||||
| final PageInfo<WxQuestionOneself> page = wxQuestionOneselfService.listAsPage(record, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| } | |||||
| @@ -586,6 +586,15 @@ public enum ErrorCode{ | |||||
| FLOATING_LAYER_FOUND(60001, "首页广告已存在,请先下线再重新投放"), | FLOATING_LAYER_FOUND(60001, "首页广告已存在,请先下线再重新投放"), | ||||
| /** | |||||
| * 问券调查 | |||||
| */ | |||||
| QUESTION_NOT_FOUND(61001, "问卷未找到"), | |||||
| QUESTION_NOT_LINE(61002, "投放到宣传页失败,问卷未上线!"), | |||||
| QUESTION_SENDUP_ERROR(61003, "投放到宣传页失败,宣传页显示已达七条上限!"), | |||||
| QUESTION_NOT_INTO(61004, "取消投放失败,不是投放状态"), | |||||
| ; | ; | ||||
| private int code; | private int code; | ||||
| @@ -0,0 +1,63 @@ | |||||
| package com.iformall.domain.po; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import java.util.Date; | |||||
| @TableName(value = "wx_opinion") | |||||
| @Data | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxOpinion extends TenantEntity { | |||||
| protected Long id; | |||||
| @TableField(exist = false) | |||||
| private Date startDate; | |||||
| @TableField(exist = false) | |||||
| private Date endDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="userId",name="userId") | |||||
| private Long userId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="liaisonMan") | |||||
| private String liaisonMan; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "性别:0:保密 1.男 2女", name = "liaisonSex") | |||||
| private Integer liaisonSex; | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="liaisonPhone") | |||||
| private String liaisonPhone; | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="liaisonEmail") | |||||
| private String liaisonEmail; | |||||
| @io.swagger.annotations.ApiModelProperty(value="图片数组",name="pictures") | |||||
| private String pictures; | |||||
| @io.swagger.annotations.ApiModelProperty(value="说明",name="explains") | |||||
| private String explains; | |||||
| @io.swagger.annotations.ApiModelProperty(value="备注",name="remark") | |||||
| private String remark; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "处理状态1:未处理,2已处理", name = "handleStatus") | |||||
| private Integer handleStatus; | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="handleId") | |||||
| private Long handleId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||||
| private Date createDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="修改时间",name="updateDate") | |||||
| private Date updateDate; | |||||
| } | |||||
| @@ -0,0 +1,89 @@ | |||||
| package com.iformall.domain.po; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.utils.Constant; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import java.util.Date; | |||||
| @TableName(value = "wx_question_oneself") | |||||
| @Data | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxQuestionOneself extends TenantEntity { | |||||
| protected Long id; | |||||
| @io.swagger.annotations.ApiModelProperty(value="logo",name="logo") | |||||
| private String logo; | |||||
| @io.swagger.annotations.ApiModelProperty(value="头图",name="topPic") | |||||
| private String topPic; | |||||
| @io.swagger.annotations.ApiModelProperty(value="名称",name="title") | |||||
| private String title; | |||||
| @io.swagger.annotations.ApiModelProperty(value="描述",name="topDesc") | |||||
| private String topDesc; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "EnumQuestionOneselfStatus", name = "status") | |||||
| private Integer status; | |||||
| @io.swagger.annotations.ApiModelProperty(value="开始时间",name="startDate") | |||||
| private Date startDate; | |||||
| @TableField(exist = false) | |||||
| private Date startStartdate; | |||||
| @TableField(exist = false) | |||||
| private Date startEnddate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endDate") | |||||
| private Date endDate; | |||||
| @TableField(exist = false) | |||||
| private Date endStartdate; | |||||
| @TableField(exist = false) | |||||
| private Date endEnddate; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "奖励积分", name = "rewardCredit") | |||||
| private Integer rewardCredit; | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||||
| private Date createDate; | |||||
| @TableField(exist = false) | |||||
| private Date createStartdate; | |||||
| @TableField(exist = false) | |||||
| private Date createEnddate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="修改时间",name="updateDate") | |||||
| private Date updateDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "排序", name = "sort") | |||||
| private Integer sort; | |||||
| @io.swagger.annotations.ApiModelProperty(value="二维码",name="qrCode") | |||||
| private String qrCode; | |||||
| @io.swagger.annotations.ApiModelProperty(value="题目数",name="countTopic") | |||||
| private Integer countTopic; | |||||
| @io.swagger.annotations.ApiModelProperty(value="题目总分数",name="countUser") | |||||
| private Integer countUser; | |||||
| @TableField(exist = false) | |||||
| @io.swagger.annotations.ApiModelProperty(value = "小程序路径", name = "weappPath") | |||||
| protected String weappPath; | |||||
| @TableField(exist = false) | |||||
| @io.swagger.annotations.ApiModelProperty(value = "二维码", name = "weappSceneForJoin") | |||||
| protected String weappSceneForJoin; | |||||
| public String getWeappPath() { | |||||
| return Constant.mainPageUrl + "?type=wj&id=" + id; | |||||
| } | |||||
| public String getWeappSceneForJoin() { | |||||
| return "t:wj:" + id; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,46 @@ | |||||
| package com.iformall.domain.po; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import java.util.Date; | |||||
| @TableName(value = "wx_question_oneself_log") | |||||
| @Data | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxQuestionOneselfLog extends TenantEntity { | |||||
| protected Long id; | |||||
| @TableField(exist = false) | |||||
| private Date startDate; | |||||
| @TableField(exist = false) | |||||
| private Date endDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="wx_question_oneself_user_id",name="wqouId") | |||||
| private Long wqouId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="问题Id",name="topicId") | |||||
| private Long topicId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="答案",name="topicTitle") | |||||
| private String topicTitle; | |||||
| @io.swagger.annotations.ApiModelProperty(value="答案id(目前为答案对应的标签id)",name="answer") | |||||
| private String answer; | |||||
| @io.swagger.annotations.ApiModelProperty(value="答案",name="answerStr") | |||||
| private String answerStr; | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||||
| private Date createDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="修改时间",name="updateDate") | |||||
| private Date updateDate; | |||||
| } | |||||
| @@ -0,0 +1,49 @@ | |||||
| package com.iformall.domain.po; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import java.util.Date; | |||||
| @TableName(value = "wx_question_oneself_topic") | |||||
| @Data | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxQuestionOneselfTopic extends TenantEntity { | |||||
| protected Long id; | |||||
| @TableField(exist = false) | |||||
| private Date startDate; | |||||
| @TableField(exist = false) | |||||
| private Date endDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="问卷Id",name="questionId") | |||||
| private Long questionId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="名称",name="title") | |||||
| private String title; | |||||
| @io.swagger.annotations.ApiModelProperty(value="答案数组",name="answer") | |||||
| private String answer; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "类型(1:单选,2:多选)", name = "type") | |||||
| private Integer type; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "分数", name = "grade") | |||||
| private Integer grade; | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||||
| private Date createDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="修改时间",name="updateDate") | |||||
| private Date updateDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "排序", name = "sort") | |||||
| private Integer sort; | |||||
| } | |||||
| @@ -0,0 +1,46 @@ | |||||
| package com.iformall.domain.po; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import java.util.Date; | |||||
| @TableName(value = "wx_question_oneself_user") | |||||
| @Data | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxQuestionOneselfUser extends TenantEntity { | |||||
| protected Long id; | |||||
| @TableField(exist = false) | |||||
| private Date startDate; | |||||
| @TableField(exist = false) | |||||
| private Date endDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="userId",name="userId") | |||||
| private Long userId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="userName") | |||||
| private String userName; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "性别:0:保密 1.男 2女", name = "userSex") | |||||
| private Integer userSex; | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="userPhone") | |||||
| private String userPhone; | |||||
| @io.swagger.annotations.ApiModelProperty(value="问卷Id",name="questionId") | |||||
| private Long questionId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||||
| private Date createDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="修改时间",name="updateDate") | |||||
| private Date updateDate; | |||||
| } | |||||
| @@ -180,7 +180,7 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Long couponId; | private Long couponId; | ||||
| @Excel(name = "券类型", width = 50, orderNum = "15", replace = {"满减券_1", "代金券_2", "团购券_3", "礼品券_4", "停车券_5", "通用券_6", "砍价券_8", "团购券_9", "积分券_50", "积分停车券_51", "消费卡_100"}) | |||||
| @Excel(name = "券类型", width = 50, orderNum = "15", replace = {"满减券_1", "代金券_2", "团购券_3", "礼品券_4", "停车券_5", "通用券_6", "砍价券_8", "团购券_9", "预购商品_10", "积分券_50", "积分停车券_51", "消费卡_100"}) | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Integer couponType; | private Integer couponType; | ||||
| @@ -6,7 +6,8 @@ package com.iformall.enums; | |||||
| public enum EnumCampaignProductType { | public enum EnumCampaignProductType { | ||||
| COUPON(1, "券"), | COUPON(1, "券"), | ||||
| ACTIVITY_JOIN(2, "活动报名"),; | |||||
| ACTIVITY_JOIN(2, "活动报名"), | |||||
| QUESTION_ONESEL(3, "问卷调查"),; | |||||
| public static EnumCampaignProductType getEnum(Integer code) { | public static EnumCampaignProductType getEnum(Integer code) { | ||||
| for (EnumCampaignProductType value : values()) { | for (EnumCampaignProductType value : values()) { | ||||
| @@ -0,0 +1,39 @@ | |||||
| package com.iformall.enums; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| public enum EnumQuestionOneselfStatus { | |||||
| STATUS_THROW_IN(0, "已保存"), | |||||
| STATUS_TAKE_OFFF(1, "已下线"), | |||||
| INJECT_CAMPAIGN(2, "已投放"), | |||||
| INJECT_ONLINE(3, "已上线"), | |||||
| INJECT_ONLINES(4, "上过线"),;//查询状态 | |||||
| public static EnumQuestionOneselfStatus getEnum(Integer code) { | |||||
| for (EnumQuestionOneselfStatus value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumQuestionOneselfStatus(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,12 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxOpinion; | |||||
| import java.util.List; | |||||
| public interface WxOpinionMapper extends CommonMapper<WxOpinion, String> { | |||||
| List<WxOpinion> findList(WxOpinion record); | |||||
| } | |||||
| @@ -0,0 +1,12 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxQuestionOneselfLog; | |||||
| import java.util.List; | |||||
| public interface WxQuestionOneselfLogMapper extends CommonMapper<WxQuestionOneselfLog, String> { | |||||
| List<WxQuestionOneselfLog> findList(WxQuestionOneselfLog record); | |||||
| } | |||||
| @@ -0,0 +1,12 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxQuestionOneself; | |||||
| import java.util.List; | |||||
| public interface WxQuestionOneselfMapper extends CommonMapper<WxQuestionOneself, String> { | |||||
| List<WxQuestionOneself> findList(WxQuestionOneself record); | |||||
| } | |||||
| @@ -0,0 +1,12 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxQuestionOneselfTopic; | |||||
| import java.util.List; | |||||
| public interface WxQuestionOneselfTopicMapper extends CommonMapper<WxQuestionOneselfTopic, String> { | |||||
| List<WxQuestionOneselfTopic> findList(WxQuestionOneselfTopic record); | |||||
| } | |||||
| @@ -0,0 +1,12 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxQuestionOneselfUser; | |||||
| import java.util.List; | |||||
| public interface WxQuestionOneselfUserMapper extends CommonMapper<WxQuestionOneselfUser, String> { | |||||
| List<WxQuestionOneselfUser> findList(WxQuestionOneselfUser record); | |||||
| } | |||||
| @@ -0,0 +1,45 @@ | |||||
| package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.domain.po.WxOpinion; | |||||
| import java.util.List; | |||||
| public interface WxOpinionService { | |||||
| List<WxOpinion> findList(WxOpinion record); | |||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * | |||||
| * @param record | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxOpinion> listAsPage(WxOpinion record, Integer pageIndex, Integer pageSize); | |||||
| /** | |||||
| * 根据Id获得实体 | |||||
| * | |||||
| * @param id | |||||
| * @return | |||||
| */ | |||||
| WxOpinion getById(Long id); | |||||
| /** | |||||
| * 保存或更新实体 | |||||
| * | |||||
| * @param record | |||||
| */ | |||||
| void saveOrUpdate(WxOpinion record); | |||||
| /** | |||||
| * 根据Id删除实体 | |||||
| * | |||||
| * @param id | |||||
| */ | |||||
| void deleteById(Long id); | |||||
| } | |||||
| @@ -0,0 +1,45 @@ | |||||
| package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.domain.po.WxQuestionOneselfLog; | |||||
| import java.util.List; | |||||
| public interface WxQuestionOneselfLogService { | |||||
| List<WxQuestionOneselfLog> findList(WxQuestionOneselfLog record); | |||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * | |||||
| * @param record | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxQuestionOneselfLog> listAsPage(WxQuestionOneselfLog record, Integer pageIndex, Integer pageSize); | |||||
| /** | |||||
| * 根据Id获得实体 | |||||
| * | |||||
| * @param id | |||||
| * @return | |||||
| */ | |||||
| WxQuestionOneselfLog getById(Long id); | |||||
| /** | |||||
| * 保存或更新实体 | |||||
| * | |||||
| * @param record | |||||
| */ | |||||
| void saveOrUpdate(WxQuestionOneselfLog record); | |||||
| /** | |||||
| * 根据Id删除实体 | |||||
| * | |||||
| * @param id | |||||
| */ | |||||
| void deleteById(Long id); | |||||
| } | |||||
| @@ -0,0 +1,52 @@ | |||||
| package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxActivity; | |||||
| import com.iformall.domain.po.WxQuestionOneself; | |||||
| import java.util.List; | |||||
| public interface WxQuestionOneselfService { | |||||
| List<WxQuestionOneself> findList(WxQuestionOneself record); | |||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * | |||||
| * @param record | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxQuestionOneself> listAsPage(WxQuestionOneself record, Integer pageIndex, Integer pageSize); | |||||
| /** | |||||
| * 根据Id获得实体 | |||||
| * | |||||
| * @param id | |||||
| * @return | |||||
| */ | |||||
| WxQuestionOneself getById(Long id); | |||||
| /** | |||||
| * 保存或更新实体 | |||||
| * | |||||
| * @param record | |||||
| */ | |||||
| void saveOrUpdate(WxQuestionOneself record); | |||||
| /** | |||||
| * 根据Id删除实体 | |||||
| * | |||||
| * @param id | |||||
| */ | |||||
| void deleteById(Long id); | |||||
| ResultData updateStatus(WxQuestionOneself record); | |||||
| ResultData sendToCampaign(Long id); | |||||
| ResultData offLineCampaign(WxQuestionOneself record); | |||||
| } | |||||
| @@ -0,0 +1,45 @@ | |||||
| package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.domain.po.WxQuestionOneselfTopic; | |||||
| import java.util.List; | |||||
| public interface WxQuestionOneselfTopicService { | |||||
| List<WxQuestionOneselfTopic> findList(WxQuestionOneselfTopic record); | |||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * | |||||
| * @param record | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxQuestionOneselfTopic> listAsPage(WxQuestionOneselfTopic record, Integer pageIndex, Integer pageSize); | |||||
| /** | |||||
| * 根据Id获得实体 | |||||
| * | |||||
| * @param id | |||||
| * @return | |||||
| */ | |||||
| WxQuestionOneselfTopic getById(Long id); | |||||
| /** | |||||
| * 保存或更新实体 | |||||
| * | |||||
| * @param record | |||||
| */ | |||||
| void saveOrUpdate(WxQuestionOneselfTopic record); | |||||
| /** | |||||
| * 根据Id删除实体 | |||||
| * | |||||
| * @param id | |||||
| */ | |||||
| void deleteById(Long id); | |||||
| } | |||||
| @@ -0,0 +1,45 @@ | |||||
| package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.domain.po.WxQuestionOneselfUser; | |||||
| import java.util.List; | |||||
| public interface WxQuestionOneselfUserService { | |||||
| List<WxQuestionOneselfUser> findList(WxQuestionOneselfUser record); | |||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * | |||||
| * @param record | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxQuestionOneselfUser> listAsPage(WxQuestionOneselfUser record, Integer pageIndex, Integer pageSize); | |||||
| /** | |||||
| * 根据Id获得实体 | |||||
| * | |||||
| * @param id | |||||
| * @return | |||||
| */ | |||||
| WxQuestionOneselfUser getById(Long id); | |||||
| /** | |||||
| * 保存或更新实体 | |||||
| * | |||||
| * @param record | |||||
| */ | |||||
| void saveOrUpdate(WxQuestionOneselfUser record); | |||||
| /** | |||||
| * 根据Id删除实体 | |||||
| * | |||||
| * @param id | |||||
| */ | |||||
| void deleteById(Long id); | |||||
| } | |||||
| @@ -0,0 +1,60 @@ | |||||
| package com.iformall.service.impl; | |||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.IdWorker; | |||||
| import com.iformall.domain.po.WxOpinion; | |||||
| import com.iformall.mapper.WxOpinionMapper; | |||||
| import com.iformall.service.WxOpinionService; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| @Service | |||||
| public class WxOpinionServiceImpl implements WxOpinionService { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| WxOpinionMapper wxOpinionMapper; | |||||
| @Override | |||||
| public List<WxOpinion> findList(WxOpinion record) { | |||||
| return wxOpinionMapper.findList(record); | |||||
| } | |||||
| @Override | |||||
| public PageInfo<WxOpinion> listAsPage(WxOpinion record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxOpinionMapper.findList(record)); | |||||
| } | |||||
| @Override | |||||
| public WxOpinion getById(Long id) { | |||||
| return wxOpinionMapper.selectById(id); | |||||
| } | |||||
| @Override | |||||
| public void saveOrUpdate(WxOpinion record) { | |||||
| Date now = new Date(); | |||||
| if (record.getId() == null) { | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | |||||
| record.setCreateDate(now); | |||||
| record.setUpdateDate(now); | |||||
| wxOpinionMapper.insert(record); | |||||
| } else { | |||||
| record.setUpdateDate(now); | |||||
| wxOpinionMapper.updateById(record); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void deleteById(Long id) { | |||||
| // wxOpinionMapper.deleteById(id); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,60 @@ | |||||
| package com.iformall.service.impl; | |||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.IdWorker; | |||||
| import com.iformall.domain.po.WxQuestionOneselfLog; | |||||
| import com.iformall.mapper.WxQuestionOneselfLogMapper; | |||||
| import com.iformall.service.WxQuestionOneselfLogService; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| @Service | |||||
| public class WxQuestionOneselfLogServiceImpl implements WxQuestionOneselfLogService { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| WxQuestionOneselfLogMapper wxQuestionOneselfLogMapper; | |||||
| @Override | |||||
| public List<WxQuestionOneselfLog> findList(WxQuestionOneselfLog record) { | |||||
| return wxQuestionOneselfLogMapper.findList(record); | |||||
| } | |||||
| @Override | |||||
| public PageInfo<WxQuestionOneselfLog> listAsPage(WxQuestionOneselfLog record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxQuestionOneselfLogMapper.findList(record)); | |||||
| } | |||||
| @Override | |||||
| public WxQuestionOneselfLog getById(Long id) { | |||||
| return wxQuestionOneselfLogMapper.selectById(id); | |||||
| } | |||||
| @Override | |||||
| public void saveOrUpdate(WxQuestionOneselfLog record) { | |||||
| Date now = new Date(); | |||||
| if (record.getId() == null) { | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | |||||
| record.setCreateDate(now); | |||||
| record.setUpdateDate(now); | |||||
| wxQuestionOneselfLogMapper.insert(record); | |||||
| } else { | |||||
| record.setUpdateDate(now); | |||||
| wxQuestionOneselfLogMapper.updateById(record); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void deleteById(Long id) { | |||||
| // wxQuestionOneselfLogMapper.deleteById(id); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,170 @@ | |||||
| package com.iformall.service.impl; | |||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.IdWorker; | |||||
| import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxActivity; | |||||
| import com.iformall.domain.po.WxCampaign; | |||||
| import com.iformall.domain.po.WxQuestionOneself; | |||||
| import com.iformall.enums.*; | |||||
| import com.iformall.exception.MallinkException; | |||||
| import com.iformall.mapper.WxCampaignMapper; | |||||
| import com.iformall.mapper.WxQuestionOneselfMapper; | |||||
| import com.iformall.service.WxCampaignService; | |||||
| import com.iformall.service.WxQuestionOneselfService; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import org.springframework.transaction.annotation.Propagation; | |||||
| import org.springframework.transaction.annotation.Transactional; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| @Service | |||||
| public class WxQuestionOneselfServiceImpl implements WxQuestionOneselfService { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| WxQuestionOneselfMapper wxQuestionOneselfMapper; | |||||
| @Autowired | |||||
| WxCampaignMapper wxCampaignMapper; | |||||
| @Autowired | |||||
| WxCampaignService wxCampaignService; | |||||
| @Override | |||||
| public List<WxQuestionOneself> findList(WxQuestionOneself record) { | |||||
| return wxQuestionOneselfMapper.findList(record); | |||||
| } | |||||
| @Override | |||||
| public PageInfo<WxQuestionOneself> listAsPage(WxQuestionOneself record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxQuestionOneselfMapper.findList(record)); | |||||
| } | |||||
| @Override | |||||
| public WxQuestionOneself getById(Long id) { | |||||
| return wxQuestionOneselfMapper.selectById(id); | |||||
| } | |||||
| @Override | |||||
| public void saveOrUpdate(WxQuestionOneself record) { | |||||
| Date now = new Date(); | |||||
| if (record.getId() == null) { | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | |||||
| record.setCreateDate(now); | |||||
| record.setUpdateDate(now); | |||||
| wxQuestionOneselfMapper.insert(record); | |||||
| } else { | |||||
| record.setUpdateDate(now); | |||||
| wxQuestionOneselfMapper.updateById(record); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void deleteById(Long id) { | |||||
| // wxQuestionOneselfMapper.deleteById(id); | |||||
| } | |||||
| @Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | |||||
| @Override | |||||
| public ResultData updateStatus(WxQuestionOneself record) { | |||||
| WxQuestionOneself byId = this.getById(record.getId()); | |||||
| if (byId == null) { | |||||
| return new ResultData(ErrorCode.QUESTION_NOT_FOUND); | |||||
| } | |||||
| this.saveOrUpdate(record); | |||||
| if(record.getStatus().equals(EnumQuestionOneselfStatus.STATUS_TAKE_OFFF.getCode())){ | |||||
| WxCampaign campaign = new WxCampaign(); | |||||
| campaign.updateTenantInfo(byId); | |||||
| campaign.setProduceId(record.getId()); | |||||
| WxCampaign wxCampaign = wxCampaignMapper.selectOne(new QueryWrapper(campaign)); | |||||
| if(wxCampaign != null){ | |||||
| wxCampaign.setStatus(EnumCampaignStatus.STATUS_TAKE_OFFF.getCode()); | |||||
| wxCampaignMapper.updateById(wxCampaign); | |||||
| } | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| @Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | |||||
| @Override | |||||
| public ResultData sendToCampaign(Long id) { | |||||
| WxQuestionOneself byId = this.getById(id); | |||||
| if (byId == null) { | |||||
| return new ResultData(ErrorCode.QUESTION_NOT_FOUND); | |||||
| } | |||||
| //只有上线才能投放 | |||||
| if(!byId.getStatus().equals(EnumQuestionOneselfStatus.INJECT_ONLINE.getCode())){ | |||||
| return new ResultData(ErrorCode.QUESTION_NOT_LINE); | |||||
| } | |||||
| WxCampaign campaignQuery = new WxCampaign(); | |||||
| campaignQuery.updateTenantInfo(byId); | |||||
| campaignQuery.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | |||||
| int count = wxCampaignMapper.selectCount(new QueryWrapper(campaignQuery)); | |||||
| if (count >= 7) { | |||||
| return new ResultData(ErrorCode.QUESTION_SENDUP_ERROR); | |||||
| } | |||||
| WxQuestionOneself record = new WxQuestionOneself(); | |||||
| record.setId(id); | |||||
| record.setStatus(EnumQuestionOneselfStatus.INJECT_CAMPAIGN.getCode()); | |||||
| this.saveOrUpdate(record); | |||||
| campaignQuery = new WxCampaign(); | |||||
| campaignQuery.updateTenantInfo(byId); | |||||
| campaignQuery.setProduceId(id); | |||||
| WxCampaign campaign = wxCampaignMapper.selectOne(new QueryWrapper(campaignQuery)); | |||||
| if (campaign == null) { | |||||
| campaign = new WxCampaign(); | |||||
| } | |||||
| campaign.updateTenantInfo(byId); | |||||
| campaign.setProduceId(byId.getId()); | |||||
| campaign.setProduceType(EnumCampaignProductType.QUESTION_ONESEL.getCode()); | |||||
| campaign.setTitle(byId.getTitle()); | |||||
| campaign.setCoverImg(byId.getTopPic()); | |||||
| campaign.setDetail(byId.getTopDesc()); | |||||
| campaign.setValidStartDate(byId.getStartDate()); | |||||
| campaign.setValidEndDate(byId.getEndDate()); | |||||
| campaign.setType(EnumCampaignType.PAGEPATH.getCode()); | |||||
| campaign.setPagePath(byId.getWeappPath()); | |||||
| campaign.setPageScene(byId.getWeappSceneForJoin()); | |||||
| return wxCampaignService.addForPath(campaign); | |||||
| } | |||||
| @Override | |||||
| public ResultData offLineCampaign(WxQuestionOneself record) { | |||||
| WxQuestionOneself byId = this.getById(record.getId()); | |||||
| if (byId == null) { | |||||
| return new ResultData(ErrorCode.QUESTION_NOT_FOUND); | |||||
| } | |||||
| if(!record.getStatus().equals(EnumQuestionOneselfStatus.INJECT_CAMPAIGN.getCode())) { | |||||
| return new ResultData(ErrorCode.QUESTION_NOT_INTO); | |||||
| } | |||||
| record.setStatus(EnumQuestionOneselfStatus.INJECT_ONLINE.getCode()); | |||||
| this.saveOrUpdate(record); | |||||
| WxCampaign campaign = new WxCampaign(); | |||||
| campaign.updateTenantInfo(byId); | |||||
| campaign.setProduceId(record.getId()); | |||||
| WxCampaign wxCampaign = wxCampaignMapper.selectOne(new QueryWrapper(campaign)); | |||||
| wxCampaign.setStatus(EnumCampaignStatus.STATUS_TAKE_OFFF.getCode()); | |||||
| wxCampaignMapper.updateById(wxCampaign); | |||||
| return new ResultData(); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,60 @@ | |||||
| package com.iformall.service.impl; | |||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.IdWorker; | |||||
| import com.iformall.domain.po.WxQuestionOneselfTopic; | |||||
| import com.iformall.mapper.WxQuestionOneselfTopicMapper; | |||||
| import com.iformall.service.WxQuestionOneselfTopicService; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| @Service | |||||
| public class WxQuestionOneselfTopicServiceImpl implements WxQuestionOneselfTopicService { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| WxQuestionOneselfTopicMapper wxQuestionOneselfTopicMapper; | |||||
| @Override | |||||
| public List<WxQuestionOneselfTopic> findList(WxQuestionOneselfTopic record) { | |||||
| return wxQuestionOneselfTopicMapper.findList(record); | |||||
| } | |||||
| @Override | |||||
| public PageInfo<WxQuestionOneselfTopic> listAsPage(WxQuestionOneselfTopic record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxQuestionOneselfTopicMapper.findList(record)); | |||||
| } | |||||
| @Override | |||||
| public WxQuestionOneselfTopic getById(Long id) { | |||||
| return wxQuestionOneselfTopicMapper.selectById(id); | |||||
| } | |||||
| @Override | |||||
| public void saveOrUpdate(WxQuestionOneselfTopic record) { | |||||
| Date now = new Date(); | |||||
| if (record.getId() == null) { | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | |||||
| record.setCreateDate(now); | |||||
| record.setUpdateDate(now); | |||||
| wxQuestionOneselfTopicMapper.insert(record); | |||||
| } else { | |||||
| record.setUpdateDate(now); | |||||
| wxQuestionOneselfTopicMapper.updateById(record); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void deleteById(Long id) { | |||||
| // wxQuestionOneselfTopicMapper.deleteById(id); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,60 @@ | |||||
| package com.iformall.service.impl; | |||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.IdWorker; | |||||
| import com.iformall.domain.po.WxQuestionOneselfUser; | |||||
| import com.iformall.mapper.WxQuestionOneselfUserMapper; | |||||
| import com.iformall.service.WxQuestionOneselfUserService; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| @Service | |||||
| public class WxQuestionOneselfUserServiceImpl implements WxQuestionOneselfUserService { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| WxQuestionOneselfUserMapper wxQuestionOneselfUserMapper; | |||||
| @Override | |||||
| public List<WxQuestionOneselfUser> findList(WxQuestionOneselfUser record) { | |||||
| return wxQuestionOneselfUserMapper.findList(record); | |||||
| } | |||||
| @Override | |||||
| public PageInfo<WxQuestionOneselfUser> listAsPage(WxQuestionOneselfUser record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxQuestionOneselfUserMapper.findList(record)); | |||||
| } | |||||
| @Override | |||||
| public WxQuestionOneselfUser getById(Long id) { | |||||
| return wxQuestionOneselfUserMapper.selectById(id); | |||||
| } | |||||
| @Override | |||||
| public void saveOrUpdate(WxQuestionOneselfUser record) { | |||||
| Date now = new Date(); | |||||
| if (record.getId() == null) { | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | |||||
| record.setCreateDate(now); | |||||
| record.setUpdateDate(now); | |||||
| wxQuestionOneselfUserMapper.insert(record); | |||||
| } else { | |||||
| record.setUpdateDate(now); | |||||
| wxQuestionOneselfUserMapper.updateById(record); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void deleteById(Long id) { | |||||
| // wxQuestionOneselfUserMapper.deleteById(id); | |||||
| } | |||||
| } | |||||
| @@ -227,9 +227,9 @@ public class WiwideUtil implements SMSExcutor { | |||||
| public static void main(String[] args) { | public static void main(String[] args) { | ||||
| Map<String, String> params = new HashMap<>(2); | Map<String, String> params = new HashMap<>(2); | ||||
| params.put("username", "api-test1"); | |||||
| params.put("password", "Wwd789"); | |||||
| String res = HttpUtil.doPost("http://140.143.33.245/api/user/auth", params); | |||||
| params.put("username", "lianhua"); | |||||
| params.put("password", "widash1234"); | |||||
| String res = HttpUtil.doPost("https://vap.vision.wiwide.com/api/user/auth", params); | |||||
| System.out.println(res); | System.out.println(res); | ||||
| JSONObject result = JSONObject.parseObject(res); | JSONObject result = JSONObject.parseObject(res); | ||||
| if (result.getInteger("result") == 0) { | if (result.getInteger("result") == 0) { | ||||
| @@ -243,8 +243,8 @@ public class WiwideUtil implements SMSExcutor { | |||||
| String sign = WiwideEntry.encrypt(wiWideInfo); | String sign = WiwideEntry.encrypt(wiWideInfo); | ||||
| byte[] s = HttpUtil.doWiwidePicGet("http://140.143.33.245" + "/api/reports/pictures/get_picture?type=pic&id=b3b30445674bb49840e64c2f8b0be347", sign); | |||||
| System.out.println(s); | |||||
| // byte[] s = HttpUtil.doWiwidePicGet("http://140.143.33.245" + "/api/reports/pictures/get_picture?type=pic&id=b3b30445674bb49840e64c2f8b0be347", sign); | |||||
| // System.out.println(s); | |||||
| // Map<String, Object> param = new HashMap<>(); | // Map<String, Object> param = new HashMap<>(); | ||||
| // param.put("type","pic"); | // param.put("type","pic"); | ||||
| @@ -255,16 +255,16 @@ public class WiwideUtil implements SMSExcutor { | |||||
| // String s = queryDataNew("http://140.143.33.245" + "/api/reports/pictures/get_picture", sign, param); | // String s = queryDataNew("http://140.143.33.245" + "/api/reports/pictures/get_picture", sign, param); | ||||
| // System.out.println(DataUtil.unicodeToUtf8(s)); | // System.out.println(DataUtil.unicodeToUtf8(s)); | ||||
| // Map<String, Object> param = new HashMap<>(); | |||||
| Map<String, Object> param = new HashMap<>(); | |||||
| // param.put("pageStart",1); | // param.put("pageStart",1); | ||||
| // param.put("pageSize",10); | // param.put("pageSize",10); | ||||
| // param.put("key",0); | // param.put("key",0); | ||||
| // param.put("value",""); | // param.put("value",""); | ||||
| // param.put("placeStatus",0); | // param.put("placeStatus",0); | ||||
| // | |||||
| // | |||||
| // String s = queryDataNew("http://140.143.33.245" + "/api/place/place", sign, param); | |||||
| // System.out.println(DataUtil.unicodeToUtf8(s)); | |||||
| String s = queryDataNew("https://vap.vision.wiwide.com" + "/api/place/place_list", sign, param); | |||||
| System.out.println(DataUtil.unicodeToUtf8(s)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -0,0 +1,88 @@ | |||||
| <?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.iformall.mapper.WxOpinionMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxOpinion"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||||
| <result column="user_id" jdbcType="bigint" property="userId"/> | |||||
| <result column="liaison_man" jdbcType="VARCHAR" property="liaisonMan"/> | |||||
| <result column="liaison_sex" jdbcType="tinyint" property="liaisonrSex"/> | |||||
| <result column="liaison_phone" jdbcType="VARCHAR" property="liaisonPhone"/> | |||||
| <result column="liaison_email" jdbcType="VARCHAR" property="liaisonEmail"/> | |||||
| <result column="pictures" jdbcType="json" property="pictures"/> | |||||
| <result column="explains" jdbcType="varchar" property="explains"/> | |||||
| <result column="remark" jdbcType="varchar" property="remark"/> | |||||
| <result column="handle_status" jdbcType="tinyint" property="handleStatus"/> | |||||
| <result column="handle_id" jdbcType="bigint" property="handleId"/> | |||||
| <result column="create_date" jdbcType="datetime" property="createDate"/> | |||||
| <result column="update_date" jdbcType="datetime" property="updateDate"/> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`,`tenant_id`,`parent_tenant_id`, `user_id`, `liaison_man`, `liaison_sex`, `liaison_phone`, `liaison_email`, | |||||
| `pictures`, `explains`, `remark`, `handle_status`, `handle_id`, `create_date`,`update_date` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where `del_status` = 1 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <if test=" null != userId "> | |||||
| and `user_id` = #{userId} | |||||
| </if> | |||||
| <if test=" null != liaisonMan "> | |||||
| and `liaison_man` like concat('%', #{liaisonMan},'%') | |||||
| </if> | |||||
| <if test=" null != liaisonPhone "> | |||||
| and `liaison_phone` like concat('%', #{liaisonPhone},'%') | |||||
| </if> | |||||
| <if test=" null != liaisonEmail "> | |||||
| and `liaison_email` like concat('%', #{liaisonEmail},'%') | |||||
| </if> | |||||
| <if test=" null != liaisonSex "> | |||||
| and `liaison_sex` = #{liaisonSex} | |||||
| </if> | |||||
| <if test=" null != handleStatus "> | |||||
| and `handle_status` = #{handleStatus} | |||||
| </if> | |||||
| <if test=" null != startDate "> | |||||
| and `create_date` >= #{startDate} | |||||
| </if> | |||||
| <if test=" null != endDate "> | |||||
| and `create_date` <= #{endDate} | |||||
| </if> | |||||
| <if test=" null != ids "> | |||||
| and id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxOpinion" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_opinion | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| </mapper> | |||||
| @@ -0,0 +1,67 @@ | |||||
| <?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.iformall.mapper.WxQuestionOneselfLogMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxQuestionOneselfLog"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||||
| <result column="wqou_id" jdbcType="bigint" property="wqouId"/> | |||||
| <result column="topic_id" jdbcType="bigint" property="topicId"/> | |||||
| <result column="topic_title" jdbcType="VARCHAR" property="topicTitle"/> | |||||
| <result column="answer" jdbcType="json" property="answer"/> | |||||
| <result column="answer_str" jdbcType="VARCHAR" property="answerStr"/> | |||||
| <result column="create_date" jdbcType="datetime" property="createDate"/> | |||||
| <result column="update_date" jdbcType="datetime" property="updateDate"/> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`,`tenant_id`,`parent_tenant_id`, `wqou_id`, `topic_id`, `topic_title`, `answer`, `answer_str`, | |||||
| `create_date`,`update_date` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where 1 = 1 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <if test=" null != wqouId "> | |||||
| and `wqou_id` = #{wqouId} | |||||
| </if> | |||||
| <if test=" null != topicId "> | |||||
| and `topic_id` = #{topicId} | |||||
| </if> | |||||
| <if test=" null != startDate "> | |||||
| and `create_date` >= #{startDate} | |||||
| </if> | |||||
| <if test=" null != endDate "> | |||||
| and `create_date` <= #{endDate} | |||||
| </if> | |||||
| <if test=" null != ids "> | |||||
| and id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxQuestionOneselfLog" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_question_oneself_log | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| </mapper> | |||||
| @@ -0,0 +1,96 @@ | |||||
| <?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.iformall.mapper.WxQuestionOneselfMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxQuestionOneself"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||||
| <result column="logo" jdbcType="VARCHAR" property="logo"/> | |||||
| <result column="top_pic" jdbcType="VARCHAR" property="topPic"/> | |||||
| <result column="title" jdbcType="VARCHAR" property="title"/> | |||||
| <result column="top_desc" jdbcType="text" property="topDesc"/> | |||||
| <result column="status" jdbcType="tinyint" property="status"/> | |||||
| <result column="start_date" jdbcType="datetime" property="startDate"/> | |||||
| <result column="end_date" jdbcType="datetime" property="endDate"/> | |||||
| <result column="reward_credit" jdbcType="int" property="rewardCredit"/> | |||||
| <result column="create_date" jdbcType="datetime" property="createDate"/> | |||||
| <result column="update_date" jdbcType="datetime" property="updateDate"/> | |||||
| <result column="sort" jdbcType="int" property="sort"/> | |||||
| <result column="count_topic" jdbcType="int" property="countTopic"/> | |||||
| <result column="count_user" jdbcType="int" property="countUser"/> | |||||
| <result column="qr_code" jdbcType="VARCHAR" property="qrCode"/> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`,`tenant_id`,`parent_tenant_id`, `logo`, `top_pic`, `title`, `top_desc`, `status`, `start_date`, `end_date`, | |||||
| `reward_credit`,`create_date`,`update_date`,`sort`, `qr_code`, `count_topic`, `count_user` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where `del_status` = 1 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <if test=" null != title "> | |||||
| and `title` like concat('%', #{title},'%') | |||||
| </if> | |||||
| <if test=" null != status and status lt 3"> | |||||
| and `status` = #{status} | |||||
| </if> | |||||
| <if test=" null != status and status == 3"> | |||||
| and `status` >= 2 and `status` <= 3 | |||||
| </if> | |||||
| <if test=" null != status and status == 4"> | |||||
| and `status` > 0 | |||||
| </if> | |||||
| <if test=" null != createStartdate "> | |||||
| and `create_date` >= #{createStartdate} | |||||
| </if> | |||||
| <if test=" null != createEnddate "> | |||||
| and `create_date` <= #{createEnddate} | |||||
| </if> | |||||
| <if test=" null != startStartdate "> | |||||
| and `start_date` >= #{startStartdate} | |||||
| </if> | |||||
| <if test=" null != startEnddate "> | |||||
| and `start_date` <= #{startEnddate} | |||||
| </if> | |||||
| <if test=" null != endStartdate "> | |||||
| and `end_date` >= #{endStartdate} | |||||
| </if> | |||||
| <if test=" null != endEnddate "> | |||||
| and `end_date` <= #{endEnddate} | |||||
| </if> | |||||
| <if test=" null != ids "> | |||||
| and id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxQuestionOneself" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_question_oneself | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| </mapper> | |||||
| @@ -0,0 +1,71 @@ | |||||
| <?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.iformall.mapper.WxQuestionOneselfTopicMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxQuestionOneselfTopic"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||||
| <result column="question_id" jdbcType="BIGINT" property="questionId"/> | |||||
| <result column="title" jdbcType="VARCHAR" property="title"/> | |||||
| <result column="answer" jdbcType="json" property="answer"/> | |||||
| <result column="type" jdbcType="tinyint" property="type"/> | |||||
| <result column="create_date" jdbcType="datetime" property="createDate"/> | |||||
| <result column="update_date" jdbcType="datetime" property="updateDate"/> | |||||
| <result column="sort" jdbcType="int" property="sort"/> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`,`tenant_id`,`parent_tenant_id`, `question_id`, `title`, `answer`, `type`, | |||||
| `create_date`,`update_date`,`sort` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where `del_status` = 1 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <if test=" null != questionId "> | |||||
| and `question_id` = #{questionId} | |||||
| </if> | |||||
| <if test=" null != title "> | |||||
| and `title` like concat('%', #{title},'%') | |||||
| </if> | |||||
| <if test=" null != type "> | |||||
| and `type` = #{type} | |||||
| </if> | |||||
| <if test=" null != startDate "> | |||||
| and `create_date` >= #{startDate} | |||||
| </if> | |||||
| <if test=" null != endDate "> | |||||
| and `create_date` <= #{endDate} | |||||
| </if> | |||||
| <if test=" null != ids "> | |||||
| and id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxQuestionOneselfTopic" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_question_oneself_topic | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| </mapper> | |||||
| @@ -0,0 +1,75 @@ | |||||
| <?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.iformall.mapper.WxQuestionOneselfUserMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxQuestionOneselfUser"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||||
| <result column="user_id" jdbcType="bigint" property="userId"/> | |||||
| <result column="user_name" jdbcType="VARCHAR" property="userName"/> | |||||
| <result column="user_sex" jdbcType="tinyint" property="userSex"/> | |||||
| <result column="user_phone" jdbcType="VARCHAR" property="userPhone"/> | |||||
| <result column="question_id" jdbcType="bigint" property="questionId"/> | |||||
| <result column="create_date" jdbcType="datetime" property="createDate"/> | |||||
| <result column="update_date" jdbcType="datetime" property="updateDate"/> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`,`tenant_id`,`parent_tenant_id`, `user_id`, `user_name`, `user_sex`, `user_phone`, `question_id`, | |||||
| `create_date`,`update_date` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where 1 = 1 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <if test=" null != userId "> | |||||
| and `user_id` = #{userId} | |||||
| </if> | |||||
| <if test=" null != userName "> | |||||
| and `user_name` like concat('%', #{userName},'%') | |||||
| </if> | |||||
| <if test=" null != userPhone "> | |||||
| and `user_phone` like concat('%', #{userPhone},'%') | |||||
| </if> | |||||
| <if test=" null != userSex "> | |||||
| and `user_sex` = #{userSex} | |||||
| </if> | |||||
| <if test=" null != startDate "> | |||||
| and `create_date` >= #{startDate} | |||||
| </if> | |||||
| <if test=" null != endDate "> | |||||
| and `create_date` <= #{endDate} | |||||
| </if> | |||||
| <if test=" null != ids "> | |||||
| and id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxQuestionOneselfUser" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_question_oneself_user | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| </mapper> | |||||