mirror of https://github.com/elunez/eladmin
消息模块
parent
686bd25ed7
commit
1ef83f9e4a
|
@ -6,6 +6,12 @@ package me.zhengjie.modules.system.cons;
|
||||||
*/
|
*/
|
||||||
public enum MessageModulePath {
|
public enum MessageModulePath {
|
||||||
CUSTOMER_ORDER_LIST("客户订单列表","order/customerOrder"),
|
CUSTOMER_ORDER_LIST("客户订单列表","order/customerOrder"),
|
||||||
|
DELIVERY_ORDER_INFO_LIST("销售发货单列表","order/deliveryOrderInfo"),
|
||||||
|
OUT_SOURCE_LIST("委外加工单列表","outSource/outSourceProcess"),
|
||||||
|
OUT_SOURCE_INSPECTION_CERTIFICATE_LIST("委外验收单列表","outSource/outSourceInspectionCertificate"),
|
||||||
|
PRODUCT_PURCHASE_LIST("产品采购单列表","purchase/productPurchase"),
|
||||||
|
CONSUMABLES_PURCHASE_LIST("耗材采购单列表","purchase/consumablesPurchase"),
|
||||||
|
QUALITY_CHECKSHEET_LIST("质量检验单列表","productQuality/qualityCheckSheet"),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,12 @@ package me.zhengjie.modules.system.cons;
|
||||||
*/
|
*/
|
||||||
public enum MessageModuleType {
|
public enum MessageModuleType {
|
||||||
CUSTOMER_ORDER("客户订单", "CUSTOMER_ORDER"),
|
CUSTOMER_ORDER("客户订单", "CUSTOMER_ORDER"),
|
||||||
INVOICE("销售发货单", "INVOICE")
|
INVOICE("销售发货单", "INVOICE"),
|
||||||
|
OUT_SOURCE_PROCESS("委外加工单", "OUT_SOURCE_PROCESS"),
|
||||||
|
OUT_SOURCE_INSPECTION_CERTIFICATE("委外验收单", "OUT_SOURCE_INSPECTION_CERTIFICATE"),
|
||||||
|
PRODUCT_PURCHASE("产品采购单", "PRODUCT_PURCHASE"),
|
||||||
|
CONSUMABLES_PURCHASE("耗材采购单", "CONSUMABLES_PURCHASE"),
|
||||||
|
QUALITY_CHECK_SHEET("质量检验单", "QUALITY_CHECK_SHEET"),
|
||||||
|
|
||||||
;
|
;
|
||||||
private String name;
|
private String name;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package me.zhengjie.modules.system.repository;
|
package me.zhengjie.modules.system.repository;
|
||||||
|
|
||||||
import me.zhengjie.modules.system.domain.Menu;
|
|
||||||
import me.zhengjie.modules.system.domain.Message;
|
import me.zhengjie.modules.system.domain.Message;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
|
|
@ -25,14 +25,14 @@ public class MessageController {
|
||||||
private MessageService messageService;
|
private MessageService messageService;
|
||||||
|
|
||||||
@ApiOperation(value = "我的消息列表")
|
@ApiOperation(value = "我的消息列表")
|
||||||
@GetMapping(value = "/queryInvoiceList")
|
@GetMapping(value = "/queryMessageList")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','MESSAGE_ALL','MESSAGE_ALL')")
|
@PreAuthorize("hasAnyRole('ADMIN','MESSAGE_ALL','MESSAGE_ALL')")
|
||||||
public ResponseEntity queryInvoiceList(MessageCriteria criteria){
|
public ResponseEntity queryMessageList(MessageCriteria criteria){
|
||||||
return new ResponseEntity(messageService.queryAll(criteria), HttpStatus.OK);
|
return new ResponseEntity(messageService.queryAll(criteria), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log("修改消息")
|
@Log("修改消息")
|
||||||
@PutMapping(value = "/menus")
|
@PutMapping(value = "/message")
|
||||||
@PreAuthorize("hasAnyRole('ADMIN','MESSAGE_ALL','MESSAGE_EDIT')")
|
@PreAuthorize("hasAnyRole('ADMIN','MESSAGE_ALL','MESSAGE_EDIT')")
|
||||||
public ResponseEntity update(@Validated(Menu.Update.class) @RequestBody Message resources){
|
public ResponseEntity update(@Validated(Menu.Update.class) @RequestBody Message resources){
|
||||||
messageService.update(resources);
|
messageService.update(resources);
|
||||||
|
|
|
@ -3,7 +3,6 @@ package me.zhengjie.modules.system.service;
|
||||||
import me.zhengjie.modules.system.domain.Message;
|
import me.zhengjie.modules.system.domain.Message;
|
||||||
import me.zhengjie.modules.system.service.dto.MessageCriteria;
|
import me.zhengjie.modules.system.service.dto.MessageCriteria;
|
||||||
import me.zhengjie.modules.system.service.dto.MessageDTO;
|
import me.zhengjie.modules.system.service.dto.MessageDTO;
|
||||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceInspectionCertificateQueryCriteria;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 黄星星
|
* @author 黄星星
|
||||||
|
|
|
@ -250,6 +250,7 @@ public class CustomerOrderServiceImpl implements CustomerOrderService {
|
||||||
message.setModulePath(MessageModulePath.CUSTOMER_ORDER_LIST.getCode());
|
message.setModulePath(MessageModulePath.CUSTOMER_ORDER_LIST.getCode());
|
||||||
message.setModuleTypeName(MessageModuleType.CUSTOMER_ORDER.getCode());
|
message.setModuleTypeName(MessageModuleType.CUSTOMER_ORDER.getCode());
|
||||||
message.setReadStatus(MessageReadStatus.NO_READ.getStatus());
|
message.setReadStatus(MessageReadStatus.NO_READ.getStatus());
|
||||||
|
message.setInitCode(customerOrderCode);
|
||||||
messageList.add(message);
|
messageList.add(message);
|
||||||
}
|
}
|
||||||
messageRepository.saveAll(messageList);
|
messageRepository.saveAll(messageList);
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
package me.zhengjie.modules.wms.invoice.service.impl;
|
package me.zhengjie.modules.wms.invoice.service.impl;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import me.zhengjie.exception.BadRequestException;
|
import me.zhengjie.exception.BadRequestException;
|
||||||
|
import me.zhengjie.modules.system.cons.MessageModulePath;
|
||||||
|
import me.zhengjie.modules.system.cons.MessageModuleType;
|
||||||
|
import me.zhengjie.modules.system.cons.MessageReadStatus;
|
||||||
|
import me.zhengjie.modules.system.domain.Message;
|
||||||
|
import me.zhengjie.modules.system.repository.MessageRepository;
|
||||||
|
import me.zhengjie.modules.system.service.UserService;
|
||||||
|
import me.zhengjie.modules.system.service.dto.UserDTO;
|
||||||
|
import me.zhengjie.modules.system.service.dto.UserQueryCriteria;
|
||||||
import me.zhengjie.modules.wms.bd.domain.CustomerInfo;
|
import me.zhengjie.modules.wms.bd.domain.CustomerInfo;
|
||||||
import me.zhengjie.modules.wms.bd.domain.ProductInfo;
|
import me.zhengjie.modules.wms.bd.domain.ProductInfo;
|
||||||
import me.zhengjie.modules.wms.bd.repository.CustomerInfoRepository;
|
import me.zhengjie.modules.wms.bd.repository.CustomerInfoRepository;
|
||||||
|
@ -53,6 +62,7 @@ import javax.persistence.criteria.Root;
|
||||||
* @author jie
|
* @author jie
|
||||||
* @date 2019-08-27
|
* @date 2019-08-27
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||||
public class InvoiceServiceImpl implements InvoiceService {
|
public class InvoiceServiceImpl implements InvoiceService {
|
||||||
|
@ -75,6 +85,12 @@ public class InvoiceServiceImpl implements InvoiceService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProductInfoRepository productInfoRepository;
|
private ProductInfoRepository productInfoRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MessageRepository messageRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object queryAll(InvoiceQueryCriteria criteria, Pageable pageable){
|
public Object queryAll(InvoiceQueryCriteria criteria, Pageable pageable){
|
||||||
Specification<Invoice> specification = new Specification<Invoice>() {
|
Specification<Invoice> specification = new Specification<Invoice>() {
|
||||||
|
@ -261,6 +277,33 @@ public class InvoiceServiceImpl implements InvoiceService {
|
||||||
InvoiceDetailDTO invoiceDetailDTO = new InvoiceDetailDTO();
|
InvoiceDetailDTO invoiceDetailDTO = new InvoiceDetailDTO();
|
||||||
BeanUtils.copyProperties(invoiceDTO, invoiceDetailDTO);
|
BeanUtils.copyProperties(invoiceDTO, invoiceDetailDTO);
|
||||||
invoiceDetailDTO.setInvoiceProductDTOList(invoiceProductDTOList);
|
invoiceDetailDTO.setInvoiceProductDTOList(invoiceProductDTOList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增消息通知
|
||||||
|
*/
|
||||||
|
try {
|
||||||
|
// 查看所有用户
|
||||||
|
UserQueryCriteria userQueryCriteria = new UserQueryCriteria();
|
||||||
|
List<UserDTO> userDTOList =(List<UserDTO>)userService.queryAll(userQueryCriteria);
|
||||||
|
if(!CollectionUtils.isEmpty(userDTOList)){
|
||||||
|
List<Message> messageList = new ArrayList<>();
|
||||||
|
for(UserDTO userDTO : userDTOList){
|
||||||
|
Message message = new Message();
|
||||||
|
message.setUserIdAccept(userDTO.getId());
|
||||||
|
String messageContent = MessageModuleType.INVOICE.getName() + "(" + saleInvoiceCode + ")";
|
||||||
|
message.setMessContent(messageContent);
|
||||||
|
message.setModulePath(MessageModulePath.DELIVERY_ORDER_INFO_LIST.getCode());
|
||||||
|
message.setModuleTypeName(MessageModuleType.INVOICE.getCode());
|
||||||
|
message.setReadStatus(MessageReadStatus.NO_READ.getStatus());
|
||||||
|
message.setInitCode(saleInvoiceCode);
|
||||||
|
messageList.add(message);
|
||||||
|
}
|
||||||
|
messageRepository.saveAll(messageList);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("单据编号:插入消息失败!");
|
||||||
|
}
|
||||||
|
|
||||||
return invoiceDetailDTO;
|
return invoiceDetailDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
package me.zhengjie.modules.wms.outSourceProductSheet.service.impl;
|
package me.zhengjie.modules.wms.outSourceProductSheet.service.impl;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import me.zhengjie.exception.BadRequestException;
|
import me.zhengjie.exception.BadRequestException;
|
||||||
|
import me.zhengjie.modules.system.cons.MessageModulePath;
|
||||||
|
import me.zhengjie.modules.system.cons.MessageModuleType;
|
||||||
|
import me.zhengjie.modules.system.cons.MessageReadStatus;
|
||||||
|
import me.zhengjie.modules.system.domain.Message;
|
||||||
|
import me.zhengjie.modules.system.repository.MessageRepository;
|
||||||
|
import me.zhengjie.modules.system.service.UserService;
|
||||||
|
import me.zhengjie.modules.system.service.dto.UserDTO;
|
||||||
|
import me.zhengjie.modules.system.service.dto.UserQueryCriteria;
|
||||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceInspectionCertificate;
|
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceInspectionCertificate;
|
||||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceInspectionCertificateProduct;
|
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceInspectionCertificateProduct;
|
||||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceProcessSheet;
|
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceProcessSheet;
|
||||||
|
@ -43,6 +52,7 @@ import javax.persistence.criteria.Root;
|
||||||
* @author jie
|
* @author jie
|
||||||
* @date 2019-10-01
|
* @date 2019-10-01
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||||
public class OutSourceInspectionCertificateServiceImpl implements OutSourceInspectionCertificateService {
|
public class OutSourceInspectionCertificateServiceImpl implements OutSourceInspectionCertificateService {
|
||||||
|
@ -60,6 +70,12 @@ public class OutSourceInspectionCertificateServiceImpl implements OutSourceInspe
|
||||||
@Autowired
|
@Autowired
|
||||||
private OutSourceInspectionCertificateProductMapper outSourceInspectionCertificateProductMapper;
|
private OutSourceInspectionCertificateProductMapper outSourceInspectionCertificateProductMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MessageRepository messageRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object queryAll(OutSourceInspectionCertificateQueryCriteria criteria, Pageable pageable){
|
public Object queryAll(OutSourceInspectionCertificateQueryCriteria criteria, Pageable pageable){
|
||||||
Specification<OutSourceInspectionCertificate> specification = new Specification<OutSourceInspectionCertificate>() {
|
Specification<OutSourceInspectionCertificate> specification = new Specification<OutSourceInspectionCertificate>() {
|
||||||
|
@ -170,6 +186,31 @@ public class OutSourceInspectionCertificateServiceImpl implements OutSourceInspe
|
||||||
outSourceInspectionCertificateDTO.setOutSourceInspectionCertificateProductList(outSourceInspectionCertificateProductDTOList);
|
outSourceInspectionCertificateDTO.setOutSourceInspectionCertificateProductList(outSourceInspectionCertificateProductDTOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增消息通知
|
||||||
|
*/
|
||||||
|
try {
|
||||||
|
// 查看所有用户
|
||||||
|
UserQueryCriteria userQueryCriteria = new UserQueryCriteria();
|
||||||
|
List<UserDTO> userDTOList =(List<UserDTO>)userService.queryAll(userQueryCriteria);
|
||||||
|
if(!CollectionUtils.isEmpty(userDTOList)){
|
||||||
|
List<Message> messageList = new ArrayList<>();
|
||||||
|
for(UserDTO userDTO : userDTOList){
|
||||||
|
Message message = new Message();
|
||||||
|
message.setUserIdAccept(userDTO.getId());
|
||||||
|
String messageContent = MessageModuleType.OUT_SOURCE_INSPECTION_CERTIFICATE.getName() + "(" + outSourceInspectionCertificateCode + ")";
|
||||||
|
message.setMessContent(messageContent);
|
||||||
|
message.setModulePath(MessageModulePath.OUT_SOURCE_INSPECTION_CERTIFICATE_LIST.getCode());
|
||||||
|
message.setModuleTypeName(MessageModuleType.OUT_SOURCE_INSPECTION_CERTIFICATE.getCode());
|
||||||
|
message.setReadStatus(MessageReadStatus.NO_READ.getStatus());
|
||||||
|
message.setInitCode(outSourceInspectionCertificateCode);
|
||||||
|
messageList.add(message);
|
||||||
|
}
|
||||||
|
messageRepository.saveAll(messageList);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("单据编号:插入消息失败!");
|
||||||
|
}
|
||||||
return outSourceInspectionCertificateDTO;
|
return outSourceInspectionCertificateDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
package me.zhengjie.modules.wms.outSourceProductSheet.service.impl;
|
package me.zhengjie.modules.wms.outSourceProductSheet.service.impl;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import me.zhengjie.exception.BadRequestException;
|
import me.zhengjie.exception.BadRequestException;
|
||||||
|
import me.zhengjie.modules.system.cons.MessageModulePath;
|
||||||
|
import me.zhengjie.modules.system.cons.MessageModuleType;
|
||||||
|
import me.zhengjie.modules.system.cons.MessageReadStatus;
|
||||||
|
import me.zhengjie.modules.system.domain.Message;
|
||||||
|
import me.zhengjie.modules.system.repository.MessageRepository;
|
||||||
|
import me.zhengjie.modules.system.service.UserService;
|
||||||
|
import me.zhengjie.modules.system.service.dto.UserDTO;
|
||||||
|
import me.zhengjie.modules.system.service.dto.UserQueryCriteria;
|
||||||
import me.zhengjie.modules.wms.invoice.domain.Invoice;
|
import me.zhengjie.modules.wms.invoice.domain.Invoice;
|
||||||
import me.zhengjie.modules.wms.invoice.domain.InvoiceProduct;
|
import me.zhengjie.modules.wms.invoice.domain.InvoiceProduct;
|
||||||
import me.zhengjie.modules.wms.invoice.service.dto.InvoiceDTO;
|
import me.zhengjie.modules.wms.invoice.service.dto.InvoiceDTO;
|
||||||
|
@ -55,6 +64,7 @@ import javax.persistence.criteria.Root;
|
||||||
* @author jie
|
* @author jie
|
||||||
* @date 2019-08-17
|
* @date 2019-08-17
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||||
public class OutSourceProcessSheetServiceImpl implements OutSourceProcessSheetService {
|
public class OutSourceProcessSheetServiceImpl implements OutSourceProcessSheetService {
|
||||||
|
@ -71,6 +81,12 @@ public class OutSourceProcessSheetServiceImpl implements OutSourceProcessSheetSe
|
||||||
@Autowired
|
@Autowired
|
||||||
private OutSourceProcessSheetProductMapper outSourceProcessSheetProductMapper;
|
private OutSourceProcessSheetProductMapper outSourceProcessSheetProductMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MessageRepository messageRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object queryAll(OutSourceProcessSheetQueryCriteria criteria, Pageable pageable){
|
public Object queryAll(OutSourceProcessSheetQueryCriteria criteria, Pageable pageable){
|
||||||
Specification<OutSourceProcessSheet> specification = new Specification<OutSourceProcessSheet>() {
|
Specification<OutSourceProcessSheet> specification = new Specification<OutSourceProcessSheet>() {
|
||||||
|
@ -198,6 +214,32 @@ public class OutSourceProcessSheetServiceImpl implements OutSourceProcessSheetSe
|
||||||
outSourceProcessSheetDTO.setOutSourceProcessSheetProductList(outSourceProcessSheetProductDTOList);
|
outSourceProcessSheetDTO.setOutSourceProcessSheetProductList(outSourceProcessSheetProductDTOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增消息通知
|
||||||
|
*/
|
||||||
|
try {
|
||||||
|
// 查看所有用户
|
||||||
|
UserQueryCriteria userQueryCriteria = new UserQueryCriteria();
|
||||||
|
List<UserDTO> userDTOList =(List<UserDTO>)userService.queryAll(userQueryCriteria);
|
||||||
|
if(!CollectionUtils.isEmpty(userDTOList)){
|
||||||
|
List<Message> messageList = new ArrayList<>();
|
||||||
|
for(UserDTO userDTO : userDTOList){
|
||||||
|
Message message = new Message();
|
||||||
|
message.setUserIdAccept(userDTO.getId());
|
||||||
|
String messageContent = MessageModuleType.OUT_SOURCE_PROCESS.getName() + "(" + outSourceProcessSheetCode + ")";
|
||||||
|
message.setMessContent(messageContent);
|
||||||
|
message.setModulePath(MessageModulePath.OUT_SOURCE_LIST.getCode());
|
||||||
|
message.setModuleTypeName(MessageModuleType.OUT_SOURCE_PROCESS.getCode());
|
||||||
|
message.setReadStatus(MessageReadStatus.NO_READ.getStatus());
|
||||||
|
message.setInitCode(outSourceProcessSheetCode);
|
||||||
|
messageList.add(message);
|
||||||
|
}
|
||||||
|
messageRepository.saveAll(messageList);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("单据编号:插入消息失败!");
|
||||||
|
}
|
||||||
|
|
||||||
return outSourceProcessSheetDTO;
|
return outSourceProcessSheetDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
package me.zhengjie.modules.wms.purchase.service.impl;
|
package me.zhengjie.modules.wms.purchase.service.impl;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import me.zhengjie.exception.BadRequestException;
|
import me.zhengjie.exception.BadRequestException;
|
||||||
|
import me.zhengjie.modules.system.cons.MessageModulePath;
|
||||||
|
import me.zhengjie.modules.system.cons.MessageModuleType;
|
||||||
|
import me.zhengjie.modules.system.cons.MessageReadStatus;
|
||||||
|
import me.zhengjie.modules.system.domain.Message;
|
||||||
|
import me.zhengjie.modules.system.repository.MessageRepository;
|
||||||
|
import me.zhengjie.modules.system.service.UserService;
|
||||||
|
import me.zhengjie.modules.system.service.dto.UserDTO;
|
||||||
|
import me.zhengjie.modules.system.service.dto.UserQueryCriteria;
|
||||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceProcessSheet;
|
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceProcessSheet;
|
||||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceProcessSheetProduct;
|
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceProcessSheetProduct;
|
||||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceProcessSheetDTO;
|
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceProcessSheetDTO;
|
||||||
|
@ -47,6 +56,7 @@ import javax.persistence.criteria.Root;
|
||||||
* @author jie
|
* @author jie
|
||||||
* @date 2019-10-06
|
* @date 2019-10-06
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||||
public class ConsumablesPurchaseOrderServiceImpl implements ConsumablesPurchaseOrderService {
|
public class ConsumablesPurchaseOrderServiceImpl implements ConsumablesPurchaseOrderService {
|
||||||
|
@ -63,6 +73,12 @@ public class ConsumablesPurchaseOrderServiceImpl implements ConsumablesPurchaseO
|
||||||
@Autowired
|
@Autowired
|
||||||
private ConsumablesPurchaseOrderProductMapper consumablesPurchaseOrderProductMapper;
|
private ConsumablesPurchaseOrderProductMapper consumablesPurchaseOrderProductMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MessageRepository messageRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object queryAll(ConsumablesPurchaseOrderQueryCriteria criteria, Pageable pageable){
|
public Object queryAll(ConsumablesPurchaseOrderQueryCriteria criteria, Pageable pageable){
|
||||||
Specification<ConsumablesPurchaseOrder> specification = new Specification<ConsumablesPurchaseOrder>() {
|
Specification<ConsumablesPurchaseOrder> specification = new Specification<ConsumablesPurchaseOrder>() {
|
||||||
|
@ -189,6 +205,32 @@ public class ConsumablesPurchaseOrderServiceImpl implements ConsumablesPurchaseO
|
||||||
consumablesPurchaseOrderDTO.setConsumablesPurchaseOrderProductList(consumablesPurchaseOrderProductDTOList);
|
consumablesPurchaseOrderDTO.setConsumablesPurchaseOrderProductList(consumablesPurchaseOrderProductDTOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增消息通知
|
||||||
|
*/
|
||||||
|
try {
|
||||||
|
// 查看所有用户
|
||||||
|
UserQueryCriteria userQueryCriteria = new UserQueryCriteria();
|
||||||
|
List<UserDTO> userDTOList =(List<UserDTO>)userService.queryAll(userQueryCriteria);
|
||||||
|
if(!CollectionUtils.isEmpty(userDTOList)){
|
||||||
|
List<Message> messageList = new ArrayList<>();
|
||||||
|
for(UserDTO userDTO : userDTOList){
|
||||||
|
Message message = new Message();
|
||||||
|
message.setUserIdAccept(userDTO.getId());
|
||||||
|
String messageContent = MessageModuleType.CONSUMABLES_PURCHASE.getName() + "(" + consumablesPurchaseOrderCode + ")";
|
||||||
|
message.setMessContent(messageContent);
|
||||||
|
message.setModulePath(MessageModulePath.CONSUMABLES_PURCHASE_LIST.getCode());
|
||||||
|
message.setModuleTypeName(MessageModuleType.CONSUMABLES_PURCHASE.getCode());
|
||||||
|
message.setReadStatus(MessageReadStatus.NO_READ.getStatus());
|
||||||
|
message.setInitCode(consumablesPurchaseOrderCode);
|
||||||
|
messageList.add(message);
|
||||||
|
}
|
||||||
|
messageRepository.saveAll(messageList);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("单据编号:插入消息失败!");
|
||||||
|
}
|
||||||
return consumablesPurchaseOrderDTO;
|
return consumablesPurchaseOrderDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
package me.zhengjie.modules.wms.purchase.service.impl;
|
package me.zhengjie.modules.wms.purchase.service.impl;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import me.zhengjie.exception.BadRequestException;
|
import me.zhengjie.exception.BadRequestException;
|
||||||
|
import me.zhengjie.modules.system.cons.MessageModulePath;
|
||||||
|
import me.zhengjie.modules.system.cons.MessageModuleType;
|
||||||
|
import me.zhengjie.modules.system.cons.MessageReadStatus;
|
||||||
|
import me.zhengjie.modules.system.domain.Message;
|
||||||
|
import me.zhengjie.modules.system.repository.MessageRepository;
|
||||||
|
import me.zhengjie.modules.system.service.UserService;
|
||||||
|
import me.zhengjie.modules.system.service.dto.UserDTO;
|
||||||
|
import me.zhengjie.modules.system.service.dto.UserQueryCriteria;
|
||||||
import me.zhengjie.modules.wms.purchase.cons.AuditStatus;
|
import me.zhengjie.modules.wms.purchase.cons.AuditStatus;
|
||||||
import me.zhengjie.modules.wms.purchase.domain.ConsumablesPurchaseOrder;
|
import me.zhengjie.modules.wms.purchase.domain.ConsumablesPurchaseOrder;
|
||||||
import me.zhengjie.modules.wms.purchase.domain.ProductPurchaseOrder;
|
import me.zhengjie.modules.wms.purchase.domain.ProductPurchaseOrder;
|
||||||
|
@ -48,6 +57,7 @@ import javax.persistence.criteria.Root;
|
||||||
* @author jie
|
* @author jie
|
||||||
* @date 2019-10-06
|
* @date 2019-10-06
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||||
public class ProductPurchaseOrderServiceImpl implements ProductPurchaseOrderService {
|
public class ProductPurchaseOrderServiceImpl implements ProductPurchaseOrderService {
|
||||||
|
@ -64,6 +74,12 @@ public class ProductPurchaseOrderServiceImpl implements ProductPurchaseOrderServ
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProductPurchaseOrderProductMapper productPurchaseOrderProductMapper;
|
private ProductPurchaseOrderProductMapper productPurchaseOrderProductMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MessageRepository messageRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object queryAll(ProductPurchaseOrderQueryCriteria criteria, Pageable pageable){
|
public Object queryAll(ProductPurchaseOrderQueryCriteria criteria, Pageable pageable){
|
||||||
Specification<ProductPurchaseOrder> specification = new Specification<ProductPurchaseOrder>() {
|
Specification<ProductPurchaseOrder> specification = new Specification<ProductPurchaseOrder>() {
|
||||||
|
@ -189,6 +205,32 @@ public class ProductPurchaseOrderServiceImpl implements ProductPurchaseOrderServ
|
||||||
productPurchaseOrderDTO.setProductPurchaseOrderProductList(productPurchaseOrderProductDTOList);
|
productPurchaseOrderDTO.setProductPurchaseOrderProductList(productPurchaseOrderProductDTOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增消息通知
|
||||||
|
*/
|
||||||
|
try {
|
||||||
|
// 查看所有用户
|
||||||
|
UserQueryCriteria userQueryCriteria = new UserQueryCriteria();
|
||||||
|
List<UserDTO> userDTOList =(List<UserDTO>)userService.queryAll(userQueryCriteria);
|
||||||
|
if(!CollectionUtils.isEmpty(userDTOList)){
|
||||||
|
List<Message> messageList = new ArrayList<>();
|
||||||
|
for(UserDTO userDTO : userDTOList){
|
||||||
|
Message message = new Message();
|
||||||
|
message.setUserIdAccept(userDTO.getId());
|
||||||
|
String messageContent = MessageModuleType.PRODUCT_PURCHASE.getName() + "(" + productPurchaseOrderCode + ")";
|
||||||
|
message.setMessContent(messageContent);
|
||||||
|
message.setModulePath(MessageModulePath.PRODUCT_PURCHASE_LIST.getCode());
|
||||||
|
message.setModuleTypeName(MessageModuleType.PRODUCT_PURCHASE.getCode());
|
||||||
|
message.setReadStatus(MessageReadStatus.NO_READ.getStatus());
|
||||||
|
message.setInitCode(productPurchaseOrderCode);
|
||||||
|
messageList.add(message);
|
||||||
|
}
|
||||||
|
messageRepository.saveAll(messageList);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("单据编号:插入消息失败!");
|
||||||
|
}
|
||||||
return productPurchaseOrderDTO;
|
return productPurchaseOrderDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
package me.zhengjie.modules.wms.qualityCheckSheet.service.impl;
|
package me.zhengjie.modules.wms.qualityCheckSheet.service.impl;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import me.zhengjie.exception.BadRequestException;
|
import me.zhengjie.exception.BadRequestException;
|
||||||
|
import me.zhengjie.modules.system.cons.MessageModulePath;
|
||||||
|
import me.zhengjie.modules.system.cons.MessageModuleType;
|
||||||
|
import me.zhengjie.modules.system.cons.MessageReadStatus;
|
||||||
|
import me.zhengjie.modules.system.domain.Message;
|
||||||
|
import me.zhengjie.modules.system.repository.MessageRepository;
|
||||||
|
import me.zhengjie.modules.system.service.UserService;
|
||||||
|
import me.zhengjie.modules.system.service.dto.UserDTO;
|
||||||
|
import me.zhengjie.modules.system.service.dto.UserQueryCriteria;
|
||||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceInspectionCertificate;
|
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceInspectionCertificate;
|
||||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceInspectionCertificateProduct;
|
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceInspectionCertificateProduct;
|
||||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceProcessSheet;
|
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceProcessSheet;
|
||||||
|
@ -56,6 +65,7 @@ import javax.persistence.criteria.Root;
|
||||||
* @author huangxingxing
|
* @author huangxingxing
|
||||||
* @date 2019-11-12
|
* @date 2019-11-12
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||||
public class QualityCheckSheetServiceImpl implements QualityCheckSheetService {
|
public class QualityCheckSheetServiceImpl implements QualityCheckSheetService {
|
||||||
|
@ -72,6 +82,12 @@ public class QualityCheckSheetServiceImpl implements QualityCheckSheetService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private QualityCheckSheetProductMapper qualityCheckSheetProductMapper;
|
private QualityCheckSheetProductMapper qualityCheckSheetProductMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MessageRepository messageRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object queryAll(QualityCheckSheetQueryCriteria criteria, Pageable pageable){
|
public Object queryAll(QualityCheckSheetQueryCriteria criteria, Pageable pageable){
|
||||||
Specification<QualityCheckSheet> specification = new Specification<QualityCheckSheet>() {
|
Specification<QualityCheckSheet> specification = new Specification<QualityCheckSheet>() {
|
||||||
|
@ -197,6 +213,32 @@ public class QualityCheckSheetServiceImpl implements QualityCheckSheetService {
|
||||||
qualityCheckSheetDTO.setQualityCheckSheetProductList(qualityCheckSheetProductDTOList);
|
qualityCheckSheetDTO.setQualityCheckSheetProductList(qualityCheckSheetProductDTOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增消息通知
|
||||||
|
*/
|
||||||
|
try {
|
||||||
|
// 查看所有用户
|
||||||
|
UserQueryCriteria userQueryCriteria = new UserQueryCriteria();
|
||||||
|
List<UserDTO> userDTOList =(List<UserDTO>)userService.queryAll(userQueryCriteria);
|
||||||
|
if(!CollectionUtils.isEmpty(userDTOList)){
|
||||||
|
List<Message> messageList = new ArrayList<>();
|
||||||
|
for(UserDTO userDTO : userDTOList){
|
||||||
|
Message message = new Message();
|
||||||
|
message.setUserIdAccept(userDTO.getId());
|
||||||
|
String messageContent = MessageModuleType.QUALITY_CHECK_SHEET.getName() + "(" + qualityCheekSheetCode + ")";
|
||||||
|
message.setMessContent(messageContent);
|
||||||
|
message.setModulePath(MessageModulePath.QUALITY_CHECKSHEET_LIST.getCode());
|
||||||
|
message.setModuleTypeName(MessageModuleType.QUALITY_CHECK_SHEET.getCode());
|
||||||
|
message.setReadStatus(MessageReadStatus.NO_READ.getStatus());
|
||||||
|
message.setInitCode(qualityCheekSheetCode);
|
||||||
|
messageList.add(message);
|
||||||
|
}
|
||||||
|
messageRepository.saveAll(messageList);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("单据编号:插入消息失败!");
|
||||||
|
}
|
||||||
|
|
||||||
return qualityCheckSheetDTO;
|
return qualityCheckSheetDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue