Commit a18b074c authored by 赵啸非's avatar 赵啸非

添加初始值

parent 4b162468
This diff is collapsed.
......@@ -228,6 +228,24 @@
</resources>
</configuration>
</execution>
<execution>
<id>copy-db</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<outputDirectory>${project.basedir}/dist/${project.artifactId}/db</outputDirectory>
<resources>
<resource>
<directory>db/</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
......
package com.mortals.xhx.common.utils;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.matter.service.MatterService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* 同步部门数据
*
* @author: zxfei
* @date: 2022/4/13 13:34
* @description:
**/
@AllArgsConstructor
@Slf4j
public class SyncDeptThread implements Runnable {
private DeptService deptService;
@Override
public void run() {
deptService.syncDept(null);
}
}
package com.mortals.xhx.common.utils;
import com.alibaba.fastjson.JSON;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.matter.service.MatterService;
import com.mortals.xhx.module.site.model.SiteTreeSelect;
import com.mortals.xhx.module.site.service.SiteService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
/**
* 同步基础事项数据
*
* @author: zxfei
* @date: 2022/4/13 13:34
* @description:
**/
@AllArgsConstructor
@Slf4j
public class SyncTreeMatterThread implements Runnable {
private MatterService matterService;
@Override
public void run() {
matterService.syncMatter(null);
}
}
package com.mortals.xhx.daemon;
import cn.hutool.core.io.FileUtil;
import cn.hutool.setting.Setting;
import cn.hutool.setting.dialect.Props;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.Constant;
import com.mortals.framework.common.Rest;
import com.mortals.framework.util.ThreadPool;
import com.mortals.xhx.common.pdu.ApiRespPdu;
import com.mortals.xhx.module.matter.model.MatterDatumEntity;
import com.mortals.xhx.module.matter.model.MatterDatumFileEntity;
import com.mortals.xhx.module.matter.service.*;
import com.mortals.xhx.module.matters.service.MattersDetailService;
import com.mortals.xhx.module.matters.service.MattersService;
import com.mortals.xhx.common.utils.SyncDeptThread;
import com.mortals.xhx.common.utils.SyncTreeMatterThread;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.matter.service.MatterService;
import lombok.extern.apachecommons.CommonsLog;
import org.checkerframework.checker.units.qual.A;
import org.checkerframework.checker.units.qual.K;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
......@@ -44,6 +36,8 @@ public class RequestDataController {
@Autowired
private MatterService matterService;
@Autowired
private DeptService deptService;
/**
* 生成基础数据prop
......@@ -87,19 +81,27 @@ public class RequestDataController {
return respPdu;
}
/**
* 同步事项数据
* 同步部门数据
*
* @return
*/
@PostMapping("/syncMatter")
public ApiRespPdu<String> syncMatter() {
ApiRespPdu<String> respPdu = new ApiRespPdu<>();
@GetMapping("/syncDept")
public Rest<String> syncDept() {
ThreadPool.getInstance().execute(new SyncDeptThread(deptService));
return Rest.ok("接收同步部门成功");
}
matterService.syncMatter(null);
return respPdu;
/**
* 同步事项数据
*
* @return
*/
@GetMapping("/syncMatter")
public Rest<String> syncMatter() {
ThreadPool.getInstance().execute(new SyncTreeMatterThread(matterService));
return Rest.ok("接收同步成功");
}
private void checkKeyValue(BiMap<String, String> map, Map.Entry<String, Object> m, String value) {
......
package com.mortals.xhx.module.dept.service;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDCacheService;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.dept.model.DeptEntity;
......@@ -12,4 +13,10 @@ import com.mortals.xhx.module.dept.model.DeptEntity;
*/
public interface DeptService extends ICRUDCacheService<DeptEntity,Long> {
/**
* 同步政务网部门数据
* @param context
*/
void syncDept(Context context);
}
\ No newline at end of file
package com.mortals.xhx.module.dept.service.impl;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.xhx.module.area.service.AreaService;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.matters.model.MattersDeptEntity;
import com.mortals.xhx.module.matters.model.MattersDeptQuery;
import com.mortals.xhx.module.matters.service.MattersDeptService;
import com.mortals.xhx.module.matters.service.MattersService;
import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.service.SiteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.dept.dao.DeptDao;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.service.DeptService;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.List;
/**
* DeptService
* 部门 service实现
*
* @author zxfei
* @date 2022-01-12
*/
* DeptService
* 部门 service实现
*
* @author zxfei
* @date 2022-01-12
*/
@Service("deptService")
public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptEntity, Long> implements DeptService {
@Autowired
private SiteService siteService;
@Autowired
private DeptService deptService;
@Autowired
private MattersDeptService mattersDeptService;
@Override
public void syncDept(Context context) {
List<MattersDeptEntity> deptList = mattersDeptService.find(new MattersDeptQuery());
deptList.forEach(dept -> {
//根据区域查询当前区域下存在的站点
List<SiteEntity> siteEntityList = siteService.getFlatSitesByAreaCode(dept.getAreaCode(), context);
siteEntityList.forEach(site -> {
//根据站点添加部门信息,部门编号存在时候不添加
DeptEntity deptExistEntity = deptService.selectOne(new DeptQuery().siteId(site.getId()).deptNumber(dept.getDeptCode()), context);
if (ObjectUtils.isEmpty(deptExistEntity)) {
DeptEntity deptEntity = new DeptEntity();
deptEntity.initAttrValue();
deptEntity.setDeptNumber(dept.getDeptCode());
deptEntity.setSiteId(site.getId());
deptEntity.setName(dept.getName());
deptEntity.setCreateTime(new Date());
deptEntity.setCreateUserId(1L);
deptService.save(deptEntity, context);
}
});
});
}
}
\ No newline at end of file
......@@ -125,9 +125,9 @@ public class MatterAcceptEntity extends MatterAcceptVo {
this.matterId = 0L;
this.matterName = null;
this.matterName = "";
this.content = null;
this.content = "";
this.source = 0;
}
......
......@@ -93,9 +93,6 @@ public class MatterChargesEntity extends MatterChargesVo {
this.source = source;
}
@Override
public int hashCode() {
return this.getId().hashCode();
......@@ -125,9 +122,9 @@ public class MatterChargesEntity extends MatterChargesVo {
this.matterId = 0L;
this.matterName = null;
this.matterName = "";
this.content = null;
this.content = "";
this.source = 0;
}
......
......@@ -460,7 +460,7 @@ public class MatterDatumEntity extends MatterDatumVo {
this.matterId = null;
this.matterName = null;
this.matterName = "";
this.materialName = "";
......@@ -476,11 +476,11 @@ public class MatterDatumEntity extends MatterDatumVo {
this.paperNum = 1;
this.paperGg = null;
this.paperGg = "";
this.jianmMs = "无";
this.sealWay = null;
this.sealWay = "";
this.isjianm = "是";
......@@ -490,13 +490,13 @@ public class MatterDatumEntity extends MatterDatumVo {
this.materialSourceSm = "";
this.remarkSub = null;
this.remarkSub = "";
this.clauseContent = null;
this.clauseContent = "";
this.summary = null;
this.summary = "";
this.remark = null;
this.remark = "";
this.source = 1;
}
......
......@@ -182,15 +182,15 @@ public class MatterFlowlimitEntity extends MatterFlowlimitVo {
this.matterId = 0L;
this.matterName = null;
this.matterName = "";
this.flowName = null;
this.flowName = "";
this.flowTime = null;
this.flowTime = "";
this.flowLimit = null;
this.flowLimit = "";
this.flowDesc = null;
this.flowDesc = "";
this.source = 0;
}
......
package com.mortals.xhx.module.matter.model;
import java.util.Date;
import java.util.List;
import com.mortals.xhx.module.matter.model.MatterEntity;
/**
* 基础事项查询对象
*
* @author zxfei
* @date 2022-01-20
* @date 2022-10-13
*/
public class MatterQuery extends MatterEntity {
/** 开始 序号,主键,自增长 */
......@@ -50,6 +52,30 @@ public class MatterQuery extends MatterEntity {
/** 事项编号 */
private List<String> matterNoList;
/** 区域编码 */
private List<String> areaCodeList;
/** 部门编号 */
private List<String> deptCodeList;
/** 行政权力编号 */
private List<String> powerCodeList;
/** 主题编号 */
private List<String> themeCodeList;
/** 服务类型编号 */
private List<String> usertypeCodeList;
/** 事项组名 */
private List<String> groupNameList;
/** 事项详情链接 */
private List<String> urlList;
/** 是否获取事项详情 */
private List<String> haveGetMatterInfoList;
/** 所属部门 */
private List<String> belongDeptList;
......@@ -522,6 +548,126 @@ public class MatterQuery extends MatterEntity {
public void setMatterNoList(List<String> matterNoList){
this.matterNoList = matterNoList;
}
/**
* 获取 区域编码
* @return areaCodeList
*/
public List<String> getAreaCodeList(){
return this.areaCodeList;
}
/**
* 设置 区域编码
* @param areaCodeList
*/
public void setAreaCodeList(List<String> areaCodeList){
this.areaCodeList = areaCodeList;
}
/**
* 获取 部门编号
* @return deptCodeList
*/
public List<String> getDeptCodeList(){
return this.deptCodeList;
}
/**
* 设置 部门编号
* @param deptCodeList
*/
public void setDeptCodeList(List<String> deptCodeList){
this.deptCodeList = deptCodeList;
}
/**
* 获取 行政权力编号
* @return powerCodeList
*/
public List<String> getPowerCodeList(){
return this.powerCodeList;
}
/**
* 设置 行政权力编号
* @param powerCodeList
*/
public void setPowerCodeList(List<String> powerCodeList){
this.powerCodeList = powerCodeList;
}
/**
* 获取 主题编号
* @return themeCodeList
*/
public List<String> getThemeCodeList(){
return this.themeCodeList;
}
/**
* 设置 主题编号
* @param themeCodeList
*/
public void setThemeCodeList(List<String> themeCodeList){
this.themeCodeList = themeCodeList;
}
/**
* 获取 服务类型编号
* @return usertypeCodeList
*/
public List<String> getUsertypeCodeList(){
return this.usertypeCodeList;
}
/**
* 设置 服务类型编号
* @param usertypeCodeList
*/
public void setUsertypeCodeList(List<String> usertypeCodeList){
this.usertypeCodeList = usertypeCodeList;
}
/**
* 获取 事项组名
* @return groupNameList
*/
public List<String> getGroupNameList(){
return this.groupNameList;
}
/**
* 设置 事项组名
* @param groupNameList
*/
public void setGroupNameList(List<String> groupNameList){
this.groupNameList = groupNameList;
}
/**
* 获取 事项详情链接
* @return urlList
*/
public List<String> getUrlList(){
return this.urlList;
}
/**
* 设置 事项详情链接
* @param urlList
*/
public void setUrlList(List<String> urlList){
this.urlList = urlList;
}
/**
* 获取 是否获取事项详情
* @return haveGetMatterInfoList
*/
public List<String> getHaveGetMatterInfoList(){
return this.haveGetMatterInfoList;
}
/**
* 设置 是否获取事项详情
* @param haveGetMatterInfoList
*/
public void setHaveGetMatterInfoList(List<String> haveGetMatterInfoList){
this.haveGetMatterInfoList = haveGetMatterInfoList;
}
/**
* 获取 所属部门
* @return belongDeptList
......@@ -1989,6 +2135,158 @@ public class MatterQuery extends MatterEntity {
}
/**
* 设置 区域编码
* @param areaCode
*/
public MatterQuery areaCode(String areaCode){
setAreaCode(areaCode);
return this;
}
/**
* 设置 区域编码
* @param areaCodeList
*/
public MatterQuery areaCodeList(List<String> areaCodeList){
this.areaCodeList = areaCodeList;
return this;
}
/**
* 设置 部门编号
* @param deptCode
*/
public MatterQuery deptCode(String deptCode){
setDeptCode(deptCode);
return this;
}
/**
* 设置 部门编号
* @param deptCodeList
*/
public MatterQuery deptCodeList(List<String> deptCodeList){
this.deptCodeList = deptCodeList;
return this;
}
/**
* 设置 行政权力编号
* @param powerCode
*/
public MatterQuery powerCode(String powerCode){
setPowerCode(powerCode);
return this;
}
/**
* 设置 行政权力编号
* @param powerCodeList
*/
public MatterQuery powerCodeList(List<String> powerCodeList){
this.powerCodeList = powerCodeList;
return this;
}
/**
* 设置 主题编号
* @param themeCode
*/
public MatterQuery themeCode(String themeCode){
setThemeCode(themeCode);
return this;
}
/**
* 设置 主题编号
* @param themeCodeList
*/
public MatterQuery themeCodeList(List<String> themeCodeList){
this.themeCodeList = themeCodeList;
return this;
}
/**
* 设置 服务类型编号
* @param usertypeCode
*/
public MatterQuery usertypeCode(String usertypeCode){
setUsertypeCode(usertypeCode);
return this;
}
/**
* 设置 服务类型编号
* @param usertypeCodeList
*/
public MatterQuery usertypeCodeList(List<String> usertypeCodeList){
this.usertypeCodeList = usertypeCodeList;
return this;
}
/**
* 设置 事项组名
* @param groupName
*/
public MatterQuery groupName(String groupName){
setGroupName(groupName);
return this;
}
/**
* 设置 事项组名
* @param groupNameList
*/
public MatterQuery groupNameList(List<String> groupNameList){
this.groupNameList = groupNameList;
return this;
}
/**
* 设置 事项详情链接
* @param url
*/
public MatterQuery url(String url){
setUrl(url);
return this;
}
/**
* 设置 事项详情链接
* @param urlList
*/
public MatterQuery urlList(List<String> urlList){
this.urlList = urlList;
return this;
}
/**
* 设置 是否获取事项详情
* @param haveGetMatterInfo
*/
public MatterQuery haveGetMatterInfo(String haveGetMatterInfo){
setHaveGetMatterInfo(haveGetMatterInfo);
return this;
}
/**
* 设置 是否获取事项详情
* @param haveGetMatterInfoList
*/
public MatterQuery haveGetMatterInfoList(List<String> haveGetMatterInfoList){
this.haveGetMatterInfoList = haveGetMatterInfoList;
return this;
}
/**
* 设置 所属部门
* @param belongDept
......
......@@ -144,11 +144,11 @@ public class MatterQuestionEntity extends MatterQuestionVo {
this.matterId = 0L;
this.matterName = null;
this.matterName = "";
this.question = null;
this.question = "";
this.answer = null;
this.answer = "";
this.source = 0;
}
......
......@@ -182,15 +182,15 @@ public class MatterSetbaseEntity extends MatterSetbaseVo {
this.matterId = 0L;
this.matterName = null;
this.matterName = "";
this.policyName = null;
this.policyName = "";
this.policyType = "法律";
this.policyitem = null;
this.policyitem = "";
this.content = null;
this.content = "";
this.source = 0;
}
......
package com.mortals.xhx.module.workman.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.alibaba.fastjson.JSON;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.workman.model.vo.WorkmanVo;
import org.springframework.beans.BeanUtils;
/**
* 工作人员实体对象
*
......@@ -551,4 +550,20 @@ public class WorkmanEntity extends WorkmanVo {
this.dangyuanext = "";
}
public static void main(String[] args) {
WorkmanEntity source = new WorkmanEntity();
source.setLoginName("admin");
source.setLoginPwd("123456");
WorkmanEntity workmanEntity = new WorkmanEntity();
workmanEntity.initAttrValue();
//BeanUtils.copyProperties(source,workmanEntity, BeanUtil.getNullPropertyNames(source));
BeanUtils.copyProperties(workmanEntity,source, BeanUtil.getNullPropertyNames(workmanEntity));
System.out.println(JSON.toJSONString(source));
}
}
\ No newline at end of file
{
"base-local": {
"baseUrl": "http://127.0.0.1:17214/base"
"baseUrl": "http://127.0.0.1:17211/base"
},
"base-dev": {
"baseUrl": "http://192.168.0.217:17211/base"
"baseUrl": "http://192.168.0.60:17211/base"
},
"base-test": {
"baseUrl": "http://192.168.0.98:11078/base"
......
......@@ -106,7 +106,7 @@ client.global.set("Matter_id", JSON.parse(response.body).data.id);
%}
###基础事项查看
GET {{baseUrl}}/matter/info?id={{Matter_id}}
GET {{baseUrl}}/matter/info?id=6071
Accept: application/json
###基础事项编辑
......
......@@ -4,10 +4,7 @@ POST {{baseUrl}}/site/matter/list
Content-Type: application/json
{
"siteId":9277 ,
"siteName":"ew9wke" ,
"matterId":5364 ,
"matterName":"gpdtup" ,
"siteId":21 ,
"page":1,
"size":10
}
......
......@@ -50,5 +50,13 @@ GET {{baseUrl}}/sms/set/delete?id={{SmsSet_id}}
Accept: application/json
###同步数据
GET {{baseUrl}}/test/syncMatter
Accept: application/json
###同步数据
GET {{baseUrl}}/test/syncDept
Accept: application/json
......@@ -28,32 +28,12 @@ Content-Type: application/json
###工作人员更新与保存
POST {{baseUrl}}/workman/save
Authorization: {{authToken}}
Content-Type: application/json
{
"userName":"workman",
"password": "123456",
"deptId":1,
"deptName":"测试站点部门",
"windowId":1,
"windowName":"测试窗口1",
"siteId":1,
"siteName":"测试站点",
"name":"w8oamz",
"number":"8ylq9h",
"userpost":"4nl4dx",
"posttitle":"8qv5uh",
"politicalstatus":1,
"dangyuan":1,
"phone":"sotmv2",
"mobile":"4oj2d8",
"starlevel":1,
"summary":"ypajwa",
"photoPath":"/xxxx/xx.jepg",
"duty":"aahncs",
"promise":"av4y8s",
"business":"eir0kk",
"online":1
"loginName":"workman1",
"loginPwd": "123456"
}
> {%
......
......@@ -28,18 +28,17 @@ public class RabbitConfig {
}
//修改系列和与反序列化转换器
@Bean
public MessageConverter messageConverter() {
return new Jackson2JsonMessageConverter();
}
// @Bean
// public MessageConverter messageConverter() {
// return new Jackson2JsonMessageConverter();
// }
@Bean
//@Bean
public AsyncRabbitTemplate asyncRabbitTemplate(RabbitTemplate rabbitTemplate) {
AsyncRabbitTemplate asyncRabbitTemplate = new AsyncRabbitTemplate(rabbitTemplate);
asyncRabbitTemplate.setReceiveTimeout(10000);
return asyncRabbitTemplate;
}
}
This diff is collapsed.
This diff is collapsed.
......@@ -136,12 +136,8 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
......@@ -204,6 +200,24 @@
</resources>
</configuration>
</execution>
<execution>
<id>copy-db</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<outputDirectory>${project.basedir}/dist/${project.artifactId}/db</outputDirectory>
<resources>
<resource>
<directory>db/</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
......
......@@ -57,15 +57,16 @@
<profile>
<id>product</id>
<properties>
<profiles.active>product</profiles.active>
<profiles.active>test</profiles.active>
<profiles.server.port>17214</profiles.server.port>
<profiles.queue.type>rabbitmq</profiles.queue.type>
<profiles.kafka.brokers>192.168.0.100:9092</profiles.kafka.brokers>
<profiles.rabbitmq.host>192.168.0.100</profiles.rabbitmq.host>
<profiles.rabbitmq.host>127.0.0.1</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.nacos.server-addr>192.168.0.100:8848</profiles.nacos.server-addr>
<profiles.rabbitmq.username>root_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>xhx@2022</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>stp</profiles.nacos.namespace>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.path>/mortals/app/logs</profiles.log.path>
</properties>
</profile>
......
......@@ -19,7 +19,7 @@ fi
echo "stoping application $PROJECT_NAME......"
kill -9 ${pid}
kill -15 ${pid}
echo "Send shutdown request to Server $PROJECT_NAME OK"
......
......@@ -112,7 +112,7 @@ security:
- /resource/sms/code
logging:
level:
reactor.netty: DEBUG
reactor.netty: info
org.springframework.cloud.gateway: TRACE
......
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