Merge branch 'dev' of http://62.234.3.186:3000/sxyanzhu/jhprjv2 into dev
commit
1d4bb33bda
|
@ -19,6 +19,14 @@ public interface SysUserOpenidMapper
|
||||||
*/
|
*/
|
||||||
public SysUserOpenid selectSysUserOpenidById(Long id);
|
public SysUserOpenid selectSysUserOpenidById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户绑定小程序openId
|
||||||
|
*
|
||||||
|
* @param openId 用户绑定小程序openId主键
|
||||||
|
* @return 用户绑定小程序openId
|
||||||
|
*/
|
||||||
|
public SysUserOpenid selectSysUserOpenidByOpenId(String openId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询用户绑定小程序openId列表
|
* 查询用户绑定小程序openId列表
|
||||||
*
|
*
|
||||||
|
|
|
@ -19,6 +19,14 @@ public interface ISysUserOpenidService
|
||||||
*/
|
*/
|
||||||
public SysUserOpenid selectSysUserOpenidById(Long id);
|
public SysUserOpenid selectSysUserOpenidById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户绑定小程序openId
|
||||||
|
*
|
||||||
|
* @param openId 用户绑定小程序openId主键
|
||||||
|
* @return 用户绑定小程序openId
|
||||||
|
*/
|
||||||
|
public SysUserOpenid selectSysUserOpenidByOpenId(String openId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询用户绑定小程序openId列表
|
* 查询用户绑定小程序openId列表
|
||||||
*
|
*
|
||||||
|
|
|
@ -31,6 +31,16 @@ public class SysUserOpenidServiceImpl implements ISysUserOpenidService
|
||||||
return sysUserOpenidMapper.selectSysUserOpenidById(id);
|
return sysUserOpenidMapper.selectSysUserOpenidById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户绑定小程序openId
|
||||||
|
*
|
||||||
|
* @param openId 用户绑定小程序openId主键
|
||||||
|
* @return 用户绑定小程序openId
|
||||||
|
*/
|
||||||
|
public SysUserOpenid selectSysUserOpenidByOpenId(String openId) {
|
||||||
|
return sysUserOpenidMapper.selectSysUserOpenidByOpenId(openId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询用户绑定小程序openId列表
|
* 查询用户绑定小程序openId列表
|
||||||
*
|
*
|
||||||
|
|
|
@ -58,6 +58,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSysUserOpenidByOpenId" parameterType="String" resultMap="SysUserOpenidResult">
|
||||||
|
<include refid="selectSysUserOpenidVo"/>
|
||||||
|
where openId = #{openId}
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertSysUserOpenid" parameterType="SysUserOpenid" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertSysUserOpenid" parameterType="SysUserOpenid" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into sys_user_openid
|
insert into sys_user_openid
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
|
|
@ -120,7 +120,7 @@ export default {
|
||||||
// 校检文件类型
|
// 校检文件类型
|
||||||
if (this.fileType) {
|
if (this.fileType) {
|
||||||
const fileName = file.name.split('.');
|
const fileName = file.name.split('.');
|
||||||
const fileExt = fileName[fileName.length - 1];
|
const fileExt = fileName[fileName.length - 1].toLocaleLowerCase();
|
||||||
const isTypeOk = this.fileType.indexOf(fileExt) >= 0;
|
const isTypeOk = this.fileType.indexOf(fileExt) >= 0;
|
||||||
if (!isTypeOk) {
|
if (!isTypeOk) {
|
||||||
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
|
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
|
||||||
|
|
|
@ -23,12 +23,18 @@
|
||||||
<!-- 上传提示 -->
|
<!-- 上传提示 -->
|
||||||
<div class="el-upload__tip" slot="tip" v-if="showTip">
|
<div class="el-upload__tip" slot="tip" v-if="showTip">
|
||||||
请上传
|
请上传
|
||||||
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
|
<template v-if="fileSize">
|
||||||
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
|
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
|
||||||
|
</template>
|
||||||
|
<template v-if="fileType">
|
||||||
|
格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
|
||||||
|
</template>
|
||||||
的文件
|
的文件
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false"
|
<el-dialog
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:close-on-press-escape="false"
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisible"
|
||||||
title="预览"
|
title="预览"
|
||||||
width="800"
|
width="800"
|
||||||
|
@ -66,8 +72,13 @@ export default {
|
||||||
// 是否显示提示
|
// 是否显示提示
|
||||||
isShowTip: {
|
isShowTip: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true,
|
||||||
}
|
},
|
||||||
|
// 文件名是否效验
|
||||||
|
fileNameChk: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -81,7 +92,7 @@ export default {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + getToken(),
|
Authorization: "Bearer " + getToken(),
|
||||||
},
|
},
|
||||||
fileList: []
|
fileList: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -89,11 +100,11 @@ export default {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
// 首先将值转为数组
|
// 首先将值转为数组
|
||||||
const list = Array.isArray(val) ? val : this.value.split(',');
|
const list = Array.isArray(val) ? val : this.value.split(",");
|
||||||
// 然后将数组转为对象数组
|
// 然后将数组转为对象数组
|
||||||
this.fileList = list.map(item => {
|
this.fileList = list.map((item) => {
|
||||||
if (typeof item === "string") {
|
if (typeof item === "string") {
|
||||||
if (item.indexOf(this.baseUrl) === -1 && item.indexOf('http') === -1) {
|
if (item.indexOf(this.baseUrl) === -1 && item.indexOf("http") === -1) {
|
||||||
item = { name: this.baseUrl + item, url: this.baseUrl + item };
|
item = { name: this.baseUrl + item, url: this.baseUrl + item };
|
||||||
} else {
|
} else {
|
||||||
item = { name: item, url: item };
|
item = { name: item, url: item };
|
||||||
|
@ -107,8 +118,8 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
immediate: true
|
immediate: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
// 是否显示提示
|
// 是否显示提示
|
||||||
|
@ -123,10 +134,12 @@ export default {
|
||||||
if (this.fileType.length) {
|
if (this.fileType.length) {
|
||||||
let fileExtension = "";
|
let fileExtension = "";
|
||||||
if (file.name.lastIndexOf(".") > -1) {
|
if (file.name.lastIndexOf(".") > -1) {
|
||||||
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
|
fileExtension = file.name
|
||||||
|
.slice(file.name.lastIndexOf(".") + 1)
|
||||||
|
.toLocaleLowerCase();
|
||||||
}
|
}
|
||||||
isImg = this.fileType.some(type => {
|
isImg = this.fileType.some((type) => {
|
||||||
if (file.type.indexOf(type) > -1) return true;
|
if (file.type.toLocaleLowerCase().indexOf(type) > -1) return true;
|
||||||
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
|
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
@ -135,7 +148,9 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isImg) {
|
if (!isImg) {
|
||||||
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`);
|
this.$modal.msgError(
|
||||||
|
`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`
|
||||||
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.fileSize) {
|
if (this.fileSize) {
|
||||||
|
@ -145,6 +160,12 @@ export default {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(this.fileNameChk){
|
||||||
|
if (file.name.lastIndexOf("[") > -1 || file.name.lastIndexOf("]")) {
|
||||||
|
this.$modal.msgError(`文件名中不能包含英文[],请修改为中文〔〕或【】!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
this.$modal.loading("正在上传图片,请稍候...");
|
this.$modal.loading("正在上传图片,请稍候...");
|
||||||
this.number++;
|
this.number++;
|
||||||
},
|
},
|
||||||
|
@ -167,7 +188,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 删除图片
|
// 删除图片
|
||||||
handleDelete(file) {
|
handleDelete(file) {
|
||||||
const findex = this.fileList.map(f => f.name).indexOf(file.name);
|
const findex = this.fileList.map((f) => f.name).indexOf(file.name);
|
||||||
if (findex > -1) {
|
if (findex > -1) {
|
||||||
this.fileList.splice(findex, 1);
|
this.fileList.splice(findex, 1);
|
||||||
this.$emit("input", this.listToString(this.fileList));
|
this.$emit("input", this.listToString(this.fileList));
|
||||||
|
@ -202,9 +223,9 @@ export default {
|
||||||
strs += list[i].url.replace(this.baseUrl, "") + separator;
|
strs += list[i].url.replace(this.baseUrl, "") + separator;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return strs != '' ? strs.substr(0, strs.length - 1) : '';
|
return strs != "" ? strs.substr(0, strs.length - 1) : "";
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
@ -218,9 +239,9 @@ export default {
|
||||||
transition: all 0s;
|
transition: all 0s;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .el-list-enter, .el-list-leave-active {
|
::v-deep .el-list-enter,
|
||||||
|
.el-list-leave-active {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,21 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-content">
|
<div class="app-content">
|
||||||
<div>
|
<el-row>
|
||||||
</div>
|
<el-col :sm="24" :lg="24">
|
||||||
|
<el-result icon="success" title="消息授权成功">
|
||||||
|
<template slot="extra">
|
||||||
|
<el-button type="primary" size="medium" round>返回小程序</el-button>
|
||||||
|
</template>
|
||||||
|
</el-result>
|
||||||
|
</el-col>
|
||||||
|
<el-col :sm="24" :lg="24">
|
||||||
|
<el-result icon="error" title="消息授权失败" subTitle="请关注公众号并进行网页授权">
|
||||||
|
<template slot="extra">
|
||||||
|
<el-button type="primary" size="medium" round>返回小程序</el-button>
|
||||||
|
</template>
|
||||||
|
</el-result>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.ruoyi.common.constant.Constants;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.redis.RedisCache;
|
import com.ruoyi.common.core.redis.RedisCache;
|
||||||
|
import com.ruoyi.common.enums.ShiFouEnum;
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.sign.Md5Utils;
|
import com.ruoyi.common.utils.sign.Md5Utils;
|
||||||
|
@ -43,6 +44,7 @@ public class ProjectController extends BaseController {
|
||||||
@GetMapping("/findProjectByDept")
|
@GetMapping("/findProjectByDept")
|
||||||
public AjaxResult findProjectByDept(Long deptId){
|
public AjaxResult findProjectByDept(Long deptId){
|
||||||
SurProject surProject=new SurProject();
|
SurProject surProject=new SurProject();
|
||||||
|
surProject.setProgressVisible(ShiFouEnum.FOU.getCode());
|
||||||
if(deptId==-1){
|
if(deptId==-1){
|
||||||
long roleId= SecurityUtils.getRoleId();
|
long roleId= SecurityUtils.getRoleId();
|
||||||
if(5==roleId||6==roleId||7==roleId){
|
if(5==roleId||6==roleId||7==roleId){
|
||||||
|
@ -57,12 +59,12 @@ public class ProjectController extends BaseController {
|
||||||
surProject.setDeptId(deptId);
|
surProject.setDeptId(deptId);
|
||||||
}
|
}
|
||||||
List<SurProject> list=isurProjectService.selectSurProjectList(surProject);
|
List<SurProject> list=isurProjectService.selectSurProjectList(surProject);
|
||||||
for (SurProject p :list){
|
//for (SurProject p :list){
|
||||||
//DateTime dt1= DateUtil.parse(p.getScheduledStartTime());
|
//DateTime dt1= DateUtil.parse(p.getScheduledStartTime());
|
||||||
//DateTime dt2=DateUtil.parse(p.getPlannedCompletionTime());
|
//DateTime dt2=DateUtil.parse(p.getPlannedCompletionTime());
|
||||||
//long days= DateUtil.between(dt1,dt2, DateUnit.DAY);
|
//long days= DateUtil.between(dt1,dt2, DateUnit.DAY);
|
||||||
//p.setProjectTimeLimit(days);
|
//p.setProjectTimeLimit(days);
|
||||||
}
|
//}
|
||||||
return success(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,9 @@ import com.ruoyi.common.constant.CacheConstants;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.redis.RedisCache;
|
import com.ruoyi.common.core.redis.RedisCache;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.system.domain.SysUserOpenid;
|
||||||
|
import com.ruoyi.system.service.ISysUserOpenidService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import me.chanjar.weixin.common.api.WxConsts;
|
import me.chanjar.weixin.common.api.WxConsts;
|
||||||
import me.chanjar.weixin.common.exception.WxErrorException;
|
import me.chanjar.weixin.common.exception.WxErrorException;
|
||||||
|
@ -36,6 +39,9 @@ public class WxAuthController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private WxMpService wxMpService;
|
private WxMpService wxMpService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysUserOpenidService sysUserOpenidService;
|
||||||
|
|
||||||
@Anonymous
|
@Anonymous
|
||||||
@GetMapping("/auth")
|
@GetMapping("/auth")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
@ -123,4 +129,24 @@ public class WxAuthController extends BaseController {
|
||||||
response.sendRedirect(returnUrl + "&openid=" + openId);
|
response.sendRedirect(returnUrl + "&openid=" + openId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author :JiangYuQi
|
||||||
|
* @param: :
|
||||||
|
* @return: 重定向
|
||||||
|
* 获取用户信息类,最后重定向到指定url
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@GetMapping("/binding")
|
||||||
|
public AjaxResult binding(String openId,String msgOpenId) throws Exception {
|
||||||
|
/*当用户同意授权后,将小程序openId和公众号OpenId进行绑定*/
|
||||||
|
if(StringUtils.isNotBlank(openId)){
|
||||||
|
SysUserOpenid sysUserOpenid = sysUserOpenidService.selectSysUserOpenidByOpenId(openId);
|
||||||
|
if(sysUserOpenid!=null){
|
||||||
|
sysUserOpenid.setMsgOpenId(msgOpenId);
|
||||||
|
return toAjax(sysUserOpenidService.updateSysUserOpenid(sysUserOpenid));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return error();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<!--普通用户查询项目人员-->
|
<!--普通用户查询项目人员-->
|
||||||
<if test='nowRole == "15" or nowRole == "16" or nowRole == "17" or nowRole == "99"'> left join sur_project_userinfo spu on spu.project_id = sp.id</if>
|
<if test='nowRole == "15" or nowRole == "16" or nowRole == "17" or nowRole == "99"'> left join sur_project_userinfo spu on spu.project_id = sp.id</if>
|
||||||
<where>
|
<where>
|
||||||
sp.isDel = 0 and sp.progressVisible=0
|
sp.isDel = 0
|
||||||
<if test="deptId != null "> and sp.deptId like concat('%', #{deptId}, '%')</if>
|
<if test="deptId != null "> and sp.deptId like concat('%', #{deptId}, '%')</if>
|
||||||
<if test="projectName != null and projectName != ''"> and sp.projectName like concat('%', #{projectName}, '%')</if>
|
<if test="projectName != null and projectName != ''"> and sp.projectName like concat('%', #{projectName}, '%')</if>
|
||||||
<if test="projectCode != null and projectCode != ''"> and sp.projectCode = #{projectCode}</if>
|
<if test="projectCode != null and projectCode != ''"> and sp.projectCode = #{projectCode}</if>
|
||||||
|
@ -79,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="projiectLevel != null and projiectLevel != ''"> and sp.projiectLevel = #{projiectLevel}</if>
|
<if test="projiectLevel != null and projiectLevel != ''"> and sp.projiectLevel = #{projiectLevel}</if>
|
||||||
<if test="projectRegional != null and projectRegional != ''"> and sp.projectRegional = #{projectRegional}</if>
|
<if test="projectRegional != null and projectRegional != ''"> and sp.projectRegional = #{projectRegional}</if>
|
||||||
<if test="projectAddress != null and projectAddress != ''"> and sp.projectAddress = #{projectAddress}</if>
|
<if test="projectAddress != null and projectAddress != ''"> and sp.projectAddress = #{projectAddress}</if>
|
||||||
|
<if test="progressVisible != null and progressVisible != ''"> and sp.progressVisible = #{progressVisible}</if>
|
||||||
<if test="projectNature != null and projectNature != ''"> and sp.projectNature = #{projectNature}</if>
|
<if test="projectNature != null and projectNature != ''"> and sp.projectNature = #{projectNature}</if>
|
||||||
<if test="licenceNumber != null and licenceNumber != ''"> and sp.licenceNumber = #{licenceNumber}</if>
|
<if test="licenceNumber != null and licenceNumber != ''"> and sp.licenceNumber = #{licenceNumber}</if>
|
||||||
<if test="projectApproval != null and projectApproval != ''"> and sp.projectApproval = #{projectApproval}</if>
|
<if test="projectApproval != null and projectApproval != ''"> and sp.projectApproval = #{projectApproval}</if>
|
||||||
|
|
Loading…
Reference in New Issue