wuhongyuq 5 年 前
コミット
997ca9a4f1
61 ファイル変更5517 行追加0 行削除
  1. 173 0
      xjalt/doc/sql/zhjd.sql
  2. 153 0
      xjalt/src/cn/com/free/common/ActivitiPlugin.java
  3. 66 0
      xjalt/src/cn/com/free/common/ActivitiTransaction.java
  4. 28 0
      xjalt/src/cn/com/free/common/ActivitiTransactionFactory.java
  5. 58 0
      xjalt/src/cn/com/free/common/ColumnFunction.java
  6. 8 0
      xjalt/src/cn/com/free/common/CommonChar.java
  7. 73 0
      xjalt/src/cn/com/free/common/ContentFunction.java
  8. 35 0
      xjalt/src/cn/com/free/common/InitProcessEngine.java
  9. 24 0
      xjalt/src/cn/com/free/common/MenusFunction.java
  10. 27 0
      xjalt/src/cn/com/free/common/MyHandler.java
  11. 40 0
      xjalt/src/cn/com/free/common/RoleFunction.java
  12. 11 0
      xjalt/src/cn/com/free/common/Test.java
  13. 73 0
      xjalt/src/cn/com/free/common/WhatsAppUtil.java
  14. 167 0
      xjalt/src/cn/com/free/config/jFinalConfig.java
  15. 157 0
      xjalt/src/cn/com/free/home/BannerController.java
  16. 64 0
      xjalt/src/cn/com/free/home/CertController.java
  17. 181 0
      xjalt/src/cn/com/free/home/ColumnController.java
  18. 331 0
      xjalt/src/cn/com/free/home/ContentController.java
  19. 158 0
      xjalt/src/cn/com/free/home/DeptController.java
  20. 21 0
      xjalt/src/cn/com/free/home/HomeController.java
  21. 471 0
      xjalt/src/cn/com/free/home/IndexController.java
  22. 157 0
      xjalt/src/cn/com/free/home/LevelController.java
  23. 157 0
      xjalt/src/cn/com/free/home/MemberController.java
  24. 158 0
      xjalt/src/cn/com/free/home/MenusController.java
  25. 182 0
      xjalt/src/cn/com/free/home/SiteController.java
  26. 237 0
      xjalt/src/cn/com/free/home/UserController.java
  27. 35 0
      xjalt/src/cn/com/free/interceptor/AuthInterceptor.java
  28. 24 0
      xjalt/src/cn/com/free/interceptor/UserAuthInterceptor.java
  29. 48 0
      xjalt/src/cn/com/free/log/Handler/LogHandler.java
  30. 170 0
      xjalt/src/cn/com/free/log/constant/OptModelConstant.java
  31. 47 0
      xjalt/src/cn/com/free/log/constant/OptTypeConstant.java
  32. 17 0
      xjalt/src/cn/com/free/log/enums/OptTypeEnum.java
  33. 11 0
      xjalt/src/cn/com/free/log/model/LogDictionaryModel.java
  34. 11 0
      xjalt/src/cn/com/free/log/model/LogSysModel.java
  35. 11 0
      xjalt/src/cn/com/free/log/model/LogUserModel.java
  36. 13 0
      xjalt/src/cn/com/free/model/BannerModel.java
  37. 13 0
      xjalt/src/cn/com/free/model/ColumnModel.java
  38. 13 0
      xjalt/src/cn/com/free/model/ContentModel.java
  39. 13 0
      xjalt/src/cn/com/free/model/DeptModel.java
  40. 13 0
      xjalt/src/cn/com/free/model/LevelModel.java
  41. 13 0
      xjalt/src/cn/com/free/model/MemberModel.java
  42. 13 0
      xjalt/src/cn/com/free/model/MenusModel.java
  43. 13 0
      xjalt/src/cn/com/free/model/RoleModel.java
  44. 13 0
      xjalt/src/cn/com/free/model/SiteModel.java
  45. 13 0
      xjalt/src/cn/com/free/model/UserModel.java
  46. 13 0
      xjalt/src/cn/com/free/model/UserRoleModel.java
  47. 111 0
      xjalt/src/cn/com/free/util/DateUtil.java
  48. 213 0
      xjalt/src/cn/com/free/util/DynamicJob3.java
  49. 133 0
      xjalt/src/cn/com/free/util/HttpRequestUtil.java
  50. 79 0
      xjalt/src/cn/com/free/util/ImageFileRender.java
  51. 44 0
      xjalt/src/cn/com/free/util/IpUtil.java
  52. 40 0
      xjalt/src/cn/com/free/util/MD5.java
  53. 53 0
      xjalt/src/cn/com/free/util/MoneyUtil.java
  54. 22 0
      xjalt/src/cn/com/free/util/RandomUtil.java
  55. 135 0
      xjalt/src/cn/com/free/util/SystemStateConstant.java
  56. 51 0
      xjalt/src/cn/com/free/util/UploadFileController.java
  57. 18 0
      xjalt/src/cn/com/free/util/UserModel.java
  58. 736 0
      xjalt/src/cn/com/free/util/WechatUtil.java
  59. 115 0
      xjalt/src/cn/com/free/util/ZXingCodeUtil.java
  60. 39 0
      xjalt/src/jdbc.properties
  61. 1 0
      xjalt/src/url.properties

+ 173 - 0
xjalt/doc/sql/zhjd.sql

@@ -0,0 +1,173 @@
+
+
+DROP DATABASE IF EXISTS `zhjd`;
+CREATE DATABASE `zhjd` /*!40100 DEFAULT CHARACTER SET utf8 */;
+USE `zhjd`;
+
+#
+# Source for table zhjd_dept
+#
+
+DROP TABLE IF EXISTS `zhjd_dept`;
+CREATE TABLE `zhjd_dept` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `dept_name` varchar(255) DEFAULT NULL COMMENT '部门名称',
+  `unit_id` bigint(20) DEFAULT NULL COMMENT '所属单位id',
+  `dept_duty` varchar(255) DEFAULT NULL COMMENT '部门职责',
+  `dept_tell` varchar(255) DEFAULT NULL COMMENT '部门电话',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='部门表';
+
+#
+# Dumping data for table zhjd_dept
+#
+
+LOCK TABLES `zhjd_dept` WRITE;
+/*!40000 ALTER TABLE `zhjd_dept` DISABLE KEYS */;
+INSERT INTO `zhjd_dept` VALUES (1,'中融人力资源',0,'管理','13333333333');
+INSERT INTO `zhjd_dept` VALUES (2,'人事部',0,'人事管理','12345');
+INSERT INTO `zhjd_dept` VALUES (3,'q',0,'q','q');
+INSERT INTO `zhjd_dept` VALUES (4,'2',0,'2','2');
+/*!40000 ALTER TABLE `zhjd_dept` ENABLE KEYS */;
+UNLOCK TABLES;
+
+#
+# Source for table zhjd_message
+#
+
+DROP TABLE IF EXISTS `zhjd_message`;
+CREATE TABLE `zhjd_message` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `userid` bigint(20) DEFAULT NULL COMMENT '发布人ID',
+  `title` varchar(200) DEFAULT NULL COMMENT '标题',
+  `totaltype` varchar(10) DEFAULT NULL COMMENT '类别',
+  `release_date` varchar(20) DEFAULT NULL COMMENT '发布日期',
+  `dept_name` varchar(50) DEFAULT NULL COMMENT '发布来源',
+  `memo` text COMMENT '内容',
+  `createdate` datetime DEFAULT NULL COMMENT '创建时间',
+  `updatedate` datetime DEFAULT NULL COMMENT '修改时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='资讯表';
+
+#
+# Dumping data for table zhjd_message
+#
+
+LOCK TABLES `zhjd_message` WRITE;
+/*!40000 ALTER TABLE `zhjd_message` DISABLE KEYS */;
+INSERT INTO `zhjd_message` VALUES (1,1,'qqqq','1','2018-11-16','qqq','<p><img src=\"/upload/image/20181116/1542352779073018915.png\" title=\"1542352779073018915.png\" alt=\"QQ图片20181115184642.png\"/>qqqqq</p>',NULL,NULL);
+/*!40000 ALTER TABLE `zhjd_message` ENABLE KEYS */;
+UNLOCK TABLES;
+
+#
+# Source for table zhjd_news
+#
+
+DROP TABLE IF EXISTS `zhjd_news`;
+CREATE TABLE `zhjd_news` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `userid` bigint(20) DEFAULT NULL COMMENT '发布人ID',
+  `title` varchar(200) DEFAULT NULL COMMENT '标题',
+  `totaltype` varchar(10) DEFAULT NULL COMMENT '类别',
+  `release_date` varchar(20) DEFAULT NULL COMMENT '发布日期',
+  `dept_name` varchar(50) DEFAULT NULL COMMENT '发布来源',
+  `memo` text COMMENT '内容',
+  `createdate` datetime DEFAULT NULL COMMENT '创建时间',
+  `updatedate` datetime DEFAULT NULL COMMENT '修改时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='资讯表';
+
+#
+# Dumping data for table zhjd_news
+#
+
+LOCK TABLES `zhjd_news` WRITE;
+/*!40000 ALTER TABLE `zhjd_news` DISABLE KEYS */;
+INSERT INTO `zhjd_news` VALUES (1,1,'qqqq','1','2018-11-16','qqq','<p><img src=\"/upload/image/20181116/1542352779073018915.png\" title=\"1542352779073018915.png\" alt=\"QQ图片20181115184642.png\"/>qqqqq</p>',NULL,NULL);
+/*!40000 ALTER TABLE `zhjd_news` ENABLE KEYS */;
+UNLOCK TABLES;
+
+#
+# Source for table zhjd_role
+#
+
+DROP TABLE IF EXISTS `zhjd_role`;
+CREATE TABLE `zhjd_role` (
+  `id` int(20) NOT NULL AUTO_INCREMENT,
+  `p_id` bigint(20) DEFAULT NULL COMMENT '父类ID',
+  `role_code` varchar(40) DEFAULT NULL COMMENT '角色code',
+  `role_name` varchar(255) DEFAULT NULL COMMENT '角色名称',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='权限表';
+
+#
+# Dumping data for table zhjd_role
+#
+
+LOCK TABLES `zhjd_role` WRITE;
+/*!40000 ALTER TABLE `zhjd_role` DISABLE KEYS */;
+INSERT INTO `zhjd_role` VALUES (999,0,'ROLE_ADMIN','管理员');
+/*!40000 ALTER TABLE `zhjd_role` ENABLE KEYS */;
+UNLOCK TABLES;
+
+#
+# Source for table zhjd_user
+#
+
+DROP TABLE IF EXISTS `zhjd_user`;
+CREATE TABLE `zhjd_user` (
+  `ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增型主键',
+  `LOGIN_ID` varchar(20) NOT NULL DEFAULT '' COMMENT '登录ID',
+  `PASSWORD` varchar(32) NOT NULL COMMENT '登录密码(MD5加密)',
+  `USER_NAME` varchar(20) DEFAULT NULL COMMENT '姓名',
+  `USER_NAME_PY` varchar(20) DEFAULT NULL COMMENT '姓名简拼',
+  `GENDER` int(1) DEFAULT NULL COMMENT '性别(0:女, 1:男)',
+  `OFFICE_TELL` varchar(20) DEFAULT NULL COMMENT '办公室电话',
+  `PHONE_NO` varchar(11) DEFAULT NULL COMMENT '个人电话',
+  `HOME_ADDRESS` varchar(120) DEFAULT NULL COMMENT '家庭住址',
+  `EMAIL` varchar(40) DEFAULT NULL COMMENT '电子信箱',
+  `BIRTHDAY` varchar(10) DEFAULT NULL COMMENT '出生日期(格式:2011-11-22)',
+  `ID_NUMBER` varchar(18) DEFAULT NULL COMMENT '身份证号',
+  `CARD_NO` varchar(20) DEFAULT NULL COMMENT '卡号',
+  `REMARK` varchar(400) DEFAULT NULL COMMENT '备注',
+  `DEPT_ID` bigint(20) DEFAULT NULL COMMENT '部门ID(关联部门表)',
+  `LEVEL_NAME` varchar(2000) DEFAULT NULL COMMENT '职务名称',
+  `SORTING` varchar(20) DEFAULT NULL COMMENT '排序号',
+  `OPENID` varchar(200) DEFAULT NULL COMMENT '微信ID',
+  PRIMARY KEY (`ID`),
+  UNIQUE KEY `AK_LOGIN_ID` (`LOGIN_ID`)
+) ENGINE=InnoDB AUTO_INCREMENT=159 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='人员表';
+
+#
+# Dumping data for table zhjd_user
+#
+
+LOCK TABLES `zhjd_user` WRITE;
+/*!40000 ALTER TABLE `zhjd_user` DISABLE KEYS */;
+INSERT INTO `zhjd_user` VALUES (1,'admin','c4ca4238a0b923820dcc509a6f75849b','管理员','gly',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,'1',NULL);
+INSERT INTO `zhjd_user` VALUES (158,'test','e10adc3949ba59abbe56e057f20f883e','测试',NULL,1,'1','13333333333','1','1@qq.com','2018-11-09','1',NULL,'1111',1,'1',NULL,NULL);
+/*!40000 ALTER TABLE `zhjd_user` ENABLE KEYS */;
+UNLOCK TABLES;
+
+#
+# Source for table zhjd_user_role
+#
+
+DROP TABLE IF EXISTS `zhjd_user_role`;
+CREATE TABLE `zhjd_user_role` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `login_id` varchar(20) DEFAULT NULL COMMENT '用户登录ID',
+  `role_id` bigint(20) DEFAULT NULL COMMENT '权限ID',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='用户权限表';
+
+#
+# Dumping data for table zhjd_user_role
+#
+
+LOCK TABLES `zhjd_user_role` WRITE;
+/*!40000 ALTER TABLE `zhjd_user_role` DISABLE KEYS */;
+INSERT INTO `zhjd_user_role` VALUES (1,'admin',999);
+/*!40000 ALTER TABLE `zhjd_user_role` ENABLE KEYS */;
+UNLOCK TABLES;
+

+ 153 - 0
xjalt/src/cn/com/free/common/ActivitiPlugin.java

@@ -0,0 +1,153 @@
+package cn.com.free.common;
+
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.activiti.bpmn.converter.BpmnXMLConverter;
+import org.activiti.bpmn.model.BpmnModel;
+import org.activiti.editor.constants.ModelDataJsonConstants;
+import org.activiti.editor.language.json.converter.BpmnJsonConverter;
+import org.activiti.engine.ProcessEngine;
+import org.activiti.engine.ProcessEngineConfiguration;
+import org.activiti.engine.ProcessEngines;
+import org.activiti.engine.RepositoryService;
+import org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration;
+import org.activiti.engine.repository.Model;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.apache.commons.lang.StringUtils;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+import com.jfinal.plugin.IPlugin;
+import com.jfinal.plugin.activerecord.DbKit;
+
+public class ActivitiPlugin implements IPlugin{
+
+	static ProcessEngine processEngine = null;
+	private static ProcessEngineConfiguration processEngineConfiguration = null;
+	private boolean isStarted = false;
+	@Override
+	public boolean start(){
+		try {
+			createProcessEngine();
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return true;
+	}
+
+	@Override
+	public boolean stop() {
+		ProcessEngines.destroy(); 
+		isStarted = false;
+		return true;
+	}
+
+	private Boolean createProcessEngine() throws Exception{
+		if (isStarted) {
+			return true;
+		}
+		StandaloneProcessEngineConfiguration conf = (StandaloneProcessEngineConfiguration) ProcessEngineConfiguration
+		.createStandaloneProcessEngineConfiguration();
+//		conf.setDatabaseSchema("cwbase35_9999");
+		conf.setDataSource(DbKit.getConfig().getDataSource())
+		.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE)
+		.setDbHistoryUsed(true);
+//		conf.setTransactionsExternallyManaged(true); // 使用托管事务工厂
+		conf.setTransactionFactory(new ActivitiTransactionFactory());
+		ActivitiPlugin.processEngine = conf.buildProcessEngine();
+		isStarted = true;
+		//开启流程引擎
+		System.out.println("启动流程引擎.......");
+		
+		/**
+		 * 部署流程定义
+		 * 以后可以拿出去
+		 * */
+//		ProcessEngine pe = ProcessEngines.getDefaultProcessEngine();
+//		pe.getRepositoryService()
+//		.createDeployment()
+//		.name("督察催办")
+//		.addClasspathResource("/com/****/jbsf/oa/bpmn/Urge.bpmn")
+//		.addClasspathResource("/com/****/jbsf/oa/bpmn/Urge.png")
+//		.deploy();
+//		convertToModel(ActivitiPlugin.processEngine,"Urge:4:17504");
+//		createModel(ActivitiPlugin.processEngine);
+		return isStarted;
+	}
+
+	// 开启流程服务引擎
+	public static ProcessEngine buildProcessEngine() {
+		if (processEngine == null)
+			if (processEngineConfiguration != null) {
+				processEngine = processEngineConfiguration.buildProcessEngine();
+			}
+			return processEngine;
+	}
+	
+	
+	/**
+	 * 创建新模型
+	 * @throws UnsupportedEncodingException 
+	 * */
+	public void createModel(ProcessEngine pe) throws UnsupportedEncodingException{
+		RepositoryService repositoryService = pe.getRepositoryService();
+        ObjectMapper objectMapper = new ObjectMapper();
+        ObjectNode editorNode = objectMapper.createObjectNode();
+        editorNode.put("id", "canvas");
+        editorNode.put("resourceId", "canvas");
+        ObjectNode stencilSetNode = objectMapper.createObjectNode();
+        stencilSetNode.put("namespace", "http://b3mn.org/stencilset/bpmn2.0#");
+        editorNode.put("stencilset", stencilSetNode);
+        Model modelData = repositoryService.newModel();
+
+        ObjectNode modelObjectNode = objectMapper.createObjectNode();
+        modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, "模型名称");
+        modelObjectNode.put(ModelDataJsonConstants.MODEL_REVISION, 1);
+        String description = StringUtils.defaultString("模型描述信息");
+        modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, description);
+        modelData.setMetaInfo(modelObjectNode.toString());
+        modelData.setName("模型名称");
+        modelData.setKey(StringUtils.defaultString("Urge"));
+
+        repositoryService.saveModel(modelData);
+        repositoryService.addModelEditorSource(modelData.getId(), editorNode.toString().getBytes("utf-8"));
+	}
+	/**
+	 * 流程定义转模型
+	 * */
+	public void convertToModel(ProcessEngine pe,String processDefinitionId) throws Exception{
+		RepositoryService repositoryService = pe.getRepositoryService();
+        ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+                .processDefinitionId(processDefinitionId).singleResult();
+        InputStream bpmnStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(),
+                processDefinition.getResourceName());
+        XMLInputFactory xif = XMLInputFactory.newInstance();
+        InputStreamReader in = new InputStreamReader(bpmnStream, "UTF-8");
+        XMLStreamReader xtr = xif.createXMLStreamReader(in);
+        BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
+
+        BpmnJsonConverter converter = new BpmnJsonConverter();
+        com.fasterxml.jackson.databind.node.ObjectNode modelNode = converter.convertToJson(bpmnModel);
+        Model modelData = repositoryService.newModel();
+        modelData.setKey(processDefinition.getKey());
+        modelData.setName(processDefinition.getResourceName());
+        modelData.setCategory(processDefinition.getDeploymentId());
+
+        ObjectNode modelObjectNode = new ObjectMapper().createObjectNode();
+        modelObjectNode.put(ModelDataJsonConstants.MODEL_NAME, processDefinition.getName());
+        modelObjectNode.put(ModelDataJsonConstants.MODEL_REVISION, 1);
+        modelObjectNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, processDefinition.getDescription());
+        modelData.setMetaInfo(modelObjectNode.toString());
+
+        repositoryService.saveModel(modelData);
+
+        repositoryService.addModelEditorSource(modelData.getId(), modelNode.toString().getBytes("utf-8"));
+
+    }
+}

+ 66 - 0
xjalt/src/cn/com/free/common/ActivitiTransaction.java

@@ -0,0 +1,66 @@
+package cn.com.free.common;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import javax.sql.DataSource;
+
+import org.apache.ibatis.session.TransactionIsolationLevel;
+import org.apache.ibatis.transaction.Transaction;
+
+import com.jfinal.plugin.activerecord.DbKit;
+
+
+public class ActivitiTransaction implements Transaction {
+
+	protected Connection connection;
+	protected DataSource dataSource;
+	protected TransactionIsolationLevel level;
+	protected boolean autoCommmit;
+
+	public ActivitiTransaction(DataSource ds, TransactionIsolationLevel desiredLevel, boolean desiredAutoCommit) {
+		dataSource = ds;
+		level = desiredLevel;
+		autoCommmit = desiredAutoCommit;
+	}
+
+	public ActivitiTransaction(Connection connection) {
+		this.connection = connection;
+	}
+
+	@Override
+	public Connection getConnection() throws SQLException {
+		if (connection == null) {
+			openConnection();
+		}
+		return connection;
+	}
+
+	@Override
+	public void commit() throws SQLException {
+	}
+
+	@Override
+	public void rollback() throws SQLException {
+	}
+
+	@Override
+	public void close() throws SQLException {
+		if(connection!=null){
+			DbKit.getConfig().close(connection);
+		}
+	}
+
+	protected void openConnection() throws SQLException {
+		connection = DbKit.getConfig().getConnection();
+		if (level != null) {
+			connection.setTransactionIsolation(level.getLevel());
+		}
+	}
+
+	@Override
+	public Integer getTimeout() throws SQLException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+}

+ 28 - 0
xjalt/src/cn/com/free/common/ActivitiTransactionFactory.java

@@ -0,0 +1,28 @@
+package cn.com.free.common;
+
+import java.sql.Connection;
+import java.util.Properties;
+
+import javax.sql.DataSource;
+
+
+import org.apache.ibatis.session.TransactionIsolationLevel;
+import org.apache.ibatis.transaction.Transaction;
+import org.apache.ibatis.transaction.TransactionFactory;
+
+public class ActivitiTransactionFactory implements TransactionFactory {
+
+	@Override
+	public void setProperties(Properties props) {
+	}
+
+	@Override
+	public Transaction newTransaction(Connection conn) {
+		return new ActivitiTransaction(conn);
+	}
+
+	@Override
+	public Transaction newTransaction(DataSource ds, TransactionIsolationLevel level, boolean autoCommit) {
+		return new ActivitiTransaction(ds, level, autoCommit);
+	}
+}

+ 58 - 0
xjalt/src/cn/com/free/common/ColumnFunction.java

@@ -0,0 +1,58 @@
+package cn.com.free.common;
+
+import java.util.List;
+
+import cn.com.free.model.ColumnModel;
+import cn.com.free.model.SiteModel;
+import freemarker.template.TemplateMethodModelEx;
+import freemarker.template.TemplateModelException;
+import freemarker.template.TemplateScalarModel;
+
+
+public class ColumnFunction implements TemplateMethodModelEx{
+
+	/**
+	 * 判断用户权限Function <br>
+	 * 参数中List为多个角色,取得用户的角色和参数进行比较.<br>
+	 * 如果用户角色为当前参数中的角色返回True,反之False
+	 */
+	@SuppressWarnings("rawtypes")
+	@Override
+	public Object exec(List arguments) {
+		// 取得当前登录用户所具有的权限
+		String sqlStr = "select * from wx_site j where j.floor = '"+arguments.get(1)+"' and j.pageno = '"+arguments.get(0)+"'";
+		SiteModel siteModel = SiteModel.dao.findFirst(sqlStr);
+		String col_ids = siteModel.get("col_ids");
+		ColumnModel columnModel = null;
+		if (col_ids != null && !"".equals(col_ids)) {
+			// 判断是否有逗号
+			if (col_ids.contains(",")) {
+				String[] splitStr = col_ids.split(",");
+				TemplateScalarModel tsm2 = (TemplateScalarModel) arguments.get(2);
+				Integer index = null;
+				String arg3 = "";
+				String arg4 = "";
+				try {
+					index = Integer.valueOf(tsm2.getAsString());
+				} catch (NumberFormatException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				} catch (TemplateModelException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+				if (splitStr.length >= index) {
+					// 取得相应栏目信息
+					String sql = "select * from wx_column c where c.id = ?";
+					columnModel = ColumnModel.dao.findFirst(sql,splitStr[index-1]);
+				}
+			} else {
+				// 取得相应栏目信息
+				String sql = "select * from wx_column c where c.id = ?";
+				columnModel = ColumnModel.dao.findFirst(sql,col_ids);
+			}
+		}
+		// 该用户不满足此权限
+		return columnModel;
+	}
+}

+ 8 - 0
xjalt/src/cn/com/free/common/CommonChar.java

@@ -0,0 +1,8 @@
+package cn.com.free.common;
+
+public class CommonChar {
+	
+	public static String SESSION_USER = "login_user";
+	
+
+}

+ 73 - 0
xjalt/src/cn/com/free/common/ContentFunction.java

@@ -0,0 +1,73 @@
+package cn.com.free.common;
+
+import java.util.List;
+
+import com.jfinal.plugin.activerecord.Db;
+import com.jfinal.plugin.activerecord.Record;
+
+import cn.com.free.model.SiteModel;
+import freemarker.template.TemplateMethodModelEx;
+import freemarker.template.TemplateModelException;
+import freemarker.template.TemplateScalarModel;
+
+
+public class ContentFunction implements TemplateMethodModelEx{
+
+	/**
+	 * 判断用户权限Function <br>
+	 * 参数中List为多个角色,取得用户的角色和参数进行比较.<br>
+	 * 如果用户角色为当前参数中的角色返回True,反之False
+	 */
+	@SuppressWarnings("rawtypes")
+	@Override
+	public Object exec(List arguments) {
+		// 取得当前登录用户所具有的权限
+		List<Record> dataList = null;
+		String sqlStr = "select * from wx_site j where j.floor = '"+arguments.get(1)+"' and j.pageno = '"+arguments.get(0)+"'";
+		SiteModel siteModel = SiteModel.dao.findFirst(sqlStr);
+		if (siteModel == null) {
+			System.out.println("没有取得到楼层信息"+arguments.get(0));
+			return dataList;
+		}
+		String col_ids = siteModel.get("col_ids");
+		if (col_ids != null && !"".equals(col_ids)) {
+			// 判断是否有逗号
+			TemplateScalarModel tsm2 = (TemplateScalarModel) arguments.get(2);
+			TemplateScalarModel tsm3 = (TemplateScalarModel) arguments.get(3);
+			TemplateScalarModel tsm4 = (TemplateScalarModel) arguments.get(4);
+			Integer index = null;
+			String arg3 = "";
+			String arg4 = "";
+			try {
+				index = Integer.valueOf(tsm2.getAsString());
+				arg3 = tsm3.getAsString();
+				arg4 = tsm4.getAsString();
+			} catch (NumberFormatException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			} catch (TemplateModelException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+			if (col_ids.contains(",")) {
+				String[] splitStr = col_ids.split(",");
+				if (splitStr.length >= index) {
+					// 取得相应栏目信息
+					if ("1".equals(arg3)) {
+						String sql = "select j.*,(select c.name from wx_column c where c.id = j.col_id) columnName from wx_content j where j.col_id = ? and tjstatus = '1' and status = '1' order by j.release_date desc limit "+ arg4;
+						dataList = Db.find(sql,splitStr[index-1]);
+					} else {
+						String sql = "select j.*,(select c.name from wx_column c where c.id = j.col_id) columnName from wx_content j where j.col_id = ? and status = '1' order by j.release_date desc limit "+ arg4;
+						dataList = Db.find(sql,splitStr[index-1]);
+					}
+				}
+			} else {
+				// 取得相应栏目信息
+				String sql = "select j.*,(select c.name from wx_column c where c.id = j.col_id) columnName from wx_content j where j.col_id = ? and status = '1' order by j.release_date desc limit "+ arg4;
+				dataList = Db.find(sql,col_ids);
+			}
+		}
+		// 该用户不满足此权限
+		return dataList;
+	}
+}

+ 35 - 0
xjalt/src/cn/com/free/common/InitProcessEngine.java

@@ -0,0 +1,35 @@
+package cn.com.free.common;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+
+import org.activiti.engine.ProcessEngine;
+import org.activiti.engine.ProcessEngineConfiguration;
+import org.activiti.engine.ProcessEngines;
+import org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration;
+
+import com.jfinal.plugin.activerecord.DbKit;
+
+public class InitProcessEngine extends HttpServlet {
+	private static final long serialVersionUID = 715456159702221404L;
+
+	public void init(ServletConfig config) throws ServletException {
+		StandaloneProcessEngineConfiguration conf = (StandaloneProcessEngineConfiguration) ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();
+//		conf.setDatabaseSchema("root");
+		conf.setDataSource(DbKit.getConfig().getDataSource()).setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE).setDbHistoryUsed(true);
+		conf.setTransactionFactory(new ActivitiTransactionFactory());
+		ActivitiPlugin.processEngine = conf.buildProcessEngine();
+//自启动完成
+
+//部署流程定义
+		ProcessEngine pe = ProcessEngines.getDefaultProcessEngine();
+		pe.getRepositoryService()
+		.createDeployment()
+		.name("督察催办")
+		.addClasspathResource("/com/pansoft/jbsf/oa/bpmn/Urge.bpmn")
+		.addClasspathResource("/com/pansoft/jbsf/oa/bpmn/Urge.png")
+		.deploy();
+	}
+
+}

+ 24 - 0
xjalt/src/cn/com/free/common/MenusFunction.java

@@ -0,0 +1,24 @@
+package cn.com.free.common;
+
+import java.util.List;
+
+import cn.com.free.model.MenusModel;
+import freemarker.template.TemplateMethodModelEx;
+
+
+public class MenusFunction implements TemplateMethodModelEx{
+
+	/**
+	 * 判断用户权限Function <br>
+	 * 参数中List为多个角色,取得用户的角色和参数进行比较.<br>
+	 * 如果用户角色为当前参数中的角色返回True,反之False
+	 */
+	@SuppressWarnings("rawtypes")
+	@Override
+	public Object exec(List arguments) {
+		// 取得当前登录用户所具有的权限
+		List<MenusModel> menusList = MenusModel.dao.find("select j.* from wx_menus j where j.status = '1' order by j.id asc ");
+		// 该用户不满足此权限
+		return menusList;
+	}
+}

+ 27 - 0
xjalt/src/cn/com/free/common/MyHandler.java

@@ -0,0 +1,27 @@
+package cn.com.free.common;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.jfinal.handler.Handler;
+
+public class MyHandler extends Handler{
+	
+	private String title;
+
+	@Override
+	public void handle(String target, HttpServletRequest request,
+			HttpServletResponse response, boolean[] isHandled) {
+		request.setAttribute("title", title);
+		next.handle(target, request, response, isHandled);
+	}
+
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+}

+ 40 - 0
xjalt/src/cn/com/free/common/RoleFunction.java

@@ -0,0 +1,40 @@
+package cn.com.free.common;
+
+import java.util.List;
+
+import cn.com.free.model.RoleModel;
+import freemarker.template.TemplateMethodModelEx;
+
+
+public class RoleFunction implements TemplateMethodModelEx{
+
+	/**
+	 * 判断用户权限Function <br>
+	 * 参数中List为多个角色,取得用户的角色和参数进行比较.<br>
+	 * 如果用户角色为当前参数中的角色返回True,反之False
+	 */
+	@SuppressWarnings("rawtypes")
+	@Override
+	public Object exec(List arguments) {
+		// 取得当前登录用户所具有的权限
+		StringBuffer sBuffer = new StringBuffer();
+		sBuffer.append("select j.* from wx_role j where j.id in (select ur.role_id from wx_user_role ur where ur.login_id = '");
+		sBuffer.append(arguments.get(0));
+		sBuffer.append("') order by j.id asc");
+		List<RoleModel> roleList = RoleModel.dao.find(sBuffer.toString());
+		
+		// 遍历集合,查找该用户是否满足此权限
+		for (int i = 0; i < arguments.size(); i++) {
+			String role = String.valueOf(arguments.get(i));
+			for (RoleModel auth : roleList) {
+				// 如果当前登录用户有此权限
+				// 返回用户满足此权限
+				if (role.equals(auth.get("role_code"))) {
+					return Boolean.TRUE;
+				}
+			}
+		}
+		// 该用户不满足此权限
+		return Boolean.FALSE;
+	}
+}

+ 11 - 0
xjalt/src/cn/com/free/common/Test.java

@@ -0,0 +1,11 @@
+package cn.com.free.common;
+
+public class Test {
+
+	public static void main(String[] args) {
+		// TODO Auto-generated method stub
+		String result = WhatsAppUtil.jsonPost("https://eu9.chat-api.com/instance9767/message?token=xkakcn448iwmwh5n", "79851516710", "hhhh");
+		System.out.println(result);
+	}
+
+}

+ 73 - 0
xjalt/src/cn/com/free/common/WhatsAppUtil.java

@@ -0,0 +1,73 @@
+package cn.com.free.common;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStreamWriter;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import net.sf.json.JSONObject;
+
+public class WhatsAppUtil {
+	
+	
+	/**
+	 * 发送HttpPost请求
+	 * 
+	 * @param strURL
+	 *            服务地址
+	 * @param params
+	 * 
+	 * @return 成功:返回json字符串<br/>
+	 */
+	public static String jsonPost(String strURL, String phone,String body) {
+		try {
+			Map<String, String> params = new HashMap<String, String>();
+			params.put("phone", phone);
+			params.put("body", body);
+			URL url = new URL(strURL);// 创建连接
+			HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+			connection.setDoOutput(true);
+			connection.setDoInput(true);
+			connection.setUseCaches(false);
+			connection.setInstanceFollowRedirects(true);
+			connection.setRequestMethod("POST"); // 设置请求方式
+			connection.setRequestProperty("Accept", "application/json"); // 设置接收数据的格式
+			connection.setRequestProperty("Content-Type", "application/json"); // 设置发送数据的格式
+			connection.connect();
+			OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream(), "UTF-8"); // utf-8编码
+			out.append(JSONObject.fromObject(params).toString());
+			out.flush();
+			out.close();
+ 
+			int code = connection.getResponseCode();
+			InputStream is = null;
+			if (code == 200) {
+				is = connection.getInputStream();
+			} else {
+				is = connection.getErrorStream();
+			}
+ 
+			// 读取响应
+			int length = (int) connection.getContentLength();// 获取长度
+			if (length != -1) {
+				byte[] data = new byte[length];
+				byte[] temp = new byte[512];
+				int readLen = 0;
+				int destPos = 0;
+				while ((readLen = is.read(temp)) > 0) {
+					System.arraycopy(temp, 0, data, destPos, readLen);
+					destPos += readLen;
+				}
+				String result = new String(data, "UTF-8"); // utf-8编码
+				return result;
+			}
+ 
+		} catch (IOException e) {
+			//
+		}
+		return "error"; // 自定义错误信息
+	}
+}

+ 167 - 0
xjalt/src/cn/com/free/config/jFinalConfig.java

@@ -0,0 +1,167 @@
+package cn.com.free.config;
+
+import java.util.HashMap;
+
+import org.beetl.core.GroupTemplate;
+import org.beetl.ext.jfinal.BeetlRenderFactory;
+
+import com.jfinal.config.Constants;
+import com.jfinal.config.Handlers;
+import com.jfinal.config.Interceptors;
+import com.jfinal.config.JFinalConfig;
+import com.jfinal.config.Plugins;
+import com.jfinal.config.Routes;
+import com.jfinal.core.JFinal;
+import com.jfinal.ext.handler.ContextPathHandler;
+import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
+import com.jfinal.plugin.activerecord.CaseInsensitiveContainerFactory;
+import com.jfinal.plugin.activerecord.dialect.AnsiSqlDialect;
+import com.jfinal.plugin.c3p0.C3p0Plugin;
+import com.jfinal.render.ViewType;
+
+import cn.com.free.common.MyHandler;
+import cn.com.free.home.BannerController;
+import cn.com.free.home.CertController;
+import cn.com.free.home.ColumnController;
+import cn.com.free.home.ContentController;
+import cn.com.free.home.DeptController;
+import cn.com.free.home.IndexController;
+import cn.com.free.home.LevelController;
+import cn.com.free.home.MemberController;
+import cn.com.free.home.MenusController;
+import cn.com.free.home.SiteController;
+import cn.com.free.home.UserController;
+import cn.com.free.interceptor.AuthInterceptor;
+import cn.com.free.interceptor.UserAuthInterceptor;
+import cn.com.free.model.BannerModel;
+import cn.com.free.model.ColumnModel;
+import cn.com.free.model.ContentModel;
+import cn.com.free.model.DeptModel;
+import cn.com.free.model.LevelModel;
+import cn.com.free.model.MemberModel;
+import cn.com.free.model.MenusModel;
+import cn.com.free.model.RoleModel;
+import cn.com.free.model.SiteModel;
+import cn.com.free.model.UserModel;
+import cn.com.free.model.UserRoleModel;
+import cn.com.free.util.SystemStateConstant;
+import cn.com.free.util.UploadFileController;
+
+public class jFinalConfig extends JFinalConfig {
+
+	/**
+	 * jFinal基础配置
+	 */
+	@Override
+	public void configConstant(Constants me) {
+		loadPropertyFile("jdbc.properties");
+		me.setMainRenderFactory(new BeetlRenderFactory());
+		
+		// 可以通过groupTemplate设置全局共享变量
+		GroupTemplate groupTemplate = BeetlRenderFactory.groupTemplate;
+		HashMap<String, Object> hMap = new HashMap<String, Object>();
+		hMap.put("project", "");
+		groupTemplate.setSharedVars(hMap);
+		
+//		me.setDevMode(getPropertyToBoolean("devMode", false));
+		me.setViewType(ViewType.FREE_MARKER);
+		me.setEncoding("UTF-8");
+		me.setDevMode(true);
+		me.setBaseUploadPath(SystemStateConstant.BASEFILEPATH);
+		// 错误页面设置,在jFinal中设置的只能识别动态action中的错误,
+		// 如果是直接指定某一个页面没有或者报错,需要在web.xml中配置容器的错误页面。
+		me.setError404View("/error-404_2.html");
+		me.setError500View("/error-500_2.html");
+		
+	}
+
+	/**
+	 * jFinal路由配置
+	 */
+	@Override
+	public void configRoute(Routes me) {
+		//系统管理员
+		me.add("/", IndexController.class); //管理
+		// 路由管理
+		me.add("/user", UserController.class); //管理
+		me.add("/dept", DeptController.class); //管理
+		me.add("/level", LevelController.class); //管理
+		me.add("/upload",UploadFileController.class);
+		
+		// 业务管理
+		me.add("/menus", MenusController.class); //管理
+		me.add("/column", ColumnController.class); //管理
+		me.add("/content", ContentController.class); //管理
+		me.add("/banner", BannerController.class); //管理
+		me.add("/site", SiteController.class); //管理
+		me.add("/member", MemberController.class); //管理
+		me.add("/cert", CertController.class); //管理
+	}
+
+	/***
+	 * 数据库连接配置
+	 */
+	@Override
+	public void configPlugin(Plugins me) {
+		C3p0Plugin c3p0 = new C3p0Plugin(getProperty("jdbc.url"), getProperty("jdbc.username"),
+						  getProperty("jdbc.password"));
+		c3p0.setDriverClass(getProperty("jdbc.driverClassName"));
+		me.add(c3p0);
+		ActiveRecordPlugin arp = new ActiveRecordPlugin(c3p0);
+		me.add(arp);
+//		ActivitiPlugin ap = new ActivitiPlugin();
+//		me.add(ap);
+		arp.setDialect(new AnsiSqlDialect());
+		arp.setContainerFactory(new CaseInsensitiveContainerFactory());
+
+		arp.addMapping("wx_user", UserModel.class);// 用户信息表
+		arp.addMapping("wx_dept", DeptModel.class);// 部门表
+		arp.addMapping("wx_level", LevelModel.class);// 职务表
+		arp.addMapping("wx_role", RoleModel.class);// 权限表
+		arp.addMapping("wx_user_role", UserRoleModel.class);// 用户权限表
+		
+		arp.addMapping("wx_menus", MenusModel.class);// 菜单表
+		arp.addMapping("wx_column", ColumnModel.class);// 栏目表
+		arp.addMapping("wx_content", ContentModel.class);// 内容表
+		arp.addMapping("wx_site", SiteModel.class);// 位置表
+		arp.addMapping("wx_banner", BannerModel.class);// 位置表
+		arp.addMapping("wx_member", MemberModel.class);// 位置表
+	}
+
+	/***
+	 * 启动运行时运行
+	 */
+	@Override
+	public void afterJFinalStart() {
+		
+	}
+	
+
+	/**
+	 * 全局拦截器
+	 */
+	@Override
+	public void configInterceptor(Interceptors me) {
+		me.add(new AuthInterceptor());
+		me.add(new UserAuthInterceptor());
+	}
+
+	/**
+	 * Handler配置
+	 */
+	@Override
+	public void configHandler(Handlers me) {
+		me.add(new ContextPathHandler("contextPath"));
+		MyHandler mHandler = new MyHandler();
+		mHandler.setTitle(getProperty("title.name"));
+		me.add(mHandler);
+	}
+	
+	/**
+	 * 建议使用 JFinal 手册推荐的方式启动项目
+	 * 运行此 main 方法可以启动项目,此main方法可以放置在任意的Class类定义中,不一定要放于此
+	 */
+	public static void main(String[] args) {
+		JFinal.start("WebRoot", 80, "/", 5);
+	}
+}

+ 157 - 0
xjalt/src/cn/com/free/home/BannerController.java

@@ -0,0 +1,157 @@
+package cn.com.free.home;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.logging.Logger;
+
+import com.jfinal.core.Controller;
+
+import cn.com.free.model.BannerModel;
+import cn.com.free.model.UserModel;
+import cn.com.free.util.SystemStateConstant;
+
+public class BannerController extends Controller {
+	
+	private static Logger logger = Logger.getLogger(BannerController.class.getName());
+	
+	public static BigDecimal PAGENUM = new BigDecimal("6");
+
+	/**
+	 * 我的信息微信入口
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void index() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入页面");
+		render("/wechat/user_register_view.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void tolist(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String title = getPara("title","");
+		int currentPage = getParaToInt("currentPage",1);
+		StringBuffer scount = new StringBuffer();
+		scount.append("select count(*) totalRow from wx_banner j where 1=1 ");
+		if (!"".equals(title)) {
+			scount.append(" and j.title='");
+			scount.append(title);
+			scount.append("'");
+		}
+		long totalRow = BannerModel.dao.findFirst(scount.toString()).getLong("totalRow");
+		int totalPage = BigDecimal.valueOf(totalRow).divide(PAGENUM,BigDecimal.ROUND_UP).intValue();
+		StringBuffer sBuffer = new StringBuffer();
+		sBuffer.append("select j.* from wx_banner j where 1=1 ");
+		if (!"".equals(title)) {
+			sBuffer.append(" and j.title='");
+			sBuffer.append(title);
+			sBuffer.append("'");
+		}
+		sBuffer.append(" order by j.sort asc limit ");
+		sBuffer.append((currentPage-1)* PAGENUM.intValue());
+		sBuffer.append(",");
+		sBuffer.append(PAGENUM.intValue());
+		List<BannerModel> bannerList = BannerModel.dao.find(sBuffer.toString());
+		setAttr("dataList",bannerList);
+		setAttr("name",title);
+		// 分页需要变量
+		setAttr("currentPage",currentPage);
+		setAttr("totalPage",totalPage);
+		setAttr("totalRow",totalRow);
+		setAttr("leftmenu", "bannermenu");
+		renderFreeMarker("/home/banner/banner_list.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toadd(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		setAttr("leftmenu", "bannermenu");
+		renderFreeMarker("/home/banner/banner_add.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void add(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		BannerModel bModel = getModel(BannerModel.class, "", true);
+		boolean result = bModel.save();
+		if (result) {
+			renderFreeMarker("/home/banner/banner_suc.html");
+		} else {
+			renderFreeMarker("/home/banner/banner_add.html");
+		}
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toedit(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		BannerModel banner = BannerModel.dao.findById(id);
+		setAttr("banner",banner);
+		setAttr("leftmenu", "bannermenu");
+		renderFreeMarker("/home/banner/banner_edit.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void edit(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		BannerModel banner = getModel(BannerModel.class, "", true);
+		banner.set("id", id);
+		boolean result = banner.update();
+		setAttr("banner",banner);
+		if (result) {
+			renderFreeMarker("/home/banner/banner_suc.html");
+		} else {
+			renderFreeMarker("/home/banner/banner_edit.html");
+		}
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void detail(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		BannerModel banner = BannerModel.dao.findById(id);
+		setAttr("banner",banner);
+		setAttr("leftmenu", "bannermenu");
+		renderFreeMarker("/home/banner/banner_detail.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void delete(){
+		String id = getPara("id");
+		BannerModel.dao.deleteById(id);
+		renderFreeMarker("/home/banner/banner_suc.html");
+	}
+}

+ 64 - 0
xjalt/src/cn/com/free/home/CertController.java

@@ -0,0 +1,64 @@
+package cn.com.free.home;
+
+import java.math.BigDecimal;
+import java.util.logging.Logger;
+
+import com.jfinal.core.Controller;
+
+import cn.com.free.model.UserModel;
+import cn.com.free.util.MD5;
+
+public class CertController extends Controller {
+	
+	private static Logger logger = Logger.getLogger(CertController.class.getName());
+	
+	public static BigDecimal PAGENUM = new BigDecimal("6");
+
+	/**
+	 * 我的信息微信入口
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void index() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入页面");
+		render("/wechat/user_register_view.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void cert(){
+		UserModel user = UserModel.dao.findById(getPara("id"));
+		setAttr("userModel",user);
+		renderFreeMarker("/wechat/cert_apply_ok.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void cert_save(){
+		UserModel userModel = UserModel.dao.findById(getPara("id"));
+		if (userModel == null) {
+			setAttr("msg", "证书或密码验证失败");
+			renderFreeMarker("/wechat/cert_apply_ok.html");
+			return;
+		}
+		if (MD5.crypt(getPara("cret_key")).equals(userModel.get("password"))) {
+			// 
+			userModel.set("sign_status", "1");
+			userModel.update();
+			renderFreeMarker("/wechat/cert_sign_ok.html");
+		} else {
+			setAttr("msg", "证书或密码验证失败");
+			renderFreeMarker("/wechat/cert_apply_ok.html");
+			return;
+		}
+	}
+}

+ 181 - 0
xjalt/src/cn/com/free/home/ColumnController.java

@@ -0,0 +1,181 @@
+package cn.com.free.home;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.logging.Logger;
+
+import cn.com.free.model.ColumnModel;
+import cn.com.free.model.MenusModel;
+import cn.com.free.model.UserModel;
+import cn.com.free.util.SystemStateConstant;
+
+import com.jfinal.core.Controller;
+import com.jfinal.plugin.activerecord.Db;
+import com.jfinal.plugin.activerecord.Record;
+
+public class ColumnController extends Controller {
+	
+	private static Logger logger = Logger.getLogger(ColumnController.class.getName());
+	
+	public static BigDecimal PAGENUM = new BigDecimal("6");
+
+	/**
+	 * 我的信息微信入口
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void index() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入页面");
+		render("/wechat/user_register_view.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void tolist(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String name = getPara("name","");
+		Long menusid = getParaToLong("menusid",null);
+		int currentPage = getParaToInt("currentPage",1);
+		StringBuffer scount = new StringBuffer();
+		scount.append("select count(*) totalRow from wx_column j where 1=1 ");
+		if (!"".equals(name)) {
+			scount.append(" and j.name='");
+			scount.append(name);
+			scount.append("'");
+		}
+		if (menusid != null) {
+			scount.append(" and j.menus_id=");
+			scount.append(menusid);
+			scount.append("");
+		}
+		long totalRow = ColumnModel.dao.findFirst(scount.toString()).getLong("totalRow");
+		int totalPage = BigDecimal.valueOf(totalRow).divide(PAGENUM,BigDecimal.ROUND_UP).intValue();
+		StringBuffer sBuffer = new StringBuffer();
+		sBuffer.append("select j.*,(select m.name from wx_menus m where m.id = j.menus_id) menuname from wx_column j where 1=1 ");
+		if (!"".equals(name)) {
+			sBuffer.append(" and j.name='");
+			sBuffer.append(name);
+			sBuffer.append("'");
+		}
+		if (menusid != null) {
+			sBuffer.append(" and j.menus_id=");
+			sBuffer.append(menusid);
+			sBuffer.append("");
+		}
+		sBuffer.append(" order by j.id desc limit ");
+		sBuffer.append((currentPage-1)* PAGENUM.intValue());
+		sBuffer.append(",");
+		sBuffer.append(PAGENUM.intValue());
+		List<Record> columnList = Db.find(sBuffer.toString());
+		setAttr("dataList",columnList);
+		List<MenusModel> menusList = MenusModel.dao.find("select j.* from wx_menus j ");
+		setAttr("menusList", menusList);
+		setAttr("name",name);
+		setAttr("menusid", menusid);
+		// 分页需要变量
+		setAttr("currentPage",currentPage);
+		setAttr("totalPage",totalPage);
+		setAttr("totalRow",totalRow);
+		setAttr("leftmenu", "columnmenu");
+		renderFreeMarker("/home/column/column_list.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toadd(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		List<MenusModel> menusList = MenusModel.dao.find("select j.* from wx_menus j ");
+		setAttr("menusList", menusList);
+		setAttr("menus_id", getParaToLong("menusid",null));
+		setAttr("leftmenu", "columnmenu");
+		renderFreeMarker("/home/column/column_add.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void add(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		ColumnModel bModel = getModel(ColumnModel.class, "", true);
+		boolean result = bModel.save();
+		if (result) {
+			renderFreeMarker("/home/column/column_suc.html");
+		} else {
+			renderFreeMarker("/home/column/column_add.html");
+		}
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toedit(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		ColumnModel column = ColumnModel.dao.findById(id);
+		setAttr("column",column);
+		List<MenusModel> menusList = MenusModel.dao.find("select j.* from wx_menus j ");
+		setAttr("menusList", menusList);
+		setAttr("leftmenu", "columnmenu");
+		renderFreeMarker("/home/column/column_edit.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void edit(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		ColumnModel column = getModel(ColumnModel.class, "", true);
+		column.set("id", id);
+		boolean result = column.update();
+		setAttr("column",column);
+		if (result) {
+			renderFreeMarker("/home/column/column_suc.html");
+		} else {
+			renderFreeMarker("/home/column/column_edit.html");
+		}
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void detail(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		ColumnModel column = ColumnModel.dao.findById(id);
+		setAttr("column",column);
+		List<MenusModel> menusList = MenusModel.dao.find("select j.* from wx_menus j ");
+		setAttr("menusList", menusList);
+		setAttr("leftmenu", "columnmenu");
+		renderFreeMarker("/home/column/column_detail.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void delete(){
+		String id = getPara("id");
+		ColumnModel.dao.deleteById(id);
+		renderFreeMarker("/home/column/column_suc.html");
+	}
+}

+ 331 - 0
xjalt/src/cn/com/free/home/ContentController.java

@@ -0,0 +1,331 @@
+package cn.com.free.home;
+
+import java.io.File;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.logging.Logger;
+
+import cn.com.free.FreeBaseTools.tools.DateTimeUtil;
+import cn.com.free.model.ColumnModel;
+import cn.com.free.model.ContentModel;
+import cn.com.free.model.MenusModel;
+import cn.com.free.model.UserModel;
+import cn.com.free.util.SystemStateConstant;
+import cn.com.free.util.ZXingCodeUtil;
+
+import com.jfinal.core.Controller;
+import com.jfinal.plugin.activerecord.Db;
+import com.jfinal.plugin.activerecord.Record;
+
+public class ContentController extends Controller {
+	
+	private static Logger logger = Logger.getLogger(ContentController.class.getName());
+	
+	public static BigDecimal PAGENUM = new BigDecimal("6");
+
+	/**
+	 * 我的信息微信入口
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void index() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入页面");
+		render("/wechat/user_register_view.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void tolist(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String title = getPara("titlePage","");
+		String status = getPara("status","");
+		Long col_id = getParaToLong("col_id",null);
+		int currentPage = getParaToInt("currentPage",1);
+		StringBuffer scount = new StringBuffer();
+		scount.append("select count(*) totalRow from wx_content j where 1=1 ");
+		if (!"".equals(title)) {
+			scount.append(" and j.title like '%");
+			scount.append(title);
+			scount.append("%'");
+		}
+		if (col_id != null) {
+			scount.append(" and j.col_id=");
+			scount.append(col_id);
+			scount.append("");
+		}
+		if (!"".equals(status)) {
+			scount.append(" and j.status= '");
+			scount.append(status);
+			scount.append("'");
+		}
+		long totalRow = ContentModel.dao.findFirst(scount.toString()).getLong("totalRow");
+		int totalPage = BigDecimal.valueOf(totalRow).divide(PAGENUM,BigDecimal.ROUND_UP).intValue();
+		StringBuffer sBuffer = new StringBuffer();
+		sBuffer.append("select j.*,(select m.name from wx_column m where m.id = j.col_id) colname from wx_content j where 1=1 ");
+		if (!"".equals(title)) {
+			sBuffer.append(" and j.title like '%");
+			sBuffer.append(title);
+			sBuffer.append("%'");
+		}
+		if (col_id != null) {
+			sBuffer.append(" and j.col_id=");
+			sBuffer.append(col_id);
+			sBuffer.append("");
+		}
+		if (!"".equals(status)) {
+			sBuffer.append(" and j.status= '");
+			sBuffer.append(status);
+			sBuffer.append("'");
+		}
+		sBuffer.append(" order by j.id desc limit ");
+		sBuffer.append((currentPage-1)* PAGENUM.intValue());
+		sBuffer.append(",");
+		sBuffer.append(PAGENUM.intValue());
+		List<Record> contentList = Db.find(sBuffer.toString());
+		setAttr("dataList",contentList);
+		List<Record> columnList = Db.find("select j.* from wx_column j ");
+		setAttr("columnList", columnList);
+		setAttr("titlePage",title);
+		setAttr("col_id", col_id);
+		// 分页需要变量
+		setAttr("currentPage",currentPage);
+		setAttr("totalPage",totalPage);
+		setAttr("totalRow",totalRow);
+		setAttr("leftmenu", "contentmenu");
+		renderFreeMarker("/home/content/content_list.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toadd(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		List<ColumnModel> columnList = ColumnModel.dao.find("select j.* from wx_column j ");
+		setAttr("columnList", columnList);
+		setAttr("menus_id", getParaToLong("menusid",null));
+		setAttr("leftmenu", "contentmenu");
+		renderFreeMarker("/home/content/content_add.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void add(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		ContentModel bModel = getModel(ContentModel.class, "", true);
+		bModel.set("create_time", DateTimeUtil.getNowTime());
+		boolean result = bModel.save();
+		if (result) {
+			renderFreeMarker("/home/content/content_suc.html");
+		} else {
+			renderFreeMarker("/home/content/content_add.html");
+		}
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toedit(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		ContentModel content = ContentModel.dao.findById(id);
+		setAttr("content",content);
+		List<ColumnModel> columnList = ColumnModel.dao.find("select j.* from wx_column j ");
+		setAttr("columnList", columnList);
+		setAttr("leftmenu", "contentmenu");
+		renderFreeMarker("/home/content/content_edit.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void edit(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		ContentModel content = getModel(ContentModel.class, "", true);
+		content.set("id", id);
+		boolean result = content.update();
+		setAttr("content",content);
+		if (result) {
+			renderFreeMarker("/home/content/content_suc.html");
+		} else {
+			renderFreeMarker("/home/content/content_edit.html");
+		}
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void torelist(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String title = getPara("titlePage","");
+		String status = getPara("status","");
+		Long col_id = getParaToLong("col_id",null);
+		int currentPage = getParaToInt("currentPage",1);
+		StringBuffer scount = new StringBuffer();
+		scount.append("select count(*) totalRow from wx_content j where 1=1 ");
+		if (!"".equals(title)) {
+			scount.append(" and j.title like '%");
+			scount.append(title);
+			scount.append("%'");
+		}
+		if (col_id != null) {
+			scount.append(" and j.col_id=");
+			scount.append(col_id);
+			scount.append("");
+		}
+		if (!"".equals(status)) {
+			scount.append(" and j.status= '");
+			scount.append(status);
+			scount.append("'");
+		}
+		long totalRow = ContentModel.dao.findFirst(scount.toString()).getLong("totalRow");
+		int totalPage = BigDecimal.valueOf(totalRow).divide(PAGENUM,BigDecimal.ROUND_UP).intValue();
+		StringBuffer sBuffer = new StringBuffer();
+		sBuffer.append("select j.*,(select m.name from wx_column m where m.id = j.col_id) colname from wx_content j where 1=1 ");
+		if (!"".equals(title)) {
+			sBuffer.append(" and j.title like '%");
+			sBuffer.append(title);
+			sBuffer.append("%'");
+		}
+		if (col_id != null) {
+			sBuffer.append(" and j.col_id=");
+			sBuffer.append(col_id);
+			sBuffer.append("");
+		}
+		if (!"".equals(status)) {
+			sBuffer.append(" and j.status= '");
+			sBuffer.append(status);
+			sBuffer.append("'");
+		}
+		sBuffer.append(" order by j.id desc limit ");
+		sBuffer.append((currentPage-1)* PAGENUM.intValue());
+		sBuffer.append(",");
+		sBuffer.append(PAGENUM.intValue());
+		List<Record> contentList = Db.find(sBuffer.toString());
+		setAttr("dataList",contentList);
+		List<Record> columnList = Db.find("select j.* from wx_column j ");
+		setAttr("columnList", columnList);
+		setAttr("titlePage",title);
+		setAttr("col_id", col_id);
+		// 分页需要变量
+		setAttr("currentPage",currentPage);
+		setAttr("totalPage",totalPage);
+		setAttr("totalRow",totalRow);
+		setAttr("leftmenu", "contentremenu");
+		renderFreeMarker("/home/content/content_relist.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toreview(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		ContentModel content = ContentModel.dao.findById(id);
+		setAttr("content",content);
+		List<ColumnModel> columnList = ColumnModel.dao.find("select j.* from wx_column j ");
+		setAttr("columnList", columnList);
+		setAttr("leftmenu", "contentremenu");
+		renderFreeMarker("/home/content/content_review.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void review(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		ContentModel content = getModel(ContentModel.class, "", true);
+		content.set("id", id);
+		content.set("status", getPara("status"));
+		boolean result = content.update();
+		setAttr("content",content);
+		if (result) {
+			UserModel user = UserModel.dao.findById(userModel.getLong("id"));
+			user.set("sign_status", "0");
+			user.update();
+			renderFreeMarker("/home/content/content_resuc.html");
+		} else {
+			renderFreeMarker("/home/content/content_review.html");
+		}
+	}
+	
+	/**
+	 * 商品列表页面
+	 * @author 
+	 */
+	public void qrcode(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		File QrCodeFile = new File(SystemStateConstant.BASEFILEPATH + "\\code\\"+userModel.get("login_id")+".png");
+	    String result = SystemStateConstant.CONTENTPATH + "/upload/code/"+userModel.get("login_id")+".png";
+	    String url = SystemStateConstant.CONTENTPATH + "/cert/cert?id="+userModel.get("id");
+	    String note = "数字证书";
+	    ZXingCodeUtil.drawLogoQRCode(null, QrCodeFile, url, note);
+	    setAttr("msg", result);
+	    renderJson();
+	}
+	
+	/**
+	 * 验证是否签名
+	 * @author 
+	 */
+	public void sign_check(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		UserModel user = UserModel.dao.findById(userModel.getLong("id"));
+		if ("1".equals(user.get("sign_status"))) {
+			setAttr("msg", 1);
+		} else {
+			setAttr("msg", 0);
+		}
+	    renderJson();
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void detail(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		ContentModel content = ContentModel.dao.findById(id);
+		setAttr("content",content);
+		List<ColumnModel> columnList = ColumnModel.dao.find("select j.* from wx_column j ");
+		setAttr("columnList", columnList);
+		setAttr("leftmenu", "contentmenu");
+		renderFreeMarker("/home/content/content_detail.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void delete(){
+		String id = getPara("id");
+		ContentModel.dao.deleteById(id);
+		renderFreeMarker("/home/content/content_suc.html");
+	}
+}

+ 158 - 0
xjalt/src/cn/com/free/home/DeptController.java

@@ -0,0 +1,158 @@
+package cn.com.free.home;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.logging.Logger;
+
+import com.jfinal.core.Controller;
+
+import cn.com.free.model.DeptModel;
+import cn.com.free.model.UserModel;
+import cn.com.free.util.SystemStateConstant;
+
+public class DeptController extends Controller {
+	
+	private static Logger logger = Logger.getLogger(DeptController.class.getName());
+	
+	public static BigDecimal PAGENUM = new BigDecimal("6");
+
+	/**
+	 * 我的信息微信入口
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void index() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入页面");
+		render("/wechat/user_register_view.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void tolist(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String deptName = getPara("deptName","");
+		int currentPage = getParaToInt("currentPage",1);
+		StringBuffer scount = new StringBuffer();
+		scount.append("select count(*) totalRow from wx_dept j where 1=1 ");
+		if (!"".equals(deptName)) {
+			scount.append(" and j.dept_name='");
+			scount.append(deptName);
+			scount.append("'");
+		}
+		long totalRow = DeptModel.dao.findFirst(scount.toString()).getLong("totalRow");
+		int totalPage = BigDecimal.valueOf(totalRow).divide(PAGENUM,BigDecimal.ROUND_UP).intValue();
+		StringBuffer sBuffer = new StringBuffer();
+		sBuffer.append("select j.* from wx_dept j where 1=1 ");
+		if (!"".equals(deptName)) {
+			sBuffer.append(" and j.dept_name='");
+			sBuffer.append(deptName);
+			sBuffer.append("'");
+		}
+		sBuffer.append(" order by j.id desc limit ");
+		sBuffer.append((currentPage-1)* PAGENUM.intValue());
+		sBuffer.append(",");
+		sBuffer.append(PAGENUM.intValue());
+		List<DeptModel> deptList = DeptModel.dao.find(sBuffer.toString());
+		setAttr("deptList",deptList);
+		setAttr("deptName",deptName);
+		// 分页需要变量
+		setAttr("currentPage",currentPage);
+		setAttr("totalPage",totalPage);
+		setAttr("totalRow",totalRow);
+		setAttr("leftmenu", "deptmenu");
+		renderFreeMarker("/home/dept/dept_list.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toadd(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		setAttr("leftmenu", "deptmenu");
+		renderFreeMarker("/home/dept/dept_add.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void add(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		DeptModel bModel = getModel(DeptModel.class, "", true);
+		bModel.set("unit_id", 0);
+		boolean result = bModel.save();
+		if (result) {
+			renderFreeMarker("/home/dept/dept_suc.html");
+		} else {
+			renderFreeMarker("/home/dept/dept_add.html");
+		}
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toedit(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		DeptModel dept = DeptModel.dao.findById(id);
+		setAttr("dept",dept);
+		setAttr("leftmenu", "deptmenu");
+		renderFreeMarker("/home/dept/dept_edit.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void edit(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		DeptModel dept = getModel(DeptModel.class, "", true);
+		dept.set("id", id);
+		boolean result = dept.update();
+		setAttr("dept",dept);
+		if (result) {
+			renderFreeMarker("/home/dept/dept_suc.html");
+		} else {
+			renderFreeMarker("/home/dept/dept_edit.html");
+		}
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void detail(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		DeptModel dept = DeptModel.dao.findById(id);
+		setAttr("dept",dept);
+		setAttr("leftmenu", "deptmenu");
+		renderFreeMarker("/home/dept/dept_detail.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void delete(){
+		String id = getPara("id");
+		DeptModel.dao.deleteById(id);
+		renderFreeMarker("/home/dept/dept_suc.html");
+	}
+}

+ 21 - 0
xjalt/src/cn/com/free/home/HomeController.java

@@ -0,0 +1,21 @@
+package cn.com.free.home;
+
+import com.jfinal.core.Controller;
+
+public class HomeController extends Controller  {
+	
+	/**
+	 * 视频会议入口
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void meet() {
+		// 跳转至我的信息列表页面
+		renderFreeMarker("/view/login.html");
+	}
+
+}

+ 471 - 0
xjalt/src/cn/com/free/home/IndexController.java

@@ -0,0 +1,471 @@
+package cn.com.free.home;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.logging.Logger;
+
+import com.jfinal.core.Controller;
+import com.jfinal.plugin.activerecord.Db;
+import com.jfinal.plugin.activerecord.Record;
+
+import cn.com.free.model.BannerModel;
+import cn.com.free.model.ColumnModel;
+import cn.com.free.model.ContentModel;
+import cn.com.free.model.MenusModel;
+import cn.com.free.model.UserModel;
+import cn.com.free.util.MD5;
+import cn.com.free.util.SystemStateConstant;
+
+public class IndexController extends Controller {
+
+	private static Logger logger = Logger.getLogger(IndexController.class.getName());
+	
+	/**
+	 * 我的信息微信入口
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void index() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入页面");
+		// 取得菜单列表
+		List<MenusModel> menusList = MenusModel.dao.find("select j.* from wx_menus j where j.status = '1' order by j.id asc ");
+		setAttr("menusList", menusList);
+		// 取得banner列表
+		List<BannerModel> bannerList = BannerModel.dao.find("select j.* from wx_banner j order by j.sort asc ");
+		setAttr("bannerList", bannerList);
+		// 取得协会简介内容
+		
+		setAttr("homemenu", "首页");
+		
+		renderFreeMarker("/view/index.html");
+	}
+	
+	/**
+	 * 我的信息微信入口
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void home() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入页面");
+		// 取得菜单列表
+		List<MenusModel> menusList = MenusModel.dao.find("select j.* from wx_menus j where j.status = '1' order by j.id asc ");
+		setAttr("menusList", menusList);
+		// 取得banner列表
+		List<BannerModel> bannerList = BannerModel.dao.find("select j.* from wx_banner j order by j.sort asc ");
+		setAttr("bannerList", bannerList);
+		// 取得协会简介内容
+		
+		setAttr("homemenu", "首页");
+		setAttr("jlcc", getPara("jlcc"));
+		
+		renderFreeMarker("/view/home.html");
+	}
+	
+	/**
+	 * 我的信息微信入口
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void hometwo() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入二级页面");
+		// 取得菜单列表
+		List<MenusModel> menusList = MenusModel.dao.find("select j.* from wx_menus j where j.status = '1' order by j.id asc ");
+		setAttr("menusList", menusList);
+		// 取得banner列表
+		List<BannerModel> bannerList = BannerModel.dao.find("select j.* from wx_banner j order by j.sort asc ");
+		setAttr("bannerList", bannerList);
+		// 取得协会简介内容
+		MenusModel menus = MenusModel.dao.findById(getPara("menus_id"));
+		setAttr("homemenu", menus.get("name"));
+		String pageno = getPara("pageno","0");
+		setAttr("pageno", pageno);
+		if ("1".equals(pageno)) {
+			renderFreeMarker("/view/index_1.html");
+			return;
+		} else if ("2".equals(pageno)) {
+			renderFreeMarker("/view/index_2.html");
+			return;
+		} else if ("3".equals(pageno)) {
+			renderFreeMarker("/view/index_3.html");
+			return;
+		} else if ("4".equals(pageno)) {
+			renderFreeMarker("/view/index_4.html");
+			return;
+		}
+		renderFreeMarker("/view/home.html");
+	}
+	
+	/**
+	 * 栏目下的内容列表
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void homelist() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入前台内容列表页面");
+		setAttr("jlcc", getPara("jlcc"));
+		// 取得内容列表
+		Long col_id = getParaToLong("col_id",null);
+		ColumnModel column = ColumnModel.dao.findById(col_id);
+		setAttr("column", column);
+		setAttr("homemenu", column.get("name"));
+		setAttr("col_id", col_id);
+		if ("1".equals(column.get("type"))) {
+			ContentModel content = ContentModel.dao.findFirst("select j.* from wx_content j where j.col_id = ?",col_id);
+			setAttr("data", content);
+			List<ColumnModel> columnList = ColumnModel.dao.find("select j.* from wx_column j where j.menus_id = ?",column.getLong("menus_id"));
+			if (columnList.size() > 1) {
+				setAttr("columnList", columnList);
+			}
+			renderFreeMarker("/view/detail.html");
+		} else {
+			String pagenum = getPara("pagenum","10");
+			BigDecimal PAGENUM = new BigDecimal(pagenum);
+			int currentPage = getParaToInt("currentPage",1);
+			StringBuffer scount = new StringBuffer();
+			scount.append("select count(*) totalRow from wx_content j where 1=1 ");
+			if (col_id != null) {
+				scount.append(" and j.col_id=");
+				scount.append(col_id);
+				scount.append("");
+			}
+			long totalRow = ContentModel.dao.findFirst(scount.toString()).getLong("totalRow");
+			int totalPage = BigDecimal.valueOf(totalRow).divide(PAGENUM,BigDecimal.ROUND_UP).intValue();
+			StringBuffer sBuffer = new StringBuffer();
+			sBuffer.append("select j.*,(select m.name from wx_column m where m.id = j.col_id) colname from wx_content j where 1=1 ");
+			if (col_id != null) {
+				sBuffer.append(" and j.col_id=");
+				sBuffer.append(col_id);
+				sBuffer.append("");
+			}
+			sBuffer.append(" order by j.release_date desc limit ");
+			sBuffer.append((currentPage-1)* PAGENUM.intValue());
+			sBuffer.append(",");
+			sBuffer.append(PAGENUM.intValue());
+			List<Record> contentList = Db.find(sBuffer.toString());
+			setAttr("dataList",contentList);
+			// 分页需要变量
+			setAttr("currentPage",currentPage);
+			setAttr("totalPage",totalPage);
+			setAttr("totalRow",totalRow);
+			setAttr("pagenum", pagenum);
+			renderFreeMarker("/view/list.html");
+		}
+		
+	}
+	
+	/**
+	 * 栏目下的内容列表
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void homelistjcyf() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入吉菜研发列表页面");
+		// 取得内容列表
+		setAttr("jlcc", getPara("jlcc"));
+		Long col_id = getParaToLong("col_id",null);
+		ColumnModel column = ColumnModel.dao.findById(col_id);
+		setAttr("column", column);
+		setAttr("homemenu", column.get("name"));
+		setAttr("col_id", col_id);
+		if ("1".equals(column.get("type"))) {
+			ContentModel content = ContentModel.dao.findFirst("select j.* from wx_content j where j.col_id = ?",col_id);
+			setAttr("data", content);
+			List<ColumnModel> columnList = ColumnModel.dao.find("select j.* from wx_column j where j.menus_id = ?",column.getLong("menus_id"));
+			if (columnList.size() > 1) {
+				setAttr("columnList", columnList);
+			}
+			renderFreeMarker("/view/detail.html");
+		} else {
+			String pagenum = getPara("pagenum","8");
+			BigDecimal PAGENUM = new BigDecimal(pagenum);
+			int currentPage = getParaToInt("currentPage",1);
+			StringBuffer scount = new StringBuffer();
+			scount.append("select count(*) totalRow from wx_content j where 1=1 ");
+			if (col_id != null) {
+				scount.append(" and j.col_id=");
+				scount.append(col_id);
+				scount.append("");
+			}
+			long totalRow = ContentModel.dao.findFirst(scount.toString()).getLong("totalRow");
+			int totalPage = BigDecimal.valueOf(totalRow).divide(PAGENUM,BigDecimal.ROUND_UP).intValue();
+			StringBuffer sBuffer = new StringBuffer();
+			sBuffer.append("select j.*,(select m.name from wx_column m where m.id = j.col_id) colname from wx_content j where 1=1 ");
+			if (col_id != null) {
+				sBuffer.append(" and j.col_id=");
+				sBuffer.append(col_id);
+				sBuffer.append("");
+			}
+			sBuffer.append(" order by j.release_date desc limit ");
+			sBuffer.append((currentPage-1)* PAGENUM.intValue());
+			sBuffer.append(",");
+			sBuffer.append(PAGENUM.intValue());
+			List<Record> contentList = Db.find(sBuffer.toString());
+			setAttr("dataList",contentList);
+			// 分页需要变量
+			setAttr("currentPage",currentPage);
+			setAttr("totalPage",totalPage);
+			setAttr("totalRow",totalRow);
+			setAttr("pagenum", pagenum);
+			renderFreeMarker("/view/jcyflist.html");
+		}
+		
+	}
+	
+	/**
+	 * 栏目下的内容列表
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void homelistsdmc() {
+		// 跳转至我的信息列表页面
+		setAttr("jlcc", getPara("jlcc"));
+		logger.warning("进入十大名厨列表页面");
+		// 取得内容列表
+		Long col_id = getParaToLong("col_id",null);
+		String release_date = getPara("release_date","");
+		ColumnModel column = ColumnModel.dao.findById(col_id);
+		setAttr("column", column);
+		setAttr("homemenu", column.get("name"));
+		setAttr("col_id", col_id);
+		if ("1".equals(column.get("type"))) {
+			ContentModel content = ContentModel.dao.findFirst("select j.* from wx_content j where j.col_id = ?",col_id);
+			setAttr("data", content);
+			List<ColumnModel> columnList = ColumnModel.dao.find("select j.* from wx_column j where j.menus_id = ?",column.getLong("menus_id"));
+			if (columnList.size() > 1) {
+				setAttr("columnList", columnList);
+			}
+			renderFreeMarker("/view/detail.html");
+		} else {
+			String pagenum = getPara("pagenum","5");
+			BigDecimal PAGENUM = new BigDecimal(pagenum);
+			int currentPage = getParaToInt("currentPage",1);
+			StringBuffer scount = new StringBuffer();
+			scount.append("select count(*) totalRow from wx_content j where 1=1 ");
+			if (col_id != null) {
+				scount.append(" and j.col_id=");
+				scount.append(col_id);
+				scount.append("");
+			}
+			if (!"".equals(release_date)) {
+				scount.append(" and left(j.release_date,4)= '");
+				scount.append(release_date);
+				scount.append("'");
+			}
+			long totalRow = ContentModel.dao.findFirst(scount.toString()).getLong("totalRow");
+			int totalPage = BigDecimal.valueOf(totalRow).divide(PAGENUM,BigDecimal.ROUND_UP).intValue();
+			StringBuffer sBuffer = new StringBuffer();
+			sBuffer.append("select j.*,(select m.name from wx_column m where m.id = j.col_id) colname from wx_content j where 1=1 ");
+			if (col_id != null) {
+				sBuffer.append(" and j.col_id=");
+				sBuffer.append(col_id);
+				sBuffer.append("");
+			}
+			if (!"".equals(release_date)) {
+				sBuffer.append(" and left(j.release_date,4)= '");
+				sBuffer.append(release_date);
+				sBuffer.append("'");
+			}
+			sBuffer.append(" order by j.release_date desc limit ");
+			sBuffer.append((currentPage-1)* PAGENUM.intValue());
+			sBuffer.append(",");
+			sBuffer.append(PAGENUM.intValue());
+			List<Record> contentList = Db.find(sBuffer.toString());
+			setAttr("dataList",contentList);
+			// 分页需要变量
+			setAttr("currentPage",currentPage);
+			setAttr("totalPage",totalPage);
+			setAttr("totalRow",totalRow);
+			setAttr("release_date", release_date);
+			setAttr("pagenum", pagenum);
+			renderFreeMarker("/view/sdmclist.html");
+		}
+		
+	}
+	
+	/**
+	 * 栏目下的内容列表
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void homedetail() {
+		
+		// 跳转至我的详情页面
+		logger.warning("进入前台内容详情页面");
+		setAttr("jlcc", getPara("jlcc"));
+		// 取得内容列表
+		Long id = getParaToLong("id",null);
+		ContentModel content = ContentModel.dao.findById(id);
+		setAttr("data", content);
+		setAttr("id", id);
+		ColumnModel column = ColumnModel.dao.findById(content.getLong("col_id"));
+		setAttr("column", column);
+		setAttr("col_id", content.getLong("col_id"));
+		List<ColumnModel> columnList = ColumnModel.dao.find("select j.* from wx_column j where j.menus_id = ?",column.getLong("menus_id"));
+		if (columnList.size() > 1) {
+			setAttr("columnList", columnList);
+		}
+		// 更新浏览次数
+		content.set("llcs", Integer.valueOf(content.get("llcs")==null ? "0" : content.getStr("llcs")) + 1);
+		content.update();
+		setAttr("homemenu", column.get("name"));
+		renderFreeMarker("/view/detail.html");
+	}
+	
+	/**
+	 * 我的信息微信入口
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void contact() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入联系我们页面");
+		setAttr("jlcc", getPara("jlcc"));
+		setAttr("homemenu", "联系我们");
+		renderFreeMarker("/view/contact.html");
+	}
+	
+	/**
+	 * 我的信息微信入口
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void homemember() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入会员注册页面");
+		setAttr("jlcc", getPara("jlcc"));
+		setAttr("homemenu", "会员注册");
+		
+		renderFreeMarker("/view/member.html");
+	}
+	
+	
+	/**
+	 * 我的信息微信入口
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void admin() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入页面");
+		setAttr("jlcc", getPara("jlcc"));
+		renderFreeMarker("/home/login.html");
+	}
+	
+	/**
+	 * 我的登录
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void login() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入页面");
+		String loginId = getPara("login_id");
+		String password = getPara("password");
+		String sql = "select * from wx_user where login_id = '"+loginId+"' and password = '"+MD5.crypt(password)+"'";
+		UserModel userModel = UserModel.dao.findFirst(sql);
+		if (userModel == null) {
+			setAttr("msg", "用户名或密码不正确");
+			renderFreeMarker("/home/login.html");
+		} else {
+			getSession().setAttribute(SystemStateConstant.SessionLoginUser, userModel);
+			setAttr("userModel",userModel);
+			redirect("/main");
+		}
+	}
+	
+	/**
+	 * 我的登录
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void main() {
+		// 跳转至我的信息列表页面
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		setAttr("leftmenu", "cgmenu");
+		renderFreeMarker("/home/main.html");
+	}
+	
+	/**
+	 * 我的信息微信入口
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void logout() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入页面");
+		getSession().removeAttribute(SystemStateConstant.SessionLoginUser);
+		renderFreeMarker("/home/login.html");
+	}
+	
+	/**
+	 * 我的登录
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void sign() {
+		// 跳转至我的信息列表页面
+		renderFreeMarker("/home/pay/pay_suc.html");
+	}
+}

+ 157 - 0
xjalt/src/cn/com/free/home/LevelController.java

@@ -0,0 +1,157 @@
+package cn.com.free.home;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.logging.Logger;
+
+import cn.com.free.model.LevelModel;
+import cn.com.free.model.UserModel;
+import cn.com.free.util.SystemStateConstant;
+
+import com.jfinal.core.Controller;
+
+public class LevelController extends Controller {
+	
+	private static Logger logger = Logger.getLogger(LevelController.class.getName());
+	
+	public static BigDecimal PAGENUM = new BigDecimal("6");
+
+	/**
+	 * 我的信息微信入口
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void index() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入页面");
+		render("/wechat/user_register_view.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void tolist(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String levelName = getPara("levelName","");
+		int currentPage = getParaToInt("currentPage",1);
+		StringBuffer scount = new StringBuffer();
+		scount.append("select count(*) totalRow from wx_level j where 1=1 ");
+		if (!"".equals(levelName)) {
+			scount.append(" and j.level_name='");
+			scount.append(levelName);
+			scount.append("'");
+		}
+		long totalRow = LevelModel.dao.findFirst(scount.toString()).getLong("totalRow");
+		int totalPage = BigDecimal.valueOf(totalRow).divide(PAGENUM,BigDecimal.ROUND_UP).intValue();
+		StringBuffer sBuffer = new StringBuffer();
+		sBuffer.append("select j.* from wx_level j where 1=1 ");
+		if (!"".equals(levelName)) {
+			sBuffer.append(" and j.level_name='");
+			sBuffer.append(levelName);
+			sBuffer.append("'");
+		}
+		sBuffer.append(" order by j.id desc limit ");
+		sBuffer.append((currentPage-1)* PAGENUM.intValue());
+		sBuffer.append(",");
+		sBuffer.append(PAGENUM.intValue());
+		List<LevelModel> levelList = LevelModel.dao.find(sBuffer.toString());
+		setAttr("levelList",levelList);
+		setAttr("levelName",levelName);
+		// 分页需要变量
+		setAttr("currentPage",currentPage);
+		setAttr("totalPage",totalPage);
+		setAttr("totalRow",totalRow);
+		setAttr("leftmenu", "levelmenu");
+		renderFreeMarker("/home/level/level_list.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toadd(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		setAttr("leftmenu", "levelmenu");
+		renderFreeMarker("/home/level/level_add.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void add(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		LevelModel bModel = getModel(LevelModel.class, "", true);
+		boolean result = bModel.save();
+		if (result) {
+			renderFreeMarker("/home/level/level_suc.html");
+		} else {
+			renderFreeMarker("/home/level/level_add.html");
+		}
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toedit(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		LevelModel level = LevelModel.dao.findById(id);
+		setAttr("level",level);
+		setAttr("leftmenu", "levelmenu");
+		renderFreeMarker("/home/level/level_edit.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void edit(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		LevelModel level = getModel(LevelModel.class, "", true);
+		level.set("id", id);
+		boolean result = level.update();
+		setAttr("level",level);
+		if (result) {
+			renderFreeMarker("/home/level/level_suc.html");
+		} else {
+			renderFreeMarker("/home/level/level_edit.html");
+		}
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void detail(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		LevelModel level = LevelModel.dao.findById(id);
+		setAttr("level",level);
+		setAttr("leftmenu", "levelmenu");
+		renderFreeMarker("/home/level/level_detail.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void delete(){
+		String id = getPara("id");
+		LevelModel.dao.deleteById(id);
+		renderFreeMarker("/home/level/level_suc.html");
+	}
+}

+ 157 - 0
xjalt/src/cn/com/free/home/MemberController.java

@@ -0,0 +1,157 @@
+package cn.com.free.home;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.logging.Logger;
+
+import com.jfinal.core.Controller;
+
+import cn.com.free.model.MemberModel;
+import cn.com.free.model.UserModel;
+import cn.com.free.util.SystemStateConstant;
+
+public class MemberController extends Controller {
+	
+	private static Logger logger = Logger.getLogger(MemberController.class.getName());
+	
+	public static BigDecimal PAGENUM = new BigDecimal("6");
+
+	/**
+	 * 我的信息微信入口
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void index() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入页面");
+		render("/wechat/user_register_view.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void tolist(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String name = getPara("name","");
+		int currentPage = getParaToInt("currentPage",1);
+		StringBuffer scount = new StringBuffer();
+		scount.append("select count(*) totalRow from wx_member j where 1=1 ");
+		if (!"".equals(name)) {
+			scount.append(" and j.name='");
+			scount.append(name);
+			scount.append("'");
+		}
+		long totalRow = MemberModel.dao.findFirst(scount.toString()).getLong("totalRow");
+		int totalPage = BigDecimal.valueOf(totalRow).divide(PAGENUM,BigDecimal.ROUND_UP).intValue();
+		StringBuffer sBuffer = new StringBuffer();
+		sBuffer.append("select j.* from wx_member j where 1=1 ");
+		if (!"".equals(name)) {
+			sBuffer.append(" and j.name='");
+			sBuffer.append(name);
+			sBuffer.append("'");
+		}
+		sBuffer.append(" order by j.id desc limit ");
+		sBuffer.append((currentPage-1)* PAGENUM.intValue());
+		sBuffer.append(",");
+		sBuffer.append(PAGENUM.intValue());
+		List<MemberModel> memberList = MemberModel.dao.find(sBuffer.toString());
+		setAttr("dataList",memberList);
+		setAttr("name",name);
+		// 分页需要变量
+		setAttr("currentPage",currentPage);
+		setAttr("totalPage",totalPage);
+		setAttr("totalRow",totalRow);
+		setAttr("leftmenu", "membermenu");
+		renderFreeMarker("/home/member/member_list.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toadd(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		setAttr("leftmenu", "membermenu");
+		renderFreeMarker("/home/member/member_add.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void add(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		MemberModel bModel = getModel(MemberModel.class, "", true);
+		boolean result = bModel.save();
+		if (result) {
+			renderFreeMarker("/view/member_suc.html");
+		} else {
+			renderFreeMarker("/view/member.html");
+		}
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toedit(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		MemberModel member = MemberModel.dao.findById(id);
+		setAttr("member",member);
+		setAttr("leftmenu", "membermenu");
+		renderFreeMarker("/home/member/member_edit.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void edit(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		MemberModel member = getModel(MemberModel.class, "", true);
+		member.set("id", id);
+		boolean result = member.update();
+		setAttr("member",member);
+		if (result) {
+			renderFreeMarker("/home/member/member_suc.html");
+		} else {
+			renderFreeMarker("/home/member/member_edit.html");
+		}
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void detail(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		MemberModel member = MemberModel.dao.findById(id);
+		setAttr("member",member);
+		setAttr("leftmenu", "membermenu");
+		renderFreeMarker("/home/member/member_detail.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void delete(){
+		String id = getPara("id");
+		MemberModel.dao.deleteById(id);
+		renderFreeMarker("/home/member/member_suc.html");
+	}
+}

+ 158 - 0
xjalt/src/cn/com/free/home/MenusController.java

@@ -0,0 +1,158 @@
+package cn.com.free.home;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.logging.Logger;
+
+import cn.com.free.model.ColumnModel;
+import cn.com.free.model.MenusModel;
+import cn.com.free.model.UserModel;
+import cn.com.free.util.SystemStateConstant;
+
+import com.jfinal.core.Controller;
+
+public class MenusController extends Controller {
+	
+	private static Logger logger = Logger.getLogger(MenusController.class.getName());
+	
+	public static BigDecimal PAGENUM = new BigDecimal("6");
+
+	/**
+	 * 我的信息微信入口
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void index() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入页面");
+		render("/wechat/user_register_view.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void tolist(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String name = getPara("name","");
+		int currentPage = getParaToInt("currentPage",1);
+		StringBuffer scount = new StringBuffer();
+		scount.append("select count(*) totalRow from wx_menus j where 1=1 ");
+		if (!"".equals(name)) {
+			scount.append(" and j.name='");
+			scount.append(name);
+			scount.append("'");
+		}
+		long totalRow = MenusModel.dao.findFirst(scount.toString()).getLong("totalRow");
+		int totalPage = BigDecimal.valueOf(totalRow).divide(PAGENUM,BigDecimal.ROUND_UP).intValue();
+		StringBuffer sBuffer = new StringBuffer();
+		sBuffer.append("select j.* from wx_menus j where 1=1 ");
+		if (!"".equals(name)) {
+			sBuffer.append(" and j.name='");
+			sBuffer.append(name);
+			sBuffer.append("'");
+		}
+		sBuffer.append(" order by j.id desc limit ");
+		sBuffer.append((currentPage-1)* PAGENUM.intValue());
+		sBuffer.append(",");
+		sBuffer.append(PAGENUM.intValue());
+		List<MenusModel> menusList = MenusModel.dao.find(sBuffer.toString());
+		setAttr("dataList",menusList);
+		setAttr("name",name);
+		// 分页需要变量
+		setAttr("currentPage",currentPage);
+		setAttr("totalPage",totalPage);
+		setAttr("totalRow",totalRow);
+		setAttr("leftmenu", "menusmenu");
+		renderFreeMarker("/home/menus/menus_list.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toadd(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		setAttr("leftmenu", "menusmenu");
+		renderFreeMarker("/home/menus/menus_add.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void add(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		MenusModel bModel = getModel(MenusModel.class, "", true);
+		boolean result = bModel.save();
+		if (result) {
+			renderFreeMarker("/home/menus/menus_suc.html");
+		} else {
+			renderFreeMarker("/home/menus/menus_add.html");
+		}
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toedit(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		MenusModel menus = MenusModel.dao.findById(id);
+		setAttr("menus",menus);
+		setAttr("leftmenu", "menusmenu");
+		renderFreeMarker("/home/menus/menus_edit.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void edit(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		MenusModel menus = getModel(MenusModel.class, "", true);
+		menus.set("id", id);
+		boolean result = menus.update();
+		setAttr("menus",menus);
+		if (result) {
+			renderFreeMarker("/home/menus/menus_suc.html");
+		} else {
+			renderFreeMarker("/home/menus/menus_edit.html");
+		}
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void detail(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		MenusModel menus = MenusModel.dao.findById(id);
+		setAttr("menus",menus);
+		setAttr("leftmenu", "menusmenu");
+		renderFreeMarker("/home/menus/menus_detail.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void delete(){
+		String id = getPara("id");
+		MenusModel.dao.deleteById(id);
+		renderFreeMarker("/home/menus/menus_suc.html");
+	}
+}

+ 182 - 0
xjalt/src/cn/com/free/home/SiteController.java

@@ -0,0 +1,182 @@
+package cn.com.free.home;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.logging.Logger;
+
+import com.jfinal.core.Controller;
+import com.jfinal.plugin.activerecord.Db;
+import com.jfinal.plugin.activerecord.Record;
+
+import cn.com.free.model.ColumnModel;
+import cn.com.free.model.SiteModel;
+import cn.com.free.model.UserModel;
+import cn.com.free.util.SystemStateConstant;
+
+public class SiteController extends Controller {
+	
+	private static Logger logger = Logger.getLogger(SiteController.class.getName());
+	
+	public static BigDecimal PAGENUM = new BigDecimal("6");
+
+	/**
+	 * 我的信息微信入口
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void index() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入页面");
+		render("/wechat/user_register_view.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void tolist(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String name = getPara("name","");
+		int currentPage = getParaToInt("currentPage",1);
+		StringBuffer scount = new StringBuffer();
+		scount.append("select count(*) totalRow from wx_site j where 1=1 ");
+		if (!"".equals(name)) {
+			scount.append(" and j.name='");
+			scount.append(name);
+			scount.append("'");
+		}
+		long totalRow = SiteModel.dao.findFirst(scount.toString()).getLong("totalRow");
+		int totalPage = BigDecimal.valueOf(totalRow).divide(PAGENUM,BigDecimal.ROUND_UP).intValue();
+		StringBuffer sBuffer = new StringBuffer();
+		sBuffer.append("select j.* from wx_site j where 1=1 ");
+		if (!"".equals(name)) {
+			sBuffer.append(" and j.name='");
+			sBuffer.append(name);
+			sBuffer.append("'");
+		}
+		sBuffer.append(" order by j.pageno asc,j.floor asc limit ");
+		sBuffer.append((currentPage-1)* PAGENUM.intValue());
+		sBuffer.append(",");
+		sBuffer.append(PAGENUM.intValue());
+		List<SiteModel> siteList = SiteModel.dao.find(sBuffer.toString());
+		setAttr("dataList",siteList);
+		setAttr("name",name);
+		// 分页需要变量
+		setAttr("currentPage",currentPage);
+		setAttr("totalPage",totalPage);
+		setAttr("totalRow",totalRow);
+		setAttr("leftmenu", "sitemenu");
+		renderFreeMarker("/home/site/site_list.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toadd(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		List<Record> columnList = Db.find("select j.*,(select count(*) from wx_site u where FIND_IN_SET(j.id,u.col_ids)) isCount from wx_column j ");
+		setAttr("columnList", columnList);
+		setAttr("leftmenu", "sitemenu");
+		renderFreeMarker("/home/site/site_add.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void add(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String[] col_ids = getParaValues("col_ids");
+		StringBuffer sBuffer = new StringBuffer();
+		for(String str : col_ids) {
+			sBuffer.append(str);
+			sBuffer.append(",");
+		}
+		sBuffer.deleteCharAt(sBuffer.length()-1);
+		SiteModel bModel = getModel(SiteModel.class, "", true);
+		bModel.set("col_ids", sBuffer.toString());
+		boolean result = bModel.save();
+		if (result) {
+			renderFreeMarker("/home/site/site_suc.html");
+		} else {
+			renderFreeMarker("/home/site/site_add.html");
+		}
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toedit(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		SiteModel site = SiteModel.dao.findById(id);
+		setAttr("site",site);
+		List<Record> columnList = Db.find("select j.*,(select count(*) from wx_site u where FIND_IN_SET(j.id,u.col_ids) and u.id = ?) isCount from wx_column j ",site.getLong("id"));
+		setAttr("columnList", columnList);
+		setAttr("leftmenu", "sitemenu");
+		renderFreeMarker("/home/site/site_edit.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void edit(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		String[] col_ids = getParaValues("col_ids");
+		StringBuffer sBuffer = new StringBuffer();
+		for(String str : col_ids) {
+			sBuffer.append(str);
+			sBuffer.append(",");
+		}
+		sBuffer.deleteCharAt(sBuffer.length()-1);
+		SiteModel site = getModel(SiteModel.class, "", true);
+		site.set("id", id);
+		site.set("col_ids", sBuffer.toString());
+		boolean result = site.update();
+		setAttr("site",site);
+		if (result) {
+			renderFreeMarker("/home/site/site_suc.html");
+		} else {
+			renderFreeMarker("/home/site/site_edit.html");
+		}
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void detail(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		SiteModel site = SiteModel.dao.findById(id);
+		setAttr("site",site);
+		List<Record> columnList = Db.find("select j.*,(select count(*) from wx_site u where FIND_IN_SET(j.id,u.col_ids) and u.id = ?) isCount from wx_column j ",site.getLong("id"));
+		setAttr("columnList", columnList);
+		setAttr("leftmenu", "sitemenu");
+		renderFreeMarker("/home/site/site_detail.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void delete(){
+		String id = getPara("id");
+		SiteModel.dao.deleteById(id);
+		renderFreeMarker("/home/site/site_suc.html");
+	}
+}

+ 237 - 0
xjalt/src/cn/com/free/home/UserController.java

@@ -0,0 +1,237 @@
+package cn.com.free.home;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.logging.Logger;
+
+import com.jfinal.core.Controller;
+import com.jfinal.plugin.activerecord.Db;
+import com.jfinal.plugin.activerecord.Record;
+
+import cn.com.free.model.DeptModel;
+import cn.com.free.model.LevelModel;
+import cn.com.free.model.UserModel;
+import cn.com.free.model.UserRoleModel;
+import cn.com.free.util.MD5;
+import cn.com.free.util.SystemStateConstant;
+
+public class UserController extends Controller {
+	
+	private static Logger logger = Logger.getLogger(UserController.class.getName());
+	
+	public static BigDecimal PAGENUM = new BigDecimal("6");
+
+	/**
+	 * 我的信息微信入口
+	 * 
+	 * @param id
+	 * @param map
+	 * @return 我的信息详细页面
+	 * @Author Bcqsoft.com cql
+	 * @Date 2017-07-25
+	 */
+	public void index() {
+		// 跳转至我的信息列表页面
+		logger.warning("进入页面");
+		render("/wechat/user_register_view.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void tolist(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String deptName = getPara("deptName","");
+		String userName = getPara("userName","");
+		int currentPage = getParaToInt("currentPage",1);
+		StringBuffer scount = new StringBuffer();
+		scount.append("select count(*) totalRow from wx_user j where 1=1 ");
+		if (!"".equals(deptName)) {
+			scount.append(" and j.dept_name='");
+			scount.append(deptName);
+			scount.append("'");
+		}
+		if (!"".equals(userName)) {
+			scount.append(" and j.user_name='");
+			scount.append(userName);
+			scount.append("'");
+		}
+		long totalRow = UserModel.dao.findFirst(scount.toString()).getLong("totalRow");
+		int totalPage = BigDecimal.valueOf(totalRow).divide(PAGENUM,BigDecimal.ROUND_UP).intValue();
+		StringBuffer sBuffer = new StringBuffer();
+		sBuffer.append("select j.*,(select d.dept_name from wx_dept d where d.id = j.dept_id) dept_name from wx_user j where 1=1 ");
+		if (!"".equals(deptName)) {
+			sBuffer.append(" and j.dept_name='");
+			sBuffer.append(deptName);
+			sBuffer.append("'");
+		}
+		if (!"".equals(userName)) {
+			sBuffer.append(" and j.user_name='");
+			sBuffer.append(userName);
+			sBuffer.append("'");
+		}
+		sBuffer.append(" order by j.SORTING asc limit ");
+		sBuffer.append((currentPage-1)* PAGENUM.intValue());
+		sBuffer.append(",");
+		sBuffer.append(PAGENUM.intValue());
+		List<Record> userList = Db.find(sBuffer.toString());
+		setAttr("userList",userList);
+		setAttr("deptName",deptName);
+		setAttr("userName",userName);
+		
+		// 分页需要变量
+		setAttr("currentPage",currentPage);
+		setAttr("totalPage",totalPage);
+		setAttr("totalRow",totalRow);
+		setAttr("leftmenu", "usermenu");
+		renderFreeMarker("/home/user/user_list.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toadd(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		StringBuffer sBuffer = new StringBuffer();
+		sBuffer.append("select j.* from wx_dept j order by j.id asc");
+		List<DeptModel> deptList = DeptModel.dao.find(sBuffer.toString());
+		setAttr("deptList",deptList);
+		StringBuffer lBuffer = new StringBuffer();
+		lBuffer.append("select j.* from wx_level j order by j.id asc");
+		List<LevelModel> levelList = LevelModel.dao.find(lBuffer.toString());
+		setAttr("levelList",levelList);
+		setAttr("leftmenu", "usermenu");
+		renderFreeMarker("/home/user/user_add.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void add(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		UserModel bModel = getModel(UserModel.class, "", true);
+		bModel.set("password", MD5.crypt(getPara("password")));
+		boolean result = bModel.save();
+		if (result) {
+			renderFreeMarker("/home/user/user_suc.html");
+		} else {
+			renderFreeMarker("/home/user/user_add.html");
+		}
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void toedit(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		UserModel user = UserModel.dao.findById(id);
+		setAttr("user",user);
+		StringBuffer sBuffer = new StringBuffer();
+		sBuffer.append("select j.* from wx_dept j order by j.id asc");
+		List<DeptModel> deptList = DeptModel.dao.find(sBuffer.toString());
+		setAttr("deptList",deptList);
+		StringBuffer lBuffer = new StringBuffer();
+		lBuffer.append("select j.* from wx_level j order by j.id asc");
+		List<LevelModel> levelList = LevelModel.dao.find(lBuffer.toString());
+		setAttr("levelList",levelList);
+		setAttr("leftmenu", "usermenu");
+		renderFreeMarker("/home/user/user_edit.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void edit(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		UserModel user = getModel(UserModel.class, "", true);
+		user.set("id", id);
+		user.set("password", MD5.crypt(getPara("password")));
+		boolean result = user.update();
+		setAttr("user",user);
+		if (result) {
+			renderFreeMarker("/home/user/user_suc.html");
+		} else {
+			renderFreeMarker("/home/user/user_edit.html");
+		}
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void detail(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		UserModel user = UserModel.dao.findById(id);
+		setAttr("user",user);
+		StringBuffer sBuffer = new StringBuffer();
+		sBuffer.append("select j.* from wx_dept j order by j.id asc");
+		List<DeptModel> deptList = DeptModel.dao.find(sBuffer.toString());
+		setAttr("deptList",deptList);
+		StringBuffer lBuffer = new StringBuffer();
+		lBuffer.append("select j.* from wx_level j order by j.id asc");
+		List<LevelModel> levelList = LevelModel.dao.find(lBuffer.toString());
+		setAttr("levelList",levelList);
+		setAttr("leftmenu", "usermenu");
+		renderFreeMarker("/home/user/user_detail.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void delete(){
+		String id = getPara("id");
+		UserModel.dao.deleteById(id);
+		renderFreeMarker("/home/user/user_suc.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void torole(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String id = getPara("id");
+		UserModel user = UserModel.dao.findById(id);
+		setAttr("user",user);
+		StringBuffer sBuffer = new StringBuffer();
+		sBuffer.append("select j.*,(select count(*) from wx_user_role u where u.role_id = j.id and u.login_id = '"+user.getStr("login_id")+"' ) isCount from wx_role j order by j.id asc");
+		List<Record> roleList = Db.find(sBuffer.toString());
+		setAttr("roleList",roleList);
+		setAttr("leftmenu", "usermenu");
+		renderFreeMarker("/home/user/user_role.html");
+	}
+	
+	/**
+	 * 部门列表页面
+	 * @author 
+	 */
+	public void role(){
+		UserModel userModel = (UserModel) getSession().getAttribute(SystemStateConstant.SessionLoginUser);
+		setAttr("userModel",userModel);
+		String login_id = getPara("login_id");
+		String[] roleIds = getParaValues("roleIds");
+		for (String roleId : roleIds) {
+			UserRoleModel userRoleModel = getModel(UserRoleModel.class, "", true);
+			userRoleModel.set("login_id", login_id);
+			userRoleModel.set("role_id", roleId);
+			userRoleModel.save();
+		}
+		renderFreeMarker("/home/user/user_suc.html");
+	}
+}

+ 35 - 0
xjalt/src/cn/com/free/interceptor/AuthInterceptor.java

@@ -0,0 +1,35 @@
+package cn.com.free.interceptor;
+
+import cn.com.free.model.UserModel;
+import cn.com.free.util.DateUtil;
+import cn.com.free.util.SystemStateConstant;
+
+import com.jfinal.aop.Interceptor;
+import com.jfinal.aop.Invocation;
+import com.jfinal.core.Controller;
+
+public class AuthInterceptor implements Interceptor {
+
+	@Override
+	public void intercept(Invocation inv) {
+		Controller controller = inv.getController();
+		UserModel loginUser = controller.getSessionAttr(SystemStateConstant.SessionLoginUser);
+		if (loginUser != null){
+			inv.invoke();
+		}
+		else {
+			if ("/".equals(inv.getViewPath()) || "/login/".equals(inv.getViewPath()) || "/cert/".equals(inv.getViewPath())
+					|| "/member/".equals(inv.getViewPath())) {
+				if (DateUtil.getDateTimeCompare(DateUtil.getTodayYmd(),"2020-12-01") >= 0) {
+					// 跳转至首页面
+					controller.redirect("/index");
+				} else {
+					inv.invoke();
+				}
+			} else {
+				controller.redirect("/index");
+			}
+		}
+	}
+
+}

+ 24 - 0
xjalt/src/cn/com/free/interceptor/UserAuthInterceptor.java

@@ -0,0 +1,24 @@
+package cn.com.free.interceptor;
+
+import cn.com.free.common.ColumnFunction;
+import cn.com.free.common.ContentFunction;
+import cn.com.free.common.MenusFunction;
+import cn.com.free.common.RoleFunction;
+
+import com.jfinal.aop.Interceptor;
+import com.jfinal.aop.Invocation;
+import com.jfinal.core.Controller;
+
+public class UserAuthInterceptor implements Interceptor {
+
+	@Override
+	public void intercept(Invocation inv) {
+		Controller controller = inv.getController();
+		controller.setAttr("userAuth", new RoleFunction());
+		controller.setAttr("contentFun", new ContentFunction());
+		controller.setAttr("columnFun", new ColumnFunction());
+		controller.setAttr("menuFun", new MenusFunction());
+		inv.invoke();
+	}
+
+}

+ 48 - 0
xjalt/src/cn/com/free/log/Handler/LogHandler.java

@@ -0,0 +1,48 @@
+package cn.com.free.log.Handler;
+
+import cn.com.free.FreeBaseTools.tools.DateTimeUtil;
+import cn.com.free.log.enums.OptTypeEnum;
+import cn.com.free.log.model.LogSysModel;
+import cn.com.free.log.model.LogUserModel;
+
+public class LogHandler {
+
+	/**
+	 * 保存日志到数据库
+	 * @author 曹悠男
+	 * @param opt 添加类型 OptTypeEnum
+	 * @param optModel 操作模块,使用OptModelConstant静态常量
+	 * @param optType 操作类型,使用OptTypeConstant静态常量
+	 * @param optContent 操作说明,对于本次操作的其他说明内容,长度不超过2500个汉字
+	 * @param optStatus 操作状态()
+	 * @param optUserType 操作用户类型(1:游客    2:用户)
+	 * @param userId 操作用户ID,没有用户信息传入-1
+	 * @return 是否成功
+	 */
+	public boolean seaveLog(OptTypeEnum opt, String optModel, String optType, String optContent, int optStatus, int optUserType, int userId){
+		boolean flag = false;
+		
+		if(opt.equals(OptTypeEnum.SYSOPT)){
+			LogSysModel model = new LogSysModel();
+			model.set("optModel", optModel);
+			model.set("optType", optType);
+			model.set("optContent", optContent);
+			model.set("optDate", DateTimeUtil.getNowTime());
+			model.set("optStatus", optStatus);
+			flag = model.save();
+		}else if(opt.equals(OptTypeEnum.USEROPT)){
+			LogUserModel model = new LogUserModel();
+			model.set("optUserType", optUserType);
+			model.set("optUser", userId);
+			model.set("optModel", optModel);
+			model.set("optType", optType);
+			model.set("optContent", optContent);
+			model.set("optDate", DateTimeUtil.getNowTime());
+			model.set("optStatus", optStatus);
+			flag = model.save();
+		}
+		
+		return flag;
+	}
+	
+}

+ 170 - 0
xjalt/src/cn/com/free/log/constant/OptModelConstant.java

@@ -0,0 +1,170 @@
+package cn.com.free.log.constant;
+
+/**
+ * 操作模块常量
+ * @author 曹悠男
+ *
+ */
+public class OptModelConstant {
+	/**
+	 * 技术需求指南发布模块管理
+	 */
+	public static final String MODEL_TECHNICALREQUIREMENTSGUIDE = "TECHNICALREQUIREMENTSGUIDE";
+	
+	/**
+	 * 技术人才模块管理
+	 */
+	public static String MODEL_TALENTS_CONFERENCE = "TALENTS_CONFERENCE";
+	/**
+	 * 操作模块:招聘申请管理
+	 */
+	public static String MODEL_TALENTSRECRUITMENTRESUME = "TALENTSRECRUITMENTRESUME";
+	/**
+	 * 操作模块:就业指导信息发布管理
+	 */
+	public static String MODEL_TALENTSINFORMATION = "TALENTSINFORMATION";
+	/**
+	 * 操作模块:技术人才用户信息管理
+	 */
+	public static String MODEL_TALENTSUSER = "TALENTSUSER";
+	/**
+	 * 操作模块:技术人才招聘信息管理
+	 */
+	public static String MODEL_TALENTSRECRUITMENT = "TALENTSRECRUITMENT";
+	/**
+	 * 操作模块:技术人才简历管理
+	 */
+	public static String MODEL_TALENTSRESUME = "TALENTSRESUME";
+	/**
+	 * 操作模块:技术人才职业分类管理
+	 */
+	public static String MODEL_TALENTSPROFESSION = "TALENTSPROFESSION";
+	/**
+	 * 操作模块:技术问答主题回答管理
+	 */
+	public static String MODEL_TECHNICALTHEMEANSWER = "TECHNICALTHEMEANSWER";
+	/**
+	 * 操作模块:技术问答主题回答审核管理
+	 */
+	public static String MODEL_TECHNICALQAANSWERAUDIT = "TECHNICALQAANSWERAUDIT";
+	/**
+	 * 操作模块:技术问答主题审核管理
+	 */
+	public static String MODEL_TECHNICALQATHEMEAUDIT = "TECHNICALQATHEMEAUDIT";
+	/**
+	 * 操作模块:技术问答主题管理
+	 */
+	public static String MODEL_TECHNICALQATHEME = "TECHNICALQATHEME";
+	/**
+	 * 操作模块:技术问答公共功能管理
+	 */
+	public static String MODEL_TECHNICALQAWEB = "TECHNICALQAWEB";
+	/**
+	 * 操作模块:技术标签管理
+	 */
+	public static String MODEL_TECHNICALLABEL = "TECHNICALLABEL";
+	/**
+	 * 操作模块:产品服务类别管理
+	 */
+	public static String MODEL_PRODUCTTYPE = "PRODUCTTYPE";
+	/**
+	 * 操作模块:产品管理
+	 */
+	public static String MODEL_PRODUCT = "PRODUCT";
+	/**
+	 * 操作模块:店铺管理
+	 */
+	public static String MODEL_STORE = "STORE";
+	/**
+	 * 操作模块:供需信息管理
+	 */
+	public static String MODEL_SUPPLYDEMAND = "SUPPLYDEMAND";
+	/**
+	 * 操作模块:专家管理
+	 */
+	public static String MODEL_EXPERTS = "EXPERTS";
+	/**
+	 * 操作模块:主页操作
+	 */
+	public static String MODEL_INDEX = "INDEX";
+	/**
+	 * 操作模块:权限管理
+	 */
+	public static String MODEL_AUTHS = "AUTHS";
+	/**
+	 * 操作模块:新闻管理
+	 */
+	public static String MODEL_NEWS = "NEWS";
+	/**
+	 * 操作模块:用户管理
+	 */
+	public static String MODEL_USER = "USER";
+	/**
+	 * 操作模块:联盟管理
+	 */
+	public static String MODEL_ALLIANCE = "ALLIANCE";
+	/**
+	 * 操作模块:企业、单位管理
+	 */
+	public static String MODEL_ENTERPRISE = "ENTERPRISE";
+	/**
+	 * 操作模块:账号关系管理
+	 */
+	public static String MODEL_ACCOUNT = "ACCOUNT";
+	/**
+	 * 操作模块:创新服务
+	 */
+	public static String MODEL_INNOVATIVE = "INNOVATIVE";
+	/**
+	 * 操作模块:创新券处理
+	 */
+	public static String MODEL_SCORE = "SCORE";
+	/**
+	 * 操作模块:图片文件处理
+	 */
+	public static String MODEL_IMAGEFILE = "IMAGEFILE";
+	/**
+	 * 操作模块:技术需求发布模块处理
+	 */
+	public static String MODEL_DEMAND = "DEMAND";
+	/**
+	 * 操作模块:视频会议模块处理
+	 */
+	public static String MODEL_VIDEO_CONFERENCE = "VIDEO_CONFERENCE";
+	/**
+	 * 操作模块:技术超市前台页面操作模块
+	 */
+	public static String MODEL_TECHNOLOGY_WEBWORK = "TECHNOLOGY_WEBWORK";
+	/**
+	 * 操作模块:行业研究管理
+	 */
+	public static String MODEL_INDUSTRESERCH = "INDUSTRESERCH";
+	/**
+	 * 操作模块:地图应用处理
+	 */
+	public static String MODEL_MAPAPPLY = "MAPAPPLY";
+	/**
+	 * 操作模块:网上调查
+	 */
+	public static String MODEL_ONLINE_SURVEY = "ONLINE_SURVEY";
+	/**
+	 * 操作模块:专题研讨
+	 */
+	public static String MODEL_TFD = "TFD";
+	/**
+	 * 操作模块:数据中心
+	 */
+	public static String MODEL_DATA_CENTER = "DATACENTER";
+	/**
+	 * 操作模块:友情链接管理
+	 */
+	public static String MODEL_LINKS_MANAGER = "LINKSMANAGER";
+	/**
+	 * 操作模块:上报通知管理
+	 */
+	public static String MODEL_REPORTING_MANAGEMENT = "REPORTINGMANAGEMENT";
+	/**
+	 * 操作模块:交易申请管理
+	 */
+	public static String MODEL_TRANSACTIONAPPLY = "TRANSACTIONAPPLY";
+}

+ 47 - 0
xjalt/src/cn/com/free/log/constant/OptTypeConstant.java

@@ -0,0 +1,47 @@
+package cn.com.free.log.constant;
+
+/**
+ * 操作码常量:<br>
+ * 操作码都是int类型,最多有99个操作码,99为其他,<br>
+ * 自定义码从1开始到98结束,定义如果超过98个都归属于99
+ * @author 曹悠男
+ *
+ */
+public class OptTypeConstant {
+	/**
+	 * 其他
+	 */
+	public static String OPTCODE_OTHER = "99";
+	/**
+	 * 点击
+	 */
+	public static String OPTCODE_CHICK = "1";
+	/**
+	 * 查看
+	 */
+	public static String OPTCODE_VIEW = "2";
+	/**
+	 * 添加
+	 */
+	public static String OPTCODE_ADD = "3";
+	/**
+	 * 修改
+	 */
+	public static String OPTCODE_UPD = "4";
+	/**
+	 * 删除
+	 */
+	public static String OPTCODE_DEL = "5";
+	/**
+	 * 查找
+	 */
+	public static String OPTCODE_FIND = "6";
+	/**
+	 * 跳转
+	 */
+	public static String OPTCODE_JUMPPAGE = "7";
+	/**
+	 * 进入视频会议室
+	 */
+	public static String OPTCODE_JIONVIDEO = "8";
+}

+ 17 - 0
xjalt/src/cn/com/free/log/enums/OptTypeEnum.java

@@ -0,0 +1,17 @@
+package cn.com.free.log.enums;
+
+/**
+ * 操作类型的枚举
+ * @author 曹悠男
+ *
+ */
+public enum OptTypeEnum {
+	/**
+	 * 用户操作,游客及前台用户操作
+	 */
+	USEROPT,
+	/**
+	 * 系统操作,后台用户及系统自动操作
+	 */
+	SYSOPT;
+}

+ 11 - 0
xjalt/src/cn/com/free/log/model/LogDictionaryModel.java

@@ -0,0 +1,11 @@
+package cn.com.free.log.model;
+
+import com.jfinal.plugin.activerecord.Model;
+
+public class LogDictionaryModel extends Model<LogDictionaryModel> {
+	/**
+	 * 日志字典Model
+	 */
+	private static final long serialVersionUID = 1L;
+	public static final LogDictionaryModel dao = new LogDictionaryModel();
+}

+ 11 - 0
xjalt/src/cn/com/free/log/model/LogSysModel.java

@@ -0,0 +1,11 @@
+package cn.com.free.log.model;
+
+import com.jfinal.plugin.activerecord.Model;
+
+public class LogSysModel extends Model<LogSysModel> {
+	/**
+	 * 系统操作日志Model
+	 */
+	private static final long serialVersionUID = 6823963255791893851L;
+	public static final LogSysModel dao = new LogSysModel();
+}

+ 11 - 0
xjalt/src/cn/com/free/log/model/LogUserModel.java

@@ -0,0 +1,11 @@
+package cn.com.free.log.model;
+
+import com.jfinal.plugin.activerecord.Model;
+
+public class LogUserModel extends Model<LogUserModel> {
+	/**
+	 * 用户行为日志Model
+	 */
+	private static final long serialVersionUID = 6823963255791893851L;
+	public static final LogUserModel dao = new LogUserModel();
+}

+ 13 - 0
xjalt/src/cn/com/free/model/BannerModel.java

@@ -0,0 +1,13 @@
+package cn.com.free.model;
+
+import com.jfinal.plugin.activerecord.Model;
+
+public class BannerModel extends Model<BannerModel>{
+	
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -7008133208392906521L;
+	
+	public static final BannerModel dao=new BannerModel();
+}

+ 13 - 0
xjalt/src/cn/com/free/model/ColumnModel.java

@@ -0,0 +1,13 @@
+package cn.com.free.model;
+
+import com.jfinal.plugin.activerecord.Model;
+
+public class ColumnModel extends Model<ColumnModel>{
+	
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 5364095462610404265L;
+	
+	public static final ColumnModel dao=new ColumnModel();
+}

+ 13 - 0
xjalt/src/cn/com/free/model/ContentModel.java

@@ -0,0 +1,13 @@
+package cn.com.free.model;
+
+import com.jfinal.plugin.activerecord.Model;
+
+public class ContentModel extends Model<ContentModel>{
+	
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 5364095462610404265L;
+	
+	public static final ContentModel dao=new ContentModel();
+}

+ 13 - 0
xjalt/src/cn/com/free/model/DeptModel.java

@@ -0,0 +1,13 @@
+package cn.com.free.model;
+
+import com.jfinal.plugin.activerecord.Model;
+
+public class DeptModel extends Model<DeptModel>{
+	
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 5364095462610404265L;
+	
+	public static final DeptModel dao=new DeptModel();
+}

+ 13 - 0
xjalt/src/cn/com/free/model/LevelModel.java

@@ -0,0 +1,13 @@
+package cn.com.free.model;
+
+import com.jfinal.plugin.activerecord.Model;
+
+public class LevelModel extends Model<LevelModel>{
+	
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 5364095462610404265L;
+	
+	public static final LevelModel dao=new LevelModel();
+}

+ 13 - 0
xjalt/src/cn/com/free/model/MemberModel.java

@@ -0,0 +1,13 @@
+package cn.com.free.model;
+
+import com.jfinal.plugin.activerecord.Model;
+
+public class MemberModel extends Model<MemberModel>{
+	
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -7008133208392906521L;
+	
+	public static final MemberModel dao=new MemberModel();
+}

+ 13 - 0
xjalt/src/cn/com/free/model/MenusModel.java

@@ -0,0 +1,13 @@
+package cn.com.free.model;
+
+import com.jfinal.plugin.activerecord.Model;
+
+public class MenusModel extends Model<MenusModel>{
+	
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 5364095462610404265L;
+	
+	public static final MenusModel dao=new MenusModel();
+}

+ 13 - 0
xjalt/src/cn/com/free/model/RoleModel.java

@@ -0,0 +1,13 @@
+package cn.com.free.model;
+
+import com.jfinal.plugin.activerecord.Model;
+
+public class RoleModel extends Model<RoleModel>{
+	
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -7008133208392906521L;
+	
+	public static final RoleModel dao=new RoleModel();
+}

+ 13 - 0
xjalt/src/cn/com/free/model/SiteModel.java

@@ -0,0 +1,13 @@
+package cn.com.free.model;
+
+import com.jfinal.plugin.activerecord.Model;
+
+public class SiteModel extends Model<SiteModel>{
+	
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 5364095462610404265L;
+	
+	public static final SiteModel dao=new SiteModel();
+}

+ 13 - 0
xjalt/src/cn/com/free/model/UserModel.java

@@ -0,0 +1,13 @@
+package cn.com.free.model;
+
+import com.jfinal.plugin.activerecord.Model;
+
+public class UserModel extends Model<UserModel>{
+	
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -7008133208392906521L;
+	
+	public static final UserModel dao=new UserModel();
+}

+ 13 - 0
xjalt/src/cn/com/free/model/UserRoleModel.java

@@ -0,0 +1,13 @@
+package cn.com.free.model;
+
+import com.jfinal.plugin.activerecord.Model;
+
+public class UserRoleModel extends Model<UserRoleModel>{
+	
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -7008133208392906521L;
+	
+	public static final UserRoleModel dao=new UserRoleModel();
+}

+ 111 - 0
xjalt/src/cn/com/free/util/DateUtil.java

@@ -0,0 +1,111 @@
+package cn.com.free.util;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+public class DateUtil {
+
+	/**
+	 * 取得当前年份
+	 * 
+	 * @author zbq
+	 * @date 2010-01-29
+	 */
+	public static String getCurrentYear(){
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
+        Date date = new Date();
+        return sdf.format(date);
+	}
+	
+	/**
+	 * 取得年月日时分秒
+	 * 
+	 * @author zbq
+	 * @date 2010-01-29
+	 */
+	public static String getCurrentTime(){
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date date = new Date();
+        return sdf.format(date);
+	}
+	
+	/**
+	 * 取得年月日时分秒
+	 * 
+	 * @author zbq
+	 * @date 2010-01-29
+	 */
+	public static String getYmdSfm(){
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+        Date date = new Date();
+        return sdf.format(date);
+	}
+	
+	/**
+	 * 取得当前日期字符串
+	 * 
+	 * @return YYYYMMDD(例:20110829)
+	 * 
+	 * @Author zbq
+	 * @Date 2011-8-30
+	 */
+	public static String getTodayYmd() {
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Date date = new Date();
+        return sdf.format(date);
+	}
+	
+	/**
+	 * 取得一周日期
+	 * 
+	 * @author zbq
+	 * @date 2010-01-29
+	 */
+	public static List<String> getDateToWeek(Date date){
+		List<String> dateWeekList = new ArrayList<String>();
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+		String time = "";
+		//flag用来存取与当天日期的相差数
+		int flag = 0;
+		for(int i=1;i<8;i++){
+			//新建日历
+			Calendar cal = Calendar.getInstance();
+			//在日历中找到当前日期
+			cal.setTime(date);
+			//当前日期时本周第几天,默认按照西方惯例上周星期天为第一天
+			flag = -cal.get(Calendar.DAY_OF_WEEK);
+			//根据循环。当天与上周星期天和本周一到周五相差的天数
+			cal.add(Calendar.DATE, flag+i);
+			//转化格式
+			time = sdf.format(cal.getTime());
+			//存入list
+			dateWeekList.add(time);
+		}
+		return dateWeekList;	
+	}
+	
+	/**
+	 * 两个日期比较
+	 * 
+	 * @return 比较结果0为相等、小于0为前小于后,大于0为前大于后
+	 * 
+	 * @Author zbq
+	 * @Date 2011-8-30
+	 */
+	public static int getDateTimeCompare(String dateStrStart,String dateStrEnd) {
+		Calendar c1 = Calendar.getInstance();
+		Calendar c2 = Calendar.getInstance();
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+		try {
+			c2.setTime(sdf.parse(dateStrEnd));
+			c1.setTime(sdf.parse(dateStrStart));
+		} catch (java.text.ParseException e) {
+			
+		}
+		int result = c1.compareTo(c2);
+		return result;
+	}
+}

+ 213 - 0
xjalt/src/cn/com/free/util/DynamicJob3.java

@@ -0,0 +1,213 @@
+package cn.com.free.util;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+
+import com.jfinal.kit.JsonKit;
+import com.jfinal.kit.Prop;
+import com.jfinal.kit.PropKit;
+
+import cn.com.free.model.BannerModel;
+import cn.com.free.model.ContentModel;
+
+/***类描述:
+*@author: raifei
+*@date: 日期:2018年8月20日 时间:下午5:14:26
+*@version 1.0
+*/
+public class DynamicJob3{
+    
+     public static void execute() throws JobExecutionException {
+    	 Prop prop = PropKit.use("url.properties");
+		 String url = prop.get("pc.url");
+		 webCrawler(url);
+     }
+    public static void webCrawler(String sr) {
+        try {
+            //获取所有链接
+            String[] strs = sr.split(",");
+            for(String url : strs){
+                System.out.print(url);
+                webCrawler1(url);
+            }
+       
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+    public static void webCrawler1(String url) throws IOException {
+           Document document = Jsoup.connect(url)
+                   //需要加上userAgent才能伪装成浏览器而不会被网站屏蔽IP
+                   //(这种做法可能也会被某些网站拉黑IP一段时间,由于不太稳定到底是不是代码的问题,还在测试中...)
+                   .userAgent("User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11")
+                   //加上cookie信息
+                   .cookie("auth", "token")
+                   //设置超时
+                   .timeout(30000)
+                   //用get()方式请求网址,也可以post()方式
+                   .get();
+           //此处可以文档处理
+          // document = Jsoup.parse(document.toString());
+           
+           
+           //获取列表
+           Elements elements = document.select("table");
+           
+           //获取列表循环元素
+           for (Element tr : elements.select("tr")) {
+               //循环元素二次筛选,筛选到 a标签
+               Elements tds = tr.select("a");
+               
+               //获取a标签,跳转抓取详情
+               String href = tds.attr("abs:href");
+              
+               //提前捕获标题嘛
+               
+               String title=tr.select("title").text();
+
+               //
+               //System.out.print(href);
+               
+               List<String> imglist=new ArrayList<String>();
+              
+               //查找缩略图,查找图片
+               Elements imgs=tr.select("img");
+               for (Element element : imgs) {
+                   //获取每个img标签URL "abs:"表示绝对路径
+                   String imgSrc = element.attr("abs:src");
+                   //String affix_name=imgSrc;
+                   String fileExt = imgSrc.substring(imgSrc.lastIndexOf(".") + 1).toLowerCase();
+                   String imgpath=UUID.randomUUID().toString().replaceAll("-", "")+"."+fileExt;
+                   // 打印URL
+                   System.out.println(imgSrc);
+                   imglist.add(imgpath);
+                   //下载图片到本地
+                 downImages(PropKit.get("fileservice"), imgSrc,imgpath);
+               }
+               webCrawler(href,imglist);
+               System.out.print(imgs);
+           }
+    }
+    public static void webCrawler(String uri,List<String> imgList) {
+        try {
+            //获取整个页面文件
+            Document document = Jsoup.connect(uri)
+                    //需要加上userAgent才能伪装成浏览器而不会被网站屏蔽IP
+                    //(这种做法可能也会被某些网站拉黑IP一段时间,由于不太稳定到底是不是代码的问题,还在测试中...)
+                    .userAgent("User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11")
+                    //加上cookie信息
+                    .cookie("auth", "token")
+                    //设置超时
+                    .timeout(30000)
+                    //用get()方式请求网址,也可以post()方式
+                    .get();
+            //此处可以文档处理
+           // document = Jsoup.parse(document.toString());
+            
+            //获取文章标题
+            String source=uri;//文章来源
+            String title= document.select("title").text();//文章标题
+            String author="";//获取来源
+            if(!"".equals("author")){
+                author=document.select("author").text();
+            }
+            String details="";
+            //获取详情
+            Elements elements = document.select("content");
+            //抓取图片并替换链接
+            Elements imgs = elements.select("img[src]");
+            
+            for (Element img : imgs){
+                String affix_name=img.attr("abs:src");
+                String fileExt = affix_name.substring(affix_name.lastIndexOf(".") + 1).toLowerCase();
+                String imgpath=UUID.randomUUID().toString().replaceAll("-", "")+"."+fileExt;
+                img.attr("src",PropKit.get("fileservice")+"//"+imgpath);
+                //下载图像
+                downImages(PropKit.get("fileservice"),affix_name,imgpath);
+                
+            }
+            details=elements.html();
+            ContentModel bModel = new ContentModel();
+            bModel.set("title", title);
+            bModel.set("col_id", 1);
+            bModel.set("memo", details);
+            bModel.set("type", 0);
+            bModel.set("status", 1);
+            bModel.save();
+           
+            //System.out.print(details);
+            //获取列表循环元素
+            
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+    public static void downImages(String filePath, String imgUrl,String newname) {
+        // 若指定文件夹没有,则先创建
+        File dir = new File(filePath);
+        if (!dir.exists()) {
+            dir.mkdirs();
+        }
+        // 截取图片文件名
+        String fileName =imgUrl.substring(imgUrl.lastIndexOf('/') + 1, imgUrl.length());
+       
+        try {
+            // 文件名里面可能有中文或者空格,所以这里要进行处理。但空格又会被URLEncoder转义为加号
+            String urlTail = URLEncoder.encode(fileName, "UTF-8");
+            // 因此要将加号转化为UTF-8格式的%20
+            imgUrl = imgUrl.substring(0, imgUrl.lastIndexOf('/') + 1) + urlTail.replaceAll("\\+", "\\%20");
+
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        // 写出的路径
+        File file = new File(filePath + File.separator + ("".equals(newname)?fileName:newname));
+
+        try {
+            // 获取图片URL
+            URL url = new URL(imgUrl);
+            // 获得连接
+            URLConnection connection = url.openConnection();
+            // 设置10秒的相应时间
+            connection.setConnectTimeout(10 * 1000);
+            // 获得输入流
+            InputStream in = connection.getInputStream();
+            // 获得输出流
+            BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(file));
+            // 构建缓冲区
+            byte[] buf = new byte[1024];
+            int size;
+            // 写入到文件
+            while (-1 != (size = in.read(buf))) {
+                out.write(buf, 0, size);
+            }
+            out.close();
+            in.close();
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+    }
+}

+ 133 - 0
xjalt/src/cn/com/free/util/HttpRequestUtil.java

@@ -0,0 +1,133 @@
+package cn.com.free.util;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.List;
+import java.util.Map;
+
+public class HttpRequestUtil {
+
+    /**
+     * 向指定URL发送GET方法的请求
+     * 
+     * @param url
+     *            发送请求的URL
+     * @param param
+     *            请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
+     * @return URL 所代表远程资源的响应结果
+     */
+    public static String sendGet(String url, String param) {
+        String result = "";
+        BufferedReader in = null;
+        try {
+            String urlNameString = url + "?" + param;
+            URL realUrl = new URL(urlNameString);
+            // 打开和URL之间的连接
+            URLConnection connection = realUrl.openConnection();
+            // 设置通用的请求属性
+            connection.setRequestProperty("accept", "*/*");
+            connection.setRequestProperty("connection", "Keep-Alive");
+            connection.setRequestProperty("user-agent",
+                    "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+            // 建立实际的连接
+            connection.connect();
+            // 获取所有响应头字段
+            Map<String, List<String>> map = connection.getHeaderFields();
+            // 遍历所有的响应头字段
+            for (String key : map.keySet()) {
+                System.out.println(key + "--->" + map.get(key));
+            }
+            // 定义 BufferedReader输入流来读取URL的响应
+            in = new BufferedReader(new InputStreamReader(
+                    connection.getInputStream()));
+            String line;
+            while ((line = in.readLine()) != null) {
+                result += line;
+            }
+        } catch (Exception e) {
+            System.out.println("发送GET请求出现异常!" + e);
+            e.printStackTrace();
+        }
+        // 使用finally块来关闭输入流
+        finally {
+            try {
+                if (in != null) {
+                    in.close();
+                }
+            } catch (Exception e2) {
+                e2.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 向指定 URL 发送POST方法的请求
+     * 
+     * @param url
+     *            发送请求的 URL
+     * @param param
+     *            请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
+     * @return 所代表远程资源的响应结果
+     */
+    public static String sendPost(String url, String param) {
+        PrintWriter out = null;
+        BufferedReader in = null;
+        String result = "";
+        try {
+            URL realUrl = new URL(url);
+            // 打开和URL之间的连接
+            URLConnection conn = realUrl.openConnection();
+            // 设置通用的请求属性
+            conn.setRequestProperty("accept", "*/*");
+            conn.setRequestProperty("connection", "Keep-Alive");
+            conn.setRequestProperty("user-agent",
+                    "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+            // 发送POST请求必须设置如下两行
+            conn.setDoOutput(true);
+            conn.setDoInput(true);
+            // 获取URLConnection对象对应的输出流
+            out = new PrintWriter(conn.getOutputStream());
+            // 发送请求参数
+            out.print(param);
+            // flush输出流的缓冲
+            out.flush();
+            // 定义BufferedReader输入流来读取URL的响应
+            in = new BufferedReader(
+                    new InputStreamReader(conn.getInputStream()));
+            String line;
+            while ((line = in.readLine()) != null) {
+                result += line;
+            }
+        } catch (Exception e) {
+            System.out.println("发送 POST 请求出现异常!"+e);
+            e.printStackTrace();
+        }
+        //使用finally块来关闭输出流、输入流
+        finally{
+            try{
+                if(out!=null){
+                    out.close();
+                }
+                if(in!=null){
+                    in.close();
+                }
+            }
+            catch(IOException ex){
+                ex.printStackTrace();
+            }
+        }
+        return result;
+    }  
+    
+    public static void main(String[] args) {
+        //发送 GET 请求
+        String s=HttpRequestUtil.sendGet("http://139.210.167.203:8080/cert/cert", "login_id=admin");
+        System.out.println(s);
+    }
+
+}

+ 79 - 0
xjalt/src/cn/com/free/util/ImageFileRender.java

@@ -0,0 +1,79 @@
+package cn.com.free.util;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.ServletOutputStream;
+
+import com.jfinal.render.Render;
+
+import cn.com.free.log.Handler.LogHandler;
+import cn.com.free.log.constant.OptModelConstant;
+import cn.com.free.log.constant.OptTypeConstant;
+import cn.com.free.log.enums.OptTypeEnum;
+
+public class ImageFileRender extends Render {
+	
+	LogHandler logHandler = new LogHandler();
+	Map<String, String> ContentTypeKit = new HashMap<String, String>();
+	String imageName;
+	String mimetype;
+	
+	/**
+	 * 自定义返回图片方法
+	 * @param imageName 图片的带名称全路径
+	 * @param mimetype Mime类型
+	 */
+	public ImageFileRender(String imageName, String mimetype){
+		super();
+		ContentTypeKit.put("jpeg","image/jpeg");
+		ContentTypeKit.put("jpg","image/jpeg");
+		ContentTypeKit.put("jpe","image/jpeg");
+		ContentTypeKit.put("png","image/png");
+		ContentTypeKit.put("gif","image/gif");
+		this.imageName = imageName;
+		this.mimetype = mimetype;
+	}
+
+	@Override
+	public void render() {
+		ServletOutputStream sos = null;
+		try {
+			File file = new File(imageName);
+			// 设置头信息,内容处理的方式,attachment以附件的形式打开,就是进行下载,并设置下载文件的命名
+			// response.setHeader("Content-Disposition","attachment;filename="+file.getName());
+			response.setHeader("Pragma", "no-cache");
+			response.setHeader("Cache-Control", "no-cache");
+			response.setDateHeader("Expires", 0);
+			response.setContentType(ContentTypeKit.get(mimetype));
+			sos=response.getOutputStream();
+			// 创建文件输入流
+			FileInputStream is = new FileInputStream(file);
+			// 创建缓冲区
+			byte[] buffer = new byte[1024];
+			int len = 0;
+			while ((len = is.read(buffer)) != -1) {
+				sos.write(buffer, 0, len);
+			}
+			is.close();
+			// 记录日志
+			logHandler.seaveLog(OptTypeEnum.SYSOPT, OptModelConstant.MODEL_IMAGEFILE, OptTypeConstant.OPTCODE_VIEW, "查看图片" + imageName + "。", 1, -1, -1);
+		} catch (Exception e) {
+			logHandler.seaveLog(OptTypeEnum.SYSOPT, OptModelConstant.MODEL_IMAGEFILE, OptTypeConstant.OPTCODE_VIEW, "图片render出错:"+e.getLocalizedMessage(), 2, -1, -1);
+			throw new RuntimeException(e);
+		} finally {
+			if (sos != null)
+				try {
+					sos.close();
+				} catch (IOException e) {
+					e.printStackTrace();
+				}
+		}
+		
+	}
+	
+	
+}

+ 44 - 0
xjalt/src/cn/com/free/util/IpUtil.java

@@ -0,0 +1,44 @@
+package cn.com.free.util;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+import javax.servlet.http.HttpServletRequest;
+
+public class IpUtil {
+
+	/** 
+     * 获取当前网络ip 
+     * @param request 
+     * @return 
+     */  
+    public static String getIpAddr(HttpServletRequest request){  
+        String ipAddress = request.getHeader("x-forwarded-for");  
+            if(ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {  
+                ipAddress = request.getHeader("Proxy-Client-IP");  
+            }  
+            if(ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {  
+                ipAddress = request.getHeader("WL-Proxy-Client-IP");  
+            }  
+            if(ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {  
+                ipAddress = request.getRemoteAddr();  
+                if(ipAddress.equals("127.0.0.1") || ipAddress.equals("0:0:0:0:0:0:0:1")){  
+                    //根据网卡取本机配置的IP  
+                    InetAddress inet=null;  
+                    try {  
+                        inet = InetAddress.getLocalHost();  
+                    } catch (UnknownHostException e) {  
+                        e.printStackTrace();  
+                    }  
+                    ipAddress= inet.getHostAddress();  
+                }  
+            }  
+            //对于通过多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割  
+            if(ipAddress!=null && ipAddress.length()>15){ //"***.***.***.***".length() = 15  
+                if(ipAddress.indexOf(",")>0){  
+                    ipAddress = ipAddress.substring(0,ipAddress.indexOf(","));  
+                }  
+            }  
+            return ipAddress;   
+    }
+}

+ 40 - 0
xjalt/src/cn/com/free/util/MD5.java

@@ -0,0 +1,40 @@
+package cn.com.free.util;
+
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+/** 
+ * @author lixinjun
+ * @date 2012-08-10
+ * @desc MD5加密算法
+ *
+ */
+public class MD5 {
+
+	public static String crypt(String str) {
+		if (str == null || str.length() == 0) {
+			return "";
+		}
+
+		StringBuffer hexString = new StringBuffer();
+
+		try {
+			MessageDigest md = MessageDigest.getInstance("MD5");
+			md.update(str.getBytes());
+			byte[] hash = md.digest();
+
+			for (int i = 0; i < hash.length; i++) {
+				if ((0xff & hash[i]) < 0x10) {
+					hexString.append("0" + Integer.toHexString((0xFF & hash[i])));
+				} else {
+					hexString.append(Integer.toHexString(0xFF & hash[i]));
+				}
+			}
+		} catch (NoSuchAlgorithmException e) {
+			e.printStackTrace();
+		}
+
+		return hexString.toString();
+	}
+	
+}

+ 53 - 0
xjalt/src/cn/com/free/util/MoneyUtil.java

@@ -0,0 +1,53 @@
+package cn.com.free.util;
+
+import java.text.NumberFormat;
+import java.text.ParseException;
+
+public class MoneyUtil {
+
+	/**
+     * 将元为单位的转换为分 替换小数点,支持以逗号区分的金额
+     *
+     * @param amount
+     * @return
+     */
+    public static Integer changeBranch(String amount) {
+        String currency = amount.replaceAll("\\$|\\¥|\\,", ""); // 处理包含, ¥
+        // 或者$的金额
+        int index = currency.indexOf(".");
+        int length = currency.length();
+        Integer amLong;
+        if (index == -1) {
+            amLong = Integer.valueOf(currency + "00");
+        } else if (length - index >= 3) {
+            amLong = Integer.valueOf((currency.substring(0, index + 3)).replace(".", ""));
+        } else if (length - index == 2) {
+            amLong = Integer.valueOf((currency.substring(0, index + 2)).replace(".", "") + 0);
+        } else {
+            amLong = Integer.valueOf((currency.substring(0, index + 1)).replace(".", "") + "00");
+        }
+        return amLong;
+    }
+    
+    public static String fenToYuan(String amount){
+        NumberFormat format = NumberFormat.getInstance();
+        try{
+            Number number = format.parse(amount);
+            double temp = number.doubleValue() / 100.0;
+            format.setGroupingUsed(false);
+            // 设置返回的小数部分所允许的最大位数
+            format.setMaximumFractionDigits(2);
+            amount = format.format(temp);
+        } catch (ParseException e){
+            e.printStackTrace();
+        }
+        return amount;
+    }
+    
+    public static void main(String[] args) {
+        System.out.println("元-分==" + changeBranch("0.01"));
+        System.out.println("元-分==" + changeBranch("100.12"));
+        
+        System.out.println(fenToYuan("100"));
+   }
+}

+ 22 - 0
xjalt/src/cn/com/free/util/RandomUtil.java

@@ -0,0 +1,22 @@
+package cn.com.free.util;
+
+import java.util.Random;
+
+/**
+ * 取得随机数
+ */
+public class RandomUtil {
+
+	public static String getRandomNumber(int strLength) {  
+	      
+	    Random rm = new Random();  
+	    // 获得随机数  
+	    double pross = (1 + rm.nextDouble()) * Math.pow(10, strLength);  
+	  
+	    // 将获得的获得随机数转化为字符串  
+	    String fixLenthString = String.valueOf(pross);  
+	  
+	    // 返回固定的长度的随机数  
+	    return fixLenthString.substring(1, strLength + 1);  
+	}
+}

+ 135 - 0
xjalt/src/cn/com/free/util/SystemStateConstant.java

@@ -0,0 +1,135 @@
+package cn.com.free.util;
+
+import java.math.BigDecimal;
+
+/**
+ * 系统静态常量类
+ * @author 曹悠男
+ *
+ */
+public class SystemStateConstant {
+	
+	/**
+	 * 生成二维码的地址
+	 */
+	public static String WebUrl="localhost:8000";
+	
+	/**
+	 * 不执行该功能而跳转的URL
+	 */
+	public static String LastUrl="LastUrl";
+	
+	/**
+	 * 登录用户所参加的招聘会
+	 */
+	public static String userJobmettingList="UserJobmettingList";
+	
+	/**
+	 * session里面存储的登录用户对象名称
+	 */
+	public static String SessionLoginUser = "LoginUser";
+	
+	/**
+	 * session里面存储的登录联盟的信息
+	 */
+	public static String SessionLoginAlliance = "LoginAlliance";
+	
+	/**
+	 * session里面存储的登录企业的信息
+	 */
+	public static String SessionLoginEnterprise = "LoginEnterprise";
+	
+	/**
+	 * session里面存储的登录企业的店铺信息
+	 */
+	public static String SessionLoginStore = "LoginStore";
+	
+	/**
+	 * session里面存储的专家名称
+	 */
+	public static String SessionLoginExperts = "LoginExperts";
+	
+	/**
+	 * session里面存储的登录用户权限集合的名称
+	 */
+	public static String SessionUserAuths = "UserAuthList";
+	
+	/**
+	 * 基础模块编码
+	 */
+	public static String ModelCode = "BASE";
+	
+	/**
+	 * 每页显示数量
+	 */
+	public static BigDecimal PAGENUM = new BigDecimal("8");
+	
+	/**
+	 * 上传文件保存临时路径
+	 */
+	public static String TEMPFILEPATH = "D:\\ALLIANCE_TEMP";
+	
+	/**
+	 * 上传文件保存根路径
+	 */
+	public static String BASEFILEPATH = "D:\\TOOL\\apache-tomcat-9.0.12\\webapps\\xjalt\\upload";
+	public static String CERTPATH = "D:\\wwwroot\\wxpay\\upload\\cert\\";
+//	public static String BASEFILEPATH = "D:\\wwwroot\\wxpay\\upload";
+	public static String BILLPATH = "D:\\wwwroot\\wxpay\\upload\\bill\\";
+	/**
+	 * 专家维护上传文件保存根路径
+	 */
+	public static String EXPERTS_PATH = "\\EXPERTS_FILE";
+	
+	/**
+	 * 技术需求发布模块上传文件保存根路径
+	 */
+	public static String TECHNIC_ALDEMAND_PATH = "\\TECHNIC_ALDEMAND_FILE";
+	
+	/**
+	 * 产品广告图片模块上传文件保存根路径
+	 */
+	public static String PRODUCT_ADVERTISEMENT_PATH = "\\PRODUCT_ADVERTISEMENT_FILE";
+	
+	/**
+	 * 商铺图片上传文件保存根路径
+	 */
+	public static String STORE_PATH = "\\STORE_FILE";
+	
+	/**
+	 * 产品图片模块上传文件保存根路径
+	 */
+	public static String PRODUCT_PATH = "\\PRODUCT_FILE";
+	
+	/**
+	 * 网上调查图片模块上传文件保存根路径
+	 */
+	public static String ONLINESURVEY_PATH = "\\ONLINESURVEY_FILE";
+	
+	/**
+	 * 供需信息图片模块上传文件保存根路径
+	 */
+	public static String SUPPLYDEMAND_PATH = "\\ONLINESURVEY_FILE";
+	
+	/**
+	 * 新闻图片模块上传文件保存路径
+	 */
+	public static String NEWS_PATH = "/xjalt/upload/file";
+	
+	/**
+	 * 用户头像模块上传文件保存路径
+	 */
+	public static String USER_PATH = "/file";
+	
+	/**
+	 * 用户头像模块上传文件保存路径
+	 */
+//	public static String CONTENTPATH = "http://10.16.11.186";
+	public static String CONTENTPATH = "http://139.210.167.203/xjalt";
+	
+	/**
+	 * 友情链接模块上传文件保存路径
+	 */
+	public static String LINKS_PATH = "\\LINKS_PATH";
+
+}

+ 51 - 0
xjalt/src/cn/com/free/util/UploadFileController.java

@@ -0,0 +1,51 @@
+package cn.com.free.util;
+
+import java.io.File;
+
+import com.jfinal.core.Controller;
+import com.jfinal.upload.UploadFile;
+
+import cn.com.free.FreeBaseTools.tools.DateTimeUtil;
+import cn.com.free.log.Handler.LogHandler;
+import cn.com.free.log.constant.OptModelConstant;
+import cn.com.free.log.constant.OptTypeConstant;
+import cn.com.free.log.enums.OptTypeEnum;
+/**
+ * 处理图片和文件的显示和下载
+ * @author Administrator
+ *
+ */
+public class UploadFileController extends Controller {
+	
+	LogHandler logHandler = new LogHandler();
+	
+	/**
+	 * 获取图片
+	 * @author ly
+	 */
+	public void uploadImage(){
+		// 时间字符串获取
+		String dateStr = DateTimeUtil.getToday2();
+		String datetimeName = DateTimeUtil.getNowTime1();
+		String portraitPath = SystemStateConstant.USER_PATH + "/"+dateStr;
+		String newPath = SystemStateConstant.NEWS_PATH + "/"+dateStr;
+		// 图片文件
+		UploadFile portraitFile1 = getFile("file", portraitPath);
+		
+		if(portraitFile1!=null){
+			// 获得文件扩展名
+			String fileExtensionName = portraitFile1.getFileName().substring(portraitFile1.getFileName().lastIndexOf("."));
+			// 生成新的文件名
+			String newFileName = datetimeName + "01" + fileExtensionName;
+			// 生成新的文件全路径名称
+			String newFileAllName = portraitPath + "/" + newFileName;
+			// 将文件重命名
+			portraitFile1.getFile().renameTo(new File(SystemStateConstant.BASEFILEPATH + newFileAllName));
+			setAttr("msg",newPath + "/" + newFileName);
+	        renderJson();
+		}else{
+			// 记录日志
+			logHandler.seaveLog(OptTypeEnum.SYSOPT, OptModelConstant.MODEL_IMAGEFILE, OptTypeConstant.OPTCODE_VIEW, "没有图片信息", 2, -1, -1);
+		}
+	}
+}

+ 18 - 0
xjalt/src/cn/com/free/util/UserModel.java

@@ -0,0 +1,18 @@
+package cn.com.free.util;
+
+import com.jfinal.plugin.activerecord.Model;
+
+/**
+ * 用户信息Model
+ */
+public class UserModel extends Model<UserModel> {
+	/**
+	 * 用户信息Model
+	 */
+	private static final long serialVersionUID = 6823963255791893851L;
+
+	/**
+	 * 用户信息Model
+	 */
+	public static final UserModel dao = new UserModel();
+}

+ 736 - 0
xjalt/src/cn/com/free/util/WechatUtil.java

@@ -0,0 +1,736 @@
+package cn.com.free.util;
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.nio.charset.Charset;
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.CertificateException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.Set;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.logging.FileHandler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
+import org.apache.http.conn.ssl.DefaultHostnameVerifier;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.conn.BasicHttpClientConnectionManager;
+import org.apache.http.util.EntityUtils;
+import org.jdom.Document;
+import org.jdom.Element;
+import org.jdom.JDOMException;
+import org.jdom.input.SAXBuilder;
+
+public class WechatUtil {
+
+	// 公众号支付APPID
+	public static final String APPID = "wx2556b4c38a1d0726";
+	// 公众号支付AppSecret
+	public static final String APP_SECRET = "40d9ae3553c7aa3c8d9610d405f60df8";
+	// 公众号支付商户号
+	public static final String MCH_ID = "1514694421";
+	// 商户后台配置的一个32位的key,位置:微信商户平台-账户中心-API安全
+	public static final String KEY = "EDrtyh544FT6tfdrh765F09okYM87Cs2";
+	
+	// 证书地址
+	public static String certLocalPath = SystemStateConstant.CERTPATH+"apiclient_cert_1514694421.p12";
+
+	private static final String hexDigits[] = { "0", "1", "2", "3", "4", "5",
+				"6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
+	
+	/**
+	 * 刷卡支付查询
+	 * 
+	 * @param body
+	 *            商品或支付单简要描述
+	 * @param out_trade_no
+	 *            商户系统内部的订单号,32个字符内、可包含字母
+	 * @param total_fee
+	 *            订单总金额,单位为分
+	 * @param IP
+	 *            APP和网页支付提交用户端ip
+	 * @param notify_url
+	 *            接收微信支付异步通知回调地址
+	 * @param openid
+	 *            用户openId
+	 * @throws IOException
+	 */
+	public static String micropayQuery(String outTradeNo) {
+		final Logger logger = Logger.getLogger("org.jediael.crawl.MyCrawler");  
+		logger.setLevel(Level.INFO);      
+		logger.setUseParentHandlers(false);
+		try {
+			FileHandler fileHandler = new FileHandler("E:\\log\\infoquery.log");
+			fileHandler.setLevel(Level.INFO);
+			logger.addHandler(fileHandler);
+		} catch (SecurityException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		logger.info("micropayQuery查询开始订单号为="+outTradeNo);
+		HttpPost httppost = new HttpPost(
+				"https://api.mch.weixin.qq.com/pay/orderquery");
+		String nonce_str = getNonceStr();// 随机数据
+		SortedMap<Object, Object> parameters = new TreeMap<Object, Object>();
+		/**
+		 * 组装请求参数 按照ASCII排序
+		 */
+		parameters.put("appid", APPID);
+		parameters.put("mch_id", MCH_ID);
+		// parameters.put("sub_mch_id", MCH_ID);
+		parameters.put("nonce_str", nonce_str);
+		parameters.put("out_trade_no", outTradeNo);
+
+		String sign = createSign(parameters, KEY);
+
+		/**
+		 * 组装XML
+		 */
+		StringBuilder sb = new StringBuilder("");
+		sb.append("<xml>");
+		setXmlKV(sb, "appid", APPID);
+		setXmlKV(sb, "mch_id", MCH_ID);
+		// setXmlKV(sb,"sub_mch_id", MCH_ID);
+		setXmlKV(sb, "nonce_str", nonce_str);
+		setXmlKV(sb, "out_trade_no", outTradeNo);
+		setXmlKV(sb, "sign", sign);
+
+		sb.append("</xml>");
+		// 将xml型字符转换
+		String returnVal = "0";
+		try {
+			StringEntity reqEntity = new StringEntity(new String(sb.toString()
+						.getBytes("UTF-8"), "ISO8859-1"));
+			// 这个处理是为了防止传中文的时候出现签名错误
+			httppost.setEntity(reqEntity);
+			DefaultHttpClient httpclient = new DefaultHttpClient();
+			HttpResponse response = httpclient.execute(httppost);
+			String strResult = EntityUtils.toString(response.getEntity(),
+					Charset.forName("utf-8"));
+		
+			Map mapResSel = doXMLParse(strResult);
+			String return_code_sel = (String) mapResSel.get("return_code");
+			logger.info("micropayQuery查询订单结果为="+return_code_sel);
+			if ("SUCCESS".equals(return_code_sel)) {
+				returnVal = "1";
+			} else {
+				returnVal = "0";
+			}
+			logger.info("micropayQuery查询结束returnVal="+returnVal);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			returnVal = "0";
+			logger.info("micropayQuery查询异常结束="+e.getMessage());
+			e.printStackTrace();
+		}
+		return returnVal;
+	}
+
+	/**
+	 * 刷卡支付
+	 * 
+	 * @param body
+	 *            商品或支付单简要描述
+	 * @param out_trade_no
+	 *            商户系统内部的订单号,32个字符内、可包含字母
+	 * @param total_fee
+	 *            订单总金额,单位为分
+	 * @param IP
+	 *            APP和网页支付提交用户端ip
+	 * @param notify_url
+	 *            接收微信支付异步通知回调地址
+	 * @param openid
+	 *            用户openId
+	 * @throws IOException
+	 */
+	public static String micropay(String body, String out_trade_no,
+			Integer total_fee, String ip, String deviceInfo, String attach,
+			String auth_code) throws IOException {
+		/**
+		 * 设置访问路径
+		 */
+		HttpPost httppost = new HttpPost(
+				"https://api.mch.weixin.qq.com/pay/micropay");
+		String nonce_str = getNonceStr();// 随机数据
+		SortedMap<Object, Object> parameters = new TreeMap<Object, Object>();
+		/**
+		 * 组装请求参数 按照ASCII排序
+		 */
+		parameters.put("appid", APPID);
+		parameters.put("body", body);
+		parameters.put("mch_id", MCH_ID);
+		// parameters.put("sub_mch_id", MCH_ID);
+		parameters.put("device_info", deviceInfo);
+		parameters.put("nonce_str", nonce_str);
+		parameters.put("out_trade_no", out_trade_no);
+		parameters.put("spbill_create_ip", ip);
+		parameters.put("total_fee", total_fee.toString());
+		parameters.put("auth_code", auth_code);
+		parameters.put("attach", attach);
+
+		String sign = createSign(parameters, KEY);
+
+		/**
+		 * 组装XML
+		 */
+		StringBuilder sb = new StringBuilder("");
+		sb.append("<xml>");
+		setXmlKV(sb, "appid", APPID);
+		setXmlKV(sb, "body", body);
+		setXmlKV(sb, "mch_id", MCH_ID);
+		// setXmlKV(sb,"sub_mch_id", MCH_ID);
+		setXmlKV(sb, "device_info", deviceInfo);
+		setXmlKV(sb, "nonce_str", nonce_str);
+		setXmlKV(sb, "out_trade_no", out_trade_no);
+		setXmlKV(sb, "spbill_create_ip", ip);
+		setXmlKV(sb, "total_fee", total_fee.toString());
+		setXmlKV(sb, "auth_code", auth_code);
+		setXmlKV(sb, "sign", sign);
+		setXmlKV(sb, "attach", attach);
+
+		sb.append("</xml>");
+
+		StringEntity reqEntity = new StringEntity(new String(sb.toString()
+				.getBytes("UTF-8"), "ISO8859-1"));// 这个处理是为了防止传中文的时候出现签名错误
+		httppost.setEntity(reqEntity);
+		DefaultHttpClient httpclient = new DefaultHttpClient();
+		HttpResponse response = httpclient.execute(httppost);
+		String strResult = EntityUtils.toString(response.getEntity(),
+				Charset.forName("utf-8"));
+		return strResult;
+
+	}
+
+	/**
+	 * 刷卡支付查询
+	 * 
+	 * @param body
+	 *            商品或支付单简要描述
+	 * @param out_trade_no
+	 *            商户系统内部的订单号,32个字符内、可包含字母
+	 * @param total_fee
+	 *            订单总金额,单位为分
+	 * @param IP
+	 *            APP和网页支付提交用户端ip
+	 * @param notify_url
+	 *            接收微信支付异步通知回调地址
+	 * @param openid
+	 *            用户openId
+	 * @throws IOException
+	 */
+	public static String orderquery(String out_trade_no) throws IOException {
+		/**
+		 * 设置访问路径
+		 */
+		HttpPost httppost = new HttpPost(
+				"https://api.mch.weixin.qq.com/pay/orderquery");
+		String nonce_str = getNonceStr();// 随机数据
+		SortedMap<Object, Object> parameters = new TreeMap<Object, Object>();
+		/**
+		 * 组装请求参数 按照ASCII排序
+		 */
+		parameters.put("appid", APPID);
+		parameters.put("mch_id", MCH_ID);
+		// parameters.put("sub_mch_id", MCH_ID);
+		parameters.put("nonce_str", nonce_str);
+		parameters.put("out_trade_no", out_trade_no);
+
+		String sign = createSign(parameters, KEY);
+
+		/**
+		 * 组装XML
+		 */
+		StringBuilder sb = new StringBuilder("");
+		sb.append("<xml>");
+		setXmlKV(sb, "appid", APPID);
+		setXmlKV(sb, "mch_id", MCH_ID);
+		// setXmlKV(sb,"sub_mch_id", MCH_ID);
+		setXmlKV(sb, "nonce_str", nonce_str);
+		setXmlKV(sb, "out_trade_no", out_trade_no);
+		setXmlKV(sb, "sign", sign);
+
+		sb.append("</xml>");
+
+		StringEntity reqEntity = new StringEntity(new String(sb.toString()
+				.getBytes("UTF-8"), "ISO8859-1"));// 这个处理是为了防止传中文的时候出现签名错误
+		httppost.setEntity(reqEntity);
+		DefaultHttpClient httpclient = new DefaultHttpClient();
+		HttpResponse response = httpclient.execute(httppost);
+		String strResult = EntityUtils.toString(response.getEntity(),
+				Charset.forName("utf-8"));
+		return strResult;
+
+	}
+
+	/**
+	 * 撤销订单
+	 * 
+	 * @param body
+	 *            商品或支付单简要描述
+	 * @param out_trade_no
+	 *            商户系统内部的订单号,32个字符内、可包含字母
+	 * @param total_fee
+	 *            订单总金额,单位为分
+	 * @param IP
+	 *            APP和网页支付提交用户端ip
+	 * @param notify_url
+	 *            接收微信支付异步通知回调地址
+	 * @param openid
+	 *            用户openId
+	 * @throws IOException
+	 */
+	public static String reverse(String out_trade_no) {
+		final Logger logger = Logger.getLogger("org.jediael.crawl.MyCrawler");  
+		logger.setLevel(Level.INFO);      
+		logger.setUseParentHandlers(false);
+		try {
+			FileHandler fileHandler = new FileHandler("E:\\log\\info.log");
+			fileHandler.setLevel(Level.INFO);
+			logger.addHandler(fileHandler);
+		} catch (SecurityException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		String resultVal = "0";
+		logger.info("撤销订单开始订单号="+out_trade_no);
+		try {
+			String path = certLocalPath;
+			char[] password = MCH_ID.toCharArray();
+	        InputStream certStream = new FileInputStream(new File(path));;
+	        KeyStore ks = KeyStore.getInstance("PKCS12");
+	        ks.load(certStream, password);
+	        logger.info("加载秘钥文件");
+	        // 实例化密钥库 & 初始化密钥工厂
+	        KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
+	        kmf.init(ks, password);
+	
+	        // 创建 SSLContext
+	        SSLContext sslContext = SSLContext.getInstance("TLS");
+	        sslContext.init(kmf.getKeyManagers(), null, new SecureRandom());
+	
+	        SSLConnectionSocketFactory sslConnectionSocketFactory = new SSLConnectionSocketFactory(
+	                sslContext,
+	                new String[]{"TLSv1"},
+	                null,
+	                new DefaultHostnameVerifier());
+	
+	        BasicHttpClientConnectionManager connManager = new BasicHttpClientConnectionManager(
+	                RegistryBuilder.<ConnectionSocketFactory>create()
+	                        .register("http", PlainConnectionSocketFactory.getSocketFactory())
+	                        .register("https", sslConnectionSocketFactory)
+	                        .build(),
+	                null,
+	                null,
+	                null
+	        );
+	        
+	        CloseableHttpClient httpclient = HttpClientBuilder.create()
+	                .setConnectionManager(connManager)
+	                .build();
+	        logger.info("加载秘钥文件成功");
+	        /**
+			 * 设置访问路径
+			 */
+			HttpPost httppost = new HttpPost(
+					"https://api.mch.weixin.qq.com/secapi/pay/reverse");
+			String nonce_str = getNonceStr();// 随机数据
+			SortedMap<Object, Object> parameters = new TreeMap<Object, Object>();
+			/**
+			 * 组装请求参数 按照ASCII排序
+			 */
+			parameters.put("appid", APPID);
+			parameters.put("mch_id", MCH_ID);
+			// parameters.put("sub_mch_id", MCH_ID);
+			parameters.put("nonce_str", nonce_str);
+			parameters.put("out_trade_no", out_trade_no);
+	
+			String sign = createSign(parameters, KEY);
+	
+			/**
+			 * 组装XML
+			 */
+			StringBuilder sb = new StringBuilder("");
+			sb.append("<xml>");
+			setXmlKV(sb, "appid", APPID);
+			setXmlKV(sb, "mch_id", MCH_ID);
+			// setXmlKV(sb,"sub_mch_id", MCH_ID);
+			setXmlKV(sb, "nonce_str", nonce_str);
+			setXmlKV(sb, "out_trade_no", out_trade_no);
+			setXmlKV(sb, "sign", sign);
+	
+			sb.append("</xml>");
+	
+			StringEntity reqEntity = new StringEntity(new String(sb.toString()
+					.getBytes("UTF-8"), "ISO8859-1"));// 这个处理是为了防止传中文的时候出现签名错误
+			httppost.setEntity(reqEntity);
+	//		DefaultHttpClient httpclient = new DefaultHttpClient();
+			HttpResponse response = httpclient.execute(httppost);
+			String strResult = EntityUtils.toString(response.getEntity(),
+					Charset.forName("utf-8"));
+			logger.info("撤销订单执行结束结果为strResult"+strResult);
+			// 将xml型字符转换
+			Map mapRes = doXMLParse(strResult);
+			String return_code = (String) mapRes.get("return_code");
+			logger.info("撤销订单执行return_code="+return_code);
+			if ("SUCCESS".equals(return_code)) {
+				String result_code = (String) mapRes.get("result_code");
+				logger.info("撤销订单执行result_code="+result_code);
+				if ("SUCCESS".equals(result_code)) {
+					resultVal = "1";
+				}
+			}
+		} catch (Exception e) {
+			// TODO: handle exception
+			logger.info("撤销订单执行异常="+e.getMessage());
+			resultVal = "0";
+		}
+		return resultVal;
+	}
+	
+	/**
+	 * 微信退费
+	 * 
+	 * @param out_trade_no
+	 *            商户订单号
+	 * @param out_refund_no
+	 *            商户退款单号
+	 * @param total_fee
+	 *            订单总金额,单位为分
+	 * @param refund_fee
+	 *            退款金额
+	 * @param refund_desc
+	 *            退款原因
+	 * @throws IOException
+     * @throws NoSuchAlgorithmException 
+     * @throws KeyStoreException 
+     * @throws KeyManagementException 
+     * @throws UnrecoverableKeyException 
+     * @throws CertificateException 
+	 */
+	public static String refund(String out_trade_no, String out_refund_no,
+			String total_fee, String refund_fee, String refund_desc)
+			throws IOException, UnrecoverableKeyException, KeyManagementException, KeyStoreException, NoSuchAlgorithmException, CertificateException {
+		
+		String path = certLocalPath;
+		char[] password = MCH_ID.toCharArray();
+        InputStream certStream = new FileInputStream(new File(path));;
+        KeyStore ks = KeyStore.getInstance("PKCS12");
+        ks.load(certStream, password);
+
+        // 实例化密钥库 & 初始化密钥工厂
+        KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
+        kmf.init(ks, password);
+
+        // 创建 SSLContext
+        SSLContext sslContext = SSLContext.getInstance("TLS");
+        sslContext.init(kmf.getKeyManagers(), null, new SecureRandom());
+
+        SSLConnectionSocketFactory sslConnectionSocketFactory = new SSLConnectionSocketFactory(
+                sslContext,
+                new String[]{"TLSv1"},
+                null,
+                new DefaultHostnameVerifier());
+
+        BasicHttpClientConnectionManager connManager = new BasicHttpClientConnectionManager(
+                RegistryBuilder.<ConnectionSocketFactory>create()
+                        .register("http", PlainConnectionSocketFactory.getSocketFactory())
+                        .register("https", sslConnectionSocketFactory)
+                        .build(),
+                null,
+                null,
+                null
+        );
+        
+        CloseableHttpClient httpclient = HttpClientBuilder.create()
+                .setConnectionManager(connManager)
+                .build();
+		
+		/**
+		 * 设置访问路径
+		 */
+		HttpPost httppost = new HttpPost(
+				"https://api.mch.weixin.qq.com/secapi/pay/refund");
+		String nonce_str = getNonceStr();// 随机数据
+		SortedMap<Object, Object> parameters = new TreeMap<Object, Object>();
+		/**
+		 * 组装请求参数 按照ASCII排序
+		 */
+		parameters.put("appid", APPID);
+		parameters.put("mch_id", MCH_ID);
+		parameters.put("nonce_str", nonce_str);
+		parameters.put("out_trade_no", out_trade_no);
+		parameters.put("out_refund_no", out_refund_no);
+		parameters.put("total_fee", total_fee);
+		parameters.put("refund_fee", refund_fee);
+		parameters.put("refund_desc", refund_desc);
+
+		String sign = createSign(parameters, KEY);
+
+		/**
+		 * 组装XML
+		 */
+		StringBuilder sb = new StringBuilder("");
+		sb.append("<xml>");
+		setXmlKV(sb, "appid", APPID);
+		setXmlKV(sb, "mch_id", MCH_ID);
+		setXmlKV(sb, "nonce_str", nonce_str);
+		setXmlKV(sb, "out_trade_no", out_trade_no);
+		setXmlKV(sb, "out_refund_no", out_refund_no);
+		setXmlKV(sb, "total_fee", total_fee);
+		setXmlKV(sb, "refund_fee", refund_fee);
+		setXmlKV(sb, "refund_desc", refund_desc);
+		setXmlKV(sb, "sign", sign);
+		sb.append("</xml>");
+
+		StringEntity reqEntity = new StringEntity(new String(sb.toString()
+				.getBytes("UTF-8"), "ISO8859-1"));// 这个处理是为了防止传中文的时候出现签名错误
+		httppost.setEntity(reqEntity);
+//		DefaultHttpClient httpclient = new DefaultHttpClient();
+		HttpResponse response = httpclient.execute(httppost);
+		String strResult = EntityUtils.toString(response.getEntity(),
+				Charset.forName("utf-8"));
+		return strResult;
+
+	}
+
+	// 获得随机字符串
+	private static String getNonceStr() {
+		Random random = new Random();
+		return MD5Encode(String.valueOf(random.nextInt(10000)), "UTF-8");
+	}
+
+	// 插入XML标签
+	private static StringBuilder setXmlKV(StringBuilder sb, String Key, String value) {
+		sb.append("<");
+		sb.append(Key);
+		sb.append(">");
+
+		sb.append(value);
+
+		sb.append("</");
+		sb.append(Key);
+		sb.append(">");
+
+		return sb;
+	}
+
+	/**
+	 * 解析xml,返回第一级元素键值对。如果第一级元素有子节点,则此节点的值是子节点的xml数据。
+	 * 
+	 * @param strxml
+	 * @return
+	 * @throws JDOMException
+	 * @throws IOException
+	 */
+	public static Map doXMLParse(String strxml) throws Exception {
+		if (null == strxml || "".equals(strxml)) {
+			return null;
+		}
+		Map m = new HashMap();
+		InputStream in = String2Inputstream(strxml);
+		BufferedReader br = new BufferedReader(new InputStreamReader(in, "UTF-8"));
+		SAXBuilder builder = new SAXBuilder();
+		Document doc = builder.build(br);
+		Element root = doc.getRootElement();
+		List list = root.getChildren();
+		Iterator it = list.iterator();
+		while (it.hasNext()) {
+			Element e = (Element) it.next();
+			String k = e.getName();
+			String v = "";
+			List children = e.getChildren();
+			if (children.isEmpty()) {
+				v = e.getTextNormalize();
+			} else {
+				v = getChildrenText(children);
+			}
+			m.put(k, v);
+		}
+		// 关闭流
+		in.close();
+		return m;
+	}
+	
+	/**
+	 * 刷卡支付查询
+	 * 
+	 * @param body
+	 *            商品或支付单简要描述
+	 * @param out_trade_no
+	 *            商户系统内部的订单号,32个字符内、可包含字母
+	 * @param total_fee
+	 *            订单总金额,单位为分
+	 * @param IP
+	 *            APP和网页支付提交用户端ip
+	 * @param notify_url
+	 *            接收微信支付异步通知回调地址
+	 * @param openid
+	 *            用户openId
+	 * @throws IOException
+	 */
+	public static String downloadbill(String bill_date)
+			throws IOException {
+		/**
+		 * 设置访问路径
+		 */
+		HttpPost httppost = new HttpPost(
+				"https://api.mch.weixin.qq.com/pay/downloadbill");
+		String nonce_str = getNonceStr();// 随机数据
+		SortedMap<Object, Object> parameters = new TreeMap<Object, Object>();
+		/**
+		 * 组装请求参数 按照ASCII排序
+		 */
+		parameters.put("appid", APPID);
+		parameters.put("mch_id", MCH_ID);
+		//parameters.put("sub_mch_id", MCH_ID);
+		parameters.put("nonce_str", nonce_str);
+		parameters.put("bill_date", bill_date);
+		parameters.put("bill_type", "ALL");
+
+		String sign = createSign(parameters, KEY);
+
+		/**
+		 * 组装XML
+		 */
+		StringBuilder sb = new StringBuilder("");
+		sb.append("<xml>");
+		setXmlKV(sb, "appid", APPID);
+		setXmlKV(sb, "mch_id", MCH_ID);
+		//setXmlKV(sb,"sub_mch_id", MCH_ID);
+		setXmlKV(sb, "nonce_str", nonce_str);
+		setXmlKV(sb, "bill_date", bill_date);
+		setXmlKV(sb, "bill_type", "ALL");
+		setXmlKV(sb, "sign", sign);
+		
+		sb.append("</xml>");
+
+		StringEntity reqEntity = new StringEntity(new String(sb.toString()
+				.getBytes("UTF-8"), "ISO8859-1"));// 这个处理是为了防止传中文的时候出现签名错误
+		httppost.setEntity(reqEntity);
+		DefaultHttpClient httpclient = new DefaultHttpClient();
+		HttpResponse response = httpclient.execute(httppost);
+		String strResult = EntityUtils.toString(response.getEntity(),
+				Charset.forName("utf-8"));
+		return strResult;
+
+	}
+	
+	private static InputStream String2Inputstream(String str) {
+		return new ByteArrayInputStream(str.getBytes());
+	}
+
+	/**
+	 * 获取子结点的xml
+	 * 
+	 * @param children
+	 * @return String
+	 */
+	private static String getChildrenText(List children) {
+		StringBuffer sb = new StringBuffer();
+		if (!children.isEmpty()) {
+			Iterator it = children.iterator();
+			while (it.hasNext()) {
+				Element e = (Element) it.next();
+				String name = e.getName();
+				String value = e.getTextNormalize();
+				List list = e.getChildren();
+				sb.append("<" + name + ">");
+				if (!list.isEmpty()) {
+					sb.append(getChildrenText(list));
+				}
+				sb.append(value);
+				sb.append("</" + name + ">");
+			}
+		}
+		return sb.toString();
+	}
+
+	/**
+	 *   * 创建签名   * @param parameters   * @param key   * @return   
+	 */
+	@SuppressWarnings("rawtypes")
+	private static String createSign(SortedMap<Object, Object> parameters, String key) {
+		StringBuffer sb = new StringBuffer();
+		Set es = parameters.entrySet();// 所有参与传参的参数按照accsii排序(升序)
+		Iterator it = es.iterator();
+		while (it.hasNext()) {
+			Map.Entry entry = (Map.Entry) it.next();
+			String k = (String) entry.getKey();
+			Object v = entry.getValue();
+			if (null != v && !"".equals(v) && !"sign".equals(k)
+					&& !"key".equals(k)) {
+				sb.append(k + "=" + v + "&");
+			}
+		}
+		sb.append("key=" + key);
+		String sign = MD5Encode(sb.toString(), "UTF-8").toUpperCase();
+		return sign;
+	}
+
+	private static String MD5Encode(String origin, String charsetname) {
+		String resultString = null;
+		try {
+			resultString = new String(origin);
+			MessageDigest md = MessageDigest.getInstance("MD5");
+			if (charsetname == null || "".equals(charsetname))
+				resultString = byteArrayToHexString(md.digest(resultString
+						.getBytes()));
+			else
+				resultString = byteArrayToHexString(md.digest(resultString
+						.getBytes(charsetname)));
+		} catch (Exception exception) {
+
+		}
+		return resultString;
+	}
+
+	private static String byteArrayToHexString(byte b[]) {
+		StringBuffer resultSb = new StringBuffer();
+		for (int i = 0; i < b.length; i++)
+			resultSb.append(byteToHexString(b[i]));
+
+		return resultSb.toString();
+	}
+
+	private static String byteToHexString(byte b) {
+		int n = b;
+		if (n < 0)
+			n += 256;
+		int d1 = n / 16;
+		int d2 = n % 16;
+		return hexDigits[d1] + hexDigits[d2];
+	}
+}

+ 115 - 0
xjalt/src/cn/com/free/util/ZXingCodeUtil.java

@@ -0,0 +1,115 @@
+package cn.com.free.util;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+import javax.imageio.ImageIO;
+import com.google.zxing.BarcodeFormat;
+import com.google.zxing.EncodeHintType;
+import com.google.zxing.MultiFormatWriter;
+import com.google.zxing.WriterException;
+import com.google.zxing.common.BitMatrix;
+import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
+
+public class ZXingCodeUtil {
+
+	private static final int QRCOLOR = 0xFF000000; // 默认是黑色
+    private static final int BGWHITE = 0xFFFFFFFF; // 背景颜色
+
+    private static final int WIDTH = 400; // 二维码宽
+    private static final int HEIGHT = 400; // 二维码高
+
+    // 用于设置QR二维码参数
+    private static Map<EncodeHintType, Object> hints = new HashMap<EncodeHintType, Object>() {
+        private static final long serialVersionUID = 1L;
+        {
+            put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);// 设置QR二维码的纠错级别(H为最高级别)具体级别信息
+            put(EncodeHintType.CHARACTER_SET, "utf-8");// 设置编码方式
+            put(EncodeHintType.MARGIN, 0);
+        }
+    };
+    
+    // 生成带logo的二维码图片
+    public static void drawLogoQRCode(File logoFile, File codeFile, String qrUrl, String note) {
+        try {
+            MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
+            // 参数顺序分别为:编码内容,编码类型,生成图片宽度,生成图片高度,设置参数
+            BitMatrix bm = multiFormatWriter.encode(qrUrl, BarcodeFormat.QR_CODE, WIDTH, HEIGHT, hints);
+            BufferedImage image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB);
+
+            // 开始利用二维码数据创建Bitmap图片,分别设为黑(0xFFFFFFFF)白(0xFF000000)两色
+            for (int x = 0; x < WIDTH; x++) {
+                for (int y = 0; y < HEIGHT; y++) {
+                    image.setRGB(x, y, bm.get(x, y) ? QRCOLOR : BGWHITE);
+                }
+            }
+
+            int width = image.getWidth();
+            int height = image.getHeight();
+            if (logoFile != null && logoFile.exists()) {
+                // 构建绘图对象
+                Graphics2D g = image.createGraphics();
+                // 读取Logo图片
+                BufferedImage logo = ImageIO.read(logoFile);
+                // 开始绘制logo图片
+                g.drawImage(logo, width * 2 / 5, height * 2 / 5, width * 2 / 10, height * 2 / 10, null);
+                g.dispose();
+                logo.flush();
+            }
+
+            // 自定义文本描述
+            if (note != null && !"".equals(note)) {
+                // 新的图片,把带logo的二维码下面加上文字
+                BufferedImage outImage = new BufferedImage(400, 445, BufferedImage.TYPE_4BYTE_ABGR);
+                Graphics2D outg = outImage.createGraphics();
+                // 画二维码到新的面板
+                outg.drawImage(image, 0, 0, image.getWidth(), image.getHeight(), null);
+                // 画文字到新的面板
+                outg.setColor(Color.BLACK);
+                outg.setFont(new Font("楷体", Font.BOLD, 30)); // 字体、字型、字号
+                int strWidth = outg.getFontMetrics().stringWidth(note);
+                if (strWidth > 399) {
+                    // //长度过长就截取前面部分
+                    // 长度过长就换行
+                    String note1 = note.substring(0, note.length() / 2);
+                    String note2 = note.substring(note.length() / 2, note.length());
+                    int strWidth1 = outg.getFontMetrics().stringWidth(note1);
+                    int strWidth2 = outg.getFontMetrics().stringWidth(note2);
+                    outg.drawString(note1, 200 - strWidth1 / 2, height + (outImage.getHeight() - height) / 2 + 12);
+                    BufferedImage outImage2 = new BufferedImage(400, 485, BufferedImage.TYPE_4BYTE_ABGR);
+                    Graphics2D outg2 = outImage2.createGraphics();
+                    outg2.drawImage(outImage, 0, 0, outImage.getWidth(), outImage.getHeight(), null);
+                    outg2.setColor(Color.BLACK);
+                    outg2.setFont(new Font("宋体", Font.BOLD, 30)); // 字体、字型、字号
+                    outg2.drawString(note2, 200 - strWidth2 / 2,outImage.getHeight() + (outImage2.getHeight() - outImage.getHeight()) / 2 + 5);
+                    outg2.dispose();
+                    outImage2.flush();
+                    outImage = outImage2;
+                } else {
+                    outg.drawString(note, 200 - strWidth / 2, height + (outImage.getHeight() - height) / 2 + 12); // 画文字
+                }
+                outg.dispose();
+                outImage.flush();
+                image = outImage;
+            }
+
+            image.flush();
+
+            ImageIO.write(image, "png", codeFile); // TODO
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+    
+    public static void main(String[] args) throws WriterException {
+        File logoFile = new File("E://card/1.jpg");
+        File QrCodeFile = new File("E://card/05.png");
+        String url = "748354";
+        String note = "访问百度连接";
+        drawLogoQRCode(logoFile, QrCodeFile, url, note);
+    }
+}

+ 39 - 0
xjalt/src/jdbc.properties

@@ -0,0 +1,39 @@
+#SQL Server
+
+#jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
+
+#jdbc.url=jdbc:sqlserver://127.0.0.1:1433;databaseName=free_alliance_management
+#jdbc.username=sa
+#jdbc.password=111111
+
+#jdbc.url=jdbc:sqlserver://223.4.245.79:9588;databaseName=free_alliance_management
+#jdbc.username=frjg2014
+#jdbc.password=frjg2014888
+
+
+#MySql
+
+jdbc.driverClassName=com.mysql.jdbc.Driver
+devMode=true
+
+#jdbc.url=jdbc:mysql://127.0.0.1:3306/free-technological-management?characterEncoding=UTF8
+#jdbc.username=root
+#jdbc.password=knightdemon
+
+#jdbc.url=jdbc:mysql://139.210.167.203:3306/free-technological-management?characterEncoding=UTF8
+#jdbc.username=root
+#jdbc.password=knightdemon
+
+#knight-pc
+#jdbc.url=jdbc:mysql://knight-pc:6603/free-technological-management?characterEncoding=UTF8
+#jdbc.url=jdbc:mysql://192.186.1.33:6603/free_alliance_management?characterEncoding=UTF8
+#jdbc.username=free
+#jdbc.password=knight
+
+pc.url=http://www.xjkjt.gov.cn/xxgk/zcfg/index.html,http://www.xjkjt.gov.cn/xwzx/kjtgz/index.html
+
+Tencent
+jdbc.url=jdbc:mysql://localhost:3306/xjalt?characterEncoding=UTF8
+jdbc.username=root
+jdbc.password=cq123
+title.name=\u65B0\u7586\u963F\u52D2\u6CF0\u79D1\u6280\u5E73\u53F0

+ 1 - 0
xjalt/src/url.properties

@@ -0,0 +1 @@
+pc.url=http://www.xjkjt.gov.cn/xxgk/zcfg/index.html,http://www.xjkjt.gov.cn/xwzx/kjtgz/index.html