客户订单搜

pull/451/head
starrysky 2020-05-05 20:19:37 +08:00
parent cd4ca6e6b4
commit 9bfe11af52
12 changed files with 56 additions and 7 deletions

View File

@ -85,6 +85,9 @@ public class CustomerOrderDTO implements Serializable {
// 订单紧张状态
private String procStatus;
// 订单状态名称
private String procStatusName;
public void copy(CustomerOrderDTO source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
}

View File

@ -10,4 +10,10 @@ import me.zhengjie.annotation.Query;
*/
@Data
public class CustomerOrderQueryCriteria {
// 客户订单编号
private String customerOrderCode;
// 客户名称
private String customerName;
}

View File

@ -109,6 +109,17 @@ public class CustomerOrderServiceImpl implements CustomerOrderService {
Predicate statusPredicate = criteriaBuilder.equal(root.get("status"), 1);
targetPredicateList.add(statusPredicate);
if(!StringUtils.isEmpty(criteria.getCustomerOrderCode())){
Predicate customerOrderCodePredicate = criteriaBuilder.equal(root.get("customerOrderCode"), criteria.getCustomerOrderCode());
targetPredicateList.add(customerOrderCodePredicate);
}
if(!StringUtils.isEmpty(criteria.getCustomerName())){
Predicate customerNamePredicate = criteriaBuilder.equal(root.get("customerName"), criteria.getCustomerName());
targetPredicateList.add(customerNamePredicate);
}
criteriaQuery.orderBy(criteriaBuilder.desc(root.get("createTime")));
if(CollectionUtils.isEmpty(targetPredicateList)){
@ -119,6 +130,7 @@ public class CustomerOrderServiceImpl implements CustomerOrderService {
}
};
Page<CustomerOrder> page = customerOrderRepository.findAll(specification, pageable);
Page<CustomerOrderDTO> customerOrderDTOPage = page.map(customerOrderMapper::toDto);
if(null != customerOrderDTOPage){
List<CustomerOrderDTO> customerOrderDTOList = customerOrderDTOPage.getContent();
@ -129,6 +141,12 @@ public class CustomerOrderServiceImpl implements CustomerOrderService {
Timestamp createTime = customerOrderDTO.getCreateTime();
customerOrderDTO.setCreateTimeStr(new SimpleDateFormat("yyyy-MM-dd").format(createTime));
customerOrderDTO.setCustomerOrderProductList(customerOrderProductDTOList);
String procStatus = customerOrderDTO.getProcStatus();
ProcStatusEnum procStatusEnum = ProcStatusEnum.getProcStatusEnum(procStatus);
if(null != procStatusEnum){
customerOrderDTO.setProcStatusName(procStatusEnum.getName());
}
}
}
}

View File

@ -73,6 +73,7 @@ public class InvoiceProduct implements Serializable {
@Column(name = "remark")
private String remark;
// 销售发货单id
@Column(name = "invoice_id")
private Long invoiceId;

View File

@ -21,7 +21,7 @@ public interface InvoiceProductRepository extends JpaRepository<InvoiceProduct,
* @param invoicCode
* @return
*/
List<InvoiceProduct> findByInvoiceCodeAndStatusTrue(String invoicCode);
List<InvoiceProduct> findByInvoiceIdAndStatusTrue(String invoicCode);
/**
*

View File

@ -62,6 +62,10 @@ OutSourceProcessSheet implements Serializable {
@Column(name = "out_source_process_sheet_code")
private String outSourceProcessSheetCode;
// 委外加工单状态
@Column(name = "proc_status")
private String procStatus;
public void copy(OutSourceProcessSheet source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
}

View File

@ -47,4 +47,9 @@ public class OutSourceProcessSheetDTO implements Serializable {
// 委外加工单产品信息
private List<OutSourceProcessSheetProductDTO> outSourceProcessSheetProductList;
// 委外加工单状态
private String procStatus;
private String procStatusName;
}

View File

@ -216,6 +216,8 @@ public class OutSourceInspectionCertificateServiceImpl implements OutSourceInspe
}
messageRepository.saveAll(messageList);
}
// 修改为外加工单状态
}catch (Exception e){
log.error("单据编号:插入消息失败!");
}

View File

@ -26,8 +26,7 @@ import me.zhengjie.modules.wms.outSourceProductSheet.request.QueryOutSourceProce
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;
import me.zhengjie.utils.SecurityUtils;
import me.zhengjie.utils.ValidationUtil;
import me.zhengjie.utils.*;
import me.zhengjie.modules.wms.outSourceProductSheet.repository.OutSourceProcessSheetRepository;
import me.zhengjie.modules.wms.outSourceProductSheet.service.OutSourceProcessSheetService;
import me.zhengjie.modules.wms.outSourceProductSheet.service.dto.OutSourceProcessSheetDTO;
@ -52,8 +51,6 @@ import java.util.stream.Collectors;
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 org.springframework.util.StringUtils;
@ -186,6 +183,7 @@ public class OutSourceProcessSheetServiceImpl implements OutSourceProcessSheetSe
}
outSourceProcessSheet.setStatus(true);
outSourceProcessSheet.setProcStatus(ProcStatusEnum.OUT_SOURCE_ING.getCode());
// 新增委外加工单
outSourceProcessSheetRepository.save(outSourceProcessSheet);

View File

@ -4,7 +4,7 @@ spring:
druid:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://47.103.159.227:3306/eladmin?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
url: jdbc:log4jdbc:mysql://rm-uf6xgp37n61jn71x5ao.mysql.rds.aliyuncs.com:3306/eladmin?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
username: hecate
password: hxx2751085Qwe!

View File

@ -4,7 +4,7 @@ spring:
druid:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://47.103.159.227:3306/eladmin?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
url: jdbc:log4jdbc:mysql://rm-uf6xgp37n61jn71x5ao.mysql.rds.aliyuncs.com:3306/eladmin?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
username: hecate
password: hxx2751085Qwe!

View File

@ -8,6 +8,8 @@ public enum ProcStatusEnum {
WAIT_SEND_GOOD("等待发货", "WAIT_SEND_GOOD"),
SENDING_GOOD("发货中", "SENDING_GOOD"),
COMPLETED("已完结", "COMPLETED"),
OUT_SOURCE_ING("委外中", "OUT_SOURCE_ING")
;
private String name;
@ -34,4 +36,14 @@ public enum ProcStatusEnum {
public void setCode(String code) {
this.code = code;
}
public static ProcStatusEnum getProcStatusEnum(String code) {
ProcStatusEnum[] funcEnums = values();
for (ProcStatusEnum funcEnum : funcEnums) {
if (funcEnum.getCode().equals(code)) {
return funcEnum;
}
}
return null;
}
}