Browse Source

Merge remote-tracking branch 'origin/test' into dev

Conflicts:
	GeneratorConfig.xml
	src/main/java/com/goafanti/common/dao/TOrderBackMapper.java
	src/main/java/com/goafanti/common/dao/TOrderNewMapper.java
	src/main/java/com/goafanti/common/mapper/TOrderBackMapper.xml
	src/main/java/com/goafanti/common/model/TOrderBack.java
	src/main/java/com/goafanti/common/model/TOrderBackExample.java
anderx 7 years ago
parent
commit
b4451cec0a
58 changed files with 4116 additions and 352 deletions
  1. 1 1
      GeneratorConfig.xml
  2. 0 54
      schema/20170626-activities-news-billings.sql
  3. 0 9
      schema/201707011-star.sql
  4. 0 17
      schema/201707012-lecture.sql
  5. 0 16
      schema/20170705-coganizance-record.sql
  6. 0 2
      schema/20170707-alter-usrEdu.sql
  7. 0 13
      schema/20170711-banners.sql
  8. 0 8
      schema/20170714-engaged-field_glossory.sql
  9. 0 6
      schema/20170719-alter-activity.sql
  10. 0 5
      schema/20170720-alter-activity.sql
  11. 0 2
      schema/20170722-alter-activityUser2.sql
  12. 0 11
      schema/20170725-lectureUser.sql
  13. 0 11
      schema/20170726-alert.sql
  14. 0 40
      schema/20170816-appconfig.sql
  15. 0 4
      schema/20170821-alert.sql
  16. 0 33
      schema/20170822-init-branch-office.sql
  17. 0 9
      schema/20170829-member_grade.sql
  18. 0 15
      schema/20170901-member_order.sql
  19. 0 2
      schema/20170911-achievement-intro-length.sql
  20. 0 15
      schema/20170913-consult-order.sql
  21. 0 4
      schema/20170916-alert-achievement-demand.sql
  22. 0 10
      schema/20170918-achievement-order-change.sql
  23. 0 2
      schema/20170920-member-rank-unique.sql
  24. 0 10
      schema/20180202-sales-report.sql
  25. 9 5
      src/main/java/com/goafanti/common/controller/WebpageController.java
  26. 1 1
      src/main/java/com/goafanti/common/dao/AdminMapper.java
  27. 109 0
      src/main/java/com/goafanti/common/dao/TOrderBillNewMapper.java
  28. 5 1
      src/main/java/com/goafanti/common/dao/TOrderNewMapper.java
  29. 2 0
      src/main/java/com/goafanti/common/dao/TOrderRefundMapper.java
  30. 7 0
      src/main/java/com/goafanti/common/mapper/AdminMapper.xml
  31. 2 0
      src/main/java/com/goafanti/common/mapper/TOrderBackMapper.xml
  32. 603 0
      src/main/java/com/goafanti/common/mapper/TOrderBillNewMapper.xml
  33. 194 1
      src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml
  34. 97 0
      src/main/java/com/goafanti/common/mapper/TOrderRefundMapper.xml
  35. 1 1
      src/main/java/com/goafanti/common/mapper/UserIdentityMapper.xml
  36. 1 3
      src/main/java/com/goafanti/common/mapper/UserMapperExt.xml
  37. 29 28
      src/main/java/com/goafanti/common/model/TOrderBack.java
  38. 593 0
      src/main/java/com/goafanti/common/model/TOrderBillNew.java
  39. 1274 0
      src/main/java/com/goafanti/common/model/TOrderBillNewExample.java
  40. 196 0
      src/main/java/com/goafanti/common/utils/ExportExcelUtil.java
  41. 42 0
      src/main/java/com/goafanti/core/auth/HttpComponentsClientHttpRequestFactoryDigestAuth.java
  42. 43 0
      src/main/java/com/goafanti/core/auth/RestClient.java
  43. 29 0
      src/main/java/com/goafanti/core/auth/RestTempleteConfig.java
  44. 10 1
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java
  45. 32 0
      src/main/java/com/goafanti/order/bo/OrderListBo.java
  46. 65 0
      src/main/java/com/goafanti/order/bo/OrderRefundBo.java
  47. 279 0
      src/main/java/com/goafanti/order/controller/FundManagerOrderApiController.java
  48. 80 0
      src/main/java/com/goafanti/order/service/FundManageOrderService.java
  49. 23 0
      src/main/java/com/goafanti/order/service/OrderBillService.java
  50. 16 0
      src/main/java/com/goafanti/order/service/OrderRefundService.java
  51. 228 0
      src/main/java/com/goafanti/order/service/impl/FundManagerOrderServiceImpl.java
  52. 75 0
      src/main/java/com/goafanti/order/service/impl/OrderBillServiceImpl.java
  53. 35 0
      src/main/java/com/goafanti/order/service/impl/OrderRefundServiceImpl.java
  54. 2 2
      src/main/java/com/goafanti/order/service/impl/OrderServiceImpl.java
  55. 2 2
      src/main/resources/props/config_local.properties
  56. 24 0
      src/main/webapp/WEB-INF/views/admin/statistics.html
  57. 1 2
      src/main/webapp/WEB-INF/views/common.html
  58. 6 6
      src/main/webapp/WEB-INF/views/portal/index.html

+ 1 - 1
GeneratorConfig.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
 <generatorConfiguration>
   <classPathEntry location="C:/Users/Administrator/.dbeaver-drivers/maven/maven-central/mysql/mysql-connector-java-5.1.44.jar" />
-   <!-- <classPathEntry location="E:/mysql-connector-java-5.1.40.jar" /> -->
+   <!-- <classPathEntry location="E:/mysql-connector-java-5.1.40.jar" /> -->
   <context id="context1">	
     <jdbcConnection connectionURL="jdbc:mysql://192.168.0.17:3306/aft" 
     	driverClass="com.mysql.jdbc.Driver" password="123456" userId="dev" />

+ 0 - 54
schema/20170626-activities-news-billings.sql

@@ -1,54 +0,0 @@
-CREATE TABLE `news` (
-  `id` bigint(18) NOT NULL COMMENT '主键',
-  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
-  `edit_time` datetime DEFAULT NULL COMMENT '修改时间',
-  `title` varchar(45) DEFAULT NULL COMMENT '标题',
-  `title_img` varchar(128) DEFAULT NULL COMMENT '题图url',
-  `author` varchar(45) DEFAULT NULL COMMENT '作者',
-  `type` int(2) NOT NULL DEFAULT '0' COMMENT '类型',
-  `content` longtext COMMENT '内容',
-  `hot` int(1) NOT NULL DEFAULT '0' COMMENT '是否放在首页',
-  `source` varchar(45) DEFAULT NULL COMMENT '来源',
-  `source_url` varchar(255) DEFAULT NULL COMMENT '来源url',
-  `summary` varchar(144) DEFAULT NULL COMMENT '简介',
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='新闻资讯';
-
-
-CREATE TABLE `activity` (
-  `id` bigint(18) NOT NULL,
-  `start_time` datetime DEFAULT NULL COMMENT '开始时间',
-  `end_time` datetime DEFAULT NULL COMMENT '结束时间',
-  `name` varchar(45) DEFAULT NULL COMMENT '标题',
-  `desc` longtext COMMENT '描述',
-  `status` int(1) DEFAULT NULL COMMENT '状态',
-  `address` varchar(128) DEFAULT NULL COMMENT '活动地址',
-  `host` varchar(45) DEFAULT NULL COMMENT '主办单位',
-  `undertake` varchar(45) DEFAULT NULL COMMENT '承办单位',
-  `asist` varchar(255) DEFAULT NULL COMMENT '协办单位,逗号隔开',
-  `type` int(1) DEFAULT NULL COMMENT '活动类型',
-  `form` int(1) DEFAULT NULL COMMENT '活动形式',
-  `img_urls` varchar(255) DEFAULT NULL COMMENT '活动图片地址',
-  `result` varchar(255) DEFAULT NULL COMMENT '活动结果描述',
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='活动主表';
-
-CREATE TABLE `activity_user` (
-  `aid` bigint(18) NOT NULL COMMENT '活动id',
-  `uid` varchar(36) NOT NULL COMMENT '用户ID',
-  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '报名时间',
-  PRIMARY KEY (`aid`,`uid`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户活动表';
-
-CREATE TABLE `billings` (
-  `id` bigint(18) NOT NULL COMMENT '流水id',
-  `uid` varchar(36) DEFAULT NULL COMMENT '用户id',
-  `value` bigint(18) NOT NULL DEFAULT '0' COMMENT '支付金额,单位为分',
-  `desc` varchar(45) DEFAULT NULL COMMENT '流水描述',
-  `type` int(2) NOT NULL DEFAULT '0' COMMENT '流水订单类型',
-  `payment_type` int(2) NOT NULL DEFAULT '0' COMMENT '流水支付类型',
-  `number` varchar(45) DEFAULT NULL COMMENT '银行或者其他支付渠道的流水号',
-  `balance` bigint(18) NOT NULL DEFAULT '0' COMMENT '用户账户余额,单位为分',
-  `consumption` bigint(18) NOT NULL DEFAULT '0' COMMENT '用户总消费额,单位为分',
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户交易支付流水表';

+ 0 - 9
schema/201707011-star.sql

@@ -1,9 +0,0 @@
-CREATE TABLE `star` (
-  `id` VARCHAR(36) NOT NULL,
-  `uid` VARCHAR(36) NOT NULL COMMENT '明星用户ID',
-  `hot` INT(1) NOT NULL DEFAULT 0 COMMENT '是否在首页显示(0--否,1--是)',
-  `star` INT(1) NOT NULL DEFAULT 0 COMMENT '是否在科技明星页显示(0--不显示,1--显示)',
-  `portal_url` VARCHAR(255) NULL COMMENT '个人主页URL',
-  PRIMARY KEY (`id`))
-ENGINE = InnoDB DEFAULT CHARSET=utf8mb4
-COMMENT = '科技明星';

+ 0 - 17
schema/201707012-lecture.sql

@@ -1,17 +0,0 @@
-CREATE TABLE `lecture` (
-  `id` VARCHAR(36) CHARACTER SET 'utf8mb4' NOT NULL,
-  `uid` VARCHAR(36) CHARACTER SET 'utf8mb4'  NULL COMMENT '开展讲座人ID',
-  `lecture_time` DATETIME NOT NULL COMMENT '讲座开展时间',
-  `create_time` DATETIME NULL COMMENT '记录创建时间',
-  `last_update_time` DATETIME NULL COMMENT '记录最后更新时间',
-  `name` VARCHAR(45) CHARACTER SET 'utf8mb4' NOT NULL COMMENT '名称',
-  `summary` VARCHAR(128) CHARACTER SET 'utf8mb4' NULL COMMENT '简介',
-  `deleted_sign` INT(1) NOT NULL DEFAULT 0 COMMENT '删除标记',
-  `lecture_url` VARCHAR(255) NULL COMMENT '展示图',
-  `hot` INT(1) NOT NULL DEFAULT 0 COMMENT '是否在大咖说页面展示(0--不展示,1--展示)',
-  `dynamic` INT(1) NOT NULL DEFAULT 0 COMMENT '是否在科技明星页面展示活动动态(0--不展示,1--展示)',
-  `end_time` DATETIME NOT NULL COMMENT '讲堂结束时间',
-  PRIMARY KEY (`id`))
-ENGINE = InnoDB DEFAULT CHARSET=utf8mb4
-COMMENT = '科技讲堂';
-

+ 0 - 16
schema/20170705-coganizance-record.sql

@@ -1,16 +0,0 @@
-ALTER TABLE `organization_tech` MODIFY COLUMN `specialty` VARCHAR (255) NULL COMMENT '擅长领域';
-
-ALTER TABLE `achievement` MODIFY COLUMN `owner_mobile` VARCHAR(36) NULL COMMENT '所有人联系电话';
-
-ALTER TABLE `demand` MODIFY COLUMN `employer_contacts_mobile` VARCHAR(36) COMMENT '雇主联系人电话';
-
-ALTER TABLE `demand` MODIFY COLUMN `employer_name` VARCHAR(45) COMMENT'雇主名称';
-
-CREATE TABLE `coganizance_record` (
-  `id` BIGINT(18) NOT NULL  AUTO_INCREMENT,
-  `district` INT(4) NOT NULL COMMENT '地区(省份/市)',
-  `unit_name` VARCHAR(45) NOT NULL COMMENT '公司名称',
-  `year` INT(4) NOT NULL COMMENT '高企认定年份',
-  PRIMARY KEY (`id`))AUTO_INCREMENT = 1
-ENGINE = InnoDB
-COMMENT = '高企认定数据';

+ 0 - 2
schema/20170707-alter-usrEdu.sql

@@ -1,2 +0,0 @@
-ALTER TABLE `user_edu` MODIFY COLUMN `major_category` VARCHAR (16) NULL COMMENT '专业类别';
-

+ 0 - 13
schema/20170711-banners.sql

@@ -1,13 +0,0 @@
-CREATE TABLE `banners` (
-  `id` bigint(18) NOT NULL COMMENT '主键',
-  `sign` varchar(100) DEFAULT NULL COMMENT '广告图位置标识',
-  `text` varchar(255) DEFAULT NULL COMMENT '图片描述',
-  `imgUrl` varchar(255) DEFAULT NULL COMMENT '图片url',
-  `url` varchar(255) DEFAULT NULL COMMENT '广告图跳转链接地址',
-  `width` int(5) DEFAULT NULL COMMENT '广告图宽度',
-  `height` int(5) DEFAULT NULL COMMENT '广告图高度',
-  `start_date` datetime DEFAULT NULL COMMENT '开始日期',
-  `end_date` datetime DEFAULT NULL COMMENT '结束日期',
-  PRIMARY KEY (`id`),
-  KEY `key` (`sign`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

+ 0 - 8
schema/20170714-engaged-field_glossory.sql

@@ -1,8 +0,0 @@
-CREATE TABLE `engaged_field_glossory` (
-  `id` INT(4) NOT NULL AUTO_INCREMENT,
-  `name` VARCHAR(32) NULL COMMENT '名称',
-  `pid` INT(4) NULL COMMENT '上级ID',
-  `level` INT(1) NULL COMMENT '层级',
-  PRIMARY KEY (`id`))
-ENGINE = InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4
-COMMENT = '从事领域';

+ 0 - 6
schema/20170719-alter-activity.sql

@@ -1,6 +0,0 @@
-alter table `activity` 
-add  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间(报名开始时间)',
-add `enroll_deadline`  datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '报名截止时间';
-
-alter table `activity`  add  `title_url` varchar(255) DEFAULT NULL COMMENT '题图地址';
-alter table `activity` modify column `img_urls` varchar(1000) DEFAULT NULL COMMENT '活动图片地址';

+ 0 - 5
schema/20170720-alter-activity.sql

@@ -1,5 +0,0 @@
-ALTER TABLE `activity` CHANGE COLUMN `desc` `summary` LONGTEXT DEFAULT NULL COMMENT '描述';
-
-Alter TABLE `activity` 
-modify column 
-`create_time` datetime  NULL COMMENT '创建时间(报名开始时间)';

+ 0 - 2
schema/20170722-alter-activityUser2.sql

@@ -1,2 +0,0 @@
-ALTER TABLE `activity_user` 
-add COLUMN `last_update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '记录最后更改时间';

+ 0 - 11
schema/20170725-lectureUser.sql

@@ -1,11 +0,0 @@
-CREATE TABLE `lecture_user` (
-  `lid` BIGINT NOT NULL COMMENT '讲堂ID',
-  `uid` VARCHAR(36) NOT NULL COMMENT '报名人ID',
-  `create_time` DATETIME NULL COMMENT '创建时间(首次咨询时间)',
-  `last_update_time` DATETIME NULL COMMENT '最近一次咨询时间',
-  PRIMARY KEY (`lid`, `uid`))
-ENGINE = InnoDB DEFAULT CHARSET=utf8mb4
-COMMENT = '科技讲堂报名';
-
-alter table `lecture` 
-add column `lecturer` varchar(45) NULL comment '讲师';

+ 0 - 11
schema/20170726-alert.sql

@@ -1,12 +0,0 @@
-alter table achievement add column international_flag int(1)  default 0 comment '是否国际化  0-否  1-是';
-alter table achievement add column country_name_zh varchar(32) default '中国' comment '国际中文名称';
-alter table user_identity add column international_flag int(1)  default 0 comment '是否国际化  0-否  1-是';
-alter table organization_identity add column international_flag int(1) default 0 comment '是否国际化 0-否 1-是';
-alter table organization_info add column country_name_zh varchar(32) default '中国' comment '国际中文名称';
-create table country_code(
-	country_name_en varchar(32) not null primary key comment '英文全称',
-	country_name_zh varchar(32) not null comment '中文全称',
-	region_code char(8) not null comment '国际地区编码',
-	tel_code  int(8) comment '电话代码'
-);

+ 0 - 40
schema/20170816-appconfig.sql

@@ -1,40 +0,0 @@
-CREATE TABLE `app_config` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `cate` varchar(45) DEFAULT NULL COMMENT '分类',
-  `key` varchar(45) DEFAULT NULL COMMENT '关键字',
-  `name` varchar(45) DEFAULT NULL COMMENT '名称',
-  `value` varchar(45) DEFAULT NULL COMMENT '值',
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8;
-
-
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('collections', 'demand', '需求', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('collections', 'achievement', '成果', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('collections', 'expert', '专家', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('collections', 'company', '企业', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('collections', 'school', '高校', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('collections', 'institute', '院所', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('collections', 'policy', '政策', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('collections', 'activity', '活动', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('collections', 'news', '快讯', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('orders', 'hightech', '高企', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('orders', 'program', '科技项目', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('orders', 'patent', '专利', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('orders', 'copyright', '软著', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('orders', 'evalution', '评估', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('orders', 'activity', '活动', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('orders', 'crowdfunding', '众筹', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('orders', 'achievement', '买技术', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('orders', 'demand', '接需求', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('orders', 'date', '邀约专家', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('orders', 'consultant', '技术咨询', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('mytech', 'match', '匹配', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('mytech', 'intention', '意向', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('mytech', 'deal', '成交', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('myexpert', 'date', '邀约', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('myexpert', 'intention', '意向', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('myexpert', 'deal', '成交', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('mydemand', 'match', '匹配', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('mydemand', 'intention', '意向', '1');
-INSERT INTO `app_config` (`cate`, `key`, `name`, `value`) VALUES ('mydemand', 'deal', '成交', '1');
-

+ 0 - 4
schema/20170821-alert.sql

@@ -1,4 +0,0 @@
-alter table achievement add column jmrh_flag int(1) default 0 comment '是否属于军民融合';
-alter table news add column jmrh_flag int(1) default 0 comment '是否属于军民融合';
-alter table news add column province_id int(4) default 0 comment '新闻发布省份';
-update news set province_id = 11;

+ 0 - 33
schema/20170822-init-branch-office.sql

@@ -1,33 +0,0 @@
-#创建分公司管理表
-create table branch_office_info(
-	id int(4) primary key auto_increment,
-	name varchar(32) comment '分公司名字',
-	website varchar(32) not null comment '分公司网络地址',
-	contact_number varchar(11) comment '联系号码',
-	contact_address varchar(64) comment '联系地址',
-	logo_img varchar(64) comment 'LOGO图片',
-	qr_img varchar(64) comment '二维码图片',
-	province_id int(4) not null comment '所属省份'
-);
-#初始化数据
-insert into branch_office_info values(1,'南昌科德','nckd.jishutao.com',null,null,null,null,26);
-insert into branch_office_info values(2,'福州科宇','fzky.jishutao.com',null,null,null,null,25);
-insert into branch_office_info values(3,'贵州科德','gzkd.jishutao.com',null,null,null,null,6);
-insert into branch_office_info values(4,'大连科德','dlkd.jishutao.com',null,null,null,null,28);
-insert into branch_office_info values(5,'广州科中','gzkz.jishutao.com',null,null,null,null,12);
-insert into branch_office_info values(6,'河南科德','hnkd.jishutao.com',null,null,null,null,9);
-insert into branch_office_info values(7,'昆明科道','kmkd.jishutao.com',null,null,null,null,7);
-insert into branch_office_info values(8,'石家庄科中','sjzkz.jishutao.com',null,null,null,null,19);
-insert into branch_office_info values(9,'青岛科德','qdkd.jishutao.com',null,null,null,null,27);
-insert into branch_office_info values(10,'长春科德','cckd.jishutao.com',null,null,null,null,29);
-insert into branch_office_info values(11,'广州科丰','gzkf.jishutao.com',null,null,null,null,12);
-insert into branch_office_info values(12,'北京科德','bjkd.jishutao.com',null,null,null,null,1);
-insert into branch_office_info values(13,'山东科德','sdkd.jishutao.com',null,null,null,null,27);
-insert into branch_office_info values(14,'江苏科德','jskd.jishutao.com',null,null,null,null,22);
-insert into branch_office_info values(15,'武汉科汇','whkh.jishutao.com',null,null,null,null,10);
-insert into branch_office_info values(16,'合肥科稻','hfkd.jishutao.com',null,null,null,null,24);
-insert into branch_office_info values(17,'成都科德','cdkd.jishutao.com',null,null,null,null,5);
-insert into branch_office_info values(18,'内蒙古科发','nmgkf.jishutao.com',null,null,null,null,21);
-insert into branch_office_info values(19,'南宁科发','nnkf.jishutao.com',null,null,null,null,13);
-insert into branch_office_info values(20,'沈阳科德','sykd.jishutao.com',null,null,null,null,28);
-insert into branch_office_info values(21,'湖南科德','www.jishutao.com',null,null,null,null,11);

+ 0 - 9
schema/20170829-member_grade.sql

@@ -1,9 +0,0 @@
-CREATE TABLE `member_grade` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `grade_name` varchar(50) NOT NULL,
-  `business` longtext,
-  `cost` longtext,
-  `member_rank` int(11) DEFAULT NULL,
-  PRIMARY KEY (`id`),
-  UNIQUE KEY `gradeName_UNIQUE` (`grade_name`)
-)

+ 0 - 15
schema/20170901-member_order.sql

@@ -1,15 +0,0 @@
-CREATE TABLE `member_order` (
-  `id` bigint(19) NOT NULL,
-  `menber_type` int(11) NOT NULL COMMENT '付费会员类型',
-  `price` double(10,2) NOT NULL COMMENT '价格',
-  `valid_month` int(11) NOT NULL COMMENT '会员月类型',
-  `order_state` int(11) NOT NULL COMMENT '付款状态  0:未付款 1:已付款',
-  `order_time` datetime NOT NULL COMMENT '下单时间',
-  `user_id` varchar(36) NOT NULL COMMENT '用户ID 外键',
-  `payment_time` datetime DEFAULT NULL COMMENT '支付时间',
-  `payment_value` double(10,2) DEFAULT NULL COMMENT '实际支付金额',
-  `payment_type` varchar(16) DEFAULT NULL COMMENT '支付方式',
-  `payment_id` varchar(45) DEFAULT NULL COMMENT '支付流水号',
-  `valid_time` datetime DEFAULT NULL COMMENT '有效时间',
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;

+ 0 - 2
schema/20170911-achievement-intro-length.sql

@@ -1,2 +0,0 @@
-ALTER TABLE `achievement` 
-CHANGE COLUMN `introduction` `introduction` LONGTEXT NULL DEFAULT NULL COMMENT '成果简介' ;

+ 0 - 15
schema/20170913-consult-order.sql

@@ -1,15 +0,0 @@
-CREATE TABLE `consult_order` (
-  `id` bigint(19) NOT NULL,
-  `price` double(10,2) NOT NULL COMMENT '价格',
-  `order_state` int(11) NOT NULL COMMENT '付款状态  0:未付款 1:已付款',
-  `order_time` datetime NOT NULL COMMENT '下单时间',
-  `user_id` varchar(36) NOT NULL COMMENT '用户ID 外键',
-  `to_user_id` varchar(36) NOT NULL COMMENT '专家用户ID 外键',
-  `payment_time` datetime DEFAULT NULL COMMENT '支付时间',
-  `payment_value` double(10,2) DEFAULT NULL COMMENT '实际支付金额',
-  `payment_type` varchar(16) DEFAULT NULL COMMENT '支付方式',
-  `payment_id` varchar(45) DEFAULT NULL COMMENT '支付流水号',
-  PRIMARY KEY (`id`)
-)
-
-INSERT INTO `sys_dict` (`id`, `value`) VALUES ('consult_price', '600.00');

+ 0 - 4
schema/20170916-alert-achievement-demand.sql

@@ -1,4 +0,0 @@
-alter table achievement add column boutique int(1) default 0 comment '是否为精品成果 0-否 1-是';
-alter table demand add column boutique int(1) default 0 comment '是否为精品成果 0-否 1-是';
-alter table organization_info add column company_type int(1) comment '公司类型';
-update organization_info set company_type = 0 where identity_type = '企业';

+ 0 - 10
schema/20170918-achievement-order-change.sql

@@ -1,10 +0,0 @@
-ALTER TABLE `achievement_order` 
-DROP COLUMN `service_money`,
-DROP COLUMN `commission`,
-DROP COLUMN `contract_money`,
-DROP COLUMN `intention_money`,
-CHANGE COLUMN `status` `status` INT(2) NULL DEFAULT NULL COMMENT '(0, \"未支付\"),(1, \"已支付\"),(2, \"支付中\"),(3, \"完成\"),(9, \"取消\"),(10, \"无效\")' ,
-ADD COLUMN `payment_value` DOUBLE(10,2) NULL COMMENT '实际支付金额' AFTER `status`,
-ADD COLUMN `payment_type` VARCHAR(16) NULL COMMENT '支付方式' AFTER `payment_value`,
-ADD COLUMN `payment_id` VARCHAR(45) NULL COMMENT '支付流水号' AFTER `payment_type`,
-ADD COLUMN `payment_time` DATETIME NULL COMMENT '支付时间' AFTER `payment_id`;

+ 0 - 2
schema/20170920-member-rank-unique.sql

@@ -1,2 +0,0 @@
-ALTER TABLE `member_grade` 
-ADD UNIQUE INDEX `member_rank_UNIQUE` (`member_rank` ASC);

+ 0 - 10
schema/20180202-sales-report.sql

@@ -1,10 +0,0 @@
-CREATE TABLE `daily_sales_report` (
-  `id` int(10) NOT NULL AUTO_INCREMENT,
-  `admin_id` varchar(36) DEFAULT NULL COMMENT '员工id',
-  `dep_id` varchar(36) DEFAULT NULL COMMENT '部门id',
-  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '统计日期',
-  `order_count` int(8) DEFAULT '0' COMMENT '销售签单数量',
-  `order_amount` decimal(12,2) DEFAULT '0.00' COMMENT '销售签单总额',
-  PRIMARY KEY (`id`),
-  KEY `timeIdx` (`create_time`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;

+ 9 - 5
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -117,7 +117,7 @@ public class WebpageController extends BaseController {
 
 	@RequestMapping(value = "/admin/login", method = RequestMethod.GET)
 	public String adminLogin(HttpServletRequest request, ModelAndView modelview) {
-		return "/admin/login";
+ 		return "/admin/login";
 	}
 
 	@RequestMapping(value = "/admin/demand", method = RequestMethod.GET)
@@ -226,10 +226,10 @@ public class WebpageController extends BaseController {
 	@RequestMapping(value = "/portal/index", method = RequestMethod.GET)
 	public ModelAndView portalIndex(HttpServletRequest request, ModelAndView modelview) {
 		modelview.setViewName("/portal/index");
-		List<Banners> banners = bannersService.findPortalBanners(BannersType.SHOU_YE.getKey());
+		/*List<Banners> banners = bannersService.findPortalBanners(BannersType.SHOU_YE.getKey());
 		if (!banners.isEmpty()) {
 			modelview.addObject("banner", banners.get(0));
-		}
+		}*/
 		//政策
 		modelview.addObject("jtdt", newsService.findIndexNewsList(0, NewsType.JTDT.getCode(), 4));
 		//服务项目
@@ -448,6 +448,10 @@ public class WebpageController extends BaseController {
 		return modelview;
 	}
 	
+	@RequestMapping(value = "/admin/statistics", method = RequestMethod.GET)
+	public ModelAndView adminStatistics(HttpServletRequest request, ModelAndView modelview) {
+		modelview.setViewName("/admin/statistics");
+		return modelview;
+	}
 	
-	
-}
+}

+ 1 - 1
src/main/java/com/goafanti/common/dao/AdminMapper.java

@@ -175,6 +175,6 @@ public interface AdminMapper {
 
 	List<AdminListBo> getListDefaultPassword(String id);
 
-	
+	int getCountById(String id);
 
 }

+ 109 - 0
src/main/java/com/goafanti/common/dao/TOrderBillNewMapper.java

@@ -0,0 +1,109 @@
+package com.goafanti.common.dao;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+
+import com.goafanti.common.model.TOrderBillNew;
+import com.goafanti.common.model.TOrderBillNewExample;
+
+public interface TOrderBillNewMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_order_bill_new
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    int countByExample(TOrderBillNewExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_order_bill_new
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    int deleteByExample(TOrderBillNewExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_order_bill_new
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    int deleteByPrimaryKey(String billNo);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_order_bill_new
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    int insert(TOrderBillNew record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_order_bill_new
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    int insertSelective(TOrderBillNew record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_order_bill_new
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    List<TOrderBillNew> selectByExample(TOrderBillNewExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_order_bill_new
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    TOrderBillNew selectByPrimaryKey(String billNo);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_order_bill_new
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    int updateByExampleSelective(@Param("record") TOrderBillNew record, @Param("example") TOrderBillNewExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_order_bill_new
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    int updateByExample(@Param("record") TOrderBillNew record, @Param("example") TOrderBillNewExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_order_bill_new
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    int updateByPrimaryKeySelective(TOrderBillNew record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_order_bill_new
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    int updateByPrimaryKey(TOrderBillNew record);
+    
+    BigDecimal getAmountByOid(String oid);
+    
+    TOrderBillNew getOneRefundFlow(String BillNo);
+    
+    List<TOrderBillNew> getOneOrderAllRefundFlow(String oid);
+    
+    List<TOrderBillNew> getDeptBySome(TOrderBillNew ob);
+    
+    List<TOrderBillNew> getBillData(TOrderBillNew ob);
+}

+ 5 - 1
src/main/java/com/goafanti/common/dao/TOrderNewMapper.java

@@ -120,5 +120,9 @@ public interface TOrderNewMapper {
      */
     int updateByPrimaryKey(TOrderNew record);
 
-    TOrderNewBo getOrderNewDetail(String orderNo);
+    TOrderNewBo getOrderNewDetail(String orderNo); 
+    int getCountByIdAndStatus(TOrderNew orderNew);
+    
+    String getSaleIdByOno(String ono);
+
 }

+ 2 - 0
src/main/java/com/goafanti/common/dao/TOrderRefundMapper.java

@@ -93,4 +93,6 @@ public interface TOrderRefundMapper {
 	 * @mbg.generated  Tue Nov 20 15:20:39 CST 2018
 	 */
 	int updateByPrimaryKey(TOrderRefund record);
+	
+	int updateRefundById(TOrderRefund record);
 }

+ 7 - 0
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -954,4 +954,11 @@
   	update admin set status = '锁定' where id in (${lockIds})
   </update>
   
+  <!--  用户是为正常的 -->
+  <select id="getCountById" parameterType="java.lang.String" resultType="java.lang.Integer">
+  	select count(a.id)  from admin a
+   	inner join user_role ur on a.id=ur.uid
+   	where a.id= #{_parameter,jdbcType=VARCHAR} and ( a.status != '注销' or a.status is null)
+  </select>
+  
 </mapper>

+ 2 - 0
src/main/java/com/goafanti/common/mapper/TOrderBackMapper.xml

@@ -3,6 +3,7 @@
 <mapper namespace="com.goafanti.common.dao.TOrderBackMapper">
   <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderBack">
     <!--
+
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Wed Nov 21 11:44:14 CST 2018.
@@ -422,5 +423,6 @@
   </update>
   <update id="updateByOrderNoAndBackStatus" parameterType="java.lang.String">
   update t_order_back set back_status=1 where  back_status=0 and order_no= #{orderNo,jdbcType=VARCHAR} 
+
   </update>
 </mapper>

+ 603 - 0
src/main/java/com/goafanti/common/mapper/TOrderBillNewMapper.xml

@@ -0,0 +1,603 @@
+<?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.goafanti.common.dao.TOrderBillNewMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderBillNew">
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:14:40 CST 2018.
+    -->
+    <id column="bill_no" jdbcType="VARCHAR" property="billNo" />
+    <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
+    <result column="creater" jdbcType="VARCHAR" property="creater" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="payee_id" jdbcType="VARCHAR" property="payeeId" />
+    <result column="payer_id" jdbcType="VARCHAR" property="payerId" />
+    <result column="transaction_amount" jdbcType="DECIMAL" property="transactionAmount" />
+    <result column="transaction_subject" jdbcType="INTEGER" property="transactionSubject" />
+    <result column="transaction_channel" jdbcType="INTEGER" property="transactionChannel" />
+    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
+    <result column="confirm_sign" jdbcType="INTEGER" property="confirmSign" />
+    <result column="delete_sign" jdbcType="TINYINT" property="deleteSign" />
+    <result column="financial_pay_no" jdbcType="VARCHAR" property="financialPayNo" />
+    <result column="financial_pay_time" jdbcType="TIMESTAMP" property="financialPayTime" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:14:40 CST 2018.
+    -->
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:14:40 CST 2018.
+    -->
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:14:40 CST 2018.
+    -->
+    bill_no, order_no, creater, create_time, update_time, payee_id, payer_id, transaction_amount, 
+    transaction_subject, transaction_channel, remarks, confirm_sign, delete_sign, financial_pay_no, 
+    financial_pay_time
+  </sql>
+  <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderBillNewExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:14:40 CST 2018.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from t_order_bill_new
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:14:40 CST 2018.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from t_order_bill_new
+    where bill_no = #{billNo,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:14:40 CST 2018.
+    -->
+    delete from t_order_bill_new
+    where bill_no = #{billNo,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderBillNewExample">
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:14:40 CST 2018.
+    -->
+    delete from t_order_bill_new
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.TOrderBillNew">
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:14:40 CST 2018.
+    -->
+    insert into t_order_bill_new (bill_no, order_no, creater, 
+      create_time, update_time, payee_id, 
+      payer_id, transaction_amount, transaction_subject, 
+      transaction_channel, remarks, confirm_sign, 
+      delete_sign, financial_pay_no, financial_pay_time
+      )
+    values (#{billNo,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, #{creater,jdbcType=VARCHAR}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{payeeId,jdbcType=VARCHAR}, 
+      #{payerId,jdbcType=VARCHAR}, #{transactionAmount,jdbcType=DECIMAL}, #{transactionSubject,jdbcType=INTEGER}, 
+      #{transactionChannel,jdbcType=INTEGER}, #{remarks,jdbcType=VARCHAR}, #{confirmSign,jdbcType=INTEGER}, 
+      #{deleteSign,jdbcType=TINYINT}, #{financialPayNo,jdbcType=VARCHAR}, #{financialPayTime,jdbcType=TIMESTAMP}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderBillNew">
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:14:40 CST 2018.
+    -->
+    insert into t_order_bill_new
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="billNo != null">
+        bill_no,
+      </if>
+      <if test="orderNo != null">
+        order_no,
+      </if>
+      <if test="creater != null">
+        creater,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+      <if test="payeeId != null">
+        payee_id,
+      </if>
+      <if test="payerId != null">
+        payer_id,
+      </if>
+      <if test="transactionAmount != null">
+        transaction_amount,
+      </if>
+      <if test="transactionSubject != null">
+        transaction_subject,
+      </if>
+      <if test="transactionChannel != null">
+        transaction_channel,
+      </if>
+      <if test="remarks != null">
+        remarks,
+      </if>
+      <if test="confirmSign != null">
+        confirm_sign,
+      </if>
+      <if test="deleteSign != null">
+        delete_sign,
+      </if>
+      <if test="financialPayNo != null">
+        financial_pay_no,
+      </if>
+      <if test="financialPayTime != null">
+        financial_pay_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="billNo != null">
+        #{billNo,jdbcType=VARCHAR},
+      </if>
+      <if test="orderNo != null">
+        #{orderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="creater != null">
+        #{creater,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="payeeId != null">
+        #{payeeId,jdbcType=VARCHAR},
+      </if>
+      <if test="payerId != null">
+        #{payerId,jdbcType=VARCHAR},
+      </if>
+      <if test="transactionAmount != null">
+        #{transactionAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="transactionSubject != null">
+        #{transactionSubject,jdbcType=INTEGER},
+      </if>
+      <if test="transactionChannel != null">
+        #{transactionChannel,jdbcType=INTEGER},
+      </if>
+      <if test="remarks != null">
+        #{remarks,jdbcType=VARCHAR},
+      </if>
+      <if test="confirmSign != null">
+        #{confirmSign,jdbcType=INTEGER},
+      </if>
+      <if test="deleteSign != null">
+        #{deleteSign,jdbcType=TINYINT},
+      </if>
+      <if test="financialPayNo != null">
+        #{financialPayNo,jdbcType=VARCHAR},
+      </if>
+      <if test="financialPayTime != null">
+        #{financialPayTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.goafanti.common.model.TOrderBillNewExample" resultType="java.lang.Integer">
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:14:40 CST 2018.
+    -->
+    select count(*) from t_order_bill_new
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:14:40 CST 2018.
+    -->
+    update t_order_bill_new
+    <set>
+      <if test="record.billNo != null">
+        bill_no = #{record.billNo,jdbcType=VARCHAR},
+      </if>
+      <if test="record.orderNo != null">
+        order_no = #{record.orderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="record.creater != null">
+        creater = #{record.creater,jdbcType=VARCHAR},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.payeeId != null">
+        payee_id = #{record.payeeId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.payerId != null">
+        payer_id = #{record.payerId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.transactionAmount != null">
+        transaction_amount = #{record.transactionAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="record.transactionSubject != null">
+        transaction_subject = #{record.transactionSubject,jdbcType=INTEGER},
+      </if>
+      <if test="record.transactionChannel != null">
+        transaction_channel = #{record.transactionChannel,jdbcType=INTEGER},
+      </if>
+      <if test="record.remarks != null">
+        remarks = #{record.remarks,jdbcType=VARCHAR},
+      </if>
+      <if test="record.confirmSign != null">
+        confirm_sign = #{record.confirmSign,jdbcType=INTEGER},
+      </if>
+      <if test="record.deleteSign != null">
+        delete_sign = #{record.deleteSign,jdbcType=TINYINT},
+      </if>
+      <if test="record.financialPayNo != null">
+        financial_pay_no = #{record.financialPayNo,jdbcType=VARCHAR},
+      </if>
+      <if test="record.financialPayTime != null">
+        financial_pay_time = #{record.financialPayTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:14:40 CST 2018.
+    -->
+    update t_order_bill_new
+    set bill_no = #{record.billNo,jdbcType=VARCHAR},
+      order_no = #{record.orderNo,jdbcType=VARCHAR},
+      creater = #{record.creater,jdbcType=VARCHAR},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      payee_id = #{record.payeeId,jdbcType=VARCHAR},
+      payer_id = #{record.payerId,jdbcType=VARCHAR},
+      transaction_amount = #{record.transactionAmount,jdbcType=DECIMAL},
+      transaction_subject = #{record.transactionSubject,jdbcType=INTEGER},
+      transaction_channel = #{record.transactionChannel,jdbcType=INTEGER},
+      remarks = #{record.remarks,jdbcType=VARCHAR},
+      confirm_sign = #{record.confirmSign,jdbcType=INTEGER},
+      delete_sign = #{record.deleteSign,jdbcType=TINYINT},
+      financial_pay_no = #{record.financialPayNo,jdbcType=VARCHAR},
+      financial_pay_time = #{record.financialPayTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderBillNew">
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:14:40 CST 2018.
+    -->
+    update t_order_bill_new
+    <set>
+      <if test="orderNo != null">
+        order_no = #{orderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="creater != null">
+        creater = #{creater,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="payeeId != null">
+        payee_id = #{payeeId,jdbcType=VARCHAR},
+      </if>
+      <if test="payerId != null">
+        payer_id = #{payerId,jdbcType=VARCHAR},
+      </if>
+      <if test="transactionAmount != null">
+        transaction_amount = #{transactionAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="transactionSubject != null">
+        transaction_subject = #{transactionSubject,jdbcType=INTEGER},
+      </if>
+      <if test="transactionChannel != null">
+        transaction_channel = #{transactionChannel,jdbcType=INTEGER},
+      </if>
+      <if test="remarks != null">
+        remarks = #{remarks,jdbcType=VARCHAR},
+      </if>
+      <if test="confirmSign != null">
+        confirm_sign = #{confirmSign,jdbcType=INTEGER},
+      </if>
+      <if test="deleteSign != null">
+        delete_sign = #{deleteSign,jdbcType=TINYINT},
+      </if>
+      <if test="financialPayNo != null">
+        financial_pay_no = #{financialPayNo,jdbcType=VARCHAR},
+      </if>
+      <if test="financialPayTime != null">
+        financial_pay_time = #{financialPayTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where bill_no = #{billNo,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderBillNew">
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Nov 20 11:14:40 CST 2018.
+    -->
+    update t_order_bill_new
+    set order_no = #{orderNo,jdbcType=VARCHAR},
+      creater = #{creater,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP},
+      payee_id = #{payeeId,jdbcType=VARCHAR},
+      payer_id = #{payerId,jdbcType=VARCHAR},
+      transaction_amount = #{transactionAmount,jdbcType=DECIMAL},
+      transaction_subject = #{transactionSubject,jdbcType=INTEGER},
+      transaction_channel = #{transactionChannel,jdbcType=INTEGER},
+      remarks = #{remarks,jdbcType=VARCHAR},
+      confirm_sign = #{confirmSign,jdbcType=INTEGER},
+      delete_sign = #{deleteSign,jdbcType=TINYINT},
+      financial_pay_no = #{financialPayNo,jdbcType=VARCHAR},
+      financial_pay_time = #{financialPayTime,jdbcType=TIMESTAMP}
+    where bill_no = #{billNo,jdbcType=VARCHAR}
+  </update>
+  <!-- 根据订单编号获得已交款 -->
+  <select id="getAmountByOid" parameterType="java.lang.String" resultType="java.math.BigDecimal">
+  	select ifnull(sum(transaction_amount),0) amout from t_order_bill_new
+  	where delete_sign = 0 and order_no = #{_parameter,jdbcType=VARCHAR}
+  </select>
+  <!-- 根据流水编号获得流水详情 -->
+  <select id="getOneRefundFlow" parameterType="java.lang.String" resultType="com.goafanti.common.model.TOrderBillNew">
+  	select 
+  	b.bill_no as billNo, b.order_no as orderNo, b.creater, b.create_time as createTime, b.update_time as updateTime, 
+  	b.payee_id as payeeId, b.payer_id as payerId, b.transaction_amount as transactionAmount, 
+    b.transaction_subject as transactionSubject, b.transaction_channel as transactionChannel,  
+    b.remarks, b.confirm_sign confirmSign, b.delete_sign deleteSign, b.financial_pay_no as financialPayNo, 
+    b.financial_pay_time as financialPayTimes, u.nickname as payerName, a.name as payeeName
+     from t_order_bill_new b 
+  	left join `user` u on b.payer_id = u.id
+  	left join admin a on b.payee_id = a.id
+  	where b.delete_sign = 0 and bill_no = #{_parameter,jdbcType=VARCHAR}
+  </select>
+  <!-- 根据订单编号查看该订单相关的所有流水 -->
+  <select id="getOneOrderAllRefundFlow" parameterType="java.lang.String" resultType="com.goafanti.common.model.TOrderBillNew">
+  	select 
+  	b.bill_no as billNo, b.order_no as orderNo, b.creater, b.create_time as createTime, b.update_time as updateTime, 
+  	b.payee_id as payeeId, b.payer_id as payerId, b.transaction_amount as transactionAmount, 
+    b.transaction_subject as transactionSubject, b.transaction_channel as transactionChannel,  
+    b.remarks, b.confirm_sign confirmSign, b.delete_sign deleteSign, b.financial_pay_no as financialPayNo, 
+    b.financial_pay_time as financialPayTimes, u.nickname as payerName, a.name as payeeName
+     from t_order_bill_new b 
+  	left join `user` u on b.payer_id = u.id
+  	left join admin a on b.payee_id = a.id
+  	where b.delete_sign = 0 and order_no = #{_parameter,jdbcType=VARCHAR}
+  </select>
+  <!-- 查看自己创建的流水数据 -->
+  <select id="myBillList" parameterType="Map" resultType="com.goafanti.common.model.TOrderBillNew">
+  select 
+  	b.bill_no as billNo, b.order_no as orderNo, b.transaction_amount as transactionAmount,
+  	b.payer_id as payerId, b.payee_id as payeeId, u.nickname as payerName, a.name as payeeName, 
+  	b.transaction_subject as transactionSubject, b.transaction_channel as transactionChannel, 
+  	b.financial_pay_time as financialPayTimes,b.financial_pay_no as financialPayNo,
+  	b.creater, ad.name as createrName, o.salesman_id as saleId, oa.name as saleName
+  	from t_order_bill_new b
+  	left join `user` u on b.payer_id = u.id
+  	left join admin a on b.payee_id = a.id
+  	left join admin ad on b.creater = ad.id
+  	left join t_order_new o on o.order_no = b.order_no
+  	left join admin oa on oa.id = o.salesman_id
+  	where delete_sign = 0 
+  	<if test='b.create != null and b.create != ""'>
+  	and creater = #{creater,jdbcType=VARCHAR}
+  	</if>
+  	<if test='b.payerName != null and b.payerName != ""'>
+  	<bind name="nn" value="'%' + b.payerName + '%'"/>
+  	and u.nickname like #{nn,jdbcType=VARCHAR}
+  	</if>
+  	<if test='b.payeeName != null and b.payeeName != ""'>
+  	<bind name="n" value="'%' + b.payeeName + '%'"/>
+  	and a.name like #{n,jdbcType=VARCHAR}
+  	</if>
+  	<if test='b.departmentId != null and b.departmentId != "" '>
+  	and oa.department_id = #{b.departmentId,jdbcType=VARCHAR}
+  	</if>
+  	<if test='b.startTime != null and b.startTime != "" and b.endTime != null and b.endTime != ""'>
+  	<bind name="a" value="b.startTime + ' 00:00:00'"/>
+  	<bind name="e" value="b.endTime + ' 23:59:59'"/>
+  	and b.create_time between #{a,jdbcType=VARCHAR} and #{e,jdbcType=VARCHAR}
+  	</if>
+  	order by b.create_time desc
+  	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  <select id="myBillCount" parameterType="Map" resultType="java.lang.Integer">
+  select count(*)
+  	from t_order_bill_new b
+  	left join `user` u on b.payer_id = u.id
+  	left join admin a on b.payee_id = a.id
+  	left join t_order_new o on o.order_no = b.order_no
+  	left join admin oa on oa.id = o.salesman_id
+  	where delete_sign = 0 
+  	<if test='b.create != null and b.create != ""'>
+  	and creater = #{creater,jdbcType=VARCHAR}
+  	</if>
+  	<if test='b.payerName != null and b.payerName != ""'>
+  	<bind name="nn" value="'%' + b.payerName + '%'"/>
+  	and u.nickname like #{nn,jdbcType=VARCHAR}
+  	</if>
+  	<if test='b.payeeName != null and b.payeeName != ""'>
+  	<bind name="n" value="'%' + b.payeeName + '%'"/>
+  	and a.name like #{n,jdbcType=VARCHAR}
+  	</if>
+  	<if test='b.departmentId != null and b.departmentId != "" '>
+  	and oa.department_id = #{b.departmentId,jdbcType=VARCHAR}
+  	</if>
+  	<if test='b.startTime != null and b.startTime != "" and b.endTime != null and b.endTime != ""'>
+  	<bind name="a" value="b.startTime + ' 00:00:00'"/>
+  	<bind name="e" value="b.endTime + ' 23:59:59'"/>
+  	and b.create_time between #{a,jdbcType=VARCHAR} and #{e,jdbcType=VARCHAR}
+  	</if>
+  </select>
+  <!-- 带条件的流水部门 -->
+  <select id="getDeptBySome" parameterType="com.goafanti.common.model.TOrderBillNew" resultType="com.goafanti.common.model.TOrderBillNew">
+  	select distinct
+	  	d.id as departmentId, d.name as departmentName
+	  	from t_order_bill_new b
+	  	left join `user` u on b.payer_id = u.id
+	  	left join admin a on b.payee_id = a.id
+	  	left join t_order_new o on o.order_no = b.order_no
+	  	left join admin oa on oa.id = o.salesman_id 
+	  	left join department d on oa.department_id = d.id
+	  	where 
+	  	b.delete_sign = 0 
+	  	<if test='payerName != null and payerName != ""'>
+	  	<bind name="nn" value="'%' + payerName + '%'"/>
+	  	and u.nickname like #{nn,jdbcType=VARCHAR}
+	  	</if>
+	  	<if test='payeeName != null and payeeName != ""'>
+	  	<bind name="n" value="'%' + payeeName + '%'"/>
+	  	and a.name like #{n,jdbcType=VARCHAR}
+	  	</if>
+	  	<if test='startTime != null and startTime != "" and endTime != null and endTime != ""'>
+	  	<bind name="a" value="startTime + ' 00:00:00'"/>
+	  	<bind name="e" value="endTime + ' 23:59:59'"/>
+	  	and b.create_time between #{a,jdbcType=VARCHAR} and #{e,jdbcType=VARCHAR}
+	  	</if>
+  </select>
+  <!-- 获得流水记录 -->
+  <select id="getBillData" parameterType="com.goafanti.common.model.TOrderBillNew" resultType="com.goafanti.common.model.TOrderBillNew">
+  select 
+  	b.bill_no as billNo, b.order_no as orderNo, b.transaction_amount as transactionAmount,
+  	u.nickname as payerName, a.name as payeeName, 
+  	b.transaction_subject as transactionSubject, b.transaction_channel as transactionChannel, 
+  	b.financial_pay_time as financialPayTimes,b.financial_pay_no as financialPayNo,
+  	b.creater, ad.name as createrName, oa.name as saleName, b.create_time as createTime
+  	from t_order_bill_new b
+  	left join `user` u on b.payer_id = u.id
+  	left join admin a on b.payee_id = a.id
+  	left join admin ad on b.creater = ad.id
+  	left join t_order_new o on o.order_no = b.order_no
+  	left join admin oa on oa.id = o.salesman_id
+  	where b.delete_sign = 0 
+  	<if test='payerName != null and payerName != ""'>
+  	<bind name="nn" value="'%' + payerName + '%'"/>
+  	and u.nickname like #{nn,jdbcType=VARCHAR}
+  	</if>
+  	<if test='payeeName != null and payeeName != ""'>
+  	<bind name="n" value="'%' + payeeName + '%'"/>
+  	and a.name like #{n,jdbcType=VARCHAR}
+  	</if>
+  	<if test='departmentId != null and departmentId != "" '>
+  	and oa.department_id = #{departmentId,jdbcType=VARCHAR}
+  	</if>
+  	<if test='startTime != null and startTime != "" and endTime != null and endTime != ""'>
+  	<bind name="a" value="startTime + ' 00:00:00'"/>
+  	<bind name="e" value="endTime + ' 23:59:59'"/>
+  	and b.create_time between #{a,jdbcType=VARCHAR} and #{e,jdbcType=VARCHAR}
+  	</if>
+  	order by b.order_no, b.creater , b.financial_pay_time
+ </select>
+</mapper>

+ 194 - 1
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -795,7 +795,200 @@
       proof_aid = #{proofAid,jdbcType=VARCHAR}
     where order_no = #{orderNo,jdbcType=VARCHAR}
   </update>
-   <select id="selectOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
+  
+  <!-- 查看所有待财务管理员分配的订单数据 -->
+  <select id="getAllUnassignedListOrder" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
+  	select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
+  	o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
+  	from t_order_new o 
+  	left join `user` u on o.buyer_id = u.id
+  	left join admin a on o.salesman_id = a.id
+  	where delete_sign = 0
+  	and order_status = 2
+  	<if test="o.processStatus != null">
+  	and process_status = #{o.processStatus,jdbcType=INTEGER}
+  	</if>
+  	<if test='o.orderNo != null and o.orderNo != ""'>
+  	and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
+  	</if>
+  	<if test='o.financeId != null and o.financeId != ""'>
+  	and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
+  	</if>
+  	<if test='o.buyerName != null and o.buyerName != ""'>
+  	<bind name="n" value="'%' + o.buyerName + '%'"/>
+  	and u.nickname  like #{n,jdbcType=VARCHAR}
+  	</if>
+  	<if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
+  	<bind name="a" value="o.startTime + ' 00:00:00'"/>
+  	<bind name="b" value="o.endTime + ' 23:59:59'"/>
+  	and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
+  	</if>
+  	<if test="ob == 1">
+  	order by o.sign_time
+  	</if>
+  	<if test="ob == 2">
+  	order by o.liquidation_status,o.sign_time
+  	</if>
+	<if test="page_sql != null">
+		${page_sql}
+	</if>
+  </select>
+  <select id="getAllUnassignedCountOrder" parameterType="Map" resultType="java.lang.Integer">
+  	select count(*)  from t_order_new o 
+  	left join `user` u on o.buyer_id = u.id
+  	left join admin a on o.salesman_id = a.id
+  	where delete_sign = 0
+  	and order_status = 2
+  	<if test="o.processStatus != null">
+  	and process_status = #{o.processStatus,jdbcType=VARCHAR}
+  	</if>
+  	<if test='o.orderNo != null and o.orderNo != ""'>
+  	and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
+  	</if>
+  	<if test='financeId != null and financeId != ""'>
+  	and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
+  	</if>
+  	<if test='o.buyerName != null and o.buyerName != ""'>
+  	<bind name="n" value="'%' + o.buyerName + '%'"/>
+  	and u.nickname  like #{n,jdbcType=VARCHAR}
+  	</if>
+  	<if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
+  	<bind name="a" value="o.startTime + ' 00:00:00'"/>
+  	<bind name="b" value="o.endTime + ' 23:59:59'"/>
+  	and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
+  	</if>
+  </select>
+  <!-- 查看某订单状态是否符合要求 -->
+  <select id="getCountByIdAndStatus" parameterType="com.goafanti.common.model.TOrderNew" resultType="java.lang.Integer">
+  		select count(*) from t_order_new 
+  		where order_no = #{orderNo,jdbcType=VARCHAR}
+  	  <if test="orderType != null">
+       and order_type = #{orderType,jdbcType=INTEGER}
+      </if>
+      <if test="creater != null">
+       and creater = #{creater,jdbcType=VARCHAR}
+      </if>
+      <if test="buyerId != null">
+       and buyer_id = #{buyerId,jdbcType=VARCHAR}
+      </if>
+      <if test="firstAmount != null">
+       and first_amount = #{firstAmount,jdbcType=DECIMAL}
+      </if>
+      <if test="totalAmount != null">
+       and total_amount = #{totalAmount,jdbcType=DECIMAL}
+      </if>
+      <if test="settlementAmount != null">
+       and settlement_amount = #{settlementAmount,jdbcType=DECIMAL}
+      </if>
+      <if test="orderStatus != null">
+       and order_status = #{orderStatus,jdbcType=INTEGER}
+      </if>
+      <if test="liquidationStatus == 1">
+       and liquidation_status between 1 and 2 
+      </if>
+      <if test="processStatus != null">
+       and process_status = #{processStatus,jdbcType=INTEGER}
+      </if>
+      <if test="projectStatus != null">
+       and project_status = #{projectStatus,jdbcType=INTEGER}
+      </if>
+      <if test="approval != null">
+       and approval = #{approval,jdbcType=INTEGER}
+      </if>
+      <if test="orderRemarks != null">
+       and order_remarks = #{orderRemarks,jdbcType=VARCHAR}
+      </if>
+      <if test="deleteSign != null">
+       and delete_sign = #{deleteSign,jdbcType=INTEGER}
+      </if>
+      <if test="salesmanId != null">
+       and salesman_id = #{salesmanId,jdbcType=VARCHAR}
+      </if>
+      <if test="financeId != null">
+       and finance_id = #{financeId,jdbcType=VARCHAR}
+      </if>
+      <if test="technicianId != null">
+       and technician_id = #{technicianId,jdbcType=VARCHAR}
+      </if>
+      <if test="contractNo != null">
+       and contract_no = #{contractNo,jdbcType=VARCHAR}
+      </if>
+      <if test="contractType != null">
+       and contract_type = #{contractType,jdbcType=VARCHAR}
+      </if>
+      <if test="contacts != null">
+       and contacts = #{contacts,jdbcType=VARCHAR}
+      </if>
+      <if test="contactMobile != null">
+       and contact_mobile = #{contactMobile,jdbcType=VARCHAR}
+      </if>
+      <if test="legalPerson != null">
+       and legal_person = #{legalPerson,jdbcType=VARCHAR}
+      </if>
+      <if test="legalPersonTel != null">
+       and legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR}
+      </if>
+  </select>
+  <!-- 财务专员查看需要待收款的数据 -->
+  <select id="financeList" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
+  select  o.order_no as orderNo, o.sign_time as signTime, u.nickname as buyerName, o.order_status as orderStatus, 
+  a.name as sellerName, o.salesman_id as sellerId, o.buyer_id as buyerId, o.liquidation_status as liquidationStatus , 
+  ifnull(b.amount,0) as actuallyTotalAmount
+  	 from t_order_new o 
+  	 left join `user` u on o.buyer_id = u.id 
+  	 left join admin a on o.salesman_id = a.id
+  	 left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new
+  				group by order_no ) b on b.order_no = o.order_no
+  	 where delete_sign = 0
+  		and process_status >= 3
+  		and (approval = 0 or approval = 2)
+	  	and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
+  		<if test='o.orderNo != null and o.orderNo != ""'>
+	  	and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
+	  	</if>
+	  	<if test='o.buyerName != null and o.buyerName != ""'>
+	  	<bind name="n" value="'%' + o.buyerName + '%'"/>
+	  	and u.nickname  like #{n,jdbcType=VARCHAR}
+	  	</if>
+	  	<if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
+	  	<bind name="a" value="o.startTime + ' 00:00:00'"/>
+	  	<bind name="b" value="o.endTime + ' 23:59:59'"/>
+	  	and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
+	  	</if>
+	  	order by o.liquidation_status, o.sign_time
+	  	<if test="page_sql != null">
+			${page_sql}
+		</if>
+  </select>
+  <select id="financeCount" parameterType="Map" resultType="java.lang.Integer">
+  select count(*)
+  	 from t_order_new o 
+  	 left join `user` u on o.buyer_id = u.id 
+  	 left join admin a on o.salesman_id = a.id
+  	 left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new
+  				group by order_no ) b on b.order_no = o.order_no
+  	 where delete_sign = 0
+  		and process_status >= 3
+  		and (approval = 0 or approval = 2)
+	  	and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
+  		<if test='o.orderNo != null and o.orderNo != ""'>
+	  	and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
+	  	</if>
+	  	<if test='o.buyerName != null and o.buyerName != ""'>
+	  	<bind name="n" value="'%' + o.buyerName + '%'"/>
+	  	and u.nickname  like #{n,jdbcType=VARCHAR}
+	  	</if>
+	  	<if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
+	  	<bind name="a" value="o.startTime + ' 00:00:00'"/>
+	  	<bind name="b" value="o.endTime + ' 23:59:59'"/>
+	  	and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
+	  	</if>
+  </select>
+  <!-- 通过订单编号获得订单的负责人(营销员) -->
+  <select id="getSaleIdByOno" parameterType="java.lang.String" resultType="java.lang.String">
+  	select salesman_id from t_order_new where order_no = #{_parameter,jdbcType=VARCHAR}
+  </select>
+  <select id="selectOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
   	select 
   		a.order_no as orderNo,a.create_time as createTime, date_format(a.sign_time,'%Y-%m-%d' ) as signDate,
   		b.nickname as userName ,a.process_status as processStatus,a.total_amount as totalAmount,

+ 97 - 0
src/main/java/com/goafanti/common/mapper/TOrderRefundMapper.xml

@@ -450,4 +450,101 @@
       result = #{result,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
+  <!-- 财务专员查看自己处理的退款数据  -->
+  <select id="getRefundList" parameterType="Map" resultType="com.goafanti.order.bo.OrderRefundBo">
+  select r.id as id , r.create_time as createTime, r.order_no as orderNo, u.nickname as buyName, u.id as buyid, o.order_status as orderStatus,
+  	a.name as saleName, a.id as saleId, o.liquidation_status as liquidationStatus ,reason as reason,refund_status as  refundStatus
+  	from t_order_refund r
+  	 left join t_order_new o on r.order_no = o.order_no
+  	 left join `user` u on o.buyer_id = u.id
+  	 left join admin a on o.salesman_id = a.id
+  	where accept = #{accept,jdbcType=VARCHAR}
+  	and refund_status &lt; 2
+  	<if test='r.id != null and r.id != ""'>
+  		and id= #{r.id,jdbcType=INTEGER}
+  	</if>
+  	<if test='r.orderNo != null and r.orderNo != ""'>
+  		and order_no = #{r.orderNo,jdbcType=VARCHAR}
+  	</if>
+  	<if test='r.buyName != null and r.buyName != ""'>
+	  	<bind name="a" value="'%' + r.buyName + '%'"/>
+  		and u.nickname like #{a,jdbcType=VARCHAR}
+  	</if>
+  	<if test='r.refundStatus != null and r.refundStatus != ""'>
+  		and r.refundStatus = #{refundStatus,jdbcType=INTEGER}
+  	</if>
+  	<if test='r.startTime != null and r.startTime != "" and r.endTime != null and r.endTime != ""'>
+	  	<bind name="a" value="r.startTime + ' 00:00:00'"/>
+	  	<bind name="b" value="r.endTime + ' 23:59:59'"/>
+	  	and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
+	</if>
+	order by r.refundStatus
+  	<if test="page_sql!=null">
+	 ${page_sql}
+	</if>
+  </select>
+  <select id="getRefundCount" parameterType="Map" resultType="java.lang.Integer">
+  select count(*)
+  	from t_order_refund r
+  	 left join t_order_new o on r.order_no = o.order_no
+  	 left join `user` u on o.buyer_id = u.id
+  	 left join admin a on o.salesman_id = a.id
+  	where accept = #{accept,jdbcType=VARCHAR}
+  	<if test='r.refundStatus == null or r.refundStatus == ""'>
+  		and refund_status &lt; 2
+  	</if>
+  	<if test='r.refundStatus != null and r.refundStatus != ""'>
+  		and r.refundStatus = #{refundStatus,jdbcType=INTEGER}
+  	</if>
+  	<if test='r.id != null and r.id != ""'>
+  		and id= #{r.id,jdbcType=INTEGER}
+  	</if>
+  	<if test='r.orderNo != null and r.orderNo != ""'>
+  		and order_no = #{r.orderNo,jdbcType=VARCHAR}
+  	</if>
+  	<if test='r.buyName != null and r.buyName != ""'>
+	  	<bind name="a" value="'%' + r.buyName + '%'"/>
+  		and u.nickname like #{a,jdbcType=VARCHAR}
+  	</if>
+  	<if test='r.startTime != null and r.startTime != "" and r.endTime != null and r.endTime != ""'>
+	  	<bind name="a" value="r.startTime + ' 00:00:00'"/>
+	  	<bind name="b" value="r.endTime + ' 23:59:59'"/>
+	  	and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
+	</if>
+  </select>
+  <!-- 修改退款数据 -->
+  <update id="updateRefundById" parameterType="com.goafanti.common.model.TOrderRefund">
+  update t_order_refund
+    <set>
+      <if test="orderNo != null">
+        order_no = #{orderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="refundStatus != null">
+        refund_status = #{refundStatus,jdbcType=INTEGER},
+      </if>
+      <if test="initiate != null">
+        initiate = #{initiate,jdbcType=VARCHAR},
+      </if>
+      <if test="accept != null">
+        accept = #{accept,jdbcType=VARCHAR},
+      </if>
+      <if test="reason != null">
+        reason = #{reason,jdbcType=VARCHAR},
+      </if>
+      <if test="result != null">
+        result = #{result,jdbcType=VARCHAR},
+      </if>
+      <if test="reasonAttachmentUrl != null">
+        reason_attachment_url = #{reasonAttachmentUrl,jdbcType=LONGVARCHAR},
+      </if>
+      <if test="contractUrl != null">
+        contract_url = #{contractUrl,jdbcType=LONGVARCHAR},
+      </if>
+      <if test="applicationUrl != null">
+        application_url = #{applicationUrl,jdbcType=LONGVARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  
 </mapper>

+ 1 - 1
src/main/java/com/goafanti/common/mapper/UserIdentityMapper.xml

@@ -1041,7 +1041,7 @@
 				group by  seller_id ) o on t.uid=o.seller_id
 	where expert=1
 	and u.status !=1
-	and t.expert_audit =2
+	and t.audit_status =2
 	<if test="industry != null">
         and t.industry = #{industry,jdbcType=VARCHAR}
     </if>

+ 1 - 3
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -766,7 +766,6 @@
 			b.audit_status as auditStatus,
 			b.graduate_school as graduateSchool,
 			b.consultation_price as consultationPrice,
-			b.expert_audit as expertAudit,
 			b.release_status as releaseStatus,
 			a.aid as aid,d.name as adminName
 		from
@@ -1276,7 +1275,6 @@
 			dg3.name as area,
 			c.name as industry,
 			d.name as adminName,
-			b.expert_audit as expertAudit,
 			b.release_status as releaseStatus
 		from user a inner join user_identity b on a.id = b.uid
 		left join district_glossory dg1 on b.province = dg1.id
@@ -1973,4 +1971,4 @@ inner join(
 		and share_type=0
 		and to_days(transfer_time)=to_days(now())
 	</select>
-</mapper>
+</mapper>

+ 29 - 28
src/main/java/com/goafanti/common/model/TOrderBack.java

@@ -7,8 +7,8 @@ public class TOrderBack {
      *
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column t_order_back.id
-     *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     *
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     private Integer id;
 
@@ -17,7 +17,7 @@ public class TOrderBack {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column t_order_back.order_no
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     private String orderNo;
 
@@ -26,7 +26,7 @@ public class TOrderBack {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column t_order_back.back_status
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     private Integer backStatus;
 
@@ -35,7 +35,7 @@ public class TOrderBack {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column t_order_back.create_time
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     private Date createTime;
 
@@ -44,7 +44,7 @@ public class TOrderBack {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column t_order_back.initiate
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     private String initiate;
 
@@ -53,7 +53,7 @@ public class TOrderBack {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column t_order_back.accept
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     private String accept;
 
@@ -62,7 +62,7 @@ public class TOrderBack {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column t_order_back.reason
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     private String reason;
 
@@ -71,7 +71,7 @@ public class TOrderBack {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column t_order_back.result
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     private String result;
 
@@ -80,7 +80,7 @@ public class TOrderBack {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column t_order_back.reason_attachment_url
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     private String reasonAttachmentUrl;
 
@@ -90,7 +90,7 @@ public class TOrderBack {
      *
      * @return the value of t_order_back.id
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     public Integer getId() {
         return id;
@@ -102,7 +102,7 @@ public class TOrderBack {
      *
      * @param id the value for t_order_back.id
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     public void setId(Integer id) {
         this.id = id;
@@ -114,7 +114,7 @@ public class TOrderBack {
      *
      * @return the value of t_order_back.order_no
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     public String getOrderNo() {
         return orderNo;
@@ -126,7 +126,7 @@ public class TOrderBack {
      *
      * @param orderNo the value for t_order_back.order_no
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     public void setOrderNo(String orderNo) {
         this.orderNo = orderNo;
@@ -138,7 +138,7 @@ public class TOrderBack {
      *
      * @return the value of t_order_back.back_status
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     public Integer getBackStatus() {
         return backStatus;
@@ -150,7 +150,7 @@ public class TOrderBack {
      *
      * @param backStatus the value for t_order_back.back_status
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     public void setBackStatus(Integer backStatus) {
         this.backStatus = backStatus;
@@ -162,7 +162,7 @@ public class TOrderBack {
      *
      * @return the value of t_order_back.create_time
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     public Date getCreateTime() {
         return createTime;
@@ -174,7 +174,7 @@ public class TOrderBack {
      *
      * @param createTime the value for t_order_back.create_time
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     public void setCreateTime(Date createTime) {
         this.createTime = createTime;
@@ -186,7 +186,7 @@ public class TOrderBack {
      *
      * @return the value of t_order_back.initiate
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     public String getInitiate() {
         return initiate;
@@ -198,7 +198,7 @@ public class TOrderBack {
      *
      * @param initiate the value for t_order_back.initiate
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     public void setInitiate(String initiate) {
         this.initiate = initiate;
@@ -210,7 +210,7 @@ public class TOrderBack {
      *
      * @return the value of t_order_back.accept
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     public String getAccept() {
         return accept;
@@ -222,7 +222,7 @@ public class TOrderBack {
      *
      * @param accept the value for t_order_back.accept
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     public void setAccept(String accept) {
         this.accept = accept;
@@ -234,7 +234,7 @@ public class TOrderBack {
      *
      * @return the value of t_order_back.reason
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     public String getReason() {
         return reason;
@@ -246,7 +246,7 @@ public class TOrderBack {
      *
      * @param reason the value for t_order_back.reason
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     public void setReason(String reason) {
         this.reason = reason;
@@ -258,7 +258,7 @@ public class TOrderBack {
      *
      * @return the value of t_order_back.result
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     public String getResult() {
         return result;
@@ -270,7 +270,7 @@ public class TOrderBack {
      *
      * @param result the value for t_order_back.result
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     public void setResult(String result) {
         this.result = result;
@@ -282,7 +282,7 @@ public class TOrderBack {
      *
      * @return the value of t_order_back.reason_attachment_url
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
      */
     public String getReasonAttachmentUrl() {
         return reasonAttachmentUrl;
@@ -294,7 +294,8 @@ public class TOrderBack {
      *
      * @param reasonAttachmentUrl the value for t_order_back.reason_attachment_url
      *
-     * @mbg.generated Wed Nov 21 11:44:14 CST 2018
+     * @mbggenerated Tue Nov 20 11:06:11 CST 2018
+>>>>>>> refs/remotes/origin/test
      */
     public void setReasonAttachmentUrl(String reasonAttachmentUrl) {
         this.reasonAttachmentUrl = reasonAttachmentUrl;

+ 593 - 0
src/main/java/com/goafanti/common/model/TOrderBillNew.java

@@ -0,0 +1,593 @@
+package com.goafanti.common.model;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class TOrderBillNew {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_order_bill_new.bill_no
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    private String billNo;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_order_bill_new.order_no
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    private String orderNo;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_order_bill_new.creater
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    private String creater;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_order_bill_new.create_time
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    private Date createTime;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_order_bill_new.update_time
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    private Date updateTime;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_order_bill_new.payee_id
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    private String payeeId;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_order_bill_new.payer_id
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    private String payerId;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_order_bill_new.transaction_amount
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    private BigDecimal transactionAmount;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_order_bill_new.transaction_subject
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    private Integer transactionSubject;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_order_bill_new.transaction_channel
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    private Integer transactionChannel;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_order_bill_new.remarks
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    private String remarks;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_order_bill_new.confirm_sign
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    private Integer confirmSign;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_order_bill_new.delete_sign
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    private Byte deleteSign;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_order_bill_new.financial_pay_no
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    private String financialPayNo;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_order_bill_new.financial_pay_time
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    private Date financialPayTime;
+
+    private String financialPayTimes;
+    private String payerName;
+    private String payeeName;
+    private String createrName;
+    private String startTime;
+    private String endTime;
+    private String departmentId;
+    private String saleId;
+    private String saleName;
+    private String departmentName;
+    
+    
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_order_bill_new.bill_no
+     *
+     * @return the value of t_order_bill_new.bill_no
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public String getBillNo() {
+        return billNo;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_order_bill_new.bill_no
+     *
+     * @param billNo the value for t_order_bill_new.bill_no
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public void setBillNo(String billNo) {
+        this.billNo = billNo;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_order_bill_new.order_no
+     *
+     * @return the value of t_order_bill_new.order_no
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_order_bill_new.order_no
+     *
+     * @param orderNo the value for t_order_bill_new.order_no
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_order_bill_new.creater
+     *
+     * @return the value of t_order_bill_new.creater
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public String getCreater() {
+        return creater;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_order_bill_new.creater
+     *
+     * @param creater the value for t_order_bill_new.creater
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public void setCreater(String creater) {
+        this.creater = creater;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_order_bill_new.create_time
+     *
+     * @return the value of t_order_bill_new.create_time
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_order_bill_new.create_time
+     *
+     * @param createTime the value for t_order_bill_new.create_time
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_order_bill_new.update_time
+     *
+     * @return the value of t_order_bill_new.update_time
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_order_bill_new.update_time
+     *
+     * @param updateTime the value for t_order_bill_new.update_time
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_order_bill_new.payee_id
+     *
+     * @return the value of t_order_bill_new.payee_id
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public String getPayeeId() {
+        return payeeId;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_order_bill_new.payee_id
+     *
+     * @param payeeId the value for t_order_bill_new.payee_id
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public void setPayeeId(String payeeId) {
+        this.payeeId = payeeId;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_order_bill_new.payer_id
+     *
+     * @return the value of t_order_bill_new.payer_id
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public String getPayerId() {
+        return payerId;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_order_bill_new.payer_id
+     *
+     * @param payerId the value for t_order_bill_new.payer_id
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public void setPayerId(String payerId) {
+        this.payerId = payerId;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_order_bill_new.transaction_amount
+     *
+     * @return the value of t_order_bill_new.transaction_amount
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public BigDecimal getTransactionAmount() {
+        return transactionAmount;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_order_bill_new.transaction_amount
+     *
+     * @param transactionAmount the value for t_order_bill_new.transaction_amount
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public void setTransactionAmount(BigDecimal transactionAmount) {
+        this.transactionAmount = transactionAmount;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_order_bill_new.transaction_subject
+     *
+     * @return the value of t_order_bill_new.transaction_subject
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public Integer getTransactionSubject() {
+        return transactionSubject;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_order_bill_new.transaction_subject
+     *
+     * @param transactionSubject the value for t_order_bill_new.transaction_subject
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public void setTransactionSubject(Integer transactionSubject) {
+        this.transactionSubject = transactionSubject;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_order_bill_new.transaction_channel
+     *
+     * @return the value of t_order_bill_new.transaction_channel
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public Integer getTransactionChannel() {
+        return transactionChannel;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_order_bill_new.transaction_channel
+     *
+     * @param transactionChannel the value for t_order_bill_new.transaction_channel
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public void setTransactionChannel(Integer transactionChannel) {
+        this.transactionChannel = transactionChannel;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_order_bill_new.remarks
+     *
+     * @return the value of t_order_bill_new.remarks
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public String getRemarks() {
+        return remarks;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_order_bill_new.remarks
+     *
+     * @param remarks the value for t_order_bill_new.remarks
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_order_bill_new.confirm_sign
+     *
+     * @return the value of t_order_bill_new.confirm_sign
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public Integer getConfirmSign() {
+        return confirmSign;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_order_bill_new.confirm_sign
+     *
+     * @param confirmSign the value for t_order_bill_new.confirm_sign
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public void setConfirmSign(Integer confirmSign) {
+        this.confirmSign = confirmSign;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_order_bill_new.delete_sign
+     *
+     * @return the value of t_order_bill_new.delete_sign
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public Byte getDeleteSign() {
+        return deleteSign;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_order_bill_new.delete_sign
+     *
+     * @param deleteSign the value for t_order_bill_new.delete_sign
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public void setDeleteSign(Byte deleteSign) {
+        this.deleteSign = deleteSign;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_order_bill_new.financial_pay_no
+     *
+     * @return the value of t_order_bill_new.financial_pay_no
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public String getFinancialPayNo() {
+        return financialPayNo;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_order_bill_new.financial_pay_no
+     *
+     * @param financialPayNo the value for t_order_bill_new.financial_pay_no
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public void setFinancialPayNo(String financialPayNo) {
+        this.financialPayNo = financialPayNo;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_order_bill_new.financial_pay_time
+     *
+     * @return the value of t_order_bill_new.financial_pay_time
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public Date getFinancialPayTime() {
+        return financialPayTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_order_bill_new.financial_pay_time
+     *
+     * @param financialPayTime the value for t_order_bill_new.financial_pay_time
+     *
+     * @mbggenerated Tue Nov 20 11:14:40 CST 2018
+     */
+    public void setFinancialPayTime(Date financialPayTime) {
+        this.financialPayTime = financialPayTime;
+    }
+
+	public String getFinancialPayTimes() {
+		return financialPayTimes;
+	}
+
+	public void setFinancialPayTimes(String financialPayTimes) {
+		this.financialPayTimes = financialPayTimes;
+	}
+
+	public String getPayerName() {
+		return payerName;
+	}
+
+	public void setPayerName(String payerName) {
+		this.payerName = payerName;
+	}
+
+	public String getPayeeName() {
+		return payeeName;
+	}
+
+	public void setPayeeName(String payeeName) {
+		this.payeeName = payeeName;
+	}
+
+	public String getCreaterName() {
+		return createrName;
+	}
+
+	public void setCreaterName(String createrName) {
+		this.createrName = createrName;
+	}
+
+	public String getStartTime() {
+		return startTime;
+	}
+
+	public void setStartTime(String startTime) {
+		this.startTime = startTime;
+	}
+
+	public String getEndTime() {
+		return endTime;
+	}
+
+	public void setEndTime(String endTime) {
+		this.endTime = endTime;
+	}
+
+	public String getDepartmentId() {
+		return departmentId;
+	}
+
+	public void setDepartmentId(String departmentId) {
+		this.departmentId = departmentId;
+	}
+
+	public String getSaleId() {
+		return saleId;
+	}
+
+	public void setSaleId(String saleId) {
+		this.saleId = saleId;
+	}
+
+	public String getSaleName() {
+		return saleName;
+	}
+
+	public void setSaleName(String saleName) {
+		this.saleName = saleName;
+	}
+
+	public String getDepartmentName() {
+		return departmentName;
+	}
+
+	public void setDepartmentName(String departmentName) {
+		this.departmentName = departmentName;
+	}
+}

File diff suppressed because it is too large
+ 1274 - 0
src/main/java/com/goafanti/common/model/TOrderBillNewExample.java


+ 196 - 0
src/main/java/com/goafanti/common/utils/ExportExcelUtil.java

@@ -0,0 +1,196 @@
+package com.goafanti.common.utils;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.text.SimpleDateFormat;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFCellStyle;
+import org.apache.poi.hssf.usermodel.HSSFFont;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.util.CellRangeAddress;
+
+import com.goafanti.common.model.TOrderBillNew;
+
+public class ExportExcelUtil {
+	
+	//设置单元格格式
+	private static HSSFCellStyle setCellStyle1(HSSFWorkbook workbook){
+		// 设置字体  
+		HSSFFont font = workbook.createFont();  
+		// font.setColor(HSSFFont.COLOR_RED);  
+		font.setFontName("微软雅黑");
+		font.setFontHeightInPoints((short) 10);//字体大小  
+		  
+		// 设置样式  
+		HSSFCellStyle cellStyle = workbook.createCellStyle();  
+		cellStyle.setFont(font);  //字体
+		
+		//设置自动换行
+		cellStyle.setWrapText(true);
+		return cellStyle;
+	}
+	//设置单元格格式
+	private static HSSFCellStyle setCellStyle2(HSSFWorkbook workbook){
+		// 设置字体  
+		HSSFFont font = workbook.createFont();  
+		font.setFontName("微软雅黑");
+		font.setFontHeightInPoints((short) 14);//字体大小  
+		font.setFontHeight((short) 600);
+		// 设置样式  
+		HSSFCellStyle cellStyle = workbook.createCellStyle();  
+		cellStyle.setFont(font);  //字体
+		return cellStyle;
+	}
+	
+	//下载课表
+	public static void download(String path, HttpServletResponse response,String filename) { 
+		try {  
+            // path是指欲下载的文件的路径。  
+            File file = new File(path);  
+            // 取得文件名。  
+            // 以流的形式下载文件。  
+            InputStream fis = new BufferedInputStream(new FileInputStream(path));  
+            byte[] buffer = new byte[fis.available()];  
+            fis.read(buffer);  
+            fis.close();  
+            // 清空response  
+            response.reset();  
+            // 设置response的Header  
+            response.addHeader("Content-Disposition", "attachment;filename="  
+                    + new String(filename.getBytes(),"iso-8859-1"));  //防止中文乱码或者中文忽略的情况
+            response.addHeader("Content-Length", "" + file.length());  
+            OutputStream toClient = new BufferedOutputStream(  
+                    response.getOutputStream());  
+            response.setContentType("application/octet-stream;charset=utf-8");  
+            toClient.write(buffer);  
+            toClient.flush();  
+            toClient.close();  
+            
+          
+        } catch (IOException ex) {  
+            ex.printStackTrace();  
+        }  
+		
+	}
+	public static void download(String path, HttpServletResponse response) {  
+        try {  
+            // path是指欲下载的文件的路径。  
+            File file = new File(path);  
+            // 取得文件名。  
+            String filename = file.getName();  
+            // 以流的形式下载文件。  
+            InputStream fis = new BufferedInputStream(new FileInputStream(path));  
+            byte[] buffer = new byte[fis.available()];  
+            fis.read(buffer);  
+            fis.close();  
+            // 清空response  
+            response.reset();  
+            // 设置response的Header  
+            response.addHeader("Content-Disposition", "attachment;filename="  
+                    + new String(filename.getBytes(),"iso-8859-1"));  
+            response.addHeader("Content-Length", "" + file.length());  
+            OutputStream toClient = new BufferedOutputStream(  
+                    response.getOutputStream());  
+            response.setContentType("application/octet-stream;charset=utf-8");  
+            toClient.write(buffer);  
+            toClient.flush();  
+            toClient.close();  
+        } catch (IOException ex) {  
+            ex.printStackTrace();  
+        }  
+    }  
+	
+	//=========================================================此处分割线===========================================================================//
+	/**
+	 * 导出部门流水数据
+	 * @param map 数据
+	 * @param deptnames 部门名称数组
+	 * @param comment 表头(列名)
+	 * @param filePath 生成文件路径
+	 */
+	public static void exportDeptBillInfo(Map<String,List<TOrderBillNew>> map,String[] deptnames,String[] comment,String filePath){
+		//map 数据 ,deptnames 部门名称,comment表头 (列名称)
+ 		//1,创建一个workbook,对应的是一个excel文件
+		HSSFWorkbook wb = new HSSFWorkbook();
+		int count = 0;
+		//遍历map
+		for (Map.Entry<String,List<TOrderBillNew>> entry : map.entrySet()) {
+			//2.创建一个sheet
+			HSSFSheet sheet = wb.createSheet(entry.getKey());
+			//3。创建一个row
+			HSSFRow row = sheet.createRow(0);
+			//4.创建一个cell
+			HSSFCell cell = row.createCell(0);
+			cell.setCellValue(deptnames[count]+" 流水记录");
+			count ++;
+			HSSFCellStyle style1 = setCellStyle1(wb);
+			cell.setCellStyle(style1);
+			//合并列
+			sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, comment.length-1));//合并单元格
+			//创建表头
+			HSSFRow row2 = sheet.createRow(1);
+			for(int i = 0; i < comment.length; i++){
+				sheet.setColumnWidth(i, 3000);//设置列宽
+				HSSFCell c = row2.createCell(i);
+				c.setCellValue(comment[i]);
+				c.setCellStyle(style1);
+			}
+			//填充表格数据
+			//int rowmnum = sheet.getLastRowNum();//获得当前行数据
+			List<TOrderBillNew> list = entry.getValue();
+			if(list == null){
+				continue;
+			}
+			for (TOrderBillNew ob : list) {
+				//新增一行
+				HSSFRow r = sheet.createRow(sheet.getLastRowNum()+1);
+				for (int i = 0; i < comment.length; i++) {
+					//当前列的只
+					String o ;
+					switch (comment[i]) {
+					case "平台流水编号": o = ob.getBillNo(); break;
+					case "平台流水时间": o = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(ob.getCreateTime()); break;
+					case "交易金额": o = ob.getTransactionAmount().toString(); break;
+					case "付款方": o = ob.getPayerName(); break;
+					case "收款方": o = ob.getPayeeName(); break;
+					case "流水科目": o = ob.getTransactionSubject().toString(); break;
+					case "交易渠道": o = ob.getTransactionChannel().toString(); break;
+					case "交易时间": o = ob.getFinancialPayTimes(); break;
+					case "财务流水号": o = ob.getFinancialPayNo();break;
+					case "订单编号": o = ob.getOrderNo(); break;
+					case "订单负责人": o = ob.getSaleName(); break;
+					default: o = ""; break;
+					}
+					HSSFCell c = r.createCell(i);
+					c.setCellValue(o);
+				}
+			}
+		}
+		
+		//将表格数据放入文件中
+		try {
+			FileOutputStream fos = new FileOutputStream(filePath);
+			wb.write(fos);
+			fos.close();
+			System.out.println("已经创建文件");
+		} catch (Exception e) {
+			System.out.println("发生了异常");
+			e.printStackTrace();
+		}
+	}
+	
+	
+}

+ 42 - 0
src/main/java/com/goafanti/core/auth/HttpComponentsClientHttpRequestFactoryDigestAuth.java

@@ -0,0 +1,42 @@
+package com.goafanti.core.auth;
+
+
+import java.net.URI;
+import org.apache.http.HttpHost;
+import org.apache.http.client.AuthCache;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.protocol.ClientContext;
+import org.apache.http.impl.auth.DigestScheme;
+import org.apache.http.impl.client.BasicAuthCache;
+import org.apache.http.protocol.BasicHttpContext;
+import org.apache.http.protocol.HttpContext;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
+ 
+public class HttpComponentsClientHttpRequestFactoryDigestAuth extends HttpComponentsClientHttpRequestFactory {
+	 
+	public HttpComponentsClientHttpRequestFactoryDigestAuth(HttpClient client) {
+        super(client);
+    }
+ 
+    @Override
+    protected HttpContext createHttpContext(HttpMethod httpMethod, URI uri) {
+        return createHttpContext(uri);
+    }
+ 
+    private HttpContext createHttpContext(URI uri) {
+        // Create AuthCache instance
+        AuthCache authCache = new BasicAuthCache();
+        // Generate DIGEST scheme object, initialize it and add it to the local auth cache
+        DigestScheme digestAuth = new DigestScheme();
+        // If we already know the realm name
+        digestAuth.overrideParamter("realm", "myrealm");
+        HttpHost targetHost = new HttpHost(uri.getHost(), uri.getPort());
+        authCache.put(targetHost, digestAuth);
+ 
+        // Add AuthCache to the execution context
+        BasicHttpContext localcontext = new BasicHttpContext();
+        localcontext.setAttribute(ClientContext.AUTH_CACHE, authCache);
+        return localcontext;
+    }
+}

+ 43 - 0
src/main/java/com/goafanti/core/auth/RestClient.java

@@ -0,0 +1,43 @@
+package com.goafanti.core.auth;
+
+import java.util.Base64;
+
+import org.junit.Test;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestTemplate;
+
+public class RestClient {
+	private final String BS_HOST= "http://localhost:8090/";
+	//@Test
+	public void whenSecuredRestApiIsConsumed_then200OK() {
+	    RestTemplate restTemplate = new RestTempleteConfig().getRestTemplate();
+	    ResponseEntity<String> entity = restTemplate.exchange(BS_HOST, HttpMethod.GET, null, String.class);
+	    System.out.println(entity.getStatusCode());
+	    System.out.println(entity.getBody());
+	}
+	private HttpHeaders getHeaders(){
+		String plainCredentials="dev:123456";
+		String base64Credentials = Base64.getEncoder().encodeToString(plainCredentials.getBytes());
+		HttpHeaders headers = new HttpHeaders();
+		headers.add("Authorization", "Basic " + base64Credentials);
+		return headers;
+	}
+ 
+	public String sendToBs(String apiUrl,HttpMethod method,LinkedMultiValueMap<String, String> params) {
+		RestTemplate restTemplate = new RestTemplate();
+		HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<MultiValueMap<String, String>>(params,getHeaders());
+		ResponseEntity<String> response = restTemplate.exchange(BS_HOST + "/" + apiUrl, method,request, String.class);
+		
+		return response.getBody();
+	}
+	
+	@Test
+	public void testLogin() {
+		System.out.println(sendToBs("login", HttpMethod.GET, null));
+	}
+}

+ 29 - 0
src/main/java/com/goafanti/core/auth/RestTempleteConfig.java

@@ -0,0 +1,29 @@
+package com.goafanti.core.auth;
+
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.CredentialsProvider;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.springframework.web.client.RestTemplate;
+
+
+public class RestTempleteConfig {
+	public RestTemplate getRestTemplate() {
+		CloseableHttpClient client = HttpClientBuilder.create().setDefaultCredentialsProvider(provider())
+				.useSystemProperties().build();
+		HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactoryDigestAuth(
+				client);
+ 
+		return new RestTemplate(requestFactory);
+	}
+ 
+	private CredentialsProvider provider() {
+		CredentialsProvider provider = new BasicCredentialsProvider();
+		UsernamePasswordCredentials credentials = new UsernamePasswordCredentials("dev", "123456");
+		provider.setCredentials(AuthScope.ANY, credentials);
+		return provider;
+	}
+}

+ 10 - 1
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -10,11 +10,15 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
+
 import javax.annotation.Resource;
+
 import org.apache.commons.beanutils.BeanUtils;
+import org.apache.commons.beanutils.PropertyUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
@@ -390,7 +394,12 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		UserIdentity ui = new UserIdentity();
 		User user = new User();
 		try {
-			BeanUtilsExt.copyProperties(ui, bo);
+			try {
+				PropertyUtils.copyProperties(ui,bo);
+			} catch (NoSuchMethodException e) {
+				e.printStackTrace();
+			}
+			//BeanUtilsExt.copyProperties(ui, bo);
 			user.setId(bo.getUid());
 			user.setSocietyTag(bo.getSocietyTag());
 			user.setHeadPortraitUrl(bo.getHeadPortraitUrl());

+ 32 - 0
src/main/java/com/goafanti/order/bo/OrderListBo.java

@@ -38,6 +38,7 @@ public class OrderListBo {
 	private String salesmanName;
 	/** 财务负责人 **/
 	private String financeName;
+	private String financeId;
 	/** 技术员 **/
 	private String technicianName;
 	/** 关联部门名称 **/
@@ -56,6 +57,13 @@ public class OrderListBo {
 	private Integer changeStatus;
 	/** 可操作状态 **/
 	private OperatorActive active;
+	/** 流程状态 **/
+	private Integer processStatus;
+	/** 搜索开始时间 **/
+	private String startTime;
+	/** 搜索结束时间 **/
+	private String endTime;
+	
 	public String getOrderNo() {
 		return orderNo;
 	}
@@ -206,4 +214,28 @@ public class OrderListBo {
 	public void setActive(OperatorActive active) {
 		this.active = active;
 	}
+	public String getFinanceId() {
+		return financeId;
+	}
+	public void setFinanceId(String financeId) {
+		this.financeId = financeId;
+	}
+	public Integer getProcessStatus() {
+		return processStatus;
+	}
+	public void setProcessStatus(Integer processStatus) {
+		this.processStatus = processStatus;
+	}
+	public String getStartTime() {
+		return startTime;
+	}
+	public void setStartTime(String startTime) {
+		this.startTime = startTime;
+	}
+	public String getEndTime() {
+		return endTime;
+	}
+	public void setEndTime(String endTime) {
+		this.endTime = endTime;
+	}
 }

+ 65 - 0
src/main/java/com/goafanti/order/bo/OrderRefundBo.java

@@ -0,0 +1,65 @@
+package com.goafanti.order.bo;
+
+import com.goafanti.common.model.TOrderRefund;
+
+public class OrderRefundBo extends TOrderRefund {
+	
+	private String buyName;
+	private String buyid;
+	private Integer orderStatus;
+	private Integer liquidationStatus;
+	private String saleName;
+	private String saleId;
+	private String startTime;
+	private String endTime;
+	public String getBuyName() {
+		return buyName;
+	}
+	public void setBuyName(String buyName) {
+		this.buyName = buyName;
+	}
+	public String getBuyid() {
+		return buyid;
+	}
+	public void setBuyid(String buyid) {
+		this.buyid = buyid;
+	}
+	public Integer getOrderStatus() {
+		return orderStatus;
+	}
+	public void setOrderStatus(Integer orderStatus) {
+		this.orderStatus = orderStatus;
+	}
+	public Integer getLiquidationStatus() {
+		return liquidationStatus;
+	}
+	public void setLiquidationStatus(Integer liquidationStatus) {
+		this.liquidationStatus = liquidationStatus;
+	}
+	public String getSaleName() {
+		return saleName;
+	}
+	public void setSaleName(String saleName) {
+		this.saleName = saleName;
+	}
+	public String getSaleId() {
+		return saleId;
+	}
+	public void setSaleId(String saleId) {
+		this.saleId = saleId;
+	}
+	public String getStartTime() {
+		return startTime;
+	}
+	public void setStartTime(String startTime) {
+		this.startTime = startTime;
+	}
+	public String getEndTime() {
+		return endTime;
+	}
+	public void setEndTime(String endTime) {
+		this.endTime = endTime;
+	}
+	
+	
+}

+ 279 - 0
src/main/java/com/goafanti/order/controller/FundManagerOrderApiController.java

@@ -0,0 +1,279 @@
+package com.goafanti.order.controller;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.model.TOrderBack;
+import com.goafanti.common.model.TOrderBillNew;
+import com.goafanti.common.model.TOrderRefund;
+import com.goafanti.common.utils.ExportExcelUtil;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.order.bo.OrderListBo;
+import com.goafanti.order.bo.OrderRefundBo;
+import com.goafanti.order.service.FundManageOrderService;
+import com.goafanti.order.service.OrderBillService;
+import com.goafanti.order.service.OrderRefundService;
+
+@RestController
+@RequestMapping(value = "/api/admin/financial")
+public class FundManagerOrderApiController extends CertifyApiController {
+	@Resource
+	private FundManageOrderService fundManageOrderServiceImpl;
+	@Resource
+	private OrderBillService orderBillServiceImpl;
+	@Resource
+	private OrderRefundService orderRefundServiceImpl;
+	
+	/**
+	 * 财务管理员查看所有待分配的订单
+	 * @param order
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	@RequestMapping(value="/allUnassignedOrder",method = RequestMethod.GET)
+	public Result allUnassignedOrder(OrderListBo order, Integer pageNo, Integer pageSize ){
+		Result res = new Result();
+		order.setProjectStage(2);
+		res.setData(fundManageOrderServiceImpl.allUnassignedOrder(order, pageNo, pageSize,1));
+		return res;
+	}
+	
+	/**
+	 * 财务管理员分派订单
+	 * @param orderid
+	 * @param financeId
+	 * @return
+	 */
+	@RequestMapping(value="/distributionFinance", method = RequestMethod.POST)
+	public Result distributionFinance(String orderNo, String financeId, Integer approval){
+		Result res = new Result();
+		Integer r = fundManageOrderServiceImpl.distributionFinance(orderNo, financeId, approval);
+		if(r == -1){
+			res.getError().add(buildError("", "未通过特批不能分配"));
+			return res;
+		}else if( r == -2 ){
+			res.getError().add(buildError("", "订单编号或者财务专员发生异常错误"));
+			return res;
+		}else{
+			res.setData(r);
+		}
+		return res;
+	}
+	
+	/**
+	 * 财务专员查看分配给自己的订单
+	 * @param order
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	@RequestMapping(value="/financeList", method = RequestMethod.GET)
+	public Result financeList(OrderListBo order, Integer pageNo, Integer pageSize ){
+		Result res = new Result();
+		//财务专员自己的id
+		order.setFinanceId(TokenManager.getAdminId());
+		order.setProjectStage(3);
+		res.setData(fundManageOrderServiceImpl.financeList(order, pageNo, pageSize));
+		return res;
+	}
+	
+	/**
+	 * 财务专员驳回
+	 * @param orderBack
+	 * @return
+	 */
+	@RequestMapping(value="/reject", method = RequestMethod.POST)
+	public Result reject(TOrderBack orderBack){
+		Result res = new Result();
+		if(null != orderBack.getReason() && orderBack.getReason().length() > 256){
+			res.getError().add(buildError("", "驳回原因长度不能大于256"));
+			return res;
+		}
+		Integer i = fundManageOrderServiceImpl.reject(orderBack);
+		if(i>0){
+			res.setData("驳回处理成功!");
+		}else{
+			res.getError().add(buildError("", "已经交款不能驳回"));
+		}
+		return res;
+	}
+	
+	/**
+	 * 财务专员新增流水记录并流转订单状态
+	 * @param billNew
+	 * @return
+	 */
+	@RequestMapping(value="/addReceiptsFlow", method = RequestMethod.POST)
+	public Result addReceiptsFlow(TOrderBillNew billNew){
+		Result res = new Result();
+		if(null != billNew.getRemarks() && billNew.getRemarks().length() > 255){
+			res.getError().add(buildError("", "备注长度不能大于255"));
+			return res;
+		}
+		//流水时间处理
+		try {
+			billNew.setFinancialPayTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(billNew.getFinancialPayTimes()));
+		} catch (ParseException e) {
+			e.printStackTrace();
+			res.getError().add(buildError("", "财务流水时间有误!"));
+			return res;
+		}
+		Integer i = fundManageOrderServiceImpl.addReceiptsFlow(billNew);
+		if(i>0){
+			res.setData("新增收款记录成功!");
+		}else{
+			res.getError().add(buildError("", "本次收款金额大于应收金额!"));
+		}
+		return res;
+	}
+	
+	/**
+	 * 财务专员查看自己要处理的退单数据
+	 * @param refund
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	@RequestMapping(value="/getRefundList", method = RequestMethod.GET)
+	public Result getRefundList(OrderRefundBo refund, Integer pageNo, Integer pageSize){
+		Result res = new Result();
+		refund.setAccept(TokenManager.getAdminId());
+		res.setData(orderRefundServiceImpl.getRefundList(refund, pageNo, pageSize));
+		return res;
+	}
+	
+	/**
+	 * 财务专员审核退款
+	 * @param refund
+	 * @return
+	 */
+	@RequestMapping(value="/changeRefund", method = RequestMethod.POST)
+	public Result changeRefund(TOrderRefund refund){
+		Result res = new Result();
+		if(null != refund.getResult() && refund.getResult().length() > 256){
+			res.getError().add(buildError("", "审批意见长度不能大于256"));
+			return res;
+		}
+		int r = fundManageOrderServiceImpl.changeRefund(refund);
+		if(r>0){
+			res.setData("审核退款成功!");
+		}else{
+			res.getError().add(buildError("", "状态异常不能审批!"));
+		}
+		return res;
+	}
+	
+	/**
+	 * 财务专员新增退款流水
+	 * @param orderRefund
+	 * @return
+	 */
+	@RequestMapping(value="/addRefundFlow", method = RequestMethod.POST)
+	public Result addRefundFlow(TOrderBillNew orderRefund){
+		Result res = new Result();
+		if(null != orderRefund.getRemarks() && orderRefund.getRemarks().length() > 255){
+			res.getError().add(buildError("", "备注长度不能大于255"));
+			return res;
+		}
+		try {
+			orderRefund.setFinancialPayTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(orderRefund.getFinancialPayTimes()));
+		} catch (ParseException e) {
+			e.printStackTrace();
+			res.getError().add(buildError("", "财务流水时间有误!"));
+			return res;
+		}
+		int r = fundManageOrderServiceImpl.addRefundFlow(orderRefund);
+		if(r>0){
+			res.setData("退款记录新增成功!");
+		}else{
+			res.getError().add(buildError("", "退款金额不能大于已交款金额"));
+		}
+		return res;
+	}
+	
+	/**
+	 * 根据id查看订单流水数据
+	 * @param rid
+	 * @return
+	 */
+	@RequestMapping(value="/selectOneRefundFlow", method = RequestMethod.GET)
+	public Result selectOneRefundFlow(String billNo){
+		Result res = new Result();
+		res.setData(fundManageOrderServiceImpl.selectOneRefundFlow(billNo));
+		return res;
+	}
+	
+	/**
+	 * 根据订单编号查看该订单相关的所有流水
+	 * @param orderNo
+	 * @return
+	 */
+	@RequestMapping(value="/selectOneOrderAllRefundFlow", method = RequestMethod.GET)
+	public Result selectOneOrderAllRefundFlow(String orderNo){
+		Result res = new Result();
+		res.setData(fundManageOrderServiceImpl.selectOneOrderAllRefundFlow(orderNo));
+		return res;
+	}
+	
+	/**
+	 * 财务专员查看自己的流水
+	 * @param billNew
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	@RequestMapping(value="/myBillList", method = RequestMethod.GET)
+	public Result myBillList(TOrderBillNew billNew, Integer pageNo, Integer pageSize){
+		Result res = new Result();
+		billNew.setCreater(TokenManager.getAdminId());
+		res.setData(orderBillServiceImpl.myBillList(billNew, pageNo, pageSize));
+		return res;
+	}
+
+	/**
+	 * 查看部门的流水
+	 * @param billNew
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	@RequestMapping(value="/deptBillList", method = RequestMethod.GET)
+	public Result deptBillList(TOrderBillNew billNew, Integer pageNo, Integer pageSize){
+		Result res = new Result();
+		res.setData(orderBillServiceImpl.myBillList(billNew, pageNo, pageSize));
+		return res;
+	}
+	
+	/**
+	 * 下载部门流水数据
+	 * @param billNew
+	 * @param response
+	 * @return
+	 */
+	 @RequestMapping(value="/exportBillData", method = RequestMethod.GET)
+	 public Result exportBillData(TOrderBillNew billNew,HttpServletResponse response){
+		 Result res = new Result();
+		 String path = orderBillServiceImpl.exportBillData(billNew);
+		 if("null".equals(path)){
+			 res.getError().add(buildError("", "没有流水记录!"));
+			 return res;
+		 }
+		 String fileName = "部门流水" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
+		 ExportExcelUtil.download(path,response,fileName);
+		 res.setData(path);
+		 return res;
+	 }
+	 
+	
+}

+ 80 - 0
src/main/java/com/goafanti/order/service/FundManageOrderService.java

@@ -0,0 +1,80 @@
+package com.goafanti.order.service;
+
+import java.util.List;
+
+import com.goafanti.common.model.TOrderBack;
+import com.goafanti.common.model.TOrderBillNew;
+import com.goafanti.common.model.TOrderRefund;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.order.bo.OrderListBo;
+
+public interface FundManageOrderService {
+	
+	/**
+	 * 财务管理员查看所有未派单的订单
+	 * @param order 与订单相关的查询条件
+	 * @param pageNo
+	 * @param PageSize
+	 * @return
+	 */
+	Pagination<OrderListBo> allUnassignedOrder(OrderListBo order,Integer pageNo,Integer pageSize,Integer ob);
+	/**
+	 * 财务专员查看分配给自己的订单
+	 * @param order
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	Pagination<OrderListBo> financeList(OrderListBo order,Integer pageNo,Integer pageSize);
+
+	/**
+	 * 财务管理员分派订单给财务专员
+	 * @param orderid 
+	 * @param financeId
+	 * @return
+	 */
+	Integer distributionFinance(String orderid, String financeId, Integer approval);
+	
+	/**
+	 * 财务专员驳回
+	 * @param back
+	 * @return
+	 */
+	Integer reject(TOrderBack back);
+	
+	/**
+	 * 财务专员添加收款流水
+	 * @param billNew
+	 * @return
+	 */
+	Integer addReceiptsFlow(TOrderBillNew billNew);
+	
+	
+	/**
+	 * 财务专员审核退单数据
+	 * @param refund
+	 * @return
+	 */
+	Integer changeRefund(TOrderRefund refund);
+	
+	/**
+	 * 财务专员新增退单流水
+	 * @param refund
+	 * @return
+	 */
+	Integer addRefundFlow(TOrderBillNew billNew);
+	
+	/***
+	 * 根据流水编号获得流水详情
+	 * @param BillNo
+	 * @return
+	 */
+	TOrderBillNew selectOneRefundFlow(String BillNo);
+	/**
+	 * 根据订单编号获得其流水数据
+	 * @param orderNo
+	 * @return
+	 */
+	List<TOrderBillNew> selectOneOrderAllRefundFlow(String orderNo);
+	
+}

+ 23 - 0
src/main/java/com/goafanti/order/service/OrderBillService.java

@@ -0,0 +1,23 @@
+package com.goafanti.order.service;
+
+import com.goafanti.common.model.TOrderBillNew;
+import com.goafanti.core.mybatis.page.Pagination;
+
+public interface OrderBillService {
+	
+	/**
+	 * 查看自己的流水
+	 * @param billNew
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	Pagination<TOrderBillNew> myBillList(TOrderBillNew billNew, Integer pageNo, Integer pageSize);
+	
+	/**
+	 * 导出流水数据
+	 * @param billNew
+	 * @return
+	 */
+	String exportBillData(TOrderBillNew billNew);
+}

+ 16 - 0
src/main/java/com/goafanti/order/service/OrderRefundService.java

@@ -0,0 +1,16 @@
+package com.goafanti.order.service;
+
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.order.bo.OrderRefundBo;
+
+public interface OrderRefundService {
+	
+	/**
+	 * 财务专员查看自己要处理的退单数据
+	 * @param refund
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	Pagination<OrderRefundBo> getRefundList(OrderRefundBo refund, Integer pageNo, Integer pageSize);
+}

+ 228 - 0
src/main/java/com/goafanti/order/service/impl/FundManagerOrderServiceImpl.java

@@ -0,0 +1,228 @@
+package com.goafanti.order.service.impl;
+
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.dao.AdminMapper;
+import com.goafanti.common.dao.TOrderBackMapper;
+import com.goafanti.common.dao.TOrderBillNewMapper;
+import com.goafanti.common.dao.TOrderNewMapper;
+import com.goafanti.common.dao.TOrderRefundMapper;
+import com.goafanti.common.model.TOrderBack;
+import com.goafanti.common.model.TOrderBillNew;
+import com.goafanti.common.model.TOrderNew;
+import com.goafanti.common.model.TOrderRefund;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.JDBCIdGenerator;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.order.bo.OrderListBo;
+import com.goafanti.order.service.FundManageOrderService;
+
+@Service
+public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper> implements FundManageOrderService {
+	
+	@Autowired
+	private TOrderNewMapper	tOrderNewMapper;
+	@Autowired
+	private AdminMapper	adminMapper;
+	@Autowired
+	private TOrderBillNewMapper billNewMapper;
+	@Autowired
+	private TOrderBackMapper backMapper;
+	@Autowired
+	private TOrderRefundMapper refundMapper;
+	@Autowired
+	JDBCIdGenerator	idGenerator;
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<OrderListBo> allUnassignedOrder(OrderListBo order, Integer pageNo,
+			Integer pageSize,Integer ob) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		params.put("o", order);
+		params.put("ob", ob);
+		Pagination<OrderListBo> data = (Pagination<OrderListBo>)findPage("getAllUnassignedListOrder", "getAllUnassignedCountOrder", params, pageNo, pageSize);
+		return data;
+	}
+	
+	@Override
+	public Integer distributionFinance(String orderNo, String financeId, Integer approval) {
+		// 先判断订单id和财务专员是否存在或者能够使用
+		//判断是不是特批的数据
+		if(approval != 2){//特批未通过
+			return -1;
+		}
+		TOrderNew onew = new TOrderNew();
+		onew.setOrderNo(orderNo);
+		onew.setDeleteSign(0);//正常
+		onew.setProcessStatus(2);//已派财务管理员
+		onew.setApproval(approval);//特批状态
+		onew.setOrderStatus(2);//营销管理员审核通过
+		
+		int idCount = tOrderNewMapper.getCountByIdAndStatus(onew);
+		int fidCount = adminMapper.getCountById(financeId);
+		Integer r = null;
+		if(idCount == 1 && fidCount == 1){
+			//修改订单流程状态
+			TOrderNew record = new TOrderNew();
+			record.setOrderNo(orderNo);
+			record.setFinanceId(financeId);
+			record.setProjectStatus(3);
+			r = tOrderNewMapper.updateByPrimaryKeySelective(record);
+		}else{
+			//返回错误标志 提示订单编号或者财务专员选择错误
+			r = -2;
+		}
+		return r;
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<OrderListBo> financeList(OrderListBo order,
+			Integer pageNo, Integer pageSize) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		params.put("o", order);
+		Pagination<OrderListBo> data = (Pagination<OrderListBo>)findPage("financeList", "financeCount", params, pageNo, pageSize);
+		return data;
+	}
+
+	@Override
+	public Integer reject(TOrderBack back) {
+		// 是否已经收款
+		BigDecimal bd = billNewMapper.getAmountByOid(back.getOrderNo());
+		if(bd.compareTo(new BigDecimal(0.0)) == 1){
+			return 0;//已经收款不能驳回
+		}
+		//否 可以处理驳回
+		
+		//修改订单状态
+		TOrderNew orderNew = new  TOrderNew();
+		orderNew.setOrderNo(back.getOrderNo());
+		orderNew.setOrderStatus(5);
+		int c = tOrderNewMapper.updateByPrimaryKeySelective(orderNew);
+		
+		//新增驳回数据
+		if(c>0){
+			back.setBackStatus(0);
+			System.out.println(TokenManager.getUserId());
+			System.out.println(TokenManager.getAdminId());
+			back.setInitiate(TokenManager.getAdminId());//发起人
+			back.setAccept(tOrderNewMapper.getSaleIdByOno(back.getOrderNo()));	//查看该订单的负责人	
+			c = backMapper.insertSelective(back);
+		}
+		return c;
+	}
+
+	@Override
+	public Integer addReceiptsFlow(TOrderBillNew billNew) {
+		//判断有没有要加入的金额有没有超过总金额
+		BigDecimal bd = billNewMapper.getAmountByOid(billNew.getOrderNo());
+		//获得的单个订单金额数据(首付金额和总金额)
+		TOrderNew o = tOrderNewMapper.selectByPrimaryKey(billNew.getOrderNo());
+		if(null == o){
+			return -2;
+		}
+		bd.add(billNew.getTransactionAmount().abs());
+		int lstaus = 0;
+		
+		//如果订单流水总额大于总金额 return -1
+		//如果订单流水等于于总金额 lstaus 2
+		//如果订单流水小于总金额大于首付 lstaus 1
+		//如果订单流水小于首付 lstaus 0
+		if(bd.compareTo(o.getTotalAmount()) == 1){
+			return -1;//超过不能添加
+		}else if(bd.compareTo(o.getTotalAmount()) == 0){
+			lstaus = 2;
+		}else if(bd.compareTo(o.getTotalAmount()) == -1 && bd.compareTo(o.getFirstAmount()) == 1){
+			lstaus = 1;
+		}
+		//否则新增流水信息
+		billNew.setBillNo(idGenerator.generateId().toString());
+		billNew.setCreater(TokenManager.getAdminId());
+		billNew.setCreater("1");
+		int result = billNewMapper.insertSelective(billNew);
+		
+		//修改订单结算金额和结算状态
+		//如果已经首付并且流程状态是没有派给咨询师的修改流程状态为4
+		TOrderNew orderNew = new TOrderNew();
+		orderNew.setOrderNo(billNew.getOrderNo());
+		orderNew.setSettlementAmount(bd);
+		orderNew.setLiquidationStatus(lstaus);
+		if(lstaus == 1 && o.getProcessStatus() == 3){
+			orderNew.setProcessStatus(4);
+		}
+		if(result > 0){
+			result = tOrderNewMapper.updateByPrimaryKeySelective(orderNew);
+		}
+		
+		return result;
+	}
+
+	@Override
+	public Integer changeRefund(TOrderRefund refund) {
+		//查看当前退单状态
+		TOrderRefund d = refundMapper.selectByPrimaryKey(refund.getId());
+		if(d.getRefundStatus() != 0){
+			return -1;
+		}
+		
+		
+		//TODO 这里是否要修改订单状态待确定
+		
+		//修改退单审核状态
+		return refundMapper.updateRefundById(refund);
+	}
+
+	@Override
+	public Integer addRefundFlow(TOrderBillNew billNew) {
+		// 查看收款总金额
+		BigDecimal bd = billNewMapper.getAmountByOid(billNew.getOrderNo());
+		billNew.setTransactionAmount(billNew.getTransactionAmount().abs());//绝对值
+		int lstaus = 3;
+		//如果小于要退的金额 return -1
+		//如果等于要退的金额 lstatus 4
+		//如果大于 要退的金额 lstatus 3
+		if(bd.compareTo(billNew.getTransactionAmount()) == -1){
+			return -1;
+		}else if(bd.compareTo(billNew.getTransactionAmount()) == 0){
+			lstaus = 4;
+		}
+		
+		//新增收款流水
+		billNew.setBillNo(idGenerator.generateId().toString());
+		billNew.setCreater(TokenManager.getAdminId());
+		billNew.setTransactionAmount(billNew.getTransactionAmount().negate());// 取负数
+		int result = billNewMapper.insertSelective(billNew);
+		
+		//修改订单数据结算状态和结算金额
+		TOrderNew orderNew = new TOrderNew();
+		orderNew.setOrderNo(billNew.getOrderNo());
+		orderNew.setSettlementAmount(bd.add(billNew.getTransactionAmount()));
+		orderNew.setLiquidationStatus(lstaus);
+		if(lstaus == 4){//如果款项全部退完就更改订单状态,这里不一定待商榷
+			orderNew.setProcessStatus(6);
+		}
+		if(result > 0){
+			result = tOrderNewMapper.updateByPrimaryKeySelective(orderNew);
+		}
+		return result;
+	}
+
+	@Override
+	public TOrderBillNew selectOneRefundFlow(String BillNo) {
+		return billNewMapper.getOneRefundFlow(BillNo);
+	}
+
+	@Override
+	public List<TOrderBillNew> selectOneOrderAllRefundFlow(String orderNo) {
+		return billNewMapper.getOneOrderAllRefundFlow(orderNo);
+	}
+
+	
+}

+ 75 - 0
src/main/java/com/goafanti/order/service/impl/OrderBillServiceImpl.java

@@ -0,0 +1,75 @@
+package com.goafanti.order.service.impl;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.dao.TOrderBillNewMapper;
+import com.goafanti.common.model.TOrderBillNew;
+import com.goafanti.common.utils.ExportExcelUtil;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.order.service.OrderBillService;
+
+@Service
+public class OrderBillServiceImpl extends BaseMybatisDao<TOrderBillNewMapper> implements OrderBillService {
+	
+	@Autowired
+	private TOrderBillNewMapper billNewMapper;
+//	@Value(value = "${upload.path}")
+//	private String	uploadPath = null;
+
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<TOrderBillNew> myBillList(TOrderBillNew billNew,
+			Integer pageNo, Integer pageSize) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		params.put("b", billNew);
+		Pagination<TOrderBillNew> data = (Pagination<TOrderBillNew>)findPage("myBillList", "myBillCount", params, pageNo, pageSize);
+		return data;
+	}
+
+
+	@Override
+	public String exportBillData(TOrderBillNew billNew) {
+		// 判断导出是否有部门
+		String deptid = billNew.getDepartmentId();
+		Map<String, List<TOrderBillNew>> map = new HashMap<String, List<TOrderBillNew>>();
+		String[] deptnames = null; 
+		if(StringUtils.isBlank(deptid)){
+			//获得所有有数据的部门
+			List<TOrderBillNew> dlist = billNewMapper.getDeptBySome(billNew);
+			if(null == dlist || dlist.size() == 0){
+				return "null";
+			}
+			deptnames = new String[dlist.size()];
+			for (int i = 0; i < dlist.size(); i++) {
+				TOrderBillNew ob = dlist.get(i);
+				deptnames[i] = ob.getDepartmentName();
+				billNew.setDepartmentId(ob.getDepartmentId());
+				map.put(ob.getDepartmentName(), billNewMapper.getBillData(billNew));
+			}
+		}else{
+			deptnames = new String[1];
+			map.put(billNew.getDepartmentName(), billNewMapper.getBillData(billNew));
+		}
+		String[] comment = {"平台流水编号","平台流水时间","交易金额","付款方","收款方","流水科目","交易渠道","交易时间","财务流水号","订单编号","订单负责人"};
+		String filePath = "F:/data/public/upload" + "/billtemp";
+		File f = new File(filePath);
+		if(!f.exists()){
+			f.mkdirs();
+		}
+		filePath += "/" + System.nanoTime() +".xls";
+		ExportExcelUtil.exportDeptBillInfo(map, deptnames, comment, filePath);
+		return filePath;
+	}
+	
+
+	
+}

+ 35 - 0
src/main/java/com/goafanti/order/service/impl/OrderRefundServiceImpl.java

@@ -0,0 +1,35 @@
+package com.goafanti.order.service.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.dao.TOrderBillNewMapper;
+import com.goafanti.common.dao.TOrderRefundMapper;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.order.bo.OrderRefundBo;
+import com.goafanti.order.service.OrderRefundService;
+
+@Service
+public class OrderRefundServiceImpl extends BaseMybatisDao<TOrderRefundMapper> implements OrderRefundService {
+	
+	@Autowired
+	private TOrderBillNewMapper billNewMapper;
+
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<OrderRefundBo> getRefundList(OrderRefundBo refund,
+			Integer pageNo, Integer pageSize) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		params.put("r", refund);
+		Pagination<OrderRefundBo> data = (Pagination<OrderRefundBo>)findPage("getRefundList", "getRefundCount", params, pageNo, pageSize);
+		return data;
+	}
+	
+
+	
+}

+ 2 - 2
src/main/java/com/goafanti/order/service/impl/OrderServiceImpl.java

@@ -2121,8 +2121,8 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 					userFollowBusinessMapper.insert(userFollowBusiness);
 				}
 				
-			}	
-			
+			}
+		
 		
 		return 1;
 	}

+ 2 - 2
src/main/resources/props/config_local.properties

@@ -1,7 +1,7 @@
 #Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #\u6570\u636e\u5e93\u94fe\u63a5\uff0c
-jdbc.url=jdbc:mysql://192.168.0.17:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.url=jdbc\:mysql\://192.168.0.17\:3306/aft?useUnicode\=true&characterEncoding\=UTF-8&autoReconnect\=true&useSSL\=false
 #\u5e10\u53f7
 jdbc.username=dev
 #\u5bc6\u7801
@@ -76,4 +76,4 @@ easemob.client.secret=YXA61NHE0renI5N8gEgizoI5ivM9SYE
 
 jiguang.appKey=dbcea43366e038073452a04e
 jiguang.masterSecret=59792298288e4f635c737def
-jiguang.pushUrl=https://api.jpush.cn/v3/push
+jiguang.pushUrl=https://api.jpush.cn/v3/push

+ 24 - 0
src/main/webapp/WEB-INF/views/admin/statistics.html

@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:th="http://www.thymeleaf.org">
+<head th:replace="common::header(~{::title},~{::link})">
+<meta charset="utf-8">
+<title>管理员-数据统计</title>
+<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
+<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap-theme.min.css">
+
+<link th:href="${staticHost+'/dll/dll.css'}" rel="stylesheet">
+<link th:href="${staticHost+'/admin/statistics.css'}" rel="stylesheet">
+</head>
+
+<body>
+	<div id="root"></div>
+	
+	<div th:replace="common::footer(~{::script})">
+		<script type="text/javascript" th:src="${staticHost+'/vendors.js'}"></script>
+		<script type="text/javascript" th:src="${staticHost+'/dll/dll.js'}"></script>
+		<script type="text/javascript" th:src="${staticHost+'/admin/statistics.js'}"></script>
+	</div>
+</body>
+
+</html>

+ 1 - 2
src/main/webapp/WEB-INF/views/common.html

@@ -385,8 +385,7 @@
 			window.showCustomer = /*[[${shiro.hasRole('999999') || shiro.isPermitted('admin/customer')}]]*/false;
 			window.showUserList = /*[[${shiro.hasRole('999999') || shiro.isPermitted('api/admin/userList')}]]*/false;
 			window.showOrgList = /*[[${shiro.hasRole('999999') || shiro.isPermitted('api/admin/orgList')}]]*/false;
-			window.showPermissionList = /*[[${shiro.hasRole('999999') || shiro.isPermitted('api/admin/permissionList')}]]*/
-			false;
+			window.showPermissionList = /*[[${shiro.hasRole('999999') || shiro.isPermitted('api/admin/permissionList')}]]*/false;
 			window.showRoleList = /*[[${shiro.hasRole('999999') || shiro.isPermitted('api/admin/roleList')}]]*/false;
 			window.showAuditStatus = /*[[${shiro.hasRole('999999') || shiro.isPermitted('api/admin/auditStatus')}]]*/false;
 

+ 6 - 6
src/main/webapp/WEB-INF/views/portal/index.html

@@ -48,7 +48,7 @@
 			</ul>
 		</div>
 	</div>
-	<div id="index_fruit">
+	<!-- <div id="index_fruit">
 			<div class="fruit_h3">
 				<h3>精品成果</h3>
 				<a th:href="${basePath + '/portal/technologyTrading/achievement.html'}">MORE+</a>
@@ -113,8 +113,8 @@
 				
 			</div>
 		</div>
-		
-		<div id="index_demand">
+		 -->
+		<!-- <div id="index_demand">
 			<div class="fruit_h3">
 				<h3>精品需求</h3>
 				<a th:href="${basePath + '/portal/technologyTrading/demand.html'}">MORE+</a>
@@ -137,7 +137,7 @@
 					</a>
 				</div>										
 			</div>
-		</div>
+		</div> -->
 	<div id="index_policy">
 			<div class="fruit_h3">
 				<a th:href="${basePath + '/portal/thinkTank/policyList.html'}"><span>+</span> 更多政策</a>
@@ -203,7 +203,7 @@
 				</div>
 			</div>
 		</div>
-		<div id="index_man">
+		<!-- <div id="index_man">
 			<div class="index_man">
 				<img th:src="${portalHost+'/img/index_er6.png'}" alt="" />				
 				<div>
@@ -284,7 +284,7 @@
 					</span>
 				</div>
 			</div>	
-		</div>
+		</div> -->
 	
 	<footer>
 		<div th:replace="common::copyright"></div>