Commit 649def05 authored by limei's avatar limei

修改查看公司详情接口sql

parent 332ee2ea
......@@ -17,38 +17,12 @@
<select id="queryBySeq1" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto">
SELECT
c.sequence_nbr,
c.name,
c.type,
c.credit_code,
c.*,
l.cert_no as license_number,
l.expiry_date as expiration_date,
c.address,
c.contact_phone,
c.contact,
c.remark,
c.credit_attch,
c.license_attch,
c.approved,
c.org_code,
c.admin_name,
c.admin_tel,
c.legal_person,
c.legal_person_tel,
c.unit_tel,
c.create_time,
c.admin_lincense_pic,
c.admin_login_name,
c.admin_login_pwd,
c.region_code,
c.rec_user_id,
c.rec_user_name,
c.rec_date,
c.is_delete
FROM
`tz_ugp_unit_licence` as l,
`tz_ugp_company` as c
where l.unit_code = c.credit_code and c.sequence_nbr = #{sequenceNbr}
l.expiry_date as expiration_date
FROM tz_ugp_company as c
LEFT JOIN tz_ugp_unit_licence as l ON l.unit_code = c.credit_code
WHERE c.sequence_nbr = #{sequenceNbr}
</select>
</mapper>
......@@ -137,19 +137,10 @@ public class RectifyMsgController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "消息已读", notes = "消息已读")
@GetMapping(value = "/allRead")
public ResponseModel<Page<MsgNoticeDto>> allRead(@RequestParam(value = "isRead",required = false) Boolean isRead,Long current,Long size){
public ResponseModel<Page<MsgNoticeDto>> allRead(Long current,Long size){
Page page = new Page(current,size);
List<MsgNoticeDto> msgNoticeDtoList = new ArrayList<>();
msgNoticeDtoList.addAll(rectifyMsgServiceImpl.msgNotice(isRead));
if(!ValidationUtil.isEmpty(msgNoticeDtoList)) {
for(MsgNoticeDto msgNoticeDto:msgNoticeDtoList){
msgNoticeDto.setStatus("已读");
}if(!ValidationUtil.isEmpty(isRead)) {
if (!isRead) {
isRead = true;
}
}
}
msgNoticeDtoList.addAll(rectifyMsgServiceImpl.allRead());
page.setRecords(msgNoticeDtoList);
page.setTotal(msgNoticeDtoList.size());
return ResponseHelper.buildResponse(page);
......
......@@ -44,6 +44,8 @@ public class RectifyMsgServiceImpl extends BaseService<RectifyMsgDto,RectifyMsg,
OrgServiceImpl orgService;
@Autowired
InstallNoticeMsgMapper installNoticeMsgMapper;
@Autowired
InstallNoticeMsgServiceImpl installNoticeMsgService;
/**
......@@ -95,8 +97,10 @@ public class RectifyMsgServiceImpl extends BaseService<RectifyMsgDto,RectifyMsg,
if(!ValidationUtil.isEmpty(installNoticeMsg.getIsRead())){
if(installNoticeMsg.getIsRead()){
msgNoticeDto.setStatus("已读");
installNoticeMsg.setIsRead(true);
}else{
msgNoticeDto.setStatus("未读");
installNoticeMsg.setIsRead(false);
}
}
msgNoticeDto.setCreateDate(installNoticeMsg.getSendTime());
......@@ -127,4 +131,58 @@ public class RectifyMsgServiceImpl extends BaseService<RectifyMsgDto,RectifyMsg,
return msgNoticeDtoList;
}
@BusinessIdentify
public List<MsgNoticeDto> allRead(){
LambdaQueryWrapper<InstallNoticeMsg> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(InstallNoticeMsg::getTargetPersonId,orgService.getReginParams().getBusinessInfo().getUserSequenceNbr())
.orderByDesc(InstallNoticeMsg::getSendTime);
LambdaQueryWrapper<RectifyMsg> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(RectifyMsg::getMsgReceiver,orgService.getReginParams().getBusinessInfo().getUserSequenceNbr())
.orderByDesc(RectifyMsg::getSendTime);
List<RectifyMsg> rectifyMsgList = rectifyMsgMapper.selectList(wrapper1);
List<InstallNoticeMsg> installNoticeMsgList = installNoticeMsgMapper.selectList(wrapper);
List<MsgNoticeDto> msgNoticeDtoList = new ArrayList<>();
if(!ValidationUtil.isEmpty(installNoticeMsgList)) {
for (InstallNoticeMsg installNoticeMsg : installNoticeMsgList) {
MsgNoticeDto msgNoticeDto = new MsgNoticeDto();
String contents = installNoticeMsg.getContent();
msgNoticeDto.setCreateDate(installNoticeMsg.getSendTime());
msgNoticeDto.setSequenceNbr(installNoticeMsg.getSequenceNbr());
if (!ValidationUtil.isEmpty(contents)) {
String form = contents.substring(contents.indexOf('【') + 1, contents.indexOf("】"));
String context = contents.substring(contents.indexOf("】") + 1);
msgNoticeDto.setType(form);
msgNoticeDto.setContent(context);
}
if(!ValidationUtil.isEmpty(installNoticeMsg.getIsRead())){
msgNoticeDto.setStatus("已读");
installNoticeMsg.setIsRead(true);
installNoticeMsgMapper.updateById(installNoticeMsg);
}
msgNoticeDtoList.add(msgNoticeDto);
}
}
if(!ValidationUtil.isEmpty(rectifyMsgList)) {
for (RectifyMsg rectifyMsg : rectifyMsgList) {
MsgNoticeDto msgNoticeDto = new MsgNoticeDto();
String contents = rectifyMsg.getContent();
msgNoticeDto.setCreateDate(rectifyMsg.getSendTime());
msgNoticeDto.setSequenceNbr(rectifyMsg.getSequenceNbr());
if (!ValidationUtil.isEmpty(contents)) {
msgNoticeDto.setType(contents.substring(contents.indexOf('【') + 1, contents.indexOf("】")));
msgNoticeDto.setContent(contents.substring(contents.indexOf("】") + 1));
}
if(!ValidationUtil.isEmpty(rectifyMsg.getIsRead())){
msgNoticeDto.setStatus("已读");
rectifyMsg.setIsRead(true);
rectifyMsgMapper.updateById(rectifyMsg);
}
msgNoticeDtoList.add(msgNoticeDto);
}
}
return msgNoticeDtoList;
}
}
\ 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