Commit b9a2e146 authored by wanglong's avatar wanglong

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents b48501de 7c5bb785
......@@ -95,9 +95,9 @@ public class ControllerAop {
// 不需要校验token的接口直接返回
if (joinPoint.getSignature() instanceof MethodSignature) {
if (!((MethodSignature) joinPoint.getSignature()).getMethod().getAnnotation(TycloudOperation.class).needAuth() && !request.getParameterMap().containsKey("token") && ValidationUtil.isEmpty(token)) {
// if (!((MethodSignature) joinPoint.getSignature()).getMethod().getAnnotation(TycloudOperation.class).needAuth() && !request.getParameterMap().containsKey("token") && ValidationUtil.isEmpty(token)) {
return;
}
// }
}
// 平台studio配置的下载接口token从url里取
......
package com.yeejoin.amos.boot.module.ugp.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 项目安装告知短信记录表
*
* @author system_generator
* @date 2022-10-7
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="InstallNoticeMsgPageDto", description="项目安装告知短信通知记录表")
public class InstallNoticeMsgPageDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "项目名称")
private String name;
@ApiModelProperty(value = "项目安装区域")
private String installRegion;
@ApiModelProperty(value = "项目开工日期")
private Date startDate;
@ApiModelProperty(value = "建设单位")
private String constructionUnit;
@ApiModelProperty(value = "安装单位")
private String installationUnit;
@ApiModelProperty(value = "项目告知处理进度")
private String progressStatus;
@ApiModelProperty(value = "短信通知单位")
private Long targetUnitId;
@ApiModelProperty(value = "短信接收人")
private Long targetPersonId;
@ApiModelProperty(value = "短信通知内容")
private String content;
@ApiModelProperty(value = "短信发送日期")
private Date sendTime;
}
package com.yeejoin.amos.boot.module.ugp.api.dto;
import com.sun.corba.se.spi.presentation.rmi.IDLNameTranslator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
......@@ -39,4 +40,5 @@ public class SuperviseRuleDto extends BaseDto {
@ApiModelProperty(value = "创建时间")
private Date createDate;
}
package com.yeejoin.amos.boot.module.ugp.api.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.aspectj.weaver.ast.Test;
import org.springframework.web.multipart.MultipartFile;
import java.util.Date;
/**
* 焊机设备表
*
* @author system_generator
* @date 2022-10-8
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="WelderEquipmentDto", description="焊机设备表")
public class WelderEquipmentDto extends BaseDto{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "设备名称")
private String name;
@ApiModelProperty(value = "设备编号")
private String code;
@ApiModelProperty(value = "设备类型")
private String type;
@ApiModelProperty(value = "项目ID")
private Long projectId;
@ApiModelProperty(value = "项目名称")
private String projectName;
@ApiModelProperty(value = "生产厂家")
private String manufacturer;
@ApiModelProperty(value = "出厂日期")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date manufactureDate;
@ApiModelProperty(value = "使用年限")
private String serviceLife;
@ApiModelProperty(value = "校验日期")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date inspectionDate;
@ApiModelProperty(value = "使用状态")
private String useStatus;
@ApiModelProperty(value = "检定状态")
private String verifyStatus;
@ApiModelProperty(value = "附件信息")
private String info;
@ApiModelProperty(value = "资源id")
private String projectResourceId;
@ApiModelProperty(value = "附件")
private MultipartFile[] files;
}
......@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
......
package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Attachment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -11,4 +12,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface AttachmentMapper extends BaseMapper<Attachment> {
//根据source_id删除附件
void deleteBySourceId(Long sourceId);
//根据source_id查询附件
AttachmentDto selectAttBySeq(Long sourceId);
}
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 设备信息表 Mapper 接口
......@@ -9,6 +10,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author system_generator
* @date 2022-09-22
*/
@Mapper
public interface EquipmentMapper extends BaseMapper<Equipment> {
}
package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.InstallNoticeMsg;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 项目安装告知短信记录表 Mapper 接口
*
* @author system_generator
* @date 2022-09-22
* @date 2022-10-8
*/
@Mapper
public interface InstallNoticeMsgMapper extends BaseMapper<InstallNoticeMsg> {
//安装告知申请页面分页列表
Page<InstallNoticeMsgPageDto> InstallNoticeMsgPage(IPage<InstallNoticeMsgPageDto> page, @Param("name") String name, @Param("installationUnit") String installationUnit );
Page<InstallNoticeMsgPageDto> selectByName(Page<InstallNoticeMsgPageDto> page, @Param("name") String name, @Param("unit") String unit);
InstallNoticeMsgPageDto customSelectById(@Param("sequenceNbr") Long sequenceNbr);
}
package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.aspectj.weaver.ast.Test;
/**
* 项目资源表(包括焊工、管材、设备) Mapper 接口
......@@ -9,6 +16,16 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author system_generator
* @date 2022-09-22
*/
@Mapper
public interface ProjectResourceMapper extends BaseMapper<ProjectResource> {
//焊机设备表
Page<WelderEquipmentDto> WelderEquipment(IPage<WelderEquipmentDto> page, @Param("name") String name, @Param("type") String type);
Page<WelderEquipmentDto> selectByName(Page<WelderEquipmentDto> page, @Param("name") String name, @Param("unit") String unit);
Page<WelderEquipmentDto> selectByInfo(Page<WelderEquipmentDto> page, @Param("info") Test info, @Param("unit") String unit);
WelderEquipmentDto customSelectById(@Param("sequenceNbr") Long sequenceNbr);
}
package com.yeejoin.amos.boot.module.ugp.api.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 设备信息表接口类
*
......@@ -8,5 +15,8 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
* @date 2022-09-22
*/
public interface IEquipmentService {
//添加设备+附件
EquipmentDto saveEI(JSONObject object);
}
package com.yeejoin.amos.boot.module.ugp.api.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto;
/**
* 项目安装告知短信记录表接口类
*
* @author system_generator
* @date 2022-09-22
* @date 2022-10-8
*/
public interface IInstallNoticeMsgService {
//安装告知页面列表
Page<InstallNoticeMsgPageDto> installNoticeMsgList(Page<InstallNoticeMsgPageDto> page, String name, String installationUnit);
//安装告知页面分页查询
Page<InstallNoticeMsgPageDto> selectByName(Page<InstallNoticeMsgPageDto> page, String name ,String unit);
//根据sequenceNbr查询列表数据
InstallNoticeMsgPageDto customSelectById(Long sequenceNbr);
}
package com.yeejoin.amos.boot.module.ugp.api.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto;
import org.aspectj.weaver.ast.Test;
/**
* 项目资源表(包括焊工、管材、设备)接口类
*
......@@ -9,4 +13,13 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
*/
public interface IProjectResourceService {
//焊机设备表
Page<WelderEquipmentDto> installNoticeMsgList(Page<WelderEquipmentDto> page, String name, String type);
//焊机设备页面分页查询
Page<WelderEquipmentDto> selectByName(Page<WelderEquipmentDto> page, String name ,String unit);
Page<WelderEquipmentDto> selectByInfo(Page<WelderEquipmentDto> page, Test info , String unit);
//根据sequenceNbr查询列表数据
WelderEquipmentDto customSelectById(Long sequenceNbr);
}
......@@ -2,4 +2,14 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper">
<!-- //根据source_id删除附件-->
<delete id="deleteBySourceId">
delete FROM tz_ugp_attachment where source_id=#{sourceId}
</delete>
<!-- //根据source_id查询附件-->
<select id="selectAttBySeq" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto">
select * from tz_ugp_attachment where source_id=#{sourceId}
</select>
</mapper>
......@@ -2,4 +2,69 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.ugp.api.mapper.InstallNoticeMsgMapper">
<select id="InstallNoticeMsgPage" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto">
SELECT name,
install_region,
start_date,
construction_unit,
installation_unit,
progress_status,
target_unit_id,
target_person_id,
content,
send_time
FROM tz_ugp_project,
tz_ugp_install_notice_msg,
tz_ugp_install_notice
where tz_ugp_project.sequence_nbr = tz_ugp_install_notice.project_id
and tz_ugp_install_notice_msg.install_notice_id = tz_ugp_install_notice.sequence_nbr
<if test="name != null and name != ''">
and tz_ugp_project.name = #{name}
</if>
<if test="installationUnit != null and installationUnit != ''">
and tz_ugp_project.installationUnit = #{installationUnit}
</if>
</select>
<select id="selectByName" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto">
SELECT name,
install_region,
start_date,
construction_unit,
installation_unit,
progress_status,
target_unit_id,
target_person_id,
content,
send_time
FROM tz_ugp_project,
tz_ugp_install_notice_msg,
tz_ugp_install_notice
where tz_ugp_project.sequence_nbr = tz_ugp_install_notice.project_id
and tz_ugp_install_notice_msg.install_notice_id = tz_ugp_install_notice.sequence_nbr
<if test="name != null and name != ''">
and tz_ugp_project.name = #{name}
</if>
<if test="unit != null and unit != ''">
and tz_ugp_project.construction_unit_id = #{unit}
</if>
</select>
<select id="customSelectById"
resultType="com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto">
SELECT name,
install_region,
start_date,
construction_unit,
installation_unit,
progress_status,
target_unit_id,
target_person_id,
content,
send_time
FROM tz_ugp_project,
tz_ugp_install_notice_msg,
tz_ugp_install_notice
where tz_ugp_project.sequence_nbr = tz_ugp_install_notice.project_id
and tz_ugp_install_notice_msg.install_notice_id = tz_ugp_install_notice.sequence_nbr
and tz_ugp_project.sequence_nbr = #{sequenceNbr}
</select>
</mapper>
......@@ -2,4 +2,101 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper">
<select id="WelderEquipment" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto">
SELECT tz_ugp_equipment.name,
tz_ugp_equipment.code,
tz_ugp_equipment.type,
tz_ugp_project.name AS projectName,
tz_ugp_project.sequence_nbr AS projectId,
tz_ugp_equipment.manufacturer,
tz_ugp_equipment.manufacture_date,
tz_ugp_equipment.service_life,
tz_ugp_equipment.verify_status,
info,
tz_ugp_project_resource.sequence_nbr as project_resource_id
FROM tz_ugp_project
inner join tz_ugp_project_resource on tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
and tz_ugp_project_resource.type = 'equipment'
inner join tz_ugp_equipment on tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment on tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id and
tz_ugp_attachment.type = 'enuipment'
<where>
<if test="name != null and name != ''">
and tz_ugp_equipment.name = #{name}
</if>
<if test="type != null and type != ''">
and tz_ugp_equipment.type = #{type}
</if>
</where>
</select>
<select id="selectByName" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto">
SELECT tz_ugp_equipment.name,
tz_ugp_equipment.code,
tz_ugp_equipment.type,
tz_ugp_project.name as project_Name,
tz_ugp_equipment.manufacturer,
tz_ugp_equipment.manufacture_date,
tz_ugp_equipment.service_life,
tz_ugp_equipment.verify_status,
info
FROM tz_ugp_project
inner join tz_ugp_project_resource on tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
and tz_ugp_project_resource.type = 'equipment'
inner join tz_ugp_equipment on tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment on tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id and
tz_ugp_attachment.type = 'enuipment'
<where>
<if test="name != null and name != ''">
and tz_ugp_project.name = #{name}
</if>
<if test="unit != null and unit != ''">
and tz_ugp_project.construction_unit_id = #{unit}
</if>
</where>
</select>
<select id="selectByInfo" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto">
SELECT tz_ugp_equipment.name,
tz_ugp_equipment.code,
tz_ugp_equipment.type,
tz_ugp_project.name AS project_Name,
tz_ugp_equipment.manufacturer,
tz_ugp_equipment.manufacture_date,
tz_ugp_equipment.service_life,
tz_ugp_equipment.verify_status,
info
FROM tz_ugp_project
inner join tz_ugp_project_resource on tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
and tz_ugp_project_resource.type = 'equipment'
inner join tz_ugp_equipment on tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment on tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id and
tz_ugp_attachment.type = 'enuipment'
<where>
<if test="info != null and info != ''">
and tz_ugp_attachment.info = #{info}
</if>
<if test="unit != null and unit != ''">
and tz_ugp_attachment.company_id = #{unit}
</if>
</where>
</select>
<select id="customSelectById"
resultType="com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto">
SELECT tz_ugp_equipment.name,
tz_ugp_equipment.code,
tz_ugp_equipment.type,
tz_ugp_project.name AS project_Name,
tz_ugp_equipment.manufacturer,
tz_ugp_equipment.manufacture_date,
tz_ugp_equipment.service_life,
tz_ugp_equipment.verify_status,
info
FROM tz_ugp_project
inner join tz_ugp_project_resource on tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
and tz_ugp_project_resource.type = 'equipment'
inner join tz_ugp_equipment on tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment on tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id and
tz_ugp_attachment.type = 'enuipment'
where tz_ugp_equipment.sequence_nbr = #{sequenceNbr}
</select>
</mapper>
......@@ -137,7 +137,7 @@ public class CompanyController extends BaseController {
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth=false)
@ApiOperation(httpMethod = "GET",value = "企业信息表列表全部数据查询", notes = "企业信息表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<CompanyDto>> selectForList() {
......
package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentPageDto;
import com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper;
import org.apache.poi.ss.formula.functions.T;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
......@@ -7,15 +14,13 @@ import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.Date;
import java.util.List;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.EquipmentServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto;
......@@ -36,15 +41,23 @@ public class EquipmentController extends BaseController {
@Autowired
EquipmentServiceImpl equipmentServiceImpl;
@Autowired
EquipmentMapper equipmentMapper;
@Autowired
AttachmentMapper attachmentMapper;
/**
* 新增设备信息表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增设备信息表", notes = "新增设备信息表")
public ResponseModel<EquipmentDto> save(@RequestBody EquipmentDto model) {
model.setManufactureDate(new Date());
model.setInspectionDate(new Date());
model = equipmentServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
......@@ -55,10 +68,11 @@ public class EquipmentController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新设备信息表", notes = "根据sequenceNbr更新设备信息表")
public ResponseModel<EquipmentDto> updateBySequenceNbrEquipment(@RequestBody EquipmentDto model, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
public ResponseModel<EquipmentDto> updateBySequenceNbrEquipment(@RequestBody EquipmentDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setRecDate(new Date());
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(equipmentServiceImpl.updateWithModel(model));
}
......@@ -69,10 +83,10 @@ public class EquipmentController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除设备信息表", notes = "根据sequenceNbr删除设备信息表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(equipmentServiceImpl.removeById(sequenceNbr));
}
......@@ -82,9 +96,9 @@ public class EquipmentController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个设备信息表", notes = "根据sequenceNbr查询单个设备信息表")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个设备信息表", notes = "根据sequenceNbr查询单个设备信息表")
public ResponseModel<EquipmentDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(equipmentServiceImpl.queryBySeq(sequenceNbr));
}
......@@ -96,15 +110,20 @@ public class EquipmentController extends BaseController {
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET", value = "设备信息表分页查询", notes = "设备信息表分页查询")
public ResponseModel<Page<EquipmentDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) {
@ApiOperation(httpMethod = "GET",value = "设备信息表分页查询", notes = "设备信息表分页查询")
public ResponseModel<Page<EquipmentDto>> queryForPage(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "name",required = false) String name,
@RequestParam(value = "code",required = false) String code,
@RequestParam(value = "verifyStatus",required = false)String verifyStatus) {
Page<EquipmentDto> page = new Page<EquipmentDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(equipmentServiceImpl.queryForEquipmentPage(page));
return ResponseHelper.buildResponse(equipmentServiceImpl.queryForEquipmentPage(page,name,code,verifyStatus));
}
/**
......@@ -112,13 +131,12 @@ public class EquipmentController extends BaseController {
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "设备信息表列表全部数据查询", notes = "设备信息表列表全部数据查询")
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "设备信息表列表全部数据查询", notes = "设备信息表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<EquipmentDto>> selectForList() {
return ResponseHelper.buildResponse(equipmentServiceImpl.queryForEquipmentList());
}
/**
* 设备数据名称查询
*
......@@ -130,4 +148,61 @@ public class EquipmentController extends BaseController {
public ResponseModel<List<JSONObject>> selectName(@RequestParam(value = "unitId")String installationUnitId) {
return ResponseHelper.buildResponse(equipmentServiceImpl.selectName(installationUnitId));
}
/**
* 新增设备+附件
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@PostMapping (value = "/saveIE")
@ApiOperation(httpMethod = "Post", value = "新增设备+附件", notes = "新增设备+附件")
public ResponseModel<EquipmentDto> saveEquipment(@RequestBody JSONObject object) {
EquipmentDto equipmentDto = equipmentServiceImpl.saveEI(object);
Long sequenceNbr = equipmentDto.getSequenceNbr();
equipmentServiceImpl.saveAttachment(object,sequenceNbr);
return ResponseHelper.buildResponse(equipmentDto);
}
/**
*根据sequenceNbr删除设备的附件
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@DeleteMapping(value = "IE/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除设备和附件", notes = "根据sequenceNbr删除设备和附件")
public ResponseModel<Boolean> deleteEIBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
attachmentMapper.deleteBySourceId(sequenceNbr);
return ResponseHelper.buildResponse(equipmentServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询设备的附件
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "IE/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询设备和附件", notes = "根据sequenceNbr查询设备和附件")
public ResponseModel<JSONObject> selectIEOne(@PathVariable Long sequenceNbr) {
EquipmentDto equipmentDto = equipmentServiceImpl.queryBySeq(sequenceNbr);
AttachmentDto attachmentDto = attachmentMapper.selectAttBySeq(sequenceNbr);
JSONObject jsonObject = new JSONObject();
jsonObject.put("name",equipmentDto.getName());
jsonObject.put("type",equipmentDto.getType());
jsonObject.put("code",equipmentDto.getCode());
jsonObject.put("manufacturer",equipmentDto.getManufacturer());
jsonObject.put("manufactureDate",equipmentDto.getManufactureDate());
jsonObject.put("serviceLife",equipmentDto.getServiceLife());
jsonObject.put("inspectionDate",equipmentDto.getInspectionDate());
jsonObject.put("useStatus",equipmentDto.getUseStatus());
jsonObject.put("verifyStatus",equipmentDto.getVerifyStatus());
jsonObject.put("subForm",JSON.parseArray(attachmentDto.getInfo()));
return ResponseHelper.buildResponse(jsonObject);
}
}
package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
......@@ -36,7 +37,7 @@ public class InstallNoticeMsgController extends BaseController {
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增项目安装告知短信记录表", notes = "新增项目安装告知短信记录表")
public ResponseModel<InstallNoticeMsgDto> save(@RequestBody InstallNoticeMsgDto model) {
......@@ -50,7 +51,7 @@ public class InstallNoticeMsgController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新项目安装告知短信记录表", notes = "根据sequenceNbr更新项目安装告知短信记录表")
public ResponseModel<InstallNoticeMsgDto> updateBySequenceNbrInstallNoticeMsg(@RequestBody InstallNoticeMsgDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
......@@ -64,7 +65,7 @@ public class InstallNoticeMsgController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除项目安装告知短信记录表", notes = "根据sequenceNbr删除项目安装告知短信记录表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
......@@ -77,7 +78,7 @@ public class InstallNoticeMsgController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个项目安装告知短信记录表", notes = "根据sequenceNbr查询单个项目安装告知短信记录表")
public ResponseModel<InstallNoticeMsgDto> selectOne(@PathVariable Long sequenceNbr) {
......@@ -91,7 +92,7 @@ public class InstallNoticeMsgController extends BaseController {
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "项目安装告知短信记录表分页查询", notes = "项目安装告知短信记录表分页查询")
public ResponseModel<Page<InstallNoticeMsgDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
......@@ -107,10 +108,32 @@ public class InstallNoticeMsgController extends BaseController {
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "项目安装告知短信记录表列表全部数据查询", notes = "项目安装告知短信记录表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<InstallNoticeMsgDto>> selectForList() {
return ResponseHelper.buildResponse(installNoticeMsgServiceImpl.queryForInstallNoticeMsgList());
}
/**
* 安装告知短信通知记录列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/msgpage")
@ApiOperation(httpMethod = "GET",value = "安装告知短信记录表分页查询", notes = "项目安装告知短信记录表分页查询")
public ResponseModel<Page<InstallNoticeMsgPageDto>> queryForMsgPage(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "installationUnit", required = false) String installationUnit
){
Page<InstallNoticeMsgPageDto> page = new Page<InstallNoticeMsgPageDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(installNoticeMsgServiceImpl.installNoticeMsgList(page, name, installationUnit));
}
}
......@@ -112,12 +112,15 @@ public class ProjectController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "项目信息表分页查询", notes = "项目信息表分页查询")
public ResponseModel<Page<ProjectDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
public ResponseModel<Page<ProjectDto>> queryForPage(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "name",required = false) String name,
@RequestParam(value = "constructionUnit",required = false) String constructionUnit) {
Page<ProjectDto> page = new Page<ProjectDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(projectServiceImpl.queryForProjectPage(page));
return ResponseHelper.buildResponse(projectServiceImpl.queryForProjectPage(page, name, constructionUnit));
}
/**
......
package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -7,12 +8,16 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectResourceServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectResourceDto;
......@@ -38,7 +43,7 @@ public class ProjectResourceController extends BaseController {
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增项目资源表(包括焊工、管材、设备)", notes = "新增项目资源表(包括焊工、管材、设备)")
public ResponseModel<ProjectResourceDto> save(@RequestBody ProjectResourceDto model) {
......@@ -52,10 +57,10 @@ public class ProjectResourceController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新项目资源表(包括焊工、管材、设备)", notes = "根据sequenceNbr更新项目资源表(包括焊工、管材、设备)")
public ResponseModel<ProjectResourceDto> updateBySequenceNbrProjectResource(@RequestBody ProjectResourceDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
public ResponseModel<ProjectResourceDto> updateBySequenceNbrProjectResource(@RequestBody ProjectResourceDto model, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(projectResourceServiceImpl.updateWithModel(model));
}
......@@ -66,10 +71,10 @@ public class ProjectResourceController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除项目资源表(包括焊工、管材、设备)", notes = "根据sequenceNbr删除项目资源表(包括焊工、管材、设备)")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(projectResourceServiceImpl.removeById(sequenceNbr));
}
......@@ -79,9 +84,9 @@ public class ProjectResourceController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个项目资源表(包括焊工、管材、设备)", notes = "根据sequenceNbr查询单个项目资源表(包括焊工、管材、设备)")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个项目资源表(包括焊工、管材、设备)", notes = "根据sequenceNbr查询单个项目资源表(包括焊工、管材、设备)")
public ResponseModel<ProjectResourceDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(projectResourceServiceImpl.queryBySeq(sequenceNbr));
}
......@@ -93,10 +98,10 @@ public class ProjectResourceController extends BaseController {
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "项目资源表(包括焊工、管材、设备)分页查询", notes = "项目资源表(包括焊工、管材、设备)分页查询")
public ResponseModel<Page<ProjectResourceDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
@ApiOperation(httpMethod = "GET", value = "项目资源表(包括焊工、管材、设备)分页查询", notes = "项目资源表(包括焊工、管材、设备)分页查询")
public ResponseModel<Page<ProjectResourceDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) {
Page<ProjectResourceDto> page = new Page<ProjectResourceDto>();
page.setCurrent(current);
......@@ -109,14 +114,60 @@ public class ProjectResourceController extends BaseController {
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "项目资源表(包括焊工、管材、设备)列表全部数据查询", notes = "项目资源表(包括焊工、管材、设备)列表全部数据查询")
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "项目资源表(包括焊工、管材、设备)列表全部数据查询", notes = "项目资源表(包括焊工、管材、设备)列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<ProjectResourceDto>> selectForList() {
return ResponseHelper.buildResponse(projectResourceServiceImpl.queryForProjectResourceList());
}
/**
* 焊机设备列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/welderpage")
@ApiOperation(httpMethod = "GET", value = "焊机设备分页查询", notes = "焊机设备分页查询")
public ResponseModel<Page<WelderEquipmentDto>> queryForPage11(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "type", required = false) String type
) {
Page<WelderEquipmentDto> page = new Page<WelderEquipmentDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(projectResourceServiceImpl.installNoticeMsgList(page, name, type));
}
/**
* 项目设备新增
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/welderSave")
@ApiOperation(httpMethod = "POST", value = "项目设备新增", notes = "项目设备新增")
public ResponseModel<Boolean> welderSave(@RequestBody WelderEquipmentDto welderEquipmentDto){
this.projectResourceServiceImpl.welderSave(welderEquipmentDto);
return ResponseHelper.buildResponse(true);
}
/**
* 项目设备删除
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@DeleteMapping(value = "/welderDelete")
@ApiOperation(httpMethod = "Delete", value = "项目设备删除", notes = "项目设备删除")
public ResponseModel<Boolean> welderDelete(
@RequestParam String ids
){
this.projectResourceServiceImpl.welderDelete(ids);
return ResponseHelper.buildResponse(true);
}
/**
* 绑定设备跟项目
*
* @return
......
package com.yeejoin.amos.boot.module.ugp.biz.controller;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.sql.SQLIntegrityConstraintViolationException;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.TreeSet;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.SuperviseRuleServiceImpl;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -36,10 +47,11 @@ public class SuperviseRuleController extends BaseController {
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增监管区域规则表", notes = "新增监管区域规则表")
public ResponseModel<SuperviseRuleDto> save(@RequestBody SuperviseRuleDto model) {
model.setCreateDate(new Date());
model = superviseRuleServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
......@@ -50,10 +62,11 @@ public class SuperviseRuleController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PutMapping(value = "")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新监管区域规则表", notes = "根据sequenceNbr更新监管区域规则表")
public ResponseModel<SuperviseRuleDto> updateBySequenceNbrSuperviseRule(@RequestBody SuperviseRuleDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
public ResponseModel<SuperviseRuleDto> updateBySequenceNbrSuperviseRule(@RequestBody SuperviseRuleDto model,@RequestParam(value = "sequenceNbr") Long sequenceNbr) {
model.setRecDate(new Date());
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(superviseRuleServiceImpl.updateWithModel(model));
}
......@@ -64,11 +77,16 @@ public class SuperviseRuleController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@DeleteMapping(value = "")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除监管区域规则表", notes = "根据sequenceNbr删除监管区域规则表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(superviseRuleServiceImpl.removeById(sequenceNbr));
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @RequestParam(value = "sequenceNbr") String sequenceNbr){
List<Long> ids = Arrays.stream(sequenceNbr.split(",")).map(Long::valueOf).collect(Collectors.toList());
try{
return ResponseHelper.buildResponse(superviseRuleServiceImpl.removeByIds(ids));
} catch (Exception e){
return ResponseHelper.buildResponse(false);
}
}
/**
......@@ -77,10 +95,10 @@ public class SuperviseRuleController extends BaseController {
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个监管区域规则表", notes = "根据sequenceNbr查询单个监管区域规则表")
public ResponseModel<SuperviseRuleDto> selectOne(@PathVariable Long sequenceNbr) {
public ResponseModel<SuperviseRuleDto> selectOne(@RequestParam("sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(superviseRuleServiceImpl.queryBySeq(sequenceNbr));
}
......@@ -91,15 +109,20 @@ public class SuperviseRuleController extends BaseController {
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "监管区域规则表分页查询", notes = "监管区域规则表分页查询")
public ResponseModel<Page<SuperviseRuleDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
public ResponseModel<Page<SuperviseRuleDto>> queryForPage(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
int adminRegionCode,
@RequestParam(value = "superviseDeptId", required = false) Long superviseDeptId,
@RequestParam(value = "inspectionUnitId", required = false) Long inspectionUnitId
) {
Page<SuperviseRuleDto> page = new Page<SuperviseRuleDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(superviseRuleServiceImpl.queryForSuperviseRulePage(page));
return ResponseHelper.buildResponse(superviseRuleServiceImpl.queryForSuperviseRulePage(page, superviseDeptId, inspectionUnitId));
}
/**
......
......@@ -2,11 +2,17 @@ package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
import com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IEquipmentService;
import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -26,18 +32,24 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
@Autowired
EquipmentMapper equipmentMapper;
@Autowired
AttachmentServiceImpl attachmentServiceImpl;
/**
* 分页查询
*/
public Page<EquipmentDto> queryForEquipmentPage(Page<EquipmentDto> page) {
return this.queryForPage(page, null, false);
public Page<EquipmentDto> queryForEquipmentPage(Page<EquipmentDto> page, String name, String code, String verifyStatus) {
return this.queryForPage(page, null, false,name,code,verifyStatus);
}
/**
* 列表查询 示例
*/
public List<EquipmentDto> queryForEquipmentList() {
return this.queryForList("", false);
return this.queryForList("" , false);
}
/**
......@@ -62,4 +74,50 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
return names;
}
/**
* 根据sourceId添加附件
* @param object
*/
public void saveAttachment(JSONObject object,Long SequenceNbr){
AttachmentDto attachmentDto = new AttachmentDto();
JSONArray subForm = object.getJSONArray("subForm");
for(Object o:subForm){
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(o));
jsonObject.getString("Symbol_key");
JSONArray jsonArray = jsonObject.getJSONArray("info");
for(Object j:jsonArray){
JSONObject info = JSON.parseObject(JSON.toJSONString(j));
String name = info.getString("name");
attachmentDto.setSourceId(SequenceNbr);
attachmentDto.setName(info.getString("name"));
// attachmentDto.setInfo("name: "+name+","+
// "type: "+name.substring(name.lastIndexOf(".")+1)+","+
// "path: "+info.getString("url")+","+
// "certCode: "+jsonObject.getString("certCode")+","+
// "certType: "+jsonObject.getString("certType"));
attachmentDto.setInfo(JSON.toJSONString(subForm));
attachmentDto.setType(name.substring(name.lastIndexOf(".")+1));
attachmentServiceImpl.createWithModel(attachmentDto);
break;
}
}
}
@Override
public EquipmentDto saveEI(JSONObject object) {
EquipmentDto model = new EquipmentDto();
model.setName(object.getString("name"));
model.setType(object.getString("type"));
model.setCode(object.getString("code"));
model.setManufacturer(object.getString("manufacturer"));
model.setManufactureDate(object.getDate("manufactureDate"));
model.setServiceLife(object.getString("serviceLife"));
model.setInspectionDate(object.getDate("inspectionDate"));
model.setUseStatus(object.getString("useStatus"));
model.setVerifyStatus(object.getString("verifyStatus"));
EquipmentDto result = this.createWithModel(model);
return result;
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.InstallNoticeMsg;
import com.yeejoin.amos.boot.module.ugp.api.mapper.InstallNoticeMsgMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IInstallNoticeMsgService;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -17,6 +19,9 @@ import java.util.List;
*/
@Service
public class InstallNoticeMsgServiceImpl extends BaseService<InstallNoticeMsgDto,InstallNoticeMsg,InstallNoticeMsgMapper> implements IInstallNoticeMsgService {
@Autowired
InstallNoticeMsgMapper installNoticeMsgMapper;
/**
* 分页查询
*/
......@@ -30,4 +35,22 @@ public class InstallNoticeMsgServiceImpl extends BaseService<InstallNoticeMsgDto
public List<InstallNoticeMsgDto> queryForInstallNoticeMsgList() {
return this.queryForList("" , false);
}
/**
* 项目安装告知短信通知记录分页查询
*/
@Override
public Page<InstallNoticeMsgPageDto> installNoticeMsgList(Page<InstallNoticeMsgPageDto> page, String name, String installationUnit){
return this.getBaseMapper().InstallNoticeMsgPage(page, name, installationUnit);
}
@Override
public Page<InstallNoticeMsgPageDto> selectByName(Page<InstallNoticeMsgPageDto> page, String name, String unit) {
return this.getBaseMapper().selectByName(page, name, unit);
}
@Override
public InstallNoticeMsgPageDto customSelectById(Long sequenceNbr) {
return this.getBaseMapper().customSelectById(sequenceNbr);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
......@@ -9,13 +12,22 @@ import com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IProjectResourceService;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectResourceDto;
import org.aspectj.weaver.ast.Test;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
import java.util.Map;
import static com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectResourceEnum.*;
......@@ -27,12 +39,13 @@ import static com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectResourceEnum.*;
* @date 2022-09-22
*/
@Service
public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto, ProjectResource, ProjectResourceMapper> implements IProjectResourceService {
@Autowired
EquipmentMapper equipmentMapper;
public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,ProjectResource,ProjectResourceMapper> implements IProjectResourceService {
@Autowired
ProjectResourceMapper projectResourceMapper;
@Autowired
EquipmentMapper equipmentMapper;
/**
* 分页查询
......@@ -48,6 +61,63 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,
return this.queryForList("", false);
}
@Override
public Page<WelderEquipmentDto> installNoticeMsgList(Page<WelderEquipmentDto> page, String name, String type) {
return this.projectResourceMapper.WelderEquipment(page, name, type);
}
@Override
public Page<WelderEquipmentDto> selectByName(Page<WelderEquipmentDto> page, String name, String unit) {
return null;
}
@Override
public Page<WelderEquipmentDto> selectByInfo(Page<WelderEquipmentDto> page, Test info, String unit) {
return null;
}
@Override
public WelderEquipmentDto customSelectById(Long sequenceNbr) {
return null;
}
/**
* 项目设备新增
*/
@Transactional()
public void welderSave(WelderEquipmentDto welderEquipmentDto) {
// 保存设备
Equipment equipment = new Equipment();
BeanUtils.copyProperties(welderEquipmentDto, equipment);
equipmentMapper.insert(equipment);
// 处理附件
MultipartFile[] files = welderEquipmentDto.getFiles();
// 保存项目与设备对应关系
ProjectResource projectResource = new ProjectResource();
projectResource.setProjectId(welderEquipmentDto.getProjectId());
projectResource.setName(equipment.getName());
projectResource.setType("equipment");
projectResource.setResourceId(equipment.getSequenceNbr());
projectResourceMapper.insert(projectResource);
}
/**
* 项目设备删除
* @param ids
*/
@Transactional
public void welderDelete(String ids) {
this.list(new QueryWrapper<ProjectResource>().lambda().in(
ProjectResource::getSequenceNbr,
Arrays.stream(ids.split(",")).map(Long::valueOf).collect(Collectors.toList()))
).forEach(item -> {
this.equipmentMapper.deleteById(item.getResourceId());
this.projectResourceMapper.deleteById(item.getSequenceNbr());
});
}
/**
* 存储项目设备关系
*/
......
......@@ -20,8 +20,8 @@ public class SuperviseRuleServiceImpl extends BaseService<SuperviseRuleDto,Super
/**
* 分页查询
*/
public Page<SuperviseRuleDto> queryForSuperviseRulePage(Page<SuperviseRuleDto> page) {
return this.queryForPage(page, null, false);
public Page<SuperviseRuleDto> queryForSuperviseRulePage(Page<SuperviseRuleDto> page, Long superviseDeptId, Long inspectionUnitId) {
return this.queryForPage(page, null, false, superviseDeptId, inspectionUnitId );
}
/**
......
......@@ -23,7 +23,7 @@ redis.cache.failure.time=10800
## emqx properties:
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.10.90:1883
emqx.broker=tcp://39.98.45.134:1883
emqx.user-name=super
emqx.password=123456
......@@ -31,3 +31,5 @@ fire-rescue=123
params.work.flow.processDefinitionKey=xiangmulixiangliucheng
amos.secret.key=ugp
#logging.level.com.yeejoin.amos=error
\ 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