添加接口
This commit is contained in:
parent
8efe4f112f
commit
31e3e4655f
|
@ -7,6 +7,14 @@
|
|||
<artifactId>nu-admin-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-iot-local-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>nu-admin-local-api</artifactId>
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package com.nu.modules.nubaseinfo.api;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.nubaseinfo.entity.NuBaseInfoApiDto;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -9,4 +12,6 @@ public interface INuBaseInfoApi {
|
|||
public void save(NuBaseInfoApiDto dto);
|
||||
|
||||
void sync();
|
||||
|
||||
IPage<NuBaseInfoApiDto> queryPadPageList(Page<NuBaseInfoApiDto> page, QueryWrapper<NuBaseInfoApiDto> queryWrapper);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.nu.modules.nubaseinfo.entity;
|
||||
|
||||
import com.nu.modules.camerainfo.entity.CameraInfoDto;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -40,4 +41,6 @@ public class NuBaseInfoApiDto implements Serializable {
|
|||
private String sysOrgCode;
|
||||
private String orgCode;
|
||||
private String asyncId;
|
||||
|
||||
private CameraInfoDto cameraInfo;
|
||||
}
|
||||
|
|
|
@ -65,6 +65,12 @@
|
|||
<artifactId>nu-payment-local-api</artifactId>
|
||||
<version>${nursingunit.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-iot-local-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -2,6 +2,11 @@ package com.nu.modules.nuBaseInfo.mapper;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.nubaseinfo.entity.NuBaseInfoApiDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.nuBaseInfo.entity.NuBaseInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
@ -16,4 +21,5 @@ public interface NuBaseInfoMapper extends BaseMapper<NuBaseInfo> {
|
|||
|
||||
String getNuId();
|
||||
|
||||
IPage<NuBaseInfoApiDto> queryPadPageList(Page<NuBaseInfoApiDto> page,@Param(Constants.WRAPPER) QueryWrapper<NuBaseInfoApiDto> queryWrapper);
|
||||
}
|
||||
|
|
|
@ -7,4 +7,9 @@
|
|||
FROM nu_base_info
|
||||
WHERE RIGHT(nu_id, 3) REGEXP '^[0-9]{3}$'
|
||||
</select>
|
||||
|
||||
<select id="queryPadPageList" resultType="com.nu.modules.nubaseinfo.entity.NuBaseInfoApiDto">
|
||||
select * from nu_base_info
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -3,7 +3,11 @@ package com.nu.modules.nuBaseInfo.service.impl;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.camerainfo.api.CameraInfoApi;
|
||||
import com.nu.modules.camerainfo.entity.CameraInfoDto;
|
||||
import com.nu.modules.nuBaseInfo.entity.NuBaseInfo;
|
||||
import com.nu.modules.nuBaseInfo.mapper.NuBaseInfoMapper;
|
||||
import com.nu.modules.nuBaseInfo.service.INuBaseInfoService;
|
||||
|
@ -31,6 +35,9 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
|
|||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
|
||||
@Autowired
|
||||
private CameraInfoApi cameraInfoApiService;
|
||||
|
||||
@Override
|
||||
public void setNuId(NuBaseInfo nuBaseInfo) {
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
|
@ -94,4 +101,19 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
|
|||
public void sync() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<NuBaseInfoApiDto> queryPadPageList(Page<NuBaseInfoApiDto> page, QueryWrapper<NuBaseInfoApiDto> queryWrapper) {
|
||||
IPage<NuBaseInfoApiDto> list = baseMapper.queryPadPageList(page,queryWrapper);
|
||||
List<CameraInfoDto> cameraList = cameraInfoApiService.getCameraInfoList();
|
||||
//查找list集合里的nuid等于cameraList集合中nuid的就给list集合赋值
|
||||
list.getRecords().forEach(nuBaseInfoApiDto -> {
|
||||
cameraList.forEach(cameraInfoDto -> {
|
||||
if(StringUtils.equals(nuBaseInfoApiDto.getNuId(),cameraInfoDto.getNuId())){
|
||||
nuBaseInfoApiDto.setCameraInfo(cameraInfoDto);
|
||||
}
|
||||
});
|
||||
});
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,5 +33,11 @@
|
|||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-admin-local-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
package com.nu.modules.pad.baseinfo.api;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.nubaseinfo.api.INuBaseInfoApi;
|
||||
import com.nu.modules.nubaseinfo.entity.NuBaseInfoApiDto;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/pad/baseInfo")
|
||||
public class BaseInfoApi {
|
||||
|
||||
|
||||
@Autowired
|
||||
private INuBaseInfoApi iNuBaseInfoApi;
|
||||
|
||||
@ApiOperation(value = "护理单元-分页列表查询", notes = "护理单元-分页列表查询")
|
||||
@GetMapping(value = "/queryPadPageList")
|
||||
public Result<IPage<NuBaseInfoApiDto>> queryPadPageList(NuBaseInfoApiDto nuBaseInfoApiDto,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
QueryWrapper<NuBaseInfoApiDto> queryWrapper = QueryGenerator.initQueryWrapper(nuBaseInfoApiDto, req.getParameterMap(), customeRuleMap);
|
||||
Page<NuBaseInfoApiDto> page = new Page<NuBaseInfoApiDto>(pageNo, pageSize);
|
||||
IPage<NuBaseInfoApiDto> pageList = iNuBaseInfoApi.queryPadPageList(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -3,8 +3,8 @@ package com.nu.modules.ConfigMaterial.controller;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.configMaterialInfo.entity.ConfigMaterialInfo;
|
||||
import com.nu.modules.configMaterialInfo.service.IConfigMaterialInfoService;
|
||||
import com.nu.modules.ConfigMaterial.entity.ConfigMaterialInfo;
|
||||
import com.nu.modules.ConfigMaterial.service.IConfigMaterialInfoService;
|
||||
import com.nu.modules.utils.PinyinUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.nu.modules.configMaterialInfo.entity;
|
||||
package com.nu.modules.ConfigMaterial.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
@ -147,7 +147,15 @@ public class ConfigMaterialInfo implements Serializable {
|
|||
private java.lang.String sysOrgCode;
|
||||
/**拼音*/
|
||||
private java.lang.String pinyin;
|
||||
/**物料上限*/
|
||||
private java.lang.String upperLimit;
|
||||
/**物料下县*/
|
||||
private java.lang.String lowerLimit;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String treeId;//树id,用于查询
|
||||
|
||||
@TableField(exist = false)
|
||||
private String kcsl;//库存数量
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package com.nu.modules.configMaterialInfo.mapper;
|
||||
package com.nu.modules.ConfigMaterial.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.configMaterialInfo.entity.ConfigMaterialInfo;
|
||||
import com.nu.modules.ConfigMaterial.entity.ConfigMaterialInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.nu.modules.configMaterialInfo.service;
|
||||
package com.nu.modules.ConfigMaterial.service;
|
||||
|
||||
import com.nu.modules.configMaterialInfo.entity.ConfigMaterialInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.ConfigMaterial.entity.ConfigMaterialInfo;
|
||||
|
||||
/**
|
||||
* @Description: 物料信息
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.nu.modules.configMaterialInfo.service.impl;
|
||||
package com.nu.modules.ConfigMaterial.service.impl;
|
||||
|
||||
import com.nu.modules.configMaterialInfo.entity.ConfigMaterialInfo;
|
||||
import com.nu.modules.configMaterialInfo.mapper.ConfigMaterialInfoMapper;
|
||||
import com.nu.modules.configMaterialInfo.service.IConfigMaterialInfoService;
|
||||
import com.nu.modules.ConfigMaterial.entity.ConfigMaterialInfo;
|
||||
import com.nu.modules.ConfigMaterial.mapper.ConfigMaterialInfoMapper;
|
||||
import com.nu.modules.ConfigMaterial.service.IConfigMaterialInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
package com.nu.modules.qgd.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.nu.modules.qgd.entity.QgdMain;
|
||||
import com.nu.modules.qgd.service.IQgdMainService;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import com.nu.modules.qgd.entity.QgdInfo;
|
||||
|
@ -14,6 +19,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
@ -36,7 +42,9 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|||
public class QgdInfoController extends JeecgController<QgdInfo, IQgdInfoService> {
|
||||
@Autowired
|
||||
private IQgdInfoService nuInvoicingQgdInfoService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IQgdMainService nuInvoicingQgdMainService;
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
|
@ -59,21 +67,7 @@ public class QgdInfoController extends JeecgController<QgdInfo, IQgdInfoService>
|
|||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param nuInvoicingQgdInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "请购单-请购信息-添加")
|
||||
@ApiOperation(value="请购单-请购信息-添加", notes="请购单-请购信息-添加")
|
||||
@RequiresPermissions("nuInvoicingQgdInfo:nu_invoicing_qgd_info:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody QgdInfo nuInvoicingQgdInfo) {
|
||||
nuInvoicingQgdInfoService.save(nuInvoicingQgdInfo);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
|
@ -82,7 +76,6 @@ public class QgdInfoController extends JeecgController<QgdInfo, IQgdInfoService>
|
|||
*/
|
||||
@AutoLog(value = "请购单-请购信息-编辑")
|
||||
@ApiOperation(value="请购单-请购信息-编辑", notes="请购单-请购信息-编辑")
|
||||
@RequiresPermissions("nuInvoicingQgdInfo:nu_invoicing_qgd_info:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody QgdInfo nuInvoicingQgdInfo) {
|
||||
nuInvoicingQgdInfoService.updateById(nuInvoicingQgdInfo);
|
||||
|
@ -97,7 +90,6 @@ public class QgdInfoController extends JeecgController<QgdInfo, IQgdInfoService>
|
|||
*/
|
||||
@AutoLog(value = "请购单-请购信息-通过id删除")
|
||||
@ApiOperation(value="请购单-请购信息-通过id删除", notes="请购单-请购信息-通过id删除")
|
||||
@RequiresPermissions("nuInvoicingQgdInfo:nu_invoicing_qgd_info:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
nuInvoicingQgdInfoService.removeById(id);
|
||||
|
@ -112,53 +104,52 @@ public class QgdInfoController extends JeecgController<QgdInfo, IQgdInfoService>
|
|||
*/
|
||||
@AutoLog(value = "请购单-请购信息-批量删除")
|
||||
@ApiOperation(value="请购单-请购信息-批量删除", notes="请购单-请购信息-批量删除")
|
||||
@RequiresPermissions("nuInvoicingQgdInfo:nu_invoicing_qgd_info:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.nuInvoicingQgdInfoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* 批量添加请购信息
|
||||
* @param infoList
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "请购单-请购信息-通过id查询")
|
||||
@ApiOperation(value="请购单-请购信息-通过id查询", notes="请购单-请购信息-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<QgdInfo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
QgdInfo nuInvoicingQgdInfo = nuInvoicingQgdInfoService.getById(id);
|
||||
if(nuInvoicingQgdInfo==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(nuInvoicingQgdInfo);
|
||||
}
|
||||
@AutoLog(value = "请购单-请购信息-添加")
|
||||
@ApiOperation(value="请购单-请购信息-添加", notes="请购单-请购信息-添加")
|
||||
@PostMapping(value = "/addList")
|
||||
public Result<String> addList(@RequestBody List<QgdInfo> infoList) {
|
||||
nuInvoicingQgdInfoService.addList(infoList);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param nuInvoicingQgdInfo
|
||||
*/
|
||||
@RequiresPermissions("nuInvoicingQgdInfo:nu_invoicing_qgd_info:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, QgdInfo nuInvoicingQgdInfo) {
|
||||
return super.exportXls(request, nuInvoicingQgdInfo, QgdInfo.class, "请购单-请购信息");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("nuInvoicingQgdInfo:nu_invoicing_qgd_info:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, QgdInfo.class);
|
||||
}
|
||||
/**
|
||||
* 通过登录用户查询请购车列表
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryListByUser")
|
||||
public Result<IPage<QgdInfo>> queryListByUser(QgdInfo nuInvoicingQgdInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
//查询当前人是否有请购数据
|
||||
QueryWrapper<QgdMain> mainQueryWrapper = new QueryWrapper<>();
|
||||
mainQueryWrapper.eq("create_by",sysUser.getUsername());
|
||||
mainQueryWrapper.eq("status",0);
|
||||
QgdMain qgdMain = nuInvoicingQgdMainService.getOne(mainQueryWrapper);
|
||||
if(qgdMain == null){
|
||||
return Result.OK(null);
|
||||
}
|
||||
//查询请购详细信息
|
||||
QueryWrapper<QgdInfo> queryWrapper = QueryGenerator.initQueryWrapper(nuInvoicingQgdInfo, req.getParameterMap());
|
||||
queryWrapper.eq("main_id",qgdMain.getId());
|
||||
Page<QgdInfo> page = new Page<QgdInfo>(pageNo, pageSize);
|
||||
IPage<QgdInfo> pageList = nuInvoicingQgdInfoService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -103,4 +103,6 @@ public class QgdInfo implements Serializable {
|
|||
@Excel(name = "brand", width = 15)
|
||||
@ApiModelProperty(value = "brand")
|
||||
private java.lang.String brand;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public class QgdMain implements Serializable {
|
|||
/**请购单号*/
|
||||
@Excel(name = "请购单号", width = 15)
|
||||
@ApiModelProperty(value = "请购单号")
|
||||
private java.lang.Integer qgdNo;
|
||||
private java.lang.String qgdNo;
|
||||
/**请购状态 0未下单 1已下单*/
|
||||
@Excel(name = "请购状态 0未下单 1已下单", width = 15)
|
||||
@ApiModelProperty(value = "请购状态 0未下单 1已下单")
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.nu.modules.qgd.service;
|
|||
import com.nu.modules.qgd.entity.QgdInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 请购单-请购信息
|
||||
* @Author: jeecg-boot
|
||||
|
@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface IQgdInfoService extends IService<QgdInfo> {
|
||||
|
||||
void addList(List<QgdInfo> infoList);
|
||||
}
|
||||
|
|
|
@ -1,12 +1,25 @@
|
|||
package com.nu.modules.qgd.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.nu.modules.ConfigMaterial.entity.ConfigMaterialInfo;
|
||||
import com.nu.modules.qgd.entity.QgdInfo;
|
||||
import com.nu.modules.qgd.entity.QgdMain;
|
||||
import com.nu.modules.qgd.mapper.QgdInfoMapper;
|
||||
import com.nu.modules.qgd.service.IQgdInfoService;
|
||||
import com.nu.modules.qgd.service.IQgdMainService;
|
||||
import com.nu.modules.ConfigMaterial.service.IConfigMaterialInfoService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 请购单-请购信息
|
||||
* @Author: jeecg-boot
|
||||
|
@ -16,4 +29,52 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
@Service
|
||||
public class QgdInfoServiceImpl extends ServiceImpl<QgdInfoMapper, QgdInfo> implements IQgdInfoService {
|
||||
|
||||
@Autowired
|
||||
private IQgdMainService nuInvoicingQgdMainService;
|
||||
@Autowired
|
||||
private IConfigMaterialInfoService configMaterialInfoService;
|
||||
|
||||
@Override
|
||||
public void addList(List<QgdInfo> infoList) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
QueryWrapper<QgdMain> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("create_by",sysUser.getUsername());
|
||||
queryWrapper.eq("status",0);
|
||||
QgdMain qgdMain = nuInvoicingQgdMainService.getOne(queryWrapper);
|
||||
if(qgdMain == null){
|
||||
// 生成请购单号
|
||||
Date date = new Date();
|
||||
String nowDate = DateUtils.formatDate(date,"yyyy-MM-dd");
|
||||
QueryWrapper<QgdMain> queryWrapper2 = new QueryWrapper<>();
|
||||
queryWrapper2.eq("create_by",sysUser.getUsername());
|
||||
queryWrapper2.like("create_time",nowDate);
|
||||
//查询当天是否有请购单
|
||||
List<QgdMain> listSize = nuInvoicingQgdMainService.list(queryWrapper2);
|
||||
int size = listSize.size()+1;
|
||||
String ddwh = String.format("%03d", size);
|
||||
String qgdNo = sysUser.getOrgCode() + DateUtils.formatDate(date,"yyyyMMdd")+ddwh;
|
||||
qgdMain = new QgdMain();
|
||||
qgdMain.setCreateBy(sysUser.getUsername());
|
||||
qgdMain.setCreateTime(new Date());
|
||||
qgdMain.setStatus(0);
|
||||
qgdMain.setQgdNo(qgdNo);
|
||||
nuInvoicingQgdMainService.save(qgdMain);
|
||||
}
|
||||
for (QgdInfo info : infoList) {
|
||||
if(info.getPurchaseQuantity()!=null && info.getPurchaseQuantity()>0){
|
||||
ConfigMaterialInfo ConfigMaterialInfo = configMaterialInfoService.getById(info.getWlId());
|
||||
info.setMainId(qgdMain.getId());
|
||||
info.setMainNo(qgdMain.getQgdNo());
|
||||
info.setWlName(ConfigMaterialInfo.getMaterialName());
|
||||
info.setWlMaterialNo(ConfigMaterialInfo.getMaterialNo());
|
||||
info.setWlSpecificationModel(ConfigMaterialInfo.getSpecificationModel());
|
||||
info.setWlUnits(ConfigMaterialInfo.getMaterialUnits());
|
||||
info.setWlUpperLimit(ConfigMaterialInfo.getUpperLimit());
|
||||
info.setWlLowerLimit(ConfigMaterialInfo.getLowerLimit());
|
||||
baseMapper.insert(info);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package com.nu.modules.camerainfo.api;
|
||||
|
||||
import com.nu.modules.camerainfo.entity.CameraInfoDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CameraInfoApi {
|
||||
|
||||
public List<CameraInfoDto> getCameraInfoList();
|
||||
}
|
|
@ -0,0 +1,190 @@
|
|||
package com.nu.modules.camerainfo.entity;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CameraInfoDto {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**ID*/
|
||||
@ApiModelProperty(value = "ID")
|
||||
private Integer id;
|
||||
/**设备序号*/
|
||||
@ApiModelProperty(value = "设备序号")
|
||||
private String deviceIndex;
|
||||
/**设备名称*/
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
/**设备类型*/
|
||||
@ApiModelProperty(value = "设备类型")
|
||||
private String deviceType;
|
||||
/**设备状态 0 离线 1 在线 2 重启中 3 升级中 4 配置中 5 同步中*/
|
||||
@ApiModelProperty(value = "设备状态 0 离线 1 在线 2 重启中 3 升级中 4 配置中 5 同步中")
|
||||
private String deviceStatus;
|
||||
/**设备型号*/
|
||||
@ApiModelProperty(value = "设备型号")
|
||||
private String deviceModel;
|
||||
/**IP地址*/
|
||||
@ApiModelProperty(value = "IP地址")
|
||||
private String ip;
|
||||
/**MAC地址*/
|
||||
@ApiModelProperty(value = "MAC地址")
|
||||
private String mac;
|
||||
/**分组ID*/
|
||||
@ApiModelProperty(value = "分组ID")
|
||||
private String regionId;
|
||||
/**分组名称*/
|
||||
@ApiModelProperty(value = "分组名称")
|
||||
private String regionName;
|
||||
/**父设备ID*/
|
||||
@ApiModelProperty(value = "父设备ID")
|
||||
private String parentId;
|
||||
/**父设备名称*/
|
||||
@ApiModelProperty(value = "父设备名称")
|
||||
private String parentDeviceName;
|
||||
/**项目ID*/
|
||||
@ApiModelProperty(value = "项目ID")
|
||||
private String projectId;
|
||||
/**项目名称*/
|
||||
@ApiModelProperty(value = "项目名称")
|
||||
private String projectName;
|
||||
/**软件版本*/
|
||||
@ApiModelProperty(value = "软件版本")
|
||||
private String firmwareVer;
|
||||
/**硬件版本*/
|
||||
@ApiModelProperty(value = "硬件版本")
|
||||
private String hardwareVer;
|
||||
/**用户权限类型 -1 无权限 0 可读 1 可控制 2 可配置 3 可控制/配置 4 所有*/
|
||||
@ApiModelProperty(value = "用户权限类型 -1 无权限 0 可读 1 可控制 2 可配置 3 可控制/配置 4 所有")
|
||||
private String managerAuthType;
|
||||
/**告警消息权限 1 有权限 -1 无权限*/
|
||||
@ApiModelProperty(value = "告警消息权限 1 有权限 -1 无权限")
|
||||
private String msgAuthType;
|
||||
/**扩展信息*/
|
||||
@ApiModelProperty(value = "扩展信息")
|
||||
private JSONObject extend;
|
||||
/**国标编码*/
|
||||
@ApiModelProperty(value = "国标编码")
|
||||
private String sipCode;
|
||||
/**位置名称*/
|
||||
@ApiModelProperty(value = "位置名称")
|
||||
private String locationName;
|
||||
/**系统类型 public 通用 vms 监控 nms 网络 evcs 新能源充电桩 rms 客控 nbs 音箱 bas 楼控 ams 门禁 smart_agriculture 智慧农业 vps 停车管理 aaa 认证计费*/
|
||||
@ApiModelProperty(value = "系统类型 public 通用 vms 监控 nms 网络 evcs 新能源充电桩 rms 客控 nbs 音箱 bas 楼控 ams 门禁 smart_agriculture 智慧农业 vps 停车管理 aaa 认证计费")
|
||||
private String systemType;
|
||||
/**协议类型*/
|
||||
@ApiModelProperty(value = "协议类型")
|
||||
private String protocol;
|
||||
/**置顶的时间*/
|
||||
@ApiModelProperty(value = "用户设置置顶的时间,毫秒级时间戳")
|
||||
private String topTime;
|
||||
/**护理单元*/
|
||||
@ApiModelProperty(value = "护理单元ID")
|
||||
private String nuId;
|
||||
/**护理单元*/
|
||||
@ApiModelProperty(value = "护理单元")
|
||||
private String nuName;
|
||||
@ApiModelProperty(value = "码流类型 0 代表主码流,1 代码子码流")
|
||||
private int streamType;
|
||||
|
||||
/**
|
||||
* 能力集属性 ==>
|
||||
*/
|
||||
@ApiModelProperty(value = "运动检测")
|
||||
private String motionDetection;
|
||||
@ApiModelProperty(value = "视频封面")
|
||||
private String videoCover;
|
||||
@ApiModelProperty(value = "云台")
|
||||
private String ptz;
|
||||
@ApiModelProperty(value = "motor")
|
||||
private String motor;
|
||||
@ApiModelProperty(value = "smartCode")
|
||||
private String smartCode;
|
||||
@ApiModelProperty(value = "强制在H.264编码过程中生成IDR帧的函数")
|
||||
private String forceIdrFrame;
|
||||
@ApiModelProperty(value = "音频")
|
||||
private String audio;
|
||||
@ApiModelProperty(value = "本地存储")
|
||||
private String localStorage;
|
||||
@ApiModelProperty(value = "回放API本版")
|
||||
private String playbackApiVersionTwo;
|
||||
@ApiModelProperty(value = "多变性")
|
||||
private String multitrans;
|
||||
@ApiModelProperty(value = "客流")
|
||||
private String passengerFlow;
|
||||
@ApiModelProperty(value = "获取预览缩略图")
|
||||
private String getPreviewThumbnail;
|
||||
@ApiModelProperty(value = "JPG预览缩略图")
|
||||
private String previewThumbnailJpeg;
|
||||
@ApiModelProperty(value = "走廊")
|
||||
private String corridorMod;
|
||||
@ApiModelProperty(value = "背光共存")
|
||||
private String backlightCoexistence;
|
||||
/**
|
||||
* <== 能力集属性
|
||||
*/
|
||||
@ApiModelProperty(value = "查询日期")
|
||||
private String dataDate;
|
||||
@ApiModelProperty(value = "设备索引")
|
||||
private String videoDevId;
|
||||
@ApiModelProperty(value = "存储设备ID")
|
||||
private String storageDevId;
|
||||
@ApiModelProperty(value = "存储设备名称")
|
||||
private String storageDevName;
|
||||
@ApiModelProperty(value = "双摄IPC通道ID,双摄IPC的全景摄像头,其值为0.双摄IPC的特写摄像头,其值为1")
|
||||
private String channelId;
|
||||
@ApiModelProperty(value = "当录像存在存储池中, 录像所属的nvs的ID")
|
||||
private String nvsIdInPoolList;
|
||||
@ApiModelProperty(value = "录像开始时间. GMT时间,即1970.1.1零时至今的秒数")
|
||||
private String startTime;
|
||||
@ApiModelProperty(value = "录像结束时间. GMT时间,即1970.1.1零时至今的秒数")
|
||||
private String endTime;
|
||||
@ApiModelProperty(value = "录像开始时间,YYYY-MM-DD HH:MI:SS")
|
||||
private String startTimeFt;
|
||||
@ApiModelProperty(value = "录像结束时间,YYYY-MM-DD HH:MI:SS")
|
||||
private String endTimeFt;
|
||||
@ApiModelProperty(value = "录像时长,HH:MI:SS")
|
||||
private String duration;
|
||||
@ApiModelProperty(value = "回放录像类型。1: 定时录像; 2: 移动侦测等")
|
||||
private String videoType;
|
||||
@ApiModelProperty(value = "录像片段大小,单位字节")
|
||||
private String size;
|
||||
@ApiModelProperty(value = "错误码")
|
||||
private String errorCode;
|
||||
@ApiModelProperty(value = "错误描述")
|
||||
private String errorMsg;
|
||||
@ApiModelProperty(value = "录像存储设备类型 -1:未找到,0:ipc,1:nvr,2:nvs:3:server,4:vcs,5:storagePool")
|
||||
private String storageType;
|
||||
@ApiModelProperty(value = "预览/回放url")
|
||||
private String url;
|
||||
@ApiModelProperty(value = "预览/回放备用url")
|
||||
private String backupUrl;
|
||||
@ApiModelProperty(value = "ws连接传输视频地址")
|
||||
private String wsUrl;
|
||||
@ApiModelProperty(value = "wss接传输视频地址")
|
||||
private String wssUrl;
|
||||
@ApiModelProperty(value = "预览/回放通道对应的sessionId")
|
||||
private String sessionId;
|
||||
@ApiModelProperty(value = "双摄IPC通道ID")
|
||||
private String videoChannelId;
|
||||
@ApiModelProperty(value = "回放速率")
|
||||
private String scale;
|
||||
@ApiModelProperty(value = "回放api访问前缀")
|
||||
private String queryAddress;
|
||||
@ApiModelProperty(value = "录像开关;枚举:[0:表示关,1:表示开]")
|
||||
private String recordSwitch;
|
||||
@ApiModelProperty(value = "任务taskId")
|
||||
private String taskId;
|
||||
@ApiModelProperty(value = "上传mp4文件名称")
|
||||
private String fileName;
|
||||
@ApiModelProperty(value = "上传进度")
|
||||
private String process;
|
||||
@ApiModelProperty(value = "移动方向;枚举:[0:左上,1:上,2:右上,3:左,4:持续水平转动,5:右,6:左下,7:下,8:右下,9:缩小画面,10:放大画面,11:聚焦近处,12:聚焦远处]")
|
||||
private String direction;
|
||||
@ApiModelProperty(value = "开始或停止移动;枚举:[0:停止,1:开始]")
|
||||
private String startOrNot;
|
||||
@ApiModelProperty(value = "球机移动速度")
|
||||
private String speed;
|
||||
}
|
|
@ -1,10 +1,13 @@
|
|||
package com.nu.modules.tplink.camera.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.nu.modules.camerainfo.api.CameraInfoApi;
|
||||
import com.nu.modules.camerainfo.entity.CameraInfoDto;
|
||||
import com.nu.modules.tplink.camera.model.CameraTreeModel;
|
||||
import com.nu.modules.tplink.common.entity.TumsConfig;
|
||||
import com.nu.modules.tplink.common.mapper.TumsConfigMapper;
|
||||
|
@ -19,6 +22,7 @@ import com.nu.modules.tplink.camera.service.ICameraInfoService;
|
|||
import com.nu.modules.tplink.common.entity.ErrorCode;
|
||||
import com.nu.modules.tplink.common.service.IErrorCodeService;
|
||||
import com.nu.modules.tplink.utils.TumsApi;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
@ -36,7 +40,7 @@ import static java.lang.Thread.sleep;
|
|||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraInfo> implements ICameraInfoService {
|
||||
public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraInfo> implements ICameraInfoService, CameraInfoApi {
|
||||
|
||||
@Autowired
|
||||
private TumsApi tumsApi;
|
||||
|
@ -2503,4 +2507,11 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
return Result.error(errMsg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CameraInfoDto> getCameraInfoList() {
|
||||
List<CameraInfo> list = baseMapper.findAllList();
|
||||
List<CameraInfoDto> listDto =BeanUtil.copyToList(list,CameraInfoDto.class);
|
||||
return listDto;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue