+ *
+ * @author miemie
+ * @since 2018-06-09
+ */
+public class ExtMybatisMapperMethod {
+
+ private final SqlCommand command;
+ private final MethodSignature method;
+
+ public ExtMybatisMapperMethod(Class> mapperInterface, Method method, Configuration config) {
+ this.command = new SqlCommand(config, mapperInterface, method);
+ this.method = new MethodSignature(config, mapperInterface, method);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object execute(SqlSession sqlSession, Object[] args) {
+ Object result;
+ switch (command.getType()) {
+ case INSERT: {
+ Object param = method.convertArgsToSqlCommandParam(args);
+ result = rowCountResult(sqlSession.insert(command.getName(), param));
+ break;
+ }
+ case UPDATE: {
+ Object param = method.convertArgsToSqlCommandParam(args);
+ result = rowCountResult(sqlSession.update(command.getName(), param));
+ break;
+ }
+ case DELETE: {
+ Object param = method.convertArgsToSqlCommandParam(args);
+ result = rowCountResult(sqlSession.delete(command.getName(), param));
+ break;
+ }
+ case SELECT:
+ if (method.returnsVoid() && method.hasResultHandler()) {
+ executeWithResultHandler(sqlSession, args);
+ result = null;
+ } else if (method.returnsMany()) {
+ result = executeForMany(sqlSession, args);
+ } else if (method.returnsMap()) {
+ result = executeForMap(sqlSession, args);
+ } else if (method.returnsCursor()) {
+ result = executeForCursor(sqlSession, args);
+ } else {
+ Object param = method.convertArgsToSqlCommandParam(args);
+ /*
+ * 这下面
+ */
+ if (IPage.class.isAssignableFrom(method.getReturnType()) && args != null
+ && IPage.class.isAssignableFrom(args[0].getClass())) {
+ result = ((IPage) args[0]).setRecords(executeForIPage(sqlSession, args));
+ /*
+ * 这上面
+ */
+ } else {
+ result = sqlSession.selectOne(command.getName(), param);
+ if (method.returnsOptional() &&
+ (result == null || !method.getReturnType().equals(result.getClass()))) {
+ result = Optional.ofNullable(result);
+ }
+ }
+ }
+ break;
+ case FLUSH:
+ result = sqlSession.flushStatements();
+ break;
+ default:
+ throw new BindingException("Unknown execution method for: " + command.getName());
+ }
+ if (result == null && method.getReturnType().isPrimitive() && !method.returnsVoid()) {
+ throw new BindingException("Mapper method '" + command.getName()
+ + " attempted to return null from a method with a primitive return type (" + method.getReturnType() + ").");
+ }
+ return result;
+ }
+
+ /**
+ * IPage 专用
+ */
+ private List executeForIPage(SqlSession sqlSession, Object[] args) {
+ Object param = method.convertArgsToSqlCommandParam(args);
+ return sqlSession.selectList(command.getName(), param);
+ }
+
+ private Object rowCountResult(int rowCount) {
+ final Object result;
+ if (method.returnsVoid()) {
+ result = null;
+ } else if (Integer.class.equals(method.getReturnType()) || Integer.TYPE.equals(method.getReturnType())) {
+ result = rowCount;
+ } else if (Long.class.equals(method.getReturnType()) || Long.TYPE.equals(method.getReturnType())) {
+ result = (long) rowCount;
+ } else if (Boolean.class.equals(method.getReturnType()) || Boolean.TYPE.equals(method.getReturnType())) {
+ result = rowCount > 0;
+ } else {
+ throw new BindingException("Mapper method '" + command.getName() + "' has an unsupported return type: " + method.getReturnType());
+ }
+ return result;
+ }
+
+ private void executeWithResultHandler(SqlSession sqlSession, Object[] args) {
+ MappedStatement ms = sqlSession.getConfiguration().getMappedStatement(command.getName());
+ if (!StatementType.CALLABLE.equals(ms.getStatementType())
+ && void.class.equals(ms.getResultMaps().get(0).getType())) {
+ throw new BindingException("method " + command.getName()
+ + " needs either a @ResultMap annotation, a @ResultType annotation,"
+ + " or a resultType attribute in XML so a ResultHandler can be used as a parameter.");
+ }
+ Object param = method.convertArgsToSqlCommandParam(args);
+ if (method.hasRowBounds()) {
+ RowBounds rowBounds = method.extractRowBounds(args);
+ sqlSession.select(command.getName(), param, rowBounds, method.extractResultHandler(args));
+ } else {
+ sqlSession.select(command.getName(), param, method.extractResultHandler(args));
+ }
+ }
+
+ private Object executeForMany(SqlSession sqlSession, Object[] args) {
+ List result;
+ Object param = method.convertArgsToSqlCommandParam(args);
+ if (method.hasRowBounds()) {
+ RowBounds rowBounds = method.extractRowBounds(args);
+ result = sqlSession.selectList(command.getName(), param, rowBounds);
+ } else {
+ result = sqlSession.selectList(command.getName(), param);
+ }
+ // issue #510 Collections & arrays support
+ if (!method.getReturnType().isAssignableFrom(result.getClass())) {
+ if (method.getReturnType().isArray()) {
+ return convertToArray(result);
+ } else {
+ return convertToDeclaredCollection(sqlSession.getConfiguration(), result);
+ }
+ }
+ return result;
+ }
+
+ private Cursor executeForCursor(SqlSession sqlSession, Object[] args) {
+ Cursor result;
+ Object param = method.convertArgsToSqlCommandParam(args);
+ if (method.hasRowBounds()) {
+ RowBounds rowBounds = method.extractRowBounds(args);
+ result = sqlSession.selectCursor(command.getName(), param, rowBounds);
+ } else {
+ result = sqlSession.selectCursor(command.getName(), param);
+ }
+ return result;
+ }
+
+ private Object convertToDeclaredCollection(Configuration config, List list) {
+ Object collection = config.getObjectFactory().create(method.getReturnType());
+ MetaObject metaObject = config.newMetaObject(collection);
+ metaObject.addAll(list);
+ return collection;
+ }
+
+ @SuppressWarnings("unchecked")
+ private Object convertToArray(List list) {
+ Class> arrayComponentType = method.getReturnType().getComponentType();
+ Object array = Array.newInstance(arrayComponentType, list.size());
+ if (arrayComponentType.isPrimitive()) {
+ for (int i = 0; i < list.size(); i++) {
+ Array.set(array, i, list.get(i));
+ }
+ return array;
+ } else {
+ return list.toArray((E[]) array);
+ }
+ }
+
+ private Map executeForMap(SqlSession sqlSession, Object[] args) {
+ Map result;
+ Object param = method.convertArgsToSqlCommandParam(args);
+ if (method.hasRowBounds()) {
+ RowBounds rowBounds = method.extractRowBounds(args);
+ result = sqlSession.selectMap(command.getName(), param, method.getMapKey(), rowBounds);
+ } else {
+ result = sqlSession.selectMap(command.getName(), param, method.getMapKey());
+ }
+ return result;
+ }
+
+ public static class SqlCommand {
+
+ private final String name;
+ private final SqlCommandType type;
+
+ public SqlCommand(Configuration configuration, Class> mapperInterface, Method method) {
+ final String methodName = method.getName();
+ final Class> declaringClass = method.getDeclaringClass();
+ MappedStatement ms = resolveMappedStatement(mapperInterface, methodName, declaringClass,
+ configuration);
+ if (ms == null) {
+ if (method.getAnnotation(Flush.class) != null) {
+ name = null;
+ type = SqlCommandType.FLUSH;
+ } else {
+ throw new BindingException("Invalid bound statement (not found): "
+ + mapperInterface.getName() + "." + methodName);
+ }
+ } else {
+ name = ms.getId();
+ type = ms.getSqlCommandType();
+ if (type == SqlCommandType.UNKNOWN) {
+ throw new BindingException("Unknown execution method for: " + name);
+ }
+ }
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public SqlCommandType getType() {
+ return type;
+ }
+
+ private MappedStatement resolveMappedStatement(Class> mapperInterface, String methodName,
+ Class> declaringClass, Configuration configuration) {
+ String statementId = mapperInterface.getName() + "." + methodName;
+ // 新增逻辑,没找到注入的statement则先注入----------------------------------------------------------------------------------------------------------
+ if(!configuration.hasStatement(statementId)) {
+ String resource = mapperInterface.getName().replace('.', '/') + ".java (best guess)";
+ MapperBuilderAssistant assistant = new MapperBuilderAssistant(configuration, resource);
+ assistant.setCurrentNamespace(mapperInterface.getName());
+ Class> modelClass = extractModelClass(mapperInterface);
+ TableInfo tableInfo = TableInfoHelper.initTableInfo(assistant, modelClass);
+ MethodFactory.getInstance(methodName).inject(assistant,mapperInterface, modelClass,tableInfo);
+ }
+ // -----------------------------------------------------------------------------------------------------------------------------------------------
+ if (configuration.hasStatement(statementId)) {
+ return configuration.getMappedStatement(statementId);
+ } else if (mapperInterface.equals(declaringClass)) {
+ return null;
+ }
+ for (Class> superInterface : mapperInterface.getInterfaces()) {
+ if (declaringClass.isAssignableFrom(superInterface)) {
+ MappedStatement ms = resolveMappedStatement(superInterface, methodName,
+ declaringClass, configuration);
+ if (ms != null) {
+ return ms;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * 提取泛型模型,多泛型的时候请将泛型T放在第一位
+ *
+ * @param mapperClass mapper 接口
+ * @return mapper 泛型
+ */
+ protected Class> extractModelClass(Class> mapperClass) {
+ Type[] types = mapperClass.getGenericInterfaces();
+ ParameterizedType target = null;
+ for (Type type : types) {
+ if (type instanceof ParameterizedType) {
+ Type[] typeArray = ((ParameterizedType) type).getActualTypeArguments();
+ if (ArrayUtils.isNotEmpty(typeArray)) {
+ for (Type t : typeArray) {
+ if (t instanceof TypeVariable || t instanceof WildcardType) {
+ break;
+ } else {
+ target = (ParameterizedType) type;
+ break;
+ }
+ }
+ }
+ break;
+ }
+ }
+ return target == null ? null : (Class>) target.getActualTypeArguments()[0];
+ }
+ }
+
+ public static class MethodSignature {
+
+ private final boolean returnsMany;
+ private final boolean returnsMap;
+ private final boolean returnsVoid;
+ private final boolean returnsCursor;
+ private final boolean returnsOptional;
+ private final Class> returnType;
+ private final String mapKey;
+ private final Integer resultHandlerIndex;
+ private final Integer rowBoundsIndex;
+ private final ParamNameResolver paramNameResolver;
+
+ public MethodSignature(Configuration configuration, Class> mapperInterface, Method method) {
+ Type resolvedReturnType = TypeParameterResolver.resolveReturnType(method, mapperInterface);
+ if (resolvedReturnType instanceof Class>) {
+ this.returnType = (Class>) resolvedReturnType;
+ } else if (resolvedReturnType instanceof ParameterizedType) {
+ this.returnType = (Class>) ((ParameterizedType) resolvedReturnType).getRawType();
+ } else {
+ this.returnType = method.getReturnType();
+ }
+ this.returnsVoid = void.class.equals(this.returnType);
+ this.returnsMany = configuration.getObjectFactory().isCollection(this.returnType) || this.returnType.isArray();
+ this.returnsCursor = Cursor.class.equals(this.returnType);
+ this.returnsOptional = Optional.class.equals(this.returnType);
+ this.mapKey = getMapKey(method);
+ this.returnsMap = this.mapKey != null;
+ this.rowBoundsIndex = getUniqueParamIndex(method, RowBounds.class);
+ this.resultHandlerIndex = getUniqueParamIndex(method, ResultHandler.class);
+ this.paramNameResolver = new ParamNameResolver(configuration, method);
+ }
+
+ public Object convertArgsToSqlCommandParam(Object[] args) {
+ return paramNameResolver.getNamedParams(args);
+ }
+
+ public boolean hasRowBounds() {
+ return rowBoundsIndex != null;
+ }
+
+ public RowBounds extractRowBounds(Object[] args) {
+ return hasRowBounds() ? (RowBounds) args[rowBoundsIndex] : null;
+ }
+
+ public boolean hasResultHandler() {
+ return resultHandlerIndex != null;
+ }
+
+ public ResultHandler extractResultHandler(Object[] args) {
+ return hasResultHandler() ? (ResultHandler) args[resultHandlerIndex] : null;
+ }
+
+ public String getMapKey() {
+ return mapKey;
+ }
+
+ public Class> getReturnType() {
+ return returnType;
+ }
+
+ public boolean returnsMany() {
+ return returnsMany;
+ }
+
+ public boolean returnsMap() {
+ return returnsMap;
+ }
+
+ public boolean returnsVoid() {
+ return returnsVoid;
+ }
+
+ public boolean returnsCursor() {
+ return returnsCursor;
+ }
+
+ /**
+ * return whether return type is {@code java.util.Optional}
+ *
+ * @return return {@code true}, if return type is {@code java.util.Optional}
+ * @since 3.5.0
+ */
+ public boolean returnsOptional() {
+ return returnsOptional;
+ }
+
+ private Integer getUniqueParamIndex(Method method, Class> paramType) {
+ Integer index = null;
+ final Class>[] argTypes = method.getParameterTypes();
+ for (int i = 0; i < argTypes.length; i++) {
+ if (paramType.isAssignableFrom(argTypes[i])) {
+ if (index == null) {
+ index = i;
+ } else {
+ throw new BindingException(method.getName() + " cannot have multiple " + paramType.getSimpleName() + " parameters");
+ }
+ }
+ }
+ return index;
+ }
+
+ private String getMapKey(Method method) {
+ String mapKey = null;
+ if (Map.class.isAssignableFrom(method.getReturnType())) {
+ final MapKey mapKeyAnnotation = method.getAnnotation(MapKey.class);
+ if (mapKeyAnnotation != null) {
+ mapKey = mapKeyAnnotation.value();
+ }
+ }
+ return mapKey;
+ }
+ }
+}
diff --git a/console/src/main/java/com/foreverwin/mesnac/console/mybatis/override/ExtMybatisMapperProxy.java b/console/src/main/java/com/foreverwin/mesnac/console/mybatis/override/ExtMybatisMapperProxy.java
new file mode 100644
index 00000000..61075f40
--- /dev/null
+++ b/console/src/main/java/com/foreverwin/mesnac/console/mybatis/override/ExtMybatisMapperProxy.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2011-2020, hubin (jobob@qq.com).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.foreverwin.mesnac.console.mybatis.override;
+
+import org.apache.ibatis.reflection.ExceptionUtil;
+import org.apache.ibatis.session.SqlSession;
+
+import java.io.Serializable;
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Map;
+
+/**
+ * 替换掉引用
+ *
重写类: org.apache.ibatis.binding.MapperProxy
+ *
+ * @author miemie
+ * @since 2018-06-09
+ */
+public class ExtMybatisMapperProxy implements InvocationHandler, Serializable {
+
+ private static final long serialVersionUID = -6424540398559729838L;
+ private final SqlSession sqlSession;
+ private final Class mapperInterface;
+ private final Map methodCache;
+
+ public ExtMybatisMapperProxy(SqlSession sqlSession, Class mapperInterface, Map methodCache) {
+ this.sqlSession = sqlSession;
+ this.mapperInterface = mapperInterface;
+ this.methodCache = methodCache;
+ }
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ try {
+ if (Object.class.equals(method.getDeclaringClass())) {
+ return method.invoke(this, args);
+ } else if (isDefaultMethod(method)) {
+ return invokeDefaultMethod(proxy, method, args);
+ }
+ } catch (Throwable t) {
+ throw ExceptionUtil.unwrapThrowable(t);
+ }
+ final ExtMybatisMapperMethod mapperMethod = cachedMapperMethod(method);
+ return mapperMethod.execute(sqlSession, args);
+ }
+
+ private ExtMybatisMapperMethod cachedMapperMethod(Method method) {
+ return methodCache.computeIfAbsent(method, k -> new ExtMybatisMapperMethod(mapperInterface, method, sqlSession.getConfiguration()));
+ }
+
+ private Object invokeDefaultMethod(Object proxy, Method method, Object[] args)
+ throws Throwable {
+ final Constructor constructor = MethodHandles.Lookup.class
+ .getDeclaredConstructor(Class.class, int.class);
+ if (!constructor.isAccessible()) {
+ constructor.setAccessible(true);
+ }
+ final Class> declaringClass = method.getDeclaringClass();
+ return constructor
+ .newInstance(declaringClass,
+ MethodHandles.Lookup.PRIVATE | MethodHandles.Lookup.PROTECTED
+ | MethodHandles.Lookup.PACKAGE | MethodHandles.Lookup.PUBLIC)
+ .unreflectSpecial(method, declaringClass).bindTo(proxy).invokeWithArguments(args);
+ }
+
+ /**
+ * Backport of java.lang.reflect.Method#isDefault()
+ */
+ private boolean isDefaultMethod(Method method) {
+ return (method.getModifiers()
+ & (Modifier.ABSTRACT | Modifier.PUBLIC | Modifier.STATIC)) == Modifier.PUBLIC
+ && method.getDeclaringClass().isInterface();
+ }
+}
diff --git a/console/src/main/java/com/foreverwin/mesnac/console/mybatis/override/ExtMybatisMapperProxyFactory.java b/console/src/main/java/com/foreverwin/mesnac/console/mybatis/override/ExtMybatisMapperProxyFactory.java
new file mode 100644
index 00000000..f0e2a586
--- /dev/null
+++ b/console/src/main/java/com/foreverwin/mesnac/console/mybatis/override/ExtMybatisMapperProxyFactory.java
@@ -0,0 +1,43 @@
+package com.foreverwin.mesnac.console.mybatis.override;
+
+import com.baomidou.mybatisplus.core.override.MybatisMapperMethod;
+import org.apache.ibatis.session.SqlSession;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ *
+ * @description:
+ * @author: syngna
+ * @create: 2021-04-16 17:34
+ */
+public class ExtMybatisMapperProxyFactory {
+
+ private final Class mapperInterface;
+
+ private final Map methodCache = new ConcurrentHashMap<>();
+
+ public ExtMybatisMapperProxyFactory(Class mapperInterface) {
+ this.mapperInterface = mapperInterface;
+ }
+
+ public Class getMapperInterface() {
+ return mapperInterface;
+ }
+
+ public Map getMethodCache() {
+ return methodCache;
+ }
+
+ protected T newInstance(ExtMybatisMapperProxy mapperProxy) {
+ return (T) Proxy.newProxyInstance(mapperInterface.getClassLoader(), new Class[]{mapperInterface}, mapperProxy);
+ }
+
+ public T newInstance(SqlSession sqlSession) {
+ final ExtMybatisMapperProxy mapperProxy = new ExtMybatisMapperProxy(sqlSession, mapperInterface, methodCache);
+ return newInstance(mapperProxy);
+ }
+}
\ No newline at end of file
diff --git a/console/src/main/java/com/foreverwin/mesnac/console/mybatis/override/MethodFactory.java b/console/src/main/java/com/foreverwin/mesnac/console/mybatis/override/MethodFactory.java
new file mode 100644
index 00000000..179769bd
--- /dev/null
+++ b/console/src/main/java/com/foreverwin/mesnac/console/mybatis/override/MethodFactory.java
@@ -0,0 +1,53 @@
+package com.foreverwin.mesnac.console.mybatis.override;
+
+import com.baomidou.mybatisplus.core.injector.AbstractMethod;
+import com.baomidou.mybatisplus.core.injector.methods.Insert;
+import com.baomidou.mybatisplus.extension.injector.methods.*;
+
+/**
+ *
+ * @description:
+ * @author: syngna
+ * @create: 2021-04-18 17:14
+ */
+public class MethodFactory {
+
+ public static AbstractMethod getInstance(String methodName) {
+ if("insert".equals(methodName)) {
+ return new Insert();
+ } else if("delete".equals(methodName)) {
+ return new LogicDelete();
+ } else if("deleteByMap".equals(methodName)) {
+ return new LogicDeleteByMap();
+ } else if("deleteById".equals(methodName)) {
+ return new LogicDeleteById();
+ } else if("deleteBatchByIds".equals(methodName)) {
+ return new LogicDeleteBatchByIds();
+ } else if("update".equals(methodName)) {
+ return new LogicUpdate();
+ } else if("updateById".equals(methodName)) {
+ return new LogicUpdateById();
+ } else if("selectById".equals(methodName)) {
+ return new LogicSelectById();
+ } else if("selectBatchByIds".equals(methodName)) {
+ return new LogicSelectBatchByIds();
+ } else if("selectByMap".equals(methodName)) {
+ return new LogicSelectByMap();
+ } else if("selectOne".equals(methodName)) {
+ return new LogicSelectOne();
+ } else if("selectCount".equals(methodName)) {
+ return new LogicSelectCount();
+ } else if("selectMaps".equals(methodName)) {
+ return new LogicSelectMaps();
+ } else if("selectMapsPage".equals(methodName)) {
+ return new LogicSelectMapsPage();
+ } else if("selectObjs".equals(methodName)) {
+ return new LogicSelectObjs();
+ } else if("selectList".equals(methodName)) {
+ return new LogicSelectList();
+ } else if("selectPage".equals(methodName)) {
+ return new LogicSelectPage();
+ }
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/console/src/main/resources/application.yml b/console/src/main/resources/application.yml
index 0df95698..43014bd5 100644
--- a/console/src/main/resources/application.yml
+++ b/console/src/main/resources/application.yml
@@ -54,6 +54,7 @@ mybatis-plus:
typeAliasesPackage: com.foreverwin.**.model
# 配置mapper的扫描,找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
+ statement-lazy-load: false
#dialectClass: com.foreverwin.modular.core.mybatisplus.plugins.pagination.dialects.HanaDialect
# 加载全局的配置文件
# configuration:
diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/SfcDispatchController.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/SfcDispatchController.java
index 4e65163d..d19f6da2 100644
--- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/SfcDispatchController.java
+++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/SfcDispatchController.java
@@ -1,5 +1,6 @@
package com.foreverwin.mesnac.dispatch.controller;
+import com.foreverwin.mesnac.dispatch.model.ShopOrderRelease;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
@@ -26,15 +27,31 @@ public class SfcDispatchController {
public SfcDispatchService sfcDispatchService;
+ @ResponseBody
+ @GetMapping("getSfcDispatch")
+ public R getSfcDispatch() {
+ List list;
+ try {
+ ShopOrderRelease shopOrderRelease = new ShopOrderRelease();
+ shopOrderRelease.setSite(CommonMethods.getSite());
+
+ list = sfcDispatchService.findSfcDispatchList(shopOrderRelease);
+ } catch (Exception e) {
+ return R.failed(e.getMessage());
+ }
+
+ return R.ok(list);
+ }
+
@ResponseBody
@PostMapping("querySfcDispatch")
- public R querySfcDispatch(@RequestBody SfcDispatch sfcDispatch) {
- List list = null;
+ public R querySfcDispatch(@RequestBody ShopOrderRelease shopOrderRelease) {
+ List list;
try {
- sfcDispatch.setSite(CommonMethods.getSite());
+ shopOrderRelease.setSite(CommonMethods.getSite());
- list = sfcDispatchService.selectList(sfcDispatch);
+ list = sfcDispatchService.findSfcDispatchList(shopOrderRelease);
} catch (Exception e) {
return R.failed(e.getMessage());
}
@@ -91,8 +108,8 @@ public class SfcDispatchController {
.or().like(SfcDispatch::getWorkCenter, frontPage.getGlobalQuery())
.or().like(SfcDispatch::getResrce, frontPage.getGlobalQuery())
.or().like(SfcDispatch::getEmployee, frontPage.getGlobalQuery())
- .or().like(SfcDispatch::getTurnOrder, frontPage.getGlobalQuery())
- .or().like(SfcDispatch::getIsAllot, frontPage.getGlobalQuery())
+ .or().like(SfcDispatch::getTurnOperation, frontPage.getGlobalQuery())
+ .or().like(SfcDispatch::getIsDispatch, frontPage.getGlobalQuery())
.or().like(SfcDispatch::getIsImport, frontPage.getGlobalQuery())
.or().like(SfcDispatch::getRemark, frontPage.getGlobalQuery())
.or().like(SfcDispatch::getCreateUser, frontPage.getGlobalQuery())
diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/SfcDispatchMapper.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/SfcDispatchMapper.java
index a6ec0e1c..bb18d8bd 100644
--- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/SfcDispatchMapper.java
+++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/SfcDispatchMapper.java
@@ -2,6 +2,7 @@ package com.foreverwin.mesnac.dispatch.mapper;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.foreverwin.mesnac.dispatch.model.ShopOrderRelease;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@@ -19,4 +20,6 @@ import java.util.List;
public interface SfcDispatchMapper extends BaseMapper {
List findSfcDispatch(@Param("site") String site, @Param("sfc") String sfc, @Param("operation") String operation, @Param("stepId") String stepId);
+
+ List findSfcDispatchList(ShopOrderRelease shopOrderRelease);
}
\ No newline at end of file
diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/model/SfcDispatch.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/model/SfcDispatch.java
index 2ad287f9..dbaac69a 100644
--- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/model/SfcDispatch.java
+++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/model/SfcDispatch.java
@@ -16,10 +16,11 @@ import com.baomidou.mybatisplus.annotation.IdType;
*
*
* @author Leon.L
- * @since 2021-06-02
+ * @since 2021-06-04
*/
@TableName("Z_SFC_DISPATCH")
+
public class SfcDispatch extends Model {
private static final long serialVersionUID = 1L;
@@ -58,7 +59,7 @@ public class SfcDispatch extends Model {
* 派工序号
*/
@TableField("DISPATCH_SEQ")
- private Double dispatchSeq;
+ private String dispatchSeq;
/**
* 派工单号
*/
@@ -122,8 +123,8 @@ public class SfcDispatch extends Model {
/**
* 是否已经转序
*/
- @TableField("TURN_ORDER")
- private String turnOrder;
+ @TableField("TURN_OPERATION")
+ private String turnOperation;
/**
* 派工数量
*/
@@ -169,6 +170,11 @@ public class SfcDispatch extends Model {
*/
@TableField("RELEASED_COMPLETE_DATE")
private LocalDateTime releasedCompleteDate;
+ /**
+ * 实际开始时间
+ */
+ @TableField("ACTUAL_START_DATE")
+ private LocalDateTime actualStartDate;
/**
* 实际完成时间
*/
@@ -177,8 +183,8 @@ public class SfcDispatch extends Model {
/**
* 是否已经分配资源
*/
- @TableField("IS_ALLOT")
- private String isAllot;
+ @TableField("IS_DISPATCH")
+ private String isDispatch;
/**
* 是否导入
*/
@@ -189,9 +195,9 @@ public class SfcDispatch extends Model {
*/
@TableField("REMARK")
private String remark;
- /**
- * 备注
- */
+ /**
+ * 是否首工序
+ */
@TableField("IS_FIRST_OPERATION")
private String isFirstOperation;
/**
@@ -274,11 +280,11 @@ public class SfcDispatch extends Model {
this.isMajor = isMajor;
}
- public Double getDispatchSeq() {
+ public String getDispatchSeq() {
return dispatchSeq;
}
- public void setDispatchSeq(Double dispatchSeq) {
+ public void setDispatchSeq(String dispatchSeq) {
this.dispatchSeq = dispatchSeq;
}
@@ -378,12 +384,12 @@ public class SfcDispatch extends Model {
this.employee = employee;
}
- public String getTurnOrder() {
- return turnOrder;
+ public String getTurnOperation() {
+ return turnOperation;
}
- public void setTurnOrder(String turnOrder) {
- this.turnOrder = turnOrder;
+ public void setTurnOperation(String turnOperation) {
+ this.turnOperation = turnOperation;
}
public Double getDispatchQty() {
@@ -458,6 +464,14 @@ public class SfcDispatch extends Model {
this.releasedCompleteDate = releasedCompleteDate;
}
+ public LocalDateTime getActualStartDate() {
+ return actualStartDate;
+ }
+
+ public void setActualStartDate(LocalDateTime actualStartDate) {
+ this.actualStartDate = actualStartDate;
+ }
+
public LocalDateTime getActualCompleteDate() {
return actualCompleteDate;
}
@@ -466,12 +480,12 @@ public class SfcDispatch extends Model {
this.actualCompleteDate = actualCompleteDate;
}
- public String getIsAllot() {
- return isAllot;
+ public String getIsDispatch() {
+ return isDispatch;
}
- public void setIsAllot(String isAllot) {
- this.isAllot = isAllot;
+ public void setIsDispatch(String isDispatch) {
+ this.isDispatch = isDispatch;
}
public String getIsImport() {
@@ -570,89 +584,93 @@ public class SfcDispatch extends Model {
this.other5 = other5;
}
-public static final String HANDLE = "HANDLE";
+ public static final String HANDLE = "HANDLE";
+
+ public static final String SITE = "SITE";
+
+ public static final String SHOP_ORDER = "SHOP_ORDER";
-public static final String SITE = "SITE";
+ public static final String WORK_ORDER = "WORK_ORDER";
-public static final String SHOP_ORDER = "SHOP_ORDER";
+ public static final String SFC = "SFC";
-public static final String WORK_ORDER = "WORK_ORDER";
+ public static final String IS_MAJOR = "IS_MAJOR";
-public static final String SFC = "SFC";
+ public static final String DISPATCH_SEQ = "DISPATCH_SEQ";
-public static final String IS_MAJOR = "IS_MAJOR";
+ public static final String DISPATCH_NO = "DISPATCH_NO";
-public static final String DISPATCH_SEQ = "DISPATCH_SEQ";
+ public static final String DISPATCH_STATUS = "DISPATCH_STATUS";
-public static final String DISPATCH_NO = "DISPATCH_NO";
+ public static final String DRAWINGS_NO = "DRAWINGS_NO";
-public static final String DISPATCH_STATUS = "DISPATCH_STATUS";
+ public static final String DRAWINGS_REVISION = "DRAWINGS_REVISION";
-public static final String DRAWINGS_NO = "DRAWINGS_NO";
+ public static final String IS_LOCK = "IS_LOCK";
-public static final String DRAWINGS_REVISION = "DRAWINGS_REVISION";
+ public static final String ROUTER_BO = "ROUTER_BO";
-public static final String IS_LOCK = "IS_LOCK";
+ public static final String STEP_ID = "STEP_ID";
-public static final String ROUTER_BO = "ROUTER_BO";
+ public static final String OPERATION = "OPERATION";
-public static final String STEP_ID = "STEP_ID";
+ public static final String RESOURCE_TYPE = "RESOURCE_TYPE";
-public static final String OPERATION = "OPERATION";
+ public static final String WORK_CENTER = "WORK_CENTER";
-public static final String RESOURCE_TYPE = "RESOURCE_TYPE";
+ public static final String RESRCE = "RESRCE";
-public static final String WORK_CENTER = "WORK_CENTER";
+ public static final String EMPLOYEE = "EMPLOYEE";
-public static final String RESRCE = "RESRCE";
+ public static final String TURN_OPERATION = "TURN_OPERATION";
-public static final String EMPLOYEE = "EMPLOYEE";
+ public static final String DISPATCH_QTY = "DISPATCH_QTY";
-public static final String TURN_ORDER = "TURN_ORDER";
+ public static final String PROD_HOURS = "PROD_HOURS";
-public static final String DISPATCH_QTY = "DISPATCH_QTY";
+ public static final String PLANNED_START_DATE = "PLANNED_START_DATE";
-public static final String PROD_HOURS = "PROD_HOURS";
+ public static final String PLANNED_COMPLETE_DATE = "PLANNED_COMPLETE_DATE";
-public static final String PLANNED_START_DATE = "PLANNED_START_DATE";
+ public static final String EARLIEST_START_DATE = "EARLIEST_START_DATE";
-public static final String PLANNED_COMPLETE_DATE = "PLANNED_COMPLETE_DATE";
+ public static final String LATEST_END_DATE = "LATEST_END_DATE";
-public static final String EARLIEST_START_DATE = "EARLIEST_START_DATE";
+ public static final String SO_RELEASED_DATE = "SO_RELEASED_DATE";
-public static final String LATEST_END_DATE = "LATEST_END_DATE";
+ public static final String SFC_RELEASED_DATE = "SFC_RELEASED_DATE";
-public static final String SO_RELEASED_DATE = "SO_RELEASED_DATE";
+ public static final String RELEASED_COMPLETE_DATE = "RELEASED_COMPLETE_DATE";
-public static final String SFC_RELEASED_DATE = "SFC_RELEASED_DATE";
+ public static final String ACTUAL_START_DATE = "ACTUAL_START_DATE";
-public static final String RELEASED_COMPLETE_DATE = "RELEASED_COMPLETE_DATE";
+ public static final String ACTUAL_COMPLETE_DATE = "ACTUAL_COMPLETE_DATE";
-public static final String ACTUAL_COMPLETE_DATE = "ACTUAL_COMPLETE_DATE";
+ public static final String IS_DISPATCH = "IS_DISPATCH";
-public static final String IS_ALLOT = "IS_ALLOT";
+ public static final String IS_IMPORT = "IS_IMPORT";
-public static final String IS_IMPORT = "IS_IMPORT";
+ public static final String REMARK = "REMARK";
-public static final String REMARK = "REMARK";
+ public static final String IS_FIRST_OPERATION = "IS_FIRST_OPERATION";
-public static final String CREATE_USER = "CREATE_USER";
+ public static final String CREATE_USER = "CREATE_USER";
-public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
+ public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
-public static final String MODIFY_USER = "MODIFY_USER";
+ public static final String MODIFY_USER = "MODIFY_USER";
-public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
+ public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
-public static final String OTHER_1 = "OTHER_1";
+ public static final String OTHER_1 = "OTHER_1";
-public static final String OTHER_2 = "OTHER_2";
+ public static final String OTHER_2 = "OTHER_2";
-public static final String OTHER_3 = "OTHER_3";
+ public static final String OTHER_3 = "OTHER_3";
-public static final String OTHER_4 = "OTHER_4";
+ public static final String OTHER_4 = "OTHER_4";
-public static final String OTHER_5 = "OTHER_5";
+ public static final String OTHER_5 = "OTHER_5";
@Override
@@ -682,7 +700,7 @@ public static final String OTHER_5 = "OTHER_5";
", workCenter = " + workCenter +
", resrce = " + resrce +
", employee = " + employee +
- ", turnOrder = " + turnOrder +
+ ", turnOperation = " + turnOperation +
", dispatchQty = " + dispatchQty +
", prodHours = " + prodHours +
", plannedStartDate = " + plannedStartDate +
@@ -692,10 +710,12 @@ public static final String OTHER_5 = "OTHER_5";
", soReleasedDate = " + soReleasedDate +
", sfcReleasedDate = " + sfcReleasedDate +
", releasedCompleteDate = " + releasedCompleteDate +
+ ", actualStartDate = " + actualStartDate +
", actualCompleteDate = " + actualCompleteDate +
- ", isAllot = " + isAllot +
+ ", isDispatch = " + isDispatch +
", isImport = " + isImport +
", remark = " + remark +
+ ", isFirstOperation = " + isFirstOperation +
", createUser = " + createUser +
", createdDateTime = " + createdDateTime +
", modifyUser = " + modifyUser +
diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/model/ShopOrderRelease.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/model/ShopOrderRelease.java
index 47705bc9..bb3b65b9 100644
--- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/model/ShopOrderRelease.java
+++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/model/ShopOrderRelease.java
@@ -31,6 +31,9 @@ public class ShopOrderRelease extends SfcDispatch {
private String category;
private String status;
private String comments;
+ private String component;
+ private String componentDescription;
+ private String isCompleted;
private LocalDateTime plannedStartDate;
private LocalDateTime plannedCompDate;
@@ -136,6 +139,30 @@ public class ShopOrderRelease extends SfcDispatch {
this.dispatchCompleteDate = dispatchCompleteDate;
}
+ public String getComponent() {
+ return component;
+ }
+
+ public void setComponent(String component) {
+ this.component = component;
+ }
+
+ public String getComponentDescription() {
+ return componentDescription;
+ }
+
+ public void setComponentDescription(String componentDescription) {
+ this.componentDescription = componentDescription;
+ }
+
+ public String getIsCompleted() {
+ return isCompleted;
+ }
+
+ public void setIsCompleted(String isCompleted) {
+ this.isCompleted = isCompleted;
+ }
+
public Date getStartFromDate() {
return startFromDate;
}
diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/SfcDispatchService.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/SfcDispatchService.java
index 57de6579..351d8739 100644
--- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/SfcDispatchService.java
+++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/SfcDispatchService.java
@@ -3,6 +3,7 @@ package com.foreverwin.mesnac.dispatch.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import com.baomidou.mybatisplus.extension.service.IService;
+import com.foreverwin.mesnac.dispatch.model.ShopOrderRelease;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
@@ -36,4 +37,12 @@ public interface SfcDispatchService extends IService {
* @return
*/
List findSfcDispatch(String site, String sfc, String operation, String stepId);
+
+ /**
+ * 查询派工清单
+ *
+ * @param shopOrderRelease
+ * @return
+ */
+ List findSfcDispatchList(ShopOrderRelease shopOrderRelease);
}
\ No newline at end of file
diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java
index 5a708760..19992e15 100644
--- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java
+++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java
@@ -1,5 +1,6 @@
package com.foreverwin.mesnac.dispatch.service.impl;
+import com.foreverwin.mesnac.dispatch.model.ShopOrderRelease;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -47,5 +48,10 @@ public class SfcDispatchServiceImpl extends ServiceImpl findSfcDispatchList(ShopOrderRelease shopOrderRelease) {
+ return sfcDispatchMapper.findSfcDispatchList(shopOrderRelease);
+ }
+
}
\ No newline at end of file
diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/ShopOrderReleaseServiceImpl.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/ShopOrderReleaseServiceImpl.java
index 325d8a52..0b5ff244 100644
--- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/ShopOrderReleaseServiceImpl.java
+++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/ShopOrderReleaseServiceImpl.java
@@ -227,7 +227,7 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
sfcDispatchModel.setSfc(sfc);
sfcDispatchModel.setWorkOrder("");
sfcDispatchModel.setIsMajor("");
- sfcDispatchModel.setDispatchSeq(new Double(m+1));
+ sfcDispatchModel.setDispatchSeq((m + 1)+"");
sfcDispatchModel.setDispatchNo(dispatchNo);
sfcDispatchModel.setDispatchStatus(Constants.STATUS_NEW);
sfcDispatchModel.setDrawingsNo("");
@@ -243,7 +243,7 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
//sfcDispatchModel.setPlannedStartDate(plannedStartDate);
//sfcDispatchModel.setPlannedCompleteDate(plannedCompleteDate);
sfcDispatchModel.setSoReleasedDate(nowDate);
- sfcDispatchModel.setIsAllot(Constants.BOOL_FALSE);
+ sfcDispatchModel.setIsDispatch(Constants.BOOL_FALSE);
sfcDispatchModel.setIsImport(Constants.BOOL_FALSE);
sfcDispatchModel.setIsFirstOperation(isFirstOperation);
sfcDispatchModel.setCreateUser(user);
@@ -410,7 +410,7 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
sfcDispatchModel.setSfc(sfc);
sfcDispatchModel.setWorkOrder("");
sfcDispatchModel.setIsMajor("");
- sfcDispatchModel.setDispatchSeq(new Double(m + 1));
+ sfcDispatchModel.setDispatchSeq((m + 1)+"");
sfcDispatchModel.setDispatchNo(dispatchNo);
sfcDispatchModel.setDispatchStatus(Constants.STATUS_NEW);
sfcDispatchModel.setDrawingsNo("");
@@ -426,7 +426,7 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
//sfcDispatchModel.setPlannedStartDate(plannedStartDate);
//sfcDispatchModel.setPlannedCompleteDate(plannedCompleteDate);
sfcDispatchModel.setSoReleasedDate(nowDate);
- sfcDispatchModel.setIsAllot(Constants.BOOL_FALSE);
+ sfcDispatchModel.setIsDispatch(Constants.BOOL_FALSE);
sfcDispatchModel.setIsImport(Constants.BOOL_FALSE);
sfcDispatchModel.setCreateUser(user);
sfcDispatchModel.setCreatedDateTime(nowDate);
@@ -436,7 +436,7 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
} else {
//已经存在的更新
SfcDispatch sfcDispatchModel = list.get(0);
- sfcDispatchModel.setDispatchSeq(new Double(m + 1));
+ sfcDispatchModel.setDispatchSeq((m + 1)+"");
sfcDispatchModel.setModifyUser(user);
sfcDispatchModel.setModifiedDateTime(nowDate);
updateSfcDispatchList.add(sfcDispatchModel);
diff --git a/dispatch/src/main/resources/mapper/SfcDispatchMapper.xml b/dispatch/src/main/resources/mapper/SfcDispatchMapper.xml
index bbed1921..c631f005 100644
--- a/dispatch/src/main/resources/mapper/SfcDispatchMapper.xml
+++ b/dispatch/src/main/resources/mapper/SfcDispatchMapper.xml
@@ -23,7 +23,7 @@
-
+
@@ -33,8 +33,9 @@
+
-
+
@@ -49,9 +50,17 @@
+
+
+
+
+
+
+
+
- HANDLE, SITE, SHOP_ORDER, WORK_ORDER, SFC, IS_MAJOR, DISPATCH_SEQ, DISPATCH_NO, DISPATCH_STATUS, DRAWINGS_NO, DRAWINGS_REVISION, IS_LOCK, ROUTER_BO, STEP_ID, OPERATION, RESOURCE_TYPE, WORK_CENTER, RESRCE, EMPLOYEE, TURN_ORDER, DISPATCH_QTY, PROD_HOURS, PLANNED_START_DATE, PLANNED_COMPLETE_DATE, EARLIEST_START_DATE, LATEST_END_DATE, SO_RELEASED_DATE, SFC_RELEASED_DATE, RELEASED_COMPLETE_DATE, ACTUAL_COMPLETE_DATE, IS_ALLOT, IS_IMPORT, REMARK, IS_FIRST_OPERATION, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME, OTHER_1, OTHER_2, OTHER_3, OTHER_4, OTHER_5
+ HANDLE, SITE, SHOP_ORDER, WORK_ORDER, SFC, IS_MAJOR, DISPATCH_SEQ, DISPATCH_NO, DISPATCH_STATUS, DRAWINGS_NO, DRAWINGS_REVISION, IS_LOCK, ROUTER_BO, STEP_ID, OPERATION, RESOURCE_TYPE, WORK_CENTER, RESRCE, EMPLOYEE, TURN_OPERATION, DISPATCH_QTY, PROD_HOURS, PLANNED_START_DATE, PLANNED_COMPLETE_DATE, EARLIEST_START_DATE, LATEST_END_DATE, SO_RELEASED_DATE, SFC_RELEASED_DATE, RELEASED_COMPLETE_DATE, ACTUAL_START_DATE, ACTUAL_COMPLETE_DATE, IS_DISPATCH, IS_IMPORT, REMARK, IS_FIRST_OPERATION, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME, OTHER_1, OTHER_2, OTHER_3, OTHER_4, OTHER_5
@@ -104,7 +113,7 @@
AND WORK_CENTER=#{ew.entity.workCenter} AND RESRCE=#{ew.entity.resrce} AND EMPLOYEE=#{ew.entity.employee}
- AND TURN_ORDER=#{ew.entity.turnOrder}
+ AND TURN_OPERATION=#{ew.entity.turnOperation} AND DISPATCH_QTY=#{ew.entity.dispatchQty} AND PROD_HOURS=#{ew.entity.prodHours} AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}
@@ -114,8 +123,9 @@
AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate} AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate} AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}
+ AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
- AND IS_ALLOT=#{ew.entity.isAllot}
+ AND IS_DISPATCH=#{ew.entity.isDispatch} AND IS_IMPORT=#{ew.entity.isImport} AND REMARK=#{ew.entity.remark} AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}
@@ -157,7 +167,7 @@
AND WORK_CENTER=#{ew.entity.workCenter} AND RESRCE=#{ew.entity.resrce} AND EMPLOYEE=#{ew.entity.employee}
- AND TURN_ORDER=#{ew.entity.turnOrder}
+ AND TURN_OPERATION=#{ew.entity.turnOperation} AND DISPATCH_QTY=#{ew.entity.dispatchQty} AND PROD_HOURS=#{ew.entity.prodHours} AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}
@@ -167,8 +177,9 @@
AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate} AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate} AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}
+ AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
- AND IS_ALLOT=#{ew.entity.isAllot}
+ AND IS_DISPATCH=#{ew.entity.isDispatch} AND IS_IMPORT=#{ew.entity.isImport} AND REMARK=#{ew.entity.remark} AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}
@@ -218,7 +229,7 @@
AND WORK_CENTER=#{ew.entity.workCenter} AND RESRCE=#{ew.entity.resrce} AND EMPLOYEE=#{ew.entity.employee}
- AND TURN_ORDER=#{ew.entity.turnOrder}
+ AND TURN_OPERATION=#{ew.entity.turnOperation} AND DISPATCH_QTY=#{ew.entity.dispatchQty} AND PROD_HOURS=#{ew.entity.prodHours} AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}
@@ -228,8 +239,9 @@
AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate} AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate} AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}
+ AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
- AND IS_ALLOT=#{ew.entity.isAllot}
+ AND IS_DISPATCH=#{ew.entity.isDispatch} AND IS_IMPORT=#{ew.entity.isImport} AND REMARK=#{ew.entity.remark} AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}
@@ -279,7 +291,7 @@
AND WORK_CENTER=#{ew.entity.workCenter} AND RESRCE=#{ew.entity.resrce} AND EMPLOYEE=#{ew.entity.employee}
- AND TURN_ORDER=#{ew.entity.turnOrder}
+ AND TURN_OPERATION=#{ew.entity.turnOperation} AND DISPATCH_QTY=#{ew.entity.dispatchQty} AND PROD_HOURS=#{ew.entity.prodHours} AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}
@@ -289,8 +301,9 @@
AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate} AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate} AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}
+ AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
- AND IS_ALLOT=#{ew.entity.isAllot}
+ AND IS_DISPATCH=#{ew.entity.isDispatch} AND IS_IMPORT=#{ew.entity.isImport} AND REMARK=#{ew.entity.remark} AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}
@@ -340,7 +353,7 @@
AND WORK_CENTER=#{ew.entity.workCenter} AND RESRCE=#{ew.entity.resrce} AND EMPLOYEE=#{ew.entity.employee}
- AND TURN_ORDER=#{ew.entity.turnOrder}
+ AND TURN_OPERATION=#{ew.entity.turnOperation} AND DISPATCH_QTY=#{ew.entity.dispatchQty} AND PROD_HOURS=#{ew.entity.prodHours} AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}
@@ -350,8 +363,9 @@
AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate} AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate} AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}
+ AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
- AND IS_ALLOT=#{ew.entity.isAllot}
+ AND IS_DISPATCH=#{ew.entity.isDispatch} AND IS_IMPORT=#{ew.entity.isImport} AND REMARK=#{ew.entity.remark} AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}
@@ -401,7 +415,7 @@
AND WORK_CENTER=#{ew.entity.workCenter} AND RESRCE=#{ew.entity.resrce} AND EMPLOYEE=#{ew.entity.employee}
- AND TURN_ORDER=#{ew.entity.turnOrder}
+ AND TURN_OPERATION=#{ew.entity.turnOperation} AND DISPATCH_QTY=#{ew.entity.dispatchQty} AND PROD_HOURS=#{ew.entity.prodHours} AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}
@@ -411,8 +425,9 @@
AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate} AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate} AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}
+ AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
- AND IS_ALLOT=#{ew.entity.isAllot}
+ AND IS_DISPATCH=#{ew.entity.isDispatch} AND IS_IMPORT=#{ew.entity.isImport} AND REMARK=#{ew.entity.remark} AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}
@@ -462,7 +477,7 @@
AND WORK_CENTER=#{ew.entity.workCenter} AND RESRCE=#{ew.entity.resrce} AND EMPLOYEE=#{ew.entity.employee}
- AND TURN_ORDER=#{ew.entity.turnOrder}
+ AND TURN_OPERATION=#{ew.entity.turnOperation} AND DISPATCH_QTY=#{ew.entity.dispatchQty} AND PROD_HOURS=#{ew.entity.prodHours} AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}
@@ -472,8 +487,9 @@
AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate} AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate} AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}
+ AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
- AND IS_ALLOT=#{ew.entity.isAllot}
+ AND IS_DISPATCH=#{ew.entity.isDispatch} AND IS_IMPORT=#{ew.entity.isImport} AND REMARK=#{ew.entity.remark} AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}
@@ -519,7 +535,7 @@
WORK_CENTER,RESRCE,EMPLOYEE,
- TURN_ORDER,
+ TURN_OPERATION,DISPATCH_QTY,PROD_HOURS,PLANNED_START_DATE,
@@ -529,8 +545,9 @@
SO_RELEASED_DATE,SFC_RELEASED_DATE,RELEASED_COMPLETE_DATE,
+ ACTUAL_START_DATE,ACTUAL_COMPLETE_DATE,
- IS_ALLOT,
+ IS_DISPATCH,IS_IMPORT,REMARK,IS_FIRST_OPERATION,
@@ -564,7 +581,7 @@
#{workCenter},#{resrce},#{employee},
- #{turnOrder},
+ #{turnOperation},#{dispatchQty},#{prodHours},#{plannedStartDate},
@@ -574,8 +591,9 @@
#{soReleasedDate},#{sfcReleasedDate},#{releasedCompleteDate},
+ #{actualStartDate},#{actualCompleteDate},
- #{isAllot},
+ #{isDispatch},#{isImport},#{remark},#{isFirstOperation},
@@ -616,7 +634,7 @@
#{workCenter},
#{resrce},
#{employee},
- #{turnOrder},
+ #{turnOperation},
#{dispatchQty},
#{prodHours},
#{plannedStartDate},
@@ -626,8 +644,9 @@
#{soReleasedDate},
#{sfcReleasedDate},
#{releasedCompleteDate},
+ #{actualStartDate},
#{actualCompleteDate},
- #{isAllot},
+ #{isDispatch},
#{isImport},
#{remark},
#{isFirstOperation},
@@ -664,7 +683,7 @@
WORK_CENTER=#{et.workCenter},RESRCE=#{et.resrce},EMPLOYEE=#{et.employee},
- TURN_ORDER=#{et.turnOrder},
+ TURN_OPERATION=#{et.turnOperation},DISPATCH_QTY=#{et.dispatchQty},PROD_HOURS=#{et.prodHours},PLANNED_START_DATE=#{et.plannedStartDate},
@@ -674,8 +693,9 @@
SO_RELEASED_DATE=#{et.soReleasedDate},SFC_RELEASED_DATE=#{et.sfcReleasedDate},RELEASED_COMPLETE_DATE=#{et.releasedCompleteDate},
+ ACTUAL_START_DATE=#{et.actualStartDate},ACTUAL_COMPLETE_DATE=#{et.actualCompleteDate},
- IS_ALLOT=#{et.isAllot},
+ IS_DISPATCH=#{et.isDispatch},IS_IMPORT=#{et.isImport},REMARK=#{et.remark},IS_FIRST_OPERATION=#{et.isFirstOperation},
@@ -712,7 +732,7 @@
WORK_CENTER=#{et.workCenter},
RESRCE=#{et.resrce},
EMPLOYEE=#{et.employee},
- TURN_ORDER=#{et.turnOrder},
+ TURN_OPERATION=#{et.turnOperation},
DISPATCH_QTY=#{et.dispatchQty},
PROD_HOURS=#{et.prodHours},
PLANNED_START_DATE=#{et.plannedStartDate},
@@ -722,8 +742,9 @@
SO_RELEASED_DATE=#{et.soReleasedDate},
SFC_RELEASED_DATE=#{et.sfcReleasedDate},
RELEASED_COMPLETE_DATE=#{et.releasedCompleteDate},
+ ACTUAL_START_DATE=#{et.actualStartDate},
ACTUAL_COMPLETE_DATE=#{et.actualCompleteDate},
- IS_ALLOT=#{et.isAllot},
+ IS_DISPATCH=#{et.isDispatch},
IS_IMPORT=#{et.isImport},
REMARK=#{et.remark},
IS_FIRST_OPERATION=#{et.isFirstOperation},
@@ -760,7 +781,7 @@
WORK_CENTER=#{et.workCenter},RESRCE=#{et.resrce},EMPLOYEE=#{et.employee},
- TURN_ORDER=#{et.turnOrder},
+ TURN_OPERATION=#{et.turnOperation},DISPATCH_QTY=#{et.dispatchQty},PROD_HOURS=#{et.prodHours},PLANNED_START_DATE=#{et.plannedStartDate},
@@ -770,8 +791,9 @@
SO_RELEASED_DATE=#{et.soReleasedDate},SFC_RELEASED_DATE=#{et.sfcReleasedDate},RELEASED_COMPLETE_DATE=#{et.releasedCompleteDate},
+ ACTUAL_START_DATE=#{et.actualStartDate},ACTUAL_COMPLETE_DATE=#{et.actualCompleteDate},
- IS_ALLOT=#{et.isAllot},
+ IS_DISPATCH=#{et.isDispatch},IS_IMPORT=#{et.isImport},REMARK=#{et.remark},IS_FIRST_OPERATION=#{et.isFirstOperation},
@@ -807,7 +829,7 @@
AND WORK_CENTER=#{ew.entity.workCenter} AND RESRCE=#{ew.entity.resrce} AND EMPLOYEE=#{ew.entity.employee}
- AND TURN_ORDER=#{ew.entity.turnOrder}
+ AND TURN_OPERATION=#{ew.entity.turnOperation} AND DISPATCH_QTY=#{ew.entity.dispatchQty} AND PROD_HOURS=#{ew.entity.prodHours} AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}
@@ -817,8 +839,9 @@
AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate} AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate} AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}
+ AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
- AND IS_ALLOT=#{ew.entity.isAllot}
+ AND IS_DISPATCH=#{ew.entity.isDispatch} AND IS_IMPORT=#{ew.entity.isImport} AND REMARK=#{ew.entity.remark} AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}
@@ -885,7 +908,7 @@
AND WORK_CENTER=#{ew.entity.workCenter} AND RESRCE=#{ew.entity.resrce} AND EMPLOYEE=#{ew.entity.employee}
- AND TURN_ORDER=#{ew.entity.turnOrder}
+ AND TURN_OPERATION=#{ew.entity.turnOperation} AND DISPATCH_QTY=#{ew.entity.dispatchQty} AND PROD_HOURS=#{ew.entity.prodHours} AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}
@@ -895,8 +918,9 @@
AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate} AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate} AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}
+ AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
- AND IS_ALLOT=#{ew.entity.isAllot}
+ AND IS_DISPATCH=#{ew.entity.isDispatch} AND IS_IMPORT=#{ew.entity.isImport} AND REMARK=#{ew.entity.remark} AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}
@@ -911,12 +935,12 @@
AND OTHER_5=#{ew.entity.other5}
- AND ${ew.sqlSegment}
+ ${ew.sqlSegment}
- AND ${ew.sqlSegment}
+ ${ew.sqlSegment}
@@ -938,4 +962,80 @@
AND STEP_ID = #{stepId}
+
+
+
diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ResrceController.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ResrceController.java
index f397621a..c63dcceb 100644
--- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ResrceController.java
+++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ResrceController.java
@@ -41,6 +41,19 @@ public class ResrceController {
return R.ok(result);
}
+ @GetMapping("/getResourceListByType")
+ public R getResourceListByType(String resourceType) {
+ List result;
+ try {
+ String site = CommonMethods.getSite();
+ result = resrceService.getResourceListByType(site, resourceType);
+ } catch (Exception e) {
+ return R.failed(e.getMessage());
+ }
+
+ return R.ok(result);
+ }
+
/**
* 分页查询数据
*
diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/SfcController.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/SfcController.java
index fd2b2f74..58799f31 100644
--- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/SfcController.java
+++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/SfcController.java
@@ -51,30 +51,29 @@ public class SfcController {
@GetMapping("/page")
public R page(FrontPage frontPage, Sfc sfc){
IPage result;
- QueryWrapper queryWrapper = new QueryWrapper<>();
- queryWrapper.setEntity(sfc);
- if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
- //TODO modify global query
- queryWrapper.lambda().and(wrapper -> wrapper
- .like(Sfc::getHandle, frontPage.getGlobalQuery())
- .or().like(Sfc::getSite, frontPage.getGlobalQuery())
- .or().like(Sfc::getSfc, frontPage.getGlobalQuery())
- .or().like(Sfc::getStatusBo, frontPage.getGlobalQuery())
- .or().like(Sfc::getShopOrderBo, frontPage.getGlobalQuery())
- .or().like(Sfc::getItemBo, frontPage.getGlobalQuery())
- .or().like(Sfc::getLocation, frontPage.getGlobalQuery())
- .or().like(Sfc::getLccBo, frontPage.getGlobalQuery())
- .or().like(Sfc::getOriginalStatusBo, frontPage.getGlobalQuery())
- .or().like(Sfc::getQtyMultPerformed, frontPage.getGlobalQuery())
- .or().like(Sfc::getPrevSite, frontPage.getGlobalQuery())
- .or().like(Sfc::getOriginalTransferKey, frontPage.getGlobalQuery())
- .or().like(Sfc::getImmediateArchive, frontPage.getGlobalQuery())
- .or().like(Sfc::getTransferUser, frontPage.getGlobalQuery())
- .or().like(Sfc::getSnDone, frontPage.getGlobalQuery())
- .or().like(Sfc::getAinEquipmentId, frontPage.getGlobalQuery())
- );
+
+ try {
+ String site = CommonMethods.getSite();
+ sfc.setSite(site);
+
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.setEntity(sfc);
+ if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
+ queryWrapper
+ .like(Sfc.HANDLE, frontPage.getGlobalQuery())
+ .or().like(Sfc.SITE, frontPage.getGlobalQuery())
+ .or().like(Sfc.SFC, frontPage.getGlobalQuery())
+ .or().like(Sfc.STATUS_BO, frontPage.getGlobalQuery())
+ .or().like(Sfc.SHOP_ORDER_BO, frontPage.getGlobalQuery())
+ .or().like(Sfc.ITEM_BO, frontPage.getGlobalQuery())
+ .or().like(Sfc.ORIGINAL_STATUS_BO, frontPage.getGlobalQuery())
+ .or().like(Sfc.SN_DONE, frontPage.getGlobalQuery());
+ }
+ result = sfcService.page(frontPage.getPagePlus(), queryWrapper);
+ } catch (Exception e) {
+ return R.failed(e.getMessage());
}
- result = sfcService.page(frontPage.getPagePlus(), queryWrapper);
+
return R.ok(result);
}
diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/ResrceMapper.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/ResrceMapper.java
index 95e60383..d439fc40 100644
--- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/ResrceMapper.java
+++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/ResrceMapper.java
@@ -2,8 +2,11 @@ package com.foreverwin.mesnac.meapi.mapper;
import com.foreverwin.mesnac.meapi.model.Resrce;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
+import java.util.List;
+
/**
*
* Mapper 接口
@@ -15,4 +18,5 @@ import org.springframework.stereotype.Repository;
@Repository
public interface ResrceMapper extends BaseMapper {
+ List selectResourceListByType(@Param("site") String site, @Param("resourceType") String resourceType);
}
\ No newline at end of file
diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/ResrceService.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/ResrceService.java
index 0c1c8910..deae55cf 100644
--- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/ResrceService.java
+++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/ResrceService.java
@@ -25,4 +25,13 @@ public interface ResrceService extends IService {
IPage selectPage(FrontPage frontPage, Resrce resrce);
List selectList(Resrce resrce);
+
+ /**
+ * 根据资源类型查询资源清单
+ *
+ * @param site
+ * @param resourceType
+ * @return
+ */
+ List getResourceListByType(String site, String resourceType);
}
\ No newline at end of file
diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/ResrceServiceImpl.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/ResrceServiceImpl.java
index 6244f4e5..9159c3a2 100644
--- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/ResrceServiceImpl.java
+++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/ResrceServiceImpl.java
@@ -42,5 +42,10 @@ public class ResrceServiceImpl extends ServiceImpl impleme
return super.list(queryWrapper);
}
+ @Override
+ public List getResourceListByType(String site, String resourceType) {
+ return resrceMapper.selectResourceListByType(site, resourceType);
+ }
+
}
\ No newline at end of file
diff --git a/meapi/src/main/resources/mapper/ResrceMapper.xml b/meapi/src/main/resources/mapper/ResrceMapper.xml
index c6881b60..fb6664e5 100644
--- a/meapi/src/main/resources/mapper/ResrceMapper.xml
+++ b/meapi/src/main/resources/mapper/ResrceMapper.xml
@@ -540,4 +540,12 @@
+
+
diff --git a/meapi/src/main/resources/mapper/SfcMapper.xml b/meapi/src/main/resources/mapper/SfcMapper.xml
index a665108c..6549f53c 100644
--- a/meapi/src/main/resources/mapper/SfcMapper.xml
+++ b/meapi/src/main/resources/mapper/SfcMapper.xml
@@ -320,12 +320,12 @@
AND PARTITION_DATE=#{ew.entity.partitionDate}
- ${ew.sqlSegment}
+ AND ${ew.sqlSegment}
- ${ew.sqlSegment}
+ AND ${ew.sqlSegment}