Commit 4fcb483d authored by DESKTOP-BQLVS7A\admin's avatar DESKTOP-BQLVS7A\admin

合并两个信息表接口并进行更改

parent 3a0ff2e5
......@@ -21,7 +21,7 @@ public enum RectifyMsgEnum {
static {
for (WeldMethodEnum weldMethodEnum : WeldMethodEnum.values()) {
map.put(weldMethodEnum.getState(), weldMethodEnum.getName());
map.put(weldMethodEnum.getName(), weldMethodEnum.getState());
}
}
}
......@@ -30,6 +30,9 @@ public class RectifyMsgDto extends BaseDto {
@ApiModelProperty(value = "短信接收人")
private Long msgReceiver;
@ApiModelProperty(value = "短信接收人姓名")
private String msgReceiverName;
@ApiModelProperty(value = "短信通知内容")
private String content;
......
......@@ -29,6 +29,12 @@ public class RectifyMsg extends BaseEntity {
private Long problemId;
/**
* 项目安装告知id
*/
@TableField("install_notice_id")
private Long installNoticeId;
/**
* 短信通知单位id
*/
@TableField("notice_unit_id")
......@@ -58,4 +64,10 @@ public class RectifyMsg extends BaseEntity {
@TableField("is_read")
private Boolean isRead;
/**
* 短信状态:已读、未读
*/
@TableField("is_problem")
private Boolean isProblem;
}
......@@ -6,9 +6,12 @@ import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.RectifyMsgDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.RectifyMsg;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.Set;
/**
* 整改短信通知表 Mapper 接口
*
......@@ -19,7 +22,13 @@ import org.springframework.stereotype.Repository;
public interface RectifyMsgMapper extends BaseMapper<RectifyMsg> {
IPage<RectifyMsgDto> queryForRectifyMsgPage(IPage<RectifyMsgDto> page, String name,String installationUnit );
IPage<RectifyMsg> queryForRectifyMsgPage(IPage<RectifyMsg> page, String name,String isProblem,String installationUnit );
Page<RectifyMsgDto> InstallNoticeMsgPage(IPage<RectifyMsgDto> page, @Param("name") String name, @Param("installationUnit") String installationUnit, Set<String> seqs);
Page<RectifyMsgDto> selectByName(Page<RectifyMsgDto> page, @Param("name") String name, @Param("unit") String unit);
RectifyMsgDto customSelectById(@Param("sequenceNbr") Long sequenceNbr);
......
......@@ -6,16 +6,23 @@ 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.RectifyMsgDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.RectifyMsg;
import org.springframework.stereotype.Service;
/**
* 整改短信通知表接口类
* 短信通知表接口类
*
* @author system_generator
* @date 2022-09-22
*/
public interface IRectifyMsgService {
IPage<RectifyMsgDto> queryForRectifyMsgPage(IPage<RectifyMsgDto> page, String name, String installationUnit);
IPage<RectifyMsg> queryForRectifyMsgPage(IPage<RectifyMsg> page, String name,Boolean isProblem, String installationUnit);
Page<RectifyMsgDto> installNoticeMsgList(Page<RectifyMsgDto> page, String name, String installationUnit);
//安装告知页面分页查询
Page<RectifyMsgDto> selectByName(Page<RectifyMsgDto> page, String name ,String unit);
//根据sequenceNbr查询列表数据
RectifyMsgDto customSelectById(Long sequenceNbr);
}
......@@ -23,5 +23,79 @@
</select>
<select id="InstallNoticeMsgPage" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.RectifyMsgDto">
SELECT `name`,
install_region,
start_date,
construction_unit,
installation_unit,
progress_status,
notice_unit_id,
msg_receiver,
content,
send_time,
tz_ugp_project.rec_date
FROM tz_ugp_project,
tz_ugp_rectify_msg,
tz_ugp_install_notice
where tz_ugp_project.sequence_nbr = tz_ugp_install_notice.project_id
and tz_ugp_rectify_msg.install_notice_id = tz_ugp_install_notice.sequence_nbr
<if test="name != null and name != ''">
and tz_ugp_project.name like '%${name}%'
</if>
<if test="installationUnit != null and installationUnit != ''">
and tz_ugp_project.installation_unit like concat("%",#{installationUnit},"%")
</if>
<if test=" seqs != null">
and tz_ugp_rectify_msg.install_notice_id in
<foreach collection="seqs" item = "item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
order by rec_date desc
</select>
<select id="selectByName" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.RectifyMsgDto">
SELECT name,
install_region,
start_date,
construction_unit,
installation_unit,
progress_status,
notice_unit_id,
msg_receiver,
content,
send_time
FROM tz_ugp_project,
tz_ugp_rectify_msg,
tz_ugp_install_notice
where tz_ugp_project.sequence_nbr = tz_ugp_install_notice.project_id
and tz_ugp_rectify_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.RectifyMsgDto">
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_rectify_msg,
tz_ugp_install_notice
where tz_ugp_project.sequence_nbr = tz_ugp_install_notice.project_id
and tz_ugp_rectify_msg.install_notice_id = tz_ugp_install_notice.sequence_nbr
and tz_ugp_project.sequence_nbr = #{sequenceNbr}
</select>
</mapper>
package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeMsgPageDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.MsgNoticeDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.RectifyMsg;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
......@@ -36,6 +38,7 @@ public class RectifyMsgController extends BaseController {
@Autowired
RectifyMsgServiceImpl rectifyMsgServiceImpl;
/**
* 新增整改短信通知表
*
......@@ -94,20 +97,22 @@ public class RectifyMsgController extends BaseController {
*
* @param current 当前页
* @param current 每页大小
* @Param isProblem 区分质量表和告知信息表
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "整改短信通知表分页查询", notes = "整改短信通知表分页查询")
public ResponseModel<IPage<RectifyMsgDto>> queryForPage(
@ApiOperation(httpMethod = "GET",value = "整改短信通知、告知分页查询", notes = "整改短信通知表、告知分页查询")
public ResponseModel<IPage<RectifyMsg>> queryForPage(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "isProblem") Boolean isProblem,
@RequestParam(value = "name",required = false) String name,
@RequestParam(value = "installationUnit",required = false) String installationUnit) {
IPage<RectifyMsgDto> page = new Page<RectifyMsgDto>();
IPage<RectifyMsg> page = new Page<RectifyMsg>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(rectifyMsgServiceImpl.queryForRectifyMsgPage(page,name,installationUnit));
return ResponseHelper.buildResponse(rectifyMsgServiceImpl.queryForRectifyMsgPage(page,name,isProblem,installationUnit));
}
/**
......@@ -145,4 +150,43 @@ public class RectifyMsgController extends BaseController {
page.setTotal(msgNoticeDtoList.size());
return ResponseHelper.buildResponse(page);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新项目安装告知短信记录表", notes = "根据sequenceNbr更新项目安装告知短信记录表")
public ResponseModel<RectifyMsgDto> updateBySequenceNbrInstallNoticeMsg(@RequestBody RectifyMsgDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(rectifyMsgServiceImpl.updateWithModel(model));
}
/**
* 安装告知短信通知记录列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/msgpage")
@ApiOperation(httpMethod = "GET",value = "安装告知短信记录表分页查询", notes = "项目安装告知短信记录表分页查询")
public ResponseModel<Page<RectifyMsgDto>> 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<RectifyMsgDto> page = new Page<RectifyMsgDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(rectifyMsgServiceImpl.installNoticeMsgList(page, name, installationUnit));
}
}
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