Merge branch 'master' of F:\workplace-idea\榄菊\lanju-cloud with conflicts.

highway
Yangwl 1 year ago
parent 40072716eb
commit 7cb2180d78

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
<facet type="web" name="Web">
<configuration>
<webroots />
</configuration>
</facet>
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />

@ -15,14 +15,14 @@ spring:
# username: nacos
# password: sfnacos2023
# 服务注册地址
#--spring.cloud.nacos.discovery.namespace=zxl --spring.cloud.nacos.config.namespace=zxl
#--spring.cloud.nacos.discovery.namespace=ywl --spring.cloud.nacos.config.namespace=ywl
namespace: lanju-op
group: zxl
group: ywl
server-addr: 140.249.53.142:8848
config:
#命名空间
namespace: lanju-op
group: zxl
group: ywl
# 配置中心地址
server-addr: 140.249.53.142:8848
# 配置文件格式

@ -4,6 +4,11 @@
<facet type="Spring" name="Spring">
<configuration />
</facet>
<facet type="web" name="Web">
<configuration>
<webroots />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />

@ -4,6 +4,11 @@
<facet type="Spring" name="Spring">
<configuration />
</facet>
<facet type="web" name="Web">
<configuration>
<webroots />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />

@ -4,6 +4,11 @@
<facet type="Spring" name="Spring">
<configuration />
</facet>
<facet type="web" name="Web">
<configuration>
<webroots />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
<facet type="web" name="Web">
<configuration>
<webroots />
</configuration>
</facet>
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />

@ -15,14 +15,15 @@ spring:
discovery:
# username: nacos
# password: sfnacos2023
# namespace: lanju-op
namespace: lanju-op
group: zxl
group: ywl
# 服务注册地址
server-addr: 140.249.53.142:8848
config:
#命名空间
namespace: lanju-op
group: zxl
group: ywl
# 配置中心地址
server-addr: 140.249.53.142:8848
# 配置文件格式

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
<facet type="web" name="Web">
<configuration>
<webroots />
</configuration>
</facet>
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />

@ -15,13 +15,13 @@ spring:
discovery:
# 服务注册地址
namespace: lanju-op
group: zxl
group: ywl
# 服务注册地址
server-addr: 140.249.53.142:8848
config:
# 配置中心地址
namespace: lanju-op
group: zxl
group: ywl
# 服务注册地址
server-addr: 140.249.53.142:8848
# 配置文件格式

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
<facet type="web" name="Web">
<configuration>
<webroots />
</configuration>
</facet>
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
@ -30,7 +30,6 @@
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpasyncclient:4.1.5" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.16" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore-nio:4.4.16" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.14" level="project" />
<orderEntry type="library" name="Maven: org.reflections:reflections:0.9.11" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.21.0-GA" level="project" />
@ -106,6 +105,33 @@
<orderEntry type="library" name="Maven: org.apache.velocity:velocity-engine-core:2.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
<orderEntry type="library" name="Maven: com.mysql:mysql-connector-j:8.0.31" level="project" />
<orderEntry type="library" name="Maven: com.microsoft.sqlserver:mssql-jdbc:6.1.0.jre8" level="project" />
<orderEntry type="library" name="Maven: com.microsoft.azure:azure-keyvault:0.9.3" level="project" />
<orderEntry type="library" name="Maven: com.microsoft.azure:azure-core:0.9.3" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" name="Maven: javax.mail:mail:1.4.5" level="project" />
<orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-client:1.13" level="project" />
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-core:1.13" level="project" />
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-json:1.13" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.jettison:jettison:1.1" level="project" />
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.3-1" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.9.2" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.9.2" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-jaxrs:1.9.2" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-xc:1.9.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.14" level="project" />
<orderEntry type="library" name="Maven: javax.inject:javax.inject:1" level="project" />
<orderEntry type="library" name="Maven: com.microsoft.azure:adal4j:1.0.0" level="project" />
<orderEntry type="library" name="Maven: com.nimbusds:oauth2-oidc-sdk:4.5" level="project" />
<orderEntry type="library" name="Maven: net.jcip:jcip-annotations:1.0" level="project" />
<orderEntry type="library" name="Maven: net.minidev:json-smart:2.4.8" level="project" />
<orderEntry type="library" name="Maven: net.minidev:accessors-smart:2.4.8" level="project" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm:9.1" level="project" />
<orderEntry type="library" name="Maven: com.nimbusds:lang-tag:1.4" level="project" />
<orderEntry type="library" name="Maven: com.nimbusds:nimbus-jose-jwt:3.1.2" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.9.1" level="project" />
<orderEntry type="module" module-name="op-common-log" />
<orderEntry type="module" module-name="op-common-security" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.3.24" level="project" />

@ -60,6 +60,13 @@
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- sqlserver的数据库驱动包 -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.1.0.jre8</version>
</dependency>
<!-- OP Common Log -->
<dependency>
<groupId>com.op</groupId>

@ -14,13 +14,13 @@ spring:
nacos:
discovery:
namespace: lanju-op
group: zxl
group: ywl
# 服务注册地址
server-addr: 140.249.53.142:8848
config:
#命名空间
namespace: lanju-op
group: zxl
group: ywl
# 配置中心地址
server-addr: 140.249.53.142:8848
# 配置文件格式

@ -3,6 +3,7 @@ package com.op.mes.service.impl;
import java.util.*;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
@ -13,7 +14,6 @@ import com.op.mes.domain.dto.SplitOrderDTO;
import com.op.mes.domain.vo.LineAndShiftVo;
import com.op.mes.mapper.ProOrderWorkorderBatchMapper;
import com.op.mes.mapper.ProOrderWorkorderMapper;
import com.op.mes.mapper.ProRouteMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -38,8 +38,6 @@ public class ProOrderServiceImpl implements IProOrderService {
private ProOrderWorkorderMapper proOrderWorkorderMapper;
@Autowired
private ProOrderWorkorderBatchMapper proOrderWorkorderBatchMapper;
@Autowired
private ProRouteMapper proRouteMapper;
/**
*
@ -82,16 +80,12 @@ public class ProOrderServiceImpl implements IProOrderService {
ProOrder product = new ProOrder();
BeanUtils.copyProperties(splitOrderDTO.getProduct(), product);
// 设置通用属性
ProOrderWorkorder proOrderWorkorder = setCommonWorkAttribute(product, splitOrderDTO.getProductDate(), splitOrderDTO.getProdLineCode(), splitOrderDTO.getShiftId(),splitOrderDTO.getRouteCode());
ProOrderWorkorder proOrderWorkorder = setCommonWorkAttribute(product, splitOrderDTO.getProductDate(), splitOrderDTO.getProdLineCode(), splitOrderDTO.getShiftId());
// 生成对应工单表
// 一级
ProOrderWorkorder firWorkOrder = setWorkOrder(proOrderWorkorder, product);
// code
int endCode = getEndCode(product.getId());
firWorkOrder.setWorkorderCode(product.getOrderCode()+"-"+endCode);
// 更新到数据库
proOrderWorkorderMapper.insertProOrderWorkorder(firWorkOrder);
// 创建通用批次表对象
ProOrderWorkorderBatch workBatch = setCommonBatchAttribute();
// 生成批次表并更新到数据库
@ -107,8 +101,6 @@ public class ProOrderServiceImpl implements IProOrderService {
// 设置父工单
proOrderWorkorder.setParentOrder(firWorkOrder.getWorkorderCode());
ProOrderWorkorder secWorkOrder = setWorkOrder(proOrderWorkorder, product);
// code
secWorkOrder.setWorkorderCode(product.getOrderCode()+"-"+(endCode+1));
// 更新到数据库
proOrderWorkorderMapper.insertProOrderWorkorder(secWorkOrder);
// 生成批次表并更新到数据库
@ -126,8 +118,6 @@ public class ProOrderServiceImpl implements IProOrderService {
ProOrderWorkorder thiWorkOrder = setWorkOrder(proOrderWorkorder, product);
// 设置为底层节点
thiWorkOrder.setIsEnd(1);
// code
thiWorkOrder.setWorkorderCode(product.getOrderCode()+"-"+(endCode+2));
// 更新到数据库
proOrderWorkorderMapper.insertProOrderWorkorder(thiWorkOrder);
// 生成批次表并更新到数据库
@ -150,13 +140,6 @@ public class ProOrderServiceImpl implements IProOrderService {
proOrderWorkorderMapper.updateProOrderWorkorder(updateWorker);
}
// 母工单设置底层节点(只有母工单的情况下)
if (checkEnd == 0) {
firWorkOrder.setIsEnd(1);
// 更新到数据库
proOrderWorkorderMapper.updateProOrderWorkorder(firWorkOrder);
}
return success();
}
@ -176,38 +159,33 @@ public class ProOrderServiceImpl implements IProOrderService {
// 通过订单id查询所有工单信息list
List<ProOrderWorkorder> proOrderWorkorderList = proOrderWorkorderMapper.selectFirWorkOrder(id);
// 母工单循环遍历
for (int i = 0; i < proOrderWorkorderList.size(); i++) {
// 通过班次id查询班次名称
String shiftDesc = proOrderMapper.selectShiftNameById(proOrderWorkorderList.get(i).getShiftId());
for (int i = 0;i < proOrderWorkorderList.size();i++){
// 通过设备code查询出机型名称
String prodLineName = proOrderMapper.selectProdLineName(proOrderWorkorderList.get(i).getProdLineCode());
// 通过工单id查询批次号
List<String> batchCodeList = proOrderMapper.selectBatchCodesById(proOrderWorkorderList.get(i).getWorkorderId());
List<StringBuilder> batchCodes = new ArrayList<>();
// 格式化数据
for (int j = 0; j < batchCodeList.size(); j++) {
for (int j = 0;j < batchCodeList.size();j++){
batchCodes.add(new StringBuilder(batchCodeList.get(j)).append(";").append("\n"));
}
// 通过母工单workorder_id查询子工单
// 二级
List<ProOrderWorkorder> secProOrderWorkorder = proOrderWorkorderMapper.selectChildWorkOrder(proOrderWorkorderList.get(i).getWorkorderCode());
if (secProOrderWorkorder.size() > 0 && secProOrderWorkorder != null) {
if (secProOrderWorkorder.size() > 0 && secProOrderWorkorder != null){
// 三级
List<ProOrderWorkorder> thiProOrderWorkorders = proOrderWorkorderMapper.selectChildWorkOrder(secProOrderWorkorder.get(0).getWorkorderCode());
if (thiProOrderWorkorders.size() > 0 && thiProOrderWorkorders != null) {
if (thiProOrderWorkorders.size() > 0 && thiProOrderWorkorders != null){
// 将三级放入二级child
thiProOrderWorkorders.get(0).setShiftDesc(shiftDesc);
thiProOrderWorkorders.get(0).setProdLineCode(prodLineName);
thiProOrderWorkorders.get(0).setBatchCodeList(batchCodes);
secProOrderWorkorder.get(0).setChildren(thiProOrderWorkorders);
}
// 将二级放入到母工单child
secProOrderWorkorder.get(0).setShiftDesc(shiftDesc);
secProOrderWorkorder.get(0).setProdLineCode(prodLineName);
secProOrderWorkorder.get(0).setBatchCodeList(batchCodes);
proOrderWorkorderList.get(i).setChildren(secProOrderWorkorder);
}
proOrderWorkorderList.get(i).setShiftDesc(shiftDesc);
proOrderWorkorderList.get(i).setProdLineCode(prodLineName);
proOrderWorkorderList.get(i).setBatchCodeList(batchCodes);
}
@ -250,11 +228,7 @@ public class ProOrderServiceImpl implements IProOrderService {
@Override
@DS("#header.poolName")
public LineAndShiftVo getProdLineShift(String type) {
if (type.equals("white")){
LineAndShiftVo lineAndShiftVo = new LineAndShiftVo(proOrderMapper.selectProdLine(), proOrderMapper.selectProShift(),proRouteMapper.selectAllRoute());
return lineAndShiftVo;
}
LineAndShiftVo lineAndShiftVo = new LineAndShiftVo(proOrderMapper.selectPackageLine(), proOrderMapper.selectProShift(),proRouteMapper.selectAllRoute());
LineAndShiftVo lineAndShiftVo = new LineAndShiftVo(proOrderMapper.selectProdLine(), proOrderMapper.selectProShift());
return lineAndShiftVo;
}
@ -265,7 +239,6 @@ public class ProOrderServiceImpl implements IProOrderService {
* @return
*/
@Override
@DS("#header.poolName")
public ProOrder selectProOrderById(String id) {
return proOrderMapper.selectProOrderById(id);
}
@ -292,22 +265,20 @@ public class ProOrderServiceImpl implements IProOrderService {
@DS("#header.poolName")
public int insertProOrder(ProOrder proOrder) {
// 获取当前时间
Date date = DateUtils.getNowDate();
Date date = new Date();
proOrder.setId(IdUtils.fastSimpleUUID());
proOrder.setParentOrder("0");
proOrder.setStatus("o0");
proOrder.setOrderType(proOrder.getProdType());
proOrder.setOrderCode("DD"+ DateUtils.parseDateToStr(DateUtils.YYYYMMDDHHMMSSsss, date));
proOrder.setCreateBy(SecurityContextHolder.getUserName());
proOrder.setCreateTime(date);
proOrder.setUpdateBy(SecurityContextHolder.getUserName());
proOrder.setUpdateTime(date);
proOrder.setCreateTime(DateUtils.getNowDate());
return proOrderMapper.insertProOrder(proOrder);
}
@Override
public int insertSapProOrder(ProOrder proOrder) {
return 0;
DynamicDataSourceContextHolder.push("op_xiaolan");// 这是数据源的key
proOrder.setId(IdUtils.fastSimpleUUID());
proOrder.setCreateTime(DateUtils.getNowDate());
proOrder.setUpdateBy(SecurityContextHolder.getUserName());
proOrder.setUpdateTime(DateUtils.getNowDate());
return proOrderMapper.insertProOrder(proOrder);
}
/**
@ -353,16 +324,12 @@ public class ProOrderServiceImpl implements IProOrderService {
* @param proOrder
* @return
*/
private ProOrderWorkorder setCommonWorkAttribute(ProOrder proOrder, Date date, String proLineCode, String shiftId,String routeCode) {
private ProOrderWorkorder setCommonWorkAttribute(ProOrder proOrder, Date date, String proLineCode, String shiftId) {
ProOrderWorkorder proOrderWorkorder = new ProOrderWorkorder();
// 更新者
proOrderWorkorder.setUpdateBy(SecurityContextHolder.getUserName());
// 更新时间
proOrderWorkorder.setUpdateTime(DateUtils.getNowDate());
// 创建者
proOrderWorkorder.setCreateBy(SecurityContextHolder.getUserName());
// 创建时间
proOrderWorkorder.setCreateTime(DateUtils.getNowDate());
// 工单生产日期
proOrderWorkorder.setProductDate(date);
// 产品(物料)编码
@ -378,8 +345,6 @@ public class ProOrderServiceImpl implements IProOrderService {
// TODO 产品类型(pro_type)
// 单据状态(1为已经下达0未下达)
proOrderWorkorder.setStatus("w0");
// 工艺编码
proOrderWorkorder.setRouteCode(routeCode);
return proOrderWorkorder;
}
@ -392,12 +357,18 @@ public class ProOrderServiceImpl implements IProOrderService {
*/
private ProOrderWorkorder setWorkOrder(ProOrderWorkorder proOrderWorkorder, ProOrder proOrder) {
// 获取当前时间
Date date = DateUtils.getNowDate();
Date date = new Date();
// 订单表更新时间/更新者
proOrder.setUpdateBy(SecurityContextHolder.getUserName());
proOrder.setUpdateTime(date);
// 设置订单状态(只要拆了就属于已拆分)
proOrder.setStatus("o1");
// 设置订单状态
if (proOrder.getQuantitySplit() == null && proOrder.getQuantity() == Long.valueOf(proOrder.getAtrr1())){
proOrder.setStatus("o1");
}else if (proOrder.getQuantitySplit() != null && (proOrder.getQuantitySplit()+Long.valueOf(proOrder.getAtrr1()) == proOrder.getQuantity())){
proOrder.setStatus("o1");
}else {
proOrder.setStatus("o0");
}
// 更新订单表
proOrderMapper.updateOrder(proOrder);
// 生成对应的工单表
@ -413,6 +384,8 @@ public class ProOrderServiceImpl implements IProOrderService {
proOrderWorkorder.setUnit(proOrder.getUnit());
// 已拆分数量
proOrderWorkorder.setQuantitySplit(Long.valueOf(proOrder.getAtrr1()));
// TODO 工艺编码
// TODO 所有父节点
return proOrderWorkorder;
}
@ -423,12 +396,9 @@ public class ProOrderServiceImpl implements IProOrderService {
*/
private ProOrderWorkorderBatch setCommonBatchAttribute() {
ProOrderWorkorderBatch workBatch = new ProOrderWorkorderBatch();
Date date = new Date();
// 更新者
workBatch.setUpdateBy(SecurityContextHolder.getUserName());
// 创建更新时间
workBatch.setUpdateTime(DateUtils.getNowDate());
// 设置创建时间
workBatch.setCreateTime(DateUtils.getNowDate());
// 创建者
workBatch.setCreateBy(SecurityContextHolder.getUserName());
// 设置单据状态1正常
@ -460,6 +430,22 @@ public class ProOrderServiceImpl implements IProOrderService {
}
}
/**
*
*
* @param status
* @return
*/
private String changeStatus(String status) {
if (status.equals("o0")){
return "未拆分";
}
if (status.equals("o1")){
return "已拆分";
}
return status;
}
/**
* code
* @param id

@ -14,12 +14,12 @@ spring:
nacos:
discovery:
namespace: lanju-op
group: zxl
group: ywl
# 服务注册地址
server-addr: 140.249.53.142:8848
config:
namespace: lanju-op
group: zxl
group: ywl
#命名空间
#group: local
# 配置中心地址

Loading…
Cancel
Save