Commit ea37a238 authored by huangjie's avatar huangjie

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

parents 76a6b52e f2f43b58
......@@ -168,6 +168,7 @@ tenant:
- business_follow_record
- business_label
- business_relate_company
- business_open_tender
# MyBatisPlus配置
......
......@@ -32,17 +32,22 @@ public class PasswordUtils {
// 至少包含一个大写字母
password.append(UPPER_CASE.charAt(random.nextInt(UPPER_CASE.length())));
// 至少包含一个数字
password.append(NUMBERS.charAt(random.nextInt(NUMBERS.length())));
// 生成剩余部分的密码
for (int i = 0; i < length - 3; i++) {
String characters = LOWER_CASE + UPPER_CASE + NUMBERS;
password.append(characters.charAt(random.nextInt(characters.length())));
for (int i = 0; i < length - 2; i++) {
// 至少包含一个数字
password.append(NUMBERS.charAt(random.nextInt(NUMBERS.length())));
// String characters = LOWER_CASE + UPPER_CASE + NUMBERS;
// password.append(characters.charAt(random.nextInt(characters.length())));
}
// 打乱密码中字符的顺序
return shufflePassword(password.toString());
// return shufflePassword(password.toString());
return password.toString();
}
public static void main(String[] args) {
System.out.println(PasswordUtils.generatePwd(8));
}
public static String shufflePassword(String password) {
......
package com.dsk.biz.controller;
import com.dsk.biz.domain.BusinessOpenTender;
import com.dsk.biz.domain.bo.BusinessOpenTenderDto;
import com.dsk.biz.domain.bo.BusinessSearchDto;
import com.dsk.biz.service.IBusinessOpenTenderService;
import com.dsk.common.annotation.RepeatSubmit;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.domain.R;
import com.dsk.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 项目开标记录
*
* @author lcl
* @date 2023-10-23
*/
@RestController
@RequestMapping("/business/open/tender")
public class BusinessOpenTenderController extends BaseController {
@Autowired
private IBusinessOpenTenderService baseService;
/**
* 开标记录列表
*/
@GetMapping("/list")
public TableDataInfo<BusinessOpenTender> list(BusinessOpenTenderDto dto, PageQuery pageQuery){
return baseService.selectList(dto, pageQuery);
}
/**
* 添加开标记录
*/
@PostMapping
@RepeatSubmit()
public R<Void> add(@RequestBody BusinessOpenTender bo){
return toAjax(baseService.add(bo));
}
/**
* 修改开标记录
*/
@PutMapping
@RepeatSubmit()
public R<Void> edit(@RequestBody BusinessOpenTender bo){
return toAjax(baseService.edit(bo));
}
/**
* 删除开标记录
*/
@DeleteMapping("/{ids}")
@RepeatSubmit()
public R<Void> remove(@PathVariable Long[] ids){
return toAjax(baseService.remove(ids));
}
}
package com.dsk.biz.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author lcl
* @Data 2023/10/23 16:26
*/
@Data
public class BusinessOpenTender implements Serializable {
@TableId(value = "id",type = IdType.AUTO)
private Long id;
/**
* 项目id
*/
private Integer businessId;
/**
* 投标人id
*/
private Integer tendererId;
/**
* 投标人
*/
private String tenderer;
/**
* 企业性质
*/
private String tendererNature;
/**
* 项目经理
*/
private String businessManager;
/**
* 联系方式
*/
private String contact;
/**
* 投标金额
*/
private Double tenderAmount;
private Date createTime;
private Date updateTime;
}
package com.dsk.biz.domain.bo;
import com.dsk.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author lcl
* @create 2023/8/14
*/
@Data
@NoArgsConstructor
public class BusinessOpenTenderDto implements Serializable {
/**
* 项目id
*/
private Integer businessId;
}
package com.dsk.biz.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.biz.domain.BusinessOpenTender;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface BusinessOpenTenderMapper extends BaseMapper<BusinessOpenTender> {
}
package com.dsk.biz.service;
import com.dsk.biz.domain.BusinessOpenTender;
import com.dsk.biz.domain.bo.BusinessOpenTenderDto;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo;
public interface IBusinessOpenTenderService {
TableDataInfo<BusinessOpenTender> selectList(BusinessOpenTenderDto dto, PageQuery pageQuery);
int add(BusinessOpenTender bo);
int edit(BusinessOpenTender bo);
int remove(Long[] ids);
}
package com.dsk.biz.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsk.biz.domain.BusinessOpenTender;
import com.dsk.biz.domain.bo.BusinessOpenTenderDto;
import com.dsk.biz.domain.bo.BusinessSearchDto;
import com.dsk.biz.mapper.BusinessOpenTenderMapper;
import com.dsk.biz.service.IBusinessOpenTenderService;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo;
import jodd.bean.BeanException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.sql.Wrapper;
import java.util.Arrays;
import java.util.List;
/**
* @Author lcl
* @Data 2023/10/23 16:29
*/
@Slf4j
@Service
public class BusinessOpenTenderServiceImpl implements IBusinessOpenTenderService {
@Resource
private BusinessOpenTenderMapper baseMapper;
@Override
public TableDataInfo<BusinessOpenTender> selectList(BusinessOpenTenderDto dto, PageQuery pageQuery) {
return TableDataInfo.build(baseMapper.selectPage(pageQuery.build(),
Wrappers.<BusinessOpenTender>lambdaQuery().eq(BusinessOpenTender::getBusinessId, dto.getBusinessId())));
}
@Override
public int add(BusinessOpenTender bo) {
verifyBean(bo);
return baseMapper.insert(bo);
}
@Override
public int edit(BusinessOpenTender bo) {
if(ObjectUtils.isArray(bo.getId())) throw new BeanException("id不能为空!");
verifyBean(bo);
return baseMapper.updateById(bo);
}
@Override
public int remove(Long[] ids) {
return baseMapper.deleteBatchIds(Arrays.asList(ids));
}
private void verifyBean(BusinessOpenTender bo){
if(ObjectUtils.isArray(bo.getBusinessId())) throw new BeanException("项目id不能为空!");
if(ObjectUtils.isArray(bo.getTenderer())) throw new BeanException("开标人不能为空!");
if(ObjectUtils.isArray(bo.getTendererNature())) throw new BeanException("企业性质不能为空!");
if(ObjectUtils.isArray(bo.getTenderAmount())) throw new BeanException("投标金额不能为空!");
}
}
......@@ -57,7 +57,7 @@ public class EconomicServiceImpl implements EconomicService {
dto.setYear(DateUtils.getYear() - 1);
}
Map<String, Object> map = dskOpenApiUtil.requestBody("/economic/national/nationalPage", BeanUtil.beanToMap(dto, false, false));
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/economic/national/nationalPage", BeanUtil.beanToMap(dto, false, false));
Integer code = MapUtils.getInteger(map, "code", 300);
if (!code.equals(HttpStatus.OK.value())) {
throw new RuntimeException();
......
......@@ -130,20 +130,6 @@ export const constantRoutes = [
}
]
},
{
path: '',
component: Layout,
hidden: true,
redirect: 'noredirect',
children: [
{
path: '/performance/gzsc/:id',
component: () => import('@/views/market/detail'),
name: 'GzscDetail',
meta: { title: '公招市场详情', icon: 'enterprise'},
}
]
},
{
path: '/groupAccount',
component: Layout,
......@@ -173,6 +159,7 @@ export const constantRoutes = [
}
]
},
//企业详情
{
path: '/company',
component: Layout,
......@@ -181,12 +168,13 @@ export const constantRoutes = [
children: [
{
path: '/company/:id',
component: () => import('@/views/detail/party-b/index'),
component: () => import('@/views/detail'),
name: 'Company',
meta: { title: '企业详情' }
}
]
},
//人员详情
{
path: '/personnel',
component: Layout,
......@@ -194,13 +182,40 @@ export const constantRoutes = [
redirect: 'noredirect',
children: [
{
path: '/personnel/:id',
component: () => import('@/views/detail/party-b/index'),
path: '/personnel/:id.html',
component: () => import('@/views/detail'),
name: 'Personnel',
meta: { title: '人员详情' }
}
]
},
//公招市场详情
{
path: '/gzsc',
component: Layout,
hidden: true,
redirect: 'noredirect',
children: [
{
path: '/gzsc/:id',
component: () => import('@/views/detail'),
name: 'detail-gzsc',
}
]
},
//中标业绩详情
{
path: '',
component: Layout,
hidden: true,
redirect: 'noredirect',
children: [
{
path: '/performance/zb/:id.html',
component: () => import('@/views/detail'),
}
]
},
{
path: '/structure',
component: Layout,
......@@ -362,8 +377,6 @@ export const constantRoutes = [
]
},
]
// 动态路由,基于用户权限动态去加载
......
......@@ -25,7 +25,7 @@ service.interceptors.request.use(config => {
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false
// 是否需要防止数据重复提交
const isRepeatSubmit = (config.headers || {}).repeatSubmit === false
const isRepeatSubmit = (config.headers || {}).repeatSubmit === false||config.url.indexOf('getUipIdByCid')!=-1
if (getToken() && !isToken) {
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
config.headers['tenantid'] = getTenantid() //携带租户id
......
<template>
<div v-loading="loading" class="market-container">
<iframe id="companyIframe" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" width="100%" :style="{height:iframeHight+'px'}"
:src="src" />
</div>
</template>
<script>
import { steerScroll } from '@/assets/js/jskplug';
import { dskAccessToken } from '@/api/common';
export default {
name: 'Enterprise',
components: {
},
data() {
return {
loading: false, // 是否加载完成-当前页控制
iframeTimer: '', // 是否加载中定时器-当前页控制
footHeight: 0, //底部高度,若为0(页面内部嵌套或者没有底部板块)
iframeHight: window.innerHeight, // iframe高度-当前页控制
navigation: { isFixed: true, fixedHeight: 56, totalHeight: 68 }, // iframe之外页面顶部对象,ifFixed:是否浮动;fixedHeight:浮动对象高度;totalHeight:顶部整体高度
src: '', //iframe嵌套页面地址
// domain: 'https://plug.jiansheku.com', // 插件地址
domain: 'https://pre-plug.jiansheku.com', // 插件地址测试
// domain: 'http://192.168.60.210:3400',
ak: 'aec7b3ff2y2q8x6t49a7e2c463ce21912', // 需要携带的sdkId
timelongs: 7200,//刷新token时间
tokentimer: null,
};
},
created() {
if(window.location.host === 'http://szh.jiansheku.com' || window.location.host === 'szh.jiansheku.com'){
this.domain='https://plug.jiansheku.com'
}else {
this.domain='https://pre-plug.jiansheku.com'
this.domain='http://192.168.60.210:3400'
}
this.gettokens();
},
mounted() {
this.iframeLoading(); // 判断iframe页面是否加载完成-当前页控制
let that = this
window.addEventListener('message', function (event) {
if(!event.data.id && event.data.url){
that.$tab.openPage(event.data.title, event.data.url).then(() => {
// 执行结束的逻辑
})
}
}, false);
steerScroll('companyIframe', this.navigation, this.footHeight, true); // iframeId: iframe的id;navigation:页面排除iframe后剩下的顶部高度;footHeight: 页面排除iframe后剩下的底部高度;state:监听or移除监听;parentId: 父级id[不带默认就是铺满整个页面]];_this:指向当前实例(可忽略)
},
beforeDestroy() {
clearInterval(this.iframeTimer); // -当前页控制
steerScroll('companyIframe', this.navigation, this.footHeight); // iframeId: iframe的id;navigation:页面排除iframe后剩下的顶部高度;footHeight: 页面排除iframe后剩下的底部高度;state:监听or移除监听;parentId: 父级id[不带默认就是铺满整个页面]];_this:指向当前实例(可忽略)
clearInterval(this.tokentimer);
},
methods: {
gettokens() {
dskAccessToken().then(res => {
if (res.code == 200) {
this.timelongs = res.data.expire;
this.ak = res.data.accessToken;
let initTime = new Date().getTime()
if(window.location.search){
this.src = `${this.domain+this.$route.fullPath}&ak=${this.ak}&initTime=${initTime}&uid=${this.ak}&origin=${window.location.origin}`
}else{
this.src = `${this.domain+this.$route.fullPath}?ak=${this.ak}&initTime=${initTime}&uid=${this.ak}&origin=${window.location.origin}`
}
// if(window.location.search){
// this.src = `${this.domain+this.$route.fullPath}&ak=${this.ak}&initTime=${initTime}&uid=${this.ak}&origin=${window.location.origin}`
// }else{
// this.src = `${this.domain+this.$route.fullPath}?ak=${this.ak}&initTime=${initTime}&uid=${this.ak}&origin=${window.location.origin}`
// }
// }else{ //更新iframe地址的accessToken
// let ifam = document.getElementById('companyIframe')
// ifam.contentWindow.postMessage({ 'accessToken': this.ak, 'initTime': initTime }, '*')
// }
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;
this.iframeTimer = setInterval(() => {
number++;
if (document.getElementById("companyIframe").clientHeight != iframeHeight || number == 5000) {
this.loading = false;
clearInterval(this.iframeTimer);
}
});
}
}
}
</script>
<style lang="scss" scoped>
.market-container {
width: 100%;
height: 100%;
padding: 16px 24px;
box-sizing: border-box;
}
</style>
......@@ -529,7 +529,7 @@
yAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
return value + '万元'
return value
}
},
itemStyle: {
......@@ -543,7 +543,7 @@
barWidth: 20,
tooltip: {
valueFormatter: function (value) {
return value + '个';
return value;
}
},
itemStyle: {
......@@ -791,7 +791,7 @@
yAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
return value + '万元'
return value
}
},
itemStyle: {
......@@ -805,7 +805,7 @@
barWidth: 20,
tooltip: {
valueFormatter: function (value) {
return value + '个';
return value;
}
},
itemStyle: {
......
......@@ -11,7 +11,9 @@
<script>
import { steerScroll } from '@/assets/js/jskplug';
import { dskAccessToken } from '@/api/common';
import {encodeStr} from "@/assets/js/common.js"
import MaxPageSizeTip from "@/views/components/MaxPageSizeTip.vue";
import { getUipIdByCid } from '@/api/macro/macro'
export default {
name: 'Enterprise',
components: {
......@@ -19,6 +21,7 @@ export default {
},
data() {
return {
encodeStr,
loading: false, // 是否加载完成-当前页控制
iframeTimer: '', // 是否加载中定时器-当前页控制
footHeight: 0, //底部高度,若为0(页面内部嵌套或者没有底部板块)
......@@ -41,11 +44,35 @@ export default {
} else {
this.domain='https://pre-plug.jiansheku.com'
// this.domain = 'http://192.168.60.8:3400';
// this.domain = 'http://192.168.60.104:3400';
this.domain = 'http://192.168.60.210:3400';
}
this.gettokens();
this.iframeObserver();
let that = this
window.addEventListener("message", this.pagecapListener, { passive: true });
window.addEventListener('message', function (event) {
if(event.data.id){
getUipIdByCid([event.data.id]).then(res=>{
if (res.code==200) {
if(res.data&&res.data.length>0&&res.data[0].uipId){
that.$router.push({path: '/enterprise/'+that.encodeStr(event.data.id)})
}else{
that.$tab.openPage(event.data.title, '/company/'+that.encodeStr(event.data.id))
}
}
}).catch(error=>{
});
}else{
if(event.data.url){
that.$tab.openPage(event.data.title, event.data.url).then(() => {
// 执行结束的逻辑
})
}
}
}, false);
},
mounted() {
this.iframeLoading(); // 判断iframe页面是否加载完成-当前页控制
......
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