供应商澄清信息待办接口
This commit is contained in:
4
pom.xml
4
pom.xml
@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.chinaunicom.ebtp</groupId>
|
<groupId>com.chinaunicom.ebtp</groupId>
|
||||||
<artifactId>mall-ebtp-cloud-parent</artifactId>
|
<artifactId>mall-ebtp-cloud-parent</artifactId>
|
||||||
<version>2.3.0-SNAPSHOT</version>
|
<version>2.3.1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>com.chinaunicom.mall.ebtp</groupId>
|
<groupId>com.chinaunicom.mall.ebtp</groupId>
|
||||||
@ -20,7 +20,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.chinaunicom.mall.ebtp</groupId>
|
<groupId>com.chinaunicom.mall.ebtp</groupId>
|
||||||
<artifactId>uboot-core</artifactId>
|
<artifactId>uboot-core</artifactId>
|
||||||
<version>2.3.0-SNAPSHOT</version>
|
<version>2.3.1-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,6 +3,8 @@ package com.chinaunicom.mall.ebtp.extend.bizmessage.controller;
|
|||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.dto.PageDTO;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.dto.PageDTO;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessageAuthorize;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessageAuthorize;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessageVo;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessageVo;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.SupplierMsgReadInVo;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.SupplierMsgReadOutVo;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.mybatis.IBizMessagePage;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.mybatis.IBizMessagePage;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.service.BizMessageConsumerService;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.service.BizMessageConsumerService;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.vo.DescribeSiteMsgDetailVO;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.vo.DescribeSiteMsgDetailVO;
|
||||||
@ -94,4 +96,17 @@ public class BizMessageConsumerController {
|
|||||||
this.service.updateState(id);
|
this.service.updateState(id);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商澄清待办
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("供应商澄清待办")
|
||||||
|
@PostMapping("supplierClearMsgRead")
|
||||||
|
@ResponseStatus(code = HttpStatus.OK)
|
||||||
|
public SupplierMsgReadOutVo supplierClearMsgRead(@RequestBody SupplierMsgReadInVo msgReadInVo) {
|
||||||
|
SupplierMsgReadOutVo outVo = this.service.supplierClearMsgRead(msgReadInVo);
|
||||||
|
return outVo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,7 @@ package com.chinaunicom.mall.ebtp.extend.bizmessage.dao;
|
|||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.dto.PageDTO;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.dto.PageDTO;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessage;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.*;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessageAuthorize;
|
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessageVo;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -30,4 +28,6 @@ public interface BizMessageMapper extends BaseMapper<BizMessage> {
|
|||||||
Integer deleteMessageById(@Param("magId")String magId);
|
Integer deleteMessageById(@Param("magId")String magId);
|
||||||
|
|
||||||
Integer deleteAuthorizeById(@Param("magId")String magId,@Param("userId")String userId);
|
Integer deleteAuthorizeById(@Param("magId")String magId,@Param("userId")String userId);
|
||||||
|
|
||||||
|
List<Message> supplierClearMsgRead(@Param("vo") SupplierMsgReadInVo msgReadInVo);
|
||||||
}
|
}
|
||||||
|
@ -136,4 +136,34 @@
|
|||||||
and user_id = #{userId}
|
and user_id = #{userId}
|
||||||
</if>
|
</if>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="supplierClearMsgRead" resultType="com.chinaunicom.mall.ebtp.extend.bizmessage.entity.Message">
|
||||||
|
SELECT
|
||||||
|
biz_message.id,
|
||||||
|
'' AS companyId,
|
||||||
|
authorize.user_id AS userId,
|
||||||
|
'0' AS type,
|
||||||
|
biz_message.title AS title,
|
||||||
|
biz_message.createtime AS createTime,
|
||||||
|
biz_message.content AS content
|
||||||
|
FROM
|
||||||
|
biz_message
|
||||||
|
LEFT JOIN biz_message_template ON biz_message.templatecode = biz_message_template.
|
||||||
|
CODE INNER JOIN biz_message_authorize authorize ON biz_message.id = authorize.message_id
|
||||||
|
WHERE
|
||||||
|
authorize = 1
|
||||||
|
AND biz_message.templatecode = 'T0002'
|
||||||
|
<if test="vo.state !=null and vo.state !=''">
|
||||||
|
AND authorize.state = #{vo.state}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="vo.companyObjs !=null and vo.companyObjs.size() > 0">
|
||||||
|
AND authorize.user_id in
|
||||||
|
<foreach item="companyObj" collection="vo.companyObjs" separator="," open="(" close=")" index="">
|
||||||
|
#{companyObj.userId, jdbcType=NUMERIC}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
and biz_message.createtime >= #{startTime}
|
||||||
|
and biz_message.createtime <= #{endTime}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
@ -0,0 +1,10 @@
|
|||||||
|
package com.chinaunicom.mall.ebtp.extend.bizmessage.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CompanyObj {
|
||||||
|
|
||||||
|
private String companyId;
|
||||||
|
private String userId;
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.chinaunicom.mall.ebtp.extend.bizmessage.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Message {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private String companyId;
|
||||||
|
private String userId;
|
||||||
|
private String type;
|
||||||
|
private String title;
|
||||||
|
private String createTime;
|
||||||
|
private String content;
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package com.chinaunicom.mall.ebtp.extend.bizmessage.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SupplierMsgReadInVo {
|
||||||
|
|
||||||
|
private List<CompanyObj> companyObjs;
|
||||||
|
private String state;
|
||||||
|
private String startTime;
|
||||||
|
private String endTime;
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.chinaunicom.mall.ebtp.extend.bizmessage.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SupplierMsgReadOutVo {
|
||||||
|
|
||||||
|
private List<Message> messageList;
|
||||||
|
}
|
@ -1,9 +1,7 @@
|
|||||||
package com.chinaunicom.mall.ebtp.extend.bizmessage.service;
|
package com.chinaunicom.mall.ebtp.extend.bizmessage.service;
|
||||||
|
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.dto.PageDTO;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.dto.PageDTO;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessage;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.*;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessageAuthorize;
|
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessageVo;
|
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.mybatis.IBizMessagePage;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.mybatis.IBizMessagePage;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.vo.DescribeSiteMsgVO;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.vo.DescribeSiteMsgVO;
|
||||||
|
|
||||||
@ -25,4 +23,11 @@ public interface BizMessageConsumerService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
BizMessageAuthorize getAuthorize(BizMessageAuthorize authorize);
|
BizMessageAuthorize getAuthorize(BizMessageAuthorize authorize);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商澄清待办
|
||||||
|
* @param msgReadInVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
SupplierMsgReadOutVo supplierClearMsgRead(SupplierMsgReadInVo msgReadInVo);
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.chinaunicom.mall.ebtp.common.base.service.IBaseCacheUserService;
|
import com.chinaunicom.mall.ebtp.common.base.service.IBaseCacheUserService;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.dao.BizMessageMapper;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.dao.BizMessageMapper;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.dto.PageDTO;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.dto.PageDTO;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessage;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.*;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessageAuthorize;
|
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessageVo;
|
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.mybatis.BizMessagePage;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.mybatis.BizMessagePage;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.mybatis.IBizMessagePage;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.mybatis.IBizMessagePage;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.service.BizMessageConsumerService;
|
import com.chinaunicom.mall.ebtp.extend.bizmessage.service.BizMessageConsumerService;
|
||||||
@ -16,9 +14,7 @@ import org.springframework.beans.BeanUtils;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -141,4 +137,28 @@ public class BizMessageConsumerServiceImpl implements BizMessageConsumerService
|
|||||||
List<BizMessageAuthorize> authorizes = this.mapper.findAuthorizeList(authorize);
|
List<BizMessageAuthorize> authorizes = this.mapper.findAuthorizeList(authorize);
|
||||||
return authorizes!=null&&authorizes.size()>0?authorizes.get(0):new BizMessageAuthorize();
|
return authorizes!=null&&authorizes.size()>0?authorizes.get(0):new BizMessageAuthorize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商澄清待办
|
||||||
|
* @param msgReadInVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SupplierMsgReadOutVo supplierClearMsgRead(SupplierMsgReadInVo msgReadInVo){
|
||||||
|
SupplierMsgReadOutVo vo = new SupplierMsgReadOutVo();
|
||||||
|
Map<String,String> companyMap = new HashMap<>();
|
||||||
|
|
||||||
|
msgReadInVo.getCompanyObjs().forEach(c->{
|
||||||
|
companyMap.put(c.getUserId(),c.getCompanyId());
|
||||||
|
});
|
||||||
|
|
||||||
|
//查询供应商 账号
|
||||||
|
List<Message> messageList = this.mapper.supplierClearMsgRead(msgReadInVo);
|
||||||
|
messageList.forEach(m->{
|
||||||
|
m.setCompanyId(companyMap.get(m.getUserId()));
|
||||||
|
});
|
||||||
|
|
||||||
|
vo.setMessageList(messageList);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user