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

添加样表设备列表

parent 3f4348d0
......@@ -2574,14 +2574,10 @@ dict|object|字典对象
:---|:---|:---|:------
page|Integer|否|当前页
size|Integer|否|每页条数,值为-1,查询所有记录
deviceCode|String|否|设备编码,字段前后添加%%模糊查询
siteId|Long|否|站点ID
**请求样例:**
```
{
"deviceCode":"rzc79g",
"siteId":2780,
"page":1,
"size":10
}
......@@ -2603,19 +2599,18 @@ data|object|数据对象
  deviceId|Long|设备id
  deviceCode|String|设备编码
  deviceName|String|设备名称
  productId|Long|产品id
  productCode|String|产品编码
  productName|String|产品名称
  matterId|Long|事项matter id
  matterId|Long|事项id
  matterCode|String|事项编码
  matterName|String|事项名称
  siteId|Long|站点ID
  deptId|Long|部门ID
  deptCode|String|部门编号
  deptName|String|部门名称
  materialName|String|材料名
  materiaFullName|String|材料全名
  materialId|Long|材料id
  source|Integer|事项来源(0.政务网,1.自定义)
  isRecommend|Integer|是否推荐(0.未推荐,1.推荐)
  total|Integer|填单次数
  sort|Integer|排序
  sampleName|String|样表名称
  samplePath|String|样表地址
......@@ -2667,19 +2662,18 @@ data|object|数据对象
 deviceId|Long|设备id
 deviceCode|String|设备编码
 deviceName|String|设备名称
 productId|Long|产品id
 productCode|String|产品编码
 productName|String|产品名称
 matterId|Long|事项matter id
 matterId|Long|事项id
 matterCode|String|事项编码
 matterName|String|事项名称
 siteId|Long|站点ID
 deptId|Long|部门ID
 deptCode|String|部门编号
 deptName|String|部门名称
 materialName|String|材料名
 materiaFullName|String|材料全名
 materialId|Long|材料id
 source|Integer|事项来源(0.政务网,1.自定义)
 isRecommend|Integer|是否推荐(0.未推荐,1.推荐)
 total|Integer|填单次数
 sort|Integer|排序
 sampleName|String|样表名称
 samplePath|String|样表地址
......@@ -2696,29 +2690,28 @@ dict|object|字典对象
{
"code": 1,
"data": {
"id":5825,
"deviceId":6905,
"deviceCode":"cj8jgr",
"deviceName":"qdzsth",
"productId":3706,
"productCode":"tg3ujg",
"productName":"n5imno",
"matterId":1158,
"siteId":8335,
"deptId":1677,
"deptCode":"66r1h3",
"deptName":"5hc964",
"materialName":"cvzy4g",
"materiaFullName":"2igxs2",
"source":5604,
"isRecommend":9780,
"total":4803,
"sort":1159,
"sampleName":"77132s",
"samplePath":"xvk0ag",
"preViewPath":"rrotwe",
"id":7287,
"deviceId":4805,
"deviceCode":"ezsu52",
"deviceName":"gio16r",
"matterId":8179,
"matterCode":"wuz4op",
"matterName":"3j5eg0",
"siteId":9985,
"deptId":3702,
"deptCode":"dvslci",
"deptName":"urebgs",
"materialName":"znzxp8",
"materiaFullName":"ar03ng",
"materialId":3055,
"source":6317,
"isRecommend":1887,
"sort":5527,
"sampleName":"f6e961",
"samplePath":"67xnm5",
"preViewPath":"r6w3s6",
"createTime":"2023-03-22",
"createUserId":4039,
"createUserId":8413,
"updateTime":"2023-03-22"
}
}
......@@ -2739,49 +2732,16 @@ dict|object|字典对象
参数名称|类型|必填|描述
:---|:---|:---|:-------
deviceId|Long|否|设备id
deviceCode|String|否|设备编码
deviceName|String|否|设备名称
productId|Long|否|产品id
productCode|String|否|产品编码
productName|String|否|产品名称
matterId|Long|否|事项matter id
matterId|Lon;g|否|事项id
siteId|Long|否|站点ID
deptId|Long|否|部门ID
deptCode|String|否|部门编号
deptName|String|否|部门名称
materialName|String|是|材料名
materiaFullName|String|是|材料全名
source|Integer|否|事项来源(0.政务网,1.自定义)
isRecommend|Integer|否|是否推荐(0.未推荐,1.推荐)
total|Integer|否|填单次数
sort|Integer|否|排序
sampleName|String|否|样表名称
samplePath|String|否|样表地址
preViewPath|String|否|样表预览地址
materialId|Long|否|材料id
**请求样例:**
```
{
"deviceId":9361,
"deviceCode":"1agfuz",
"deviceName":"spki1w",
"productId":6615,
"productCode":"i6vl7d",
"productName":"5t3w5l",
"matterId":6353,
"siteId":7531,
"deptId":6542,
"deptCode":"ztdhof",
"deptName":"fsyyb1",
"materialName":"xgj2mj",
"materiaFullName":"93hwso",
"source":8702,
"isRecommend":461,
"total":6075,
"sort":2402,
"sampleName":"rjg0l9",
"samplePath":"oxh5zs",
"preViewPath":"kgbgzv",
"deviceId":9730,
"matterId":5750,
"materialId":8061
}
```
......@@ -2798,19 +2758,18 @@ data|object|数据对象
  deviceId|Long|设备id
  deviceCode|String|设备编码
  deviceName|String|设备名称
  productId|Long|产品id
  productCode|String|产品编码
  productName|String|产品名称
  matterId|Long|事项matter id
  matterId|Long|事项id
  matterCode|String|事项编码
  matterName|String|事项名称
  siteId|Long|站点ID
  deptId|Long|部门ID
  deptCode|String|部门编号
  deptName|String|部门名称
  materialName|String|材料名
  materiaFullName|String|材料全名
  materialId|Long|材料id
  source|Integer|事项来源(0.政务网,1.自定义)
  isRecommend|Integer|是否推荐(0.未推荐,1.推荐)
  total|Integer|填单次数
  sort|Integer|排序
  sampleName|String|样表名称
  samplePath|String|样表地址
......@@ -2863,4 +2822,3 @@ msg|String|消息|-
"code":1,
"msg":"成功"
}
......@@ -294,19 +294,18 @@ CREATE TABLE mortals_xhx_device_matter_datum(
`deviceId` bigint(20) COMMENT '设备id',
`deviceCode` varchar(255) COMMENT '设备编码',
`deviceName` varchar(255) COMMENT '设备名称',
`productId` bigint(20) COMMENT '产品id',
`productCode` varchar(255) COMMENT '产品编码',
`productName` varchar(255) COMMENT '产品名称',
`matterId` bigint(20) COMMENT '事项matter id',
`matterId` bigint(20) COMMENT '事项id',
`matterCode` varchar(255) COMMENT '事项编码',
`matterName` varchar(255) COMMENT '事项名称',
`siteId` bigint(20) COMMENT '站点ID',
`deptId` bigint(20) COMMENT '部门ID',
`deptCode` varchar(256) COMMENT '部门编号',
`deptName` varchar(256) COMMENT '部门名称',
`materialName` varchar(1024) NOT NULL COMMENT '材料名',
`materiaFullName` varchar(1024) NOT NULL COMMENT '材料全名',
`materialName` varchar(1024) COMMENT '材料名',
`materiaFullName` varchar(1024) COMMENT '材料全名',
`materialId` bigint(20) COMMENT '材料id',
`source` tinyint(2) COMMENT '事项来源(0.政务网,1.自定义)',
`isRecommend` tinyint(2) COMMENT '是否推荐(0.未推荐,1.推荐)',
`total` int(8) COMMENT '填单次数',
`sort` int(4) COMMENT '排序',
`sampleName` varchar(255) COMMENT '样表名称',
`samplePath` varchar(255) COMMENT '样表地址',
......@@ -315,9 +314,8 @@ CREATE TABLE mortals_xhx_device_matter_datum(
`createUserId` bigint(20) COMMENT '创建用户',
`updateTime` datetime COMMENT '修改时间',
PRIMARY KEY (`id`)
,KEY `deviceCode` (`deviceCode`) USING BTREE
,KEY `siteId` (`siteId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备事项申请材料业务';
package com.mortals.xhx.module.device.service.impl;
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.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;
......@@ -6,6 +13,8 @@ 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;
/**
* DeviceMatterDatumService
* 设备事项申请材料业务 service实现
......@@ -15,5 +24,53 @@ import com.mortals.xhx.module.device.service.DeviceMatterDatumService;
*/
@Service("deviceMatterDatumService")
public class DeviceMatterDatumServiceImpl extends AbstractCRUDServiceImpl<DeviceMatterDatumDao, DeviceMatterDatumEntity, Long> implements DeviceMatterDatumService {
@Autowired
private MatterService matterService;
@Autowired
private MatterDatumService matterDatumService;
@Autowired
private DeviceService deviceService;
@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.getMaterialId())){
MatterDatumEntity matterDatumEntity = matterDatumService.get(entity.getMaterialId());
if(!ObjectUtils.isEmpty(matterDatumEntity)){
entity.setMaterialName(matterDatumEntity.getMaterialName());
entity.setIsRecommend(matterDatumEntity.getIsRecommend());
entity.setSampleName(matterDatumEntity.getSampleName());
entity.setSamplePath(matterDatumEntity.getSamplePath());
entity.setPreViewPath(matterDatumEntity.getPreViewPath());
entity.setSource(matterDatumEntity.getSource());
}
}
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
package com.mortals.xhx.module.device.service.impl;
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;
......@@ -15,5 +18,17 @@ import com.mortals.xhx.module.device.service.DeviceService;
*/
@Service("deviceService")
public class DeviceServiceImpl extends AbstractCRUDServiceImpl<DeviceDao, DeviceEntity, Long> implements DeviceService {
@Autowired
private MatterService matterService;
@Autowired
private MatterDatumService matterDatumService;
@Override
protected void saveBefore(DeviceEntity entity, Context context) throws AppException {
super.saveBefore(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