mirror of https://github.com/elunez/eladmin
耗材管理 委外验收单 采购单
parent
4c1fb7d7c1
commit
750a625434
|
|
@ -0,0 +1,44 @@
|
|||
package me.zhengjie.modules.wms.bd.domain;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import lombok.Data;
|
||||
import org.hibernate.annotations.CreationTimestamp;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-05
|
||||
*/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="bd_consumables_info")
|
||||
public class ConsumablesInfo implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
private Long id;
|
||||
|
||||
@Column(name = "create_time")
|
||||
@CreationTimestamp
|
||||
private Timestamp createTime;
|
||||
|
||||
@Column(name = "update_time")
|
||||
@CreationTimestamp
|
||||
private Timestamp updateTime;
|
||||
|
||||
// 耗材名称
|
||||
@Column(name = "consumables_name")
|
||||
private String consumablesName;
|
||||
|
||||
@Column(name = "status")
|
||||
private Boolean status;
|
||||
|
||||
public void copy(ConsumablesInfo source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package me.zhengjie.modules.wms.bd.repository;
|
||||
|
||||
import me.zhengjie.modules.wms.bd.domain.ConsumablesInfo;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-05
|
||||
*/
|
||||
public interface ConsumablesInfoRepository extends JpaRepository<ConsumablesInfo, Long>, JpaSpecificationExecutor {
|
||||
|
||||
/**
|
||||
* 根据主键查询状态正常的计量单位
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
ConsumablesInfo findByIdAndStatusTrue(long id);
|
||||
|
||||
/**
|
||||
* 根据name查询状态正常的计量单位
|
||||
* @param consumablesName
|
||||
* @return
|
||||
*/
|
||||
ConsumablesInfo findByConsumablesNameAndStatusTrue(String consumablesName);
|
||||
|
||||
/**
|
||||
* 根据name查询状态删除的计量单位
|
||||
* @param consumablesName
|
||||
* @return
|
||||
*/
|
||||
ConsumablesInfo findByConsumablesNameAndStatusFalse(String consumablesName);
|
||||
|
||||
|
||||
@Modifying
|
||||
@Query(value = "update bd_consumables_info set status = 1 where id = ?1",nativeQuery = true)
|
||||
void updateStatusToTrue(long id);
|
||||
|
||||
/**
|
||||
* 删除计量单位(逻辑删除)
|
||||
* @param id
|
||||
*/
|
||||
@Modifying
|
||||
@Query(value = "update bd_consumables_info set status = 0 where id = ?1",nativeQuery = true)
|
||||
void deleteConsumablesInfo(long id);
|
||||
|
||||
/**
|
||||
* 修改计量单位名称
|
||||
* @param name
|
||||
* @param id
|
||||
*/
|
||||
@Modifying
|
||||
@Query(value = "update bd_consumables_info set consumables_name = ?1 where id = ?2",nativeQuery = true)
|
||||
void updateNameById(String name, long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
package me.zhengjie.modules.wms.bd.rest;
|
||||
|
||||
import me.zhengjie.aop.log.Log;
|
||||
import me.zhengjie.modules.wms.bd.domain.ConsumablesInfo;
|
||||
import me.zhengjie.modules.wms.bd.service.ConsumablesInfoService;
|
||||
import me.zhengjie.modules.wms.bd.service.dto.ConsumablesInfoQueryCriteria;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-05
|
||||
*/
|
||||
@Api(tags = "耗材管理")
|
||||
@RestController
|
||||
@RequestMapping("api")
|
||||
public class ConsumablesInfoController {
|
||||
|
||||
@Autowired
|
||||
private ConsumablesInfoService consumablesInfoService;
|
||||
|
||||
@Log("分页查询耗材列表")
|
||||
@ApiOperation(value = "分页查询耗材列表")
|
||||
@GetMapping(value = "/queryConsumablesInfoPageList")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','BDCONSUMABLESINFO_ALL','BDCONSUMABLESINFO_SELECT')")
|
||||
public ResponseEntity queryConsumablesInfoPageList(ConsumablesInfoQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity(consumablesInfoService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("分页查询耗材列表")
|
||||
@ApiOperation(value = "分页查询耗材列表")
|
||||
@GetMapping(value = "/queryConsumablesInfoList")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','BDCONSUMABLESINFO_ALL','BDCONSUMABLESINFO_SELECT')")
|
||||
public ResponseEntity queryConsumablesInfoList(ConsumablesInfoQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity(consumablesInfoService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("新增耗材")
|
||||
@ApiOperation(value = "新增耗材")
|
||||
@PostMapping(value = "/consumablesInfo")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','BDCONSUMABLESINFO_ALL','BDCONSUMABLESINFO_CREATE')")
|
||||
public ResponseEntity create(@Validated @RequestBody ConsumablesInfo resources){
|
||||
return new ResponseEntity(consumablesInfoService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@Log("修改耗材信息")
|
||||
@ApiOperation(value = "修改耗材信息")
|
||||
@PutMapping(value = "/consumablesInfo")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','BDCONSUMABLESINFO_ALL','BDCONSUMABLESINFO_EDIT')")
|
||||
public ResponseEntity update(@Validated @RequestBody ConsumablesInfo resources){
|
||||
consumablesInfoService.update(resources);
|
||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除耗材")
|
||||
@ApiOperation(value = "删除耗材")
|
||||
@DeleteMapping(value = "/consumablesInfo/{id}")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','BDCONSUMABLESINFO_ALL','BDCONSUMABLESINFO_DELETE')")
|
||||
public ResponseEntity delete(@PathVariable Long id){
|
||||
consumablesInfoService.delete(id);
|
||||
return new ResponseEntity(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("查看耗材详情")
|
||||
@GetMapping(value = "/consumablesInfo/{id}")
|
||||
public ResponseEntity getConsumablesInfo(@PathVariable Long id){
|
||||
return new ResponseEntity(consumablesInfoService.findById(id), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package me.zhengjie.modules.wms.bd.service;
|
||||
|
||||
import me.zhengjie.modules.wms.bd.domain.ConsumablesInfo;
|
||||
import me.zhengjie.modules.wms.bd.service.dto.ConsumablesInfoDTO;
|
||||
import me.zhengjie.modules.wms.bd.service.dto.ConsumablesInfoQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-05
|
||||
*/
|
||||
//@CacheConfig(cacheNames = "bdConsumablesInfo")
|
||||
public interface ConsumablesInfoService {
|
||||
|
||||
/**
|
||||
* queryAll 分页
|
||||
* @param criteria
|
||||
* @param pageable
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(keyGenerator = "keyGenerator")
|
||||
Object queryAll(ConsumablesInfoQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* queryAll 不分页
|
||||
* @param criteria
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(keyGenerator = "keyGenerator")
|
||||
public Object queryAll(ConsumablesInfoQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* findById
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(key = "#p0")
|
||||
ConsumablesInfoDTO findById(Long id);
|
||||
|
||||
/**
|
||||
* create
|
||||
* @param resources
|
||||
* @return
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
ConsumablesInfoDTO create(ConsumablesInfo resources);
|
||||
|
||||
/**
|
||||
* update
|
||||
* @param resources
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void update(ConsumablesInfo resources);
|
||||
|
||||
/**
|
||||
* delete
|
||||
* @param id
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void delete(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package me.zhengjie.modules.wms.bd.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-05
|
||||
*/
|
||||
@Data
|
||||
public class ConsumablesInfoDTO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Timestamp createTime;
|
||||
|
||||
private Timestamp updateTime;
|
||||
|
||||
// 耗材名称
|
||||
private String consumablesName;
|
||||
|
||||
private Boolean status;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package me.zhengjie.modules.wms.bd.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import me.zhengjie.annotation.Query;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-05
|
||||
*/
|
||||
@Data
|
||||
public class ConsumablesInfoQueryCriteria {
|
||||
}
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
package me.zhengjie.modules.wms.bd.service.impl;
|
||||
|
||||
import me.zhengjie.exception.BadRequestException;
|
||||
import me.zhengjie.modules.wms.bd.domain.ConsumablesInfo;
|
||||
import me.zhengjie.modules.wms.bd.domain.MeasureUnit;
|
||||
import me.zhengjie.utils.ValidationUtil;
|
||||
import me.zhengjie.modules.wms.bd.repository.ConsumablesInfoRepository;
|
||||
import me.zhengjie.modules.wms.bd.service.ConsumablesInfoService;
|
||||
import me.zhengjie.modules.wms.bd.service.dto.ConsumablesInfoDTO;
|
||||
import me.zhengjie.modules.wms.bd.service.dto.ConsumablesInfoQueryCriteria;
|
||||
import me.zhengjie.modules.wms.bd.service.mapper.ConsumablesInfoMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import me.zhengjie.utils.QueryHelp;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Predicate;
|
||||
import javax.persistence.criteria.Root;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-05
|
||||
*/
|
||||
@Service
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class ConsumablesInfoServiceImpl implements ConsumablesInfoService {
|
||||
|
||||
@Autowired
|
||||
private ConsumablesInfoRepository consumablesInfoRepository;
|
||||
|
||||
@Autowired
|
||||
private ConsumablesInfoMapper consumablesInfoMapper;
|
||||
|
||||
@Override
|
||||
public Object queryAll(ConsumablesInfoQueryCriteria criteria, Pageable pageable){
|
||||
Specification<ConsumablesInfo> specification = new Specification<ConsumablesInfo>() {
|
||||
@Override
|
||||
public Predicate toPredicate(Root<ConsumablesInfo> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder criteriaBuilder) {
|
||||
|
||||
List<Predicate> targetPredicateList = new ArrayList<>();
|
||||
|
||||
//状态
|
||||
Predicate statusPredicate = criteriaBuilder.equal(root.get("status"), 1);
|
||||
targetPredicateList.add(statusPredicate);
|
||||
|
||||
if(CollectionUtils.isEmpty(targetPredicateList)){
|
||||
return null;
|
||||
}else{
|
||||
return criteriaBuilder.and(targetPredicateList.toArray(new Predicate[targetPredicateList.size()]));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Page<ConsumablesInfo> page = consumablesInfoRepository.findAll(specification, pageable);
|
||||
return PageUtil.toPage(page.map(consumablesInfoMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object queryAll(ConsumablesInfoQueryCriteria criteria){
|
||||
return consumablesInfoMapper.toDto(consumablesInfoRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConsumablesInfoDTO findById(Long id) {
|
||||
Optional<ConsumablesInfo> bdConsumablesInfo = consumablesInfoRepository.findById(id);
|
||||
ValidationUtil.isNull(bdConsumablesInfo,"BdConsumablesInfo","id",id);
|
||||
return consumablesInfoMapper.toDto(bdConsumablesInfo.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ConsumablesInfoDTO create(ConsumablesInfo resources) {
|
||||
|
||||
/**
|
||||
* 查看状态正常的情况下该耗材是否存在,如果存在,则提示材已存在
|
||||
* 查看删除状态下该名字的材,如果材存在,则修改材状态
|
||||
* 否则直接插入新的记录
|
||||
*/
|
||||
ConsumablesInfo byNameAndStatusTrue = consumablesInfoRepository.findByConsumablesNameAndStatusTrue(resources.getConsumablesName());
|
||||
if(null != byNameAndStatusTrue){
|
||||
throw new BadRequestException("该耗材已经存在");
|
||||
}
|
||||
ConsumablesInfo byNameAndStatusFalse = consumablesInfoRepository.findByConsumablesNameAndStatusFalse(resources.getConsumablesName());
|
||||
if(null != byNameAndStatusFalse){
|
||||
resources.setStatus(true);
|
||||
consumablesInfoRepository.updateStatusToTrue(byNameAndStatusFalse.getId());
|
||||
Optional<ConsumablesInfo> measureUnitOptional = consumablesInfoRepository.findById(byNameAndStatusFalse.getId());
|
||||
ConsumablesInfo consumablesInfo = measureUnitOptional.get();
|
||||
return consumablesInfoMapper.toDto(consumablesInfo);
|
||||
}else{
|
||||
resources.getConsumablesName();
|
||||
resources.setStatus(true);
|
||||
ConsumablesInfo consumablesInfo = consumablesInfoRepository.save(resources);
|
||||
return consumablesInfoMapper.toDto(consumablesInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(ConsumablesInfo resources) {
|
||||
Optional<ConsumablesInfo> optionalBdConsumablesInfo = consumablesInfoRepository.findById(resources.getId());
|
||||
ValidationUtil.isNull( optionalBdConsumablesInfo,"BdConsumablesInfo","id",resources.getId());
|
||||
ConsumablesInfo bdConsumablesInfo = optionalBdConsumablesInfo.get();
|
||||
bdConsumablesInfo.copy(resources);
|
||||
consumablesInfoRepository.save(bdConsumablesInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Long id) {
|
||||
consumablesInfoRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package me.zhengjie.modules.wms.bd.service.mapper;
|
||||
|
||||
import me.zhengjie.mapper.EntityMapper;
|
||||
import me.zhengjie.modules.wms.bd.domain.ConsumablesInfo;
|
||||
import me.zhengjie.modules.wms.bd.service.dto.ConsumablesInfoDTO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-05
|
||||
*/
|
||||
@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface ConsumablesInfoMapper extends EntityMapper<ConsumablesInfoDTO, ConsumablesInfo> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package me.zhengjie.modules.wms.outSourceProductSheet.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-01
|
||||
*/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="s_out_source_inspection_certificate")
|
||||
public class OutSourceInspectionCertificate implements Serializable {
|
||||
|
||||
// 主键
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
private Long id;
|
||||
|
||||
@Column(name = "create_time")
|
||||
private Timestamp createTime;
|
||||
|
||||
@Column(name = "update_time")
|
||||
private Timestamp updateTime;
|
||||
|
||||
@Column(name = "status")
|
||||
private Integer status;
|
||||
|
||||
// 所属委外加工单
|
||||
@Column(name = "out_source_process_sheet_id")
|
||||
private Long outSourceProcessSheetId;
|
||||
|
||||
// 制单人
|
||||
@Column(name = "make_people_id")
|
||||
private Long makePeopleId;
|
||||
|
||||
// 制单人姓名
|
||||
@Column(name = "make_people_name")
|
||||
private String makePeopleName;
|
||||
|
||||
// 委外加工验收单单据编号
|
||||
@Column(name = "out_source_inspection_certificate_code")
|
||||
private String outSourceInspectionCertificateCode;
|
||||
|
||||
@Column(name = "remark")
|
||||
private String remark;
|
||||
|
||||
public void copy(OutSourceInspectionCertificate source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package me.zhengjie.modules.wms.outSourceProductSheet.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-01
|
||||
*/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="s_out_source_inspection_certificate_product")
|
||||
public class OutSourceInspectionCertificateProduct implements Serializable {
|
||||
|
||||
// 主键
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
private Long id;
|
||||
|
||||
@Column(name = "create_time")
|
||||
private Timestamp createTime;
|
||||
|
||||
@Column(name = "update_time")
|
||||
private Timestamp updateTime;
|
||||
|
||||
@Column(name = "status")
|
||||
private Integer status;
|
||||
|
||||
// 所属委外验收单
|
||||
@Column(name = "out_source_inspection_certificate_id")
|
||||
private Long outSourceInspectionCertificateId;
|
||||
|
||||
@Column(name = "product_code")
|
||||
private String productCode;
|
||||
|
||||
@Column(name = "product_id")
|
||||
private Long productId;
|
||||
|
||||
@Column(name = "product_name")
|
||||
private String productName;
|
||||
|
||||
@Column(name = "remark")
|
||||
private String remark;
|
||||
|
||||
public void copy(OutSourceInspectionCertificateProduct source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package me.zhengjie.modules.wms.outSourceProductSheet.repository;
|
||||
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceInspectionCertificateProduct;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-01
|
||||
*/
|
||||
public interface OutSourceInspectionCertificateProductRepository extends JpaRepository<OutSourceInspectionCertificateProduct, Long>, JpaSpecificationExecutor {
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package me.zhengjie.modules.wms.outSourceProductSheet.repository;
|
||||
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceInspectionCertificate;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-01
|
||||
*/
|
||||
public interface OutSourceInspectionCertificateRepository extends JpaRepository<OutSourceInspectionCertificate, Long>, JpaSpecificationExecutor {
|
||||
}
|
||||
|
|
@ -23,8 +23,6 @@ public interface OutSourceProcessSheetProductRepository extends JpaRepository<Ou
|
|||
@Query(value ="select * from s_out_source_process_sheet_product where out_source_process_sheet_id = ?1 and status =1", nativeQuery = true)
|
||||
List<OutSourceProcessSheetProduct> queryByOutSourceProcessSheetIdAndStatusTrue(Long outSourceProcessSheetId);
|
||||
|
||||
List<OutSourceProcessSheetProduct> findByOutSourceProcessSheetIdAndStatusTrue(Long invoiceId);
|
||||
|
||||
@Modifying
|
||||
@Query(value = "delete s_out_source_process_sheet_product where product_code = ?1 and out_source_process_sheet_id = ?2", nativeQuery = true)
|
||||
void deleteByProductCodeAndOutSourceProcessSheetId(String productCode, Long outSourceProcessSheetId);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
package me.zhengjie.modules.wms.outSourceProductSheet.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 黄星星
|
||||
* @date 2019-10-01
|
||||
* 查询委外加工单产品信息
|
||||
*/
|
||||
@Data
|
||||
public class QueryOutSourceProcessSheetProductRequest {
|
||||
|
||||
// 所属委外加工单
|
||||
private Long outSourceProcessSheetId;
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package me.zhengjie.modules.wms.outSourceProductSheet.rest;
|
||||
|
||||
import me.zhengjie.aop.log.Log;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceInspectionCertificate;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.OutSourceInspectionCertificateService;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceInspectionCertificateQueryCriteria;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-01
|
||||
*/
|
||||
@Api(tags = "委外验收单管理")
|
||||
@RestController
|
||||
@RequestMapping("api")
|
||||
public class OutSourceInspectionCertificateController {
|
||||
|
||||
@Autowired
|
||||
private OutSourceInspectionCertificateService outSourceInspectionCertificateService;
|
||||
|
||||
@Log("查询委外验收单")
|
||||
@ApiOperation(value = "查询委外验收单")
|
||||
@GetMapping(value = "/outSourceInspectionCertificate")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','SOUTSOURCEINSPECTIONCERTIFICATE_ALL','SOUTSOURCEINSPECTIONCERTIFICATE_SELECT')")
|
||||
public ResponseEntity getOutSourceInspectionCertificates(OutSourceInspectionCertificateQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity(outSourceInspectionCertificateService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("新增委外验收单")
|
||||
@ApiOperation(value = "新增委外验收单")
|
||||
@PostMapping(value = "/outSourceInspectionCertificate")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','SOUTSOURCEINSPECTIONCERTIFICATE_ALL','SOUTSOURCEINSPECTIONCERTIFICATE_CREATE')")
|
||||
public ResponseEntity create(@Validated @RequestBody OutSourceInspectionCertificate resources){
|
||||
return new ResponseEntity(outSourceInspectionCertificateService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@Log("修改委外验收单")
|
||||
@ApiOperation(value = "修改委外验收单")
|
||||
@PutMapping(value = "/outSourceInspectionCertificate")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','SOUTSOURCEINSPECTIONCERTIFICATE_ALL','SOUTSOURCEINSPECTIONCERTIFICATE_EDIT')")
|
||||
public ResponseEntity update(@Validated @RequestBody OutSourceInspectionCertificate resources){
|
||||
outSourceInspectionCertificateService.update(resources);
|
||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除委外验收单")
|
||||
@ApiOperation(value = "删除委外验收单")
|
||||
@DeleteMapping(value = "/outSourceInspectionCertificate/{id}")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','SOUTSOURCEINSPECTIONCERTIFICATE_ALL','SOUTSOURCEINSPECTIONCERTIFICATE_DELETE')")
|
||||
public ResponseEntity delete(@PathVariable Long id){
|
||||
outSourceInspectionCertificateService.delete(id);
|
||||
return new ResponseEntity(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("查看委外验收单详情")
|
||||
@GetMapping(value = "/outSourceInspectionCertificate/{id}")
|
||||
public ResponseEntity getOutSourceInspectionCertificate(@PathVariable Long id){
|
||||
return new ResponseEntity(outSourceInspectionCertificateService.findById(id), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -3,8 +3,11 @@ package me.zhengjie.modules.wms.outSourceProductSheet.rest;
|
|||
import me.zhengjie.aop.log.Log;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceProcessSheet;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.request.CreateOutSourceProcessSheetRequest;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.request.QueryOutSourceProcessSheetProductRequest;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.request.UpdateOutSourceProcessSheetRequest;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.OutSourceProcessSheetProductService;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.OutSourceProcessSheetService;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceProcessSheetProductQueryCriteria;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceProcessSheetQueryCriteria;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
|
@ -30,6 +33,9 @@ public class OutSourceProcessSheetController {
|
|||
@Autowired
|
||||
private OutSourceProcessSheetService outSourceProcessSheetService;
|
||||
|
||||
@Autowired
|
||||
private OutSourceProcessSheetProductService outSourceProcessSheetProductService;
|
||||
|
||||
@Log("分页查询委外加工单")
|
||||
@ApiOperation(value = "分页查询委外加工单")
|
||||
@GetMapping(value = "/queryOutSourceProcessSheetPage")
|
||||
|
|
@ -78,4 +84,10 @@ public class OutSourceProcessSheetController {
|
|||
public ResponseEntity getOutSourceProcessSheet(@PathVariable Long id){
|
||||
return new ResponseEntity(outSourceProcessSheetService.findById(id), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("查看委外加工单产品信息")
|
||||
@GetMapping(value = "/outSourceProcessSheet/outSourceProcessSheetProduct")
|
||||
public ResponseEntity queryOutSourceProcessSheetProductList(OutSourceProcessSheetProductQueryCriteria criteria){
|
||||
return new ResponseEntity(outSourceProcessSheetProductService.queryAll(criteria), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package me.zhengjie.modules.wms.outSourceProductSheet.service;
|
||||
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceInspectionCertificateProduct;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceInspectionCertificateProductDTO;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceInspectionCertificateProductQueryCriteria;
|
||||
//import org.springframework.cache.annotation.CacheConfig;
|
||||
//import org.springframework.cache.annotation.CacheEvict;
|
||||
//import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-01
|
||||
*/
|
||||
//@CacheConfig(cacheNames = "sOutSourceInspectionCertificateProduct")
|
||||
public interface OutSourceInspectionCertificateProductService {
|
||||
|
||||
/**
|
||||
* queryAll 分页
|
||||
* @param criteria
|
||||
* @param pageable
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(keyGenerator = "keyGenerator")
|
||||
Object queryAll(OutSourceInspectionCertificateProductQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* queryAll 不分页
|
||||
* @param criteria
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(keyGenerator = "keyGenerator")
|
||||
public Object queryAll(OutSourceInspectionCertificateProductQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* findById
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(key = "#p0")
|
||||
OutSourceInspectionCertificateProductDTO findById(Long id);
|
||||
|
||||
/**
|
||||
* create
|
||||
* @param resources
|
||||
* @return
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
OutSourceInspectionCertificateProductDTO create(OutSourceInspectionCertificateProduct resources);
|
||||
|
||||
/**
|
||||
* update
|
||||
* @param resources
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void update(OutSourceInspectionCertificateProduct resources);
|
||||
|
||||
/**
|
||||
* delete
|
||||
* @param id
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void delete(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package me.zhengjie.modules.wms.outSourceProductSheet.service;
|
||||
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceInspectionCertificate;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceInspectionCertificateDTO;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceInspectionCertificateQueryCriteria;
|
||||
//import org.springframework.cache.annotation.CacheConfig;
|
||||
//import org.springframework.cache.annotation.CacheEvict;
|
||||
//import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-01
|
||||
*/
|
||||
//@CacheConfig(cacheNames = "sOutSourceInspectionCertificate")
|
||||
public interface OutSourceInspectionCertificateService {
|
||||
|
||||
/**
|
||||
* queryAll 分页
|
||||
* @param criteria
|
||||
* @param pageable
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(keyGenerator = "keyGenerator")
|
||||
Object queryAll(OutSourceInspectionCertificateQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* queryAll 不分页
|
||||
* @param criteria
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(keyGenerator = "keyGenerator")
|
||||
public Object queryAll(OutSourceInspectionCertificateQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* findById
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(key = "#p0")
|
||||
OutSourceInspectionCertificateDTO findById(Long id);
|
||||
|
||||
/**
|
||||
* create
|
||||
* @param resources
|
||||
* @return
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
OutSourceInspectionCertificateDTO create(OutSourceInspectionCertificate resources);
|
||||
|
||||
/**
|
||||
* update
|
||||
* @param resources
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void update(OutSourceInspectionCertificate resources);
|
||||
|
||||
/**
|
||||
* delete
|
||||
* @param id
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void delete(Long id);
|
||||
}
|
||||
|
|
@ -8,6 +8,8 @@ import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceProces
|
|||
//import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-08-17
|
||||
|
|
@ -40,6 +42,14 @@ public interface OutSourceProcessSheetProductService {
|
|||
//@Cacheable(key = "#p0")
|
||||
OutSourceProcessSheetProductDTO findById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询委外加工单产品信息
|
||||
* @param outSourceProcessSheetProductId
|
||||
* @return
|
||||
*/
|
||||
List<OutSourceProcessSheetProductDTO> findByOutSourceProcessSheetProductId(Long outSourceProcessSheetProductId);
|
||||
|
||||
/**
|
||||
* create
|
||||
* @param resources
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package me.zhengjie.modules.wms.outSourceProductSheet.service;
|
|||
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceProcessSheet;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.request.CreateOutSourceProcessSheetRequest;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.request.QueryOutSourceProcessSheetProductRequest;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.request.UpdateOutSourceProcessSheetRequest;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceProcessSheetDTO;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceProcessSheetQueryCriteria;
|
||||
|
|
@ -9,6 +10,7 @@ import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceProces
|
|||
//import org.springframework.cache.annotation.CacheEvict;
|
||||
//import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
|
|
@ -63,4 +65,5 @@ public interface OutSourceProcessSheetService {
|
|||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void delete(Long id);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package me.zhengjie.modules.wms.outSourceProductSheet.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-01
|
||||
*/
|
||||
@Data
|
||||
public class OutSourceInspectionCertificateDTO implements Serializable {
|
||||
|
||||
// 主键
|
||||
private Long id;
|
||||
|
||||
private Timestamp createTime;
|
||||
|
||||
private Timestamp updateTime;
|
||||
|
||||
private Integer status;
|
||||
|
||||
// 所属委外加工单
|
||||
private Long outSourceProcessSheetId;
|
||||
|
||||
// 制单人
|
||||
private Long makePeopleId;
|
||||
|
||||
// 制单人姓名
|
||||
private String makePeopleName;
|
||||
|
||||
// 委外加工验收单单据编号
|
||||
private String outSourceInspectionCertificateCode;
|
||||
|
||||
private String remark;
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package me.zhengjie.modules.wms.outSourceProductSheet.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-01
|
||||
*/
|
||||
@Data
|
||||
public class OutSourceInspectionCertificateProductDTO implements Serializable {
|
||||
|
||||
// 主键
|
||||
private Long id;
|
||||
|
||||
private Timestamp createTime;
|
||||
|
||||
private Timestamp updateTime;
|
||||
|
||||
private Integer status;
|
||||
|
||||
// 所属委外验收单
|
||||
private Long outSourceInspectionCertificateId;
|
||||
|
||||
private String productCode;
|
||||
|
||||
private Long productId;
|
||||
|
||||
private String productName;
|
||||
|
||||
private String remark;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package me.zhengjie.modules.wms.outSourceProductSheet.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import me.zhengjie.annotation.Query;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-01
|
||||
*/
|
||||
@Data
|
||||
public class OutSourceInspectionCertificateProductQueryCriteria {
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package me.zhengjie.modules.wms.outSourceProductSheet.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import me.zhengjie.annotation.Query;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-01
|
||||
*/
|
||||
@Data
|
||||
public class OutSourceInspectionCertificateQueryCriteria {
|
||||
}
|
||||
|
|
@ -10,4 +10,6 @@ import me.zhengjie.annotation.Query;
|
|||
*/
|
||||
@Data
|
||||
public class OutSourceProcessSheetProductQueryCriteria {
|
||||
|
||||
private Long outSOurceProcessSheetId;
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package me.zhengjie.modules.wms.outSourceProductSheet.service.impl;
|
||||
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceInspectionCertificateProduct;
|
||||
import me.zhengjie.utils.ValidationUtil;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.repository.OutSourceInspectionCertificateProductRepository;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.OutSourceInspectionCertificateProductService;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceInspectionCertificateProductDTO;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceInspectionCertificateProductQueryCriteria;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.mapper.OutSourceInspectionCertificateProductMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.Optional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import me.zhengjie.utils.QueryHelp;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-01
|
||||
*/
|
||||
@Service
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class OutSourceInspectionCertificateProductServiceImpl implements OutSourceInspectionCertificateProductService {
|
||||
|
||||
@Autowired
|
||||
private OutSourceInspectionCertificateProductRepository outSourceInspectionCertificateProductRepository;
|
||||
|
||||
@Autowired
|
||||
private OutSourceInspectionCertificateProductMapper outSourceInspectionCertificateProductMapper;
|
||||
|
||||
@Override
|
||||
public Object queryAll(OutSourceInspectionCertificateProductQueryCriteria criteria, Pageable pageable){
|
||||
Page<OutSourceInspectionCertificateProduct> page = outSourceInspectionCertificateProductRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(outSourceInspectionCertificateProductMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object queryAll(OutSourceInspectionCertificateProductQueryCriteria criteria){
|
||||
return outSourceInspectionCertificateProductMapper.toDto(outSourceInspectionCertificateProductRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public OutSourceInspectionCertificateProductDTO findById(Long id) {
|
||||
Optional<OutSourceInspectionCertificateProduct> sOutSourceInspectionCertificateProduct = outSourceInspectionCertificateProductRepository.findById(id);
|
||||
ValidationUtil.isNull(sOutSourceInspectionCertificateProduct,"SOutSourceInspectionCertificateProduct","id",id);
|
||||
return outSourceInspectionCertificateProductMapper.toDto(sOutSourceInspectionCertificateProduct.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public OutSourceInspectionCertificateProductDTO create(OutSourceInspectionCertificateProduct resources) {
|
||||
return outSourceInspectionCertificateProductMapper.toDto(outSourceInspectionCertificateProductRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(OutSourceInspectionCertificateProduct resources) {
|
||||
Optional<OutSourceInspectionCertificateProduct> optionalSOutSourceInspectionCertificateProduct = outSourceInspectionCertificateProductRepository.findById(resources.getId());
|
||||
ValidationUtil.isNull( optionalSOutSourceInspectionCertificateProduct,"SOutSourceInspectionCertificateProduct","id",resources.getId());
|
||||
OutSourceInspectionCertificateProduct outSourceInspectionCertificateProduct = optionalSOutSourceInspectionCertificateProduct.get();
|
||||
outSourceInspectionCertificateProduct.copy(resources);
|
||||
outSourceInspectionCertificateProductRepository.save(outSourceInspectionCertificateProduct);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Long id) {
|
||||
outSourceInspectionCertificateProductRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package me.zhengjie.modules.wms.outSourceProductSheet.service.impl;
|
||||
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceInspectionCertificate;
|
||||
import me.zhengjie.utils.ValidationUtil;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.repository.OutSourceInspectionCertificateRepository;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.OutSourceInspectionCertificateService;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceInspectionCertificateDTO;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceInspectionCertificateQueryCriteria;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.mapper.OutSourceInspectionCertificateMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.Optional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import me.zhengjie.utils.QueryHelp;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-01
|
||||
*/
|
||||
@Service
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class OutSourceInspectionCertificateServiceImpl implements OutSourceInspectionCertificateService {
|
||||
|
||||
@Autowired
|
||||
private OutSourceInspectionCertificateRepository outSourceInspectionCertificateRepository;
|
||||
|
||||
@Autowired
|
||||
private OutSourceInspectionCertificateMapper outSourceInspectionCertificateMapper;
|
||||
|
||||
@Override
|
||||
public Object queryAll(OutSourceInspectionCertificateQueryCriteria criteria, Pageable pageable){
|
||||
Page<OutSourceInspectionCertificate> page = outSourceInspectionCertificateRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(outSourceInspectionCertificateMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object queryAll(OutSourceInspectionCertificateQueryCriteria criteria){
|
||||
return outSourceInspectionCertificateMapper.toDto(outSourceInspectionCertificateRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public OutSourceInspectionCertificateDTO findById(Long id) {
|
||||
Optional<OutSourceInspectionCertificate> sOutSourceInspectionCertificate = outSourceInspectionCertificateRepository.findById(id);
|
||||
ValidationUtil.isNull(sOutSourceInspectionCertificate,"SOutSourceInspectionCertificate","id",id);
|
||||
return outSourceInspectionCertificateMapper.toDto(sOutSourceInspectionCertificate.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public OutSourceInspectionCertificateDTO create(OutSourceInspectionCertificate resources) {
|
||||
return outSourceInspectionCertificateMapper.toDto(outSourceInspectionCertificateRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(OutSourceInspectionCertificate resources) {
|
||||
Optional<OutSourceInspectionCertificate> optionalSOutSourceInspectionCertificate = outSourceInspectionCertificateRepository.findById(resources.getId());
|
||||
ValidationUtil.isNull( optionalSOutSourceInspectionCertificate,"SOutSourceInspectionCertificate","id",resources.getId());
|
||||
OutSourceInspectionCertificate outSourceInspectionCertificate = optionalSOutSourceInspectionCertificate.get();
|
||||
outSourceInspectionCertificate.copy(resources);
|
||||
outSourceInspectionCertificateRepository.save(outSourceInspectionCertificate);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Long id) {
|
||||
outSourceInspectionCertificateRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -76,6 +76,13 @@ public class OutSourceProcessSheetProductServiceImpl implements OutSourceProcess
|
|||
Predicate statusPredicate = criteriaBuilder.equal(root.get("status"), 1);
|
||||
targetPredicateList.add(statusPredicate);
|
||||
|
||||
Long outSOurceProcessSheetId = criteria.getOutSOurceProcessSheetId();
|
||||
if(null != outSOurceProcessSheetId){
|
||||
Predicate outSOurceProcessSheetIdPredicate = criteriaBuilder.equal(root.get("outSOurceProcessSheetId"), 1);
|
||||
targetPredicateList.add(outSOurceProcessSheetIdPredicate);
|
||||
}
|
||||
|
||||
|
||||
if(CollectionUtils.isEmpty(targetPredicateList)){
|
||||
return null;
|
||||
}else{
|
||||
|
|
@ -93,6 +100,11 @@ public class OutSourceProcessSheetProductServiceImpl implements OutSourceProcess
|
|||
return outSourceProcessSheetProductMapper.toDto(sOutSourceProcessSheetProduct.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OutSourceProcessSheetProductDTO> findByOutSourceProcessSheetProductId(Long outSourceProcessSheetProductId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public OutSourceProcessSheetProductDTO create(OutSourceProcessSheetProduct resources) {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceProcessShee
|
|||
import me.zhengjie.modules.wms.outSourceProductSheet.repository.OutSourceProcessSheetProductRepository;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.request.CreateOutSourceProcessSheetRequest;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.request.OutSourceProcessSheetProductRequest;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.request.QueryOutSourceProcessSheetProductRequest;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.request.UpdateOutSourceProcessSheetRequest;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceProcessSheetProductDTO;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.mapper.OutSourceProcessSheetProductMapper;
|
||||
|
|
@ -23,6 +24,7 @@ import me.zhengjie.modules.wms.outSourceProductSheet.service.mapper.OutSourcePro
|
|||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -121,7 +123,7 @@ public class OutSourceProcessSheetServiceImpl implements OutSourceProcessSheetSe
|
|||
OutSourceProcessSheetDTO outSourceProcessSheetDTO = outSourceProcessSheetMapper.toDto(outSourceProcessSheet);
|
||||
|
||||
|
||||
List<OutSourceProcessSheetProduct> outSourceProcessSheetProductList = outSourceProcessSheetProductRepository.findByOutSourceProcessSheetIdAndStatusTrue(id);
|
||||
List<OutSourceProcessSheetProduct> outSourceProcessSheetProductList = outSourceProcessSheetProductRepository.queryByOutSourceProcessSheetIdAndStatusTrue(id);
|
||||
if(!CollectionUtils.isEmpty(outSourceProcessSheetProductList)){
|
||||
List<OutSourceProcessSheetProductDTO> outSourceProcessSheetProductDTOList = outSourceProcessSheetProductMapper.toDto(outSourceProcessSheetProductList);
|
||||
outSourceProcessSheetDTO.setOutSourceProcessSheetProductList(outSourceProcessSheetProductDTOList);
|
||||
|
|
@ -188,7 +190,7 @@ public class OutSourceProcessSheetServiceImpl implements OutSourceProcessSheetSe
|
|||
outSourceProcessSheetRepository.save(outSourceProcessSheet);
|
||||
|
||||
// 修改产品信息之前,查询该订单中原来的产品信息,key为产品code
|
||||
List<OutSourceProcessSheetProduct> outSourceProcessSheetProductListBeforeUpdate = outSourceProcessSheetProductRepository.findByOutSourceProcessSheetIdAndStatusTrue(outSourceProcessSheet.getId());
|
||||
List<OutSourceProcessSheetProduct> outSourceProcessSheetProductListBeforeUpdate = outSourceProcessSheetProductRepository.queryByOutSourceProcessSheetIdAndStatusTrue(outSourceProcessSheet.getId());
|
||||
Map<String, OutSourceProcessSheetProduct> outSourceProcessSheetProductMapBefore = outSourceProcessSheetProductListBeforeUpdate.stream().collect(Collectors.toMap(OutSourceProcessSheetProduct::getProductCode, Function.identity()));
|
||||
|
||||
List<OutSourceProcessSheetProductDTO> outSourceProcessSheetProductRequestList = updateOutSourceProcessSheetRequest.getOutSourceProcessSheetProductList();
|
||||
|
|
@ -244,4 +246,5 @@ public class OutSourceProcessSheetServiceImpl implements OutSourceProcessSheetSe
|
|||
public void delete(Long id) {
|
||||
outSourceProcessSheetRepository.deleteById(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package me.zhengjie.modules.wms.outSourceProductSheet.service.mapper;
|
||||
|
||||
import me.zhengjie.mapper.EntityMapper;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceInspectionCertificate;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceInspectionCertificateDTO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-01
|
||||
*/
|
||||
@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface OutSourceInspectionCertificateMapper extends EntityMapper<OutSourceInspectionCertificateDTO, OutSourceInspectionCertificate> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package me.zhengjie.modules.wms.outSourceProductSheet.service.mapper;
|
||||
|
||||
import me.zhengjie.mapper.EntityMapper;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.domain.OutSourceInspectionCertificateProduct;
|
||||
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceInspectionCertificateProductDTO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-01
|
||||
*/
|
||||
@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface OutSourceInspectionCertificateProductMapper extends EntityMapper<OutSourceInspectionCertificateProductDTO, OutSourceInspectionCertificateProduct> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package me.zhengjie.modules.wms.purchase.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="consumables_purchase_order")
|
||||
public class ConsumablesPurchaseOrder implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
private Long id;
|
||||
|
||||
@Column(name = "create_time")
|
||||
private Timestamp createTime;
|
||||
|
||||
@Column(name = "update_time")
|
||||
private Timestamp updateTime;
|
||||
|
||||
// 采购人主键
|
||||
@Column(name = "purchase_user_id")
|
||||
private Long purchaseUserId;
|
||||
|
||||
// 采购人姓名
|
||||
@Column(name = "purchase_user_name")
|
||||
private String purchaseUserName;
|
||||
|
||||
// 状态
|
||||
@Column(name = "status")
|
||||
private Integer status;
|
||||
|
||||
// 审核状态
|
||||
@Column(name = "audit_status")
|
||||
private Integer auditStatus;
|
||||
|
||||
@Column(name = "audit_user_id")
|
||||
private Long auditUserId;
|
||||
|
||||
// 审核人姓名
|
||||
@Column(name = "audit_user_name")
|
||||
private String auditUserName;
|
||||
|
||||
// 耗材采购单单据编号
|
||||
@Column(name = "consumables_purchase_order_code")
|
||||
private String consumablesPurchaseOrderCode;
|
||||
|
||||
public void copy(ConsumablesPurchaseOrder source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package me.zhengjie.modules.wms.purchase.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="consumables_purchase_order_product")
|
||||
public class ConsumablesPurchaseOrderProduct implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
private Long id;
|
||||
|
||||
// 所属耗材采购单
|
||||
@Column(name = "consumables_purchase_order_id")
|
||||
private Long consumablesPurchaseOrderId;
|
||||
|
||||
// 耗材主键
|
||||
@Column(name = "consumables_id")
|
||||
private Long consumablesId;
|
||||
|
||||
// 耗材名称
|
||||
@Column(name = "consumables_name")
|
||||
private String consumablesName;
|
||||
|
||||
// 产品单价
|
||||
@Column(name = "unit_price")
|
||||
private Long unitPrice;
|
||||
|
||||
// 产品总价
|
||||
@Column(name = "total_price")
|
||||
private Long totalPrice;
|
||||
|
||||
// 产品数量
|
||||
@Column(name = "consumables_number")
|
||||
private Long consumablesNumber;
|
||||
|
||||
// 备注
|
||||
@Column(name = "remark")
|
||||
private String remark;
|
||||
|
||||
// 创建时间
|
||||
@Column(name = "create_time")
|
||||
private Timestamp createTime;
|
||||
|
||||
// 更新时间
|
||||
@Column(name = "update_time")
|
||||
private Timestamp updateTime;
|
||||
|
||||
@Column(name = "status")
|
||||
private Integer status;
|
||||
|
||||
// 耗材编号
|
||||
@Column(name = "consumables_code")
|
||||
private String consumablesCode;
|
||||
|
||||
public void copy(ConsumablesPurchaseOrderProduct source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package me.zhengjie.modules.wms.purchase.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="product_purchase_order")
|
||||
public class ProductPurchaseOrder implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
private Long id;
|
||||
|
||||
@Column(name = "create_time")
|
||||
private Timestamp createTime;
|
||||
|
||||
@Column(name = "update_time")
|
||||
private Timestamp updateTime;
|
||||
|
||||
// 采购人主键
|
||||
@Column(name = "purchase_user_id")
|
||||
private Long purchaseUserId;
|
||||
|
||||
// 采购人姓名
|
||||
@Column(name = "purchase_user_name")
|
||||
private String purchaseUserName;
|
||||
|
||||
// 状态
|
||||
@Column(name = "status")
|
||||
private Integer status;
|
||||
|
||||
// 审核状态
|
||||
@Column(name = "audit_status")
|
||||
private Integer auditStatus;
|
||||
|
||||
@Column(name = "audit_user_id")
|
||||
private Long auditUserId;
|
||||
|
||||
// 审核人姓名
|
||||
@Column(name = "audit_user_name")
|
||||
private String auditUserName;
|
||||
|
||||
@Column(name = "product_purchase_order_code")
|
||||
private String productPurchaseOrderCode;
|
||||
|
||||
public void copy(ProductPurchaseOrder source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package me.zhengjie.modules.wms.purchase.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="product_purchase_order_product")
|
||||
public class ProductPurchaseOrderProduct implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
private Long id;
|
||||
|
||||
// 所属产品采购单
|
||||
@Column(name = "product_purchase_order_id")
|
||||
private Long productPurchaseOrderId;
|
||||
|
||||
// 产品主键
|
||||
@Column(name = "product_id")
|
||||
private Long productId;
|
||||
|
||||
// 产品名称
|
||||
@Column(name = "product_name")
|
||||
private String productName;
|
||||
|
||||
// 规格
|
||||
@Column(name = "specifications")
|
||||
private String specifications;
|
||||
|
||||
// 产品单价
|
||||
@Column(name = "unit_price")
|
||||
private Long unitPrice;
|
||||
|
||||
// 产品总价
|
||||
@Column(name = "total_price")
|
||||
private Long totalPrice;
|
||||
|
||||
// 产品数量
|
||||
@Column(name = "product_number")
|
||||
private Long productNumber;
|
||||
|
||||
// 备注
|
||||
@Column(name = "remark")
|
||||
private String remark;
|
||||
|
||||
// 创建时间
|
||||
@Column(name = "create_time")
|
||||
private Timestamp createTime;
|
||||
|
||||
// 更新时间
|
||||
@Column(name = "update_time")
|
||||
private Timestamp updateTime;
|
||||
|
||||
@Column(name = "status")
|
||||
private Integer status;
|
||||
|
||||
// 产品编号
|
||||
@Column(name = "product_code")
|
||||
private String productCode;
|
||||
|
||||
public void copy(ProductPurchaseOrderProduct source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package me.zhengjie.modules.wms.purchase.repository;
|
||||
|
||||
import me.zhengjie.modules.wms.purchase.domain.ConsumablesPurchaseOrderProduct;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
public interface ConsumablesPurchaseOrderProductRepository extends JpaRepository<ConsumablesPurchaseOrderProduct, Long>, JpaSpecificationExecutor {
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package me.zhengjie.modules.wms.purchase.repository;
|
||||
|
||||
import me.zhengjie.modules.wms.purchase.domain.ConsumablesPurchaseOrder;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
public interface ConsumablesPurchaseOrderRepository extends JpaRepository<ConsumablesPurchaseOrder, Long>, JpaSpecificationExecutor {
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package me.zhengjie.modules.wms.purchase.repository;
|
||||
|
||||
import me.zhengjie.modules.wms.purchase.domain.ProductPurchaseOrderProduct;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
public interface ProductPurchaseOrderProductRepository extends JpaRepository<ProductPurchaseOrderProduct, Long>, JpaSpecificationExecutor {
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package me.zhengjie.modules.wms.purchase.repository;
|
||||
|
||||
import me.zhengjie.modules.wms.purchase.domain.ProductPurchaseOrder;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
public interface ProductPurchaseOrderRepository extends JpaRepository<ProductPurchaseOrder, Long>, JpaSpecificationExecutor {
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package me.zhengjie.modules.wms.purchase.rest;
|
||||
|
||||
import me.zhengjie.aop.log.Log;
|
||||
import me.zhengjie.modules.wms.purchase.domain.ConsumablesPurchaseOrder;
|
||||
import me.zhengjie.modules.wms.purchase.service.ConsumablesPurchaseOrderService;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ConsumablesPurchaseOrderQueryCriteria;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Api(tags = "ConsumablesPurchaseOrder管理")
|
||||
@RestController
|
||||
@RequestMapping("api")
|
||||
public class ConsumablesPurchaseOrderController {
|
||||
|
||||
@Autowired
|
||||
private ConsumablesPurchaseOrderService consumablesPurchaseOrderService;
|
||||
|
||||
@Log("查询ConsumablesPurchaseOrder")
|
||||
@ApiOperation(value = "查询ConsumablesPurchaseOrder")
|
||||
@GetMapping(value = "/consumablesPurchaseOrder")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','CONSUMABLESPURCHASEORDER_ALL','CONSUMABLESPURCHASEORDER_SELECT')")
|
||||
public ResponseEntity getConsumablesPurchaseOrders(ConsumablesPurchaseOrderQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity(consumablesPurchaseOrderService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("新增ConsumablesPurchaseOrder")
|
||||
@ApiOperation(value = "新增ConsumablesPurchaseOrder")
|
||||
@PostMapping(value = "/consumablesPurchaseOrder")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','CONSUMABLESPURCHASEORDER_ALL','CONSUMABLESPURCHASEORDER_CREATE')")
|
||||
public ResponseEntity create(@Validated @RequestBody ConsumablesPurchaseOrder resources){
|
||||
return new ResponseEntity(consumablesPurchaseOrderService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@Log("修改ConsumablesPurchaseOrder")
|
||||
@ApiOperation(value = "修改ConsumablesPurchaseOrder")
|
||||
@PutMapping(value = "/consumablesPurchaseOrder")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','CONSUMABLESPURCHASEORDER_ALL','CONSUMABLESPURCHASEORDER_EDIT')")
|
||||
public ResponseEntity update(@Validated @RequestBody ConsumablesPurchaseOrder resources){
|
||||
consumablesPurchaseOrderService.update(resources);
|
||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除ConsumablesPurchaseOrder")
|
||||
@ApiOperation(value = "删除ConsumablesPurchaseOrder")
|
||||
@DeleteMapping(value = "/consumablesPurchaseOrder/{id}")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','CONSUMABLESPURCHASEORDER_ALL','CONSUMABLESPURCHASEORDER_DELETE')")
|
||||
public ResponseEntity delete(@PathVariable Long id){
|
||||
consumablesPurchaseOrderService.delete(id);
|
||||
return new ResponseEntity(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package me.zhengjie.modules.wms.purchase.rest;
|
||||
|
||||
import me.zhengjie.aop.log.Log;
|
||||
import me.zhengjie.modules.wms.purchase.domain.ConsumablesPurchaseOrderProduct;
|
||||
import me.zhengjie.modules.wms.purchase.service.ConsumablesPurchaseOrderProductService;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ConsumablesPurchaseOrderProductQueryCriteria;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Api(tags = "ConsumablesPurchaseOrderProduct管理")
|
||||
@RestController
|
||||
@RequestMapping("api")
|
||||
public class ConsumablesPurchaseOrderProductController {
|
||||
|
||||
@Autowired
|
||||
private ConsumablesPurchaseOrderProductService consumablesPurchaseOrderProductService;
|
||||
|
||||
@Log("查询ConsumablesPurchaseOrderProduct")
|
||||
@ApiOperation(value = "查询ConsumablesPurchaseOrderProduct")
|
||||
@GetMapping(value = "/consumablesPurchaseOrderProduct")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','CONSUMABLESPURCHASEORDERPRODUCT_ALL','CONSUMABLESPURCHASEORDERPRODUCT_SELECT')")
|
||||
public ResponseEntity getConsumablesPurchaseOrderProducts(ConsumablesPurchaseOrderProductQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity(consumablesPurchaseOrderProductService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("新增ConsumablesPurchaseOrderProduct")
|
||||
@ApiOperation(value = "新增ConsumablesPurchaseOrderProduct")
|
||||
@PostMapping(value = "/consumablesPurchaseOrderProduct")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','CONSUMABLESPURCHASEORDERPRODUCT_ALL','CONSUMABLESPURCHASEORDERPRODUCT_CREATE')")
|
||||
public ResponseEntity create(@Validated @RequestBody ConsumablesPurchaseOrderProduct resources){
|
||||
return new ResponseEntity(consumablesPurchaseOrderProductService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@Log("修改ConsumablesPurchaseOrderProduct")
|
||||
@ApiOperation(value = "修改ConsumablesPurchaseOrderProduct")
|
||||
@PutMapping(value = "/consumablesPurchaseOrderProduct")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','CONSUMABLESPURCHASEORDERPRODUCT_ALL','CONSUMABLESPURCHASEORDERPRODUCT_EDIT')")
|
||||
public ResponseEntity update(@Validated @RequestBody ConsumablesPurchaseOrderProduct resources){
|
||||
consumablesPurchaseOrderProductService.update(resources);
|
||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除ConsumablesPurchaseOrderProduct")
|
||||
@ApiOperation(value = "删除ConsumablesPurchaseOrderProduct")
|
||||
@DeleteMapping(value = "/consumablesPurchaseOrderProduct/{id}")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','CONSUMABLESPURCHASEORDERPRODUCT_ALL','CONSUMABLESPURCHASEORDERPRODUCT_DELETE')")
|
||||
public ResponseEntity delete(@PathVariable Long id){
|
||||
consumablesPurchaseOrderProductService.delete(id);
|
||||
return new ResponseEntity(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package me.zhengjie.modules.wms.purchase.rest;
|
||||
|
||||
import me.zhengjie.aop.log.Log;
|
||||
import me.zhengjie.modules.wms.purchase.domain.ProductPurchaseOrder;
|
||||
import me.zhengjie.modules.wms.purchase.service.ProductPurchaseOrderService;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ProductPurchaseOrderQueryCriteria;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Api(tags = "ProductPurchaseOrder管理")
|
||||
@RestController
|
||||
@RequestMapping("api")
|
||||
public class ProductPurchaseOrderController {
|
||||
|
||||
@Autowired
|
||||
private ProductPurchaseOrderService productPurchaseOrderService;
|
||||
|
||||
@Log("查询ProductPurchaseOrder")
|
||||
@ApiOperation(value = "查询ProductPurchaseOrder")
|
||||
@GetMapping(value = "/productPurchaseOrder")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','PRODUCTPURCHASEORDER_ALL','PRODUCTPURCHASEORDER_SELECT')")
|
||||
public ResponseEntity getProductPurchaseOrders(ProductPurchaseOrderQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity(productPurchaseOrderService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("新增ProductPurchaseOrder")
|
||||
@ApiOperation(value = "新增ProductPurchaseOrder")
|
||||
@PostMapping(value = "/productPurchaseOrder")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','PRODUCTPURCHASEORDER_ALL','PRODUCTPURCHASEORDER_CREATE')")
|
||||
public ResponseEntity create(@Validated @RequestBody ProductPurchaseOrder resources){
|
||||
return new ResponseEntity(productPurchaseOrderService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@Log("修改ProductPurchaseOrder")
|
||||
@ApiOperation(value = "修改ProductPurchaseOrder")
|
||||
@PutMapping(value = "/productPurchaseOrder")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','PRODUCTPURCHASEORDER_ALL','PRODUCTPURCHASEORDER_EDIT')")
|
||||
public ResponseEntity update(@Validated @RequestBody ProductPurchaseOrder resources){
|
||||
productPurchaseOrderService.update(resources);
|
||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除ProductPurchaseOrder")
|
||||
@ApiOperation(value = "删除ProductPurchaseOrder")
|
||||
@DeleteMapping(value = "/productPurchaseOrder/{id}")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','PRODUCTPURCHASEORDER_ALL','PRODUCTPURCHASEORDER_DELETE')")
|
||||
public ResponseEntity delete(@PathVariable Long id){
|
||||
productPurchaseOrderService.delete(id);
|
||||
return new ResponseEntity(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package me.zhengjie.modules.wms.purchase.rest;
|
||||
|
||||
import me.zhengjie.aop.log.Log;
|
||||
import me.zhengjie.modules.wms.purchase.domain.ProductPurchaseOrderProduct;
|
||||
import me.zhengjie.modules.wms.purchase.service.ProductPurchaseOrderProductService;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ProductPurchaseOrderProductQueryCriteria;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Api(tags = "ProductPurchaseOrderProduct管理")
|
||||
@RestController
|
||||
@RequestMapping("api")
|
||||
public class ProductPurchaseOrderProductController {
|
||||
|
||||
@Autowired
|
||||
private ProductPurchaseOrderProductService productPurchaseOrderProductService;
|
||||
|
||||
@Log("查询ProductPurchaseOrderProduct")
|
||||
@ApiOperation(value = "查询ProductPurchaseOrderProduct")
|
||||
@GetMapping(value = "/productPurchaseOrderProduct")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','PRODUCTPURCHASEORDERPRODUCT_ALL','PRODUCTPURCHASEORDERPRODUCT_SELECT')")
|
||||
public ResponseEntity getProductPurchaseOrderProducts(ProductPurchaseOrderProductQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity(productPurchaseOrderProductService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("新增ProductPurchaseOrderProduct")
|
||||
@ApiOperation(value = "新增ProductPurchaseOrderProduct")
|
||||
@PostMapping(value = "/productPurchaseOrderProduct")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','PRODUCTPURCHASEORDERPRODUCT_ALL','PRODUCTPURCHASEORDERPRODUCT_CREATE')")
|
||||
public ResponseEntity create(@Validated @RequestBody ProductPurchaseOrderProduct resources){
|
||||
return new ResponseEntity(productPurchaseOrderProductService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@Log("修改ProductPurchaseOrderProduct")
|
||||
@ApiOperation(value = "修改ProductPurchaseOrderProduct")
|
||||
@PutMapping(value = "/productPurchaseOrderProduct")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','PRODUCTPURCHASEORDERPRODUCT_ALL','PRODUCTPURCHASEORDERPRODUCT_EDIT')")
|
||||
public ResponseEntity update(@Validated @RequestBody ProductPurchaseOrderProduct resources){
|
||||
productPurchaseOrderProductService.update(resources);
|
||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除ProductPurchaseOrderProduct")
|
||||
@ApiOperation(value = "删除ProductPurchaseOrderProduct")
|
||||
@DeleteMapping(value = "/productPurchaseOrderProduct/{id}")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','PRODUCTPURCHASEORDERPRODUCT_ALL','PRODUCTPURCHASEORDERPRODUCT_DELETE')")
|
||||
public ResponseEntity delete(@PathVariable Long id){
|
||||
productPurchaseOrderProductService.delete(id);
|
||||
return new ResponseEntity(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package me.zhengjie.modules.wms.purchase.service;
|
||||
|
||||
import me.zhengjie.modules.wms.purchase.domain.ConsumablesPurchaseOrderProduct;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ConsumablesPurchaseOrderProductDTO;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ConsumablesPurchaseOrderProductQueryCriteria;
|
||||
//import org.springframework.cache.annotation.CacheConfig;
|
||||
//import org.springframework.cache.annotation.CacheEvict;
|
||||
//import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
//@CacheConfig(cacheNames = "consumablesPurchaseOrderProduct")
|
||||
public interface ConsumablesPurchaseOrderProductService {
|
||||
|
||||
/**
|
||||
* queryAll 分页
|
||||
* @param criteria
|
||||
* @param pageable
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(keyGenerator = "keyGenerator")
|
||||
Object queryAll(ConsumablesPurchaseOrderProductQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* queryAll 不分页
|
||||
* @param criteria
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(keyGenerator = "keyGenerator")
|
||||
public Object queryAll(ConsumablesPurchaseOrderProductQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* findById
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(key = "#p0")
|
||||
ConsumablesPurchaseOrderProductDTO findById(Long id);
|
||||
|
||||
/**
|
||||
* create
|
||||
* @param resources
|
||||
* @return
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
ConsumablesPurchaseOrderProductDTO create(ConsumablesPurchaseOrderProduct resources);
|
||||
|
||||
/**
|
||||
* update
|
||||
* @param resources
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void update(ConsumablesPurchaseOrderProduct resources);
|
||||
|
||||
/**
|
||||
* delete
|
||||
* @param id
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void delete(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package me.zhengjie.modules.wms.purchase.service;
|
||||
|
||||
import me.zhengjie.modules.wms.purchase.domain.ConsumablesPurchaseOrder;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ConsumablesPurchaseOrderDTO;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ConsumablesPurchaseOrderQueryCriteria;
|
||||
//import org.springframework.cache.annotation.CacheConfig;
|
||||
//import org.springframework.cache.annotation.CacheEvict;
|
||||
//import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
//@CacheConfig(cacheNames = "consumablesPurchaseOrder")
|
||||
public interface ConsumablesPurchaseOrderService {
|
||||
|
||||
/**
|
||||
* queryAll 分页
|
||||
* @param criteria
|
||||
* @param pageable
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(keyGenerator = "keyGenerator")
|
||||
Object queryAll(ConsumablesPurchaseOrderQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* queryAll 不分页
|
||||
* @param criteria
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(keyGenerator = "keyGenerator")
|
||||
public Object queryAll(ConsumablesPurchaseOrderQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* findById
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(key = "#p0")
|
||||
ConsumablesPurchaseOrderDTO findById(Long id);
|
||||
|
||||
/**
|
||||
* create
|
||||
* @param resources
|
||||
* @return
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
ConsumablesPurchaseOrderDTO create(ConsumablesPurchaseOrder resources);
|
||||
|
||||
/**
|
||||
* update
|
||||
* @param resources
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void update(ConsumablesPurchaseOrder resources);
|
||||
|
||||
/**
|
||||
* delete
|
||||
* @param id
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void delete(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package me.zhengjie.modules.wms.purchase.service;
|
||||
|
||||
import me.zhengjie.modules.wms.purchase.domain.ProductPurchaseOrderProduct;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ProductPurchaseOrderProductDTO;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ProductPurchaseOrderProductQueryCriteria;
|
||||
//import org.springframework.cache.annotation.CacheConfig;
|
||||
//import org.springframework.cache.annotation.CacheEvict;
|
||||
//import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
//@CacheConfig(cacheNames = "productPurchaseOrderProduct")
|
||||
public interface ProductPurchaseOrderProductService {
|
||||
|
||||
/**
|
||||
* queryAll 分页
|
||||
* @param criteria
|
||||
* @param pageable
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(keyGenerator = "keyGenerator")
|
||||
Object queryAll(ProductPurchaseOrderProductQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* queryAll 不分页
|
||||
* @param criteria
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(keyGenerator = "keyGenerator")
|
||||
public Object queryAll(ProductPurchaseOrderProductQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* findById
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(key = "#p0")
|
||||
ProductPurchaseOrderProductDTO findById(Long id);
|
||||
|
||||
/**
|
||||
* create
|
||||
* @param resources
|
||||
* @return
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
ProductPurchaseOrderProductDTO create(ProductPurchaseOrderProduct resources);
|
||||
|
||||
/**
|
||||
* update
|
||||
* @param resources
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void update(ProductPurchaseOrderProduct resources);
|
||||
|
||||
/**
|
||||
* delete
|
||||
* @param id
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void delete(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package me.zhengjie.modules.wms.purchase.service;
|
||||
|
||||
import me.zhengjie.modules.wms.purchase.domain.ProductPurchaseOrder;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ProductPurchaseOrderDTO;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ProductPurchaseOrderQueryCriteria;
|
||||
//import org.springframework.cache.annotation.CacheConfig;
|
||||
//import org.springframework.cache.annotation.CacheEvict;
|
||||
//import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
//@CacheConfig(cacheNames = "productPurchaseOrder")
|
||||
public interface ProductPurchaseOrderService {
|
||||
|
||||
/**
|
||||
* queryAll 分页
|
||||
* @param criteria
|
||||
* @param pageable
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(keyGenerator = "keyGenerator")
|
||||
Object queryAll(ProductPurchaseOrderQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* queryAll 不分页
|
||||
* @param criteria
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(keyGenerator = "keyGenerator")
|
||||
public Object queryAll(ProductPurchaseOrderQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* findById
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@Cacheable(key = "#p0")
|
||||
ProductPurchaseOrderDTO findById(Long id);
|
||||
|
||||
/**
|
||||
* create
|
||||
* @param resources
|
||||
* @return
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
ProductPurchaseOrderDTO create(ProductPurchaseOrder resources);
|
||||
|
||||
/**
|
||||
* update
|
||||
* @param resources
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void update(ProductPurchaseOrder resources);
|
||||
|
||||
/**
|
||||
* delete
|
||||
* @param id
|
||||
*/
|
||||
//@CacheEvict(allEntries = true)
|
||||
void delete(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package me.zhengjie.modules.wms.purchase.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Data
|
||||
public class ConsumablesPurchaseOrderDTO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Timestamp createTime;
|
||||
|
||||
private Timestamp updateTime;
|
||||
|
||||
// 采购人主键
|
||||
private Long purchaseUserId;
|
||||
|
||||
// 采购人姓名
|
||||
private String purchaseUserName;
|
||||
|
||||
// 状态
|
||||
private Integer status;
|
||||
|
||||
// 审核状态
|
||||
private Integer auditStatus;
|
||||
|
||||
private Long auditUserId;
|
||||
|
||||
// 审核人姓名
|
||||
private String auditUserName;
|
||||
|
||||
// 耗材采购单单据编号
|
||||
private String consumablesPurchaseOrderCode;
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package me.zhengjie.modules.wms.purchase.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Data
|
||||
public class ConsumablesPurchaseOrderProductDTO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
// 所属耗材采购单
|
||||
private Long consumablesPurchaseOrderId;
|
||||
|
||||
// 耗材主键
|
||||
private Long consumablesId;
|
||||
|
||||
// 耗材名称
|
||||
private String consumablesName;
|
||||
|
||||
// 产品单价
|
||||
private Long unitPrice;
|
||||
|
||||
// 产品总价
|
||||
private Long totalPrice;
|
||||
|
||||
// 产品数量
|
||||
private Long consumablesNumber;
|
||||
|
||||
// 备注
|
||||
private String remark;
|
||||
|
||||
// 创建时间
|
||||
private Timestamp createTime;
|
||||
|
||||
// 更新时间
|
||||
private Timestamp updateTime;
|
||||
|
||||
private Integer status;
|
||||
|
||||
// 耗材编号
|
||||
private String consumablesCode;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package me.zhengjie.modules.wms.purchase.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import me.zhengjie.annotation.Query;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Data
|
||||
public class ConsumablesPurchaseOrderProductQueryCriteria{
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package me.zhengjie.modules.wms.purchase.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import me.zhengjie.annotation.Query;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Data
|
||||
public class ConsumablesPurchaseOrderQueryCriteria{
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package me.zhengjie.modules.wms.purchase.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Data
|
||||
public class ProductPurchaseOrderDTO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Timestamp createTime;
|
||||
|
||||
private Timestamp updateTime;
|
||||
|
||||
// 采购人主键
|
||||
private Long purchaseUserId;
|
||||
|
||||
// 采购人姓名
|
||||
private String purchaseUserName;
|
||||
|
||||
// 状态
|
||||
private Integer status;
|
||||
|
||||
// 审核状态
|
||||
private Integer auditStatus;
|
||||
|
||||
private Long auditUserId;
|
||||
|
||||
// 审核人姓名
|
||||
private String auditUserName;
|
||||
|
||||
private String productPurchaseOrderCode;
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package me.zhengjie.modules.wms.purchase.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Data
|
||||
public class ProductPurchaseOrderProductDTO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
// 所属产品采购单
|
||||
private Long productPurchaseOrderId;
|
||||
|
||||
// 产品主键
|
||||
private Long productId;
|
||||
|
||||
// 产品名称
|
||||
private String productName;
|
||||
|
||||
// 规格
|
||||
private String specifications;
|
||||
|
||||
// 产品单价
|
||||
private Long unitPrice;
|
||||
|
||||
// 产品总价
|
||||
private Long totalPrice;
|
||||
|
||||
// 产品数量
|
||||
private Long productNumber;
|
||||
|
||||
// 备注
|
||||
private String remark;
|
||||
|
||||
// 创建时间
|
||||
private Timestamp createTime;
|
||||
|
||||
// 更新时间
|
||||
private Timestamp updateTime;
|
||||
|
||||
private Integer status;
|
||||
|
||||
// 产品编号
|
||||
private String productCode;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package me.zhengjie.modules.wms.purchase.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import me.zhengjie.annotation.Query;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Data
|
||||
public class ProductPurchaseOrderProductQueryCriteria{
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package me.zhengjie.modules.wms.purchase.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import me.zhengjie.annotation.Query;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Data
|
||||
public class ProductPurchaseOrderQueryCriteria{
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package me.zhengjie.modules.wms.purchase.service.impl;
|
||||
|
||||
import me.zhengjie.modules.wms.purchase.domain.ConsumablesPurchaseOrderProduct;
|
||||
import me.zhengjie.utils.ValidationUtil;
|
||||
import me.zhengjie.modules.wms.purchase.repository.ConsumablesPurchaseOrderProductRepository;
|
||||
import me.zhengjie.modules.wms.purchase.service.ConsumablesPurchaseOrderProductService;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ConsumablesPurchaseOrderProductDTO;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ConsumablesPurchaseOrderProductQueryCriteria;
|
||||
import me.zhengjie.modules.wms.purchase.service.mapper.ConsumablesPurchaseOrderProductMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.Optional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import me.zhengjie.utils.QueryHelp;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Service
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class ConsumablesPurchaseOrderProductServiceImpl implements ConsumablesPurchaseOrderProductService {
|
||||
|
||||
@Autowired
|
||||
private ConsumablesPurchaseOrderProductRepository consumablesPurchaseOrderProductRepository;
|
||||
|
||||
@Autowired
|
||||
private ConsumablesPurchaseOrderProductMapper consumablesPurchaseOrderProductMapper;
|
||||
|
||||
@Override
|
||||
public Object queryAll(ConsumablesPurchaseOrderProductQueryCriteria criteria, Pageable pageable){
|
||||
Page<ConsumablesPurchaseOrderProduct> page = consumablesPurchaseOrderProductRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(consumablesPurchaseOrderProductMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object queryAll(ConsumablesPurchaseOrderProductQueryCriteria criteria){
|
||||
return consumablesPurchaseOrderProductMapper.toDto(consumablesPurchaseOrderProductRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConsumablesPurchaseOrderProductDTO findById(Long id) {
|
||||
Optional<ConsumablesPurchaseOrderProduct> consumablesPurchaseOrderProduct = consumablesPurchaseOrderProductRepository.findById(id);
|
||||
ValidationUtil.isNull(consumablesPurchaseOrderProduct,"ConsumablesPurchaseOrderProduct","id",id);
|
||||
return consumablesPurchaseOrderProductMapper.toDto(consumablesPurchaseOrderProduct.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ConsumablesPurchaseOrderProductDTO create(ConsumablesPurchaseOrderProduct resources) {
|
||||
return consumablesPurchaseOrderProductMapper.toDto(consumablesPurchaseOrderProductRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(ConsumablesPurchaseOrderProduct resources) {
|
||||
Optional<ConsumablesPurchaseOrderProduct> optionalConsumablesPurchaseOrderProduct = consumablesPurchaseOrderProductRepository.findById(resources.getId());
|
||||
ValidationUtil.isNull( optionalConsumablesPurchaseOrderProduct,"ConsumablesPurchaseOrderProduct","id",resources.getId());
|
||||
ConsumablesPurchaseOrderProduct consumablesPurchaseOrderProduct = optionalConsumablesPurchaseOrderProduct.get();
|
||||
consumablesPurchaseOrderProduct.copy(resources);
|
||||
consumablesPurchaseOrderProductRepository.save(consumablesPurchaseOrderProduct);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Long id) {
|
||||
consumablesPurchaseOrderProductRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package me.zhengjie.modules.wms.purchase.service.impl;
|
||||
|
||||
import me.zhengjie.modules.wms.purchase.domain.ConsumablesPurchaseOrder;
|
||||
import me.zhengjie.utils.ValidationUtil;
|
||||
import me.zhengjie.modules.wms.purchase.repository.ConsumablesPurchaseOrderRepository;
|
||||
import me.zhengjie.modules.wms.purchase.service.ConsumablesPurchaseOrderService;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ConsumablesPurchaseOrderDTO;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ConsumablesPurchaseOrderQueryCriteria;
|
||||
import me.zhengjie.modules.wms.purchase.service.mapper.ConsumablesPurchaseOrderMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.Optional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import me.zhengjie.utils.QueryHelp;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Service
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class ConsumablesPurchaseOrderServiceImpl implements ConsumablesPurchaseOrderService {
|
||||
|
||||
@Autowired
|
||||
private ConsumablesPurchaseOrderRepository consumablesPurchaseOrderRepository;
|
||||
|
||||
@Autowired
|
||||
private ConsumablesPurchaseOrderMapper consumablesPurchaseOrderMapper;
|
||||
|
||||
@Override
|
||||
public Object queryAll(ConsumablesPurchaseOrderQueryCriteria criteria, Pageable pageable){
|
||||
Page<ConsumablesPurchaseOrder> page = consumablesPurchaseOrderRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(consumablesPurchaseOrderMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object queryAll(ConsumablesPurchaseOrderQueryCriteria criteria){
|
||||
return consumablesPurchaseOrderMapper.toDto(consumablesPurchaseOrderRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConsumablesPurchaseOrderDTO findById(Long id) {
|
||||
Optional<ConsumablesPurchaseOrder> consumablesPurchaseOrder = consumablesPurchaseOrderRepository.findById(id);
|
||||
ValidationUtil.isNull(consumablesPurchaseOrder,"ConsumablesPurchaseOrder","id",id);
|
||||
return consumablesPurchaseOrderMapper.toDto(consumablesPurchaseOrder.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ConsumablesPurchaseOrderDTO create(ConsumablesPurchaseOrder resources) {
|
||||
return consumablesPurchaseOrderMapper.toDto(consumablesPurchaseOrderRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(ConsumablesPurchaseOrder resources) {
|
||||
Optional<ConsumablesPurchaseOrder> optionalConsumablesPurchaseOrder = consumablesPurchaseOrderRepository.findById(resources.getId());
|
||||
ValidationUtil.isNull( optionalConsumablesPurchaseOrder,"ConsumablesPurchaseOrder","id",resources.getId());
|
||||
ConsumablesPurchaseOrder consumablesPurchaseOrder = optionalConsumablesPurchaseOrder.get();
|
||||
consumablesPurchaseOrder.copy(resources);
|
||||
consumablesPurchaseOrderRepository.save(consumablesPurchaseOrder);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Long id) {
|
||||
consumablesPurchaseOrderRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package me.zhengjie.modules.wms.purchase.service.impl;
|
||||
|
||||
import me.zhengjie.modules.wms.purchase.domain.ProductPurchaseOrderProduct;
|
||||
import me.zhengjie.utils.ValidationUtil;
|
||||
import me.zhengjie.modules.wms.purchase.repository.ProductPurchaseOrderProductRepository;
|
||||
import me.zhengjie.modules.wms.purchase.service.ProductPurchaseOrderProductService;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ProductPurchaseOrderProductDTO;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ProductPurchaseOrderProductQueryCriteria;
|
||||
import me.zhengjie.modules.wms.purchase.service.mapper.ProductPurchaseOrderProductMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.Optional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import me.zhengjie.utils.QueryHelp;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Service
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class ProductPurchaseOrderProductServiceImpl implements ProductPurchaseOrderProductService {
|
||||
|
||||
@Autowired
|
||||
private ProductPurchaseOrderProductRepository productPurchaseOrderProductRepository;
|
||||
|
||||
@Autowired
|
||||
private ProductPurchaseOrderProductMapper productPurchaseOrderProductMapper;
|
||||
|
||||
@Override
|
||||
public Object queryAll(ProductPurchaseOrderProductQueryCriteria criteria, Pageable pageable){
|
||||
Page<ProductPurchaseOrderProduct> page = productPurchaseOrderProductRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(productPurchaseOrderProductMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object queryAll(ProductPurchaseOrderProductQueryCriteria criteria){
|
||||
return productPurchaseOrderProductMapper.toDto(productPurchaseOrderProductRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductPurchaseOrderProductDTO findById(Long id) {
|
||||
Optional<ProductPurchaseOrderProduct> productPurchaseOrderProduct = productPurchaseOrderProductRepository.findById(id);
|
||||
ValidationUtil.isNull(productPurchaseOrderProduct,"ProductPurchaseOrderProduct","id",id);
|
||||
return productPurchaseOrderProductMapper.toDto(productPurchaseOrderProduct.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ProductPurchaseOrderProductDTO create(ProductPurchaseOrderProduct resources) {
|
||||
return productPurchaseOrderProductMapper.toDto(productPurchaseOrderProductRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(ProductPurchaseOrderProduct resources) {
|
||||
Optional<ProductPurchaseOrderProduct> optionalProductPurchaseOrderProduct = productPurchaseOrderProductRepository.findById(resources.getId());
|
||||
ValidationUtil.isNull( optionalProductPurchaseOrderProduct,"ProductPurchaseOrderProduct","id",resources.getId());
|
||||
ProductPurchaseOrderProduct productPurchaseOrderProduct = optionalProductPurchaseOrderProduct.get();
|
||||
productPurchaseOrderProduct.copy(resources);
|
||||
productPurchaseOrderProductRepository.save(productPurchaseOrderProduct);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Long id) {
|
||||
productPurchaseOrderProductRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package me.zhengjie.modules.wms.purchase.service.impl;
|
||||
|
||||
import me.zhengjie.modules.wms.purchase.domain.ProductPurchaseOrder;
|
||||
import me.zhengjie.utils.ValidationUtil;
|
||||
import me.zhengjie.modules.wms.purchase.repository.ProductPurchaseOrderRepository;
|
||||
import me.zhengjie.modules.wms.purchase.service.ProductPurchaseOrderService;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ProductPurchaseOrderDTO;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ProductPurchaseOrderQueryCriteria;
|
||||
import me.zhengjie.modules.wms.purchase.service.mapper.ProductPurchaseOrderMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.Optional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import me.zhengjie.utils.QueryHelp;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Service
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class ProductPurchaseOrderServiceImpl implements ProductPurchaseOrderService {
|
||||
|
||||
@Autowired
|
||||
private ProductPurchaseOrderRepository productPurchaseOrderRepository;
|
||||
|
||||
@Autowired
|
||||
private ProductPurchaseOrderMapper productPurchaseOrderMapper;
|
||||
|
||||
@Override
|
||||
public Object queryAll(ProductPurchaseOrderQueryCriteria criteria, Pageable pageable){
|
||||
Page<ProductPurchaseOrder> page = productPurchaseOrderRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(productPurchaseOrderMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object queryAll(ProductPurchaseOrderQueryCriteria criteria){
|
||||
return productPurchaseOrderMapper.toDto(productPurchaseOrderRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductPurchaseOrderDTO findById(Long id) {
|
||||
Optional<ProductPurchaseOrder> productPurchaseOrder = productPurchaseOrderRepository.findById(id);
|
||||
ValidationUtil.isNull(productPurchaseOrder,"ProductPurchaseOrder","id",id);
|
||||
return productPurchaseOrderMapper.toDto(productPurchaseOrder.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ProductPurchaseOrderDTO create(ProductPurchaseOrder resources) {
|
||||
return productPurchaseOrderMapper.toDto(productPurchaseOrderRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(ProductPurchaseOrder resources) {
|
||||
Optional<ProductPurchaseOrder> optionalProductPurchaseOrder = productPurchaseOrderRepository.findById(resources.getId());
|
||||
ValidationUtil.isNull( optionalProductPurchaseOrder,"ProductPurchaseOrder","id",resources.getId());
|
||||
ProductPurchaseOrder productPurchaseOrder = optionalProductPurchaseOrder.get();
|
||||
productPurchaseOrder.copy(resources);
|
||||
productPurchaseOrderRepository.save(productPurchaseOrder);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Long id) {
|
||||
productPurchaseOrderRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package me.zhengjie.modules.wms.purchase.service.mapper;
|
||||
|
||||
import me.zhengjie.mapper.EntityMapper;
|
||||
import me.zhengjie.modules.wms.purchase.domain.ConsumablesPurchaseOrder;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ConsumablesPurchaseOrderDTO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface ConsumablesPurchaseOrderMapper extends EntityMapper<ConsumablesPurchaseOrderDTO, ConsumablesPurchaseOrder> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package me.zhengjie.modules.wms.purchase.service.mapper;
|
||||
|
||||
import me.zhengjie.mapper.EntityMapper;
|
||||
import me.zhengjie.modules.wms.purchase.domain.ConsumablesPurchaseOrderProduct;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ConsumablesPurchaseOrderProductDTO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface ConsumablesPurchaseOrderProductMapper extends EntityMapper<ConsumablesPurchaseOrderProductDTO, ConsumablesPurchaseOrderProduct> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package me.zhengjie.modules.wms.purchase.service.mapper;
|
||||
|
||||
import me.zhengjie.mapper.EntityMapper;
|
||||
import me.zhengjie.modules.wms.purchase.domain.ProductPurchaseOrder;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ProductPurchaseOrderDTO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface ProductPurchaseOrderMapper extends EntityMapper<ProductPurchaseOrderDTO, ProductPurchaseOrder> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package me.zhengjie.modules.wms.purchase.service.mapper;
|
||||
|
||||
import me.zhengjie.mapper.EntityMapper;
|
||||
import me.zhengjie.modules.wms.purchase.domain.ProductPurchaseOrderProduct;
|
||||
import me.zhengjie.modules.wms.purchase.service.dto.ProductPurchaseOrderProductDTO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @author jie
|
||||
* @date 2019-10-06
|
||||
*/
|
||||
@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface ProductPurchaseOrderProductMapper extends EntityMapper<ProductPurchaseOrderProductDTO, ProductPurchaseOrderProduct> {
|
||||
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@ server:
|
|||
|
||||
spring:
|
||||
profiles:
|
||||
active: prod
|
||||
active: dev
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
data:
|
||||
|
|
|
|||
|
|
@ -72,7 +72,8 @@ public class EmailServiceImpl implements EmailService {
|
|||
}
|
||||
account.setFrom(emailConfig.getUser()+"<"+emailConfig.getFromUser()+">");
|
||||
//ssl方式发送
|
||||
account.setStartttlsEnable(true);
|
||||
//TODO hxx先去掉
|
||||
// account.setStartttlsEnable(true);
|
||||
String content = emailVo.getContent();
|
||||
/**
|
||||
* 发送
|
||||
|
|
|
|||
Loading…
Reference in New Issue