Commit d778d6f6 by 吴迪

Merge remote-tracking branch 'origin/master'

parents 50dedd90 71f7e46e
......@@ -3,8 +3,10 @@ package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Map;
import cn.hutool.crypto.symmetric.DES;
import io.office.modules.app.annotation.Login;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import io.office.modules.manage.vo.request.DomesticCodeVo;
import io.office.modules.sys.service.SysCaptchaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -17,6 +19,7 @@ import io.office.modules.manage.service.LogLoginService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
......@@ -31,9 +34,14 @@ import javax.servlet.http.HttpServletResponse;
@RestController
@RequestMapping("/loglogin")
public class LogLoginController {
@Autowired
private LogLoginService logLoginService;
@Autowired
private SysCaptchaService sysCaptchaService;
/**
......@@ -43,8 +51,12 @@ public class LogLoginController {
@Login
// @RequiresPermissions("manage:member:list")
public R login(@RequestBody Map<String, Object> params, HttpServletRequest request, HttpServletResponse response){
logLoginService.login(params,request,response);
return R.ok();
/*DomesticCodeVo domesticCodeVo = new DomesticCodeVo();
boolean captcha = sysCaptchaService.validate(domesticCodeVo.getUuid(), domesticCodeVo.getCaptcha());
if(!captcha){
return R.error("验证码不正确");
}*/
return R.ok().put("loginInfo",logLoginService.login(params,request,response));
}
/**
......@@ -62,7 +74,8 @@ public class LogLoginController {
/**
* 信息
*/
@RequestMapping("/info/{id}")
@RequestMapping("/api/info/{id}")
@Login
// @RequiresPermissions("manage:loglogin:info")
public R info(@PathVariable("id") Integer id){
LogLoginEntity logLogin = logLoginService.getById(id);
......@@ -70,6 +83,9 @@ public class LogLoginController {
return R.ok().put("logLogin", logLogin);
}
/**
* 保存
*/
......@@ -77,14 +93,14 @@ public class LogLoginController {
// @RequiresPermissions("manage:loglogin:save")
public R save(@RequestBody LogLoginEntity logLogin){
logLoginService.save(logLogin);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@RequestMapping("/api/update")
@Login
// @RequiresPermissions("manage:loglogin:update")
public R update(@RequestBody LogLoginEntity logLogin){
logLoginService.updateById(logLogin);
......
......@@ -47,6 +47,28 @@ public class MemberController {
/**
* 用户信息管理-修改登录密码
*/
@Login
@RequestMapping("/api/updatePass")
// @RequiresPermissions("manage:member:list")
public R updatePass(@RequestBody Map<String, Object> params){
memberService.updatePass(params);
return R.ok();
}
/**
* 用户信息管理-修改手机号码
*/
@Login
@RequestMapping("/api/updatephone")
// @RequiresPermissions("manage:member:list")
public R updatephone(@RequestBody Map<String, Object> params, HttpServletRequest request, HttpServletResponse response){
memberService.updatephone(params,request,response);
return R.ok();
}
/**
* 列表
*/
@RequestMapping("/list")
......@@ -61,7 +83,8 @@ public class MemberController {
/**
* 信息
*/
@RequestMapping("/info/{id}")
@RequestMapping("/api/info/{id}")
@Login
// @RequiresPermissions("manage:member:info")
public R info(@PathVariable("id") Integer id){
MemberEntity member = memberService.getById(id);
......@@ -83,7 +106,8 @@ public class MemberController {
/**
* 修改
*/
@RequestMapping("/update")
@RequestMapping("/api/update")
@Login
// @RequiresPermissions("manage:member:update")
public R update(@RequestBody MemberEntity member){
memberService.updateById(member);
......
......@@ -11,9 +11,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.*;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.manage.service.AnnounceService;
import io.office.modules.manage.service.LogisticsService;
import io.office.modules.manage.service.MedicalService;
import io.office.modules.manage.service.*;
import io.office.modules.sys.controller.AbstractController;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
......@@ -22,7 +20,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;
import io.office.modules.manage.service.NewsService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
......@@ -354,5 +351,45 @@ public class NewsController extends AbstractController {
return R.ok().put("data", list);
}
/**知识检索*/
@Login
@PostMapping("/api/searchKnowledgeInfo")
public R searchKnowledgeInfo(@RequestBody NewsParams newsParams) {
Map<String,Object> retMap = this.newsService.searchKnowledgeInfo(newsParams);
return R.ok().put("data", retMap);
}
/**知识检索下来分类*/
@Login
@PostMapping("/api/searchKnowledgeInfoList")
public R searchKnowledgeInfoList() {
List<Map<String,Object>> retMap = this.newsService.searchKnowledgeInfoList();
return R.ok().put("data", retMap);
}
/**热点点击*/
@Login
@GetMapping("/api/hotList")
public R hotList() {
List<Map<String,Object>> retMap = this.newsService.hotList();
return R.ok().put("data", retMap);
}
@Autowired
@Lazy
KnowledgeinfoService knowledgeinfoService;
/**查看*/
@Login
@GetMapping("/api/knowledgeinfo/{id}")
public R getInfo(@PathVariable("id") Integer id) {
KnowledgeinfoEntity retMap = this.knowledgeinfoService.getById(id);
return R.ok().put("data", retMap);
}
/**资讯排行TOP10*/
@Login
@GetMapping("/api/newsTop10")
public R newsTop10() {
List<NewsEntity> list = this.newsService.newsTop10();
return R.ok().put("data", list);
}
}
package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Map;
import io.office.modules.app.annotation.Login;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.office.modules.manage.entity.TycpdmFirmChangeEntity;
import io.office.modules.manage.service.TycpdmFirmChangeService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-11 15:15:19
*/
@RestController
@RequestMapping("/tycpdmfirmchange")
public class TycpdmFirmChangeController {
@Autowired
private TycpdmFirmChangeService tycpdmFirmChangeService;
/**
* 列表
*/
@RequestMapping("/list")
// @RequiresPermissions("manage:tycpdmfirmchange:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = tycpdmFirmChangeService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/api/info/{id}")
@Login
// @RequiresPermissions("manage:tycpdmfirmchange:info")
public R info(@PathVariable("id") Integer id){
TycpdmFirmChangeEntity tycpdmFirmChange = tycpdmFirmChangeService.getById(id);
return R.ok().put("tycpdmFirmChange", tycpdmFirmChange);
}
/**
* 保存
*/
@RequestMapping("/save")
// @RequiresPermissions("manage:tycpdmfirmchange:save")
public R save(@RequestBody TycpdmFirmChangeEntity tycpdmFirmChange){
tycpdmFirmChangeService.save(tycpdmFirmChange);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
// @RequiresPermissions("manage:tycpdmfirmchange:update")
public R update(@RequestBody TycpdmFirmChangeEntity tycpdmFirmChange){
tycpdmFirmChangeService.updateById(tycpdmFirmChange);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
// @RequiresPermissions("manage:tycpdmfirmchange:delete")
public R delete(@RequestBody Integer[] ids){
tycpdmFirmChangeService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}
package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Map;
import io.office.common.exception.RRException;
import io.office.modules.app.annotation.Login;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.office.modules.manage.entity.TycpdmFirmEntity;
import io.office.modules.manage.service.TycpdmFirmService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
/**
* ${comments}
* 企业认证信息
* @author wudi
* @email
* @date 2021-12-11 15:15:19
*/
@RestController
@RequestMapping("/tycpdmfirm")
public class TycpdmFirmController {
@Autowired
private TycpdmFirmService tycpdmFirmService;
/**
* 列表
*/
@RequestMapping("/list")
// @RequiresPermissions("manage:tycpdmfirm:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = tycpdmFirmService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{fId}")
// @RequiresPermissions("manage:tycpdmfirm:info")
public R info(@PathVariable("fId") Integer fId){
TycpdmFirmEntity tycpdmFirm = tycpdmFirmService.getById(fId);
return R.ok().put("tycpdmFirm", tycpdmFirm);
}
/**
* 保存(保存企业信息)
*/
@RequestMapping("/api/save")
@Login
// @RequiresPermissions("manage:tycpdmfirm:save")
public R save(@RequestBody TycpdmFirmEntity tycpdmFirm){
String baseUser = tycpdmFirm.getBaseUser();
if (baseUser==null){
throw new RRException("用户名不能为空");
}
//第一步不存储状态 第二部存储
//tycpdmFirm.setLogoutFlag(0); //审核状态 0待审核 1审核成功 2审核失败
tycpdmFirmService.save(tycpdmFirm);
return R.ok();
}
/**
* 根据用户名获取企业认证信息
*/
@RequestMapping("/api/findUserName")
@Login
// @RequiresPermissions("manage:tycpdmfirm:save")
public R findUserName(@RequestParam("userName") String userName){
TycpdmFirmEntity tycpdmFirmEntity=tycpdmFirmService.findUserName(userName);
return R.ok().put("data",tycpdmFirmEntity);
}
/**
* 修改
*/
@RequestMapping("/update")
// @RequiresPermissions("manage:tycpdmfirm:update")
public R update(@RequestBody TycpdmFirmEntity tycpdmFirm){
tycpdmFirmService.updateById(tycpdmFirm);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
// @RequiresPermissions("manage:tycpdmfirm:delete")
public R delete(@RequestBody Integer[] fIds){
tycpdmFirmService.removeByIds(Arrays.asList(fIds));
return R.ok();
}
}
......@@ -8,6 +8,15 @@ import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.data.repository.query.Param;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import java.io.*;
import java.security.SecureRandom;
import java.util.Scanner;
/**
* ${comments}
*
......@@ -24,6 +33,18 @@ public interface MemberDao extends BaseMapper<MemberEntity> {
@Update("UPDATE member SET pass = #{passWord} WHERE id = #{id}")
void updateByIdPassWord(@Param("id") Integer id,@Param("passWord") String passWord);
@Select("select b.code_agen as code_agen from member a left join MemAgent b on a.username=b.user_id where a.username=#{userName}")
Integer selectCode_agen(@Param("userName") String userName);
@Select("INSERT INTO useraccess (UserName,GroupId,rights) values (#{userName},1,'100,')")
void insertUserAccess(@Param("userName")String userName);
@Update("UPDATE member SET phone = #{phone} WHERE id = #{id}")
void updateByIDPhone(@Param("id") Integer id,@Param("phone") String phone);
/*@Select("select * from member where username=#{userName} or firmcode=#{userName}")
MemberEntity selectByNameAndSn(@Param("userName") String userName);*/
}
......@@ -64,4 +64,14 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List<KnowledgeinfoEntity> selectTips(NewsParams newsParams);
List<String> selectChild(Map<String,Object> params);
List<Map<String, Object>> searchKnowledgeInfo(Map<String, Object> map);
List<Map<String, Object>> searchKnowledgeInfoList();
List<Map<String, Object>> hotList();
List<NewsEntity> newsTop10();
}
package io.office.modules.manage.dao;
import io.office.modules.manage.entity.TycpdmFirmChangeEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-11 15:15:19
*/
@Mapper
public interface TycpdmFirmChangeDao extends BaseMapper<TycpdmFirmChangeEntity> {
}
package io.office.modules.manage.dao;
import io.office.modules.manage.entity.TycpdmFirmEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-11 15:15:19
*/
@Mapper
public interface TycpdmFirmDao extends BaseMapper<TycpdmFirmEntity> {
@Select("select * from tycpdm_firm where base_user=#{userName}")
TycpdmFirmEntity findUserName(@Param("userName") String userName);
}
package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-11 15:15:19
*/
@Data
@TableName("tycpdm_firm_change")
public class TycpdmFirmChangeEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* $column.comments
*/
@TableId
private Integer id;
/**
* $column.comments
*/
private Integer fId;
/**
* $column.comments
*/
private String firmname;
/**
* $column.comments
*/
private String firmname1;
/**
* $column.comments
*/
private String registeraddress;
/**
* $column.comments
*/
private String registeraddress1;
/**
* $column.comments
*/
private String address;
/**
* $column.comments
*/
private String address1;
/**
* $column.comments
*/
private String postcode;
/**
* $column.comments
*/
private String postcode1;
/**
* $column.comments
*/
private String contactman;
/**
* $column.comments
*/
private String contactmanctqh;
/**
* $column.comments
*/
private String contactmantele;
/**
* $column.comments
*/
private String contactmanmp;
/**
* $column.comments
*/
private String contactmanfax;
/**
* $column.comments
*/
private String contactmanemail;
/**
* $column.comments
*/
private String contactmansfz;
/**
* $column.comments
*/
private String contactmansfzFile;
/**
* $column.comments
*/
private String useddesc;
/**
* $column.comments
*/
private String certificatecode;
/**
* $column.comments
*/
private String political;
/**
* $column.comments
*/
private String registerprincipal;
/**
* $column.comments
*/
private String cointype;
/**
* $column.comments
*/
private String firmtype;
/**
* $column.comments
*/
private String dm;
/**
* $column.comments
*/
private String tjdm;
/**
* $column.comments
*/
private String firmcode;
/**
* $column.comments
*/
private String leader;
/**
* $column.comments
*/
private String leadertele;
/**
* $column.comments
*/
private String leaderhandset;
/**
* $column.comments
*/
private String leadersfzFile;
/**
* $column.comments
*/
private String netstation;
/**
* $column.comments
*/
private String wishusednum;
/**
* $column.comments
*/
private Integer receiveflag;
/**
* $column.comments
*/
private String memo;
/**
* $column.comments
*/
private String firmcodefile;
/**
* $column.comments
*/
private String firmbusinesslicensefile;
/**
* $column.comments
*/
private String branchcode;
/**
* $column.comments
*/
private String dbdcode;
/**
* $column.comments
*/
private String loginDate;
/**
* $column.comments
*/
private Integer logoutFlag;
/**
* $column.comments
*/
private String baseUser;
/**
* $column.comments
*/
private String approveDate;
/**
* $column.comments
*/
private String firmArchivesfile;
/**
* $column.comments
*/
private String approveContent;
/**
* $column.comments
*/
private String auditor;
/**
* $column.comments
*/
private String servicetype;
}
package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-11 15:15:19
*/
@Data
@TableName("tycpdm_firm")
public class TycpdmFirmEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* $column.comments
*/
@TableId
private Integer fId;
/**
* $column.comments
*/
private String firmname;
/**
* $column.comments
*/
private String firmname1;
/**
* $column.comments
*/
private String registeraddress;
/**
* $column.comments
*/
private String registeraddress1;
/**
* $column.comments
*/
private String address;
/**
* $column.comments
*/
private String address1;
/**
* $column.comments
*/
private String postcode;
/**
* $column.comments
*/
private String postcode1;
/**
* $column.comments
*/
private String contactman;
/**
* $column.comments
*/
private String contactmanctqh;
/**
* $column.comments
*/
private String contactmantele;
/**
* $column.comments
*/
private String contactmanmp;
/**
* $column.comments
*/
private String contactmanfax;
/**
* $column.comments
*/
private String contactmanemail;
/**
* $column.comments
*/
private String contactmansfz;
/**
* $column.comments
*/
private String contactmansfzFile;
/**
* $column.comments
*/
private String useddesc;
/**
* $column.comments
*/
private String certificatecode;
/**
* $column.comments
*/
private String political;
/**
* $column.comments
*/
private String registerprincipal;
/**
* $column.comments
*/
private String cointype;
/**
* $column.comments
*/
private String firmtype;
/**
* $column.comments
*/
private String dm;
/**
* $column.comments
*/
private String tjdm;
/**
* $column.comments
*/
private String firmcode;
/**
* $column.comments
*/
private String leader;
/**
* $column.comments
*/
private String leadertele;
/**
* $column.comments
*/
private String leaderhandset;
/**
* $column.comments
*/
private String leadersfzFile;
/**
* $column.comments
*/
private String netstation;
/**
* $column.comments
*/
private String wishusednum;
/**
* $column.comments
*/
private Integer receiveflag;
/**
* $column.comments
*/
private String memo;
/**
* $column.comments
*/
private String firmcodefile;
/**
* $column.comments
*/
private String firmbusinesslicensefile;
/**
* $column.comments
*/
private String branchcode;
/**
* $column.comments
*/
private String dbdcode;
/**
* $column.comments
*/
private String loginDate;
/**
* $column.comments
*/
private Integer logoutFlag;
/**
* $column.comments
*/
private String baseUser;
/**
* $column.comments
*/
private String approveDate;
/**
* $column.comments
*/
private String firmArchivesfile;
/**
* $column.comments
*/
private String approveContent;
/**
* $column.comments
*/
private String auditor;
/**
* $column.comments
*/
private String servicetype;
}
package io.office.modules.manage.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.LogLoginEntity;
import io.office.modules.manage.entity.MemberEntity;
import org.apache.ibatis.javassist.compiler.ast.Member;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
......@@ -19,6 +22,6 @@ public interface LogLoginService extends IService<LogLoginEntity> {
PageUtils queryPage(Map<String, Object> params);
void login(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response);
JSONObject login(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response);
}
......@@ -20,5 +20,10 @@ public interface MemberService extends IService<MemberEntity> {
PageUtils queryPage(Map<String, Object> params);
void userRegistered(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response);
void updatePass(Map<String, Object> params);
void updatephone(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response);
}
......@@ -64,5 +64,14 @@ public interface NewsService extends IService<NewsEntity> {
List<GlossaryEntity> glossaryList(NewsParams newsParams);
List<KnowledgeinfoEntity> selectTips(NewsParams newsParams);
Map<String, Object> searchKnowledgeInfo(NewsParams newsParams);
List<Map<String, Object>> searchKnowledgeInfoList();
List<Map<String, Object>> hotList();
List<NewsEntity> newsTop10();
}
package io.office.modules.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.TycpdmFirmChangeEntity;
import java.util.Map;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-11 15:15:19
*/
public interface TycpdmFirmChangeService extends IService<TycpdmFirmChangeEntity> {
PageUtils queryPage(Map<String, Object> params);
}
package io.office.modules.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.TycpdmFirmEntity;
import java.util.Map;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-11 15:15:19
*/
public interface TycpdmFirmService extends IService<TycpdmFirmEntity> {
PageUtils queryPage(Map<String, Object> params);
TycpdmFirmEntity findUserName(String userName);
}
package io.office.modules.manage.service.impl;
import com.alibaba.fastjson.JSONObject;
import io.office.common.exception.RRException;
import io.office.common.utils.IPUtils;
import io.office.common.utils.R;
import io.office.modules.manage.dao.MemberDao;
import io.office.modules.manage.entity.MemberEntity;
import io.office.modules.manage.utils.MD5Util;
import io.office.modules.manage.vo.request.DomesticCodeVo;
import io.office.modules.sys.service.SysCaptchaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -21,6 +25,7 @@ import io.office.common.utils.Query;
import io.office.modules.manage.dao.LogLoginDao;
import io.office.modules.manage.entity.LogLoginEntity;
import io.office.modules.manage.service.LogLoginService;
import sun.misc.REException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
......@@ -48,38 +53,74 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
@Override
public void login(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response) {
public JSONObject login(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response) {
String userName = String.valueOf(params.get("userName")==null?"":params.get("userName"));
String passWord = String.valueOf(params.get("passWord")==null?"":params.get("passWord"));
String verification = String.valueOf(params.get("verification")==null?"":params.get("verification"));//验证码
//session中获取验证码
//判断 验证码是否正确
int userType; //用户类型 1.业务大厅(手机号用户) 2.业务大厅(条码卡成员) 3.官网用户
Integer levels = null; //用户权限 空.代表普通用户 0.代表中心管理员,1.代表校验管理员 其他4位.代表分中心管理员
Integer isQY=2; //是否开通企业认证 1.开通 2.未开通
Integer isXT=2; //是否是业务大厅系统成员 1.是 2.否
Integer id=0; //用户ID
//判断用户是否是手机号 是手机号调用 第三方接口登录 不是继续
int userType; //1.业务大厅 2.网站用户
if (matchPhoneNumber(userName)){
//TODO tgl 调用第三方登录接口
userType=1;
}else {
userType=2;
//查询Member表
MemberEntity memberEntity = memberDao.selectByName(userName);
id=memberEntity.getId();
if (memberEntity==null){
throw new RRException("用户不存在!");
}
//用户类型 www:为官网用户 条码卡:为条码卡用户
String source = memberEntity.getSource();
String applystate = memberEntity.getApplystate();// 未申请:普通用户 通过审核:完成厂商实名认证
if (!"条码卡".equals(source)){//官网用户
userType=3;
}else {//条码卡用户
userType=2;
}
}
//获取权限
levels=memberDao.selectCode_agen(userName);
if (levels==null){
if (userType==3){
//判断是否通过企业认证
if ("通过审核".equals(applystate)){
isQY=1;
}
//判断是否是系统成员
}else if (userType==2){
isXT=1;
}
}
MemberEntity user=memberDao.selectByName(userName);
if (user==null){
throw new RRException("用户不存在!");
}
String phone = user.getPhone();
String password = user.getPass();
String passwordMD5 = MD5Util.md5Encrypt32Upper(passWord);
//判断密码是否正确
if (!passwordMD5.equals(password)){
throw new RRException("密码不正确!");
}
//TODO tgl 参数不正确添加登录日志 log_login
logLoginDao.insert(new LogLoginEntity(1,userName,"用户来源","条码卡号",phone,new Date(), IPUtils.getIpAddr(request),request.getRequestURL().toString()));
MemberEntity user=memberDao.selectByName(userName);
String phone = user.getPhone();
String password = user.getPass();
String passwordMD5 = MD5Util.md5Encrypt32Upper(passWord);
//判断密码是否正确
if (!passwordMD5.equals(password)){
throw new RRException("密码不正确!");
}
//TODO tgl 参数不正确添加登录日志 log_login
logLoginDao.insert(new LogLoginEntity(1,userName,"用户来源","条码卡号",phone,new Date(), IPUtils.getIpAddr(request),request.getRequestURL().toString()));
JSONObject jsonObject = new JSONObject();
jsonObject.put("userType",userType);
jsonObject.put("levels",levels);
jsonObject.put("isQY",isQY);
jsonObject.put("isXT",isXT);
jsonObject.put("id",id);
return jsonObject;
}
/**
......
......@@ -19,12 +19,14 @@ import io.office.common.utils.Query;
import io.office.modules.manage.dao.MemberDao;
import io.office.modules.manage.entity.MemberEntity;
import io.office.modules.manage.service.MemberService;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Service("memberService")
@Transactional
public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> implements MemberService {
@Autowired
......@@ -101,8 +103,73 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl
memberEntity.setOicq("");
memberEntity.setRegisterip(IPUtils.getIpAddr(request));
memberDao.insert(memberEntity);
memberDao.insertUserAccess(userName);
}
@Override
public void updatePass(Map<String, Object> params) {
String id = params.get("id") == null ? "" : String.valueOf( params.get("id"));//用户ID
String oldPass = params.get("oldPass") == null ? "" : String.valueOf( params.get("oldPass"));//原始密码
String newPass = params.get("newPass") == null ? "" : String.valueOf( params.get("newPass"));//新密码
String affirmPass = params.get("affirmPass") == null ? "" : String.valueOf( params.get("affirmPass"));//确认密码
if (id.equals("")){
throw new RRException("请先登录");
}
if (oldPass.equals("")){
throw new RRException("请输入旧密码");
}
if (newPass.equals("")){
throw new RRException("请输入新密码");
}
if (affirmPass.equals("")){
throw new RRException("请输入确认密码");
}
if (!newPass.equals(affirmPass)){
throw new RRException("两次密码信息不一致,请重新输入");
}
MemberEntity memberEntity = memberDao.selectById(id);
String passData = memberEntity.getPass();
String passMD5 = MD5Util.md5Encrypt32Upper(oldPass);
if (!passMD5.equals(passData)){
throw new RRException("旧密码输入错误");
}
//修改密码
memberDao.updateByIdPassWord(Integer.valueOf(id),MD5Util.md5Encrypt32Upper(newPass));
}
@Override
public void updatephone(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response) {
String id = params.get("id") == null ? "" : String.valueOf( params.get("id"));//用户ID
String phone = params.get("phone") == null ? "" : String.valueOf( params.get("phone"));//手机号码
String verification = params.get("verification") == null ? "" : String.valueOf( params.get("verification"));//验证码
if (id.equals("")){
throw new RRException("请先登录");
}
if (phone.equals("")){
throw new RRException("请输入手机号码");
}
if (verification.equals("")){
throw new RRException("请输入验证码");
}
String verUpdatephone = request.getSession().getAttribute("verUpdatephone").toString();//获取手机验证码
long verUpdateData = Long.valueOf(request.getSession().getAttribute("verUpdateData").toString());//获取手机有效时间
if (!verUpdatephone.equals(verification)){
throw new RRException("验证码输入错误");
}
long l = System.currentTimeMillis();
if (l-verUpdateData>300){
throw new RRException("验证码已超时");
}
memberDao.updateByIDPhone(Integer.valueOf(id),phone);
}
public static void main(String[] args) {
String t123456 = MD5Util.md5Encrypt32Upper("t123456");
System.out.println(t123456);
}
/**
* 以下为短信验证码验证次数判断
* @param sub 验证码
......@@ -142,10 +209,6 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl
public static void main(String[] args) {
boolean validEmail = isValidEmail("123");
System.out.println(validEmail);
}
//用户名校验
public boolean checkUserName(String logname){
String t1 = "^[0-9A-Za-z]{2,8}$"; //判断密码用户名和密码是否为数字,字母(数字或字母)
......
......@@ -8,9 +8,9 @@ import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.sys.entity.SysUserEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -225,5 +225,149 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
return list;
}
@Override
public Map<String, Object> searchKnowledgeInfo(NewsParams newsParams) {
final Map<String, Object>[] map = new Map[]{new HashMap<>()};
Map<String,Object> retMap = new HashMap<>();
List<String> list = new ArrayList<>();
if("all".equals(newsParams.getType())){
list.add("sptm");
list.add("ewtm");
list.add("zxcbm");
list.add("dwbm");
list.add("gln");
list.add("epc");
list.add("rfid");
list.add("gds");
list.add("ecr");
list.add("ebXML");
}else{
list.add(newsParams.getType());
}
list.stream().forEach(item->{
//判断是否是全部分类
if("sptm".equals(item)){
map[0] = new HashMap<>();
map[0].put("name","40");
List<String> child = getChild(map[0]);
map[0].put("list",child);
map[0].put("typeName","sptm");
map[0].put("title",newsParams.getTitle());
List<Map<String, Object>> dataList = getDataList(map[0]);
retMap.put("sptm",dataList);
}else if("ewtm".equals(item)){
map[0] = new HashMap<>();
map[0].put("name","45");
map[0].put("title",newsParams.getTitle());
List<String> child = getChild(map[0]);
map[0].put("list",child);
map[0].put("typeName","ewtm");
List<Map<String, Object>> dataList = getDataList(map[0]);
retMap.put("ewtm",dataList);
}else if("zxcbm".equals(item)){
map[0] = new HashMap<>();
map[0].put("name","93");
map[0].put("title",newsParams.getTitle());
List<String> child = getChild(map[0]);
map[0].put("list",child);
map[0].put("typeName","zxcbm");
List<Map<String, Object>> dataList = getDataList(map[0]);
retMap.put("zxcbm",dataList);
}else if("dwbm".equals(item)){
map[0] = new HashMap<>();
map[0].put("name","94");
map[0].put("title",newsParams.getTitle());
List<String> child = getChild(map[0]);
map[0].put("list",child);
map[0].put("typeName","dwbm");
List<Map<String, Object>> dataList = getDataList(map[0]);
retMap.put("dwbm",dataList);
}else if("gln".equals(item)){
map[0] = new HashMap<>();
map[0].put("name","95");
map[0].put("title",newsParams.getTitle());
List<String> child = getChild(map[0]);
map[0].put("list",child);
map[0].put("typeName","gln");
List<Map<String, Object>> dataList = getDataList(map[0]);
retMap.put("gln",dataList);
}else if("epc".equals(item)){
map[0] = new HashMap<>();
map[0].put("name","83");
map[0].put("title",newsParams.getTitle());
List<String> child = getChild(map[0]);
map[0].put("list",child);
map[0].put("typeName","epc");
List<Map<String, Object>> dataList = getDataList(map[0]);
retMap.put("epc",dataList);
}else if("rfid".equals(item)){
map[0] = new HashMap<>();
map[0].put("name","77");
map[0].put("title",newsParams.getTitle());
List<String> child = getChild(map[0]);
map[0].put("list",child);
map[0].put("typeName","rfid");
List<Map<String, Object>> dataList = getDataList(map[0]);
retMap.put("rfid",dataList);
}else if("gds".equals(item)){
map[0] = new HashMap<>();
map[0].put("name","85");
map[0].put("title",newsParams.getTitle());
List<String> child = getChild(map[0]);
map[0].put("list",child);
map[0].put("typeName","gds");
List<Map<String, Object>> dataList = getDataList(map[0]);
retMap.put("gds",dataList);
}else if("ecr".equals(item)){
map[0] = new HashMap<>();
map[0].put("name","81");
map[0].put("title",newsParams.getTitle());
List<String> child = getChild(map[0]);
map[0].put("list",child);
map[0].put("typeName","ecr");
List<Map<String, Object>> dataList = getDataList(map[0]);
retMap.put("ecr",dataList);
}else if("ebXML".equals(item)){
map[0] = new HashMap<>();
map[0].put("name","79");
map[0].put("title",newsParams.getTitle());
List<String> child = getChild(map[0]);
map[0].put("list",child);
map[0].put("typeName","ebXML");
List<Map<String, Object>> dataList = getDataList(map[0]);
retMap.put("ebXML",dataList);
}
});
return retMap;
}
@Override
public List<Map<String, Object>> searchKnowledgeInfoList() {
List<Map<String,Object>> list = this.newsDao.searchKnowledgeInfoList();
return list;
}
@Override
public List<Map<String, Object>> hotList() {
List<Map<String,Object>> list = this.newsDao.hotList();
return list;
}
@Override
public List<NewsEntity> newsTop10() {
List<NewsEntity> list = this.newsDao.newsTop10();
return list;
}
private List<Map<String,Object>> getDataList(Map<String, Object> map) {
List<Map<String,Object>> list = this.newsDao.searchKnowledgeInfo(map);
return list;
}
private List<String> getChild(Map<String, Object> map) {
List<String> list = this.newsDao.selectChild(map);
return list;
}
}
\ No newline at end of file
package io.office.modules.manage.service.impl;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
import io.office.modules.manage.dao.TycpdmFirmChangeDao;
import io.office.modules.manage.entity.TycpdmFirmChangeEntity;
import io.office.modules.manage.service.TycpdmFirmChangeService;
@Service("tycpdmFirmChangeService")
public class TycpdmFirmChangeServiceImpl extends ServiceImpl<TycpdmFirmChangeDao, TycpdmFirmChangeEntity> implements TycpdmFirmChangeService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<TycpdmFirmChangeEntity> page = this.page(
new Query<TycpdmFirmChangeEntity>().getPage(params),
new QueryWrapper<TycpdmFirmChangeEntity>()
);
return new PageUtils(page);
}
}
\ No newline at end of file
package io.office.modules.manage.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
import io.office.modules.manage.dao.TycpdmFirmDao;
import io.office.modules.manage.entity.TycpdmFirmEntity;
import io.office.modules.manage.service.TycpdmFirmService;
@Service("tycpdmFirmService")
public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirmEntity> implements TycpdmFirmService {
@Autowired
private TycpdmFirmDao tycpdmFirmDao;
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<TycpdmFirmEntity> page = this.page(
new Query<TycpdmFirmEntity>().getPage(params),
new QueryWrapper<TycpdmFirmEntity>()
);
return new PageUtils(page);
}
@Override
public TycpdmFirmEntity findUserName(String userName) {
return tycpdmFirmDao.findUserName(userName);
}
}
\ No newline at end of file
......@@ -31,6 +31,12 @@
<result property="showtime" column="showtime"/>
<result property="checkdate" column="checkdate"/>
</resultMap>
<select id="newsTop10" resultMap="newsMap">
select top 10 title,id from news where 1=1 and levels > 0
and status = '1'
and datediff(month, releasedate,getdate())=0
order by hits desc
</select>
<!--查询新闻列表-->
<select id="selectNewsList" resultMap="newsMap" parameterType="io.office.modules.manage.entity.dto.NewsParams">
......@@ -424,4 +430,52 @@
levels DESC,
knowledgeInfoid DESC
</select>
<select id="selectChild" resultType="java.lang.String">
select t.knowledgeCategoryID FROM knowledgeCategory t where t.parentCategoryID = #{name}
</select>
<select id="searchKnowledgeInfo" resultType="java.util.Map">
SELECT
top 6 Title,knowledgeInfoID,#{typeName} as type
FROM
knowledgeInfo t
LEFT JOIN knowledgeCategory tt ON t.knowledgeCategoryID = tt.knowledgeCategoryID
where 1=1
<if test="title !=null and title !=''">
and t.Title like concat(concat('%',#{title}),'%')
</if>
and t.knowledgeCategoryID in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="searchKnowledgeInfoList" resultType="java.util.Map">
SELECT
t.knowledgeCategoryID,
case knowledgeCategoryID
when 40 then 'sptm'
when 45 then 'ewtm'
when 77 then 'rfid'
when 79 then 'ebXML'
when 81 then 'ecr'
when 83 then 'ecp'
when 85 then 'gds'
when 93 then 'zxcbm'
when 94 then 'dwbm'
when 95 then 'gln'
else 'else' end type,
t.description
FROM
knowledgeCategory t
WHERE
t.knowledgeCategoryID in('40','45','93','94','95','83','77','85','81','79')
</select>
<select id="hotList" resultType="java.util.Map">
SELECT
top 5 title,knowledgeInfoID
FROM
knowledgeInfo
ORDER BY
hits DESC
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment