Compare commits

...

10 Commits

19 changed files with 324 additions and 152 deletions

View File

@ -1,58 +1,59 @@
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: dm.jdbc.driver.DmDriver
druid:
# 主库数据源
master:
url: jdbc:dm://30.30.2.24:5237/WMS_DJ?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# url: jdbc:dm://172.16.99.19:5236/WMS_DJ?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: SYSDBA
password: SYSDBA
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initialSize: 5
# 最小连接池数量
minIdle: 10
# 最大连接池数量
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: ruoyi
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: dm.jdbc.driver.DmDriver
druid:
# 主库数据源
master:
# url: jdbc:dm://30.30.2.24:5237/WMS_DJ?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
url: jdbc:dm://192.168.8.60:5236/WMS_DJ?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: SYSDBA
password: SYSDBA
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initialSize: 5
# 最小连接池数量
minIdle: 10
# 最大连接池数量
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: ruoyi
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true

View File

@ -63,7 +63,7 @@ spring:
# redis 配置
redis:
# 地址
host: 30.30.2.20
host: 192.168.8.60
# 端口默认为6379
port: 6379
# 数据库索引
@ -126,7 +126,7 @@ xss:
#Mino配置
minio:
url: http://localhost:9000
url: http://192.168.8.60:9000
accessKey: seBsDKT7Ss8B4aGiNiNn
secretKey: IYvTR63NZE3EemLfIHGTXu72O7svMEiNHG2OoOWI
bucketName: wms-dj

View File

@ -133,11 +133,14 @@ public class BaseKnifeController extends BaseController {
return getDataTable(list);
}
@PostMapping("/open/checkForAlignment")
@PostMapping("/open/checkForAlignment/{technologyCode}")
@ResponseBody
public AjaxResult checkForAlignment(@RequestBody List<String> processCodeList) {
// 获取工艺bom
List<BaseTechnologyBom> technologyBomList = baseTechnologyBomService.selectBaseTechnologyBomListByProcessCodeList(processCodeList);
public AjaxResult checkForAlignment(@PathVariable String technologyCode) {
// 验证bom工艺
BaseTechnologyBom baseTechnologyBomWrapper = new BaseTechnologyBom();
baseTechnologyBomWrapper.setTechnologyCode(technologyCode);
// List<BaseTechnologyBom> technologyBomList = baseTechnologyBomService.selectBaseTechnologyBomListByProcessCodeList(productionArrangements.getProcessCodes());
List<BaseTechnologyBom> technologyBomList = baseTechnologyBomService.selectBaseTechnologyBomList(baseTechnologyBomWrapper);
if (technologyBomList.isEmpty() || technologyBomList.size() == 1 && technologyBomList.get(0).getKnifeCode() == null)
return AjaxResult.error("未检测到工艺bom项");
@ -151,7 +154,7 @@ public class BaseKnifeController extends BaseController {
operLog.setOperLocation("上游系统");
operLog.setOperUrl("/mes/md/baseKnife/open/checkForAlignment");
operLog.setMethod("com.ktg.mes.md.controller.BaseKnifeController.checkForAlignment()");
operLog.setOperParam(JSON.toJSONString(processCodeList));
operLog.setOperParam(JSON.toJSONString(technologyCode));
operLog.setStatus(1);
operLog.setOperTime(new Date());
@ -319,15 +322,22 @@ public class BaseKnifeController extends BaseController {
baseKnifePlan.setPlanSheet(productionArrangements.getPlanSheet());
if (!baseKnifeService.selectBaseKnifeList(baseKnifePlan).isEmpty())
return AjaxResult.error("该计划单已存在,请更换重试");
WmsZdTask wmsZdTaskValid = new WmsZdTask();
wmsZdTaskValid.setPlanSheet(productionArrangements.getPlanSheet());
if (!zdTaskService.selectWmsZdTaskList(wmsZdTaskValid).isEmpty())
return AjaxResult.error("该计划单已存在,请更换重试");
// 齐套性检查
AjaxResult ajaxResult = this.checkForAlignment(productionArrangements.getProcessCodes());
AjaxResult ajaxResult = this.checkForAlignment(productionArrangements.getTechnologyCode());
if (Integer.parseInt(String.valueOf(ajaxResult.get("code"))) != 200) {
return AjaxResult.error(ajaxResult.get("msg").toString(), ajaxResult.get("data"));
}
// 验证bom工艺
List<BaseTechnologyBom> technologyBomList = baseTechnologyBomService.selectBaseTechnologyBomListByProcessCodeList(productionArrangements.getProcessCodes());
BaseTechnologyBom baseTechnologyBomWrapper = new BaseTechnologyBom();
baseTechnologyBomWrapper.setTechnologyCode(productionArrangements.getTechnologyCode());
// List<BaseTechnologyBom> technologyBomList = baseTechnologyBomService.selectBaseTechnologyBomListByProcessCodeList(productionArrangements.getProcessCodes());
List<BaseTechnologyBom> technologyBomList = baseTechnologyBomService.selectBaseTechnologyBomList(baseTechnologyBomWrapper);
if (technologyBomList.isEmpty() || technologyBomList.size() == 1 && technologyBomList.get(0).getKnifeCode() == null)
return AjaxResult.error("未检测到工艺bom项");
@ -337,7 +347,7 @@ public class BaseKnifeController extends BaseController {
// 参数列表
Map<String, Object> params = new HashMap<>();
params.put("planCode", productionArrangements.getPlanSheet());
params.put("processCodeList", productionArrangements.getProcessCodes());
params.put("processCode", productionArrangements.getTechnologyCode());
params.put("processUnit", productionArrangements.getProcessUnit());
// 构建日志
@ -579,7 +589,8 @@ public class BaseKnifeController extends BaseController {
}
// 添加生产准备记录
productionArrangements.setProcessCode(productionArrangements.getProcessCodes().toString());
// productionArrangements.setProcessCode(productionArrangements.getProcessCodes().toString());
productionArrangements.setTechnologyCode(productionArrangements.getTechnologyCode());
productionArrangements.setProcessUnit(productionArrangements.getProcessUnit());
productionArrangements.setStatus(0);
productionArrangements.setCreateTime(DateUtils.getNowDate());

View File

@ -31,12 +31,12 @@ public class WmsOutTaskController extends BaseController {
/**
* 查询出库任务列表
* 开放 查询出库任务列表
*/
@GetMapping("/open/incompleteList/{planSheet}")
public TableDataInfo openList(@PathVariable String planSheet) {
@GetMapping("/open/list")
public TableDataInfo openList(WmsOutTask wmsOutTask) {
startPage();
List<WmsOutTask> list = wmsOutTaskService.selectWmsOutTaskIncompleteList(planSheet);
List<WmsOutTask> list = wmsOutTaskService.selectWmsOutTaskList(wmsOutTask);
return getDataTable(list);
}

View File

@ -72,6 +72,14 @@ public class BaseTechnologyBom extends BaseEntity
@Excel(name = "预留字段4")
private String attr4;
/** 预留字段4 */
@Excel(name = "工艺编码")
private String technologyCode;
/** 预留字段4 */
@Excel(name = "工艺名称")
private String technologyName;
public void setTechnologyBomId(String technologyBomId)
{
this.technologyBomId = technologyBomId;
@ -199,6 +207,14 @@ public class BaseTechnologyBom extends BaseEntity
return attr4;
}
public String getTechnologyCode() {
return technologyCode;
}
public void setTechnologyCode(String technologyCode) {
this.technologyCode = technologyCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -42,6 +42,10 @@ public class MbbProduBom extends BaseEntity
@Excel(name = "标准用量")
private Integer standardDosage;
/** 标准用量 */
@Excel(name = "当期库存")
private Long currentInventory;
/** 预留字段1 */
private String attr1;
@ -154,6 +158,14 @@ public class MbbProduBom extends BaseEntity
return attr4;
}
public Long getCurrentInventory() {
return currentInventory;
}
public void setCurrentInventory(Long currentInventory) {
this.currentInventory = currentInventory;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -2,6 +2,7 @@ package com.ktg.mes.md.service.impl;
import java.util.List;
import com.ktg.common.utils.DateUtils;
import com.ktg.mes.md.mapper.BaseKnifeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -24,6 +25,9 @@ public class BomRouteServiceImpl implements IBomRouteService
@Autowired
private BomRouteMapper bomRouteMapper;
@Autowired
private BaseKnifeMapper baseKnifeMapper;
/**
* 查询BOM头
*
@ -33,7 +37,11 @@ public class BomRouteServiceImpl implements IBomRouteService
@Override
public BomRoute selectBomRouteByBomRouteId(Long bomRouteId)
{
return bomRouteMapper.selectBomRouteByBomRouteId(bomRouteId);
BomRoute bomRoute = bomRouteMapper.selectBomRouteByBomRouteId(bomRouteId);
bomRoute.getMbbProduBomList().forEach(item -> {
item.setCurrentInventory(this.baseKnifeMapper.countBaseKnife(item.getMdItemId()));
});
return bomRoute;
}
/**

View File

@ -189,17 +189,12 @@ public class InventoryBatchServiceImpl implements IInventoryBatchService {
// 获取当期入库明细数据
List<HashMap<String, Object>> hashMapList = new ArrayList<>();
WmsInPlanDetailEntity entityQuery = new WmsInPlanDetailEntity();
entityQuery.setPlanDetailsId(inTask.getDetailInId());
entityQuery.setPlanId(Long.parseLong(inTask.getPlanInId()));
// entityQuery.setKnifeId(Long.parseLong(inTask.getPlanInId()));
List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList = wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityList(entityQuery);
wmsInPlanDetailEntityList.forEach(inPlanDetailEntity -> {
// 根据出库实例对象获取出库计划明细
WmsInPlanDetails wmsInPlanDetails = this.wmsInPlanMapper.selectWmsInPlanDetailById(inPlanDetailEntity.getPlanDetailsId());
// 根据计划明细获得出库计划
WmsInPlan wmsInPlan = this.wmsInPlanMapper.selectWmsInPlanByPlanId(wmsInPlanDetails.getPlanId().toString());
// 根据出库计划获得出库类型
WmsBusinessType wmsBusinessType = this.wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(wmsInPlan.getBusinessTypeId());
WmsBusinessType wmsBusinessType = this.wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(inTask.getPlanTypeId());
// 获得物料
MdItem mdItem = this.mdItemMapper.selectMdItemById(Long.parseLong(inTask.getMaterialId()));
@ -213,25 +208,25 @@ public class InventoryBatchServiceImpl implements IInventoryBatchService {
hashMap.put("mdItemUnit", mdItem.getUnitName()); // 物料单位
hashMap.put("mdItemKnifeWarn", mdItem.getAttr2()); // 物料名称
/* 来自出入库计划类型 */
hashMap.put("planTypeId", wmsBusinessType.getTypeId()); // 库类型ID
hashMap.put("planTypeCode", wmsBusinessType.getCode()); // 库类型编码
hashMap.put("planTypeName", wmsBusinessType.getName()); // 库类型名称
hashMap.put("planTypeId", wmsBusinessType.getTypeId()); // 库类型ID
hashMap.put("planTypeCode", wmsBusinessType.getCode()); // 库类型编码
hashMap.put("planTypeName", wmsBusinessType.getName()); // 库类型名称
/* 来自计划明细 */
hashMap.put("detailBatchNum", wmsInPlanDetails.getBatch()); // 明细批次
hashMap.put("wmStorageAreaId", wmsInPlanDetails.getCellId()); // 库位ID
hashMap.put("detailBatchNum", inTask.getBatch()); // 明细批次
hashMap.put("wmStorageAreaId", inTask.getCellTgt()); // 库位ID
hashMap.put("wmStorageAreaName", inTask.getCellName()); // 库位名称
hashMap.put("detailStatus", wmsInPlanDetails.getPlanInStatus()); // 明细状态
hashMap.put("detailStatus", inTask.getPlanInStatus()); // 明细状态
// 查询库区信息
WmStorageArea wmStorageArea = wmStorageAreaMapper.selectWmStorageAreaByAreaId(wmsInPlanDetails.getCellId());
WmStorageArea wmStorageArea = wmStorageAreaMapper.selectWmStorageAreaByAreaId(inTask.getCellTgt());
WmStorageLocation wmStorageLocation = wmStorageLocationMapper.selectWmStorageLocationByLocationId(wmStorageArea.getLocationId());
// 查询库房信息
WmWarehouse wmWarehouse = wmWarehouseMapper.selectWmWarehouseByWarehouseId(wmStorageLocation.getWarehouseId());
hashMap.put("wmWarehouseName", wmWarehouse.getWarehouseName()); // 库位名称
/* 实体 */
String outTime = null;
if (wmsInPlanDetails.getCreateTime() != null)
outTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(wmsInPlanDetails.getCreateTime());
if (inPlanDetailEntity.getCreateTime() != null)
outTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(inPlanDetailEntity.getCreateTime());
hashMap.put("dateTime", outTime); // 出库时间
hashMap.put("baseKnifeId", inPlanDetailEntity.getKnifeId());
hashMap.put("planCode", inTask.getPlanInCode());
@ -240,6 +235,7 @@ public class InventoryBatchServiceImpl implements IInventoryBatchService {
hashMapList.add(hashMap);
});
inventoryBatchIn.setInfoList(hashMapList);
result.add(inventoryBatchIn);
});

View File

@ -58,6 +58,16 @@ public class WmsInTaskController extends BaseController {
return getDataTable(list);
}
/**
* 查询入库任务列表
*/
@GetMapping("/open/list")
public TableDataInfo openList(WmsInTask wmsInTask) {
startPage();
List<WmsInTask> list = wmsInTaskService.selectWmsInTaskList(wmsInTask);
return getDataTable(list);
}
/**
* 导出入库任务列表
*/
@ -114,11 +124,10 @@ public class WmsInTaskController extends BaseController {
*/
// @PreAuthorize("@ss.hasPermi('wm:wmsInTask:issueBatch')")
// @Log(title = "入库任务", businessType = BusinessType.UPDATE)
@PostMapping("/open/issueBatch")
@PostMapping("/open/issueBatch/{ids}")
@ResponseBody
public AjaxResult issueBatch(@RequestBody List<String> wmsInTaskIdList) {
wmsInTaskIdList.forEach(taskId -> {
public AjaxResult issueBatch(@PathVariable String[] ids) {
for (String taskId : ids) {
// 获取任务信息
WmsInTask wmsInTask = wmsInTaskService.selectWmsInTaskById(taskId);
// 更新任务状态
@ -220,7 +229,7 @@ public class WmsInTaskController extends BaseController {
}
mdItemService.updateMdItem(mbbBdMrlMitm);
}
});
}
return toAjax(1);
}
}

View File

@ -25,13 +25,13 @@ public class ProductionArrangements extends BaseEntity
private String planSheet;
/** 工序号 */
@Excel(name = "序号")
private String processCode;
@Excel(name = "艺编码")
private String technologyCode;
@Excel(name = "工序号")
private List<String> processCodes;
// @Excel(name = "工序号")
// private List<String> processCodes;
@Excel(name = "工序号")
@Excel(name = "加工单元")
private String processUnit;
/** 状态 */
@ -72,15 +72,15 @@ public class ProductionArrangements extends BaseEntity
{
return planSheet;
}
public void setProcessCode(String processCode)
{
this.processCode = processCode;
public String getTechnologyCode() {
return technologyCode;
}
public String getProcessCode()
{
return processCode;
public void setTechnologyCode(String technologyCode) {
this.technologyCode = technologyCode;
}
public void setStatus(Integer status)
{
this.status = status;
@ -94,13 +94,13 @@ public class ProductionArrangements extends BaseEntity
this.processUnit = processUnit;
}
public List<String> getProcessCodes() {
return processCodes;
}
public void setProcessCodes(List<String> processCodes) {
this.processCodes = processCodes;
}
// public List<String> getProcessCodes() {
// return processCodes;
// }
//
// public void setProcessCodes(List<String> processCodes) {
// this.processCodes = processCodes;
// }
public Integer getStatus()
{
@ -148,8 +148,6 @@ public class ProductionArrangements extends BaseEntity
return "ProductionArrangements{" +
"productionArrangementsId='" + productionArrangementsId + '\'' +
", planSheet='" + planSheet + '\'' +
", processCode='" + processCode + '\'' +
", processCodes=" + processCodes +
", processUnit='" + processUnit + '\'' +
", status=" + status +
", attr1='" + attr1 + '\'' +

View File

@ -72,6 +72,9 @@ public class WmsInPlanDetailEntity extends BaseEntity {
* 库位名称
*/
private String cellName;
private String cellX;
private String cellY;
private String cellZ;
/**
* 明细批次
*/
@ -186,6 +189,30 @@ public class WmsInPlanDetailEntity extends BaseEntity {
this.cellName = cellName;
}
public String getCellX() {
return cellX;
}
public void setCellX(String cellX) {
this.cellX = cellX;
}
public String getCellY() {
return cellY;
}
public void setCellY(String cellY) {
this.cellY = cellY;
}
public String getCellZ() {
return cellZ;
}
public void setCellZ(String cellZ) {
this.cellZ = cellZ;
}
public String getDetailBatch() {
return detailBatch;
}
@ -237,6 +264,9 @@ public class WmsInPlanDetailEntity extends BaseEntity {
.append("planType", getPlanType())
.append("cellCode", getCellCode())
.append("cellName", getCellName())
.append("cellX", getCellX())
.append("cellY", getCellY())
.append("cellZ", getCellZ())
.append("warehouseName", getWarehouseName())
.append("warehouseCode", getWarehouseCode())
.append("warehouseTypeName", getWarehouseTypeName())

View File

@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.ktg.common.annotation.Excel;
import com.ktg.common.core.domain.BaseEntity;
import java.util.List;
/**
* 入库任务对象 WMS_IN_TASK
*
@ -58,6 +60,9 @@ public class WmsInTask extends BaseEntity {
* 库位编码
*/
private String cellCode;
private String cellX;
private String cellY;
private String cellZ;
/**
* 起始库位
@ -129,6 +134,8 @@ public class WmsInTask extends BaseEntity {
@Excel(name = "入库明细ID")
private Long detailInId;
private List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList;
public void setId(Long id) {
this.id = id;
}
@ -201,6 +208,30 @@ public class WmsInTask extends BaseEntity {
this.cellCode = cellCode;
}
public String getCellX() {
return cellX;
}
public void setCellX(String cellX) {
this.cellX = cellX;
}
public String getCellY() {
return cellY;
}
public void setCellY(String cellY) {
this.cellY = cellY;
}
public String getCellZ() {
return cellZ;
}
public void setCellZ(String cellZ) {
this.cellZ = cellZ;
}
public void setIsActive(String isActive) {
this.isActive = isActive;
}
@ -289,6 +320,14 @@ public class WmsInTask extends BaseEntity {
this.materialUnit = materialUnit;
}
public List<WmsInPlanDetailEntity> getWmsInPlanDetailEntityList() {
return wmsInPlanDetailEntityList;
}
public void setWmsInPlanDetailEntityList(List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList) {
this.wmsInPlanDetailEntityList = wmsInPlanDetailEntityList;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@ -301,6 +340,9 @@ public class WmsInTask extends BaseEntity {
.append("cellName", getCellName())
.append("cellCode", getCellCode())
.append("cellOrig", getCellOrig())
.append("cellX", getCellX())
.append("cellY", getCellY())
.append("cellZ", getCellZ())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
@ -316,6 +358,7 @@ public class WmsInTask extends BaseEntity {
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("detailInId", getDetailInId())
.append("wmsInPlanDetailEntityList", getWmsInPlanDetailEntityList())
.toString();
}
}

View File

@ -79,6 +79,9 @@ public class WmsInPlanDetailEntityServiceImpl implements IWmsInPlanDetailEntityS
// 设置库位信息
entity.setCellCode(wmStorageArea.getAreaCode());
entity.setCellName(wmStorageArea.getAreaName());
entity.setCellX(wmStorageArea.getPositionX().toString());
entity.setCellY(wmStorageArea.getPositionY().toString());
entity.setCellZ(wmStorageArea.getPositionZ().toString());
// 查询库区信息
WmStorageLocation wmStorageLocation = wmStorageLocationMapper.selectWmStorageLocationByLocationId(wmStorageArea.getLocationId());
// 查询库房信息

View File

@ -1,6 +1,7 @@
package com.ktg.mes.wm.service.impl;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.ktg.common.utils.DateUtils;
@ -8,6 +9,10 @@ import com.ktg.generator.util.MultiModuleCodeGenerator;
import com.ktg.mes.md.domain.MdItem;
import com.ktg.mes.md.mapper.MdItemMapper;
import com.ktg.mes.md.service.IMdItemService;
import com.ktg.mes.wm.domain.WmStorageArea;
import com.ktg.mes.wm.domain.WmsInPlanDetailEntity;
import com.ktg.mes.wm.mapper.WmStorageAreaMapper;
import com.ktg.mes.wm.service.IWmsInPlanDetailEntityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ktg.mes.wm.mapper.WmsInTaskMapper;
@ -24,9 +29,12 @@ import com.ktg.mes.wm.service.IWmsInTaskService;
public class WmsInTaskServiceImpl implements IWmsInTaskService {
@Autowired
private WmsInTaskMapper wmsInTaskMapper;
@Autowired
private MdItemMapper mdItemMapper;
@Autowired
private IWmsInPlanDetailEntityService wmsInPlanDetailEntityService;
@Autowired
private WmStorageAreaMapper wmStorageAreaMapper;
/**
* 查询入库任务
@ -51,6 +59,17 @@ public class WmsInTaskServiceImpl implements IWmsInTaskService {
wmsInTaskMapper.selectWmsInTaskList(wmsInTask).forEach(task -> {
MdItem mdItem = mdItemMapper.selectMdItemByCode(task.getMaterialCode());
task.setMaterialName(mdItem.getItemName());
WmsInPlanDetailEntity wmsInPlanDetailEntityQuery = new WmsInPlanDetailEntity();
wmsInPlanDetailEntityQuery.setPlanDetailsId(task.getDetailInId());
// 库位信息
WmStorageArea wmStorageArea = wmStorageAreaMapper.selectWmStorageAreaByAreaCode(task.getCellCode());
task.setCellX(wmStorageArea.getPositionX().toString());
task.setCellY(wmStorageArea.getPositionY().toString());
task.setCellZ(wmStorageArea.getPositionZ().toString());
List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList = wmsInPlanDetailEntityService.selectWmsInPlanDetailEntityList(wmsInPlanDetailEntityQuery);
task.setWmsInPlanDetailEntityList(wmsInPlanDetailEntityList);
wmsInTaskList.add(task);
});
return wmsInTaskList;

View File

@ -441,6 +441,7 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService
wmsInTask.setMaterialId(zdTask.getmProductId().toString());
wmsInTask.setPlanTypeId("9");
wmsInTask.setPlanInStatus("1");
wmsInTask.setDetailInId(wmsInPlan.getWmsInPlanDetailsList().get(0).getDetailsId());
wmsInTask.setCreateBy(getUsername());
wmsInTask.setCreateTime(DateUtils.getNowDate());
wmsInTaskMapper.insertWmsInTask(wmsInTask);
@ -477,20 +478,17 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService
public Boolean checkFinal(String planSheet){
// 获取订单记录
ProductionArrangements productionArrangements = productionArrangementsMapper.selectProductionArrangementsByPlanSheet(planSheet);
String[] processCodes = productionArrangements.getProcessCode().substring(1, productionArrangements.getProcessCode().length() - 1).split(",");
for (String processCode : processCodes) {
// 遍历工序
List<BaseTechnologyBom> baseTechnologyBomList = baseTechnologyBomMapper.selectBaseTechnologyBomListByProcessCode(processCode.trim());
if (baseTechnologyBomList != null && baseTechnologyBomList.size() > 0) {
// 判断订单锁定的物料是否足够
for (BaseTechnologyBom technologyBom : baseTechnologyBomList) {
BaseKnife baseKnifeWrapper = new BaseKnife();
baseKnifeWrapper.setPlanSheet(planSheet);
baseKnifeWrapper.setKnifeCode(technologyBom.getKnifeCode());
List<BaseKnife> baseKnifePlanSheetList = baseKnifeMapper.selectBaseKnifeList(baseKnifeWrapper);
if (baseKnifePlanSheetList.size() < technologyBom.getKnifeCount()) return false;
}
}
BaseTechnologyBom baseTechnologyBomWrapper = new BaseTechnologyBom();
baseTechnologyBomWrapper.setTechnologyCode(productionArrangements.getTechnologyCode());
List<BaseTechnologyBom> baseTechnologyBomList = baseTechnologyBomMapper.selectBaseTechnologyBomList(baseTechnologyBomWrapper);
// 判断订单锁定的物料是否足够
for (BaseTechnologyBom technologyBom : baseTechnologyBomList) {
BaseKnife baseKnifeWrapper = new BaseKnife();
baseKnifeWrapper.setPlanSheet(planSheet);
baseKnifeWrapper.setKnifeCode(technologyBom.getKnifeCode());
List<BaseKnife> baseKnifePlanSheetList = baseKnifeMapper.selectBaseKnifeList(baseKnifeWrapper);
if (baseKnifePlanSheetList.size() < technologyBom.getKnifeCount()) return false;
}
return true;
@ -514,20 +512,17 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService
// 获取订单记录
ProductionArrangements productionArrangements = productionArrangementsMapper.selectProductionArrangementsByPlanSheet(planSheet);
String[] processCodes = productionArrangements.getProcessCode().substring(1, productionArrangements.getProcessCode().length() - 1).split(",");
for (String processCode : processCodes) {
// 遍历工序
List<BaseTechnologyBom> baseTechnologyBomList = baseTechnologyBomMapper.selectBaseTechnologyBomListByProcessCode(processCode.trim());
if (baseTechnologyBomList != null && baseTechnologyBomList.size() > 0) {
// 判断订单锁定的物料是否足够
for (BaseTechnologyBom technologyBom : baseTechnologyBomList) {
BaseKnife baseKnifeWrapper = new BaseKnife();
baseKnifeWrapper.setPlanSheet(planSheet);
baseKnifeWrapper.setKnifeCode(technologyBom.getKnifeCode());
List<BaseKnife> baseKnifeLockedList = baseKnifeMapper.selectBaseKnifeList(baseKnifeWrapper);
if (baseKnifeLockedList.size() == technologyBom.getKnifeCount()) baseKnifeResultList.addAll(baseKnifeLockedList);
}
}
BaseTechnologyBom baseTechnologyBomWrapper = new BaseTechnologyBom();
baseTechnologyBomWrapper.setTechnologyCode(productionArrangements.getTechnologyCode());
List<BaseTechnologyBom> baseTechnologyBomList = baseTechnologyBomMapper.selectBaseTechnologyBomList(baseTechnologyBomWrapper);
// 判断订单锁定的物料是否足够
for (BaseTechnologyBom technologyBom : baseTechnologyBomList) {
BaseKnife baseKnifeWrapper = new BaseKnife();
baseKnifeWrapper.setPlanSheet(planSheet);
baseKnifeWrapper.setKnifeCode(technologyBom.getKnifeCode());
List<BaseKnife> baseKnifeLockedList = baseKnifeMapper.selectBaseKnifeList(baseKnifeWrapper);
if (baseKnifeLockedList.size() == technologyBom.getKnifeCount()) baseKnifeResultList.addAll(baseKnifeLockedList);
}
String batchNum = "SCZBPC01";

View File

@ -15,6 +15,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="expendLife" column="EXPEND_LIFE" />
<result property="lockedStartTime" column="LOCKED_START_TIME" />
<result property="lockedEndTime" column="LOCKED_END_TIME" />
<result property="technologyCode" column="TECHNOLOGY_CODE" />
<result property="technologyName" column="TECHNOLOGY_NAME" />
<result property="remark" column="REMARK" />
<result property="attr1" column="ATTR1" />
<result property="attr2" column="ATTR2" />
@ -27,7 +29,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectBaseTechnologyBomVo">
select TECHNOLOGY_BOM_ID, FIGURE_CODE, PROCESS_CODE, PROCESS_NAME, KNIFE_CODE, KNIFE_SORT, KNIFE_COUNT, EXPEND_LIFE, LOCKED_START_TIME, LOCKED_END_TIME, REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME from BASE_TECHNOLOGY_BOM
select TECHNOLOGY_BOM_ID, FIGURE_CODE, PROCESS_CODE, PROCESS_NAME, KNIFE_CODE,
KNIFE_SORT, KNIFE_COUNT, EXPEND_LIFE, LOCKED_START_TIME, LOCKED_END_TIME,
TECHNOLOGY_CODE, TECHNOLOGY_NAME,
REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME
from BASE_TECHNOLOGY_BOM
</sql>
<select id="selectBaseTechnologyBomList" parameterType="BaseTechnologyBom" resultMap="BaseTechnologyBomResult">
@ -42,6 +48,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="expendLife != null and expendLife != ''"> and EXPEND_LIFE = #{expendLife}</if>
<if test="lockedStartTime != null and lockedStartTime != ''"> and LOCKED_START_TIME = #{lockedStartTime}</if>
<if test="lockedEndTime != null and lockedEndTime != ''"> and LOCKED_END_TIME = #{lockedEndTime}</if>
<if test="technologyCode != null and technologyCode != ''"> and TECHNOLOGY_CODE = #{technologyCode}</if>
<if test="technologyName != null and technologyName != ''"> and TECHNOLOGY_NAME = #{technologyName}</if>
<if test="remark != null and remark != ''"> and REMARK = #{remark}</if>
<if test="attr1 != null and attr1 != ''"> and ATTR1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and ATTR2 = #{attr2}</if>
@ -71,6 +79,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="expendLife != null">EXPEND_LIFE,</if>
<if test="lockedStartTime != null">LOCKED_START_TIME,</if>
<if test="lockedEndTime != null">LOCKED_END_TIME,</if>
<if test="technologyCode != null">TECHNOLOGY_CODE,</if>
<if test="technologyName != null">TECHNOLOGY_NAME,</if>
<if test="remark != null">REMARK,</if>
<if test="attr1 != null">ATTR1,</if>
<if test="attr2 != null">ATTR2,</if>
@ -91,6 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="expendLife != null">#{expendLife},</if>
<if test="lockedStartTime != null">#{lockedStartTime},</if>
<if test="lockedEndTime != null">#{lockedEndTime},</if>
<if test="technologyCode != null">#{technologyCode},</if>
<if test="technologyName != null">#{technologyName},</if>
<if test="remark != null">#{remark},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>

View File

@ -7,7 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="ProductionArrangements" id="ProductionArrangementsResult">
<result property="productionArrangementsId" column="PRODUCTION_ARRANGEMENTS_ID" />
<result property="planSheet" column="PLAN_SHEET" />
<result property="processCode" column="PROCESS_CODE" />
<result property="technologyCode" column="TECHNOLOGY_CODE" />
<result property="status" column="STATUS" />
<result property="attr1" column="ATTR1" />
<result property="attr2" column="ATTR2" />
@ -20,14 +20,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectProductionArrangementsVo">
select PRODUCTION_ARRANGEMENTS_ID, PLAN_SHEET, PROCESS_CODE, STATUS, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME from PRODUCTION_ARRANGEMENTS
select PRODUCTION_ARRANGEMENTS_ID, PLAN_SHEET, TECHNOLOGY_CODE, STATUS, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME from PRODUCTION_ARRANGEMENTS
</sql>
<select id="selectProductionArrangementsList" parameterType="ProductionArrangements" resultMap="ProductionArrangementsResult">
<include refid="selectProductionArrangementsVo"/>
<where>
<if test="planSheet != null and planSheet != ''"> and PLAN_SHEET = #{planSheet}</if>
<if test="processCode != null and processCode != ''"> and PROCESS_CODE = #{processCode}</if>
<if test="technologyCode != null and technologyCode != ''"> and TECHNOLOGY_CODE = #{technologyCode}</if>
<if test="status != null and status != ''"> and STATUS = #{status}</if>
<if test="attr1 != null and attr1 != ''"> and ATTR1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and ATTR2 = #{attr2}</if>
@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into PRODUCTION_ARRANGEMENTS
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planSheet != null">PLAN_SHEET,</if>
<if test="processCode != null">PROCESS_CODE,</if>
<if test="technologyCode != null">TECHNOLOGY_CODE,</if>
<if test="status != null">STATUS,</if>
<if test="processUnit != null">PROCESS_UNIT,</if>
<if test="attr1 != null">ATTR1,</if>
@ -68,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="planSheet != null">#{planSheet},</if>
<if test="processCode != null">#{processCode},</if>
<if test="technologyCode != null">#{technologyCode},</if>
<if test="status != null">#{status},</if>
<if test="processUnit != null">#{processUnit},</if>
<if test="attr1 != null">#{attr1},</if>
@ -86,7 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update PRODUCTION_ARRANGEMENTS
<trim prefix="SET" suffixOverrides=",">
<if test="planSheet != null">PLAN_SHEET = #{planSheet},</if>
<if test="processCode != null">PROCESS_CODE = #{processCode},</if>
<if test="technologyCode != null">TECHNOLOGY_CODE = #{technologyCode},</if>
<if test="status != null">STATUS = #{status},</if>
<if test="attr1 != null">ATTR1 = #{attr1},</if>
<if test="attr2 != null">ATTR2 = #{attr2},</if>

View File

@ -58,6 +58,24 @@
<result property="isDelete" column="sub_IS_DELETE"/>
</resultMap>
<resultMap type="WmsInPlanDetails" id="BizWmsInPlanDetailsResult">
<result property="detailsId" column="sub_DETAILS_ID"/>
<result property="planId" column="sub_PLAN_ID"/>
<result property="materialId" column="sub_MATERIAL_ID"/>
<result property="batch" column="sub_BATCH"/>
<result property="cellId" column="sub_CELL_ID"/>
<result property="quantity" column="sub_QUANTITY"/>
<result property="quantityIn" column="sub_QUANTITY_IN"/>
<result property="planInStatus" column="sub_PLAN_IN_STATUS"/>
<result property="remark" column="sub_REMARK"/>
<result property="createBy" column="sub_CREATE_BY"/>
<result property="createTime" column="sub_CREATE_TIME"/>
<result property="updateBy" column="sub_UPDATE_BY"/>
<result property="updateTime" column="sub_UPDATE_TIME"/>
<result property="isActivy" column="sub_IS_ACTIVY"/>
<result property="isDelete" column="sub_IS_DELETE"/>
</resultMap>
<sql id="selectWmsInPlanVo">
select PLAN_ID,
STATE,
@ -362,9 +380,9 @@
WHERE PLAN_CODE = #{value}
</select>
<select id="selectWmsInPlanDetailById" resultMap="WmsInPlanDetailsResult">
<select id="selectWmsInPlanDetailById" resultMap="BizWmsInPlanDetailsResult">
SELECT *
FROM WMS_IN_PLAN_DETAILS
WHERE DETAILS_ID = #{wmsInPlanDetailId};
WHERE DETAILS_ID = #{planDetailsId}
</select>
</mapper>

View File

@ -54,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planOutId != null and planOutId != ''"> and PLAN_OUT_ID = #{planOutId}</if>
<if test="planOutType != null and planOutType != ''"> and PLAN_OUT_TYPE = #{planOutType}</if>
<if test="technologyBomId != null and technologyBomId != ''"> and technology_bom_id = #{technologyBomId}</if>
<if test="planSheet != null and planSheet != ''"> and plan_sheet = #{planSheet}</if>
<if test="qtyOk != null and qtyOk != ''"> and QTY_OK = #{qtyOk}</if>
<if test="remark != null and remark != ''"> and REMARK = #{remark}</if>
<if test="attr1 != null and attr1 != ''"> and ATTR1 = #{attr1}</if>