Commit 0caf677b authored by “yiyousong”'s avatar “yiyousong”
parents abcb7c44 2d8c7757
This diff is collapsed.
......@@ -12,3 +12,6 @@ INSERT INTO `mortals_xhx_resource` VALUES (null, '事项材料公共库-菜单
-- ----------------------------
-- 事项材料公共库参数 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_task` (`id`, `name`, `taskKey`, `status`, `excuteService`, `excuteParam`, `excuteHost`, `excuteStrategy`, `excuteDate`, `excuteTime`, `remark`, `lastExcuteHost`, `lastExcuteTime`, `interimExcuteStatus`, `createTime`, `createUserId`, `createUserName`) VALUES ('4', '同步设备', 'SyncSiteDeviceTask', '0', 'SyncSiteDeviceTask', NULL, NULL, '4', '120', '00:00', NULL, '127.0.1.1', '2023-02-26 22:15:59', '0', '2023-02-25 14:34:12', '1', NULL);
......@@ -285,5 +285,32 @@ CREATE TABLE `mortals_xhx_device` (
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备';
-- ----------------------------
-- 设备事项申请材料业务表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_device_matter_datum`;
CREATE TABLE mortals_xhx_device_matter_datum(
`id` bigint(20) AUTO_INCREMENT COMMENT '主键,自增长',
`siteId` bigint(20) COMMENT '站点ID',
`deviceId` bigint(20) COMMENT '设备id',
`deviceCode` varchar(255) COMMENT '设备编码',
`deviceName` varchar(255) COMMENT '设备名称',
`matterId` bigint(20) COMMENT '事项id',
`matterCode` varchar(255) COMMENT '事项编码',
`matterName` varchar(255) COMMENT '事项名称',
`deptId` bigint(20) COMMENT '部门ID',
`deptCode` varchar(256) COMMENT '部门编号',
`deptName` varchar(256) COMMENT '部门名称',
`source` tinyint(2) COMMENT '事项来源(0.政务网,1.自定义)',
`isRecommend` tinyint(2) COMMENT '是否推荐(0.未推荐,1.推荐)',
`sort` int(4) COMMENT '排序',
`createTime` datetime COMMENT '创建时间',
`createUserId` bigint(20) COMMENT '创建用户',
`updateTime` datetime COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备事项申请材料业务';
......@@ -48,6 +48,7 @@
<id>test</id>
<properties>
<profiles.active>test</profiles.active>
<profiles.server.port>17002</profiles.server.port>
<profiles.server.gatewayport>11078</profiles.server.gatewayport>
<profiles.server.path>/sampleform</profiles.server.path>
<profiles.publish.path>/home/publish</profiles.publish.path>
......@@ -380,8 +381,6 @@
</execution>
</executions>
</plugin>
</plugins>
</build>
......
......@@ -13,6 +13,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
......@@ -35,6 +36,7 @@ public class OperlogAspect extends FileLogServiceImpl implements ILogService {
public void doHandlerLog(String platformMark, Long userId, String userName, String loginName, String requestUrl,
String content, String ip, Date logDate) {
super.doHandlerLog(platformMark, userId, userName, loginName, requestUrl, content, ip, logDate);
if(ObjectUtils.isEmpty(userId)) return;
operLogService.insertOperLog(ip, requestUrl, userId, userName, loginName, content);
}
......
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 是否推荐(0.未推荐,1.推荐)枚举类
*
* @author zxfei
*/
public enum IsRecommendEnum {
未推荐(0, "未推荐"),
推荐(1, "推荐");
private Integer value;
private String desc;
IsRecommendEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static IsRecommendEnum getByValue(Integer value) {
for (IsRecommendEnum isRecommendEnum : IsRecommendEnum.values()) {
if (isRecommendEnum.getValue() == value) {
return isRecommendEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (IsRecommendEnum item : IsRecommendEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
......@@ -4,7 +4,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
/**
* 事项来源 (0.政务网,1.自定义)枚举类
* 事项来源(0.政务网,1.自定义)枚举类
*
* @author zxfei
*/
......
package com.mortals.xhx.module.device.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.device.model.DeviceMatterDatumEntity;
import java.util.List;
/**
* 设备事项申请材料业务Dao
* 设备事项申请材料业务 DAO接口
*
* @author zxfei
* @date 2023-02-25
*/
public interface DeviceMatterDatumDao extends ICRUDDao<DeviceMatterDatumEntity,Long>{
}
package com.mortals.xhx.module.device.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.device.dao.DeviceMatterDatumDao;
import com.mortals.xhx.module.device.model.DeviceMatterDatumEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 设备事项申请材料业务DaoImpl DAO接口
*
* @author zxfei
* @date 2023-02-25
*/
@Repository("deviceMatterDatumDao")
public class DeviceMatterDatumDaoImpl extends BaseCRUDDaoMybatis<DeviceMatterDatumEntity,Long> implements DeviceMatterDatumDao {
}
package com.mortals.xhx.module.device.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.mortals.xhx.module.device.model.vo.DeviceMatterDatumVo;
/**
* 设备事项申请材料业务实体对象
*
* @author zxfei
* @date 2023-03-23
*/
public class DeviceMatterDatumEntity extends DeviceMatterDatumVo {
private static final long serialVersionUID = 1L;
/**
* 站点ID
*/
private Long siteId;
/**
* 设备id
*/
private Long deviceId;
/**
* 设备编码
*/
private String deviceCode;
/**
* 设备名称
*/
private String deviceName;
/**
* 事项id
*/
private Long matterId;
/**
* 事项编码
*/
private String matterCode;
/**
* 事项名称
*/
private String matterName;
/**
* 部门ID
*/
private Long deptId;
/**
* 部门编号
*/
private String deptCode;
/**
* 部门名称
*/
private String deptName;
/**
* 事项来源(0.政务网,1.自定义)
*/
private Integer source;
/**
* 是否推荐(0.未推荐,1.推荐)
*/
private Integer isRecommend;
/**
* 排序
*/
private Integer sort;
public DeviceMatterDatumEntity(){}
/**
* 获取 站点ID
* @return Long
*/
public Long getSiteId(){
return siteId;
}
/**
* 设置 站点ID
* @param siteId
*/
public void setSiteId(Long siteId){
this.siteId = siteId;
}
/**
* 获取 设备id
* @return Long
*/
public Long getDeviceId(){
return deviceId;
}
/**
* 设置 设备id
* @param deviceId
*/
public void setDeviceId(Long deviceId){
this.deviceId = deviceId;
}
/**
* 获取 设备编码
* @return String
*/
public String getDeviceCode(){
return deviceCode;
}
/**
* 设置 设备编码
* @param deviceCode
*/
public void setDeviceCode(String deviceCode){
this.deviceCode = deviceCode;
}
/**
* 获取 设备名称
* @return String
*/
public String getDeviceName(){
return deviceName;
}
/**
* 设置 设备名称
* @param deviceName
*/
public void setDeviceName(String deviceName){
this.deviceName = deviceName;
}
/**
* 获取 事项id
* @return Long
*/
public Long getMatterId(){
return matterId;
}
/**
* 设置 事项id
* @param matterId
*/
public void setMatterId(Long matterId){
this.matterId = matterId;
}
/**
* 获取 事项编码
* @return String
*/
public String getMatterCode(){
return matterCode;
}
/**
* 设置 事项编码
* @param matterCode
*/
public void setMatterCode(String matterCode){
this.matterCode = matterCode;
}
/**
* 获取 事项名称
* @return String
*/
public String getMatterName(){
return matterName;
}
/**
* 设置 事项名称
* @param matterName
*/
public void setMatterName(String matterName){
this.matterName = matterName;
}
/**
* 获取 部门ID
* @return Long
*/
public Long getDeptId(){
return deptId;
}
/**
* 设置 部门ID
* @param deptId
*/
public void setDeptId(Long deptId){
this.deptId = deptId;
}
/**
* 获取 部门编号
* @return String
*/
public String getDeptCode(){
return deptCode;
}
/**
* 设置 部门编号
* @param deptCode
*/
public void setDeptCode(String deptCode){
this.deptCode = deptCode;
}
/**
* 获取 部门名称
* @return String
*/
public String getDeptName(){
return deptName;
}
/**
* 设置 部门名称
* @param deptName
*/
public void setDeptName(String deptName){
this.deptName = deptName;
}
/**
* 获取 事项来源(0.政务网,1.自定义)
* @return Integer
*/
public Integer getSource(){
return source;
}
/**
* 设置 事项来源(0.政务网,1.自定义)
* @param source
*/
public void setSource(Integer source){
this.source = source;
}
/**
* 获取 是否推荐(0.未推荐,1.推荐)
* @return Integer
*/
public Integer getIsRecommend(){
return isRecommend;
}
/**
* 设置 是否推荐(0.未推荐,1.推荐)
* @param isRecommend
*/
public void setIsRecommend(Integer isRecommend){
this.isRecommend = isRecommend;
}
/**
* 获取 排序
* @return Integer
*/
public Integer getSort(){
return sort;
}
/**
* 设置 排序
* @param sort
*/
public void setSort(Integer sort){
this.sort = sort;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof DeviceMatterDatumEntity) {
DeviceMatterDatumEntity tmp = (DeviceMatterDatumEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",siteId:").append(getSiteId());
sb.append(",deviceId:").append(getDeviceId());
sb.append(",deviceCode:").append(getDeviceCode());
sb.append(",deviceName:").append(getDeviceName());
sb.append(",matterId:").append(getMatterId());
sb.append(",matterCode:").append(getMatterCode());
sb.append(",matterName:").append(getMatterName());
sb.append(",deptId:").append(getDeptId());
sb.append(",deptCode:").append(getDeptCode());
sb.append(",deptName:").append(getDeptName());
sb.append(",source:").append(getSource());
sb.append(",isRecommend:").append(getIsRecommend());
sb.append(",sort:").append(getSort());
return sb.toString();
}
public void initAttrValue(){
this.siteId = null;
this.deviceId = null;
this.deviceCode = null;
this.deviceName = null;
this.matterId = null;
this.matterCode = null;
this.matterName = null;
this.deptId = null;
this.deptCode = null;
this.deptName = null;
this.source = null;
this.isRecommend = null;
this.sort = null;
}
}
\ No newline at end of file
package com.mortals.xhx.module.device.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.device.model.DeviceMatterDatumEntity;
import com.mortals.xhx.module.matter.model.MatterDatumEntity;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* 设备事项申请材料业务视图对象
*
* @author zxfei
* @date 2023-02-25
*/
@Data
public class DeviceMatterDatumVo extends BaseEntityLong {
private List<MatterDatumEntity> matterDatumList;
}
\ No newline at end of file
package com.mortals.xhx.module.device.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.device.model.DeviceMatterDatumEntity;
/**
* DeviceMatterDatumService
*
* 设备事项申请材料业务 service接口
*
* @author zxfei
* @date 2023-02-25
*/
public interface DeviceMatterDatumService extends ICRUDService<DeviceMatterDatumEntity,Long>{
}
\ No newline at end of file
package com.mortals.xhx.module.device.service.impl;
import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.module.device.model.DeviceEntity;
import com.mortals.xhx.module.device.service.DeviceService;
import com.mortals.xhx.module.matter.model.MatterDatumEntity;
import com.mortals.xhx.module.matter.model.MatterDatumQuery;
import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.matter.service.MatterDatumService;
import com.mortals.xhx.module.matter.service.MatterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.device.dao.DeviceMatterDatumDao;
import com.mortals.xhx.module.device.model.DeviceMatterDatumEntity;
import com.mortals.xhx.module.device.service.DeviceMatterDatumService;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.List;
/**
* DeviceMatterDatumService
* 设备事项申请材料业务 service实现
*
* @author zxfei
* @date 2023-02-25
*/
@Service("deviceMatterDatumService")
public class DeviceMatterDatumServiceImpl extends AbstractCRUDServiceImpl<DeviceMatterDatumDao, DeviceMatterDatumEntity, Long> implements DeviceMatterDatumService {
@Autowired
private MatterService matterService;
@Autowired
private DeviceService deviceService;
@Autowired
private MatterDatumService matterDatumService;
@Override
protected void findAfter(DeviceMatterDatumEntity params, PageInfo pageInfo, Context context, List<DeviceMatterDatumEntity> list) throws AppException {
//super.findAfter(params, pageInfo, context, list);
list.forEach(item->{
List<MatterDatumEntity> matterDatumEntities = matterDatumService.find(new MatterDatumQuery().matterId(item.getMatterId()));
if(!ObjectUtils.isEmpty(matterDatumEntities)){
item.setMatterDatumList(matterDatumEntities);
}else{
item.setMatterDatumList(new ArrayList<>());
}
});
}
@Override
protected void saveBefore(DeviceMatterDatumEntity entity, Context context) throws AppException {
super.saveBefore(entity, context);
//entity.getMatterId()
if(!ObjectUtils.isEmpty(entity.getMatterId())){
MatterEntity matterEntity = matterService.get(entity.getMatterId());
if(!ObjectUtils.isEmpty(matterEntity)){
entity.setMatterCode(matterEntity.getMatterNo());
entity.setMatterName(matterEntity.getMatterName());
entity.setDeptId(matterEntity.getDeptId());
entity.setDeptCode(matterEntity.getDeptCode());
entity.setDeptName(matterEntity.getDeptName());
}
}
if(!ObjectUtils.isEmpty(entity.getDeviceId())){
DeviceEntity deviceEntity = deviceService.get(entity.getDeviceId());
if(!ObjectUtils.isEmpty(deviceEntity)){
entity.setDeviceCode(deviceEntity.getDeviceCode());
entity.setDeviceName(deviceEntity.getDeviceName());
}
}
}
@Override
protected void updateBefore(DeviceMatterDatumEntity entity, Context context) throws AppException {
super.updateBefore(entity, context);
}
}
\ 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