Commit 764c44f2 authored by yht15023815643's avatar yht15023815643

Merge branch 'zuhuduan' of http://192.168.60.201/root/dsk-operate-sys into zuhuduan

parents 69611ed1 8690ea02
......@@ -5,7 +5,6 @@ import cn.hutool.captcha.AbstractCaptcha;
import cn.hutool.captcha.generator.CodeGenerator;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.RandomUtil;
import com.dsk.common.constant.CacheConstants;
import com.dsk.common.constant.Constants;
import com.dsk.common.constant.GlobalConstants;
import com.dsk.common.core.domain.R;
......@@ -13,8 +12,6 @@ import com.dsk.common.enums.CaptchaType;
import com.dsk.common.exception.user.CaptchaException;
import com.dsk.common.exception.user.CaptchaExpireException;
import com.dsk.common.helper.LoginHelper;
import com.dsk.common.utils.DingTalkUtil;
import com.dsk.common.utils.MessageUtils;
import com.dsk.common.utils.StringUtils;
import com.dsk.common.utils.email.MailUtils;
import com.dsk.common.utils.redis.RedisUtils;
......@@ -82,14 +79,13 @@ public class CaptchaController {
// 验证码模板id 自行处理 (查数据库或写死均可)
LinkedHashMap<String, String> map = new LinkedHashMap<>(1);
map.put("code", code);
// SmsBlend smsBlend = SmsFactory.createSmsBlend(SupplierType.ALIBABA);
// SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, templateId, map);
// if (!"OK".equals(smsResponse.getCode())) {
// log.error("验证码短信发送异常 => {}", smsResponse);
// return R.fail(smsResponse.getMessage());
// }
DingTalkUtil.sendDingTalkMsg("短信通知:"+phonenumber+"登录验证码:"+code+",请尽快输入验证码完成验证,勿将验证码透露给他人,如非本人操作,请忽略本条短信。");
SmsBlend smsBlend = SmsFactory.createSmsBlend(SupplierType.ALIBABA);
SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, templateId, map);
if (!"OK".equals(smsResponse.getCode())) {
log.error("验证码短信发送异常 => {}", smsResponse);
return R.fail(smsResponse.getMessage());
}
//DingTalkUtil.sendDingTalkMsg("短信通知:"+phonenumber+"登录验证码:"+code+",请尽快输入验证码完成验证,勿将验证码透露给他人,如非本人操作,请忽略本条短信。");
return R.ok();
}
......@@ -108,19 +104,30 @@ public class CaptchaController {
}
/**
* 开发需要,临时发送短信验证码
* 发送短信验证码
*/
@GetMapping("/getTempSmsCode")
public R<Void> getTempSmsCode() {
SysUser sysUser = userMapper.selectUserById(LoginHelper.getUserId());
String key = GlobalConstants.CAPTCHA_CODE_KEY + sysUser.getPhonenumber();
String phonenumber = sysUser.getPhonenumber();
String key = GlobalConstants.CAPTCHA_CODE_KEY + phonenumber;
String code = RandomUtil.randomNumbers(6);
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
return R.ok("验证码:" + code);
// 验证码模板id 自行处理 (查数据库或写死均可)
LinkedHashMap<String, String> map = new LinkedHashMap<>(1);
map.put("code", code);
SmsBlend smsBlend = SmsFactory.createSmsBlend(SupplierType.ALIBABA);
SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, "SMS_181860796", map);
if (!"OK".equals(smsResponse.getCode())) {
log.error("验证码短信发送异常 => {}", smsResponse);
return R.fail(smsResponse.getMessage());
}
//DingTalkUtil.sendDingTalkMsg("短信通知:"+phonenumber+"登录验证码:"+code+",请尽快输入验证码完成验证,勿将验证码透露给他人,如非本人操作,请忽略本条短信。");
return R.ok();
}
/**
* 开发需要,临时校验短信验证码
* 校验短信验证码
*
* @param smsCode 验证码
*/
......
package com.dsk.web.controller.system;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.R;
import com.dsk.system.domain.SysRegion;
import com.dsk.system.service.SysRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 地区信息
*
* @author lcl
* @create 2023/6/28
*/
@RestController
@RequestMapping("/system/region")
public class SysRegionController extends BaseController {
@Autowired
private SysRegionService baseService;
/**
* 通过父id获取下级地区信息
*/
@GetMapping("/list/{parentId}")
public R<List<SysRegion>> listByParentId(@PathVariable Integer parentId) {
return R.ok(baseService.selectByParentId(parentId));
}
}
......@@ -37,10 +37,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 用户信息
......@@ -81,7 +78,7 @@ public class SysUserController extends BaseController {
SysUserExportVo vo = listVo.get(i);
if (ObjectUtil.isNotEmpty(dept)) {
vo.setDeptName(dept.getDeptName());
vo.setLeader(dept.getLeader());
//vo.setLeader(dept.getLeader());
}
}
ExcelUtil.exportExcel(listVo, "用户数据", SysUserExportVo.class, response);
......@@ -209,7 +206,7 @@ public class SysUserController extends BaseController {
public R<Void> resetPwd(@RequestBody SysUser user) {
userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId());
user.setPassword(BCrypt.hashpw(user.getPassword()));
user.setPassword(BCrypt.hashpw(new String(Base64.getDecoder().decode(user.getPassword()))));
return toAjax(userService.resetPwd(user));
}
......
......@@ -23,7 +23,7 @@ public class TenantTimerTask {
/**
* 每6小时扫描并禁用已过期租户账号
*/
@Scheduled(cron = "0 0 0/6 * * ?")
@Scheduled(cron = "0 0/10 * * * ? ")
public void updateExpiredTenantStatus() {
log.info("执行定时禁用已过期租户账号(6h/次)");
TenantHelper.ignore(tenantService::handleExpiredTenant);
......
......@@ -157,6 +157,7 @@ tenant:
- sys_user_post
- sys_user_role
- sys_client
- sys_region
- contact_info
- customer_user
- customer_follow_record
......
......@@ -9,7 +9,8 @@ import java.util.Arrays;
*
* @author dsk
*/
public class InvalidExtensionException extends FileUploadException
//public class InvalidExtensionException extends FileUploadException
public class InvalidExtensionException extends RuntimeException
{
private static final long serialVersionUID = 1L;
......
......@@ -61,7 +61,7 @@ public class CustomerServiceImpl implements ICustomerService {
dto.setUserId(LoginHelper.getUserId());
dto.setStatus(ObjectUtils.isEmpty(dto.getStatus()) ? 0 : dto.getStatus());
final TableDataInfo<CustomerListVo> result = TableDataInfo.build(baseMapper.selectList(pageQuery.build(), dto));
if(!ObjectUtils.isEmpty(result.getRows()) && !ObjectUtils.isEmpty(dto.getCompanyName())){
if (!ObjectUtils.isEmpty(result.getRows()) && !ObjectUtils.isEmpty(dto.getCompanyName())) {
for (CustomerListVo vo : result.getRows()) {
vo.setCompanyName(StringUtils.markInRed(vo.getCompanyName(), dto.getCompanyName()));
}
......@@ -121,7 +121,7 @@ public class CustomerServiceImpl implements ICustomerService {
public TableDataInfo<CustomerBusinessListVo> selectBusinessList(CustomerBusinessSearchDto dto, PageQuery pageQuery) {
if (ObjectUtils.isEmpty(dto.getCustomerId())) throw new BeanException("客户id不能为空");
dto.setUserId(LoginHelper.getUserId());
return businessInfoService.selectCustomerBusinessList(dto,pageQuery);
return businessInfoService.selectCustomerBusinessList(dto, pageQuery);
}
@Override
......@@ -197,7 +197,14 @@ public class CustomerServiceImpl implements ICustomerService {
customer.setLegalPerson(MapUtil.getStr(data, "legalPerson"));
}
if (ObjectUtils.isEmpty(customer.getRegisterCapital())) {
customer.setRegisterCapital(MapUtil.getStr(data, "registeredCapitalStr"));
String registeredCapitalStr = MapUtil.getStr(data, "registeredCapitalStr");
if (!ObjectUtils.isEmpty(registeredCapitalStr)) {
int length = registeredCapitalStr.indexOf(".0");
if (length == registeredCapitalStr.length() - 2) {
registeredCapitalStr = registeredCapitalStr.replace(".0", "");
}
}
customer.setRegisterCapital(registeredCapitalStr);
}
if (ObjectUtils.isEmpty(customer.getProvinceId())) {
customer.setProvinceId(MapUtil.getInt(data, "provinceId"));
......@@ -213,11 +220,11 @@ public class CustomerServiceImpl implements ICustomerService {
customer.setRegisterAddress(MapUtil.getStr(data, "domicile"));
} else {
String address = null;
if (ObjectUtils.isEmpty(MapUtil.getStr(data, "province"))) {
if (!ObjectUtils.isEmpty(MapUtil.getStr(data, "province"))) {
address = MapUtil.getStr(data, "province");
if (ObjectUtils.isEmpty(MapUtil.getStr(data, "city"))) {
if (!ObjectUtils.isEmpty(MapUtil.getStr(data, "city"))) {
address = address.concat("-").concat(MapUtil.getStr(data, "city"));
if (ObjectUtils.isEmpty(MapUtil.getStr(data, "county"))) {
if (!ObjectUtils.isEmpty(MapUtil.getStr(data, "county"))) {
address = address.concat("-").concat(MapUtil.getStr(data, "county"));
}
}
......
......@@ -316,10 +316,9 @@
</delete>
<delete id="deleteBusinessInfoByIds" parameterType="Long">
delete i,b,co,f,l,r,u
delete i,b,f,l,r,u
from business_info i
left join business_backlog b on b.business_id = i.id
left join business_contacts co on co.business_id = i.id
left join business_follow_record f on f.business_id = i.id
left join business_label l on l.business_id = i.id
left join business_relate_company r on r.business_id = i.id
......
/*
*
* 1、url地址,如企业详情:https://pre-plug.jiansheku.com/enterprise?ak=aec7b3ff2y2q8x6t49a7e2c463ce21912&uid=a704fb35bca54707b9b5f8c9bba57815(ak:平台唯一标识;uid:用户标识)
* 1、url地址,如正式环境企业详情:https://plug.jiansheku.com/enterprise/56546856314e567a69?ak=bc8e534da5ea40639b2f084919280a82&initTime=1694507179060&uid=4a3b4bfdfbca4bff9d9bd7c8fd42f533(ak:接口获得的accesToken;initTime:获得accesToken时的时间戳;uid:用户标识)
*
* */
const steerScroll = function(iframeId, navigation, state, parentId) { // state:监听or移除监听;navigation:页面排除iframe后剩下高度;iframeId: iframe的id
const steerScroll = function(iframeId, navigation, footHeight, state, parentId, _this) { // iframeId: iframe的id;navigation:页面排除iframe后剩下的顶部高度;footHeight: 页面排除iframe后剩下的底部高度;state:监听or移除监听;parentId: 父级id[不带默认就是铺满整个页面]];_this:指向当前实例(可忽略)
let dom = window
if (parentId) { // 默认页面可以滚动
dom = document.getElementById(parentId)
......@@ -22,7 +22,12 @@ const steerScroll = function(iframeId, navigation, state, parentId) { // state:
// 动态设置iFrame高度
if (data.height) {
document.getElementById(iframeId).style.height = data.height + 'px'
scrolling(iframeId, navigation, parentId) // 初始加载获取滚动条距离顶部高度
scrolling(iframeId, navigation, footHeight, parentId) // 初始加载获取滚动条距离顶部高度
}
// 插件当前路由
if (_this && data.currentPath) {
_this.currentRoute = data
_this.searchFlag = data.currentName.includes('search-') ? true : false
}
// 点击企业详情页 栏目名动态设置滚动高度
if (data.scrollHeight) {
......@@ -48,23 +53,35 @@ const steerScroll = function(iframeId, navigation, state, parentId) { // state:
}
})
dom.addEventListener('scroll', (event) => {
scrolling(iframeId, navigation, parentId)
scrolling(iframeId, navigation, footHeight, parentId)
})
} else {
dom.removeEventListener('scroll', (event) => {
scrolling(iframeId, navigation, parentId)
scrolling(iframeId, navigation, footHeight, parentId)
})
}
}
const scrolling = function(iframeId, navigation, parentId) {
const scrolling = function(iframeId, navigation, footHeight, parentId) {
// 滚动条距文档顶部的距离
let scrollTop = parentId ? document.getElementById(parentId).scrollTop : window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
// 将滚动距离传入子组件
const ifa = document.getElementById(iframeId)
scrollTop = scrollTop + navigation.totalHeight
const bodyHeight = document.body.clientHeight - navigation.totalHeight
ifa.contentWindow.postMessage({ 'scrollTop': scrollTop, 'navHeight': navigation.totalHeight, 'bodyHeight': bodyHeight }, '*')
let rippleHeight = 0 //插件筛选条件浮动层距离底部距离
let scrollGap = parentId ? document.getElementById(parentId).scrollTop : window.scrollTop || document.body.scrollTop || document.documentElement.scrollTop
let scrollHeight = parentId ? document.getElementById(parentId).offsetHeight : window.scrollHeight || document.body.scrollHeight || document.documentElement.scrollHeight
let domHeight = parentId ? document.getElementById(parentId).clientHeight : window.clientHeight || document.body.clientHeight || document.documentElement.clientHeight
if(parentId){ //网页内部嵌套时
rippleHeight = scrollHeight-scrollGap-domHeight
}else{ //
if(scrollHeight-scrollGap-domHeight <= footHeight){
rippleHeight = 0
}else{
rippleHeight = scrollHeight-scrollGap-domHeight - footHeight
}
}
ifa.contentWindow.postMessage({ 'scrollTop': scrollTop, 'navHeight': navigation.totalHeight, 'rippleHeight': rippleHeight }, '*')
}
export {
......
......@@ -101,8 +101,10 @@ export default {
const index = val.path.indexOf('/', val.path.indexOf('/') + 1)
const parentPath = val.path.slice(0, index)
const currentRoute = this.$router.options.routes.find(item => item.path === parentPath)
currentIcon = currentRoute.meta && currentRoute.meta.icon
icon = this.isActive(val) ? currentIcon+'Tags' : currentIcon+'Tag'
if(currentRoute){
currentIcon = currentRoute.meta && currentRoute.meta.icon
icon = this.isActive(val) ? currentIcon+'Tags' : currentIcon+'Tag'
}
}
icon = (svgIcon && svgIcon != '#') || (currentIcon && svgIcon != '#') ? icon : this.isActive(val) ? 'defaultTags' : 'defaultTag'
return `#icon-${icon}`
......
......@@ -467,7 +467,7 @@
params.cityIds=cityCode
}
if(countyCode.length > 0){
params.areaIds=countyCode
params.districtIds=countyCode
}
}else {
if(params.provinceIds){
......@@ -476,8 +476,8 @@
if(params.cityIds){
delete params.cityIds
}
if(params.areaIds){
delete params.areaIds
if(params.districtIds){
delete params.districtIds
}
}
......
......@@ -60,7 +60,6 @@
this.details=res.data;
})
infoMemberCount({combineId: this.customerId}).then(res=>{
console.log(res.data)
if(res.code==200){
this.statisticObj = res.data
}
......
......@@ -5,8 +5,10 @@
</template>
<script>
import { steerScroll } from '@/assets/js/jskplug'
export default {
import { steerScroll } from '@/assets/js/jskplug'
import { dskAccessToken } from '@/api/common'
export default {
name: 'Company',
components: {
......@@ -18,29 +20,17 @@ export default {
iframeHight: window.innerHeight, // iframe高度-当前页控制
navigation: {isFixed: true, fixedHeight: 56, totalHeight: 68}, // iframe之外页面顶部对象,ifFixed:是否浮动;fixedHeight:浮动对象高度;totalHeight:顶部整体高度
src: '', //iframe嵌套页面地址
domain: 'https://pre-plug.jiansheku.com',
domain: 'https://plug.jiansheku.com', // 插件地址
// domain: 'http://192.168.60.19:3400',
// domain: 'http://192.168.60.30:3300',
ak: 'aec7b3ff2y2q8x6t49a7e2c463ce21912' // 需要携带的sdkId
ak: 'aec7b3ff2y2q8x6t49a7e2c463ce21912', // 需要携带的sdkId
uid: this.$store.state.user.userId, // 需要携带的uid
timelongs:7200,//刷新token时间
tokentimer:null,
}
},
created() {
if (this.$route.params.id) { // 获取companyId
this.loading = true
if(this.$route.name=='Company'){ //企业详情
if(this.$route.query.html){
if(this.$route.query.type){
this.src = `${this.domain}/enterprise/${this.$route.params.id}/${this.$route.query.html}?flag=true&type=${this.$route.query.type}&ak=${this.ak}`
}else{
this.src = `${this.domain}/enterprise/${this.$route.params.id}/${this.$route.query.html}?ak=${this.ak}`
}
}else{
this.src = `${this.domain}/enterprise/${this.$route.params.id}?ak=${this.ak}`
}
}
if(this.$route.name=='Personnel'){ //人员详情
this.src = `${this.domain}/personnel/${this.$route.params.id}.html?ak=${this.ak}`
}
}
this.gettokens()
},
mounted() {
this.iframeLoading() // 判断iframe页面是否加载完成-当前页控制
......@@ -49,8 +39,53 @@ export default {
beforeDestroy() {
clearInterval(this.iframeTimer) // -当前页控制
steerScroll('companyIframe', this.navigation) // 销毁滚动
clearInterval(this.tokentimer)
},
methods: {
gettokens(){
dskAccessToken().then(res=>{
if(res.code == 200){
this.timelongs = res.data.expire
this.ak = res.data.accessToken
if (this.$route.params.id) { // 获取companyId
this.loading = true
if(this.$route.name=='Company'){ //企业详情
if(this.$route.query.html){
if(this.$route.query.type){
this.src = `${this.domain}/enterprise/${this.$route.params.id}/${this.$route.query.html}?flag=true&type=${this.$route.query.type}&ak=${this.ak}&initTime=${new Date().getTime()}&uid=${this.ak}`
}else{
this.src = `${this.domain}/enterprise/${this.$route.params.id}/${this.$route.query.html}?ak=${this.ak}&initTime=${new Date().getTime()}&uid=${this.ak}`
}
}else{
this.src = `${this.domain}/enterprise/${this.$route.params.id}?ak=${this.ak}&initTime=${new Date().getTime()}&uid=${this.ak}`
}
}
if(this.$route.name=='Personnel'){ //人员详情
this.src = `${this.domain}/personnel/${this.$route.params.id}.html?ak=${this.ak}&initTime=${new Date().getTime()}&uid=${this.ak}`
}
}
this.refreshtoken()
}else{
clearTimeout(this.tokentimer)
}
})
},
refreshtoken(){
this.tokentimer = setTimeout(()=>{
dskAccessToken().then(res => {
if (res.code == 200) {
this.timelongs = res.data.expire
this.ak = res.data.accessToken
let ifam = document.getElementById('companyIframe') //iframe的id
let akObj = res.data.expire //accessToken接口的返回值
let initTime = new Date().getTime() //accessToken接口返回后的当前时间戳
ifam.contentWindow.postMessage({ 'accessToken': akObj.accessToken, 'initTime': initTime }, '*')
}else{
clearTimeout(this.tokentimer)
}
})
}, this.timelongs*1000)
},
//判断iframe页面是否加载完成-当前页控制
iframeLoading() {
let iframeHeight = document.getElementById("companyIframe").clientHeight, number = 0
......
......@@ -377,13 +377,13 @@ export default {
return this.$message.warning("抱歉,没找到相关数据,建议调整关键词或筛选条件,重新搜索")
}
let item = this.searchList[0]
this.$router.push({path:`/groupAccount/${item.combineId}?name=${item.combineName.replace(new RegExp("<font color='#FF204E'>", 'g'),'').replace(new RegExp("</font>", 'g'),'')}&cid=${item.combineMemberCid}`})
this.$router.push({path:`/groupAccount/${item.combineId}?name=${item.combineName.replace(new RegExp("<font color='#FF204E'>", 'g'),'').replace(new RegExp("</font>", 'g'),'')}`})
},
selCompany(item = this.searchList[0]){
if(!item){
return this.$message.warning("抱歉,没找到相关数据,建议调整关键词或筛选条件,重新搜索")
}
this.$router.push({path:`/groupAccount/${item.combineId}?name=${item.combineName.replace(new RegExp("<font color='#FF204E'>", 'g'),'').replace(new RegExp("</font>", 'g'),'')}&cid=${item.combineMemberCid}`})
this.$router.push({path:`/groupAccount/${item.combineId}?name=${item.combineName.replace(new RegExp("<font color='#FF204E'>", 'g'),'').replace(new RegExp("</font>", 'g'),'')}`})
},
}
}
......
......@@ -132,7 +132,7 @@
@pagination="getList"
/>
<!-- 添加或修改角色配置对话框 -->
<!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
......
......@@ -142,7 +142,7 @@
></el-tree>
</el-form-item>
<el-form-item label="备注">
<el-input :disabled="disabled" v-model="form.remark" maxlength="50" type="textarea" placeholder="请输入内容"></el-input>
<el-input :disabled="disabled" v-model="form.remark" maxlength="50" type="textarea" placeholder="请输入文字(50字以内)"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer" v-if="!disabled">
......
......@@ -186,6 +186,11 @@
</el-tab-pane>
<el-tab-pane label="大项目最新招标" name="second">
<skeleton v-if="zhaobiaoIsSkeleton" style="padding: 16px"></skeleton>
<div class="empty" v-if="zbList.length === 0 && !zhaobiaoIsSkeleton">
<img class="img" src="@/assets/images/project/empty.png">
<div class="p1">抱歉,没找到相关数据</div>
</div>
<div v-if="!zhaobiaoIsSkeleton" class="list">
<div class="item" v-for="(item,index) in zbList" :key="index">
<p class="list-title"><router-link :to="`/radar/Notice/details/${item.id}`" tag="a" class="a-link" v-if="item.id" v-html="item.projectName"></router-link></p>
......
......@@ -45,7 +45,7 @@
<img class="img" slot="prefix" src="../assets/images/validCode.png"/>
</el-input>
<div class="login-code">
<div class="hqyzm" @click="getsms">{{smstitle}}</div>
<div class="hqyzm" @click="getsms" :class="{'disableds':smstitle!='获取验证码'}">{{smstitle}}</div>
</div>
</el-form-item>
<el-form-item style="width:100%;margin-top: 42px">
......@@ -151,7 +151,7 @@
<img class="img" slot="prefix" src="../assets/images/validCode.png"/>
</el-input>
<div class="login-code">
<div class="hqyzm" @click="getsms">{{smstitle}}</div>
<div class="hqyzm" @click="getsms" :class="{'disableds':smstitle!='获取验证码'}">{{smstitle}}</div>
</div>
</el-form-item>
<el-form-item style="width:100%;margin-top: 42px">
......@@ -280,7 +280,7 @@
_this.smstitle = _this.smstime +'秒后重试'
_this.smstime--;
if(_this.smstime <= 0){
_this.smstitle = '发送验证码'
_this.smstitle = '获取验证码'
clearInterval(_this.timers)
_this.nosend = false
}
......@@ -529,11 +529,14 @@
border-radius: 4px;
border: 1px solid #EFEFEF;
text-align: center;
color: rgba(35, 35, 35, 0.40);
color: rgba(35, 35, 35, 0.80);
font-size: 14px;
cursor: pointer;
line-height: 48px;
}
.disableds{
color: rgba(35, 35, 35, 0.40);
}
}
.el-login-footer {
height: 40px;
......
......@@ -122,6 +122,7 @@
created(){
this.getList()
this.getCount()
console.log(777)
},
methods:{
getCount(){
......@@ -190,11 +191,11 @@
if(result.code == 200){
this.$message.success('修改成功!')
this.getList()
this.getCount()
}else{
this.$message.error(result.msg)
}
})
this.getCount()
},
getYQ(){
let state = this.searchPram.state
......@@ -206,6 +207,9 @@
</script>
<style lang="scss" scoped>
.app-container{
background: #fff;
}
.records{
.tasklist{
.select{
......
......@@ -370,6 +370,10 @@
<font color="red">导入失败</font>
</template>
</el-table-column>
<el-table-column
prop="deptName"
label="所属组织">
</el-table-column>
<el-table-column
prop="nickName"
label="用户昵称">
......
package com.dsk.system.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* 行政区编码表(SysRegion)实体类
*
* @author makejava
* @since 2023-06-28 11:23:12
*/
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("sys_region")
public class SysRegion implements Serializable {
private static final long serialVersionUID = -17128129449360485L;
/**
* 行政区编码(数字型)
*/
private Integer id;
/**
* 行政区名称
*/
private String regionName;
/**
* 行政区名称(最新)
*/
private String fullName;
/**
* 行政区简称
*/
private String nameSimple;
/**
* 行政区编码(字符型)
*/
private String regionCode;
/**
* 行政区等级:1:省级,2:地市,3:区县,4:乡镇,
*/
private Integer regionLevel;
/**
* 父级id
*/
private Integer parentId;
/**
* 行政区类型:0:其他,1:省,2:直辖市,3:特别行政区,4:自治区
*/
private Integer regionType;
/**
* 权重
*/
private Integer weight;
/**
* 备注
*/
private String remark;
/**
* 0:开启,1:准备中,2:关闭
*/
private Integer status;
private Date createTime;
private Date updateTime;
private Integer updateId;
}
......@@ -5,10 +5,9 @@ import com.dsk.common.annotation.Sensitive;
import com.dsk.common.constant.UserConstants;
import com.dsk.common.enums.SensitiveStrategy;
import com.dsk.common.tenant.core.TenantEntity;
import com.dsk.common.xss.Xss;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.dsk.common.core.domain.BaseEntity;
import com.dsk.common.xss.Xss;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
......@@ -129,6 +128,11 @@ public class SysUser extends TenantEntity {
*/
private String remark;
/**
* 创建时间
*/
private Date createTime;
/**
* 部门对象
*/
......@@ -159,6 +163,7 @@ public class SysUser extends TenantEntity {
@TableField(exist = false)
private Long roleId;
public SysUser(Long userId) {
this.userId = userId;
}
......
package com.dsk.system.domain.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.dsk.common.annotation.ExcelDictFormat;
import com.dsk.common.convert.ExcelDictConvert;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -20,29 +19,29 @@ import java.util.Date;
public class SysUserExportVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 用户ID
*/
@ExcelProperty(value = "用户序号")
private Long userId;
/**
* 用户账号
*/
@ExcelProperty(value = "登录名称")
private String userName;
///**
// * 用户ID
// */
//@ExcelProperty(value = "用户序号")
//private Long userId;
//
///**
// * 用户账号
// */
//@ExcelProperty(value = "登录名称")
//private String userName;
/**
* 用户昵称
*/
@ExcelProperty(value = "用户称")
@ExcelProperty(value = "用户称")
private String nickName;
/**
* 用户邮箱
*/
@ExcelProperty(value = "用户邮箱")
private String email;
///**
// * 用户邮箱
// */
//@ExcelProperty(value = "用户邮箱")
//private String email;
/**
* 手机号码
......@@ -50,42 +49,50 @@ public class SysUserExportVo implements Serializable {
@ExcelProperty(value = "手机号码")
private String phonenumber;
/**
* 用户性别
*/
@ExcelProperty(value = "用户性别", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "sys_user_sex")
private String sex;
/**
* 帐号状态(0正常 1停用)
*/
@ExcelProperty(value = "帐号状态", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "sys_normal_disable")
private String status;
/**
* 最后登录IP
*/
@ExcelProperty(value = "最后登录IP")
private String loginIp;
/**
* 最后登录时间
*/
@ExcelProperty(value = "最后登录时间")
private Date loginDate;
///**
// * 用户性别
// */
//@ExcelProperty(value = "用户性别", converter = ExcelDictConvert.class)
//@ExcelDictFormat(dictType = "sys_user_sex")
//private String sex;
//
///**
// * 帐号状态(0正常 1停用)
// */
//@ExcelProperty(value = "帐号状态", converter = ExcelDictConvert.class)
//@ExcelDictFormat(dictType = "sys_normal_disable")
//private String status;
//
///**
// * 最后登录IP
// */
//@ExcelProperty(value = "最后登录IP")
//private String loginIp;
//
///**
// * 最后登录时间
// */
//@ExcelProperty(value = "最后登录时间")
//private Date loginDate;
/**
* 部门名称
*/
@ExcelProperty(value = "部门名称")
@ExcelProperty(value = "组织名称")
private String deptName;
///**
// * 负责人
// */
//@ExcelProperty(value = "部门负责人")
//private String leader;
/**
* 负责人
* 创建时间
*/
@ExcelProperty(value = "部门负责人")
private String leader;
@ExcelProperty(value = "创建时间")
@ColumnWidth(value = 25) // 列宽
private Date createTime;
}
package com.dsk.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.system.domain.SysRegion;
import org.apache.ibatis.annotations.Mapper;
/**
* 行政区编码表(SysRegion)表数据库访问层
*
* @author makejava
* @since 2023-06-28 11:23:13
*/
@Mapper
public interface SysRegionMapper extends BaseMapper<SysRegion> {
}
package com.dsk.system.service;
import com.dsk.system.domain.SysRegion;
import java.util.List;
/**
* 行政区编码表(SysRegion)表服务接口
*
* @author makejava
* @since 2023-06-28 11:23:12
*/
public interface SysRegionService {
List<SysRegion> selectByParentId(Integer parentId);
}
......@@ -16,7 +16,6 @@ import com.dsk.common.core.domain.entity.SysDictData;
import com.dsk.common.core.domain.entity.SysDictType;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.exception.ServiceException;
import com.dsk.common.utils.DingTalkUtil;
import com.dsk.common.utils.PasswordUtils;
import com.dsk.common.utils.StringUtils;
import com.dsk.system.domain.*;
......@@ -25,15 +24,17 @@ import com.dsk.system.domain.vo.SysTenantVo;
import com.dsk.system.mapper.*;
import com.dsk.system.service.ISysTenantService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.sms4j.api.SmsBlend;
import org.dromara.sms4j.api.entity.SmsResponse;
import org.dromara.sms4j.core.factory.SmsFactory;
import org.dromara.sms4j.provider.enumerate.SupplierType;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.*;
/**
* 企业Service业务层处理
......@@ -43,6 +44,7 @@ import java.util.List;
*/
@RequiredArgsConstructor
@Service
@Slf4j
public class ISysTenantServiceImpl implements ISysTenantService {
private final SysTenantMapper baseMapper;
......@@ -229,21 +231,32 @@ public class ISysTenantServiceImpl implements ISysTenantService {
dictDataMapper.insertBatch(dictDataList);
List<SysConfig> sysConfigList = configMapper.selectList(
new LambdaQueryWrapper<SysConfig>().eq(SysConfig::getTenantId, defaultTenantId));
new LambdaQueryWrapper<SysConfig>()
.eq(SysConfig::getTenantId, defaultTenantId)
.eq(SysConfig::getConfigType, "Y"));
for (SysConfig config : sysConfigList) {
config.setConfigId(null);
config.setTenantId(tenantId);
}
configMapper.insertBatch(sysConfigList);
////此处暂用钉钉机器人模拟发送短信
//String content = "【短信通知】:"
// + bo.getContactUserName()
// + ",您好,您已经成功开通数字化经营管理系统,请使用手机号码登录,初始密码为"
// + password
// + "。友情提示:为了您的账号安全,请勿泄露密码。";
//DingTalkUtil.sendDingTalkMsg(content);
//租户新增成功,发送短信通知租户
//此处暂用钉钉机器人模拟发送短信
String content = "【短信通知】:"
+ bo.getContactUserName()
+ ",您好,您已经成功开通数字化经营管理系统,请使用手机号码登录,初始密码为"
+ password
+ "。友情提示:为了您的账号安全,请勿泄露密码。";
DingTalkUtil.sendDingTalkMsg(content);
LinkedHashMap<String, String> map = new LinkedHashMap<>(1);
map.put("company", bo.getContactUserName());
map.put("pwd", password);
SmsBlend smsBlend = SmsFactory.createSmsBlend(SupplierType.ALIBABA);
SmsResponse smsResponse = smsBlend.sendMessage(bo.getContactPhone(), "SMS_463175230", map);
if (!"OK".equals(smsResponse.getCode())) {
log.error("新增租户通知短信发送异常 => {}", smsResponse);
}
return true;
}
......
package com.dsk.system.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsk.system.domain.SysRegion;
import com.dsk.system.mapper.SysRegionMapper;
import com.dsk.system.service.SysRegionService;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.util.List;
/**
* 行政区编码表(SysRegion)表服务实现类
*
* @author makejava
* @since 2023-06-28 11:23:12
*/
@Service("sysRegionService")
public class SysRegionServiceImpl implements SysRegionService {
@Resource
private SysRegionMapper baseMapper;
private static final Integer ACQUIESCE_PARENT_ID = 100000;
@Override
public List<SysRegion> selectByParentId(Integer parentId) {
return baseMapper.selectList(Wrappers.<SysRegion>lambdaQuery()
.eq(SysRegion::getParentId, ObjectUtils.isEmpty(parentId) ? ACQUIESCE_PARENT_ID : parentId)
.orderByAsc(SysRegion::getId));
}
}
......@@ -18,7 +18,6 @@ import com.dsk.common.core.service.UserService;
import com.dsk.common.exception.ServiceException;
import com.dsk.common.helper.DataBaseHelper;
import com.dsk.common.helper.LoginHelper;
import com.dsk.common.utils.DingTalkUtil;
import com.dsk.common.utils.PasswordUtils;
import com.dsk.common.utils.StreamUtils;
import com.dsk.common.utils.StringUtils;
......@@ -27,11 +26,16 @@ import com.dsk.system.mapper.*;
import com.dsk.system.service.ISysUserService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.sms4j.api.SmsBlend;
import org.dromara.sms4j.api.entity.SmsResponse;
import org.dromara.sms4j.core.factory.SmsFactory;
import org.dromara.sms4j.provider.enumerate.SupplierType;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
......@@ -273,13 +277,23 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
// 新增用户信息
int rows = baseMapper.insert(user);
if (rows > 0) {
//租户新增成功,发送短信通知租户
//此处暂用钉钉机器人模拟发送短信
String content = "短信通知:"+user.getNickName()
+ "您好,您已经成功开通数字化经营管理系统,请使用手机号码登录,初始密码为"
+ password
+ "。友情提示:为了您的账号安全,请勿泄露密码。";
DingTalkUtil.sendDingTalkMsg(content);
//String content = "短信通知:"+user.getNickName()
// + "您好,您已经成功开通数字化经营管理系统,请使用手机号码登录,初始密码为"
// + password
// + "。友情提示:为了您的账号安全,请勿泄露密码。";
//DingTalkUtil.sendDingTalkMsg(content);
//租户新增成功,发送短信通知租户
LinkedHashMap<String, String> map = new LinkedHashMap<>(1);
map.put("company", user.getNickName());
map.put("pwd",password);
SmsBlend smsBlend = SmsFactory.createSmsBlend(SupplierType.ALIBABA);
SmsResponse smsResponse = smsBlend.sendMessage(user.getPhonenumber(), "SMS_463175230", map);
if (!"OK".equals(smsResponse.getCode())) {
log.error("新增用户通知短信发送异常 => {}", smsResponse);
}
}
// 新增用户岗位关联
insertUserPost(user);
......
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