Browse Source

Merge remote-tracking branch 'origin/master'

Joburgess 4 years ago
parent
commit
f89ed1b7a6

+ 9 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/TenantApplyDao.java

@@ -0,0 +1,9 @@
+package com.keao.edu.user.dao;
+
+import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.user.entity.TenantApply;
+
+public interface TenantApplyDao extends BaseDAO<Long, TenantApply> {
+
+	
+}

+ 103 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/entity/TenantApply.java

@@ -0,0 +1,103 @@
+package com.keao.edu.user.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(tenant_apply):
+ */
+public class TenantApply {
+
+	/**  */
+	private Long id;
+	
+	/** 机构名称 */
+	private String name;
+	
+	/** 城市 */
+	private String city;
+	
+	/** 联系人 */
+	private String linkman;
+	
+	/** 手机号码 */
+	private String mobileNo;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/** 回访时间 */
+	private java.util.Date callBackTime;
+	
+	/** 回访记录 */
+	private String callBackLog;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setName(String name){
+		this.name = name;
+	}
+	
+	public String getName(){
+		return this.name;
+	}
+			
+	public void setCity(String city){
+		this.city = city;
+	}
+	
+	public String getCity(){
+		return this.city;
+	}
+			
+	public void setLinkman(String linkman){
+		this.linkman = linkman;
+	}
+	
+	public String getLinkman(){
+		return this.linkman;
+	}
+			
+	public void setMobileNo(String mobileNo){
+		this.mobileNo = mobileNo;
+	}
+	
+	public String getMobileNo(){
+		return this.mobileNo;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setCallBackTime(java.util.Date callBackTime){
+		this.callBackTime = callBackTime;
+	}
+	
+	public java.util.Date getCallBackTime(){
+		return this.callBackTime;
+	}
+			
+	public void setCallBackLog(String callBackLog){
+		this.callBackLog = callBackLog;
+	}
+	
+	public String getCallBackLog(){
+		return this.callBackLog;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 8 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/TenantApplyService.java

@@ -0,0 +1,8 @@
+package com.keao.edu.user.service;
+
+import com.keao.edu.common.service.BaseService;
+import com.keao.edu.user.entity.TenantApply;
+
+public interface TenantApplyService extends BaseService<Long, TenantApply> {
+
+}

+ 23 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/TenantApplyServiceImpl.java

@@ -0,0 +1,23 @@
+package com.keao.edu.user.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.common.service.impl.BaseServiceImpl;
+import com.keao.edu.user.dao.TenantApplyDao;
+import com.keao.edu.user.entity.TenantApply;
+import com.keao.edu.user.service.TenantApplyService;
+
+@Service
+public class TenantApplyServiceImpl extends BaseServiceImpl<Long, TenantApply>  implements TenantApplyService {
+	
+	@Autowired
+	private TenantApplyDao tenantApplyDao;
+
+	@Override
+	public BaseDAO<Long, TenantApply> getDAO() {
+		return tenantApplyDao;
+	}
+	
+}

+ 87 - 0
edu-user/edu-user-biz/src/main/resources/config/mybatis/TenantApplyMapper.xml

@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
+<mapper namespace="com.keao.edu.user.dao.TenantApplyDao">
+
+	<resultMap type="com.keao.edu.user.entity.TenantApply" id="TenantApply">
+		<result column="id_" property="id" />
+		<result column="name_" property="name" />
+		<result column="city_" property="city" />
+		<result column="linkman_" property="linkman" />
+		<result column="mobile_no_" property="mobileNo" />
+		<result column="create_time_" property="createTime" />
+		<result column="call_back_time_" property="callBackTime" />
+		<result column="call_back_log_" property="callBackLog" />
+	</resultMap>
+
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="TenantApply">
+		SELECT * FROM
+		tenant_apply WHERE id_ = #{id}
+	</select>
+
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="TenantApply">
+		SELECT * FROM tenant_apply ORDER
+		BY id_
+	</select>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.keao.edu.user.entity.TenantApply"
+		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
+			AS ID FROM DUAL </selectKey> -->
+		INSERT INTO tenant_apply
+		(id_,name_,city_,linkman_,mobile_no_,create_time_,call_back_time_,call_back_log_)
+		VALUES(#{id},#{name},#{city},#{linkman},#{mobileNo},#{createTime},#{callBackTime},#{callBackLog})
+	</insert>
+
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.keao.edu.user.entity.TenantApply">
+		UPDATE tenant_apply
+		<set>
+			<if test="city != null">
+				city_ = #{city},
+			</if>
+			<if test="id != null">
+				id_ = #{id},
+			</if>
+			<if test="linkman != null">
+				linkman_ = #{linkman},
+			</if>
+			<if test="callBackLog != null">
+				call_back_log_ = #{callBackLog},
+			</if>
+			<if test="mobileNo != null">
+				mobile_no_ = #{mobileNo},
+			</if>
+			<if test="callBackTime != null">
+				call_back_time_ = #{callBackTime},
+			</if>
+			<if test="name != null">
+				name_ = #{name},
+			</if>
+			<if test="createTime != null">
+				create_time_ = #{createTime},
+			</if>
+		</set>
+		WHERE id_ = #{id}
+	</update>
+
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete">
+		DELETE FROM tenant_apply WHERE id_ = #{id}
+	</delete>
+
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="TenantApply" parameterType="map">
+		SELECT * FROM tenant_apply ORDER BY id_
+		<include refid="global.limit" />
+	</select>
+
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM
+		tenant_apply
+	</select>
+</mapper>

+ 1 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/config/ResourceServerConfig.java

@@ -27,7 +27,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
         http.authorizeRequests()
                 .antMatchers("/task/*","/v2/api-docs", "/su/**", "/student/apply", "/examRegistration/ocr", "/examOrder/paymentResult",
                         "/examOrder/notify","/examinationBasic/getInfo","/examOrder/executePayment","/examOrder/pageList",
-                        "/studentExamResult/recordSync", "/appVersionInfo/queryByPlatform","/*/api/*")
+                        "/studentExamResult/recordSync", "/appVersionInfo/queryByPlatform","tenantApply/add","/*/api/*")
                 .permitAll()
                 .anyRequest().authenticated().and().csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler)
                 .authenticationEntryPoint(baseAuthenticationEntryPoint).and();

+ 58 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/TenantApplyController.java

@@ -0,0 +1,58 @@
+package com.keao.edu.user.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.keao.edu.common.controller.BaseController;
+import com.keao.edu.common.page.QueryInfo;
+import com.keao.edu.user.entity.TenantApply;
+import com.keao.edu.user.service.TenantApplyService;
+
+@RequestMapping("tenantApply")
+@Api(tags = "机构申请服务")
+@RestController
+public class TenantApplyController extends BaseController {
+
+	@Autowired
+	private TenantApplyService tenantApplyService;
+
+	@ApiOperation("分页查询")
+	@GetMapping(value = "/list")
+	@PreAuthorize("@pcs.hasPermissions('tenantApply/list')")
+	public Object getList(QueryInfo queryInfo) {
+		return succeed(tenantApplyService.queryPage(queryInfo));
+	}
+
+	@ApiOperation("单查询")
+	@ApiImplicitParam(name = "id", value = "ID编号", required = true, dataType = "Integer", paramType = "path")
+	@GetMapping(value = "/query")
+	@PreAuthorize("@pcs.hasPermissions('tenantApply/query')")
+	public Object query(Long id) {
+		return succeed(tenantApplyService.get(id));
+	}
+
+	@ApiOperation("新增")
+	@PostMapping(value = "/add", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	public Object add(TenantApply tenantApply) {
+		tenantApplyService.insert(tenantApply);
+		return succeed();
+	}
+
+	@ApiOperation("更新")
+	@PostMapping(value = "/update", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PreAuthorize("@pcs.hasPermissions('tenantApply/update')")
+	public Object update(TenantApply tenantApply) {
+		tenantApplyService.update(tenantApply);
+		return succeed();
+	}
+
+}