Commit b5f574c5 authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents 9012ac6b a4b7a172
......@@ -207,6 +207,7 @@ export default {
},
data() {
return {
loading: false,
labelCol: { span: 6 },
wrapperCol: { span: 14 },
siteInfo: {
......@@ -303,10 +304,12 @@ export default {
async handleOk() {
this.$refs.formData.validate(async (valid) => {
if (valid) {
this.loading = true;
let res = await addWindow({
...this.form,
...this.siteInfo,
});
this.loading = false;
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
......
......@@ -209,6 +209,9 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
*/
@Override
public Claims parseToken(String token) {
return Jwts.parser()
.setSigningKey(Base64.getEncoder().encodeToString(secret.getBytes()))
.parseClaimsJws(token)
......@@ -245,4 +248,11 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
private String getTokenKey(String uuid) {
return SysConstains.LOGIN_TOKEN_KEY + uuid;
}
public static void main(String[] args) {
// boolean signed = Jwts.parser().isSigned("123");
boolean signed = Jwts.parser().isSigned("eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJuaW5naGFvLm5ldCIsImV4cCI6IjE0Mzg5NTU0NDUiLCJuYW1lIjoid2FuZ2hhbyIsImFkbWluIjp0cnVlfQ.SwyHTEx_RQppr97g4J5lKXtabJecpejuef8AqKYMAJc");
System.out.println(signed);
}
}
......@@ -35,7 +35,6 @@ import com.mortals.xhx.common.code.SourceType;
public class ResourceController extends BaseCRUDJsonBodyMappingController<ResourceService,ResourceEntity,Long> {
public ResourceController(){
super.setFormClass(ResourceForm.class);
super.setModuleDesc("资源信息");
}
......
/**
* 文件:ResourceForm.java
* 版本:1.0.0
* 日期:
* Copyright &reg;
* All right reserved.
*/
package com.mortals.xhx.base.system.resource.web;
import com.mortals.framework.web.BaseCRUDFormLong;
import com.mortals.xhx.base.system.resource.model.ResourceEntity;
import com.mortals.xhx.base.system.resource.model.ResourceQuery;
/**
* <p>Title: 资源信息</p>
* <p>Description: ResourceForm </p>
* <p>Copyright: Copyright &reg; </p>
* <p>Company: </p>
* @author
* @version 1.0.0
*/
public class ResourceForm extends BaseCRUDFormLong<ResourceEntity> {
private ResourceEntity entity = new ResourceEntity();
private ResourceQuery query = new ResourceQuery();
public ResourceForm(){
}
@Override
public ResourceEntity getEntity() {
return entity;
}
public void setEntity(ResourceEntity entity) {
this.entity = entity;
}
@Override
public ResourceQuery getQuery() {
return query;
}
public void setQuery(ResourceQuery query) {
this.query = query;
}
}
\ No newline at end of file
package com.mortals.xhx.common.utils;
import cn.hutool.core.util.ReUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mortals.xhx.common.code.FiletypeEnum;
import com.mortals.xhx.common.code.SourceEnum;
import com.mortals.xhx.module.matter.model.MatterDatumFileEntity;
......@@ -146,7 +149,23 @@ public class MatterDetailHtmlParseUtil {
fileEntity.setSource(SourceEnum.政务网.getValue());
fileEntity.setFiletype(FiletypeEnum.空白表格.getValue());
fileEntity.setFileName(prenode.text().trim());
fileEntity.setFileUrl(node.firstChild().attr("href").trim());
String onclickStr = node.firstChild().attr("onclick").trim();
List<String> allGroup = ReUtil.findAllGroup1("'(.*?)'", onclickStr);
if (!ObjectUtils.isEmpty(allGroup)) {
String encryUrl = "http://www.sczwfw.gov.cn/jiq/interface/item/annex/encryptUrl?id=" + allGroup.get(0);
String resp = HttpUtil.get(encryUrl);
JSONObject obj = JSON.parseObject(resp);
String code = obj.getString("code");
String data = obj.getString("data");
if ("0".equals(code)) {
fileEntity.setFileUrl(data);
}
}
// fileEntity.setFileUrl(node.firstChild().attr("href").trim());
datumFileEntities.add(fileEntity);
}
}
......@@ -168,7 +187,22 @@ public class MatterDetailHtmlParseUtil {
fileEntity.setSource(SourceEnum.政务网.getValue());
fileEntity.setFiletype(FiletypeEnum.示例样表.getValue());
fileEntity.setFileName(prenode.text().trim());
fileEntity.setFileUrl(node.firstChild().attr("href").trim());
String onclickStr = node.firstChild().attr("onclick").trim();
List<String> allGroup = ReUtil.findAllGroup1("'(.*?)'", onclickStr);
if (!ObjectUtils.isEmpty(allGroup)) {
String encryUrl = "http://www.sczwfw.gov.cn/jiq/interface/item/annex/encryptUrl?id=" + allGroup.get(0);
String resp = HttpUtil.get(encryUrl);
JSONObject obj = JSON.parseObject(resp);
String code = obj.getString("code");
String data = obj.getString("data");
if ("0".equals(code)) {
fileEntity.setFileUrl(data);
}
}
// fileEntity.setFileUrl(node.firstChild().attr("href").trim());
datumSampleFileEntities.add(fileEntity);
}
map.put("sampleList", datumSampleFileEntities);
......@@ -478,6 +512,7 @@ public class MatterDetailHtmlParseUtil {
});
List<Map<String, Object>> mapList = MatterDetailHtmlParseUtil.getsqclInfoMapByHtml(dom);
System.out.println("==============材料==============");
System.out.println(JSON.toJSONString(mapList));
Map<String, String> sltjMapByHtml = MatterDetailHtmlParseUtil.getSltjMapByHtml(dom);
......
......@@ -247,7 +247,7 @@ public class MatterHtmlParseUtil {
params.put("taskType", "");
Rest<List<MatterEntity>> rest = MatterHtmlParseUtil.getMatterList(params, url);
System.out.println(rest.getData().size());*/
System.out.println(rest.getData().size());
/* HashMap<String, String> params = new HashMap<>();
......
......@@ -84,7 +84,7 @@ public class SyncGovMatterDetailThread implements Runnable {
List<MatterEntity> matterEntityList = matterService.find(new MatterQuery().areaCode(siteEntity.getAreaCode()).source(SourceEnum.政务网.getValue()));
log.info("查询事项列表结束");
List<MatterEntity> unSyncDetailMatterList = matterEntityList.stream()
.filter(f -> f.getHaveGetMatterInfo().equalsIgnoreCase("false"))
// .filter(f -> f.getHaveGetMatterInfo().equalsIgnoreCase("false"))
.collect(Collectors.toList());
//查询站点事项相关
......
......@@ -2,6 +2,7 @@ package com.mortals.xhx.module.app.web;
import cn.hutool.core.net.url.UrlBuilder;
import cn.hutool.core.util.ZipUtil;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
......@@ -69,6 +70,16 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(AppEntity query) {
return super.list(query);
}
/**
* @param query
* @param model
......
......@@ -2,6 +2,7 @@ package com.mortals.xhx.module.area.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
......@@ -49,6 +50,26 @@ public class AreaController extends BaseCRUDJsonBodyMappingController<AreaServic
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(AreaEntity query) {
return super.list(query);
}
/**
* @param id
* @return
*/
@Override
@UnAuth
public String info(Long id) {
return super.info(id);
}
/**
* 获取站点下拉树列表
*/
......
package com.mortals.xhx.module.business.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
......@@ -49,6 +51,15 @@ public class BusinessController extends BaseCRUDJsonBodyMappingController<Busine
super.init(model, context);
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(BusinessEntity query) {
return super.list(query);
}
@Override
protected void doListBefore(BusinessEntity query, Map<String, Object> model, Context context) throws AppException {
......
package com.mortals.xhx.module.business.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
......@@ -47,6 +49,15 @@ public class BusinessMatterController extends BaseCRUDJsonBodyMappingController<
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(BusinessMatterEntity query) {
return super.list(query);
}
@PostMapping(value = "businesslist")
public String getListByBusiness(@RequestBody BusinessMatterQuery query) {
......
......@@ -52,10 +52,30 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic
super.setModuleDesc("部门");
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(DeptEntity query) {
return super.list(query);
}
/**
* @param id
* @return
*/
@Override
@UnAuth
public String info(Long id) {
return super.info(id);
}
@Override
protected void doListBefore(DeptEntity query, Map<String, Object> model, Context context) throws AppException {
if(ObjectUtils.isEmpty(query.getIdList())){
if (ObjectUtils.isEmpty(query.getIdList())) {
if (ObjectUtils.isEmpty(query.getOrderColList())) {
query.setOrderColList(new ArrayList<OrderCol>() {
{
......@@ -66,7 +86,7 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic
} else {
query.getOrderColList().add(new OrderCol("a.createTime", OrderCol.DESCENDING));
}
}else{
} else {
}
if (!ObjectUtils.isEmpty(query.getFilter()) && YesNoEnum.YES.getValue() == query.getFilter()) {
......
package com.mortals.xhx.module.matter.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
......@@ -35,4 +37,13 @@ public class MatterAcceptController extends BaseCRUDJsonBodyMappingController<Ma
super.init(model, context);
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(MatterAcceptEntity query) {
return super.list(query);
}
}
\ No newline at end of file
package com.mortals.xhx.module.matter.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
......@@ -35,4 +37,13 @@ public class MatterChargesController extends BaseCRUDJsonBodyMappingController<M
super.init(model, context);
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(MatterChargesEntity query) {
return super.list(query);
}
}
\ No newline at end of file
......@@ -132,6 +132,25 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
super.init(model, context);
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(MatterEntity query) {
return super.list(query);
}
/**
* @param id
* @return
*/
@Override
@UnAuth
public String info(Long id) {
return super.info(id);
}
/**
* 添加事项到站点
......
package com.mortals.xhx.module.matter.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
......@@ -52,6 +54,15 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
super.init(model, context);
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(MatterDatumEntity query) {
return super.list(query);
}
@Override
protected int viewAfter(Long id, Map<String, Object> model, MatterDatumEntity entity, Context context) throws AppException {
......@@ -60,6 +71,21 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
return super.viewAfter(id, model, entity, context);
}
/**
* @param id
* @param model
* @param entity
* @param context
* @return
* @throws AppException
*/
@Override
protected int infoAfter(Long id, Map<String, Object> model, MatterDatumEntity entity, Context context) throws AppException {
List<MatterDatumFileEntity> matterDatumFileEntities = matterDatumFileService.find(new MatterDatumFileQuery().datumId(entity.getId()));
entity.setDatumFileList(matterDatumFileEntities);
return super.infoAfter(id, model, entity, context);
}
/**
* @param query
* @param model
......
package com.mortals.xhx.module.matter.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
......@@ -11,8 +13,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
*
* 材料附件
*
* @author zxfei
......@@ -20,20 +22,29 @@ import java.util.Map;
*/
@RestController
@RequestMapping("matter/datum/file")
public class MatterDatumFileController extends BaseCRUDJsonBodyMappingController<MatterDatumFileService,MatterDatumFileEntity,Long> {
public class MatterDatumFileController extends BaseCRUDJsonBodyMappingController<MatterDatumFileService, MatterDatumFileEntity, Long> {
@Autowired
private ParamService paramService;
public MatterDatumFileController(){
super.setModuleDesc( "材料附件");
public MatterDatumFileController() {
super.setModuleDesc("材料附件");
}
@Override
protected void init( Map<String, Object> model, Context context) {
this.addDict(model, "filetype", paramService.getParamBySecondOrganize("MatterDatumFile","filetype"));
this.addDict(model, "source", paramService.getParamBySecondOrganize("MatterDatumFile","source"));
super.init( model, context);
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "filetype", paramService.getParamBySecondOrganize("MatterDatumFile", "filetype"));
this.addDict(model, "source", paramService.getParamBySecondOrganize("MatterDatumFile", "source"));
super.init(model, context);
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(MatterDatumFileEntity query) {
return super.list(query);
}
}
\ No newline at end of file
package com.mortals.xhx.module.matter.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
......@@ -35,5 +37,13 @@ public class MatterFlowlimitController extends BaseCRUDJsonBodyMappingController
super.init(model, context);
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(MatterFlowlimitEntity query) {
return super.list(query);
}
}
\ No newline at end of file
package com.mortals.xhx.module.matter.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
......@@ -35,4 +37,13 @@ public class MatterIntermediaryController extends BaseCRUDJsonBodyMappingControl
super.init(model, context);
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(MatterIntermediaryEntity query) {
return super.list(query);
}
}
\ No newline at end of file
package com.mortals.xhx.module.matter.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
......@@ -35,5 +37,13 @@ public class MatterQuestionController extends BaseCRUDJsonBodyMappingController<
super.init(model, context);
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(MatterQuestionEntity query) {
return super.list(query);
}
}
\ No newline at end of file
package com.mortals.xhx.module.matter.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
......@@ -36,4 +38,13 @@ public class MatterSetbaseController extends BaseCRUDJsonBodyMappingController<M
super.init(model, context);
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(MatterSetbaseEntity query) {
return super.list(query);
}
}
\ No newline at end of file
package com.mortals.xhx.module.site.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
......@@ -56,6 +58,15 @@ public class SiteBusinessController extends BaseCRUDJsonBodyMappingController<Si
super.init(model, context);
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(SiteBusinessEntity query) {
return super.list(query);
}
@PostMapping("list/exclude")
public String excludeList(SiteBusinessEntity query) {
......
......@@ -88,6 +88,25 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
super.init(model, context);
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(SiteEntity query) {
return super.list(query);
}
/**
* @param id
* @return
*/
@Override
@UnAuth
public String info(Long id) {
return super.info(id);
}
/**
* 构建站点树
......
......@@ -60,6 +60,26 @@ public class SiteHallController extends BaseCRUDJsonBodyMappingController<SiteHa
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(SiteHallEntity query) {
return super.list(query);
}
/**
* @param id
* @return
*/
@Override
@UnAuth
public String info(Long id) {
return super.info(id);
}
/**
* 根据大厅查询所属业务
*/
......
package com.mortals.xhx.module.site.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol;
......@@ -34,6 +36,16 @@ public class SiteMatterController extends BaseCRUDJsonBodyMappingController<Site
super.setModuleDesc("站点事项");
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(SiteMatterEntity query) {
return super.list(query);
}
/**
* @param query
* @param model
......
package com.mortals.xhx.module.site.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -46,4 +48,13 @@ public class SiteThemeController extends BaseCRUDJsonBodyMappingController<SiteT
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(SiteThemeEntity query) {
return super.list(query);
}
}
\ No newline at end of file
package com.mortals.xhx.module.site.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -47,5 +49,13 @@ public class SiteThemeMatterController extends BaseCRUDJsonBodyMappingController
super.init(model, context);
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(SiteThemeMatterEntity query) {
return super.list(query);
}
}
\ No newline at end of file
......@@ -5,7 +5,9 @@ import cn.hutool.core.net.url.UrlBuilder;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.ReUtil;
import cn.hutool.core.util.StrUtil;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
......@@ -73,6 +75,26 @@ public class SkinBaseController extends BaseCRUDJsonBodyMappingController<SkinBa
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(SkinBaseEntity query) {
return super.list(query);
}
/**
* @param id
* @return
*/
@Override
@UnAuth
public String info(Long id) {
return super.info(id);
}
@Override
protected void doListBefore(SkinBaseEntity query, Map<String, Object> model, Context context) throws AppException {
......
package com.mortals.xhx.module.sms.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
......@@ -36,4 +38,23 @@ public class SmsSetController extends BaseCRUDJsonBodyMappingController<SmsSetSe
super.init(model, context);
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(SmsSetEntity query) {
return super.list(query);
}
/**
* @param id
* @return
*/
@Override
@UnAuth
public String info(Long id) {
return super.info(id);
}
}
\ No newline at end of file
......@@ -31,6 +31,7 @@ public class WindowEntity extends WindowVo {
/**
* 部门名称
*/
@Excel(name = "部门名称")
private String deptName;
/**
* 窗口名称
......
......@@ -3,6 +3,7 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICRUDCacheService;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.window.model.WindowHallEntity;
......@@ -15,7 +16,7 @@ import com.mortals.xhx.module.window.dao.WindowHallDao;
* @author zxfei
* @date 2023-04-25
*/
public interface WindowHallService extends ICRUDService<WindowHallEntity,Long>{
public interface WindowHallService extends ICRUDCacheService<WindowHallEntity,Long> {
WindowHallDao getDao();
......
......@@ -52,9 +52,12 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
@Override
protected void findAfter(WindowBusinessEntity entity, PageInfo pageInfo, Context context, List<WindowBusinessEntity> list) throws AppException {
Map<Long, WindowEntity> collect = windowService.findToMap(new WindowQuery(), context);
Map<Long, WindowHallEntity> windowHallEntityMap = windowHallService.find(new WindowHallQuery(), context).parallelStream().collect(Collectors.toMap(x -> x.getWindowId(), Function.identity()));
Map<Long, WindowEntity> collect = windowService.getCacheList().stream().collect(Collectors.toMap(x -> x.getId(), y -> y, (o, n) -> n));
//Map<Long, WindowEntity> collect = windowService.findToMap(new WindowQuery(), context);
Map<Long, WindowHallEntity> windowHallEntityMap = windowHallService.getCacheList().stream().collect(Collectors.toMap(x -> x.getId(), y -> y, (o, n) -> n));
//Map<Long, WindowHallEntity> windowHallEntityMap = windowHallService.find(new WindowHallQuery(), context).parallelStream().collect(Collectors.toMap(x -> x.getWindowId(), Function.identity()));
Iterator iterator = list.iterator();
while (iterator.hasNext()) {
WindowBusinessEntity item = (WindowBusinessEntity) iterator.next();
......@@ -67,7 +70,7 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
if (!ObjectUtils.isEmpty(windowHallEntity)) {
item.setHallId(windowHallEntity.getHallId());
item.setHallName(windowHallEntity.getHallName());
}else {
} else {
//log.info("windowhallEntity is null windowId:{}",item.getWindowId());
}
} else {
......
......@@ -2,6 +2,7 @@ package com.mortals.xhx.module.window.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.xhx.module.window.model.WindowEntity;
import com.mortals.xhx.module.window.model.WindowQuery;
import com.mortals.xhx.module.window.service.WindowService;
......@@ -27,7 +28,7 @@ import java.util.stream.Collectors;
* @date 2023-04-25
*/
@Service("windowHallService")
public class WindowHallServiceImpl extends AbstractCRUDServiceImpl<WindowHallDao, WindowHallEntity, Long> implements WindowHallService {
public class WindowHallServiceImpl extends AbstractCRUDCacheServiceImpl<WindowHallDao, WindowHallEntity, Long> implements WindowHallService {
@Autowired
private WindowService windowService;
......@@ -41,8 +42,14 @@ public class WindowHallServiceImpl extends AbstractCRUDServiceImpl<WindowHallDao
*/
@Override
protected void findAfter(WindowHallEntity params, PageInfo pageInfo, Context context, List<WindowHallEntity> list) throws AppException {
super.findAfter(params, pageInfo, context, list);
List<Long> collect = list.stream().map(i -> i.getWindowId()).distinct().collect(Collectors.toList());
Map<Long, WindowEntity> collectWin = windowService.getCacheList().stream().collect(Collectors.toMap(x -> x.getId(), y -> y, (o, n) -> n));
list.forEach(item -> {
WindowEntity windowEntity = collectWin.get(item.getWindowId());
item.setFromnum(windowEntity == null ? "" : windowEntity.getFromnum());
});
/* List<Long> collect = list.stream().map(i -> i.getWindowId()).distinct().collect(Collectors.toList());
if (!ObjectUtils.isEmpty(collect)) {
WindowQuery windowQuery = new WindowQuery();
windowQuery.setIdList(collect);
......@@ -51,6 +58,6 @@ public class WindowHallServiceImpl extends AbstractCRUDServiceImpl<WindowHallDao
WindowEntity windowEntity = collectWin.get(item.getWindowId());
item.setFromnum(windowEntity == null ? "" : windowEntity.getFromnum());
});
}
}*/
}
}
\ No newline at end of file
package com.mortals.xhx.module.window.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
......@@ -34,6 +36,13 @@ public class WindowBusinessController extends BaseCRUDJsonBodyMappingController<
super.setModuleDesc("窗口业务");
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(WindowBusinessEntity query) {
return super.list(query);
}
}
\ No newline at end of file
......@@ -12,6 +12,7 @@ import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.site.model.SiteEntity;
......@@ -28,6 +29,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
......@@ -76,6 +78,25 @@ public class WindowController extends BaseCRUDJsonBodyMappingController<WindowSe
super.init(model, context);
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(WindowEntity query) {
return super.list(query);
}
/**
* @param id
* @return
*/
@Override
@UnAuth
public String info(Long id) {
return super.info(id);
}
/**
* 添加业务到窗口
......@@ -186,6 +207,27 @@ public class WindowController extends BaseCRUDJsonBodyMappingController<WindowSe
if (!ObjectUtils.isEmpty(deptEntity)) {
windowEntity.setDeptId(deptEntity.getId());
windowEntity.setDeptName(deptEntity.getName());
}else {
//判断是否填入了部门名称
if(!ObjectUtils.isEmpty(windowEntity.getDeptName())){
//根据部门名称与站点 更新窗口
DeptQuery deptQuery = new DeptQuery();
deptQuery.setName(windowEntity.getDeptName());
deptQuery.setSiteId(DataUtil.converStr2Long(siteId,0L));
deptEntity = deptService.selectOne(deptQuery);
if(!ObjectUtils.isEmpty(deptEntity)){
windowEntity.setDeptId(deptEntity.getId());
windowEntity.setDeptName(deptEntity.getName());
}
}
}
}
//siteId为空 或deptId为空 则删除 不导入
Iterator<WindowEntity> iterator = list.iterator();
while (iterator.hasNext()) {
WindowEntity next = iterator.next();
if(ObjectUtils.isEmpty(next.getSiteId())||ObjectUtils.isEmpty(next.getDeptId())){
iterator.remove();
}
}
}
......
......@@ -2,7 +2,9 @@ package com.mortals.xhx.module.window.web;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol;
......@@ -45,6 +47,15 @@ public class WindowMatterController extends BaseCRUDJsonBodyMappingController<Wi
super.setModuleDesc("窗口事项");
}
/**
* @param query
* @return
*/
@Override
@UnAuth
public Rest<Object> list(WindowMatterEntity query) {
return super.list(query);
}
@Override
protected void doListBefore(WindowMatterEntity query, Map<String, Object> model, Context context) throws AppException {
......
......@@ -69,6 +69,14 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
super.init(model, context);
}
/**
* @param query
* @return
*/
@PostMapping(value = "interList")
public Rest<Object> interList(@RequestBody WorkmanEntity query) {
return super.list(query);
}
/**
*
......@@ -118,6 +126,8 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
}
@PostMapping(value = "doImportPic")
public String doImportPic(@RequestBody WorkmanEntity query) {
JSONObject ret = new JSONObject();
......
......@@ -57,6 +57,42 @@
</if>-->
</trim>
</trim>
<if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()">
order by
CASE
WHEN fieldType = 'date' THEN STR_TO_DATE(fieldValue, '%Y-%m-%d')
ELSE NULL
END
<trim prefix="," suffixOverrides="," suffix="">
<if test="orderCol.containsKey('id')">
a.id
<if test='orderCol.id != null and "DESC".equalsIgnoreCase(orderCol.id)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('appId')">
a.appId
<if test='orderCol.appId != null and "DESC".equalsIgnoreCase(orderCol.appId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('createTime')">
a.createTime
<if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('updateUserId')">
a.updateUserId
<if test='orderCol.updateUserId != null and "DESC".equalsIgnoreCase(orderCol.updateUserId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('updateTime')">
a.updateTime
<if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
,
</if>
</trim>
</if>
</select>
<!-- 条件映射 -->
......
......@@ -38,6 +38,7 @@
<result property="datumId" column="datumId" />
<result property="fileName" column="fileName" />
<result property="fileUrl" column="fileUrl" />
<result property="localFileUrl" column="localFileUrl" />
<result property="filetype" column="filetype" />
<result property="source" column="source" />
<result property="createTime" column="createTime" />
......@@ -133,7 +134,7 @@
<!-- 子表所有列 -->
<sql id="_columns_sub">
<trim suffixOverrides="," suffix="">
b.id,b.datumId,b.fileName,b.fileUrl,b.filetype,b.source,b.createTime,b.createUserId,b.updateTime,b.materialName,
b.id,b.datumId,b.fileName,b.fileUrl,b.localFileUrl,b.filetype,b.source,b.createTime,b.createUserId,b.updateTime,b.materialName,
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
......
......@@ -18,15 +18,6 @@ POST {{baseUrl}}/app/dataset/list
Content-Type: application/json
{
"siteId": 1,
"appId": 79,
"orConditionList": [ {
"fieldCode":"year",
"fieldValue":"2022"
},{
"fieldCode":"yOrm",
"fieldValue":"0"
}],
"page": 1,
"size": 10
}
......
......@@ -3,7 +3,7 @@
POST {{baseUrl}}/dept/list
Content-Type: application/json
{"siteId":1,"page":"1","size":"-1","orderColList":[{"colName":"sort","sortKind":"asc"}]}
{}
###部门列表1
......
......@@ -4,11 +4,6 @@ POST {{baseUrl}}/holiday/list
Content-Type: application/json
{
"siteId":9033 ,
"name":"adqb9k" ,
"year":1996 ,
"page":1,
"size":10
}
......
......@@ -124,7 +124,7 @@ client.global.set("Matter_id", JSON.parse(response.body).data.id);
%}
###基础事项查看
GET {{baseUrl}}/matter/info?id=39654
GET {{baseUrl}}/matter/info?id=34081
Accept: application/json
###基础事项编辑
......
......@@ -4,9 +4,6 @@ POST {{baseUrl}}/matter/datum/list
Content-Type: application/json
{
"matterId":3227 ,
"matterName":"r4s0v4" ,
"materialName":"b2fx5n" ,
"page":1,
"size":10
}
......@@ -60,7 +57,7 @@ client.global.set("MatterDatum_id", JSON.parse(response.body).data.id);
%}
###事项申请材料查看
GET {{baseUrl}}/matter/datum/info?id={{MatterDatum_id}}
GET {{baseUrl}}/matter/datum/info?id=53092
Accept: application/json
###事项申请材料编辑
......
......@@ -18,8 +18,9 @@ POST {{baseUrl}}/site/hall/list
Content-Type: application/json
{
"page":1,
"size":11
"siteId": 1,
"page": 1,
"size": -1
}
......
......@@ -3,11 +3,7 @@
POST {{baseUrl}}/window/business/list
Content-Type: application/json
{
"page":1,
"size":10
}
{"windowIdList":["77","78","79","80","81","82","83","84","85","86","87","88","89","90","91","92","93","94","95","96","97","98","99"],"size":-1}
###窗口业务更新与保存
POST {{baseUrl}}/window/business/save
......
......@@ -19,8 +19,7 @@ Content-Type: application/json
{
"page":1,
"size":-1,
"hallId": 11
"size":-1
}
......
......@@ -13,11 +13,7 @@ POST {{baseUrl}}/workman/list
Content-Type: application/json
{
"page":1,
"size":10,
"andConditionList":[{"name":"%张三%","number":"%123%","deptName":"%123%","windowName":"%123%"}]
}
}
###工作人员更新与保存
......
......@@ -28,7 +28,7 @@ public interface IApiAreaFeign extends IFeign {
* @param query
* @return
*/
@PostMapping(value = "/area/list")
@PostMapping(value = "/area/interlist")
String list(@RequestBody AreaEntity query);
......@@ -38,7 +38,7 @@ public interface IApiAreaFeign extends IFeign {
* @param id
* @return
*/
@GetMapping(value = "/area/info")
@GetMapping(value = "/area/interinfo")
String viewAreaInfo(@RequestParam(value = "id") Long id);
......
......@@ -26,7 +26,7 @@ public interface IDeviceFeign extends IFeign {
* @param devicePdu
* @return
*/
@PostMapping(value = "/device/list")
@PostMapping(value = "/device/interlist")
Rest<RespData<List<DevicePdu>>> list(@RequestBody DevicePdu devicePdu);
......@@ -36,7 +36,7 @@ public interface IDeviceFeign extends IFeign {
* @param id
* @return
*/
@GetMapping(value = "/device/info")
@GetMapping(value = "/device/interinfo")
Rest<DevicePdu> info(@RequestParam(value = "id") Long id);
/**
......
......@@ -22,7 +22,7 @@ public interface IProductFeign extends IFeign {
* @param productPdu
* @return
*/
@PostMapping(value = "/product/list")
@PostMapping(value = "/product/interlist")
Rest<RespData<List<ProductPdu>>> list(@RequestBody ProductPdu productPdu);
}
......
......@@ -29,7 +29,7 @@ public interface IUserFeign extends IFeign {
* @param userPdu
* @return
*/
@PostMapping(value = "/user/list")
@PostMapping(value = "/user/interlist")
Rest<RespData<List<UserPdu>>> list(@RequestBody UserPdu userPdu);
......@@ -39,7 +39,7 @@ public interface IUserFeign extends IFeign {
* @param id
* @return
*/
@GetMapping(value = "/user/info")
@GetMapping(value = "/user/interinfo")
Rest<UserPdu> info(@RequestParam(value = "id") Long id);
/**
......
package com.mortals.xhx.module.area.model;
import cn.hutool.core.date.DateUtil;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
/**
......@@ -70,4 +73,30 @@ public class AreaTreeSelect implements Serializable {
}
public static void main(String[] args) {
int year = 2023; // 目标年份
int week = 42; // 目标周数
int dayOfWeek = 2; // 目标星期几 (1 表示星期日,2 表示星期一,以此类推)
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, year);
calendar.set(Calendar.WEEK_OF_YEAR, week);
calendar.set(Calendar.DAY_OF_WEEK, dayOfWeek);
int targetYear = calendar.get(Calendar.YEAR);
int targetMonth = calendar.get(Calendar.MONTH) + 1; // 月份是从 0 开始计数的,所以需要 +1
int targetDay = calendar.get(Calendar.DAY_OF_MONTH);
System.out.println("目标日期:" + targetYear + "-" + targetMonth + "-" + targetDay);
String 年_月_日 = DateUtil.format(new Date(), "年 月 日");
System.out.println(年_月_日);
}
}
\ No newline at end of file
......@@ -20,3 +20,7 @@ export function changePassword(params) {
export function editPassword(params) {
return http.post(`${baseURL}/zwfw/user/reset/password`, params);
}
// 密码过期修改密码
export function changeForgotPassword(params) {
return http.post(`${baseURL}/zwfw/user/forgot/password`, params);
}
......@@ -59,7 +59,7 @@ axios.interceptors.response.use(
message.error({
content: msg,
maxCount: 1,
duration: 1,
duration: 2,
});
store.commit("user/reset");
router.push("/");
......
......@@ -26,8 +26,8 @@
</a-table>
</div>
</template>
<script>
<script>
import { mapState } from "vuex";
import storage from "@/utils/js/Storage";
import { export2Excel } from "@/utils/js/exportExcel";
......@@ -293,11 +293,10 @@ export default {
},
// 格式化时间
dateFormat(val) {
return this.$moment(val).format("YYYY-MM-DD HH:mm:ss");
return this.$moment.unix(val).format("YYYY-MM-DD HH:mm:ss");
},
},
};
</script>
<style lang="less" scoped>
</style>
\ No newline at end of file
<style lang="less" scoped></style>
......@@ -30,13 +30,21 @@
</a-table>
</div>
</template>
<script>
<script>
import { mapState } from "vuex";
import storage from "@/utils/js/Storage";
import { export2Excel } from "@/utils/js/exportExcel";
import { getOtherList } from "@/api/dataAdmin";
const tHeader = ["操作人身份", "操作类型", "箱号", "取件柜名称", "操作时间"]; // 导出的表头名信息
const operationTypeList = {
1: "存件",
2: "取件",
3: "锁定",
4: "开箱",
5: "清箱",
6: "解锁",
};
const filterVal = [
"userType",
"operationType",
......@@ -95,6 +103,7 @@ export default {
},
];
return {
operationTypeList,
baseurl: process.env.VUE_APP_API_PHP_URL,
siteId: storage.get(2, "siteId"),
columns,
......@@ -278,6 +287,5 @@ export default {
},
};
</script>
<style lang="less" scoped>
</style>
\ No newline at end of file
<style lang="less" scoped></style>
......@@ -188,6 +188,10 @@ export default {
} else {
this.censusList = [];
this.active = "CensusType_1";
if (this.$route.path != "/home/dataManagement") {
console.log(1);
this.$router.push("/home/dataManagement");
}
}
}
},
......
......@@ -102,8 +102,8 @@ project_ui_deploy() {
main() {
echo "后台服务部署"
project_deploy
echo "前端服务部署"
project_ui_deploy
#echo "前端服务部署"
#project_ui_deploy
exit ${RETVAL}
}
......
......@@ -76,6 +76,11 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
String token = getToken(request);
if (StringUtils.isNotEmpty(token)) {
try {
boolean signed = Jwts.parser().isSigned(token);
if (!signed) {
log.error("token非法!=>{}", token);
return null;
}
Claims claims = parseToken(token);
String uuid = (String) claims.get(SysConstains.LOGIN_USER_KEY);
String userKey = getTokenKey(uuid);
......
/**
* 文件:ResourceDao.java
* 版本:1.0.0
* 日期:
* Copyright &reg;
* All right reserved.
*/
package com.mortals.xhx.base.system.resource.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.base.system.resource.model.ResourceEntity;
import java.util.List;
/**
* <p>Title: 资源信息</p>
* <p>Description: ResourceDao DAO接口 </p>
* <p>Copyright: Copyright &reg; </p>
* <p>Company: </p>
* @author
* @version 1.0.0
*/
public interface ResourceDao extends ICRUDDao<ResourceEntity,Long> {
List<ResourceEntity> getListByUserId(Long userId);
List<ResourceEntity> getAll(int userType);
}
\ No newline at end of file
/**
* 文件:ResourceDaoImpl.java 版本:1.0.0 日期: Copyright &reg; All right reserved.
*/
package com.mortals.xhx.base.system.resource.dao.ibatis;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.framework.model.ParamDto;
import com.mortals.xhx.base.system.resource.dao.ResourceDao;
import com.mortals.xhx.base.system.resource.model.ResourceEntity;
import org.springframework.stereotype.Repository;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* Title: 资源信息
* </p>
* <p>
* Description: ResourceDaoImpl DAO接口
* </p>
* <p>
* Copyright: Copyright &reg;
* </p>
* <p>
* Company:
* </p>
* @author
* @version 1.0.0
*/
@Repository("resourceDao")
public class ResourceDaoImpl extends BaseCRUDDaoMybatis<ResourceEntity, Long> implements ResourceDao {
@Override
public List<ResourceEntity> getListByUserId(Long userId) {
ParamDto param = new ParamDto();
param.getCondition().put("userId", userId);
return getSqlSession().selectList(getSqlId("getListByUserId"), param);
}
@Override
public List<ResourceEntity> getAll(final int userType) {
return getSqlSession().selectList(getSqlId("getAllByUserType"), new HashMap<String, Object>() {
{
put("userType", userType);
}
});
}
}
\ No newline at end of file
/**
* 文件:ResourceEntity.java
* 版本:1.0.0
* 日期:
* Copyright &reg;
* All right reserved.
*/
package com.mortals.xhx.base.system.resource.model;
import com.mortals.framework.model.BaseEntityLong;
import java.util.Date;
/**
* <p>Title: 资源信息</p>
* <p>Description: ResourceEntity </p>
* <p>Copyright: Copyright &reg; </p>
* <p>Company: </p>
* @author
* @version 1.0.0
*/
public class ResourceEntity extends BaseEntityLong{
private static final long serialVersionUID = 1547777703340L;
/** 名称 */
private String name;
/** 连接地址,多个地址以逗号分隔 */
private String url;
/** 权限类型,0:无限制,1:无需登录查看,2:需要登录查看,3:需要角色权限查看,默认3 */
private Integer authType;
/** 资源类型,0:系统资源,1:开放资源,默认0 */
private Integer sourceType;
/** 创建时间 */
private Date createTime;
/** 创建用户 */
private Long createUserId;
/** 创建用户名称 */
private String createUserName;
/** 用户类型,0:系统用户 1:代理商用户 2:品牌商用户 */
private Integer userType;
public ResourceEntity(){
}
/**
* 获取 名称
* @return name
*/
public String getName(){
return this.name;
}
/**
* 设置 名称
* @param name
*/
public void setName(String name){
this.name = name;
}
/**
* 获取 连接地址,多个地址以逗号分隔
* @return url
*/
public String getUrl(){
return this.url;
}
/**
* 设置 连接地址,多个地址以逗号分隔
* @param url
*/
public void setUrl(String url){
this.url = url;
}
/**
* 获取 权限类型,0:无限制,1:无需登录查看,2:需要登录查看,3:需要角色权限查看,默认3
* @return authType
*/
public Integer getAuthType(){
return this.authType;
}
/**
* 设置 权限类型,0:无限制,1:无需登录查看,2:需要登录查看,3:需要角色权限查看,默认3
* @param authType
*/
public void setAuthType(Integer authType){
this.authType = authType;
}
/**
* 获取 资源类型,0:系统资源,1:开放资源,默认0
* @return sourceType
*/
public Integer getSourceType(){
return this.sourceType;
}
/**
* 设置 资源类型,0:系统资源,1:开放资源,默认0
* @param sourceType
*/
public void setSourceType(Integer sourceType){
this.sourceType = sourceType;
}
/**
* 获取 创建时间
* @return createTime
*/
public Date getCreateTime(){
return this.createTime;
}
/**
* 设置 创建时间
* @param createTime
*/
public void setCreateTime(Date createTime){
this.createTime = createTime;
}
/**
* 获取 创建用户
* @return createUserId
*/
public Long getCreateUserId(){
return this.createUserId;
}
/**
* 设置 创建用户
* @param createUserId
*/
public void setCreateUserId(Long createUserId){
this.createUserId = createUserId;
}
/**
* 获取 创建用户名称
* @return createUserName
*/
public String getCreateUserName(){
return this.createUserName;
}
/**
* 设置 创建用户名称
* @param createUserName
*/
public void setCreateUserName(String createUserName){
this.createUserName = createUserName;
}
/**
* 获取 用户类型,0:系统用户 1:代理商用户 2:品牌商用户
* @return userType
*/
public Integer getUserType(){
return this.userType;
}
/**
* 设置 用户类型,0:系统用户 1:代理商用户 2:品牌商用户
* @param userType
*/
public void setUserType(Integer userType){
this.userType = userType;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null)
return false;
if (obj instanceof ResourceEntity) {
ResourceEntity tmp = (ResourceEntity) obj;
if (this.getId().longValue() == tmp.getId().longValue()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append("id:").append(getId())
.append(",name:").append(getName())
.append(",url:").append(getUrl())
.append(",authType:").append(getAuthType())
.append(",sourceType:").append(getSourceType())
.append(",createTime:").append(getCreateTime())
.append(",createUserId:").append(getCreateUserId())
.append(",createUserName:").append(getCreateUserName())
.append(",userType:").append(getUserType());
return sb.toString();
}
public void initAttrValue(){
this.name = null;
this.url = null;
this.authType = 3;
this.sourceType = 0;
this.createTime = null;
this.createUserId = null;
this.createUserName = null;
this.userType = null;
}
}
\ No newline at end of file
/**
* 文件:ResourceService.java
* 版本:1.0.0
* 日期:
* Copyright &reg;
* All right reserved.
*/
package com.mortals.xhx.base.system.resource.service;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.base.system.resource.model.ResourceEntity;
import java.util.List;
import java.util.Set;
/**
* <p>Title: 资源信息</p>
* <p>Description: ResourceService service接口 </p>
* <p>Copyright: Copyright &reg; </p>
* <p>Company: </p>
* @author
* @version 1.0.0
*/
public interface ResourceService extends ICRUDService<ResourceEntity,Long> {
/**
* 查询所有可用资源
* @return
* @throws AppException
*/
List<ResourceEntity> findAllEnable() throws AppException;
/**
* 根据用户查询可用资源
* @param userId
* @return
* @throws AppException
*/
List<ResourceEntity> findListByUserId(Long userId) throws AppException;
/**
* 查询用户可用资源
* @param userId
* @return 字符串,多个以逗号分隔
* @throws AppException
*/
String findUrlByUserId(Long userId) throws AppException;
/**
* 查询用户用资源集合
* @param userId
* @return
* @throws AppException
*/
Set<String> findUrlSetByUserId(Long userId) throws AppException;
/**
* 获取所有资源,不分页
* @return
* @param userType
*/
List<ResourceEntity> findAll(int userType);
}
\ No newline at end of file
/**
* 文件:ResourceServiceImpl.java
* 版本:1.0.0
* 日期:
* Copyright &reg;
* All right reserved.
*/
package com.mortals.xhx.base.system.resource.service.impl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.resource.dao.ResourceDao;
import com.mortals.xhx.base.system.resource.model.ResourceEntity;
import com.mortals.xhx.base.system.resource.model.ResourceQuery;
import com.mortals.xhx.base.system.resource.service.ResourceService;
import com.mortals.xhx.common.key.RedisKey;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static com.mortals.xhx.common.utils.MenuEncodeUtil.generateMenuUrlCode;
/**
* <p>Title: 资源信息</p>
* <p>Description: ResourceServiceImpl service接口 </p>
* <p>Copyright: Copyright &reg; </p>
* <p>Company: </p>
* @author
* @version 1.0.0
*/
@Service("resourceService")
public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao,ResourceEntity,Long> implements ResourceService {
@Autowired
private ICacheService cacheService;
@Override
public List<ResourceEntity> findAllEnable() throws AppException {
ResourceQuery params = new ResourceQuery();
return dao.getList(params);
}
@Override
public List<ResourceEntity> findListByUserId(Long userId) throws AppException {
return dao.getListByUserId(userId);
}
@Override
public String findUrlByUserId(Long userId) throws AppException {
Set<String> urls = this.findUrlSetByUserId(userId);
return StringUtils.converArray2Str(urls.toArray(new String[urls.size()]));
}
@Override
public Set<String> findUrlSetByUserId(Long userId) throws AppException {
Set<String> urls = new HashSet<>();
List<ResourceEntity> resList = this.findListByUserId(userId);
for (ResourceEntity res : resList) {
String url = res.getUrl();
if (StringUtils.isEmpty(url)) {
continue;
}
url = url.replaceAll(",", ",");
urls.addAll(StringUtils.converStr2Set(url));
}
return urls;
}
@Override
public List<ResourceEntity> findAll(int userType) {
return dao.getAll(userType);
}
@Override
protected void updateAfter(ResourceEntity entity, Context context) throws AppException {
updateUserMenuUrlCache();
}
@Override
protected void saveAfter(ResourceEntity entity, Context context) throws AppException {
updateUserMenuUrlCache();
}
private void updateUserMenuUrlCache() {
//更新用户菜单
Set<String> hkeys = cacheService.hkeys(RedisKey.KEY_USER_MENU_CACHE);
for (String userId : hkeys) {
Set<String> urls = this.findUrlSetByUserId(DataUtil.converStr2Long(userId,0L));
String menuUrlCode = generateMenuUrlCode(urls);
cacheService.hset(RedisKey.KEY_USER_MENU_CACHE, userId,menuUrlCode);
}
}
}
\ No newline at end of file
package com.mortals.xhx.base.system.resource.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.common.code.UserType;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.resource.model.ResourceEntity;
import com.mortals.xhx.base.system.resource.service.ResourceService;
import com.mortals.xhx.common.code.AuthType;
import com.mortals.xhx.common.code.SourceType;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
/**
* 资源信息
*
* @author: zxfei
* @date: 2022/5/7 15:27
*/
@Slf4j
@RestController
@RequestMapping("resource")
public class ResourceController extends BaseCRUDJsonBodyMappingController<ResourceService,ResourceEntity,Long> {
public ResourceController(){
super.setModuleDesc("资源信息");
}
@Override
protected void init(Map<String, Object> model, Context context) {
Map<String, Object> statsus = new HashMap<String, Object>();
statsus.put("authType", AuthType.getEnumMap());
statsus.put("sourceType", SourceType.getEnumMap());
if (getCurUser().isAdmin()) {
statsus.put("userType", IBaseEnum.getEnumMap(UserType.class));
} else {
statsus.put("userType", UserType.findByValue(getCurUser().getUserType()));
}
model.put(KEY_RESULT_DICT, statsus);
}
/**
* 获取所有资源
*
* @return
*/
@PostMapping("allResources")
public String allResources(int userType) {
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "所有的customer以及user");
ret.put(KEY_RESULT_DATA, service.findAll(userType));
return ret.toJSONString();
}
}
\ No newline at end of file
......@@ -10,4 +10,9 @@ public class RedisKey {
*/
public static final String KEY_MENU_CACHE = "iot:base:MenuCacheKey:";
public static final String KEY_USER_MENU_CACHE = "user:menu";
public static final String KEY_BURY_POINT_CACHE = "bury:point";
}
package com.mortals.xhx.common.utils;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.util.AESUtil;
import lombok.extern.slf4j.Slf4j;
import java.util.Set;
@Slf4j
public class MenuEncodeUtil {
public static String generateMenuUrlCode(Set<String> urls) {
try {
String securityKey = GlobalSysInfo.getPropertyValue(SysConstains.PROP_COOKIE_SECURITY_KEY);
StringBuilder sb = new StringBuilder();
if (urls != null && urls.size() > 0) {
for (String url : urls) {
int index = url.hashCode() & (Integer.MAX_VALUE - 1);
sb.append(index).append(",");
}
}
String menuUrl = sb.toString();
return AESUtil.encrypt(menuUrl, securityKey);
} catch (Throwable e) {
log.error("编码异常",e);
return null;
}
}
}
package com.mortals.xhx.daemon.applicationservice;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.springcloud.service.IApplicationStartedService;
import com.mortals.xhx.module.page.model.pdu.BuryPointPdu;
import com.mortals.xhx.module.page.service.PageAccessDepthService;
import com.mortals.xhx.module.page.service.PageAccessService;
import com.mortals.xhx.module.page.service.PageEventService;
import com.mortals.xhx.module.page.service.PageRouteService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import static com.mortals.xhx.common.key.RedisKey.KEY_BURY_POINT_CACHE;
@Component
@Slf4j
public class ComsumerBurySaveService implements IApplicationStartedService {
protected Boolean stopped = false;
@Autowired
private ICacheService cacheService;
@Autowired
private PageAccessService pageAccessService;
@Autowired
private PageAccessDepthService pageAccessDepthService;
@Autowired
private PageEventService pageEventService;
@Autowired
private PageRouteService pageRouteService;
@Override
public void start() {
Thread sendThread = new Thread(new Runnable() {
@Override
public void run() {
int waitTime = 10;
while (!stopped) {
try {
BuryPointPdu pdu = cacheService.lpop(KEY_BURY_POINT_CACHE, BuryPointPdu.class);
if(!ObjectUtils.isEmpty(pdu)){
pageAccessService.saveByPdu(pdu);
pageAccessDepthService.saveByPdu(pdu);
pageEventService.saveByPdu(pdu);
pageRouteService.saveByPdu(pdu);
}
try {
Thread.sleep(waitTime);
} catch (InterruptedException e2) {
}
} catch (Exception e) {
log.error("异常", e);
try {
Thread.sleep(waitTime);
} catch (InterruptedException e2) {
}
}
}
}
});
sendThread.start();
}
@Override
public void stop() {
log.info("停止服务..");
this.stopped = true;
}
@Override
public int getOrder() {
return 50;
}
}
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.web.BaseJsonBodyController;
import com.mortals.xhx.module.page.model.PageInfoEntity;
......@@ -22,6 +23,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.mortals.xhx.common.key.RedisKey.KEY_BURY_POINT_CACHE;
/**
* 页面埋点
*/
......@@ -39,24 +42,26 @@ public class BuryPointController extends BaseJsonBodyController {
private PageRouteService pageRouteService;
@Autowired
private PageInfoService pageInfoService;
@Autowired
private ICacheService cacheService;
@PostMapping({"save"})
@UnAuth
public String save(@RequestBody BuryPointPdu pdu) {
Map<String, Object> model = new HashMap();
Context context = this.getContext();
int code = 1;
String busiDesc = "保存页面数据埋点信息";
try {
validData(pdu);
pageAccessService.saveByPdu(pdu);
pageAccessDepthService.saveByPdu(pdu);
pageEventService.saveByPdu(pdu);
pageRouteService.saveByPdu(pdu);
cacheService.lpush(KEY_BURY_POINT_CACHE,pdu);
// pageAccessService.saveByPdu(pdu);
// pageAccessDepthService.saveByPdu(pdu);
// pageEventService.saveByPdu(pdu);
// pageRouteService.saveByPdu(pdu);
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var7) {
this.doException(this.request, busiDesc, model, var7);
} catch (Exception e) {
this.doException(this.request, busiDesc, model, e);
code = -1;
}
model.put("entity", pdu);
......
......@@ -17,6 +17,8 @@
<property name="showSql" value="MySql" />
</plugin>
<plugin interceptor="com.mortals.framework.thirty.mybatis.LogInterceptor">
<property name="enableExecutorTime" value="true" />
<property name="showSql" value="false" />
</plugin>
</plugins>
</configuration>
\ 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