Merge remote-tracking branch 'origin/master'

This commit is contained in:
LJW 2024-11-11 14:11:17 +08:00
commit baf560095b
30 changed files with 1545 additions and 529 deletions

View File

@ -65,9 +65,6 @@
</dependency> </dependency>
<!-- 防止进入swagger页面报类型转换错误排除3.0.0中的引用手动增加1.6.2版本 --> <!-- 防止进入swagger页面报类型转换错误排除3.0.0中的引用手动增加1.6.2版本 -->
<dependency> <dependency>
<groupId>io.swagger</groupId> <groupId>io.swagger</groupId>
@ -75,7 +72,7 @@
<version>1.6.2</version> <version>1.6.2</version>
</dependency> </dependency>
<!-- Mysql驱动包 --> <!-- Mysql驱动包 -->
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
@ -106,20 +103,43 @@
</dependency> </dependency>
<!-- 达梦数据库驱动依赖 --> <!-- 达梦数据库驱动依赖 -->
<!-- <dependency>-->
<!-- <groupId>com.dameng</groupId>-->
<!-- <artifactId>DmJdbcDriver18</artifactId>-->
<!-- <version>8.1.2.79</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.dameng</groupId>-->
<!-- <artifactId>DmDialect-for-hibernate5.4</artifactId>-->
<!-- <version>8.1.3.140</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.dm</groupId>-->
<!-- <artifactId>DmJdbcDriver</artifactId>-->
<!-- <version>1.8</version>-->
<!-- <scope>system</scope>-->
<!-- <systemPath>${basedir}/lib/DmJdbcDriver18.jar</systemPath>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.dm.dialect</groupId>-->
<!-- <artifactId>hibernate5</artifactId>-->
<!-- <version>5.4</version>-->
<!-- <scope>system</scope>-->
<!-- <systemPath>${basedir}/lib/DmDialect-for-hibernate5.4.jar</systemPath>-->
<!-- </dependency>-->
<dependency> <dependency>
<groupId>com.dm</groupId> <groupId>com.dm</groupId>
<artifactId>DmJdbcDriver</artifactId> <artifactId>DmJdbcDriver</artifactId>
<version>1.8</version> <version>1.8</version>
<scope>system</scope>
<systemPath>${basedir}/lib/DmJdbcDriver18.jar</systemPath>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.dm.dialect</groupId> <groupId>com.dm.dialect</groupId>
<artifactId>hibernate5</artifactId> <artifactId>hibernate5</artifactId>
<version>5.4</version> <version>5.4</version>
<scope>system</scope>
<systemPath>${basedir}/lib/DmDialect-for-hibernate5.4.jar</systemPath>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
@ -139,15 +159,15 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId> <artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version> <version>3.1.0</version>
<configuration> <configuration>
<failOnMissingWebXml>false</failOnMissingWebXml> <failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName> <warName>${project.artifactId}</warName>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
<finalName>${project.artifactId}</finalName> <finalName>${project.artifactId}</finalName>
</build> </build>

View File

@ -6,7 +6,7 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:dm://localhost:5236/CS_HF_WMS?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:dm://localhost:5236/WMS_DJ?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: SYSDBA username: SYSDBA
password: SYSDBA password: SYSDBA
# 从库数据源 # 从库数据源

View File

@ -46,15 +46,15 @@ spring:
messages: messages:
# 国际化资源文件路径 # 国际化资源文件路径
basename: i18n/messages basename: i18n/messages
profiles: profiles:
active: druid active: druid
# 文件上传 # 文件上传
servlet: servlet:
multipart: multipart:
# 单个文件大小 # 单个文件大小
max-file-size: 10MB max-file-size: 10MB
# 设置总上传的文件大小 # 设置总上传的文件大小
max-request-size: 20MB max-request-size: 20MB
# 服务模块 # 服务模块
devtools: devtools:
restart: restart:
@ -63,13 +63,13 @@ spring:
# redis 配置 # redis 配置
redis: redis:
# 地址 # 地址
host: jjml.cc host: localhost
# 端口默认为6379 # 端口默认为6379
port: 7067 port: 6379
# 数据库索引 # 数据库索引
database: 1 database: 0
# 密码 # 密码
password: redis_HtWAZW password:
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:
@ -85,27 +85,27 @@ spring:
# token配置 # token配置
token: token:
# 令牌自定义标识 # 令牌自定义标识
header: Authorization header: Authorization
# 令牌密钥 # 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期默认30分钟 # 令牌有效期默认30分钟
expireTime: 30 expireTime: 30
# MyBatis配置 # MyBatis配置
mybatis: mybatis:
# 搜索指定包别名 # 搜索指定包别名
typeAliasesPackage: com.ktg.**.domain typeAliasesPackage: com.ktg.**.domain
# 配置mapper的扫描找到所有的mapper.xml映射文件 # 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件 # 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml configLocation: classpath:mybatis/mybatis-config.xml
# PageHelper分页插件 # PageHelper分页插件
pagehelper: pagehelper:
helperDialect: oracle helperDialect: oracle
supportMethodsArguments: true supportMethodsArguments: true
params: count=countSql params: count=countSql
# Swagger配置 # Swagger配置
swagger: swagger:
@ -116,7 +116,7 @@ swagger:
pathMapping: /dev-api pathMapping: /dev-api
# 防止XSS攻击 # 防止XSS攻击
xss: xss:
# 过滤开关 # 过滤开关
enabled: true enabled: true
# 排除链接(多个用逗号分隔) # 排除链接(多个用逗号分隔)
@ -126,7 +126,7 @@ xss:
#Mino配置 #Mino配置
minio: minio:
url: http://192.168.100.106:9000 url: http://localhost:9000
accessKey: mi80JZXet0K0v8sSHzOm accessKey: seBsDKT7Ss8B4aGiNiNn
secretKey: 2BaCUhfkFStLHdUfkBRwhshLyKFfbOBG366uakzx secretKey: IYvTR63NZE3EemLfIHGTXu72O7svMEiNHG2OoOWI
bucketName: ktg-mes bucketName: wms-dj

View File

@ -29,6 +29,8 @@ import com.ktg.common.enums.BusinessType;
import com.ktg.common.utils.poi.ExcelUtil; import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.common.core.page.TableDataInfo; import com.ktg.common.core.page.TableDataInfo;
import static com.ktg.generator.util.MultiModuleCodeGenerator.generateTaskCode;
/** /**
* 工具台账Controller * 工具台账Controller
* *
@ -95,8 +97,8 @@ public class BaseKnifeController extends BaseController
map.put("mbbMrlClass", item.getKnifeType()); map.put("mbbMrlClass", item.getKnifeType());
map.put("wmsAreaCode", item.getAreaCode()); map.put("wmsAreaCode", item.getAreaCode());
map.put("knifeLife", "100"); map.put("knifeLife", "100");
map.put("knifeLifeUser", item.getKnifeLife() == null ? null : String.valueOf(100 - Integer.parseInt(item.getKnifeLife()))); map.put("knifeLifeUser", item.getKnifeLife() == 0 ? null : String.valueOf(100 - item.getKnifeLife()));
map.put("knifeLifeLeave", item.getKnifeLife() == null ? null : item.getKnifeLife()); map.put("knifeLifeLeave", item.getKnifeLife() == 0 ? null : String.valueOf(item.getKnifeLife()));
map.put("isLocked", item.getIsLocked().toString()); map.put("isLocked", item.getIsLocked().toString());
map.put("lockedStartTime", item.getLockedStartTime() == null ? null : item.getLockedStartTime().toString()); map.put("lockedStartTime", item.getLockedStartTime() == null ? null : item.getLockedStartTime().toString());
map.put("lockedEndTime",item.getLockedEndTime() == null ? null : item.getLockedEndTime().toString()); map.put("lockedEndTime",item.getLockedEndTime() == null ? null : item.getLockedEndTime().toString());
@ -126,9 +128,11 @@ public class BaseKnifeController extends BaseController
@PostMapping("/open/checkForAlignment") @PostMapping("/open/checkForAlignment")
@ResponseBody @ResponseBody
public AjaxResult checkForAlignment(@RequestBody String json) { public AjaxResult checkForAlignment(@RequestBody String json) {
// 检查请求json是否正确
List<BaseTechnologyBom> technologyBomList = JSON.parseArray(json, BaseTechnologyBom.class); List<BaseTechnologyBom> technologyBomList = JSON.parseArray(json, BaseTechnologyBom.class);
if (technologyBomList.isEmpty() || technologyBomList.size() == 1 && technologyBomList.get(0).getKnifeCode() == null) if (technologyBomList.isEmpty() || technologyBomList.size() == 1 && technologyBomList.get(0).getKnifeCode() == null)
return AjaxResult.error("未检测到工艺bom项"); return AjaxResult.error("未检测到工艺bom项");
// 记录请求数据
technologyBomList.forEach(baseTechnologyBom -> baseTechnologyBomService.insertBaseTechnologyBom(baseTechnologyBom)); technologyBomList.forEach(baseTechnologyBom -> baseTechnologyBomService.insertBaseTechnologyBom(baseTechnologyBom));
// 构建日志 // 构建日志
@ -167,7 +171,7 @@ public class BaseKnifeController extends BaseController
baseKnifeWrapper.setMbbBdMrlId(mdItemTemp.getItemId()); baseKnifeWrapper.setMbbBdMrlId(mdItemTemp.getItemId());
baseKnifeWrapper.setIsLocked(0); baseKnifeWrapper.setIsLocked(0);
List<BaseKnife> tempList = this.baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); List<BaseKnife> tempList = this.baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
tempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife())); tempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
AtomicInteger knifeCount = new AtomicInteger(techBom.getKnifeCount()); AtomicInteger knifeCount = new AtomicInteger(techBom.getKnifeCount());
// 如果台账表中不存在尝试组刀任务查询 // 如果台账表中不存在尝试组刀任务查询
@ -181,7 +185,7 @@ public class BaseKnifeController extends BaseController
operLogService.insertOperlog(operLog); operLogService.insertOperlog(operLog);
return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode()); return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode());
} }
BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(bomRouteList.get(0).getBomRouteId()); BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(bomRouteList.get(0).getBomRouteId());
if (!bomRoute.getMbbProduBomList().isEmpty()) { if (!bomRoute.getMbbProduBomList().isEmpty()) {
@ -191,7 +195,6 @@ public class BaseKnifeController extends BaseController
baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId()); baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId());
baseKnifeWrapper.setIsLocked(0); baseKnifeWrapper.setIsLocked(0);
List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
sitmTempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife()));
if (sitmTempList.isEmpty()){ if (sitmTempList.isEmpty()){
operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode());
@ -229,7 +232,8 @@ public class BaseKnifeController extends BaseController
} else { } else {
// 将物料填入集合 // 将物料填入集合
tempList.forEach(item -> { tempList.forEach(item -> {
if (knifeCount.get() > 0 && Integer.parseInt(item.getKnifeLife()) >= Integer.parseInt(techBom.getExpendLife()) && tempList.size() > countMap.get(item.getKnifeCode())) { if (knifeCount.get() > 0 && tempList.size() > countMap.get(item.getKnifeCode())) {
// 更新数量
knifeCount.getAndDecrement(); knifeCount.getAndDecrement();
countMap.put(item.getKnifeCode(), countMap.get(item.getKnifeCode()) + 1); countMap.put(item.getKnifeCode(), countMap.get(item.getKnifeCode()) + 1);
} }
@ -238,6 +242,7 @@ public class BaseKnifeController extends BaseController
if ("PRODUCT".equals(mdItemTemp.getItemOrProduct())){ if ("PRODUCT".equals(mdItemTemp.getItemOrProduct())){
// 查询整刀bom项 如果不存在说明 为基础物料或者没有记录此整刀的组装 // 查询整刀bom项 如果不存在说明 为基础物料或者没有记录此整刀的组装
bomRouteTemp.setMdItemId(mdItemTemp.getItemId()); bomRouteTemp.setMdItemId(mdItemTemp.getItemId());
List<BomRoute> bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp); List<BomRoute> bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp);
if (bomRouteList.isEmpty()){ if (bomRouteList.isEmpty()){
operLog.setJsonResult("Bom头查询错误" + techBom.getKnifeCode()); operLog.setJsonResult("Bom头查询错误" + techBom.getKnifeCode());
@ -245,7 +250,6 @@ public class BaseKnifeController extends BaseController
return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode()); return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode());
} }
BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(bomRouteList.get(0).getBomRouteId()); BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(bomRouteList.get(0).getBomRouteId());
if (!bomRoute.getMbbProduBomList().isEmpty()) { if (!bomRoute.getMbbProduBomList().isEmpty()) {
@ -255,7 +259,6 @@ public class BaseKnifeController extends BaseController
baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId()); baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId());
baseKnifeWrapper.setIsLocked(0); baseKnifeWrapper.setIsLocked(0);
List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
sitmTempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife()));
if (sitmTempList.isEmpty()){ if (sitmTempList.isEmpty()){
operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode());
@ -304,11 +307,15 @@ public class BaseKnifeController extends BaseController
@PostMapping("/open/productionArrangements") @PostMapping("/open/productionArrangements")
@ResponseBody @ResponseBody
public AjaxResult productionArrangements(@RequestBody String json) { public AjaxResult productionArrangements(@RequestBody String json) {
// 验证请求数据
List<BaseTechnologyBom> technologyBomList = JSON.parseArray(json, BaseTechnologyBom.class); List<BaseTechnologyBom> technologyBomList = JSON.parseArray(json, BaseTechnologyBom.class);
if (technologyBomList.isEmpty() || technologyBomList.size() == 1 && technologyBomList.get(0).getKnifeCode() == null) if (technologyBomList.isEmpty() || technologyBomList.size() == 1 && technologyBomList.get(0).getKnifeCode() == null)
return AjaxResult.error("未检测到工艺bom项"); return AjaxResult.error("未检测到工艺bom项");
technologyBomList.forEach(baseTechnologyBom -> baseTechnologyBomService.insertBaseTechnologyBom(baseTechnologyBom)); technologyBomList.forEach(baseTechnologyBom -> baseTechnologyBomService.insertBaseTechnologyBom(baseTechnologyBom));
// 记录数据修改
List<BaseKnife> baseKnifeOriginList = new ArrayList<>();
// 构建日志 // 构建日志
SysOperLog operLog = new SysOperLog(); SysOperLog operLog = new SysOperLog();
operLog.setTitle("生产准备"); operLog.setTitle("生产准备");
@ -322,6 +329,7 @@ public class BaseKnifeController extends BaseController
operLog.setOperParam(json); operLog.setOperParam(json);
operLog.setStatus(1); operLog.setStatus(1);
operLog.setOperTime(new Date()); operLog.setOperTime(new Date());
// 接口返回信息
String msg = "生产准备验证成功!"; String msg = "生产准备验证成功!";
// 记录所需物料数量的map // 记录所需物料数量的map
@ -338,15 +346,17 @@ public class BaseKnifeController extends BaseController
// 台账表中查询工具 并记录数量 // 台账表中查询工具 并记录数量
mdItemTemp = mdItemService.selectMdItemByCode(techBom.getKnifeCode()); mdItemTemp = mdItemService.selectMdItemByCode(techBom.getKnifeCode());
if (mdItemTemp == null){ if (mdItemTemp == null){
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
operLog.setJsonResult("物料台账查询错误:" + techBom.getKnifeCode()); operLog.setJsonResult("物料台账查询错误:" + techBom.getKnifeCode());
operLogService.insertOperlog(operLog); operLogService.insertOperlog(operLog);
return AjaxResult.error("物料台账查询错误", techBom.getKnifeCode()); return AjaxResult.error("物料台账查询错误", techBom.getKnifeCode());
} }
// 查询复合条件的台账
baseKnifeWrapper.setMbbBdMrlId(mdItemTemp.getItemId()); baseKnifeWrapper.setMbbBdMrlId(mdItemTemp.getItemId());
baseKnifeWrapper.setIsLocked(0); baseKnifeWrapper.setIsLocked(0);
List<BaseKnife> tempList = this.baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); List<BaseKnife> tempList = this.baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
tempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife())); tempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
AtomicInteger knifeCount = new AtomicInteger(techBom.getKnifeCount()); AtomicInteger knifeCount = new AtomicInteger(techBom.getKnifeCount());
// 如果台账表中不存在尝试组刀任务查询 // 如果台账表中不存在尝试组刀任务查询
@ -356,12 +366,12 @@ public class BaseKnifeController extends BaseController
bomRouteTemp.setMdItemId(mdItemTemp.getItemId()); bomRouteTemp.setMdItemId(mdItemTemp.getItemId());
List<BomRoute> bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp); List<BomRoute> bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp);
if (bomRouteList.isEmpty()){ if (bomRouteList.isEmpty()){
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
operLog.setJsonResult("Bom头查询错误" + techBom.getKnifeCode()); operLog.setJsonResult("Bom头查询错误" + techBom.getKnifeCode());
operLogService.insertOperlog(operLog); operLogService.insertOperlog(operLog);
return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode()); return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode());
} }
BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(bomRouteList.get(0).getBomRouteId()); BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(bomRouteList.get(0).getBomRouteId());
if (!bomRoute.getMbbProduBomList().isEmpty()) { if (!bomRoute.getMbbProduBomList().isEmpty()) {
@ -371,9 +381,9 @@ public class BaseKnifeController extends BaseController
baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId()); baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId());
baseKnifeWrapper.setIsLocked(0); baseKnifeWrapper.setIsLocked(0);
List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
sitmTempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife()));
if (sitmTempList.isEmpty()){ if (sitmTempList.isEmpty()){
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode());
operLogService.insertOperlog(operLog); operLogService.insertOperlog(operLog);
return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode()); return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode());
@ -381,6 +391,7 @@ public class BaseKnifeController extends BaseController
if (sitmTempList.size() >= bom.getStandardDosage() * knifeCount.get()){ if (sitmTempList.size() >= bom.getStandardDosage() * knifeCount.get()){
countMap.put(sitmTempList.get(0).getKnifeCode(), bom.getStandardDosage() * knifeCount.get()); countMap.put(sitmTempList.get(0).getKnifeCode(), bom.getStandardDosage() * knifeCount.get());
} else { } else {
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode());
operLogService.insertOperlog(operLog); operLogService.insertOperlog(operLog);
return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode()); return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode());
@ -391,17 +402,20 @@ public class BaseKnifeController extends BaseController
// 判断基础物料是否充足 // 判断基础物料是否充足
if (sitmTempList.size() < countMap.get(sitmTempList.get(0).getKnifeCode()) && countMap.get(sitmTempList.get(0).getKnifeCode()) > bom.getStandardDosage() * knifeCount.get()){ if (sitmTempList.size() < countMap.get(sitmTempList.get(0).getKnifeCode()) && countMap.get(sitmTempList.get(0).getKnifeCode()) > bom.getStandardDosage() * knifeCount.get()){
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
operLog.setJsonResult("基础物料不足进行组装工具:" + techBom.getKnifeCode()); operLog.setJsonResult("基础物料不足进行组装工具:" + techBom.getKnifeCode());
operLogService.insertOperlog(operLog); operLogService.insertOperlog(operLog);
return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode()); return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode());
} }
} }
} else { } else {
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
operLog.setJsonResult("暂无记录整刀bom项" + techBom.getKnifeCode()); operLog.setJsonResult("暂无记录整刀bom项" + techBom.getKnifeCode());
operLogService.insertOperlog(operLog); operLogService.insertOperlog(operLog);
return AjaxResult.error("暂无记录整刀bom项", techBom.getKnifeCode()); return AjaxResult.error("暂无记录整刀bom项", techBom.getKnifeCode());
} }
} else { } else {
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
operLog.setJsonResult("基础物料不足:" + techBom.getKnifeCode()); operLog.setJsonResult("基础物料不足:" + techBom.getKnifeCode());
operLogService.insertOperlog(operLog); operLogService.insertOperlog(operLog);
return AjaxResult.error("基础物料不足", techBom.getKnifeCode()); return AjaxResult.error("基础物料不足", techBom.getKnifeCode());
@ -409,9 +423,17 @@ public class BaseKnifeController extends BaseController
} else { } else {
// 将物料填入集合 // 将物料填入集合
tempList.forEach(item -> { tempList.forEach(item -> {
if (knifeCount.get() > 0 && Integer.parseInt(item.getKnifeLife()) >= Integer.parseInt(techBom.getExpendLife()) && tempList.size() > countMap.get(item.getKnifeCode())) { if (knifeCount.get() > 0 && tempList.size() > countMap.get(item.getKnifeCode())) {
// 更新数量
knifeCount.getAndDecrement(); knifeCount.getAndDecrement();
countMap.put(item.getKnifeCode(), countMap.get(item.getKnifeCode()) + 1); countMap.put(item.getKnifeCode(), countMap.get(item.getKnifeCode()) + 1);
// 记录源数据然后锁定
baseKnifeOriginList.add(item);
item.setPlanSheet(techBom.getTechnologyBomId());
item.setIsLocked(1);
item.setLockedStartTime(techBom.getLockedStartTime());
item.setLockedEndTime(techBom.getLockedEndTime());
baseKnifeService.updateBaseKnife(item);
} }
}); });
if (knifeCount.get() > 0) { if (knifeCount.get() > 0) {
@ -421,6 +443,7 @@ public class BaseKnifeController extends BaseController
List<BomRoute> bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp); List<BomRoute> bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp);
if (bomRouteList.isEmpty()){ if (bomRouteList.isEmpty()){
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
operLog.setJsonResult("Bom头查询错误" + techBom.getKnifeCode()); operLog.setJsonResult("Bom头查询错误" + techBom.getKnifeCode());
operLogService.insertOperlog(operLog); operLogService.insertOperlog(operLog);
return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode()); return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode());
@ -435,9 +458,9 @@ public class BaseKnifeController extends BaseController
baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId()); baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId());
baseKnifeWrapper.setIsLocked(0); baseKnifeWrapper.setIsLocked(0);
List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
sitmTempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife()));
if (sitmTempList.isEmpty()){ if (sitmTempList.isEmpty()){
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode());
operLogService.insertOperlog(operLog); operLogService.insertOperlog(operLog);
return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode()); return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode());
@ -445,6 +468,7 @@ public class BaseKnifeController extends BaseController
if (sitmTempList.size() >= bom.getStandardDosage() * knifeCount.get()){ if (sitmTempList.size() >= bom.getStandardDosage() * knifeCount.get()){
countMap.put(sitmTempList.get(0).getKnifeCode(), bom.getStandardDosage() * knifeCount.get()); countMap.put(sitmTempList.get(0).getKnifeCode(), bom.getStandardDosage() * knifeCount.get());
} else { } else {
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode());
operLogService.insertOperlog(operLog); operLogService.insertOperlog(operLog);
return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode()); return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode());
@ -455,17 +479,20 @@ public class BaseKnifeController extends BaseController
// 判断基础物料是否充足 // 判断基础物料是否充足
if (sitmTempList.size() < countMap.get(sitmTempList.get(0).getKnifeCode()) && countMap.get(sitmTempList.get(0).getKnifeCode()) > bom.getStandardDosage() * knifeCount.get()){ if (sitmTempList.size() < countMap.get(sitmTempList.get(0).getKnifeCode()) && countMap.get(sitmTempList.get(0).getKnifeCode()) > bom.getStandardDosage() * knifeCount.get()){
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
operLog.setJsonResult("基础物料不足进行组装工具:" + techBom.getKnifeCode()); operLog.setJsonResult("基础物料不足进行组装工具:" + techBom.getKnifeCode());
operLogService.insertOperlog(operLog); operLogService.insertOperlog(operLog);
return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode()); return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode());
} }
} }
} else { } else {
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
operLog.setJsonResult("暂无记录整刀bom项" + techBom.getKnifeCode()); operLog.setJsonResult("暂无记录整刀bom项" + techBom.getKnifeCode());
operLogService.insertOperlog(operLog); operLogService.insertOperlog(operLog);
return AjaxResult.error("暂无记录整刀bom项", techBom.getKnifeCode()); return AjaxResult.error("暂无记录整刀bom项", techBom.getKnifeCode());
} }
} else { } else {
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
operLog.setJsonResult("基础物料不足:" + techBom.getKnifeCode()); operLog.setJsonResult("基础物料不足:" + techBom.getKnifeCode());
operLogService.insertOperlog(operLog); operLogService.insertOperlog(operLog);
return AjaxResult.error("基础物料不足", techBom.getKnifeCode()); return AjaxResult.error("基础物料不足", techBom.getKnifeCode());
@ -481,15 +508,15 @@ public class BaseKnifeController extends BaseController
List<MbbProduBom> bomList; List<MbbProduBom> bomList;
for (BaseTechnologyBom techBom : technologyBomList){ for (BaseTechnologyBom techBom : technologyBomList){
mdItem = mdItemService.selectMdItemByCode(techBom.getKnifeCode()); mdItem = mdItemService.selectMdItemByCode(techBom.getKnifeCode());
count = techBom.getKnifeCount(); count = techBom.getKnifeCount() - countMap.get(techBom.getKnifeCode());
// 先从台账表找 // 先从台账表找
baseKnifeWrapper.setMbbBdMrlId(mdItem.getItemId()); baseKnifeWrapper.setMbbBdMrlId(mdItem.getItemId());
baseKnifeWrapper.setIsLocked(0); baseKnifeWrapper.setIsLocked(0);
baseKnifeList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); baseKnifeList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
baseKnifeList.removeIf(wmsBaseKnife -> Integer.parseInt(wmsBaseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife())); baseKnifeList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife());
for (BaseKnife wmsBaseKnife : baseKnifeList){ for (BaseKnife wmsBaseKnife : baseKnifeList){
if (Integer.parseInt(wmsBaseKnife.getKnifeLife()) >= Integer.parseInt(techBom.getExpendLife()) && count > 0){ if (wmsBaseKnife.getKnifeLife() >= techBom.getExpendLife() && count > 0){
count--; count--;
} }
} }
@ -502,6 +529,7 @@ public class BaseKnifeController extends BaseController
List<BomRoute> bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp); List<BomRoute> bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp);
if (bomRouteList.isEmpty()){ if (bomRouteList.isEmpty()){
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
operLog.setJsonResult("Bom头查询错误" + techBom.getKnifeCode()); operLog.setJsonResult("Bom头查询错误" + techBom.getKnifeCode());
operLogService.insertOperlog(operLog); operLogService.insertOperlog(operLog);
return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode()); return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode());
@ -509,14 +537,16 @@ public class BaseKnifeController extends BaseController
WmsZdTask wmsZdTask = new WmsZdTask(); WmsZdTask wmsZdTask = new WmsZdTask();
wmsZdTask.setmProductId(mdItem.getItemId()); wmsZdTask.setmProductId(mdItem.getItemId());
wmsZdTask.setCode(techBom.getProcessCode() + mdItem.getItemCode()); wmsZdTask.setAttr4(techBom.getTechnologyBomId());
wmsZdTask.setName(techBom.getProcessName() + "[" + mdItem.getItemName() + "]"); wmsZdTask.setCode(techBom.getProcessCode());
wmsZdTask.setName(techBom.getProcessName());
wmsZdTask.setProductIdQty(count); wmsZdTask.setProductIdQty(count);
wmsZdTask.setAttr1(bomRouteList.get(0).getBomRouteId()); wmsZdTask.setAttr1(bomRouteList.get(0).getBomRouteId());
wmsZdTask.setCreateTime(DateUtils.getNowDate()); wmsZdTask.setCreateTime(DateUtils.getNowDate());
zdTaskService.insertWmsZdTask(wmsZdTask); zdTaskService.insertWmsZdTask(wmsZdTask);
msg = "生产准备验证成功!已生成组装任务!"; msg = "生产准备验证成功!缺少物料已生成组装任务!";
} else { } else {
baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife));
operLog.setJsonResult("缺少BOM项" + techBom.getKnifeCode()); operLog.setJsonResult("缺少BOM项" + techBom.getKnifeCode());
operLogService.insertOperlog(operLog); operLogService.insertOperlog(operLog);
return AjaxResult.error("缺少BOM项", techBom.getKnifeCode()); return AjaxResult.error("缺少BOM项", techBom.getKnifeCode());
@ -539,10 +569,13 @@ public class BaseKnifeController extends BaseController
@PutMapping("/zdTask") @PutMapping("/zdTask")
public AjaxResult zdTask(@RequestBody WmsZdTask zdTask) public AjaxResult zdTask(@RequestBody WmsZdTask zdTask)
{ {
String batchNum = "ZZPC001";
// 判断物料是否充足 // 判断物料是否充足
BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(zdTask.getAttr1()); BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(zdTask.getAttr1());
BaseKnife baseKnifeWrapper = new BaseKnife(); BaseKnife baseKnifeWrapper = new BaseKnife();
List<BaseKnife> baseKnifeList = new ArrayList<>(); List<BaseKnife> baseKnifeList = new ArrayList<>();
// 遍历组装整刀需要的bom物料
for (MbbProduBom mbbProduBom : bomRoute.getMbbProduBomList()) { for (MbbProduBom mbbProduBom : bomRoute.getMbbProduBomList()) {
baseKnifeWrapper.setMbbBdMrlId(mbbProduBom.getMdItemId()); baseKnifeWrapper.setMbbBdMrlId(mbbProduBom.getMdItemId());
baseKnifeWrapper.setIsLocked(0); baseKnifeWrapper.setIsLocked(0);
@ -555,18 +588,35 @@ public class BaseKnifeController extends BaseController
List<WmsOutPlanDetail> wmsOutPlanDetailList = new ArrayList<>(); List<WmsOutPlanDetail> wmsOutPlanDetailList = new ArrayList<>();
List<BaseKnife> baseKnifeListOutPlan = new ArrayList<>(); List<BaseKnife> baseKnifeListOutPlan = new ArrayList<>();
WmsOutPlan outPlan = new WmsOutPlan(); // 查询工艺bom
outPlan.setPlanCode(zdTask.getCode()); BaseTechnologyBom technologyBom = new BaseTechnologyBom();
outPlan.setWmsBusinessTypeId(12L); Boolean lockedFlag = false;
outPlan.setPlanState("1"); // attr4 组装任务所属计划单 如果为空则是手动组装任务不需要锁定
outPlan.setPlanType("ZDCK"); if (zdTask.getAttr4() != null){
outPlan.setCreateBy(getUsername()); lockedFlag = true;
outPlan.setCreateTime(DateUtils.getNowDate()); technologyBom = baseTechnologyBomService.selectBaseTechnologyBomByTechnologyBomId(zdTask.getAttr4());
wmsOutPlanMapper.insertWmsOutPlan(outPlan); } else {
technologyBom.setFigureCode(zdTask.getCode());
}
// 出库基础物料 根据图号查询出库计划如果不存在生成计划存在则往计划中添加任务
WmsOutPlan outPlan = wmsOutPlanMapper.selectWmsOutPlanByPlanCode(technologyBom.getFigureCode());
if (outPlan == null){
WmsOutPlan outPlanTemp = new WmsOutPlan();
outPlanTemp.setPlanCode(technologyBom.getFigureCode());
outPlanTemp.setWmsBusinessTypeId(12L);
outPlanTemp.setPlanState("1");
outPlanTemp.setPlanType("ZDCK");
outPlanTemp.setCreateBy(getUsername());
outPlanTemp.setCreateTime(DateUtils.getNowDate());
wmsOutPlanMapper.insertWmsOutPlan(outPlanTemp);
outPlan = outPlanTemp;
}
// 锁定物料 // 锁定物料
Boolean outPlanFlag = true; Boolean outPlanFlag = true;
for (int i = 0; i < zdTask.getProductIdQty(); i++) { for (int i = 0; i < zdTask.getProductIdQty(); i++) {
// 构建整刀
BaseKnife baseKnife = new BaseKnife(); BaseKnife baseKnife = new BaseKnife();
MdItem mdItem = mdItemService.selectMdItemById(zdTask.getmProductId()); MdItem mdItem = mdItemService.selectMdItemById(zdTask.getmProductId());
baseKnife.setMbbBdMrlId(zdTask.getmProductId()); baseKnife.setMbbBdMrlId(zdTask.getmProductId());
@ -575,17 +625,25 @@ public class BaseKnifeController extends BaseController
baseKnife.setKnifeUnit(mdItem.getUnitName()); baseKnife.setKnifeUnit(mdItem.getUnitName());
baseKnife.setKnifeType(mdItem.getItemTypeName()); baseKnife.setKnifeType(mdItem.getItemTypeName());
baseKnife.setAreaCode(zdTask.getAttr3()); baseKnife.setAreaCode(zdTask.getAttr3());
baseKnife.setSafeStock(mdItem.getMinStock().toString().split("\\.")[0]); baseKnife.setSafeStock(mdItem.getMinStock());
baseKnife.setStandardQuantity("1"); baseKnife.setStandardQuantity("1");
baseKnife.setKnifeLife("100"); baseKnife.setKnifeLife(100);
baseKnife.setKnifeFineState(0); baseKnife.setKnifeFineState(0);
baseKnife.setIsLocked(0); // 判断是否需要锁定整刀
baseKnife.setPlanSheet(""); if (lockedFlag) {
baseKnife.setIsLocked(1);
baseKnife.setLockedStartTime(technologyBom.getLockedStartTime());
baseKnife.setLockedEndTime(technologyBom.getLockedEndTime());
} else {
baseKnife.setIsLocked(0);
}
baseKnife.setPlanSheet(zdTask.getAttr4());
baseKnife.setItemOrProduct("PRODUCT"); baseKnife.setItemOrProduct("PRODUCT");
baseKnife.setCreateBy(getUsername()); baseKnife.setCreateBy(getUsername());
baseKnife.setCreateTime(DateUtils.getNowDate()); baseKnife.setCreateTime(DateUtils.getNowDate());
baseKnifeService.insertBaseKnife(baseKnife); baseKnifeService.insertBaseKnife(baseKnife);
// 锁定物料
int resetCount = 0; int resetCount = 0;
for (MbbProduBom mbbProduBom : bomRoute.getMbbProduBomList()) { for (MbbProduBom mbbProduBom : bomRoute.getMbbProduBomList()) {
baseKnifeWrapper.setMbbBdMrlId(mbbProduBom.getMdItemId()); baseKnifeWrapper.setMbbBdMrlId(mbbProduBom.getMdItemId());
@ -593,6 +651,7 @@ public class BaseKnifeController extends BaseController
baseKnifeList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); baseKnifeList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
if (outPlanFlag) { if (outPlanFlag) {
// 出库任务
MdItem mdItemOutPlan = mdItemService.selectMdItemById(mbbProduBom.getMdItemId()); MdItem mdItemOutPlan = mdItemService.selectMdItemById(mbbProduBom.getMdItemId());
WmsOutPlanDetail outPlanDetail = new WmsOutPlanDetail(); WmsOutPlanDetail outPlanDetail = new WmsOutPlanDetail();
outPlanDetail.setWmsOutPlanId(outPlan.getWmsOutPlanId()); outPlanDetail.setWmsOutPlanId(outPlan.getWmsOutPlanId());
@ -602,7 +661,7 @@ public class BaseKnifeController extends BaseController
outPlanDetail.setMdItemUnit(mdItemOutPlan.getUnitName()); outPlanDetail.setMdItemUnit(mdItemOutPlan.getUnitName());
outPlanDetail.setPlannedQuantity(mbbProduBom.getStandardDosage() * zdTask.getProductIdQty()); outPlanDetail.setPlannedQuantity(mbbProduBom.getStandardDosage() * zdTask.getProductIdQty());
outPlanDetail.setRealQuantity(mbbProduBom.getStandardDosage() * zdTask.getProductIdQty()); outPlanDetail.setRealQuantity(mbbProduBom.getStandardDosage() * zdTask.getProductIdQty());
outPlanDetail.setDetailBatchNum("1"); outPlanDetail.setDetailBatchNum(batchNum);
WmStorageArea wmStorageArea = wmStorageAreaService.selectWmStorageAreaByAreaCode(zdTask.getAttr3()); WmStorageArea wmStorageArea = wmStorageAreaService.selectWmStorageAreaByAreaCode(zdTask.getAttr3());
outPlanDetail.setWmStorageAreaId(wmStorageArea.getAreaId()); outPlanDetail.setWmStorageAreaId(wmStorageArea.getAreaId());
outPlanDetail.setWmStorageAreaCode(wmStorageArea.getAreaCode()); outPlanDetail.setWmStorageAreaCode(wmStorageArea.getAreaCode());
@ -611,31 +670,36 @@ public class BaseKnifeController extends BaseController
wmsOutPlanDetailList.add(outPlanDetail); wmsOutPlanDetailList.add(outPlanDetail);
} }
// 锁定基础 物料
int bomCount = mbbProduBom.getStandardDosage(); int bomCount = mbbProduBom.getStandardDosage();
for (BaseKnife wmsBaseKnife : baseKnifeList){ for (BaseKnife wmsBaseKnife : baseKnifeList){
if (bomCount > 0){ if (bomCount > 0){
wmsBaseKnife.setIsLocked(1); wmsBaseKnife.setIsLocked(1);
wmsBaseKnife.setKnifeFineState(2); wmsBaseKnife.setKnifeFineState(2);
wmsBaseKnife.setLockedStartTime(new Date()); wmsBaseKnife.setLockedStartTime(technologyBom.getLockedStartTime());
wmsBaseKnife.setLockedEndTime(new Date()); wmsBaseKnife.setLockedEndTime(technologyBom.getLockedEndTime());
wmsBaseKnife.setAttr1(baseKnife.getBaseKnifeId()); wmsBaseKnife.setAttr1(baseKnife.getBaseKnifeId());
baseKnifeListOutPlan.add(wmsBaseKnife); baseKnifeListOutPlan.add(wmsBaseKnife);
baseKnifeService.updateBaseKnife(wmsBaseKnife); baseKnifeService.updateBaseKnife(wmsBaseKnife);
bomCount--; bomCount--;
// 记录刀片重置次数
resetCount += wmsBaseKnife.getResetCount(); resetCount += wmsBaseKnife.getResetCount();
} }
} }
} }
// 更新重置次数
outPlanFlag = false; outPlanFlag = false;
baseKnife.setResetCount(resetCount); baseKnife.setResetCount(resetCount);
baseKnifeService.updateBaseKnife(baseKnife); baseKnifeService.updateBaseKnife(baseKnife);
} }
// 出库
int i = 0; int i = 0;
for (WmsOutPlanDetail outPlanDetail : wmsOutPlanDetailList){ for (WmsOutPlanDetail outPlanDetail : wmsOutPlanDetailList){
wmsOutPlanMapper.insertWmsOutPlanDetail(outPlanDetail); wmsOutPlanMapper.insertWmsOutPlanDetail(outPlanDetail);
// 出库计划明细
for (int j = 0; j < outPlanDetail.getPlannedQuantity(); j++) { for (int j = 0; j < outPlanDetail.getPlannedQuantity(); j++) {
WmsOutPlanDetailEntity wmsOutPlanDetailEntity = new WmsOutPlanDetailEntity(); WmsOutPlanDetailEntity wmsOutPlanDetailEntity = new WmsOutPlanDetailEntity();
wmsOutPlanDetailEntity.setBaseKnifeId(baseKnifeListOutPlan.get(i++).getBaseKnifeId()); wmsOutPlanDetailEntity.setBaseKnifeId(baseKnifeListOutPlan.get(i++).getBaseKnifeId());
@ -645,16 +709,18 @@ public class BaseKnifeController extends BaseController
wmsOutPlanDetailEntityMapper.insertWmsOutPlanDetailEntity(wmsOutPlanDetailEntity); wmsOutPlanDetailEntityMapper.insertWmsOutPlanDetailEntity(wmsOutPlanDetailEntity);
} }
// 生成出库任务
WmsOutTask wmsOutTask = new WmsOutTask(); WmsOutTask wmsOutTask = new WmsOutTask();
wmsOutTask.setWmsOutPlanId(outPlan.getWmsOutPlanId()); wmsOutTask.setWmsOutPlanId(outPlan.getWmsOutPlanId());
wmsOutTask.setWmsOutPlanCode(outPlan.getPlanCode()); wmsOutTask.setWmsOutPlanCode(generateTaskCode(outPlan.getPlanCode()));
wmsOutTask.setWmsOutPlanDetailId(outPlanDetail.getWmsOutPlanDetailId()); wmsOutTask.setWmsOutPlanDetailId(outPlanDetail.getWmsOutPlanDetailId());
// 出库类型 12组刀出库
wmsOutTask.setWmsBusinessTypeId(12L); wmsOutTask.setWmsBusinessTypeId(12L);
wmsOutTask.setTaskCode(outPlan.getPlanCode()); wmsOutTask.setTaskCode(outPlan.getPlanCode());
wmsOutTask.setTaskNumber(outPlanDetail.getPlannedQuantity()); wmsOutTask.setTaskNumber(outPlanDetail.getPlannedQuantity());
wmsOutTask.setOutNumber(outPlanDetail.getRealQuantity()); wmsOutTask.setOutNumber(outPlanDetail.getRealQuantity());
wmsOutTask.setWmStorageAreaId(outPlanDetail.getWmStorageAreaId()); wmsOutTask.setWmStorageAreaId(outPlanDetail.getWmStorageAreaId());
wmsOutTask.setBatchNum("1"); wmsOutTask.setBatchNum(batchNum);
wmsOutTask.setMdItemId(outPlanDetail.getMdItemId()); wmsOutTask.setMdItemId(outPlanDetail.getMdItemId());
wmsOutTask.setMdItemCode(outPlanDetail.getMdItemCode()); wmsOutTask.setMdItemCode(outPlanDetail.getMdItemCode());
wmsOutTask.setMdItemName(outPlanDetail.getMdItemName()); wmsOutTask.setMdItemName(outPlanDetail.getMdItemName());
@ -664,50 +730,75 @@ public class BaseKnifeController extends BaseController
wmsOutTask.setCreateBy(getUsername()); wmsOutTask.setCreateBy(getUsername());
wmsOutTask.setCreateTime(DateUtils.getNowDate()); wmsOutTask.setCreateTime(DateUtils.getNowDate());
wmsOutTaskMapper.insertWmsOutTask(wmsOutTask); wmsOutTaskMapper.insertWmsOutTask(wmsOutTask);
// 更新基础物料数量
MdItem mdItem = mdItemService.selectMdItemById(outPlanDetail.getMdItemId());
mdItem.setStandardNumber(mdItem.getStandardNumber() - outPlanDetail.getRealQuantity());
mdItemService.updateMdItem(mdItem);
} }
Random random = new Random(); // 整刀入库计划, 根据图号查询入库计划如果不存在生成计划存在则往计划中添加任务
WmsInPlan wmsInPlan = new WmsInPlan(); WmsInPlan wmsInPlan = wmsInPlanService.selectWmsInPlanByPlanCode(technologyBom.getFigureCode());
wmsInPlan.setState("1"); if (wmsInPlan == null){
wmsInPlan.setSourceType("SGLR"); WmsInPlan wmsInPlanTemp = new WmsInPlan();
wmsInPlan.setWareId("10"); wmsInPlanTemp.setState("1");
wmsInPlan.setCellCode(zdTask.getAttr3()); wmsInPlanTemp.setSourceType("SGLR");
wmsInPlan.setPlanCode(zdTask.getCode() + random.nextInt(100)); wmsInPlanTemp.setCellCode(zdTask.getAttr3());
wmsInPlan.setRelBillCode("组装单据"); wmsInPlanTemp.setPlanCode(technologyBom.getFigureCode());
wmsInPlan.setPlanTypeId("7"); wmsInPlanTemp.setRelBillCode("组装单据");
wmsInPlan.setCreateBy(getUsername()); wmsInPlanTemp.setPlanTypeId("13");
wmsInPlan.setCreateTime(DateUtils.getNowDate()); wmsInPlanTemp.setCreateBy(getUsername());
wmsInPlanTemp.setCreateTime(DateUtils.getNowDate());
List<WmsInPlanDetails> wmsInPlanDetailsList = new ArrayList<>(); // 入库任务明细
WmsInPlanDetails wmsInPlanDetails = new WmsInPlanDetails(); List<WmsInPlanDetails> wmsInPlanDetailsList = new ArrayList<>();
wmsInPlanDetails.setMaterialId(zdTask.getmProductId().toString()); WmsInPlanDetails wmsInPlanDetails = new WmsInPlanDetails();
wmsInPlanDetails.setBatch("10112"); wmsInPlanDetails.setMaterialId(zdTask.getmProductId().toString());
wmsInPlanDetails.setCellId("1"); wmsInPlanDetails.setBatch(batchNum);
wmsInPlanDetails.setQuantity(zdTask.getProductIdQty().toString()); wmsInPlanDetails.setCellId("1");
wmsInPlanDetails.setQuantityIn(zdTask.getProductIdQty().toString()); wmsInPlanDetails.setQuantity(zdTask.getProductIdQty().toString());
wmsInPlanDetails.setPlanInStatus("0"); wmsInPlanDetails.setQuantityIn(zdTask.getProductIdQty().toString());
wmsInPlanDetailsList.add(wmsInPlanDetails); wmsInPlanDetails.setPlanInStatus("0");
wmsInPlan.setWmsInPlanDetailsList(wmsInPlanDetailsList); wmsInPlanDetailsList.add(wmsInPlanDetails);
wmsInPlanService.insertWmsInPlan(wmsInPlan); wmsInPlanTemp.setWmsInPlanDetailsList(wmsInPlanDetailsList);
wmsInPlanService.insertWmsInPlan(wmsInPlanTemp);
wmsInPlan = wmsInPlanTemp;
} else {
// 入库任务明细
List<WmsInPlanDetails> wmsInPlanDetailsList = wmsInPlan.getWmsInPlanDetailsList();
WmsInPlanDetails wmsInPlanDetails = new WmsInPlanDetails();
wmsInPlanDetails.setMaterialId(zdTask.getmProductId().toString());
wmsInPlanDetails.setBatch(batchNum);
wmsInPlanDetails.setCellId("1");
wmsInPlanDetails.setQuantity(zdTask.getProductIdQty().toString());
wmsInPlanDetails.setQuantityIn(zdTask.getProductIdQty().toString());
wmsInPlanDetails.setPlanInStatus("0");
wmsInPlanDetailsList.add(wmsInPlanDetails);
wmsInPlan.setWmsInPlanDetailsList(wmsInPlanDetailsList);
wmsInPlanService.updateWmsInPlan(wmsInPlan);
}
// 入库任务
MdItem mdItem = mdItemService.selectMdItemById(zdTask.getmProductId()); MdItem mdItem = mdItemService.selectMdItemById(zdTask.getmProductId());
WmsInTask wmsInTask = new WmsInTask(); WmsInTask wmsInTask = new WmsInTask();
wmsInTask.setPlanInId(wmsInPlan.getPlanId()); wmsInTask.setPlanInId(wmsInPlan.getPlanId().toString());
wmsInTask.setPlanInCode(wmsInPlan.getPlanCode()); wmsInTask.setPlanInCode(generateTaskCode(wmsInPlan.getPlanCode()));
wmsInTask.setMaterialCode(mdItem.getItemCode()); wmsInTask.setMaterialCode(mdItem.getItemCode());
wmsInTask.setTaskInQuantity(zdTask.getProductIdQty()); wmsInTask.setTaskInQuantity(zdTask.getProductIdQty());
wmsInTask.setActualInQuantity(zdTask.getProductIdQty()); wmsInTask.setActualInQuantity(zdTask.getProductIdQty());
WmStorageArea wmStorageArea = wmStorageAreaService.selectWmStorageAreaByAreaCode(zdTask.getAttr3()); WmStorageArea wmStorageArea = wmStorageAreaService.selectWmStorageAreaByAreaCode(zdTask.getAttr3());
wmsInTask.setCellTgt(wmStorageArea.getAreaId()); wmsInTask.setCellTgt(wmStorageArea.getAreaId());
wmsInTask.setBatch("11011"); wmsInTask.setBatch(batchNum);
wmsInTask.setMaterialId(zdTask.getmProductId().toString()); wmsInTask.setMaterialId(zdTask.getmProductId().toString());
wmsInTask.setPlanTypeId("9"); wmsInTask.setPlanTypeId("9");
wmsInTask.setPlanInStatus("1"); wmsInTask.setPlanInStatus("1");
wmsInTaskService.insertWmsInTask(wmsInTask); wmsInTaskService.insertWmsInTask(wmsInTask);
// 更新数量
mdItem.setStandardNumber(mdItem.getStandardNumber() + zdTask.getProductIdQty()); mdItem.setStandardNumber(mdItem.getStandardNumber() + zdTask.getProductIdQty());
mdItemService.updateMdItem(mdItem); mdItemService.updateMdItem(mdItem);
// 更新组装任务
zdTask.setStatus("1"); zdTask.setStatus("1");
zdTask.setQtyOk(zdTask.getProductIdQty()); zdTask.setQtyOk(zdTask.getProductIdQty());
zdTaskService.updateWmsZdTask(zdTask); zdTaskService.updateWmsZdTask(zdTask);

View File

@ -255,10 +255,10 @@ public class MdItemController extends BaseController {
mdItem.setItemTypeName(type.getItemTypeName()); mdItem.setItemTypeName(type.getItemTypeName());
mdItem.setItemOrProduct(type.getItemOrProduct()); mdItem.setItemOrProduct(type.getItemOrProduct());
} }
if (StringUtils.isNotNull(mdItem.getSafeStockFlag()) && "N".equals(mdItem.getSafeStockFlag())) { // if (StringUtils.isNotNull(mdItem.getSafeStockFlag()) && "N".equals(mdItem.getSafeStockFlag())) {
mdItem.setMinStock(0D); // mdItem.setMinStock(0D);
mdItem.setMaxStock(0D); // mdItem.setMaxStock(0D);
} // }
MdUnitMeasure measure = mdUnitMeasureService.selectMdUnitByCode(mdItem.getUnitOfMeasure()); MdUnitMeasure measure = mdUnitMeasureService.selectMdUnitByCode(mdItem.getUnitOfMeasure());
if (StringUtils.isNotNull(measure)) { if (StringUtils.isNotNull(measure)) {
mdItem.setUnitName(measure.getMeasureName()); mdItem.setUnitName(measure.getMeasureName());

View File

@ -9,7 +9,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
* 具台账对象 BASE_KNIFE * 具台账对象 BASE_KNIFE
* *
* @author yinjinlu * @author yinjinlu
* @date 2024-10-31 * @date 2024-10-31
@ -35,15 +35,15 @@ public class BaseKnife extends BaseEntity {
private String rfid; private String rfid;
/** /**
* 具编码 * 具编码
*/ */
@Excel(name = "具编码") @Excel(name = "具编码")
private String knifeCode; private String knifeCode;
/** /**
* 具名称 * 具名称
*/ */
@Excel(name = "具名称") @Excel(name = "具名称")
private String knifeName; private String knifeName;
/** /**
@ -53,16 +53,16 @@ public class BaseKnife extends BaseEntity {
private String knifeUnit; private String knifeUnit;
/** /**
* 具类型物料分类 * 具类型物料分类
*/ */
@Excel(name = "具类型", readConverterExp = "物料分类") @Excel(name = "具类型", readConverterExp = "物料分类")
private String knifeType; private String knifeType;
/** /**
* 安全库存 * 安全库存
*/ */
@Excel(name = "安全库存") @Excel(name = "安全库存")
private String safeStock; private Integer safeStock;
/** /**
* 标准数量 * 标准数量
@ -77,15 +77,15 @@ public class BaseKnife extends BaseEntity {
private String areaCode; private String areaCode;
/** /**
* 具寿命 * 具寿命
*/ */
@Excel(name = "具寿命") @Excel(name = "具寿命")
private String knifeLife; private Integer knifeLife;
/** /**
* 具状态 * 具状态
*/ */
@Excel(name = "具状态") @Excel(name = "具状态")
private Integer knifeFineState; private Integer knifeFineState;
/** /**
@ -262,7 +262,7 @@ public class BaseKnife extends BaseEntity {
this.knifeType = knifeType; this.knifeType = knifeType;
} }
public String getSafeStock() { public Integer getSafeStock() {
return safeStock; return safeStock;
} }
@ -274,7 +274,7 @@ public class BaseKnife extends BaseEntity {
this.itemOrProduct = itemOrProduct; this.itemOrProduct = itemOrProduct;
} }
public void setSafeStock(String safeStock) { public void setSafeStock(Integer safeStock) {
this.safeStock = safeStock; this.safeStock = safeStock;
} }
@ -294,11 +294,11 @@ public class BaseKnife extends BaseEntity {
this.areaCode = areaCode; this.areaCode = areaCode;
} }
public String getKnifeLife() { public Integer getKnifeLife() {
return knifeLife; return knifeLife;
} }
public void setKnifeLife(String knifeLife) { public void setKnifeLife(Integer knifeLife) {
this.knifeLife = knifeLife; this.knifeLife = knifeLife;
} }

View File

@ -46,7 +46,7 @@ public class BaseTechnologyBom extends BaseEntity
/** 消耗定额 */ /** 消耗定额 */
@Excel(name = "消耗定额") @Excel(name = "消耗定额")
private String expendLife; private Integer expendLife;
/** 锁定开始时间 */ /** 锁定开始时间 */
@Excel(name = "锁定开始时间") @Excel(name = "锁定开始时间")
@ -135,12 +135,12 @@ public class BaseTechnologyBom extends BaseEntity
{ {
return knifeCount; return knifeCount;
} }
public void setExpendLife(String expendLife) public void setExpendLife(Integer expendLife)
{ {
this.expendLife = expendLife; this.expendLife = expendLife;
} }
public String getExpendLife() public Integer getExpendLife()
{ {
return expendLife; return expendLife;
} }

View File

@ -34,11 +34,11 @@ public class MdItem extends BaseEntity {
private String itemTypeName; private String itemTypeName;
private String enableFlag; private String enableFlag;
private String safeStockFlag; private String safeStockFlag;
private Double minStock; private Integer minStock;
private Double maxStock; private Double maxStock;
private String highValue; private String highValue;
private Integer attr1; private Integer attr1;
private String attr2; private Integer attr2;
private String attr3; private String attr3;
private String attr4; private String attr4;
@ -163,11 +163,11 @@ public class MdItem extends BaseEntity {
this.safeStockFlag = safeStockFlag; this.safeStockFlag = safeStockFlag;
} }
public Double getMinStock() { public Integer getMinStock() {
return minStock; return minStock;
} }
public void setMinStock(Double minStock) { public void setMinStock(Integer minStock) {
this.minStock = minStock; this.minStock = minStock;
} }
@ -195,11 +195,11 @@ public class MdItem extends BaseEntity {
this.attr1 = attr1; this.attr1 = attr1;
} }
public String getAttr2() { public Integer getAttr2() {
return attr2; return attr2;
} }
public void setAttr2(String attr2) { public void setAttr2(Integer attr2) {
this.attr2 = attr2; this.attr2 = attr2;
} }

View File

@ -101,4 +101,6 @@ public interface WmsOutPlanMapper {
); );
WmsOutPlanDetail selectWmsOutPlanDetailById(Long wmsOutPlanDetailId); WmsOutPlanDetail selectWmsOutPlanDetailById(Long wmsOutPlanDetailId);
WmsOutPlan selectWmsOutPlanByPlanCode(String figureCode);
} }

View File

@ -0,0 +1,104 @@
package com.ktg.mes.wm.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ktg.common.annotation.Log;
import com.ktg.common.core.controller.BaseController;
import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.enums.BusinessType;
import com.ktg.mes.wm.domain.WmsInPlanDetailEntity;
import com.ktg.mes.wm.service.IWmsInPlanDetailEntityService;
import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.common.core.page.TableDataInfo;
/**
* 入库计划明细实体Controller
*
* @author yinjinlu
* @date 2024-11-05
*/
@RestController
@RequestMapping("/wm/wmsInPlanDetailsEntity")
public class WmsInPlanDetailEntityController extends BaseController
{
@Autowired
private IWmsInPlanDetailEntityService wmsInPlanDetailEntityService;
/**
* 查询入库计划明细实体列表
*/
@PreAuthorize("@ss.hasPermi('wm:wmsInPlanDetailsEntity:list')")
@GetMapping("/list")
public TableDataInfo list(WmsInPlanDetailEntity wmsInPlanDetailEntity)
{
startPage();
List<WmsInPlanDetailEntity> list = wmsInPlanDetailEntityService.selectWmsInPlanDetailEntityList(wmsInPlanDetailEntity);
return getDataTable(list);
}
/**
* 导出入库计划明细实体列表
*/
@PreAuthorize("@ss.hasPermi('wm:wmsInPlanDetailsEntity:export')")
@Log(title = "入库计划明细实体", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WmsInPlanDetailEntity wmsInPlanDetailEntity)
{
List<WmsInPlanDetailEntity> list = wmsInPlanDetailEntityService.selectWmsInPlanDetailEntityList(wmsInPlanDetailEntity);
ExcelUtil<WmsInPlanDetailEntity> util = new ExcelUtil<WmsInPlanDetailEntity>(WmsInPlanDetailEntity.class);
util.exportExcel(response, list, "入库计划明细实体数据");
}
/**
* 获取入库计划明细实体详细信息
*/
@PreAuthorize("@ss.hasPermi('wm:wmsInPlanDetailsEntity:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(wmsInPlanDetailEntityService.selectWmsInPlanDetailEntityById(id));
}
/**
* 新增入库计划明细实体
*/
@PreAuthorize("@ss.hasPermi('wm:wmsInPlanDetailsEntity:add')")
@Log(title = "入库计划明细实体", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WmsInPlanDetailEntity wmsInPlanDetailEntity)
{
return toAjax(wmsInPlanDetailEntityService.insertWmsInPlanDetailEntity(wmsInPlanDetailEntity));
}
/**
* 修改入库计划明细实体
*/
@PreAuthorize("@ss.hasPermi('wm:wmsInPlanDetailsEntity:edit')")
@Log(title = "入库计划明细实体", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WmsInPlanDetailEntity wmsInPlanDetailEntity)
{
return toAjax(wmsInPlanDetailEntityService.updateWmsInPlanDetailEntity(wmsInPlanDetailEntity));
}
/**
* 删除入库计划明细实体
*/
@PreAuthorize("@ss.hasPermi('wm:wmsInPlanDetailsEntity:remove')")
@Log(title = "入库计划明细实体", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(wmsInPlanDetailEntityService.deleteWmsInPlanDetailEntityByIds(ids));
}
}

View File

@ -140,9 +140,9 @@ public class WmsInTaskController extends BaseController {
baseKnife.setKnifeUnit(mbbBdMrlMitm.getUnitName()); baseKnife.setKnifeUnit(mbbBdMrlMitm.getUnitName());
baseKnife.setKnifeType(mbbBdMrlMitm.getItemTypeName()); baseKnife.setKnifeType(mbbBdMrlMitm.getItemTypeName());
baseKnife.setAreaCode(wmStorageArea.getAreaCode()); baseKnife.setAreaCode(wmStorageArea.getAreaCode());
baseKnife.setSafeStock(mbbBdMrlMitm.getMinStock().toString().split("\\.")[0]); baseKnife.setSafeStock(mbbBdMrlMitm.getMinStock());
baseKnife.setStandardQuantity("1"); baseKnife.setStandardQuantity("1");
baseKnife.setKnifeLife("100"); baseKnife.setKnifeLife(100);
baseKnife.setKnifeFineState(0); baseKnife.setKnifeFineState(0);
baseKnife.setPlanSheet(""); baseKnife.setPlanSheet("");
baseKnife.setResetCount(mbbBdMrlMitm.getAttr1()); baseKnife.setResetCount(mbbBdMrlMitm.getAttr1());

View File

@ -1,6 +1,7 @@
package com.ktg.mes.wm.domain; package com.ktg.mes.wm.domain;
import java.util.List; import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ktg.common.annotation.Excel; import com.ktg.common.annotation.Excel;
@ -8,358 +9,379 @@ import com.ktg.common.core.domain.BaseEntity;
/** /**
* 入库计划对象 WMS_IN_PLAN * 入库计划对象 WMS_IN_PLAN
* *
* @author yinjinlu * @author yinjinlu
* @date 2024-10-31 * @date 2024-10-31
*/ */
public class WmsInPlan extends BaseEntity public class WmsInPlan extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 主键 */ /**
private String planId; * 主键
*/
private Long planId;
/** 状态[00-新建 20-执行中 40-关闭 45-手工关闭] */ /**
* 状态[00-新建 20-执行中 40-关闭 45-手工关闭]
*/
@Excel(name = "状态[00-新建 20-执行中 40-关闭 45-手工关闭]") @Excel(name = "状态[00-新建 20-执行中 40-关闭 45-手工关闭]")
private String state; private String state;
/** 来源类型[10-接口 20-手工 30-导入] */ /**
* 来源类型[10-接口 20-手工 30-导入]
*/
@Excel(name = "来源类型[10-接口 20-手工 30-导入]") @Excel(name = "来源类型[10-接口 20-手工 30-导入]")
private String sourceType; private String sourceType;
/** 仓库ID */ /**
* 仓库ID
*/
@Excel(name = "仓库ID") @Excel(name = "仓库ID")
private String wareId; private String wareId;
/** 库位编码 */ /**
* 库位编码
*/
@Excel(name = "库位编码") @Excel(name = "库位编码")
private String cellCode; private String cellCode;
/** 工单号 */ /**
* 工单号
*/
@Excel(name = "工单号") @Excel(name = "工单号")
private String workOrderCode; private String workOrderCode;
/** 计划日期 */ /**
* 计划日期
*/
@Excel(name = "计划日期") @Excel(name = "计划日期")
private String expectDate; private String expectDate;
/** 发布人 */ /**
* 发布人
*/
@Excel(name = "发布人") @Excel(name = "发布人")
private String publishName; private String publishName;
/** 发布时间 */ /**
* 发布时间
*/
@Excel(name = "发布时间") @Excel(name = "发布时间")
private String publishTime; private String publishTime;
/** 关闭人(暂不可用) */ /**
* 关闭人(暂不可用)
*/
@Excel(name = "关闭人(暂不可用)") @Excel(name = "关闭人(暂不可用)")
private String closerId; private String closerId;
/** 关闭日期(暂不可用) */ /**
* 关闭日期(暂不可用)
*/
@Excel(name = "关闭日期(暂不可用)") @Excel(name = "关闭日期(暂不可用)")
private String closeTime; private String closeTime;
/** 关联单据号 */ /**
* 关联单据号
*/
@Excel(name = "关联单据号") @Excel(name = "关联单据号")
private String relBillCode; private String relBillCode;
/** 客户ID. */ /**
* 客户ID.
*/
@Excel(name = "客户ID.") @Excel(name = "客户ID.")
private String customerId; private String customerId;
/** 采购单号. */ /**
* 采购单号.
*/
@Excel(name = "采购单号.") @Excel(name = "采购单号.")
private String poCode; private String poCode;
/** 部门ID. */ /**
* 部门ID.
*/
@Excel(name = "部门ID.") @Excel(name = "部门ID.")
private String departmentId; private String departmentId;
/** 合同号. */ /**
* 合同号.
*/
@Excel(name = "合同号.") @Excel(name = "合同号.")
private String contractNo; private String contractNo;
/** 供应商ID. */ /**
* 供应商ID.
*/
@Excel(name = "供应商ID.") @Excel(name = "供应商ID.")
private String supplierId; private String supplierId;
/** 业务类型id. */ /**
* 业务类型id.
*/
@Excel(name = "业务类型id.") @Excel(name = "业务类型id.")
private String businessTypeId; private String businessTypeId;
/** 来源出库任务. */ /**
* 来源出库任务.
*/
@Excel(name = "来源出库任务.") @Excel(name = "来源出库任务.")
private String srcOutTaskId; private String srcOutTaskId;
/** 激活标识(0激活1冻结) */ /**
* 激活标识(0激活1冻结)
*/
@Excel(name = "激活标识(0激活1冻结)") @Excel(name = "激活标识(0激活1冻结)")
private String isActive; private String isActive;
/** 删除标识(0未删除1删除) */ /**
* 删除标识(0未删除1删除)
*/
@Excel(name = "删除标识(0未删除1删除)") @Excel(name = "删除标识(0未删除1删除)")
private String isDelete; private String isDelete;
/** 计划编码 */ /**
* 计划编码
*/
@Excel(name = "计划编码") @Excel(name = "计划编码")
private String planCode; private String planCode;
/** 入库类型 */ /**
* 入库类型
*/
@Excel(name = "入库类型") @Excel(name = "入库类型")
private String planTypeId; private String planTypeId;
/** 入库计划明细信息 */ /**
* 入库计划明细信息
*/
private List<WmsInPlanDetails> wmsInPlanDetailsList; private List<WmsInPlanDetails> wmsInPlanDetailsList;
public void setPlanId(String planId) public void setPlanId(Long planId) {
{
this.planId = planId; this.planId = planId;
} }
public String getPlanId() public Long getPlanId() {
{
return planId; return planId;
} }
public void setState(String state)
{ public void setState(String state) {
this.state = state; this.state = state;
} }
public String getState() public String getState() {
{
return state; return state;
} }
public void setSourceType(String sourceType)
{ public void setSourceType(String sourceType) {
this.sourceType = sourceType; this.sourceType = sourceType;
} }
public String getSourceType() public String getSourceType() {
{
return sourceType; return sourceType;
} }
public void setWareId(String wareId)
{ public void setWareId(String wareId) {
this.wareId = wareId; this.wareId = wareId;
} }
public String getWareId() public String getWareId() {
{
return wareId; return wareId;
} }
public void setCellCode(String cellCode)
{ public void setCellCode(String cellCode) {
this.cellCode = cellCode; this.cellCode = cellCode;
} }
public String getCellCode() public String getCellCode() {
{
return cellCode; return cellCode;
} }
public void setWorkOrderCode(String workOrderCode)
{ public void setWorkOrderCode(String workOrderCode) {
this.workOrderCode = workOrderCode; this.workOrderCode = workOrderCode;
} }
public String getWorkOrderCode() public String getWorkOrderCode() {
{
return workOrderCode; return workOrderCode;
} }
public void setExpectDate(String expectDate)
{ public void setExpectDate(String expectDate) {
this.expectDate = expectDate; this.expectDate = expectDate;
} }
public String getExpectDate() public String getExpectDate() {
{
return expectDate; return expectDate;
} }
public void setPublishName(String publishName)
{ public void setPublishName(String publishName) {
this.publishName = publishName; this.publishName = publishName;
} }
public String getPublishName() public String getPublishName() {
{
return publishName; return publishName;
} }
public void setPublishTime(String publishTime)
{ public void setPublishTime(String publishTime) {
this.publishTime = publishTime; this.publishTime = publishTime;
} }
public String getPublishTime() public String getPublishTime() {
{
return publishTime; return publishTime;
} }
public void setCloserId(String closerId)
{ public void setCloserId(String closerId) {
this.closerId = closerId; this.closerId = closerId;
} }
public String getCloserId() public String getCloserId() {
{
return closerId; return closerId;
} }
public void setCloseTime(String closeTime)
{ public void setCloseTime(String closeTime) {
this.closeTime = closeTime; this.closeTime = closeTime;
} }
public String getCloseTime() public String getCloseTime() {
{
return closeTime; return closeTime;
} }
public void setRelBillCode(String relBillCode)
{ public void setRelBillCode(String relBillCode) {
this.relBillCode = relBillCode; this.relBillCode = relBillCode;
} }
public String getRelBillCode() public String getRelBillCode() {
{
return relBillCode; return relBillCode;
} }
public void setCustomerId(String customerId)
{ public void setCustomerId(String customerId) {
this.customerId = customerId; this.customerId = customerId;
} }
public String getCustomerId() public String getCustomerId() {
{
return customerId; return customerId;
} }
public void setPoCode(String poCode)
{ public void setPoCode(String poCode) {
this.poCode = poCode; this.poCode = poCode;
} }
public String getPoCode() public String getPoCode() {
{
return poCode; return poCode;
} }
public void setDepartmentId(String departmentId)
{ public void setDepartmentId(String departmentId) {
this.departmentId = departmentId; this.departmentId = departmentId;
} }
public String getDepartmentId() public String getDepartmentId() {
{
return departmentId; return departmentId;
} }
public void setContractNo(String contractNo)
{ public void setContractNo(String contractNo) {
this.contractNo = contractNo; this.contractNo = contractNo;
} }
public String getContractNo() public String getContractNo() {
{
return contractNo; return contractNo;
} }
public void setSupplierId(String supplierId)
{ public void setSupplierId(String supplierId) {
this.supplierId = supplierId; this.supplierId = supplierId;
} }
public String getSupplierId() public String getSupplierId() {
{
return supplierId; return supplierId;
} }
public void setBusinessTypeId(String businessTypeId)
{ public void setBusinessTypeId(String businessTypeId) {
this.businessTypeId = businessTypeId; this.businessTypeId = businessTypeId;
} }
public String getBusinessTypeId() public String getBusinessTypeId() {
{
return businessTypeId; return businessTypeId;
} }
public void setSrcOutTaskId(String srcOutTaskId)
{ public void setSrcOutTaskId(String srcOutTaskId) {
this.srcOutTaskId = srcOutTaskId; this.srcOutTaskId = srcOutTaskId;
} }
public String getSrcOutTaskId() public String getSrcOutTaskId() {
{
return srcOutTaskId; return srcOutTaskId;
} }
public void setIsActive(String isActive)
{ public void setIsActive(String isActive) {
this.isActive = isActive; this.isActive = isActive;
} }
public String getIsActive() public String getIsActive() {
{
return isActive; return isActive;
} }
public void setIsDelete(String isDelete)
{ public void setIsDelete(String isDelete) {
this.isDelete = isDelete; this.isDelete = isDelete;
} }
public String getIsDelete() public String getIsDelete() {
{
return isDelete; return isDelete;
} }
public void setPlanCode(String planCode)
{ public void setPlanCode(String planCode) {
this.planCode = planCode; this.planCode = planCode;
} }
public String getPlanCode() public String getPlanCode() {
{
return planCode; return planCode;
} }
public void setPlanTypeId(String planTypeId)
{ public void setPlanTypeId(String planTypeId) {
this.planTypeId = planTypeId; this.planTypeId = planTypeId;
} }
public String getPlanTypeId() public String getPlanTypeId() {
{
return planTypeId; return planTypeId;
} }
public List<WmsInPlanDetails> getWmsInPlanDetailsList() public List<WmsInPlanDetails> getWmsInPlanDetailsList() {
{
return wmsInPlanDetailsList; return wmsInPlanDetailsList;
} }
public void setWmsInPlanDetailsList(List<WmsInPlanDetails> wmsInPlanDetailsList) public void setWmsInPlanDetailsList(List<WmsInPlanDetails> wmsInPlanDetailsList) {
{
this.wmsInPlanDetailsList = wmsInPlanDetailsList; this.wmsInPlanDetailsList = wmsInPlanDetailsList;
} }
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("planId", getPlanId()) .append("planId", getPlanId())
.append("state", getState()) .append("state", getState())
.append("sourceType", getSourceType()) .append("sourceType", getSourceType())
.append("wareId", getWareId()) .append("wareId", getWareId())
.append("cellCode", getCellCode()) .append("cellCode", getCellCode())
.append("workOrderCode", getWorkOrderCode()) .append("workOrderCode", getWorkOrderCode())
.append("expectDate", getExpectDate()) .append("expectDate", getExpectDate())
.append("publishName", getPublishName()) .append("publishName", getPublishName())
.append("publishTime", getPublishTime()) .append("publishTime", getPublishTime())
.append("closerId", getCloserId()) .append("closerId", getCloserId())
.append("closeTime", getCloseTime()) .append("closeTime", getCloseTime())
.append("relBillCode", getRelBillCode()) .append("relBillCode", getRelBillCode())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
.append("remark", getRemark()) .append("remark", getRemark())
.append("customerId", getCustomerId()) .append("customerId", getCustomerId())
.append("poCode", getPoCode()) .append("poCode", getPoCode())
.append("departmentId", getDepartmentId()) .append("departmentId", getDepartmentId())
.append("contractNo", getContractNo()) .append("contractNo", getContractNo())
.append("supplierId", getSupplierId()) .append("supplierId", getSupplierId())
.append("businessTypeId", getBusinessTypeId()) .append("businessTypeId", getBusinessTypeId())
.append("srcOutTaskId", getSrcOutTaskId()) .append("srcOutTaskId", getSrcOutTaskId())
.append("isActive", getIsActive()) .append("isActive", getIsActive())
.append("isDelete", getIsDelete()) .append("isDelete", getIsDelete())
.append("planCode", getPlanCode()) .append("planCode", getPlanCode())
.append("planTypeId", getPlanTypeId()) .append("planTypeId", getPlanTypeId())
.append("wmsInPlanDetailsList", getWmsInPlanDetailsList()) .append("wmsInPlanDetailsList", getWmsInPlanDetailsList())
.toString(); .toString();
} }
} }

View File

@ -0,0 +1,115 @@
package com.ktg.mes.wm.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ktg.common.annotation.Excel;
import com.ktg.common.core.domain.BaseEntity;
/**
* 入库计划明细实体对象 WMS_IN_PLAN_DETAIL_ENTITY
*
* @author yinjinlu
* @date 2024-11-05
*/
public class WmsInPlanDetailEntity extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* $column.columnComment
*/
private Long id;
/**
* 入库计划ID
*/
@Excel(name = "入库计划ID")
private Long planId;
/**
* 入库计划明细ID
*/
@Excel(name = "入库计划明细ID")
private Long planDetailsId;
/**
* 来源
*/
@Excel(name = "来源")
private String source;
/**
* 台账ID
*/
@Excel(name = "台账ID")
private Long knifeId;
/**
* 消耗寿命
*/
@Excel(name = "消耗寿命")
private Integer consumeLife;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setPlanId(Long planId) {
this.planId = planId;
}
public Long getPlanId() {
return planId;
}
public void setPlanDetailsId(Long planDetailsId) {
this.planDetailsId = planDetailsId;
}
public Long getPlanDetailsId() {
return planDetailsId;
}
public void setSource(String source) {
this.source = source;
}
public String getSource() {
return source;
}
public void setKnifeId(Long knifeId) {
this.knifeId = knifeId;
}
public Long getKnifeId() {
return knifeId;
}
public void setConsumeLife(Integer consumeLife) {
this.consumeLife = consumeLife;
}
public Integer getConsumeLife() {
return consumeLife;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("planId", getPlanId())
.append("planDetailsId", getPlanDetailsId())
.append("source", getSource())
.append("knifeId", getKnifeId())
.append("consumeLife", getConsumeLife())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.ktg.common.annotation.Excel; import com.ktg.common.annotation.Excel;
import com.ktg.common.core.domain.BaseEntity; import com.ktg.common.core.domain.BaseEntity;
import java.util.List;
/** /**
* 入库计划明细对象 WMS_IN_PLAN_DETAILS * 入库计划明细对象 WMS_IN_PLAN_DETAILS
* *
@ -20,9 +22,11 @@ public class WmsInPlanDetails extends BaseEntity
/** 入库计划ID */ /** 入库计划ID */
@Excel(name = "入库计划ID") @Excel(name = "入库计划ID")
private String planId; private Long planId;
/** 物料ID */ /**
* 物料ID
*/
@Excel(name = "物料ID") @Excel(name = "物料ID")
private String materialId; private String materialId;
@ -54,8 +58,9 @@ public class WmsInPlanDetails extends BaseEntity
@Excel(name = "删除标识(0未删除1删除)") @Excel(name = "删除标识(0未删除1删除)")
private String isDelete; private String isDelete;
public void setDetailsId(Long detailsId) private List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList;
{
public void setDetailsId(Long detailsId) {
this.detailsId = detailsId; this.detailsId = detailsId;
} }
@ -63,13 +68,12 @@ public class WmsInPlanDetails extends BaseEntity
{ {
return detailsId; return detailsId;
} }
public void setPlanId(String planId)
{ public void setPlanId(Long planId) {
this.planId = planId; this.planId = planId;
} }
public String getPlanId() public Long getPlanId() {
{
return planId; return planId;
} }
public void setMaterialId(String materialId) public void setMaterialId(String materialId)
@ -145,24 +149,33 @@ public class WmsInPlanDetails extends BaseEntity
return isDelete; return isDelete;
} }
public List<WmsInPlanDetailEntity> getWmsInPlanDetailEntityList() {
return wmsInPlanDetailEntityList;
}
public void setWmsInPlanDetailEntityList(List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList) {
this.wmsInPlanDetailEntityList = wmsInPlanDetailEntityList;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("detailsId", getDetailsId()) .append("detailsId", getDetailsId())
.append("planId", getPlanId()) .append("planId", getPlanId())
.append("materialId", getMaterialId()) .append("materialId", getMaterialId())
.append("batch", getBatch()) .append("batch", getBatch())
.append("cellId", getCellId()) .append("cellId", getCellId())
.append("quantity", getQuantity()) .append("quantity", getQuantity())
.append("quantityIn", getQuantityIn()) .append("quantityIn", getQuantityIn())
.append("planInStatus", getPlanInStatus()) .append("planInStatus", getPlanInStatus())
.append("remark", getRemark()) .append("remark", getRemark())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.append("isActivy", getIsActivy()) .append("isActivy", getIsActivy())
.append("isDelete", getIsDelete()) .append("isDelete", getIsDelete())
.toString(); .append("wmsInPlanDetailEntityList", getWmsInPlanDetailEntityList())
.toString();
} }
} }

View File

@ -16,7 +16,7 @@ public class WmsInTask extends BaseEntity
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 主键 */ /** 主键 */
private String id; private Long id;
/** 任务编码 */ /** 任务编码 */
@Excel(name = "任务编码") @Excel(name = "任务编码")
@ -44,7 +44,7 @@ public class WmsInTask extends BaseEntity
/** 是否激活 */ /** 是否激活 */
@Excel(name = "是否激活") @Excel(name = "是否激活")
private String isActivy; private String isActive;
/** 是否删除 */ /** 是否删除 */
@Excel(name = "是否删除") @Excel(name = "是否删除")
@ -74,12 +74,16 @@ public class WmsInTask extends BaseEntity
@Excel(name = "物料编码") @Excel(name = "物料编码")
private String materialCode; private String materialCode;
public void setId(String id) /** 入库明细ID */
@Excel(name = "入库明细ID")
private Long detailInId;
public void setId(Long id)
{ {
this.id = id; this.id = id;
} }
public String getId() public Long getId()
{ {
return id; return id;
} }
@ -137,14 +141,14 @@ public class WmsInTask extends BaseEntity
{ {
return cellOrig; return cellOrig;
} }
public void setIsActivy(String isActivy) public void setIsActive(String isActivy)
{ {
this.isActivy = isActivy; this.isActive = isActivy;
} }
public String getIsActivy() public String getIsActive()
{ {
return isActivy; return isActive;
} }
public void setIsDelete(String isDelete) public void setIsDelete(String isDelete)
{ {
@ -210,6 +214,14 @@ public class WmsInTask extends BaseEntity
return materialCode; return materialCode;
} }
public Long getDetailInId() {
return detailInId;
}
public void setDetailInId(Long detailInId) {
this.detailInId = detailInId;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -225,7 +237,7 @@ public class WmsInTask extends BaseEntity
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.append("isActivy", getIsActivy()) .append("isActive", getIsActive())
.append("isDelete", getIsDelete()) .append("isDelete", getIsDelete())
.append("batch", getBatch()) .append("batch", getBatch())
.append("materialId", getMaterialId()) .append("materialId", getMaterialId())
@ -233,6 +245,7 @@ public class WmsInTask extends BaseEntity
.append("planInStatus", getPlanInStatus()) .append("planInStatus", getPlanInStatus())
.append("planInCode", getPlanInCode()) .append("planInCode", getPlanInCode())
.append("materialCode", getMaterialCode()) .append("materialCode", getMaterialCode())
.append("detailInId", getDetailInId())
.toString(); .toString();
} }
} }

View File

@ -1,5 +1,6 @@
package com.ktg.mes.wm.domain; package com.ktg.mes.wm.domain;
import com.ktg.mes.md.domain.BaseTechnologyBom;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ktg.common.annotation.Excel; import com.ktg.common.annotation.Excel;
@ -53,6 +54,8 @@ public class WmsZdTask extends BaseEntity
@Excel(name = "预留字段1") @Excel(name = "预留字段1")
private Long attr1; private Long attr1;
private String planSheet;
/** 预留字段2 */ /** 预留字段2 */
@Excel(name = "预留字段2") @Excel(name = "预留字段2")
private String attr2; private String attr2;
@ -196,6 +199,14 @@ public class WmsZdTask extends BaseEntity
return status; return status;
} }
public String getPlanSheet() {
return planSheet;
}
public void setPlanSheet(String planSheet) {
this.planSheet = planSheet;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -0,0 +1,83 @@
package com.ktg.mes.wm.mapper;
import java.util.List;
import com.ktg.mes.wm.domain.WmsInPlanDetailEntity;
/**
* 入库计划明细实体Mapper接口
*
* @author yinjinlu
* @date 2024-11-05
*/
public interface WmsInPlanDetailEntityMapper
{
/**
* 查询入库计划明细实体
*
* @param id 入库计划明细实体主键
* @return 入库计划明细实体
*/
public WmsInPlanDetailEntity selectWmsInPlanDetailEntityById(Long id);
/**
* 根据入库计划明细 id查询
* @param id 入库计划明细主键
* @return 入库计划明细实体
*/
public WmsInPlanDetailEntity selectWmsInPlanDetailEntityByPlanDetailsId(Long id);
/**
* 查询入库计划明细实体列表
*
* @param wmsInPlanDetailEntity 入库计划明细实体
* @return 入库计划明细实体集合
*/
public List<WmsInPlanDetailEntity> selectWmsInPlanDetailEntityList(WmsInPlanDetailEntity wmsInPlanDetailEntity);
/**
* 新增入库计划明细实体
*
* @param wmsInPlanDetailEntity 入库计划明细实体
* @return 结果
*/
public int insertWmsInPlanDetailEntity(WmsInPlanDetailEntity wmsInPlanDetailEntity);
/**
* 修改入库计划明细实体
*
* @param wmsInPlanDetailEntity 入库计划明细实体
* @return 结果
*/
public int updateWmsInPlanDetailEntity(WmsInPlanDetailEntity wmsInPlanDetailEntity);
/**
* 删除入库计划明细实体
*
* @param id 入库计划明细实体主键
* @return 结果
*/
public int deleteWmsInPlanDetailEntityById(Long id);
/**
* 批量删除入库计划明细实体
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteWmsInPlanDetailEntityByIds(Long[] ids);
/**
* 删除入库计划明细实体 根据入库计划明细ID
*
* @param id 入库计划明细主键
* @return 结果
*/
public int deleteWmsInPlanDetailEntityByPlanDetailsId(Long id);
/**
* 批量插入入库计划明细实例
* @param wmsInPlanDetailEntityList 入库计划明细实例集合
* @return 结果
*/
public int batchWmsInPlanDetailEntity(List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList);
}

View File

@ -84,4 +84,6 @@ public interface WmsInPlanMapper
* @return 结果 * @return 结果
*/ */
public int deleteWmsInPlanDetailsByPlanId(String planId); public int deleteWmsInPlanDetailsByPlanId(String planId);
WmsInPlan selectWmsInPlanByPlanCode(String planCode);
} }

View File

@ -0,0 +1,69 @@
package com.ktg.mes.wm.service;
import java.util.List;
import com.ktg.mes.wm.domain.WmsInPlanDetailEntity;
/**
* 入库计划明细实体Service接口
*
* @author yinjinlu
* @date 2024-11-05
*/
public interface IWmsInPlanDetailEntityService
{
/**
* 查询入库计划明细实体
*
* @param id 入库计划明细实体主键
* @return 入库计划明细实体
*/
public WmsInPlanDetailEntity selectWmsInPlanDetailEntityById(Long id);
/**
* 根据入库计划明细ID 查询入库计划明细实体
*
* @param id 入库计划明细主键
* @return 入库计划明细实体
*/
public WmsInPlanDetailEntity selectWmsInPlanDetailEntityByPlanDetailsId(Long id);
/**
* 查询入库计划明细实体列表
*
* @param wmsInPlanDetailEntity 入库计划明细实体
* @return 入库计划明细实体集合
*/
public List<WmsInPlanDetailEntity> selectWmsInPlanDetailEntityList(WmsInPlanDetailEntity wmsInPlanDetailEntity);
/**
* 新增入库计划明细实体
*
* @param wmsInPlanDetailEntity 入库计划明细实体
* @return 结果
*/
public int insertWmsInPlanDetailEntity(WmsInPlanDetailEntity wmsInPlanDetailEntity);
/**
* 修改入库计划明细实体
*
* @param wmsInPlanDetailEntity 入库计划明细实体
* @return 结果
*/
public int updateWmsInPlanDetailEntity(WmsInPlanDetailEntity wmsInPlanDetailEntity);
/**
* 批量删除入库计划明细实体
*
* @param ids 需要删除的入库计划明细实体主键集合
* @return 结果
*/
public int deleteWmsInPlanDetailEntityByIds(Long[] ids);
/**
* 删除入库计划明细实体信息
*
* @param id 入库计划明细实体主键
* @return 结果
*/
public int deleteWmsInPlanDetailEntityById(Long id);
}

View File

@ -19,6 +19,8 @@ public interface IWmsInPlanService
*/ */
public WmsInPlan selectWmsInPlanByPlanId(String planId); public WmsInPlan selectWmsInPlanByPlanId(String planId);
WmsInPlan selectWmsInPlanByPlanCode(String planCode);
/** /**
* 查询入库计划列表 * 查询入库计划列表
* *
@ -58,4 +60,5 @@ public interface IWmsInPlanService
* @return 结果 * @return 结果
*/ */
public int deleteWmsInPlanByPlanId(String planId); public int deleteWmsInPlanByPlanId(String planId);
} }

View File

@ -0,0 +1,107 @@
package com.ktg.mes.wm.service.impl;
import java.util.List;
import com.ktg.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ktg.mes.wm.mapper.WmsInPlanDetailEntityMapper;
import com.ktg.mes.wm.domain.WmsInPlanDetailEntity;
import com.ktg.mes.wm.service.IWmsInPlanDetailEntityService;
/**
* 入库计划明细实体Service业务层处理
*
* @author yinjinlu
* @date 2024-11-05
*/
@Service
public class WmsInPlanDetailEntityServiceImpl implements IWmsInPlanDetailEntityService
{
@Autowired
private WmsInPlanDetailEntityMapper wmsInPlanDetailEntityMapper;
/**
* 查询入库计划明细实体
*
* @param id 入库计划明细实体主键
* @return 入库计划明细实体
*/
@Override
public WmsInPlanDetailEntity selectWmsInPlanDetailEntityById(Long id)
{
return wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityById(id);
}
/**
* 根据入库计划明细ID 查询入库计划明细实体
*
* @param id 入库计划明细主键
* @return 入库计划明细实体
*/
@Override
public WmsInPlanDetailEntity selectWmsInPlanDetailEntityByPlanDetailsId(Long id) {
return wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityByPlanDetailsId(id);
}
/**
* 查询入库计划明细实体列表
*
* @param wmsInPlanDetailEntity 入库计划明细实体
* @return 入库计划明细实体
*/
@Override
public List<WmsInPlanDetailEntity> selectWmsInPlanDetailEntityList(WmsInPlanDetailEntity wmsInPlanDetailEntity)
{
return wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityList(wmsInPlanDetailEntity);
}
/**
* 新增入库计划明细实体
*
* @param wmsInPlanDetailEntity 入库计划明细实体
* @return 结果
*/
@Override
public int insertWmsInPlanDetailEntity(WmsInPlanDetailEntity wmsInPlanDetailEntity)
{
wmsInPlanDetailEntity.setCreateTime(DateUtils.getNowDate());
return wmsInPlanDetailEntityMapper.insertWmsInPlanDetailEntity(wmsInPlanDetailEntity);
}
/**
* 修改入库计划明细实体
*
* @param wmsInPlanDetailEntity 入库计划明细实体
* @return 结果
*/
@Override
public int updateWmsInPlanDetailEntity(WmsInPlanDetailEntity wmsInPlanDetailEntity)
{
wmsInPlanDetailEntity.setUpdateTime(DateUtils.getNowDate());
return wmsInPlanDetailEntityMapper.updateWmsInPlanDetailEntity(wmsInPlanDetailEntity);
}
/**
* 批量删除入库计划明细实体
*
* @param ids 需要删除的入库计划明细实体主键
* @return 结果
*/
@Override
public int deleteWmsInPlanDetailEntityByIds(Long[] ids)
{
return wmsInPlanDetailEntityMapper.deleteWmsInPlanDetailEntityByIds(ids);
}
/**
* 删除入库计划明细实体信息
*
* @param id 入库计划明细实体主键
* @return 结果
*/
@Override
public int deleteWmsInPlanDetailEntityById(Long id)
{
return wmsInPlanDetailEntityMapper.deleteWmsInPlanDetailEntityById(id);
}
}

View File

@ -1,10 +1,15 @@
package com.ktg.mes.wm.service.impl; package com.ktg.mes.wm.service.impl;
import java.util.List; import java.util.List;
import com.ktg.common.utils.DateUtils; import com.ktg.common.utils.DateUtils;
import com.ktg.mes.wm.domain.WmsInPlanDetailEntity;
import com.ktg.mes.wm.mapper.WmsInPlanDetailEntityMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import com.ktg.common.utils.StringUtils; import com.ktg.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import com.ktg.mes.wm.domain.WmsInPlanDetails; import com.ktg.mes.wm.domain.WmsInPlanDetails;
@ -14,50 +19,54 @@ import com.ktg.mes.wm.service.IWmsInPlanService;
/** /**
* 入库计划Service业务层处理 * 入库计划Service业务层处理
* *
* @author yinjinlu * @author yinjinlu
* @date 2024-10-31 * @date 2024-10-31
*/ */
@Service @Service
public class WmsInPlanServiceImpl implements IWmsInPlanService public class WmsInPlanServiceImpl implements IWmsInPlanService {
{
@Autowired @Autowired
private WmsInPlanMapper wmsInPlanMapper; private WmsInPlanMapper wmsInPlanMapper;
@Autowired
private WmsInPlanDetailEntityMapper wmsInPlanDetailEntityMapper;
/** /**
* 查询入库计划 * 查询入库计划
* *
* @param planId 入库计划主键 * @param planId 入库计划主键
* @return 入库计划 * @return 入库计划
*/ */
@Override @Override
public WmsInPlan selectWmsInPlanByPlanId(String planId) public WmsInPlan selectWmsInPlanByPlanId(String planId) {
{
return wmsInPlanMapper.selectWmsInPlanByPlanId(planId); return wmsInPlanMapper.selectWmsInPlanByPlanId(planId);
} }
@Override
public WmsInPlan selectWmsInPlanByPlanCode(String planCode) {
return wmsInPlanMapper.selectWmsInPlanByPlanCode(planCode);
}
/** /**
* 查询入库计划列表 * 查询入库计划列表
* *
* @param wmsInPlan 入库计划 * @param wmsInPlan 入库计划
* @return 入库计划 * @return 入库计划
*/ */
@Override @Override
public List<WmsInPlan> selectWmsInPlanList(WmsInPlan wmsInPlan) public List<WmsInPlan> selectWmsInPlanList(WmsInPlan wmsInPlan) {
{
return wmsInPlanMapper.selectWmsInPlanList(wmsInPlan); return wmsInPlanMapper.selectWmsInPlanList(wmsInPlan);
} }
/** /**
* 新增入库计划 * 新增入库计划
* *
* @param wmsInPlan 入库计划 * @param wmsInPlan 入库计划
* @return 结果 * @return 结果
*/ */
@Transactional @Transactional
@Override @Override
public int insertWmsInPlan(WmsInPlan wmsInPlan) public int insertWmsInPlan(WmsInPlan wmsInPlan) {
{
wmsInPlan.setCreateTime(DateUtils.getNowDate()); wmsInPlan.setCreateTime(DateUtils.getNowDate());
int rows = wmsInPlanMapper.insertWmsInPlan(wmsInPlan); int rows = wmsInPlanMapper.insertWmsInPlan(wmsInPlan);
insertWmsInPlanDetails(wmsInPlan); insertWmsInPlanDetails(wmsInPlan);
@ -66,69 +75,89 @@ public class WmsInPlanServiceImpl implements IWmsInPlanService
/** /**
* 修改入库计划 * 修改入库计划
* *
* @param wmsInPlan 入库计划 * @param wmsInPlan 入库计划
* @return 结果 * @return 结果
*/ */
@Transactional @Transactional
@Override @Override
public int updateWmsInPlan(WmsInPlan wmsInPlan) public int updateWmsInPlan(WmsInPlan wmsInPlan) {
{
wmsInPlan.setUpdateTime(DateUtils.getNowDate()); wmsInPlan.setUpdateTime(DateUtils.getNowDate());
wmsInPlanMapper.deleteWmsInPlanDetailsByPlanId(wmsInPlan.getPlanId()); wmsInPlanMapper.deleteWmsInPlanDetailsByPlanId(wmsInPlan.getPlanId().toString());
insertWmsInPlanDetails(wmsInPlan); insertWmsInPlanDetails(wmsInPlan);
return wmsInPlanMapper.updateWmsInPlan(wmsInPlan); return wmsInPlanMapper.updateWmsInPlan(wmsInPlan);
} }
/** /**
* 批量删除入库计划 * 批量删除入库计划
* *
* @param planIds 需要删除的入库计划主键 * @param planIds 需要删除的入库计划主键
* @return 结果 * @return 结果
*/ */
@Transactional @Transactional
@Override @Override
public int deleteWmsInPlanByPlanIds(String[] planIds) public int deleteWmsInPlanByPlanIds(String[] planIds) {
{
wmsInPlanMapper.deleteWmsInPlanDetailsByPlanIds(planIds); wmsInPlanMapper.deleteWmsInPlanDetailsByPlanIds(planIds);
return wmsInPlanMapper.deleteWmsInPlanByPlanIds(planIds); return wmsInPlanMapper.deleteWmsInPlanByPlanIds(planIds);
} }
/** /**
* 删除入库计划信息 * 删除入库计划信息
* *
* @param planId 入库计划主键 * @param planId 入库计划主键
* @return 结果 * @return 结果
*/ */
@Transactional @Transactional
@Override @Override
public int deleteWmsInPlanByPlanId(String planId) public int deleteWmsInPlanByPlanId(String planId) {
{
wmsInPlanMapper.deleteWmsInPlanDetailsByPlanId(planId); wmsInPlanMapper.deleteWmsInPlanDetailsByPlanId(planId);
return wmsInPlanMapper.deleteWmsInPlanByPlanId(planId); return wmsInPlanMapper.deleteWmsInPlanByPlanId(planId);
} }
/** /**
* 新增入库计划明细信息 * 新增入库计划明细信息
* *
* @param wmsInPlan 入库计划对象 * @param wmsInPlan 入库计划对象
*/ */
public void insertWmsInPlanDetails(WmsInPlan wmsInPlan) public void insertWmsInPlanDetails(WmsInPlan wmsInPlan) {
{
List<WmsInPlanDetails> wmsInPlanDetailsList = wmsInPlan.getWmsInPlanDetailsList(); List<WmsInPlanDetails> wmsInPlanDetailsList = wmsInPlan.getWmsInPlanDetailsList();
String planId = wmsInPlan.getPlanId(); Long planId = wmsInPlan.getPlanId();
if (StringUtils.isNotNull(wmsInPlanDetailsList)) if (StringUtils.isNotNull(wmsInPlanDetailsList)) {
{
List<WmsInPlanDetails> list = new ArrayList<WmsInPlanDetails>(); List<WmsInPlanDetails> list = new ArrayList<WmsInPlanDetails>();
for (WmsInPlanDetails wmsInPlanDetails : wmsInPlanDetailsList) for (WmsInPlanDetails wmsInPlanDetails : wmsInPlanDetailsList) {
{
wmsInPlanDetails.setPlanId(planId); wmsInPlanDetails.setPlanId(planId);
list.add(wmsInPlanDetails); list.add(wmsInPlanDetails);
// 插入入库任务明细实例
wmsInPlanDetailEntityMapper.deleteWmsInPlanDetailEntityByPlanDetailsId(wmsInPlanDetails.getDetailsId());
insertWmsInPlanDetailEntity(wmsInPlanDetails);
} }
if (list.size() > 0) if (!list.isEmpty()) {
{
wmsInPlanMapper.batchWmsInPlanDetails(list); wmsInPlanMapper.batchWmsInPlanDetails(list);
} }
} }
} }
/**
* 新增入库计划明细实例
*
* @param wmsInPlanDetails 入库计划明细对象
*/
public void insertWmsInPlanDetailEntity(WmsInPlanDetails wmsInPlanDetails) {
List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList = wmsInPlanDetails.getWmsInPlanDetailEntityList();
Long planId = wmsInPlanDetails.getPlanId();
Long planDetailsId = wmsInPlanDetails.getDetailsId();
if (StringUtils.isNotNull(wmsInPlanDetailEntityList)) {
ArrayList<WmsInPlanDetailEntity> list = new ArrayList<>();
for (WmsInPlanDetailEntity wmsInPlanDetailEntity : wmsInPlanDetailEntityList) {
wmsInPlanDetailEntity.setPlanId(planId);
wmsInPlanDetailEntity.setPlanDetailsId(planDetailsId);
list.add(wmsInPlanDetailEntity);
}
if (!list.isEmpty()) {
wmsInPlanDetailEntityMapper.batchWmsInPlanDetailEntity(list);
}
}
}
} }

View File

@ -83,7 +83,6 @@
BK.IS_LOCKED, BK.IS_LOCKED,
BK.LOCKED_START_TIME, BK.LOCKED_START_TIME,
BK.LOCKED_END_TIME, BK.LOCKED_END_TIME,
BK.PLAN_SHEET,
BK.RESET_COUNT, BK.RESET_COUNT,
BK.ITEM_OR_PRODUCT, BK.ITEM_OR_PRODUCT,
BK.REMARK, BK.REMARK,
@ -94,10 +93,12 @@
BK.CREATE_BY, BK.CREATE_BY,
BK.CREATE_TIME, BK.CREATE_TIME,
BK.UPDATE_BY, BK.UPDATE_BY,
BK.UPDATE_TIME BK.UPDATE_TIME,
BTB.FIGURE_CODE PLAN_SHEET
from BASE_KNIFE BK from BASE_KNIFE BK
LEFT JOIN MD_ITEM MI on BK.MBB_BD_MRL_ID = MI.ITEM_ID LEFT JOIN MD_ITEM MI on BK.MBB_BD_MRL_ID = MI.ITEM_ID
LEFT JOIN MD_ITEM_TYPE MIT ON MI.ITEM_TYPE_ID = MIT.ITEM_TYPE_ID LEFT JOIN MD_ITEM_TYPE MIT ON MI.ITEM_TYPE_ID = MIT.ITEM_TYPE_ID
LEFT JOIN BASE_TECHNOLOGY_BOM BTB ON BTB.TECHNOLOGY_BOM_ID = BK.PLAN_SHEET
</sql> </sql>
<select id="selectBaseKnifeList" parameterType="BaseKnife" resultMap="BaseKnifeResult"> <select id="selectBaseKnifeList" parameterType="BaseKnife" resultMap="BaseKnifeResult">
@ -559,7 +560,7 @@
<select id="countBaseKnife" resultType="java.lang.Long"> <select id="countBaseKnife" resultType="java.lang.Long">
SELECT COUNT(*) SELECT COUNT(*)
FROM BASE_KNIFE BK FROM BASE_KNIFE BK
WHERE MBB_BD_MRL_ID = #{mbbBdMrlId} WHERE MBB_BD_MRL_ID = #{mbbBdMrlId} AND KNIFE_FINE_STATE = 0 OR KNIFE_FINE_STATE = 1
</select> </select>
<select id="selectScrapList" resultMap="BaseKnifeResult"> <select id="selectScrapList" resultMap="BaseKnifeResult">

View File

@ -154,9 +154,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<insert id="batchMbbProduBom"> <insert id="batchMbbProduBom">
insert into MBB_PRODU_BOM( MBB_PRODU_BOM_ID, BOM_ROUTE_ID, MD_ITEM_ID, MD_ITEM_NAME, MD_ITEM_CODE, MD_ITEM_UNIT, STANDARD_DOSAGE, REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME) values insert into MBB_PRODU_BOM( BOM_ROUTE_ID, MD_ITEM_ID, MD_ITEM_NAME, MD_ITEM_CODE, MD_ITEM_UNIT, STANDARD_DOSAGE, REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME) values
<foreach item="item" index="index" collection="list" separator=","> <foreach item="item" index="index" collection="list" separator=",">
( #{item.mbbProduBomId}, #{item.bomRouteId}, #{item.mdItemId}, #{item.mdItemName}, #{item.mdItemCode}, #{item.mdItemUnit}, #{item.standardDosage}, #{item.remark}, #{item.attr1}, #{item.attr2}, #{item.attr3}, #{item.attr4}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}) ( #{item.bomRouteId}, #{item.mdItemId}, #{item.mdItemName}, #{item.mdItemCode}, #{item.mdItemUnit}, #{item.standardDosage}, #{item.remark}, #{item.attr1}, #{item.attr2}, #{item.attr3}, #{item.attr4}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
</foreach> </foreach>
</insert> </insert>
</mapper> </mapper>

View File

@ -51,6 +51,7 @@
max_stock, max_stock,
high_value, high_value,
attr1, attr1,
attr2,
create_by, create_by,
create_time, create_time,
remark remark
@ -183,22 +184,19 @@
enable_flag, enable_flag,
</if> </if>
safe_stock_flag, safe_stock_flag,
<if test="safeStockFlag == 'Y'.toString()"> <if test="minStock != null and minStock != ''">
min_stock, min_stock,
</if> </if>
<if test="safeStockFlag == 'Y'.toString()">
max_stock,
</if>
<if test="highValue != null and highValue != ''"> <if test="highValue != null and highValue != ''">
high_value, high_value,
</if> </if>
<if test="remark != null and remark != ''"> <if test="remark != null and remark != ''">
remark, remark,
</if> </if>
<if test="attr1 != null and attr1 != ''"> <if test="attr1 != null">
attr1, attr1,
</if> </if>
<if test="attr2 != null and attr2 != ''"> <if test="attr2 != null">
attr2, attr2,
</if> </if>
<if test="attr3 != null and attr3 != 0"> <if test="attr3 != null and attr3 != 0">
@ -238,22 +236,19 @@
#{enableFlag}, #{enableFlag},
</if> </if>
#{safeStockFlag}, #{safeStockFlag},
<if test="safeStockFlag == 'Y'.toString() and minStock != null"> <if test="minStock != null and minStock != ''">
#{minStock}, #{minStock},
</if> </if>
<if test="safeStockFlag == 'Y'.toString() and safeStockFlag != null">
#{maxStock},
</if>
<if test="highValue != null and highValue != ''"> <if test="highValue != null and highValue != ''">
#{highValue}, #{highValue},
</if> </if>
<if test="remark != null and remark != ''"> <if test="remark != null and remark != ''">
#{remark}, #{remark},
</if> </if>
<if test="attr1 != null and attr1 != ''"> <if test="attr1 != null">
#{attr1}, #{attr1},
</if> </if>
<if test="attr2 != null and attr2 != ''"> <if test="attr2 != null">
#{attr2}, #{attr2},
</if> </if>
<if test="attr3 != null and attr3 != 0"> <if test="attr3 != null and attr3 != 0">
@ -319,10 +314,10 @@
<if test="remark != null and remark != ''"> <if test="remark != null and remark != ''">
remark = #{remark}, remark = #{remark},
</if> </if>
<if test="attr1 != null and attr1 != ''"> <if test="attr1 != null">
attr1=#{attr1}, attr1=#{attr1},
</if> </if>
<if test="attr2 != null and attr2 != ''"> <if test="attr2 != null">
attr2=#{attr2}, attr2=#{attr2},
</if> </if>
<if test="attr3 != null and attr3 != 0"> <if test="attr3 != null and attr3 != 0">

View File

@ -344,13 +344,13 @@
</delete> </delete>
<insert id="batchWmsOutPlanDetail"> <insert id="batchWmsOutPlanDetail">
insert into WMS_OUT_PLAN_DETAIL(WMS_OUT_PLAN_DETAIL_ID, WMS_OUT_PLAN_ID, MD_ITEM_ID, MD_ITEM_CODE, MD_ITEM_NAME, insert into WMS_OUT_PLAN_DETAIL( WMS_OUT_PLAN_ID, MD_ITEM_ID, MD_ITEM_CODE, MD_ITEM_NAME,
MD_ITEM_UNIT, PLANNED_QUANTITY, REAL_QUANTITY, DETAIL_BATCH_NUM, MD_ITEM_UNIT, PLANNED_QUANTITY, REAL_QUANTITY, DETAIL_BATCH_NUM,
WM_STORAGE_AREA_ID, WM_STORAGE_AREA_CODE, WM_STORAGE_AREA_NAME, DETAIL_STATE, WM_STORAGE_AREA_ID, WM_STORAGE_AREA_CODE, WM_STORAGE_AREA_NAME, DETAIL_STATE,
REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY,
UPDATE_TIME) values UPDATE_TIME) values
<foreach item="item" index="index" collection="list" separator=","> <foreach item="item" index="index" collection="list" separator=",">
(#{item.wmsOutPlanDetailId}, #{item.wmsOutPlanId}, #{item.mdItemId}, #{item.mdItemCode}, #{item.mdItemName}, ( #{item.wmsOutPlanId}, #{item.mdItemId}, #{item.mdItemCode}, #{item.mdItemName},
#{item.mdItemUnit}, #{item.plannedQuantity}, #{item.realQuantity}, #{item.detailBatchNum}, #{item.mdItemUnit}, #{item.plannedQuantity}, #{item.realQuantity}, #{item.detailBatchNum},
#{item.wmStorageAreaId}, #{item.wmStorageAreaCode}, #{item.wmStorageAreaName}, #{item.detailState}, #{item.wmStorageAreaId}, #{item.wmStorageAreaCode}, #{item.wmStorageAreaName}, #{item.detailState},
#{item.remark}, #{item.attr1}, #{item.attr2}, #{item.attr3}, #{item.attr4}, #{item.createBy}, #{item.remark}, #{item.attr1}, #{item.attr2}, #{item.attr3}, #{item.attr4}, #{item.createBy},
@ -360,12 +360,12 @@
<insert id="insertWmsOutPlanDetail" parameterType="WmsOutPlanDetail" useGeneratedKeys="true" <insert id="insertWmsOutPlanDetail" parameterType="WmsOutPlanDetail" useGeneratedKeys="true"
keyProperty="wmsOutPlanDetailId"> keyProperty="wmsOutPlanDetailId">
insert into WMS_OUT_PLAN_DETAIL(WMS_OUT_PLAN_DETAIL_ID, WMS_OUT_PLAN_ID, MD_ITEM_ID, MD_ITEM_CODE, MD_ITEM_NAME, insert into WMS_OUT_PLAN_DETAIL( WMS_OUT_PLAN_ID, MD_ITEM_ID, MD_ITEM_CODE, MD_ITEM_NAME,
MD_ITEM_UNIT, PLANNED_QUANTITY, REAL_QUANTITY, DETAIL_BATCH_NUM, MD_ITEM_UNIT, PLANNED_QUANTITY, REAL_QUANTITY, DETAIL_BATCH_NUM,
WM_STORAGE_AREA_ID, WM_STORAGE_AREA_CODE, WM_STORAGE_AREA_NAME, DETAIL_STATE, WM_STORAGE_AREA_ID, WM_STORAGE_AREA_CODE, WM_STORAGE_AREA_NAME, DETAIL_STATE,
REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY,
UPDATE_TIME) UPDATE_TIME)
values (#{wmsOutPlanDetailId}, #{wmsOutPlanId}, #{mdItemId}, #{mdItemCode}, #{mdItemName}, values ( #{wmsOutPlanId}, #{mdItemId}, #{mdItemCode}, #{mdItemName},
#{mdItemUnit}, #{plannedQuantity}, #{realQuantity}, #{detailBatchNum}, #{mdItemUnit}, #{plannedQuantity}, #{realQuantity}, #{detailBatchNum},
#{wmStorageAreaId}, #{wmStorageAreaCode}, #{wmStorageAreaName}, #{detailState}, #{wmStorageAreaId}, #{wmStorageAreaCode}, #{wmStorageAreaName}, #{detailState},
#{remark}, #{attr1}, #{attr2}, #{attr3}, #{attr4}, #{createBy}, #{remark}, #{attr1}, #{attr2}, #{attr3}, #{attr4}, #{createBy},
@ -390,4 +390,47 @@
FROM WMS_OUT_PLAN_DETAIL FROM WMS_OUT_PLAN_DETAIL
WHERE WMS_OUT_PLAN_DETAIL_ID = #{wmsOutPlanDetailId}; WHERE WMS_OUT_PLAN_DETAIL_ID = #{wmsOutPlanDetailId};
</select> </select>
<select id="selectWmsOutPlanByPlanCode" resultMap="WmsOutPlanWmsOutPlanDetailResult">
select a.WMS_OUT_PLAN_ID,
a.PLAN_CODE,
a.WMS_BUSINESS_TYPE_ID,
a.PLAN_STATE,
a.PLAN_TYPE,
a.RECIPIENT_USERNAME,
a.REMARK,
a.ATTR1,
a.ATTR2,
a.ATTR3,
a.ATTR4,
a.CREATE_BY,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME,
b.WMS_OUT_PLAN_DETAIL_ID as sub_WMS_OUT_PLAN_DETAIL_ID,
b.WMS_OUT_PLAN_ID as sub_WMS_OUT_PLAN_ID,
b.MD_ITEM_ID as sub_MD_ITEM_ID,
b.MD_ITEM_CODE as sub_MD_ITEM_CODE,
b.MD_ITEM_NAME as sub_MD_ITEM_NAME,
b.MD_ITEM_UNIT as sub_MD_ITEM_UNIT,
b.PLANNED_QUANTITY as sub_PLANNED_QUANTITY,
b.REAL_QUANTITY as sub_REAL_QUANTITY,
b.DETAIL_BATCH_NUM as sub_DETAIL_BATCH_NUM,
b.WM_STORAGE_AREA_ID as sub_WM_STORAGE_AREA_ID,
b.WM_STORAGE_AREA_CODE as sub_WM_STORAGE_AREA_CODE,
b.WM_STORAGE_AREA_NAME as sub_WM_STORAGE_AREA_NAME,
b.DETAIL_STATE as sub_DETAIL_STATE,
b.REMARK as sub_REMARK,
b.ATTR1 as sub_ATTR1,
b.ATTR2 as sub_ATTR2,
b.ATTR3 as sub_ATTR3,
b.ATTR4 as sub_ATTR4,
b.CREATE_BY as sub_CREATE_BY,
b.CREATE_TIME as sub_CREATE_TIME,
b.UPDATE_BY as sub_UPDATE_BY,
b.UPDATE_TIME as sub_UPDATE_TIME
from WMS_OUT_PLAN a
left join WMS_OUT_PLAN_DETAIL b on b.WMS_OUT_PLAN_ID = a.WMS_OUT_PLAN_ID
where a.PLAN_CODE = #{planCode}
</select>
</mapper> </mapper>

View File

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ktg.mes.wm.mapper.WmsInPlanDetailEntityMapper">
<resultMap type="WmsInPlanDetailEntity" id="WmsInPlanDetailEntityResult">
<result property="id" column="ID"/>
<result property="planId" column="PLAN_ID"/>
<result property="planDetailsId" column="PLAN_DETAILS_ID"/>
<result property="source" column="SOURCE"/>
<result property="knifeId" column="KNIFE_ID"/>
<result property="consumeLife" column="CONSUME_LIFE"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
</resultMap>
<sql id="selectWmsInPlanDetailEntityVo">
select ID,
PLAN_ID,
PLAN_DETAILS_ID,
SOURCE,
KNIFE_ID,
CONSUME_LIFE,
CREATE_BY,
CREATE_TIME,
UPDATE_BY,
UPDATE_TIME
from WMS_IN_PLAN_DETAIL_ENTITY
</sql>
<select id="selectWmsInPlanDetailEntityList" parameterType="WmsInPlanDetailEntity"
resultMap="WmsInPlanDetailEntityResult">
<include refid="selectWmsInPlanDetailEntityVo"/>
<where>
<if test="planId != null and planId != ''">and PLAN_ID = #{planId}</if>
<if test="planDetailsId != null and planDetailsId != ''">and PLAN_DETAILS_ID = #{planDetailsId}</if>
<if test="source != null and source != ''">and SOURCE = #{source}</if>
<if test="knifeId != null and knifeId != ''">and KNIFE_ID = #{knifeId}</if>
<if test="consumeLife != null and consumeLife != ''">and CONSUME_LIFE = #{consumeLife}</if>
<if test="createBy != null and createBy != ''">and CREATE_BY = #{createBy}</if>
<if test="createTime != null and createTime != ''">and CREATE_TIME = #{createTime}</if>
<if test="updateBy != null and updateBy != ''">and UPDATE_BY = #{updateBy}</if>
<if test="updateTime != null and updateTime != ''">and UPDATE_TIME = #{updateTime}</if>
</where>
</select>
<select id="selectWmsInPlanDetailEntityById" parameterType="Long" resultMap="WmsInPlanDetailEntityResult">
<include refid="selectWmsInPlanDetailEntityVo"/>
where ID = #{id}
</select>
<select id="selectWmsInPlanDetailEntityByPlanDetailsId" parameterType="Long" resultMap="WmsInPlanDetailEntityResult">
<include refid="selectWmsInPlanDetailEntityVo"/>
where PLAN_DETAILS_ID = #{planDetailsId}
</select>
<insert id="insertWmsInPlanDetailEntity" parameterType="WmsInPlanDetailEntity" useGeneratedKeys="true"
keyProperty="id">
insert into WMS_IN_PLAN_DETAIL_ENTITY
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planId != null">PLAN_ID,</if>
<if test="planDetailsId != null">PLAN_DETAILS_ID,</if>
<if test="source != null">SOURCE,</if>
<if test="knifeId != null">KNIFE_ID,</if>
<if test="consumeLife != null">CONSUME_LIFE,</if>
<if test="createBy != null">CREATE_BY,</if>
<if test="createTime != null">CREATE_TIME,</if>
<if test="updateBy != null">UPDATE_BY,</if>
<if test="updateTime != null">UPDATE_TIME,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="planId != null">#{planId},</if>
<if test="planDetailsId != null">#{planDetailsId},</if>
<if test="source != null">#{source},</if>
<if test="knifeId != null">#{knifeId},</if>
<if test="consumeLife != null">#{consumeLife},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateWmsInPlanDetailEntity" parameterType="WmsInPlanDetailEntity">
update WMS_IN_PLAN_DETAIL_ENTITY
<trim prefix="SET" suffixOverrides=",">
<if test="planId != null">PLAN_ID = #{planId},</if>
<if test="planDetailsId != null">PLAN_DETAILS_ID = #{planDetailsId},</if>
<if test="source != null">SOURCE = #{source},</if>
<if test="knifeId != null">KNIFE_ID = #{knifeId},</if>
<if test="consumeLife != null">CONSUME_LIFE = #{consumeLife},</if>
<if test="createBy != null">CREATE_BY = #{createBy},</if>
<if test="createTime != null">CREATE_TIME = #{createTime},</if>
<if test="updateBy != null">UPDATE_BY = #{updateBy},</if>
<if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
</trim>
where ID = #{id}
</update>
<delete id="deleteWmsInPlanDetailEntityById" parameterType="Long">
delete
from WMS_IN_PLAN_DETAIL_ENTITY
where ID = #{id}
</delete>
<delete id="deleteWmsInPlanDetailEntityByIds" parameterType="String">
delete from WMS_IN_PLAN_DETAIL_ENTITY where ID in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteWmsInPlanDetailEntityByPlanDetailsId" parameterType="Long">
delete
from WMS_IN_PLAN_DETAIL_ENTITY
where PLAN_DETAILS_ID = #{PlanDetailsId}
</delete>
<!--批量插入-->
<insert id="batchWmsInPlanDetailEntity">
insert into WMS_IN_PLAN_DETAIL_ENTITY(
ID,PLAN_ID,PLAN_DETAILS_ID,SOURCE,KNIFE_ID,CONSUME_LIFE,CREATE_BY,CREATE_TIME,UPDATE_BY,UPDATE_TIME) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.planId}, #{item.planDetailsId}, #{item.source}, #{item.knifeId},
#{item.consumeLife},#{item.createBy}, #{item.createTime}, #{item.updateBy},
#{item.updateTime})
</foreach>
</insert>
</mapper>

View File

@ -1,107 +1,229 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ktg.mes.wm.mapper.WmsInPlanMapper"> <mapper namespace="com.ktg.mes.wm.mapper.WmsInPlanMapper">
<resultMap type="WmsInPlan" id="WmsInPlanResult"> <resultMap type="WmsInPlan" id="WmsInPlanResult">
<result property="planId" column="PLAN_ID" /> <result property="planId" column="PLAN_ID"/>
<result property="state" column="STATE" /> <result property="state" column="STATE"/>
<result property="sourceType" column="SOURCE_TYPE" /> <result property="sourceType" column="SOURCE_TYPE"/>
<result property="wareId" column="WARE_ID" /> <result property="wareId" column="WARE_ID"/>
<result property="cellCode" column="CELL_CODE" /> <result property="cellCode" column="CELL_CODE"/>
<result property="workOrderCode" column="WORK_ORDER_CODE" /> <result property="workOrderCode" column="WORK_ORDER_CODE"/>
<result property="expectDate" column="EXPECT_DATE" /> <result property="expectDate" column="EXPECT_DATE"/>
<result property="publishName" column="PUBLISH_NAME" /> <result property="publishName" column="PUBLISH_NAME"/>
<result property="publishTime" column="PUBLISH_TIME" /> <result property="publishTime" column="PUBLISH_TIME"/>
<result property="closerId" column="CLOSER_ID" /> <result property="closerId" column="CLOSER_ID"/>
<result property="closeTime" column="CLOSE_TIME" /> <result property="closeTime" column="CLOSE_TIME"/>
<result property="relBillCode" column="REL_BILL_CODE" /> <result property="relBillCode" column="REL_BILL_CODE"/>
<result property="createBy" column="CREATE_BY" /> <result property="createBy" column="CREATE_BY"/>
<result property="createTime" column="CREATE_TIME" /> <result property="createTime" column="CREATE_TIME"/>
<result property="updateTime" column="UPDATE_TIME" /> <result property="updateTime" column="UPDATE_TIME"/>
<result property="updateBy" column="UPDATE_BY" /> <result property="updateBy" column="UPDATE_BY"/>
<result property="remark" column="REMARK" /> <result property="remark" column="REMARK"/>
<result property="customerId" column="CUSTOMER_ID" /> <result property="customerId" column="CUSTOMER_ID"/>
<result property="poCode" column="PO_CODE" /> <result property="poCode" column="PO_CODE"/>
<result property="departmentId" column="DEPARTMENT_ID" /> <result property="departmentId" column="DEPARTMENT_ID"/>
<result property="contractNo" column="CONTRACT_NO" /> <result property="contractNo" column="CONTRACT_NO"/>
<result property="supplierId" column="SUPPLIER_ID" /> <result property="supplierId" column="SUPPLIER_ID"/>
<result property="businessTypeId" column="BUSINESS_TYPE_ID" /> <result property="businessTypeId" column="BUSINESS_TYPE_ID"/>
<result property="srcOutTaskId" column="SRC_OUT_TASK_ID" /> <result property="srcOutTaskId" column="SRC_OUT_TASK_ID"/>
<result property="isActive" column="IS_ACTIVE" /> <result property="isActive" column="IS_ACTIVE"/>
<result property="isDelete" column="IS_DELETE" /> <result property="isDelete" column="IS_DELETE"/>
<result property="planCode" column="PLAN_CODE" /> <result property="planCode" column="PLAN_CODE"/>
<result property="planTypeId" column="PLAN_TYPE_ID" /> <result property="planTypeId" column="PLAN_TYPE_ID"/>
</resultMap> </resultMap>
<resultMap id="WmsInPlanWmsInPlanDetailsResult" type="WmsInPlan" extends="WmsInPlanResult"> <resultMap id="WmsInPlanWmsInPlanDetailsResult" type="WmsInPlan" extends="WmsInPlanResult">
<collection property="wmsInPlanDetailsList" notNullColumn="sub_DETAILS_ID" javaType="java.util.List" resultMap="WmsInPlanDetailsResult" /> <collection property="wmsInPlanDetailsList" notNullColumn="sub_DETAILS_ID" javaType="java.util.List"
resultMap="WmsInPlanDetailsResult"/>
</resultMap> </resultMap>
<resultMap type="WmsInPlanDetails" id="WmsInPlanDetailsResult"> <resultMap type="WmsInPlanDetails" id="WmsInPlanDetailsResult">
<result property="detailsId" column="sub_DETAILS_ID" /> <result property="detailsId" column="sub_DETAILS_ID"/>
<result property="planId" column="sub_PLAN_ID" /> <result property="planId" column="sub_PLAN_ID"/>
<result property="materialId" column="sub_MATERIAL_ID" /> <result property="materialId" column="sub_MATERIAL_ID"/>
<result property="batch" column="sub_BATCH" /> <result property="batch" column="sub_BATCH"/>
<result property="cellId" column="sub_CELL_ID" /> <result property="cellId" column="sub_CELL_ID"/>
<result property="quantity" column="sub_QUANTITY" /> <result property="quantity" column="sub_QUANTITY"/>
<result property="quantityIn" column="sub_QUANTITY_IN" /> <result property="quantityIn" column="sub_QUANTITY_IN"/>
<result property="planInStatus" column="sub_PLAN_IN_STATUS" /> <result property="planInStatus" column="sub_PLAN_IN_STATUS"/>
<result property="remark" column="sub_REMARK" /> <result property="remark" column="sub_REMARK"/>
<result property="createBy" column="sub_CREATE_BY" /> <result property="createBy" column="sub_CREATE_BY"/>
<result property="createTime" column="sub_CREATE_TIME" /> <result property="createTime" column="sub_CREATE_TIME"/>
<result property="updateBy" column="sub_UPDATE_BY" /> <result property="updateBy" column="sub_UPDATE_BY"/>
<result property="updateTime" column="sub_UPDATE_TIME" /> <result property="updateTime" column="sub_UPDATE_TIME"/>
<result property="isActivy" column="sub_IS_ACTIVY" /> <result property="isActivy" column="sub_IS_ACTIVY"/>
<result property="isDelete" column="sub_IS_DELETE" /> <result property="isDelete" column="sub_IS_DELETE"/>
</resultMap> </resultMap>
<sql id="selectWmsInPlanVo"> <sql id="selectWmsInPlanVo">
select PLAN_ID, STATE, SOURCE_TYPE, WARE_ID, CELL_CODE, WORK_ORDER_CODE, EXPECT_DATE, PUBLISH_NAME, PUBLISH_TIME, CLOSER_ID, CLOSE_TIME, REL_BILL_CODE, CREATE_BY, CREATE_TIME, UPDATE_TIME, UPDATE_BY, REMARK, CUSTOMER_ID, PO_CODE, DEPARTMENT_ID, CONTRACT_NO, SUPPLIER_ID, BUSINESS_TYPE_ID, SRC_OUT_TASK_ID, IS_ACTIVE, IS_DELETE, PLAN_CODE, PLAN_TYPE_ID from WMS_IN_PLAN select PLAN_ID,
STATE,
SOURCE_TYPE,
WARE_ID,
CELL_CODE,
WORK_ORDER_CODE,
EXPECT_DATE,
PUBLISH_NAME,
PUBLISH_TIME,
CLOSER_ID,
CLOSE_TIME,
REL_BILL_CODE,
CREATE_BY,
CREATE_TIME,
UPDATE_TIME,
UPDATE_BY,
REMARK,
CUSTOMER_ID,
PO_CODE,
DEPARTMENT_ID,
CONTRACT_NO,
SUPPLIER_ID,
BUSINESS_TYPE_ID,
SRC_OUT_TASK_ID,
IS_ACTIVE,
IS_DELETE,
PLAN_CODE,
PLAN_TYPE_ID
from WMS_IN_PLAN
order by CREATE_TIME desc
</sql> </sql>
<select id="selectWmsInPlanList" parameterType="WmsInPlan" resultMap="WmsInPlanResult"> <select id="selectWmsInPlanList" parameterType="WmsInPlan" resultMap="WmsInPlanResult">
<include refid="selectWmsInPlanVo"/> <include refid="selectWmsInPlanVo"/>
<where> <where>
<if test="state != null and state != ''"> and STATE = #{state}</if> <if test="state != null and state != ''">and STATE = #{state}</if>
<if test="sourceType != null and sourceType != ''"> and SOURCE_TYPE = #{sourceType}</if> <if test="sourceType != null and sourceType != ''">and SOURCE_TYPE = #{sourceType}</if>
<if test="wareId != null and wareId != ''"> and WARE_ID = #{wareId}</if> <if test="wareId != null and wareId != ''">and WARE_ID = #{wareId}</if>
<if test="cellCode != null and cellCode != ''"> and CELL_CODE = #{cellCode}</if> <if test="cellCode != null and cellCode != ''">and CELL_CODE = #{cellCode}</if>
<if test="workOrderCode != null and workOrderCode != ''"> and WORK_ORDER_CODE = #{workOrderCode}</if> <if test="workOrderCode != null and workOrderCode != ''">and WORK_ORDER_CODE = #{workOrderCode}</if>
<if test="expectDate != null and expectDate != ''"> and EXPECT_DATE = #{expectDate}</if> <if test="expectDate != null and expectDate != ''">and EXPECT_DATE = #{expectDate}</if>
<if test="publishName != null and publishName != ''"> and PUBLISH_NAME like concat('%', #{publishName}, '%')</if> <if test="publishName != null and publishName != ''">and PUBLISH_NAME like concat('%', #{publishName},
<if test="publishTime != null and publishTime != ''"> and PUBLISH_TIME = #{publishTime}</if> '%')
<if test="closerId != null and closerId != ''"> and CLOSER_ID = #{closerId}</if> </if>
<if test="closeTime != null and closeTime != ''"> and CLOSE_TIME = #{closeTime}</if> <if test="publishTime != null and publishTime != ''">and PUBLISH_TIME = #{publishTime}</if>
<if test="relBillCode != null and relBillCode != ''"> and REL_BILL_CODE = #{relBillCode}</if> <if test="closerId != null and closerId != ''">and CLOSER_ID = #{closerId}</if>
<if test="createBy != null and createBy != ''"> and CREATE_BY = #{createBy}</if> <if test="closeTime != null and closeTime != ''">and CLOSE_TIME = #{closeTime}</if>
<if test="createTime != null and createTime != ''"> and CREATE_TIME = #{createTime}</if> <if test="relBillCode != null and relBillCode != ''">and REL_BILL_CODE = #{relBillCode}</if>
<if test="updateTime != null and updateTime != ''"> and UPDATE_TIME = #{updateTime}</if> <if test="createBy != null and createBy != ''">and CREATE_BY = #{createBy}</if>
<if test="updateBy != null and updateBy != ''"> and UPDATE_BY = #{updateBy}</if> <if test="createTime != null and createTime != ''">and CREATE_TIME = #{createTime}</if>
<if test="remark != null and remark != ''"> and REMARK = #{remark}</if> <if test="updateTime != null and updateTime != ''">and UPDATE_TIME = #{updateTime}</if>
<if test="customerId != null and customerId != ''"> and CUSTOMER_ID = #{customerId}</if> <if test="updateBy != null and updateBy != ''">and UPDATE_BY = #{updateBy}</if>
<if test="poCode != null and poCode != ''"> and PO_CODE = #{poCode}</if> <if test="remark != null and remark != ''">and REMARK = #{remark}</if>
<if test="departmentId != null and departmentId != ''"> and DEPARTMENT_ID = #{departmentId}</if> <if test="customerId != null and customerId != ''">and CUSTOMER_ID = #{customerId}</if>
<if test="contractNo != null and contractNo != ''"> and CONTRACT_NO = #{contractNo}</if> <if test="poCode != null and poCode != ''">and PO_CODE = #{poCode}</if>
<if test="supplierId != null and supplierId != ''"> and SUPPLIER_ID = #{supplierId}</if> <if test="departmentId != null and departmentId != ''">and DEPARTMENT_ID = #{departmentId}</if>
<if test="businessTypeId != null and businessTypeId != ''"> and BUSINESS_TYPE_ID = #{businessTypeId}</if> <if test="contractNo != null and contractNo != ''">and CONTRACT_NO = #{contractNo}</if>
<if test="srcOutTaskId != null and srcOutTaskId != ''"> and SRC_OUT_TASK_ID = #{srcOutTaskId}</if> <if test="supplierId != null and supplierId != ''">and SUPPLIER_ID = #{supplierId}</if>
<if test="isActive != null and isActive != ''"> and IS_ACTIVE = #{isActive}</if> <if test="businessTypeId != null and businessTypeId != ''">and BUSINESS_TYPE_ID = #{businessTypeId}</if>
<if test="isDelete != null and isDelete != ''"> and IS_DELETE = #{isDelete}</if> <if test="srcOutTaskId != null and srcOutTaskId != ''">and SRC_OUT_TASK_ID = #{srcOutTaskId}</if>
<if test="planCode != null and planCode != ''"> and PLAN_CODE = #{planCode}</if> <if test="isActive != null and isActive != ''">and IS_ACTIVE = #{isActive}</if>
<if test="planTypeId != null and planTypeId != ''"> and PLAN_TYPE_ID = #{planTypeId}</if> <if test="isDelete != null and isDelete != ''">and IS_DELETE = #{isDelete}</if>
<if test="planCode != null and planCode != ''">and PLAN_CODE = #{planCode}</if>
<if test="planTypeId != null and planTypeId != ''">and PLAN_TYPE_ID = #{planTypeId}</if>
</where> </where>
</select> </select>
<select id="selectWmsInPlanByPlanId" parameterType="String" resultMap="WmsInPlanWmsInPlanDetailsResult"> <select id="selectWmsInPlanByPlanId" parameterType="String" resultMap="WmsInPlanWmsInPlanDetailsResult">
select a.PLAN_ID, a.STATE, a.SOURCE_TYPE, a.WARE_ID, a.CELL_CODE, a.WORK_ORDER_CODE, a.EXPECT_DATE, a.PUBLISH_NAME, a.PUBLISH_TIME, a.CLOSER_ID, a.CLOSE_TIME, a.REL_BILL_CODE, a.CREATE_BY, a.CREATE_TIME, a.UPDATE_TIME, a.UPDATE_BY, a.REMARK, a.CUSTOMER_ID, a.PO_CODE, a.DEPARTMENT_ID, a.CONTRACT_NO, a.SUPPLIER_ID, a.BUSINESS_TYPE_ID, a.SRC_OUT_TASK_ID, a.IS_ACTIVE, a.IS_DELETE, a.PLAN_CODE, a.PLAN_TYPE_ID, select a.PLAN_ID,
b.DETAILS_ID as sub_DETAILS_ID, b.PLAN_ID as sub_PLAN_ID, b.MATERIAL_ID as sub_MATERIAL_ID, b.BATCH as sub_BATCH, b.CELL_ID as sub_CELL_ID, b.QUANTITY as sub_QUANTITY, b.QUANTITY_IN as sub_QUANTITY_IN, b.PLAN_IN_STATUS as sub_PLAN_IN_STATUS, b.REMARK as sub_REMARK, b.CREATE_BY as sub_CREATE_BY, b.CREATE_TIME as sub_CREATE_TIME, b.UPDATE_BY as sub_UPDATE_BY, b.UPDATE_TIME as sub_UPDATE_TIME, b.IS_ACTIVY as sub_IS_ACTIVY, b.IS_DELETE as sub_IS_DELETE a.STATE,
a.SOURCE_TYPE,
a.WARE_ID,
a.CELL_CODE,
a.WORK_ORDER_CODE,
a.EXPECT_DATE,
a.PUBLISH_NAME,
a.PUBLISH_TIME,
a.CLOSER_ID,
a.CLOSE_TIME,
a.REL_BILL_CODE,
a.CREATE_BY,
a.CREATE_TIME,
a.UPDATE_TIME,
a.UPDATE_BY,
a.REMARK,
a.CUSTOMER_ID,
a.PO_CODE,
a.DEPARTMENT_ID,
a.CONTRACT_NO,
a.SUPPLIER_ID,
a.BUSINESS_TYPE_ID,
a.SRC_OUT_TASK_ID,
a.IS_ACTIVE,
a.IS_DELETE,
a.PLAN_CODE,
a.PLAN_TYPE_ID,
b.DETAILS_ID as sub_DETAILS_ID,
b.PLAN_ID as sub_PLAN_ID,
b.MATERIAL_ID as sub_MATERIAL_ID,
b.BATCH as sub_BATCH,
b.CELL_ID as sub_CELL_ID,
b.QUANTITY as sub_QUANTITY,
b.QUANTITY_IN as sub_QUANTITY_IN,
b.PLAN_IN_STATUS as sub_PLAN_IN_STATUS,
b.REMARK as sub_REMARK,
b.CREATE_BY as sub_CREATE_BY,
b.CREATE_TIME as sub_CREATE_TIME,
b.UPDATE_BY as sub_UPDATE_BY,
b.UPDATE_TIME as sub_UPDATE_TIME,
b.IS_ACTIVY as sub_IS_ACTIVY,
b.IS_DELETE as sub_IS_DELETE
from WMS_IN_PLAN a from WMS_IN_PLAN a
left join WMS_IN_PLAN_DETAILS b on b.PLAN_ID = a.PLAN_ID left join WMS_IN_PLAN_DETAILS b on b.PLAN_ID = a.PLAN_ID
where a.PLAN_ID = #{planId} where a.PLAN_ID = #{planId}
</select> </select>
<select id="selectWmsInPlanByPlanCode" parameterType="String" resultMap="WmsInPlanWmsInPlanDetailsResult">
select a.PLAN_ID,
a.STATE,
a.SOURCE_TYPE,
a.WARE_ID,
a.CELL_CODE,
a.WORK_ORDER_CODE,
a.EXPECT_DATE,
a.PUBLISH_NAME,
a.PUBLISH_TIME,
a.CLOSER_ID,
a.CLOSE_TIME,
a.REL_BILL_CODE,
a.CREATE_BY,
a.CREATE_TIME,
a.UPDATE_TIME,
a.UPDATE_BY,
a.REMARK,
a.CUSTOMER_ID,
a.PO_CODE,
a.DEPARTMENT_ID,
a.CONTRACT_NO,
a.SUPPLIER_ID,
a.BUSINESS_TYPE_ID,
a.SRC_OUT_TASK_ID,
a.IS_ACTIVE,
a.IS_DELETE,
a.PLAN_CODE,
a.PLAN_TYPE_ID,
b.DETAILS_ID as sub_DETAILS_ID,
b.PLAN_ID as sub_PLAN_ID,
b.MATERIAL_ID as sub_MATERIAL_ID,
b.BATCH as sub_BATCH,
b.CELL_ID as sub_CELL_ID,
b.QUANTITY as sub_QUANTITY,
b.QUANTITY_IN as sub_QUANTITY_IN,
b.PLAN_IN_STATUS as sub_PLAN_IN_STATUS,
b.REMARK as sub_REMARK,
b.CREATE_BY as sub_CREATE_BY,
b.CREATE_TIME as sub_CREATE_TIME,
b.UPDATE_BY as sub_UPDATE_BY,
b.UPDATE_TIME as sub_UPDATE_TIME,
b.IS_ACTIVY as sub_IS_ACTIVY,
b.IS_DELETE as sub_IS_DELETE
from WMS_IN_PLAN a
left join WMS_IN_PLAN_DETAILS b on b.PLAN_ID = a.PLAN_ID
where a.PLAN_CODE = #{planCode}
</select>
<insert id="insertWmsInPlan" parameterType="WmsInPlan" useGeneratedKeys="true" keyProperty="planId"> <insert id="insertWmsInPlan" parameterType="WmsInPlan" useGeneratedKeys="true" keyProperty="planId">
insert into WMS_IN_PLAN insert into WMS_IN_PLAN
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -132,7 +254,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDelete != null">IS_DELETE,</if> <if test="isDelete != null">IS_DELETE,</if>
<if test="planCode != null">PLAN_CODE,</if> <if test="planCode != null">PLAN_CODE,</if>
<if test="planTypeId != null">PLAN_TYPE_ID,</if> <if test="planTypeId != null">PLAN_TYPE_ID,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="state != null">#{state},</if> <if test="state != null">#{state},</if>
<if test="sourceType != null">#{sourceType},</if> <if test="sourceType != null">#{sourceType},</if>
@ -161,7 +283,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDelete != null">#{isDelete},</if> <if test="isDelete != null">#{isDelete},</if>
<if test="planCode != null">#{planCode},</if> <if test="planCode != null">#{planCode},</if>
<if test="planTypeId != null">#{planTypeId},</if> <if test="planTypeId != null">#{planTypeId},</if>
</trim> </trim>
</insert> </insert>
<update id="updateWmsInPlan" parameterType="WmsInPlan"> <update id="updateWmsInPlan" parameterType="WmsInPlan">
@ -199,31 +321,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<delete id="deleteWmsInPlanByPlanId" parameterType="String"> <delete id="deleteWmsInPlanByPlanId" parameterType="String">
delete from WMS_IN_PLAN where PLAN_ID = #{planId} delete
from WMS_IN_PLAN
where PLAN_ID = #{planId}
</delete> </delete>
<delete id="deleteWmsInPlanByPlanIds" parameterType="String"> <delete id="deleteWmsInPlanByPlanIds" parameterType="String">
delete from WMS_IN_PLAN where PLAN_ID in delete from WMS_IN_PLAN where PLAN_ID in
<foreach item="planId" collection="array" open="(" separator="," close=")"> <foreach item="planId" collection="array" open="(" separator="," close=")">
#{planId} #{planId}
</foreach> </foreach>
</delete> </delete>
<delete id="deleteWmsInPlanDetailsByPlanIds" parameterType="String"> <delete id="deleteWmsInPlanDetailsByPlanIds" parameterType="String">
delete from WMS_IN_PLAN_DETAILS where PLAN_ID in delete from WMS_IN_PLAN_DETAILS where PLAN_ID in
<foreach item="planId" collection="array" open="(" separator="," close=")"> <foreach item="planId" collection="array" open="(" separator="," close=")">
#{planId} #{planId}
</foreach> </foreach>
</delete> </delete>
<delete id="deleteWmsInPlanDetailsByPlanId" parameterType="String"> <delete id="deleteWmsInPlanDetailsByPlanId" parameterType="String">
delete from WMS_IN_PLAN_DETAILS where PLAN_ID = #{planId} delete
from WMS_IN_PLAN_DETAILS
where PLAN_ID = #{planId}
</delete> </delete>
<insert id="batchWmsInPlanDetails"> <insert id="batchWmsInPlanDetails">
insert into WMS_IN_PLAN_DETAILS( PLAN_ID, MATERIAL_ID, BATCH, CELL_ID, QUANTITY, QUANTITY_IN, PLAN_IN_STATUS, REMARK, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, IS_ACTIVY, IS_DELETE) values insert into WMS_IN_PLAN_DETAILS( PLAN_ID, MATERIAL_ID, BATCH, CELL_ID, QUANTITY, QUANTITY_IN, PLAN_IN_STATUS,
<foreach item="item" index="index" collection="list" separator=","> REMARK, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, IS_ACTIVY, IS_DELETE) values
( #{item.planId}, #{item.materialId}, #{item.batch}, #{item.cellId}, #{item.quantity}, #{item.quantityIn}, #{item.planInStatus}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.isActivy}, #{item.isDelete}) <foreach item="item" index="index" collection="list" separator=",">
( #{item.planId}, #{item.materialId}, #{item.batch}, #{item.cellId}, #{item.quantity}, #{item.quantityIn},
#{item.planInStatus}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy},
#{item.updateTime}, #{item.isActivy}, #{item.isDelete})
</foreach> </foreach>
</insert> </insert>
</mapper> </mapper>

View File

@ -1,66 +1,91 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ktg.mes.wm.mapper.WmsInTaskMapper"> <mapper namespace="com.ktg.mes.wm.mapper.WmsInTaskMapper">
<resultMap type="WmsInTask" id="WmsInTaskResult"> <resultMap type="WmsInTask" id="WmsInTaskResult">
<result property="id" column="ID" /> <result property="id" column="ID"/>
<result property="taskInCode" column="TASK_IN_CODE" /> <result property="taskInCode" column="TASK_IN_CODE"/>
<result property="planInId" column="PLAN_IN_ID" /> <result property="planInId" column="PLAN_IN_ID"/>
<result property="taskInQuantity" column="TASK_IN_QUANTITY" /> <result property="taskInQuantity" column="TASK_IN_QUANTITY"/>
<result property="actualInQuantity" column="ACTUAL_IN_QUANTITY" /> <result property="actualInQuantity" column="ACTUAL_IN_QUANTITY"/>
<result property="cellTgt" column="CELL_TGT" /> <result property="cellTgt" column="CELL_TGT"/>
<result property="cellOrig" column="CELL_ORIG" /> <result property="cellOrig" column="CELL_ORIG"/>
<result property="remark" column="REMARK" /> <result property="remark" column="REMARK"/>
<result property="createBy" column="CREATE_BY" /> <result property="createBy" column="CREATE_BY"/>
<result property="createTime" column="CREATE_TIME" /> <result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY" /> <result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME" /> <result property="updateTime" column="UPDATE_TIME"/>
<result property="isActivy" column="IS_ACTIVY" /> <result property="isActive" column="IS_ACTIVE"/>
<result property="isDelete" column="IS_DELETE" /> <result property="isDelete" column="IS_DELETE"/>
<result property="batch" column="BATCH" /> <result property="batch" column="BATCH"/>
<result property="materialId" column="MATERIAL_ID" /> <result property="materialId" column="MATERIAL_ID"/>
<result property="planTypeId" column="PLAN_TYPE_ID" /> <result property="planTypeId" column="PLAN_TYPE_ID"/>
<result property="planInStatus" column="PLAN_IN_STATUS" /> <result property="planInStatus" column="PLAN_IN_STATUS"/>
<result property="planInCode" column="PLAN_IN_CODE" /> <result property="planInCode" column="PLAN_IN_CODE"/>
<result property="materialCode" column="MATERIAL_CODE" /> <result property="materialCode" column="MATERIAL_CODE"/>
<result property="detailInId" column="DETAIL_IN_ID"/>
</resultMap> </resultMap>
<sql id="selectWmsInTaskVo"> <sql id="selectWmsInTaskVo">
select ID, TASK_IN_CODE, PLAN_IN_ID, TASK_IN_QUANTITY, ACTUAL_IN_QUANTITY, CELL_TGT, CELL_ORIG, REMARK, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, IS_ACTIVY, IS_DELETE, BATCH, MATERIAL_ID, PLAN_TYPE_ID, PLAN_IN_STATUS, PLAN_IN_CODE, MATERIAL_CODE from WMS_IN_TASK select ID,
TASK_IN_CODE,
PLAN_IN_ID,
TASK_IN_QUANTITY,
ACTUAL_IN_QUANTITY,
CELL_TGT,
CELL_ORIG,
REMARK,
CREATE_BY,
CREATE_TIME,
UPDATE_BY,
UPDATE_TIME,
IS_ACTIVE,
IS_DELETE,
BATCH,
MATERIAL_ID,
PLAN_TYPE_ID,
PLAN_IN_STATUS,
PLAN_IN_CODE,
MATERIAL_CODE,
DETAIL_IN_ID
from WMS_IN_TASK
</sql> </sql>
<select id="selectWmsInTaskList" parameterType="WmsInTask" resultMap="WmsInTaskResult"> <select id="selectWmsInTaskList" parameterType="WmsInTask" resultMap="WmsInTaskResult">
<include refid="selectWmsInTaskVo"/> <include refid="selectWmsInTaskVo"/>
<where> <where>
<if test="taskInCode != null and taskInCode != ''"> and TASK_IN_CODE = #{taskInCode}</if> <if test="taskInCode != null and taskInCode != ''">and TASK_IN_CODE = #{taskInCode}</if>
<if test="planInId != null and planInId != ''"> and PLAN_IN_ID = #{planInId}</if> <if test="planInId != null and planInId != ''">and PLAN_IN_ID = #{planInId}</if>
<if test="taskInQuantity != null and taskInQuantity != ''"> and TASK_IN_QUANTITY = #{taskInQuantity}</if> <if test="taskInQuantity != null and taskInQuantity != ''">and TASK_IN_QUANTITY = #{taskInQuantity}</if>
<if test="actualInQuantity != null and actualInQuantity != ''"> and ACTUAL_IN_QUANTITY = #{actualInQuantity}</if> <if test="actualInQuantity != null and actualInQuantity != ''">and ACTUAL_IN_QUANTITY =
<if test="cellTgt != null and cellTgt != ''"> and CELL_TGT = #{cellTgt}</if> #{actualInQuantity}
<if test="cellOrig != null and cellOrig != ''"> and CELL_ORIG = #{cellOrig}</if> </if>
<if test="remark != null and remark != ''"> and REMARK = #{remark}</if> <if test="cellTgt != null and cellTgt != ''">and CELL_TGT = #{cellTgt}</if>
<if test="createBy != null and createBy != ''"> and CREATE_BY = #{createBy}</if> <if test="cellOrig != null and cellOrig != ''">and CELL_ORIG = #{cellOrig}</if>
<if test="createTime != null and createTime != ''"> and CREATE_TIME = #{createTime}</if> <if test="remark != null and remark != ''">and REMARK = #{remark}</if>
<if test="updateBy != null and updateBy != ''"> and UPDATE_BY = #{updateBy}</if> <if test="createBy != null and createBy != ''">and CREATE_BY = #{createBy}</if>
<if test="updateTime != null and updateTime != ''"> and UPDATE_TIME = #{updateTime}</if> <if test="createTime != null and createTime != ''">and CREATE_TIME = #{createTime}</if>
<if test="isActivy != null and isActivy != ''"> and IS_ACTIVY = #{isActivy}</if> <if test="updateBy != null and updateBy != ''">and UPDATE_BY = #{updateBy}</if>
<if test="isDelete != null and isDelete != ''"> and IS_DELETE = #{isDelete}</if> <if test="updateTime != null and updateTime != ''">and UPDATE_TIME = #{updateTime}</if>
<if test="batch != null and batch != ''"> and BATCH = #{batch}</if> <if test="isActive != null and isActive != ''">and IS_ACTIVE = #{isActive}</if>
<if test="materialId != null and materialId != ''"> and MATERIAL_ID = #{materialId}</if> <if test="isDelete != null and isDelete != ''">and IS_DELETE = #{isDelete}</if>
<if test="planTypeId != null and planTypeId != ''"> and PLAN_TYPE_ID = #{planTypeId}</if> <if test="batch != null and batch != ''">and BATCH = #{batch}</if>
<if test="planInStatus != null and planInStatus != ''"> and PLAN_IN_STATUS = #{planInStatus}</if> <if test="materialId != null and materialId != ''">and MATERIAL_ID = #{materialId}</if>
<if test="planInCode != null and planInCode != ''"> and PLAN_IN_CODE = #{planInCode}</if> <if test="planTypeId != null and planTypeId != ''">and PLAN_TYPE_ID = #{planTypeId}</if>
<if test="materialCode != null and materialCode != ''"> and MATERIAL_CODE = #{materialCode}</if> <if test="planInStatus != null and planInStatus != ''">and PLAN_IN_STATUS = #{planInStatus}</if>
<if test="planInCode != null and planInCode != ''">and PLAN_IN_CODE = #{planInCode}</if>
<if test="materialCode != null and materialCode != ''">and MATERIAL_CODE = #{materialCode}</if>
<if test="detailInId != null and detailInId != ''">and DETAIL_IN_ID = #{detailInId}</if>
</where> </where>
</select> </select>
<select id="selectWmsInTaskById" parameterType="String" resultMap="WmsInTaskResult"> <select id="selectWmsInTaskById" parameterType="String" resultMap="WmsInTaskResult">
<include refid="selectWmsInTaskVo"/> <include refid="selectWmsInTaskVo"/>
where ID = #{id} where ID = #{id}
</select> </select>
<insert id="insertWmsInTask" parameterType="WmsInTask" useGeneratedKeys="true" keyProperty="id"> <insert id="insertWmsInTask" parameterType="WmsInTask" useGeneratedKeys="true" keyProperty="id">
insert into WMS_IN_TASK insert into WMS_IN_TASK
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -75,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">CREATE_TIME,</if> <if test="createTime != null">CREATE_TIME,</if>
<if test="updateBy != null">UPDATE_BY,</if> <if test="updateBy != null">UPDATE_BY,</if>
<if test="updateTime != null">UPDATE_TIME,</if> <if test="updateTime != null">UPDATE_TIME,</if>
<if test="isActivy != null">IS_ACTIVY,</if> <if test="isActive != null">IS_ACTIVE,</if>
<if test="isDelete != null">IS_DELETE,</if> <if test="isDelete != null">IS_DELETE,</if>
<if test="batch != null">BATCH,</if> <if test="batch != null">BATCH,</if>
<if test="materialId != null">MATERIAL_ID,</if> <if test="materialId != null">MATERIAL_ID,</if>
@ -83,7 +108,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planInStatus != null">PLAN_IN_STATUS,</if> <if test="planInStatus != null">PLAN_IN_STATUS,</if>
<if test="planInCode != null">PLAN_IN_CODE,</if> <if test="planInCode != null">PLAN_IN_CODE,</if>
<if test="materialCode != null">MATERIAL_CODE,</if> <if test="materialCode != null">MATERIAL_CODE,</if>
</trim> <if test="detailInId != null">DETAIL_IN_ID,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskInCode != null">#{taskInCode},</if> <if test="taskInCode != null">#{taskInCode},</if>
<if test="planInId != null">#{planInId},</if> <if test="planInId != null">#{planInId},</if>
@ -96,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="isActivy != null">#{isActivy},</if> <if test="isActive != null">#{isActive},</if>
<if test="isDelete != null">#{isDelete},</if> <if test="isDelete != null">#{isDelete},</if>
<if test="batch != null">#{batch},</if> <if test="batch != null">#{batch},</if>
<if test="materialId != null">#{materialId},</if> <if test="materialId != null">#{materialId},</if>
@ -104,7 +130,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planInStatus != null">#{planInStatus},</if> <if test="planInStatus != null">#{planInStatus},</if>
<if test="planInCode != null">#{planInCode},</if> <if test="planInCode != null">#{planInCode},</if>
<if test="materialCode != null">#{materialCode},</if> <if test="materialCode != null">#{materialCode},</if>
</trim> <if test="detailInId != null">#{detailInId},</if>
</trim>
</insert> </insert>
<update id="updateWmsInTask" parameterType="WmsInTask"> <update id="updateWmsInTask" parameterType="WmsInTask">
@ -121,7 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">CREATE_TIME = #{createTime},</if> <if test="createTime != null">CREATE_TIME = #{createTime},</if>
<if test="updateBy != null">UPDATE_BY = #{updateBy},</if> <if test="updateBy != null">UPDATE_BY = #{updateBy},</if>
<if test="updateTime != null">UPDATE_TIME = #{updateTime},</if> <if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
<if test="isActivy != null">IS_ACTIVY = #{isActivy},</if> <if test="isActive != null">IS_ACTIVE = #{isActive},</if>
<if test="isDelete != null">IS_DELETE = #{isDelete},</if> <if test="isDelete != null">IS_DELETE = #{isDelete},</if>
<if test="batch != null">BATCH = #{batch},</if> <if test="batch != null">BATCH = #{batch},</if>
<if test="materialId != null">MATERIAL_ID = #{materialId},</if> <if test="materialId != null">MATERIAL_ID = #{materialId},</if>
@ -129,16 +156,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planInStatus != null">PLAN_IN_STATUS = #{planInStatus},</if> <if test="planInStatus != null">PLAN_IN_STATUS = #{planInStatus},</if>
<if test="planInCode != null">PLAN_IN_CODE = #{planInCode},</if> <if test="planInCode != null">PLAN_IN_CODE = #{planInCode},</if>
<if test="materialCode != null">MATERIAL_CODE = #{materialCode},</if> <if test="materialCode != null">MATERIAL_CODE = #{materialCode},</if>
<if test="detailInId != null">DETAIL_IN_ID = #{detailInId},</if>
</trim> </trim>
where ID = #{id} where ID = #{id}
</update> </update>
<delete id="deleteWmsInTaskById" parameterType="String"> <delete id="deleteWmsInTaskById" parameterType="String">
delete from WMS_IN_TASK where ID = #{id} delete
from WMS_IN_TASK
where ID = #{id}
</delete> </delete>
<delete id="deleteWmsInTaskByIds" parameterType="String"> <delete id="deleteWmsInTaskByIds" parameterType="String">
delete from WMS_IN_TASK where ID in delete from WMS_IN_TASK where ID in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

View File

@ -19,6 +19,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="attr2" column="ATTR2" /> <result property="attr2" column="ATTR2" />
<result property="attr3" column="ATTR3" /> <result property="attr3" column="ATTR3" />
<result property="attr4" column="ATTR4" /> <result property="attr4" column="ATTR4" />
<result property="figureCode" column="figure_code" />
<result property="planSheet" column="plan_sheet" />
<result property="createBy" column="CREATE_BY" /> <result property="createBy" column="CREATE_BY" />
<result property="createTime" column="CREATE_TIME" /> <result property="createTime" column="CREATE_TIME" />
<result property="updateBy" column="UPDATE_BY" /> <result property="updateBy" column="UPDATE_BY" />
@ -29,9 +31,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectWmsZdTaskVo"> <sql id="selectWmsZdTaskVo">
select wzt.WMS_ZD_TASK_ID, wzt.CODE, wzt."name", wzt.M_PRODUCT_ID, wzt."product_id_qty", wzt.QTY, wzt.PLAN_OUT_ID, select wzt.WMS_ZD_TASK_ID, wzt.CODE, wzt."name", wzt.M_PRODUCT_ID, wzt."product_id_qty", wzt.QTY, wzt.PLAN_OUT_ID,
wzt.PLAN_OUT_TYPE, wzt.QTY_OK, wzt.REMARK, wzt.ATTR1, wzt.ATTR3, wzt.ATTR4, wzt.CREATE_BY, wzt.CREATE_TIME, wzt.PLAN_OUT_TYPE, wzt.QTY_OK, wzt.REMARK, wzt.ATTR1, wzt.ATTR3, wzt.ATTR4, wzt.CREATE_BY, wzt.CREATE_TIME,
wzt.UPDATE_BY, wzt.UPDATE_TIME, wzt.STATUS, mi.item_name attr2 wzt.UPDATE_BY, wzt.UPDATE_TIME, wzt.STATUS, mi.item_name attr2, btb.figure_code plan_sheet
from WMS_ZD_TASK wzt from WMS_ZD_TASK wzt
left join md_item mi on wzt.m_product_id = mi.item_id left join md_item mi on wzt.m_product_id = mi.item_id
left join base_technology_bom btb on btb.technology_bom_id = wzt.attr4
</sql> </sql>
<select id="selectWmsZdTaskList" parameterType="WmsZdTask" resultMap="WmsZdTaskResult"> <select id="selectWmsZdTaskList" parameterType="WmsZdTask" resultMap="WmsZdTaskResult">
@ -48,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="attr1 != null and attr1 != ''"> and ATTR1 = #{attr1}</if> <if test="attr1 != null and attr1 != ''"> and ATTR1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and ATTR2 = #{attr2}</if> <if test="attr2 != null and attr2 != ''"> and ATTR2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and ATTR3 = #{attr3}</if> <if test="attr3 != null and attr3 != ''"> and ATTR3 = #{attr3}</if>
<if test="attr4 != null and attr4 != ''"> and ATTR4 = #{attr4}</if> <if test="attr4 != null "> and ATTR4 = #{attr4}</if>
<if test="createBy != null and createBy != ''"> and CREATE_BY = #{createBy}</if> <if test="createBy != null and createBy != ''"> and CREATE_BY = #{createBy}</if>
<if test="createTime != null and createTime != ''"> and CREATE_TIME = #{createTime}</if> <if test="createTime != null and createTime != ''"> and CREATE_TIME = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and UPDATE_BY = #{updateBy}</if> <if test="updateBy != null and updateBy != ''"> and UPDATE_BY = #{updateBy}</if>
@ -121,7 +124,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="attr1 != null">ATTR1 = #{attr1},</if> <if test="attr1 != null">ATTR1 = #{attr1},</if>
<if test="attr2 != null">ATTR2 = #{attr2},</if> <if test="attr2 != null">ATTR2 = #{attr2},</if>
<if test="attr3 != null">ATTR3 = #{attr3},</if> <if test="attr3 != null">ATTR3 = #{attr3},</if>
<if test="attr4 != null">ATTR4 = #{attr4},</if>
<if test="createBy != null">CREATE_BY = #{createBy},</if> <if test="createBy != null">CREATE_BY = #{createBy},</if>
<if test="createTime != null">CREATE_TIME = #{createTime},</if> <if test="createTime != null">CREATE_TIME = #{createTime},</if>
<if test="updateBy != null">UPDATE_BY = #{updateBy},</if> <if test="updateBy != null">UPDATE_BY = #{updateBy},</if>