Bläddra i källkod

Merge remote-tracking branch 'origin/master'

jz.kai 4 år sedan
förälder
incheckning
63241c356c

+ 21 - 0
common/src/main/java/com/jpsoft/employment/modules/base/dao/MobileBannerInfoDAO.java

@@ -0,0 +1,21 @@
+package com.jpsoft.employment.modules.base.dao;
+
+import com.jpsoft.employment.modules.base.entity.MobileBannerInfo;
+import com.jpsoft.employment.modules.common.dto.Sort;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@Repository
+public interface MobileBannerInfoDAO {
+	int insert(MobileBannerInfo entity);
+	int update(MobileBannerInfo entity);
+	int exist(String id);
+	MobileBannerInfo get(String id);
+	int delete(String id);
+	List<MobileBannerInfo> list();
+	List<MobileBannerInfo> search(Map<String, Object> searchParams, List<Sort> sortList);
+
+    List<MobileBannerInfo> getBannerInfo(String type);
+}

+ 89 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/MobileBannerInfo.java

@@ -0,0 +1,89 @@
+package com.jpsoft.employment.modules.base.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 描述:base_mobile_banner_info的实体类
+ */
+@Data
+@ApiModel(value = "base_mobile_banner_info的实体类")
+public class MobileBannerInfo {
+    /**
+     *
+     */
+    @ApiModelProperty(value = "")
+    private String id;
+    /**
+     * 幻灯片标题
+     */
+    @ApiModelProperty(value = "幻灯片标题")
+    private String name;
+    /**
+     * 幻灯片分类
+     */
+    @ApiModelProperty(value = "幻灯片分类")
+    private String classify;
+    /**
+     * 幻灯片链接地址
+     */
+    @ApiModelProperty(value = "幻灯片链接地址")
+    private String linkUrl;
+    /**
+     * 幻灯片图片
+     */
+    @ApiModelProperty(value = "幻灯片图片")
+    private String picUrl;
+    /**
+     * 创建人
+     */
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+    /**
+     * 创建时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 更新人
+     */
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+    /**
+     * 更新时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+    /**
+     * 是否删除
+     */
+    @ApiModelProperty(value = "是否删除")
+    private Boolean delFlag;
+
+    @ApiModelProperty(value = "幻灯片分类")
+    private String classifyN;
+
+    @ApiModelProperty(value = "审核状态(0-未审核,1-已审核)")
+    private Boolean enabled;
+
+    @ApiModelProperty(value = "序号")
+    private Integer sortNo;
+
+    @ApiModelProperty(value = "是否根据商品类别显示")
+    private String goodsType;
+
+    @ApiModelProperty(value = "是否是班主任专属")
+    private Boolean isTeachers;
+
+
+
+}

+ 19 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/MobileBannerInfoService.java

@@ -0,0 +1,19 @@
+package com.jpsoft.employment.modules.base.service;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.employment.modules.base.entity.MobileBannerInfo;
+import com.jpsoft.employment.modules.common.dto.Sort;
+
+import java.util.List;
+import java.util.Map;
+
+public interface MobileBannerInfoService {
+	MobileBannerInfo get(String id);
+	boolean exist(String id);
+	int insert(MobileBannerInfo model);
+	int update(MobileBannerInfo model);
+	int delete(String id);
+	List<MobileBannerInfo> list();
+	List<MobileBannerInfo> getBannerInfo(String type);
+	Page<MobileBannerInfo> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
+}

+ 75 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/impl/MobileBannerInfoServiceImpl.java

@@ -0,0 +1,75 @@
+package com.jpsoft.employment.modules.base.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.jpsoft.employment.modules.base.dao.MobileBannerInfoDAO;
+import com.jpsoft.employment.modules.base.entity.MobileBannerInfo;
+import com.jpsoft.employment.modules.base.service.MobileBannerInfoService;
+import com.jpsoft.employment.modules.common.dto.Sort;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@Transactional
+@Component(value="mobileBannerInfoService")
+public class MobileBannerInfoServiceImpl implements MobileBannerInfoService {
+	@Resource(name="mobileBannerInfoDAO")
+	private MobileBannerInfoDAO mobileBannerInfoDAO;
+
+	@Override
+	public MobileBannerInfo get(String id) {
+		// TODO Auto-generated method stub
+		return mobileBannerInfoDAO.get(id);
+	}
+
+	@Override
+	public int insert(MobileBannerInfo model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return mobileBannerInfoDAO.insert(model);
+	}
+
+	@Override
+	public int update(MobileBannerInfo model) {
+		// TODO Auto-generated method stub
+		return mobileBannerInfoDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return mobileBannerInfoDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = mobileBannerInfoDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<MobileBannerInfo> list() {
+		// TODO Auto-generated method stub
+		return mobileBannerInfoDAO.list();
+	}
+
+	@Override
+	public List<MobileBannerInfo> getBannerInfo(String type) {
+		// TODO Auto-generated method stub
+		return mobileBannerInfoDAO.getBannerInfo(type);
+	}
+	@Override
+	public Page<MobileBannerInfo> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize, boolean count, List<Sort> sortList) {
+        Page<MobileBannerInfo> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            mobileBannerInfoDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+}

+ 123 - 0
common/src/main/resources/mapper/base/MobileBannerInfo.xml

@@ -0,0 +1,123 @@
+<?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">
+<!-- namespace必须指向DAO接口 -->
+<mapper namespace="com.jpsoft.employment.modules.base.dao.MobileBannerInfoDAO">
+    <resultMap id="MobileBannerInfoMap" type="com.jpsoft.employment.modules.base.entity.MobileBannerInfo">
+        <id property="id" column="id_"/>
+        <result property="name" column="name_"/>
+        <result property="classify" column="classify_"/>
+        <result property="linkUrl" column="link_url"/>
+        <result property="picUrl" column="pic_url"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="enabled" column="enabled_"/>
+        <result property="sortNo" column="sort_no"/>
+
+    </resultMap>
+    <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.MobileBannerInfo">
+        <!--
+        <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+            select sys_guid() from dual
+        </selectKey>
+        -->
+        <![CDATA[
+		insert into base_mobile_banner_info
+	    (id_,name_,classify_,link_url,pic_url,create_by,create_time,update_by,update_time,del_flag,enabled_,sort_no)
+		values
+		(
+			#{id,jdbcType=VARCHAR}
+			,#{name,jdbcType=VARCHAR}
+			,#{classify,jdbcType= VARCHAR }
+			,#{linkUrl,jdbcType=VARCHAR}
+			,#{picUrl,jdbcType=VARCHAR}
+			,#{createBy,jdbcType=VARCHAR}
+			,#{createTime,jdbcType= TIMESTAMP }
+			,#{updateBy,jdbcType=VARCHAR}
+			,#{updateTime,jdbcType= TIMESTAMP }
+			,#{delFlag,jdbcType= NUMERIC }
+			,#{enabled,jdbcType=VARCHAR}
+			,#{sortNo,jdbcType= NUMERIC }
+
+		)
+	]]>
+    </insert>
+    <delete id="delete" parameterType="string">
+        delete from base_mobile_banner_info where id_=#{id,jdbcType=VARCHAR}
+    </delete>
+    <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.MobileBannerInfo">
+        update base_mobile_banner_info
+        <set>
+            <if test="name!=null">
+                name_=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="classify!=null">
+                classify_=#{classify,jdbcType= VARCHAR },
+            </if>
+            <if test="linkUrl!=null">
+                link_url=#{linkUrl,jdbcType=VARCHAR},
+            </if>
+            <if test="picUrl!=null">
+                pic_url=#{picUrl,jdbcType=VARCHAR},
+            </if>
+            <if test="createBy!=null">
+                create_by=#{createBy,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime!=null">
+                create_time=#{createTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="updateBy!=null">
+                update_by=#{updateBy,jdbcType=VARCHAR},
+            </if>
+            <if test="updateTime!=null">
+                update_time=#{updateTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="delFlag!=null">
+                del_flag=#{delFlag,jdbcType= NUMERIC },
+            </if>
+            <if test="enabled!=null">
+                enabled_=#{enabled,jdbcType=NUMERIC},
+            </if>
+            <if test="sortNo!=null">
+                sort_no=#{sortNo,jdbcType=NUMERIC},
+            </if>
+
+
+        </set>
+        where id_=#{id}
+    </update>
+    <select id="get" parameterType="string" resultMap="MobileBannerInfoMap">
+        select * from
+        base_mobile_banner_info where id_=#{0}
+    </select>
+    <select id="exist" parameterType="string" resultType="int">
+        select count(*) from base_mobile_banner_info where id_=#{0}
+    </select>
+    <select id="list" resultMap="MobileBannerInfoMap">
+        select * from base_mobile_banner_info
+    </select>
+    <select id="getBannerInfo" resultMap="MobileBannerInfoMap">
+        select * from base_mobile_banner_info where classify_ in ('all',#{0})  and enabled_ =1  and del_flag=0
+        order by sort_no asc
+    </select>
+    <select id="search" parameterType="hashmap" resultMap="MobileBannerInfoMap">
+        <![CDATA[
+			select * from base_mobile_banner_info
+		]]>
+        <where>
+            del_flag=0
+            <if test="searchParams.name != null">
+                and name_ like #{searchParams.name}
+            </if>
+            <if test="searchParams.classify != null">
+                and classify_ = #{searchParams.classify}
+            </if>
+        </where>
+        <foreach item="sort" collection="sortList" open="order by" separator=",">
+            ${sort.name} ${sort.order}
+        </foreach>
+    </select>
+</mapper>

+ 1 - 1
common/src/main/resources/mapper/sys/DataDictionary.xml

@@ -145,7 +145,7 @@
         FROM
         sys_data_dictionary a where a.del_flag = 0
         and data_type = 2
-        and a.parent_id = #{0}
+        and a.parent_id = #{0}    order by a.sort_no asc
     </select>
 
     <select id="getName" parameterType="string" resultType="string">

+ 2 - 1
web/src/main/java/com/jpsoft/employment/config/WebMvcConfig.java

@@ -79,8 +79,9 @@ public class WebMvcConfig implements WebMvcConfigurer {
 				.excludePathPatterns("/mobile/whisperingWallApi/whisperingWallInfoList")
 				.excludePathPatterns("/mobile/whisperingWallApi/whisperingWallInfoDetail")
                 .excludePathPatterns("/mobile/billInfoApi/dueList")
-                .excludePathPatterns("/mobile/bannerInfo/getBannerInfo")
+                //.excludePathPatterns("/mobile/bannerInfo/getBannerInfo")
 				.excludePathPatterns("/mobile/doubleHundred/submitInformation")
+                .excludePathPatterns("/mobile/bannerInfo/findByOpenId")
                 .excludePathPatterns("/wechat/**")
 				.excludePathPatterns("/wxPay/**")
 				.excludePathPatterns("/aliPay/**")

+ 82 - 0
web/src/main/java/com/jpsoft/employment/modules/mobile/controller/BannerInfoApiController.java

@@ -0,0 +1,82 @@
+package com.jpsoft.employment.modules.mobile.controller;
+
+import com.jpsoft.employment.modules.base.entity.MobileBannerInfo;
+import com.jpsoft.employment.modules.base.service.MobileBannerInfoService;
+import com.jpsoft.employment.modules.common.dto.MessageResult;
+import com.jpsoft.employment.modules.common.utils.JwtUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.joda.time.DateTime;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/mobile/bannerInfo")
+@Api(description = "移动端广告栏接口")
+public class BannerInfoApiController {
+
+    @Autowired
+    private MobileBannerInfoService mobileBannerInfoService;
+
+  @PostMapping("getBannerInfo")
+
+    @ApiOperation(value = "获取移动端广告栏")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "type", value = "hr(hr新闻+公共新闻) , job(job+公共新闻)", required = true, paramType = "form"),
+    })
+  // @RequestMapping(value = "getBannerInfo", method = RequestMethod.POST)
+
+    public MessageResult<List> getBannerInfo(
+            @RequestParam(value = "type", defaultValue = "") String type,
+            String token,
+            @RequestAttribute  String subject) {
+
+        MessageResult<List> messageResult = new MessageResult<>();
+        //    Map<String, Object> map = new HashMap<>();
+
+        try {
+            List<MobileBannerInfo> list = mobileBannerInfoService.getBannerInfo(type);
+
+            //         map.put("list",list);
+            messageResult.setData(list);
+            messageResult.setCode(200);
+            messageResult.setMessage("查询成功");
+            messageResult.setResult(true);
+
+        } catch (Exception ex) {
+            messageResult.setCode(400);
+            messageResult.setMessage(ex.getMessage());
+            messageResult.setResult(false);
+        }
+
+        return messageResult;
+    }
+
+    @Value("${jwt.secret}")
+    private String jwtSecret;
+    @PostMapping("findByOpenId")
+    @ApiOperation(value = "通过openId查询人员(公开接口)")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "openId", value = "微信openId", required = true, paramType = "form")
+    })
+    public MessageResult<Map> findByOpenId(String openId) {
+        MessageResult<Map> messageResult = new MessageResult<>();
+
+        Map<String, Object> dataMap = new HashMap<String, Object>();
+        String token = JwtUtil.createToken(jwtSecret, openId, DateTime.now().plusHours(6).toDate());
+
+         dataMap.put("token", token);
+        messageResult.setData(dataMap);
+        messageResult.setResult(true);
+        messageResult.setCode(200);
+        return  messageResult;
+    }
+
+}

+ 28 - 33
web/src/main/java/com/jpsoft/employment/modules/mobile/controller/RecruitmentApiController.java

@@ -24,7 +24,7 @@ import java.util.*;
 @Slf4j
 @RestController
 @RequestMapping("/mobile/recruitmentApi")
-@Api(description = "移动端职接口")
+@Api(description = "移动端职接口")
 public class RecruitmentApiController {
     private Logger logger = LoggerFactory.getLogger(getClass());
 
@@ -33,45 +33,40 @@ public class RecruitmentApiController {
 
     @PostMapping("getRecruitmentList")
     @ApiOperation(value = "职位列表")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "subject", value = "目标(不传)", paramType = "form"),
+    public MessageResult<Map> getRecruitmentList(
+            String id,
+            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
+            @RequestParam(value="pageSize",defaultValue="20") int pageSize,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
 
-    })
-    public MessageResult<Map> getRecruitmentList(@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
-                                              @RequestParam(value="pageSize",defaultValue="20") int pageSize,
-                                              @RequestAttribute String subject) {
+        //当前用户ID
+        System.out.println(subject);
 
-        MessageResult<Map> messageResult = new MessageResult<>();
+        MessageResult<Map> msgResult = new MessageResult<>();
 
-        try {
-            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
-            Map<String,Object> searchParams = new HashMap<>();
-            searchParams.put("createBy", subject);
+        Map<String,Object> searchParams = new HashMap<>();
 
-            List<Sort> sortList = new ArrayList<>();
-            int tabId = 0;
-            switch (tabId) {
-                case 0:
-                    sortList.add(new Sort("createTime","asc"));
-                    break;
-                case 1:
-                    sortList.add(new Sort("readingTimes","desc"));
-                    break;
-            }
+        List<Sort> sortList = new ArrayList<>();
+        int tabId = 0;
+        switch (tabId) {
+            case 0:
+                sortList.add(new Sort("create_time","asc"));
+                break;
+            case 1:
+                sortList.add(new Sort("reading_times","desc"));
+                break;
+        }
 
-            Page<Recruitment> page = recruitmentService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+        if (StringUtils.isNotEmpty(id)) {
+            searchParams.put("id","%" + id + "%");
+        }
 
-            messageResult.setData(PojoUtils.pageWrapper(page));
-            messageResult.setCode(200);
-            messageResult.setMessage("查询成功");
-            messageResult.setResult(true);
+        Page<Recruitment> page = recruitmentService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
 
-        } catch (Exception ex) {
-            messageResult.setCode(400);
-            messageResult.setMessage(ex.getMessage());
-            messageResult.setResult(false);
-        }
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
 
-        return messageResult;
+        return msgResult;
     }
 }

+ 1 - 0
web/src/main/java/com/jpsoft/employment/modules/sys/controller/DataDictionaryController.java

@@ -276,6 +276,7 @@ public class DataDictionaryController {
     @RequestMapping(value = "queryChildren", method = RequestMethod.POST)
     public MessageResult<List> queryChildren(
             @RequestParam(value = "parentId", defaultValue = "") String parentId,
+            String token,
             @RequestAttribute String subject) {
         MessageResult<List> msgResult = new MessageResult<>();