Merge remote-tracking branch 'origin/master'

master
philip 4 years ago
commit 4e29e82e22

@ -160,6 +160,8 @@ public interface Constants {
String PRINT_TYPE_INV = "INV";
// 在制品标签
String PRINT_TYPE_SFC = "SFC";
// 余料标签
String PRINT_TYPE_EXM = "EXM";
/**
* Y-使N-/

@ -131,7 +131,7 @@ public class SfcDispatchDto implements Serializable{
/**
*
*/
@ExcelColumn("备注")
@ExcelColumn("备注信息")
private String remark;
/**
*
@ -174,7 +174,6 @@ public class SfcDispatchDto implements Serializable{
private String componentDescription;
private String isCompleted;
private BigDecimal completedQty;
private String userName;
private String resourceWorkCenter;
private String status;
@ -578,14 +577,6 @@ public class SfcDispatchDto implements Serializable{
this.completedQty = completedQty;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getResourceWorkCenter() {
return resourceWorkCenter;
}

@ -61,14 +61,31 @@ public class PrintLogServiceImpl extends ServiceImpl<PrintLogMapper, PrintLog> i
@Override
public void labelPrint(String site, String user, List<PrintLog> printList) {
List<LabelPrintDto> labelPrintDtoList = new ArrayList<>();
StringBuffer stringBuffer = new StringBuffer("");
for (PrintLog printLog : printList) {
LabelPrintDto labelPrintDto = new LabelPrintDto();
// 打印机名称、打印模板
labelPrintDto.setPrinter(printLog.getPrintName());
labelPrintDto.setPrintTemplate(printLog.getPrintTemplate());
// {"ITEM":"500100010001","INVENTORY":"500100010001*20210721","ITEM_DESC":"测试物料","SUPPLIER":"BA002"}
// 打印参数:物料编号、物料描述、供应商、批次号
String printParam = printLog.getPrintParam();
JSONObject jsonObject = JSONObject.parseObject(printParam);
String item = jsonObject.getString("ITEM");
String item_desc = jsonObject.getString("ITEM_DESC");
String supplier = jsonObject.getString("SUPPLIER");
String inventory = jsonObject.getString("INVENTORY");
labelPrintDto.setItem(item);
labelPrintDto.setItemDescription(item_desc);
labelPrintDto.setSupplier(supplier);
labelPrintDto.setBatch(inventory);
/*
labelPrintDto.setItem(printLog.getItem());
labelPrintDto.setItemDescription(printLog.getItemDescription());
labelPrintDto.setItemDescription(printLog.getItemDescription());*/
labelPrintDtoList.add(labelPrintDto);
stringBuffer.append(printParam).append(",");
}
String jsonList = JSON.toJSONString(labelPrintDtoList);
String post = HttpUtil.post(printServer, JSON.toJSONString(labelPrintDtoList), 30000);
/**
* {"msg":"打印成功","code":0}

@ -1,6 +1,7 @@
#Spring
spring:
datasource:
hikari:
dynamic:
primary: wip #设置默认的数据源或者数据源组,默认值即为master
datasource:
@ -9,8 +10,35 @@ spring:
username: wip
password: wip
driver-class-name: oracle.jdbc.OracleDriver
druid:
filters: stat,wall,log4j2
initial-size: 5
max-active: 50
min-idle: 5
max-wait: 60000
validation-query: SELECT 'x' FROM DUAL
test-on-borrow: true
test-on-return: true
test-while-idle: true
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
remove-abandoned: true
remove-abandoned-timeout: 1800
log-abandoned: true
web-stat-filter:
enabled: true
url-pattern: /*
exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
stat-view-servlet:
enabled: true
url-pattern: /druid/*
reset-enable: false
stat:
log-slow-sql: true
merge-sql: true
slow-sql-millis: 100
activemq:
enabled: true
enabled: false
brokerUrl: tcp://121.36.58.109:61616?wireFormat.maxInactivityDuration=0
password: admin
user: admin

@ -147,7 +147,7 @@ public class CallItemController {
@ResponseBody
@PostMapping("/cancelCallItem")
public R cancelCallItem(@RequestBody List<String> callItemNoList) {
public R cancelCallItem(@RequestBody List<CallItem> callItemNoList) {
try {
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
@ -162,6 +162,23 @@ public class CallItemController {
return R.ok("取消叫料成功");
}
@ResponseBody
@PostMapping("/refreshCallItem")
public R refreshCallItem(@RequestBody List<CallItem> callItemList) {
try {
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
if (callItemList == null || callItemList.size() <= 0) {
throw BusinessException.build("请至少选择一笔记录");
}
callItemService.refreshCallItem(site, user, callItemList);
} catch (Exception e) {
return R.failed(e.getMessage());
}
return R.ok("刷新叫料明细成功");
}
@ResponseBody
@PostMapping("/refreshRequiredTime")
public R refreshRequiredTime(@RequestBody List<String> callItemNoList) {

@ -72,38 +72,38 @@ public class SfcDispatchController {
public R getSfcDispatch(String workCenter, String dispatchStatus, String item, String itemNumber, String workOrder, String shopOrder,
String resrce, String resourceType, String operation, String sfc, String component, String componentDescription, String turnOperation,
String isDispatch, String startFromDate_S, String startToDate_S, String completeFromDate_S, String completeToDate_S) {
List<ShopOrderRelease> list;
List<SfcDispatchDto> list;
try {
ShopOrderRelease shopOrderRelease = new ShopOrderRelease();
shopOrderRelease.setSite(CommonMethods.getSite());
shopOrderRelease.setWorkCenter(workCenter);
shopOrderRelease.setDispatchStatus(dispatchStatus);
shopOrderRelease.setItem(item);
shopOrderRelease.setItemNumber(itemNumber);
shopOrderRelease.setWorkOrder(workOrder);
shopOrderRelease.setShopOrder(shopOrder);
shopOrderRelease.setResrce(resrce);
shopOrderRelease.setResourceType(resourceType);
shopOrderRelease.setOperation(operation);
shopOrderRelease.setSfc(sfc);
shopOrderRelease.setComponent(component);
shopOrderRelease.setComponentDescription(componentDescription);
shopOrderRelease.setTurnOperation(turnOperation);
shopOrderRelease.setIsDispatch(isDispatch);
SfcDispatchDto sfcDispatchDto = new SfcDispatchDto();
sfcDispatchDto.setSite(CommonMethods.getSite());
sfcDispatchDto.setWorkCenter(workCenter);
sfcDispatchDto.setDispatchStatus(dispatchStatus);
sfcDispatchDto.setItem(item);
sfcDispatchDto.setItemNumber(itemNumber);
sfcDispatchDto.setWorkOrder(workOrder);
sfcDispatchDto.setShopOrder(shopOrder);
sfcDispatchDto.setResrce(resrce);
sfcDispatchDto.setResourceType(resourceType);
sfcDispatchDto.setOperation(operation);
sfcDispatchDto.setSfc(sfc);
sfcDispatchDto.setComponent(component);
sfcDispatchDto.setComponentDescription(componentDescription);
sfcDispatchDto.setTurnOperation(turnOperation);
sfcDispatchDto.setIsDispatch(isDispatch);
if (startFromDate_S != null) {
shopOrderRelease.setStartFromDate(DateUtil.parse(startFromDate_S));
sfcDispatchDto.setStartFromDate(DateUtil.parse(startFromDate_S));
}
if (startToDate_S != null) {
shopOrderRelease.setStartToDate(DateUtil.parse(startToDate_S));
sfcDispatchDto.setStartToDate(DateUtil.parse(startToDate_S));
}
if (completeFromDate_S != null) {
shopOrderRelease.setCompleteFromDate(DateUtil.parse(completeFromDate_S));
sfcDispatchDto.setCompleteFromDate(DateUtil.parse(completeFromDate_S));
}
if (completeToDate_S != null) {
shopOrderRelease.setCompleteToDate(DateUtil.parse(completeToDate_S));
sfcDispatchDto.setCompleteToDate(DateUtil.parse(completeToDate_S));
}
list = sfcDispatchService.findSfcDispatchList(shopOrderRelease);
list = sfcDispatchService.findSfcDispatchList(sfcDispatchDto);
} catch (Exception e) {
return R.failed(e.getMessage());
}
@ -114,29 +114,29 @@ public class SfcDispatchController {
/**
*
*
* @param shopOrderRelease
* @param sfcDispatchDto
* @return
*/
@ResponseBody
@PostMapping("findSfcDispatch")
public R findSfcDispatch(@RequestBody ShopOrderRelease shopOrderRelease) {
List<ShopOrderRelease> list;
public R findSfcDispatch(@RequestBody SfcDispatchDto sfcDispatchDto) {
List<SfcDispatchDto> list;
try {
shopOrderRelease.setSite(CommonMethods.getSite());
if (shopOrderRelease.getStartFromDate_S() != null) {
shopOrderRelease.setStartFromDate(DateUtil.parse(shopOrderRelease.getStartFromDate_S()));
sfcDispatchDto.setSite(CommonMethods.getSite());
if (sfcDispatchDto.getStartFromDate_S() != null) {
sfcDispatchDto.setStartFromDate(DateUtil.parse(sfcDispatchDto.getStartFromDate_S()));
}
if (shopOrderRelease.getStartToDate_S() != null) {
shopOrderRelease.setStartToDate(DateUtil.parse(shopOrderRelease.getStartToDate_S()));
if (sfcDispatchDto.getStartToDate_S() != null) {
sfcDispatchDto.setStartToDate(DateUtil.parse(sfcDispatchDto.getStartToDate_S()));
}
if (shopOrderRelease.getCompleteFromDate_S() != null) {
shopOrderRelease.setCompleteFromDate(DateUtil.parse(shopOrderRelease.getCompleteFromDate_S()));
if (sfcDispatchDto.getCompleteFromDate_S() != null) {
sfcDispatchDto.setCompleteFromDate(DateUtil.parse(sfcDispatchDto.getCompleteFromDate_S()));
}
if (shopOrderRelease.getCompleteToDate_S() != null) {
shopOrderRelease.setCompleteToDate(DateUtil.parse(shopOrderRelease.getCompleteToDate_S()));
if (sfcDispatchDto.getCompleteToDate_S() != null) {
sfcDispatchDto.setCompleteToDate(DateUtil.parse(sfcDispatchDto.getCompleteToDate_S()));
}
list = sfcDispatchService.findSfcDispatchList(shopOrderRelease);
list = sfcDispatchService.findSfcDispatchList(sfcDispatchDto);
} catch (Exception e) {
return R.failed(e.getMessage());
}
@ -330,24 +330,24 @@ public class SfcDispatchController {
@PostMapping("/gantt-list")
public R ganttList(@RequestBody ShopOrderRelease shopOrderRelease) {
public R ganttList(@RequestBody SfcDispatchDto sfcDispatchDto) {
Map<String, Object> result = new HashMap<>();
try {
String site = CommonMethods.getSite();
if (StringUtil.isBlank(shopOrderRelease.getStartFromDate_S())) {
if (StringUtil.isBlank(sfcDispatchDto.getStartFromDate_S())) {
throw BusinessException.build("派工开始时间不能为空!");
}
if (StringUtil.isBlank(shopOrderRelease.getStartToDate_S())) {
if (StringUtil.isBlank(sfcDispatchDto.getStartToDate_S())) {
throw BusinessException.build("派工开始时间不能为空!");
}
shopOrderRelease.setSite(site);
shopOrderRelease.setDispatchStatus(DispatchStatusEnum.RELEASE.getCode());
shopOrderRelease.setStartFromDate(DateUtil.parseDate(shopOrderRelease.getStartFromDate_S()));
shopOrderRelease.setStartToDate(DateUtil.parseDate(shopOrderRelease.getStartToDate_S()));
sfcDispatchDto.setSite(site);
sfcDispatchDto.setDispatchStatus(DispatchStatusEnum.RELEASE.getCode());
sfcDispatchDto.setStartFromDate(DateUtil.parseDate(sfcDispatchDto.getStartFromDate_S()));
sfcDispatchDto.setStartToDate(DateUtil.parseDate(sfcDispatchDto.getStartToDate_S()));
result = sfcDispatchService.ganttList(site, shopOrderRelease);
result = sfcDispatchService.ganttList(site, sfcDispatchDto);
} catch (Exception e) {
return R.failed(e.getMessage());
}

@ -7,6 +7,7 @@ public class IssueItemDto implements Serializable {
private String site;
private String item;
private String workOrder;
private String resource;
private String workCenter;
private String shopOrder;
@ -31,6 +32,14 @@ public class IssueItemDto implements Serializable {
this.item = item;
}
public String getWorkOrder() {
return workOrder;
}
public void setWorkOrder(String workOrder) {
this.workOrder = workOrder;
}
public String getResource() {
return resource;
}

@ -36,7 +36,7 @@ public interface CallItemMapper extends BaseMapper<CallItem> {
List<CallItem> findCallItemDetailListByDispatchBo(@Param("site") String site, @Param("list") List<String> list);
void updateCallItemStatusByDispatchBo(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List<CallItem> list);
void updateCallItemStatusByDispatchBo(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List<String> list);
void updateCallItemStatusByCallItemNo(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List<String> list);

@ -27,10 +27,10 @@ public interface SfcDispatchMapper extends BaseMapper<SfcDispatch> {
/**
*
*
* @param shopOrderRelease
* @param sfcDispatchDto
* @return
*/
List<ShopOrderRelease> findSfcDispatchList(ShopOrderRelease shopOrderRelease);
List<SfcDispatchDto> findSfcDispatchList(SfcDispatchDto sfcDispatchDto);
/**
*

@ -138,6 +138,8 @@ public class CallItem extends Model<CallItem> {
@TableField(exist = false)
private String item;
@TableField(exist = false)
private String itemGroup;
@TableField(exist = false)
private String component;
@TableField(exist = false)
private String itemDescription;
@ -170,6 +172,10 @@ public class CallItem extends Model<CallItem> {
@TableField(exist = false)
private String remark;
@TableField(exist = false)
private BigDecimal sizeReqQty;
@TableField(exist = false)
private BigDecimal compReqQty;
@TableField(exist = false)
private String startFromDate_S;
@TableField(exist = false)
private String startToDate_S;
@ -362,6 +368,14 @@ public class CallItem extends Model<CallItem> {
this.item = item;
}
public String getItemGroup() {
return itemGroup;
}
public void setItemGroup(String itemGroup) {
this.itemGroup = itemGroup;
}
public String getComponent() {
return component;
}
@ -490,6 +504,22 @@ public class CallItem extends Model<CallItem> {
this.remark = remark;
}
public BigDecimal getSizeReqQty() {
return sizeReqQty;
}
public void setSizeReqQty(BigDecimal sizeReqQty) {
this.sizeReqQty = sizeReqQty;
}
public BigDecimal getCompReqQty() {
return compReqQty;
}
public void setCompReqQty(BigDecimal compReqQty) {
this.compReqQty = compReqQty;
}
public String getStartFromDate_S() {
return startFromDate_S;
}

@ -61,7 +61,6 @@ public class ShopOrderRelease extends SfcDispatch {
private String operationDescription;
private String isCompleted;
private BigDecimal completedQty;
private String userName;
private String resourceWorkCenter;
private LocalDateTime dispatchCompleteDate;
@ -231,14 +230,6 @@ public class ShopOrderRelease extends SfcDispatch {
this.resourceWorkCenter = resourceWorkCenter;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public LocalDateTime getDispatchCompleteDate() {
return dispatchCompleteDate;
}

@ -85,7 +85,16 @@ public interface CallItemService extends IService<CallItem> {
* @param user
* @param callItemNoList
*/
void cancelCallItem(String site, String user, List<String> callItemNoList);
void cancelCallItem(String site, String user, List<CallItem> callItemNoList);
/**
*
*
* @param site
* @param user
* @param callItemList
*/
void refreshCallItem(String site, String user, List<CallItem> callItemList);
/**
*
@ -96,6 +105,14 @@ public interface CallItemService extends IService<CallItem> {
*/
void refreshRequiredTime(String site, String user, List<String> callItemNoList);
/**
*
*
* @param user
* @param status
* @param list
*/
void updateCallItemStatusByDispatchBo(String status, String user, List<String> list);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/**

@ -28,4 +28,7 @@ public interface ItemBatchService extends IService<ItemBatch> {
* @return
*/
List<ItemBatch> findItemBatch(String site, String item, String batch);
List<ItemBatch> findItemLabel(String site, String item, String label);
}

@ -34,10 +34,10 @@ public interface SfcDispatchService extends IService<SfcDispatch> {
/**
*
*
* @param shopOrderRelease
* @param sfcDispatchDto
* @return
*/
List<ShopOrderRelease> findSfcDispatchList(ShopOrderRelease shopOrderRelease);
List<SfcDispatchDto> findSfcDispatchList(SfcDispatchDto sfcDispatchDto);
/**
*
@ -106,8 +106,8 @@ public interface SfcDispatchService extends IService<SfcDispatch> {
*
*
* @param site
* @param shopOrderRelease
* @param sfcDispatchDto
* @return
*/
Map<String, Object> ganttList(String site, ShopOrderRelease shopOrderRelease);
Map<String, Object> ganttList(String site, SfcDispatchDto sfcDispatchDto);
}

@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
@ -80,8 +81,6 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
callItem.setRequiredQty(sfcDispatchDto.getDispatchQty());
callItem.setRequiredDateTime(sfcDispatchDto.getPlannedStartDate());
callItem.setStatus(Constants.CALL_ITEM_STATUS_NEW);
callItem.setCallStatus(Constants.CALL_ITEM_STATUS_NEW);
callItem.setIssueStatus(Constants.CALL_ITEM_STATUS_NEW);
callItem.setCreateUser(user);
callItem.setCreatedDateTime(nowDate);
callItem.setModifyUser(user);
@ -101,8 +100,6 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
callItem.setHandle(HandleEnum.CALL_ITEM.getHandle(site, callItemNo));
callItem.setCallType(Constants.CALL_TYPE_MATERIAL);
callItem.setStatus(Constants.CALL_ITEM_STATUS_NEW);
callItem.setCallStatus(Constants.CALL_ITEM_STATUS_NEW);
callItem.setIssueStatus(Constants.CALL_ITEM_STATUS_NEW);
callItem.setCreateUser(user);
callItem.setCreatedDateTime(nowDate);
callItem.setModifyUser(user);
@ -143,8 +140,13 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
return;
}
LocalDateTime dateTime = LocalDateTime.now();
callItemMapper.updateCallItemStatusByDispatchBo(Constants.CALL_ITEM_STATUS_CALLED, user, dateTime, callItemList);
//派工单号集合
List<String> dispatchBoList = new ArrayList<>();
for (CallItem callItem : callItemList) {
dispatchBoList.add(callItem.getSfcDispatchBo());
}
this.updateCallItemStatusByDispatchBo(Constants.CALL_ITEM_STATUS_CALLED, user, dispatchBoList);
}
@Override
@ -153,6 +155,8 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
return;
}
//派工单号集合
List<String> dispatchBoList = new ArrayList<>();
for (CallItem callItem : callItemList) {
String sfcDispatchBo = callItem.getSfcDispatchBo();
List<CallItem> list = callItemMapper.selectCallItemAndType(sfcDispatchBo);
@ -167,20 +171,87 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
throw BusinessException.build("勾选的派工单包含原材料组件,不能触发确认到料");
}
}
dispatchBoList.add(sfcDispatchBo);
}
LocalDateTime dateTime = LocalDateTime.now();
callItemMapper.updateCallItemStatusByDispatchBo(Constants.CALL_ITEM_STATUS_ISSUED, user, dateTime, callItemList);
this.updateCallItemStatusByDispatchBo(Constants.CALL_ITEM_STATUS_ISSUED, user, dispatchBoList);
}
@Override
public void cancelCallItem(String site, String user, List<String> callItemNoList) {
public void cancelCallItem(String site, String user, List<CallItem> callItemNoList) {
if (callItemNoList == null || callItemNoList.size() <= 0) {
return;
}
List<String> callItemList = new ArrayList<>();
for (CallItem callItem: callItemNoList) {
String status = callItem.getStatus();
if (Constants.CALL_ITEM_STATUS_ISSUED.equals(status)) {
throw BusinessException.build("领料单号【" +callItem.getCallItemNo()+ "】已发料,不允许取消!");
}
callItemList.add(callItem.getCallItemNo());
}
LocalDateTime dateTime = LocalDateTime.now();
callItemMapper.updateCallItemStatusByCallItemNo(Constants.CALL_ITEM_STATUS_CANCELED, user, dateTime, callItemNoList);
callItemMapper.updateCallItemStatusByCallItemNo(Constants.CALL_ITEM_STATUS_CANCELED, user, dateTime, callItemList);
}
@Override
public void refreshCallItem(String site, String user, List<CallItem> callItemList) {
if (callItemList == null || callItemList.size() <= 0) {
return;
}
List<SfcDispatchDto> sfcDispatchList = new ArrayList<>();
for (CallItem callItem: callItemList) {
SfcDispatchDto sfcDispatchDto = new SfcDispatchDto();
sfcDispatchDto.setHandle(callItem.getSfcDispatchBo());
sfcDispatchList.add(sfcDispatchDto);
}
List<CallItem> list = callItemMapper.selectDispatchCallItem(sfcDispatchList);
if (list == null || list.size() <= 0) {
return;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LocalDateTime nowDate = LocalDateTime.now();
List<CallItem> addList = new ArrayList<>();
List<CallItem> modList = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
CallItem callItem = list.get(i);
String handle = callItem.getHandle();
BigDecimal reqQty = callItem.getRequiredQty();
if (reqQty.compareTo(BigDecimal.ZERO) == 1) {
if (StringUtil.isBlank(handle)) {
String component = StringUtil.trimHandle(callItem.getComponentBo());
String callItemNo = callItem.getSfc() + callItem.getStepId() + component;
callItem.setCallItemNo(callItemNo);
callItem.setHandle(HandleEnum.CALL_ITEM.getHandle(site, callItemNo));
callItem.setCallType(Constants.CALL_TYPE_MATERIAL);
callItem.setStatus(Constants.CALL_ITEM_STATUS_NEW);
callItem.setCreateUser(user);
callItem.setCreatedDateTime(nowDate);
callItem.setModifyUser(user);
callItem.setModifiedDateTime(nowDate);
addList.add(callItem);
} else {
callItem.setRequiredQty(callItem.getIssueQty());
callItem.setModifyUser(user);
callItem.setModifiedDateTime(nowDate);
modList.add(callItem);
}
}
}
if (addList != null && addList.size() > 0) {
this.saveBatch(addList);
}
if (modList != null && modList.size() > 0) {
this.updateBatchById(modList);
}
}
@Override
@ -194,6 +265,12 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
callItemMapper.refreshRequiredTime(user, dateTime, callItemNoList);
}
@Override
public void updateCallItemStatusByDispatchBo(String status, String user, List<String> list) {
LocalDateTime dateTime = LocalDateTime.now();
callItemMapper.updateCallItemStatusByDispatchBo(status, user, dateTime, list);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@Override
@ -203,10 +280,64 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
@Override
public List<CallItem> findIssueItemList(IssueItemDto issueItemDto) {
List<CallItem> list;
if (issueItemDto.getMatchResource()) {
return callItemMapper.finsIssueItemListToResource(issueItemDto);
list = callItemMapper.finsIssueItemListToResource(issueItemDto);
} else {
return callItemMapper.finsIssueItemListNoResource(issueItemDto);
list = callItemMapper.finsIssueItemListNoResource(issueItemDto);
}
if (list == null || list.size() <= 0) {
return list;
}
//计算合计(按下料尺寸)
//物料组为GB(钢板):合计=下料尺寸*号最后两位相乘*需求数量
//其他物料: 合计:下料尺寸*号最后一位*需求数量
Map<String, BigDecimal> compQtyMap = new HashMap<>();
for (CallItem callItem: list) {
String component = callItem.getItem();
String itemGroup = callItem.getItemGroup();
BigDecimal reqQty = callItem.getRequiredQty();
String blankingSize = callItem.getBlankingSize();
//工序叫料不需要计算数量
if (Constants.CALL_TYPE_OPERATION.equals(callItem.getCallType())) {
callItem.setSizeReqQty(BigDecimal.ONE);
compQtyMap.put(component, BigDecimal.ONE);
continue;
}
if ("GB".equals(itemGroup) && blankingSize.contains("*")) {
String []size = blankingSize.split("/*");
if (size != null && size.length >= 2) {
int sizeLength = size.length;
BigDecimal length = new BigDecimal(size[sizeLength-1]);
BigDecimal width = new BigDecimal(size[sizeLength-2]);
BigDecimal sizeReqQty = length.multiply(width).multiply(reqQty);
callItem.setSizeReqQty(sizeReqQty);
//按物料汇总需求数量
compQtyMap.put(component, (compQtyMap.get(component) != null ? compQtyMap.get(component).add(sizeReqQty) : sizeReqQty));
}
} else {
String []size = blankingSize.split("/*");
if (size != null && size.length >= 1) {
int sizeLength = size.length;
BigDecimal length = new BigDecimal(size[sizeLength-1]);
BigDecimal sizeReqQty = length.multiply(reqQty);
callItem.setSizeReqQty(sizeReqQty);
//按物料汇总需求数量
compQtyMap.put(component, (compQtyMap.get(component) != null ? compQtyMap.get(component).add(sizeReqQty) : sizeReqQty));
}
}
}
//计算总数量(按数量汇总)
for (CallItem callItem : list) {
callItem.setCompReqQty(compQtyMap.get(callItem.getItem()));
}
return list;
}
}

@ -89,7 +89,7 @@ public class IssueItemServiceImpl extends ServiceImpl<IssueItemMapper, IssueItem
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (MaterialType.RAW.value().equals(materialType)){
//原材料
List<ItemBatch> itemBatchList = itemBatchService.findItemBatch(site, item, inventory);
List<ItemBatch> itemBatchList = itemBatchService.findItemLabel(site, item, inventory);
if (itemBatchList == null || itemBatchList.size() <= 0) {
throw BusinessException.build("扫描的物料条码【 "+ inventory +" 】不存在!");
}
@ -178,10 +178,12 @@ public class IssueItemServiceImpl extends ServiceImpl<IssueItemMapper, IssueItem
if (MaterialType.RAW.value().equals(materialType)) {
//原材料
List<ItemBatch> itemBatchList = itemBatchService.findItemBatch(site, item, inventory);
List<ItemBatch> itemBatchList = itemBatchService.findItemLabel(site, item, inventory);
if (itemBatchList == null || itemBatchList.size() <= 0) {
throw BusinessException.build("扫描的物料条码【 " + inventory + " 】不存在!");
}
String batch = itemBatchList.get(0).getBatch();
String supplier = itemBatchList.get(0).getSupplier();
try {
//查询库存是否存在
@ -195,6 +197,20 @@ public class IssueItemServiceImpl extends ServiceImpl<IssueItemMapper, IssueItem
request.setItemRef(itemBo);
request.setInventoryId(inventory);
request.setQuantityOnHand(issueInvQty);
//库存自定义字段
List<InventoryDataField> inventoryDataFieldList = new ArrayList<>();
InventoryDataField dataField = new InventoryDataField();
dataField.setAttribute("BATCH_NUMBER");
dataField.setValue(batch);
inventoryDataFieldList.add(dataField);
dataField = new InventoryDataField();
dataField.setAttribute("VENDOR_NAME");
dataField.setValue(supplier);
inventoryDataFieldList.add(dataField);
request.setAssemblyDataList(inventoryDataFieldList);
meInventoryService.validateAndAdd(request);
} else {
issueInvQty = issueInvQty.add(inventoryModel.getQtyOnHand());

@ -41,7 +41,19 @@ public class ItemBatchServiceImpl extends ServiceImpl<ItemBatchMapper, ItemBatch
queryMap.put(ItemBatch.SITE, site);
queryMap.put(ItemBatch.ITEM, item);
if (StringUtil.notBlank(batch)) {
queryMap.put(ItemBatch.LABEL, batch);
queryMap.put(ItemBatch.BATCH, batch);
}
return itemBatchMapper.selectByMap(queryMap);
}
@Override
public List<ItemBatch> findItemLabel(String site, String item, String label) {
Map<String, Object> queryMap = new HashMap<>();
queryMap.put(ItemBatch.SITE, site);
queryMap.put(ItemBatch.ITEM, item);
if (StringUtil.notBlank(label)) {
queryMap.put(ItemBatch.LABEL, label);
}
return itemBatchMapper.selectByMap(queryMap);

@ -85,8 +85,8 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
}
@Override
public List<ShopOrderRelease> findSfcDispatchList(ShopOrderRelease shopOrderRelease) {
return sfcDispatchMapper.findSfcDispatchList(shopOrderRelease);
public List<SfcDispatchDto> findSfcDispatchList(SfcDispatchDto sfcDispatchDto) {
return sfcDispatchMapper.findSfcDispatchList(sfcDispatchDto);
}
@Override
@ -184,6 +184,7 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
LocalDateTime nowDate = LocalDateTime.now();
SfcDispatch sfcDispatch = null;
List<SfcDispatch> list = new ArrayList<>();
List<String> dispatchBoList = new ArrayList<>();
for (SfcDispatchDto sfcDispatchDto : sfcDispatchList) {
String sfcDispatchBo = sfcDispatchDto.getHandle();
String shopOrder = sfcDispatchDto.getShopOrder();
@ -209,12 +210,17 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
sfcDispatchDto.setDispatchStatus(DispatchStatusEnum.CANCEL.getCode());
dispatchBoList.add(sfcDispatchBo);
}
if (list != null && list.size() > 0) {
this.updateBatchById(list);
}
//取消叫料数据
callItemService.updateCallItemStatusByDispatchBo(Constants.CALL_ITEM_STATUS_CANCELED, user, dispatchBoList);
//取消产前准备任务
prodReadyTaskService.createTask(sfcDispatchList);
}
@ -242,11 +248,11 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
}
@Override
public Map<String, Object> ganttList(String site, ShopOrderRelease shopOrderRelease) {
public Map<String, Object> ganttList(String site, SfcDispatchDto sfcDispatchDto) {
Map<String, Object> map = new HashMap<>();
//查询派工数据
List<ShopOrderRelease> scheduleList = this.findSfcDispatchList(shopOrderRelease);
List<SfcDispatchDto> scheduleList = this.findSfcDispatchList(sfcDispatchDto);
if (scheduleList == null || scheduleList.size() <= 0) {
return map;
}
@ -259,7 +265,7 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
}
});
Map<String, Map<String, List<WorkCenterWorkTimeDTO>>> processedMap = this.processWorkCenterWorkTimes(site, workCenterList, shopOrderRelease.getStartFromDate(), shopOrderRelease.getStartToDate());
Map<String, Map<String, List<WorkCenterWorkTimeDTO>>> processedMap = this.processWorkCenterWorkTimes(site, workCenterList, sfcDispatchDto.getStartFromDate(), sfcDispatchDto.getStartToDate());
map.put("workCenterWorkTimes", processedMap);
return map;
@ -428,7 +434,7 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
}
//校验操作者与资源是否匹配
String employees = sfcDispatchDto.getUserName();
String employees = sfcDispatchDto.getEmployee();
if (StringUtil.notBlank(employees)) {
//资源、计划时间必输
if (StringUtils.isBlank(resource)) {
@ -439,7 +445,7 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
}
//派工人员为多个
String [] employeeArray = new String[]{};
String [] employeeArray = new String[1];
if (!employees.contains(",")) {
employeeArray[0] = employees;
} else {

@ -1,12 +1,17 @@
package com.foreverwin.mesnac.dispatch.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.model.PrintLog;
import com.foreverwin.mesnac.common.service.PrintLogService;
import com.foreverwin.mesnac.common.util.ExceptionUtil;
import com.foreverwin.mesnac.common.util.NumberUtil;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dispatch.model.SurplusInventory;
import com.foreverwin.mesnac.dispatch.service.SurplusInventoryService;
import com.foreverwin.mesnac.meapi.model.Inventory;
import com.foreverwin.mesnac.meapi.model.InventoryAssyData;
import com.foreverwin.mesnac.meapi.service.InventoryAssyDataService;
import com.foreverwin.mesnac.meapi.service.InventoryService;
import com.foreverwin.modular.core.exception.BusinessException;
@ -51,7 +56,10 @@ public class SurplusReturnServiceImpl extends ServiceImpl<SurplusReturnMapper, S
private SurplusReturnMapper surplusReturnMapper;
@Autowired
private SurplusInventoryService surplusInventoryService;
@Autowired
private PrintLogService printLogService;
@Autowired
private InventoryAssyDataService inventoryAssyDataService;
@Override
public Map<String, Object> getInventoryData(String site, String inventory) {
@ -181,5 +189,35 @@ public class SurplusReturnServiceImpl extends ServiceImpl<SurplusReturnMapper, S
surplusItemReturn.setModifyUser(user);
surplusItemReturn.setModifiedDateTime(dateTime);
surplusReturnMapper.insert(surplusItemReturn);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// 记录余料信息,提供打印
// {"ITEM":"500100010001","INVENTORY":"500100010001*20210721","ITEM_DESC":"测试物料","SUPPLIER":"BA002"}
PrintLog printLog = new PrintLog();
printLog.setHandle(UUID.randomUUID().toString());
printLog.setSfc(site);
printLog.setCategory(Constants.PRINT_TYPE_EXM);
printLog.setPrintTemplate(Constants.PRINT_TYPE_EXM);
//打印模板参数
JSONObject jsonObject = new JSONObject();
jsonObject.put("ITEM", inventoryModel.getItemBo().split(",")[1]); // 物料编号
jsonObject.put("ITEM_DESC", inventoryModel.getDescription()); // 物料描述
InventoryAssyData inventoryAssyData = new InventoryAssyData();
inventoryAssyData.setInventoryBo(inventoryBo);
inventoryAssyData.setDataField("VENDOR_NAME");
List<InventoryAssyData> inventoryAssyDataList = inventoryAssyDataService.selectList(inventoryAssyData);
if (inventoryAssyDataList.size() == 1){
jsonObject.put("SUPPLIER", inventoryAssyDataList.get(0).getDataAttr()); // 供应商
}else {
throw BusinessException.build("未正确找到当前批次的供应商!");
}
jsonObject.put("INVENTORY", surplusInventory); // 批次号
printLog.setPrintParam(jsonObject.toString());
printLog.setInventory(surplusInventory);
printLog.setItemBo(inventoryModel.getItemBo());
//printLog.setIsPrint("false");
printLog.setCreateUser(user);
printLog.setCreatedDateTime(dateTime);
printLogService.save(printLog);
}
}

@ -28,6 +28,7 @@
<resultMap id="FullResultMap" type="com.foreverwin.mesnac.dispatch.model.CallItem" extends="BaseResultMap">
<result column="ITEM" property="item" />
<result column="ITEM_GROUP" property="itemGroup" />
<result column="COMPONENT" property="component" />
<result column="ITEM_DESCRIPTION" property="itemDescription" />
<result column="MATERIAL_TYPE" property="materialType" />
@ -595,7 +596,7 @@
<select id="selectEffectedCallItemByDispatchBo" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM Z_CALL_ITEM
WHERE SFC_DISPATCH_BO = #{sfcDispatchBo}
WHERE SFC_DISPATCH_BO = #{sfcDispatchBo} AND STATUS IN ('802','803')
</select>
<delete id="deleteDispatchCallItem">
@ -607,7 +608,7 @@
<select id="selectDispatchCallItem" resultMap="BaseResultMap">
SELECT ZSD.HANDLE SFC_DISPATCH_BO, ZSD.SITE, ZSD.SHOP_ORDER, ZSD.SFC, ZSD.DISPATCH_NO, ZSD.OPERATION, ZSD.STEP_ID, ZSD.RESRCE, BC.COMPONENT_GBO COMPONENT_BO,
SC.QTY*BC.QTY REQUIRED_QTY, ZSD.PLANNED_START_DATE REQUIRED_DATE_TIME
SC.QTY*BC.QTY ISSUE_QTY, SC.QTY*BC.QTY-NVL(ZCI.REQUIRED_QTY,0) REQUIRED_QTY, ZSD.PLANNED_START_DATE REQUIRED_DATE_TIME, ZCI.HANDLE, ZCI.CALL_TYPE
FROM Z_SFC_DISPATCH ZSD
INNER JOIN SFC SC ON SC.SITE = ZSD.SITE AND SC.SFC = ZSD.SFC
INNER JOIN SFC_BOM SB ON SB.SFC_BO = SC.HANDLE
@ -615,10 +616,12 @@
INNER JOIN ITEM CP ON CP.HANDLE = BC.COMPONENT_GBO
INNER JOIN BOM_OPERATION BO ON BO.BOM_COMPONENT_BO = BC.HANDLE AND BO.OPERATION_BO = 'OperationBO:'||SC.SITE||','||ZSD.OPERATION||',#'
INNER JOIN CUSTOM_FIELDS CF ON CF.HANDLE = BC.HANDLE AND CF."ATTRIBUTE" = 'STEP_ID' AND CF.VALUE = ZSD.STEP_ID
LEFT JOIN Z_CALL_ITEM ZCI ON ZCI.SFC_DISPATCH_BO = ZSD.HANDLE AND ZCI.COMPONENT_BO = CP.HANDLE AND ZCI.STEP_ID = ZSD.STEP_ID
WHERE ZSD.HANDLE IN
<foreach item="item" collection="list" separator="," open="(" close=")" index="">
#{item.handle}
</foreach>
ORDER BY TO_NUMBER(CF.VALUE)
</select>
<select id="selectCallItemAndType" resultMap="FullResultMap">
@ -734,7 +737,7 @@
GROUP BY SITE, SFC
) ZS ON ZS.SITE = SC.SITE AND ZS.SFC = SC.SFC
WHERE IV.QTY_ON_HAND > 0
) VS ON VS.SITE = ZCI.SITE AND VS.ITEM_BO = ZCI.COMPONENT_BO
) VS ON VS.SITE = ZCI.SITE AND ZCI.SFC = VS.SFC AND VS.ITEM_BO = ZCI.COMPONENT_BO
LEFT JOIN Z_SFC_DISPATCH ZSH ON ZSH.SITE = VS.SITE AND ZSH.SFC = VS.SFC AND ZSH.DISPATCH_SEQ = VS.DISPATCH_SEQ
WHERE ZCI.SITE = #{site}
<if test="workCenter != null and workCenter != ''" >
@ -826,7 +829,7 @@
UPDATE Z_CALL_ITEM SET STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime}
WHERE STATUS != '804' AND SFC_DISPATCH_BO IN
<foreach item="item" collection="list" separator="," open="(" close=")" index="">
#{item.sfcDispatchBo}
#{item}
</foreach>
</update>
@ -872,13 +875,15 @@
</select>
<select id="finsIssueItemListToResource" resultMap="FullResultMap">
SELECT VIP.SITE, VIP.WORK_ORDER, VIP.ITEM_BO, VIP.ITEM, VIP.ITEM_DESCRIPTION, VIP.REQUIRED_QTY, VIP.BLANKING_SIZE, VIP.RESRCE, SIP.SOURCE_RESOURCE
SELECT VIP.SITE, VIP.WORK_ORDER, VIP.CALL_TYPE, VIP.ITEM_GROUP, VIP.ITEM_BO, VIP.ITEM, VIP.ITEM_DESCRIPTION, VIP.REQUIRED_QTY, VIP.BLANKING_SIZE, VIP.RESRCE, SIP.SOURCE_RESOURCE
FROM (
SELECT L.SITE, CF.VALUE WORK_ORDER, CP.HANDLE ITEM_BO, CP.ITEM, CT.DESCRIPTION ITEM_DESCRIPTION, SUM(L.REQUIRED_QTY)-SUM(NVL(L.ISSUE_QTY,0)) REQUIRED_QTY, W.BLANKING_SIZE, W.RESRCE
SELECT L.SITE, CF.VALUE WORK_ORDER, L.CALL_TYPE, IG.ITEM_GROUP, CP.HANDLE ITEM_BO, CP.ITEM, CT.DESCRIPTION ITEM_DESCRIPTION, SUM(L.REQUIRED_QTY)-SUM(NVL(L.ISSUE_QTY,0)) REQUIRED_QTY, W.BLANKING_SIZE, W.RESRCE
FROM Z_CALL_ITEM L
INNER JOIN Z_SFC_DISPATCH W ON L.SFC_DISPATCH_BO = W.HANDLE
INNER JOIN ITEM CP ON CP.HANDLE = L.COMPONENT_BO
LEFT JOIN ITEM_T CT ON CT.ITEM_BO = CP.HANDLE AND CT.LOCALE = 'zh'
LEFT JOIN ITEM_GROUP_MEMBER IGM ON IGM.ITEM_BO = CP.HANDLE
LEFT JOIN ITEM_GROUP IG ON IG.HANDLE = IGM.ITEM_GROUP_BO
INNER JOIN SHOP_ORDER SO ON SO.SITE = L.SITE AND SO.SHOP_ORDER = L.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = SO.HANDLE AND CF."ATTRIBUTE" = 'WORK_ORDER'
WHERE L.SITE = #{site} AND L.STATUS = '802'
@ -891,8 +896,8 @@
<if test="shopOrder != null and shopOrder != ''">
AND SO.SHOP_ORDER = #{shopOrder}
</if>
<if test="dispatchNo != null and dispatchNo != ''">
AND W.DISPATCH_NO = #{dispatchNo}
<if test="workOrder != null and workOrder != ''">
AND CF.VALUE = #{workOrder}
</if>
<if test="requiredFromDT != null">
AND L.REQUIRED_DATE_TIME >= #{requiredFromDT}
@ -900,7 +905,7 @@
<if test="requiredToDT != null">
AND L.REQUIRED_DATE_TIME &lt;= #{requiredToDT}
</if>
GROUP BY L.SITE, CF.VALUE, CP.HANDLE, CP.ITEM, CT.DESCRIPTION, W.BLANKING_SIZE, W.RESRCE
GROUP BY L.SITE, CF.VALUE, L.CALL_TYPE, IG.ITEM_GROUP, CP.HANDLE, CP.ITEM, CT.DESCRIPTION, W.BLANKING_SIZE, W.RESRCE
) VIP
LEFT JOIN (
SELECT L.SITE, L.ITEM_BO, ZD.RESRCE SOURCE_RESOURCE
@ -914,16 +919,19 @@
WHERE W.QTY_ON_HAND > 0
) SIP
ON VIP.SITE = SIP.SITE AND VIP.ITEM_BO = SIP.ITEM_BO AND VIP.REQUIRED_QTY > 0
ORDER BY VIP.WORK_ORDER, VIP.ITEM
</select>
<select id="finsIssueItemListNoResource" resultMap="FullResultMap">
SELECT VIP.SITE, VIP.WORK_ORDER, VIP.ITEM_BO, VIP.ITEM, VIP.ITEM_DESCRIPTION, VIP.REQUIRED_QTY, VIP.BLANKING_SIZE, SIP.SOURCE_RESOURCE
SELECT VIP.SITE, VIP.WORK_ORDER, VIP.CALL_TYPE, VIP.ITEM_GROUP, VIP.ITEM_BO, VIP.ITEM, VIP.ITEM_DESCRIPTION, VIP.REQUIRED_QTY, VIP.BLANKING_SIZE, SIP.SOURCE_RESOURCE
FROM (
SELECT L.SITE, CF.VALUE WORK_ORDER, CP.HANDLE ITEM_BO, CP.ITEM, CT.DESCRIPTION ITEM_DESCRIPTION, SUM(L.REQUIRED_QTY)-SUM(NVL(L.ISSUE_QTY,0)) REQUIRED_QTY, W.BLANKING_SIZE
SELECT L.SITE, CF.VALUE WORK_ORDER, L.CALL_TYPE, IG.ITEM_GROUP, CP.HANDLE ITEM_BO, CP.ITEM, CT.DESCRIPTION ITEM_DESCRIPTION, SUM(L.REQUIRED_QTY)-SUM(NVL(L.ISSUE_QTY,0)) REQUIRED_QTY, W.BLANKING_SIZE
FROM Z_CALL_ITEM L
INNER JOIN Z_SFC_DISPATCH W ON L.SFC_DISPATCH_BO = W.HANDLE
INNER JOIN ITEM CP ON CP.HANDLE = L.COMPONENT_BO
LEFT JOIN ITEM_T CT ON CT.ITEM_BO = CP.HANDLE AND CT.LOCALE = 'zh'
LEFT JOIN ITEM_GROUP_MEMBER IGM ON IGM.ITEM_BO = CP.HANDLE
LEFT JOIN ITEM_GROUP IG ON IG.HANDLE = IGM.ITEM_GROUP_BO
INNER JOIN SHOP_ORDER SO ON SO.SITE = L.SITE AND SO.SHOP_ORDER = L.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = SO.HANDLE AND CF."ATTRIBUTE" = 'WORK_ORDER'
WHERE L.SITE = #{site} AND L.STATUS = '802'
@ -936,8 +944,8 @@
<if test="shopOrder != null and shopOrder != ''">
AND SO.SHOP_ORDER = #{shopOrder}
</if>
<if test="dispatchNo != null and dispatchNo != ''">
AND W.DISPATCH_NO = #{dispatchNo}
<if test="workOrder != null and workOrder != ''">
AND CF.VALUE = #{workOrder}
</if>
<if test="requiredFromDT != null">
AND L.REQUIRED_DATE_TIME >= #{requiredFromDT}
@ -945,7 +953,7 @@
<if test="requiredToDT != null">
AND L.REQUIRED_DATE_TIME &lt;= #{requiredToDT}
</if>
GROUP BY L.SITE, CF.VALUE, CP.HANDLE, CP.ITEM, CT.DESCRIPTION, W.BLANKING_SIZE
GROUP BY L.SITE, CF.VALUE, L.CALL_TYPE, IG.ITEM_GROUP, CP.HANDLE, CP.ITEM, CT.DESCRIPTION, W.BLANKING_SIZE
) VIP
LEFT JOIN (
SELECT L.SITE, L.ITEM_BO, ZD.RESRCE SOURCE_RESOURCE
@ -959,5 +967,6 @@
WHERE W.QTY_ON_HAND > 0
) SIP
ON VIP.SITE = SIP.SITE AND VIP.ITEM_BO = SIP.ITEM_BO AND VIP.REQUIRED_QTY > 0
ORDER BY VIP.WORK_ORDER, VIP.ITEM
</select>
</mapper>

@ -51,7 +51,7 @@
<result column="OTHER_5" property="other5" />
</resultMap>
<resultMap id="FullResultMap" type="com.foreverwin.mesnac.dispatch.model.ShopOrderRelease">
<resultMap id="FullResultMap" type="com.foreverwin.mesnac.common.dto.SfcDispatchDto">
<result column="IS_COMPLETED" property="isCompleted" />
<result column="ITEM_BO" property="itemBo" />
<result column="ITEM" property="item" />
@ -63,7 +63,6 @@
<result column="ITEM_DESCRIPTION" property="itemDescription" />
<result column="COMPONENT" property="component" />
<result column="COMPLETED_QTY" property="completedQty" />
<result column="USER_NAME" property="userName" />
<result column="COMPONENT_DESCRIPTION" property="componentDescription" />
<result column="OPERATION_DESCRIPTION" property="operationDescription" />
<result column="RESOURCE_WORK_CENTER" property="resourceWorkCenter" />

@ -1,8 +1,10 @@
package com.foreverwin.mesnac.integration.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.constant.CustomFieldConstant;
import com.foreverwin.mesnac.common.dto.LabelPrintDto;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.model.PrintLog;
import com.foreverwin.mesnac.common.service.PrintLogService;
@ -431,6 +433,9 @@ public class InterfaceServiceImpl implements InterfaceService {
* 3.MES=MES
*/
String erpWorkCenter = componentDto.getOPERATION();
if (StringUtil.isBlank(erpWorkCenter)) {
throw BusinessException.build("BOM节点下字段【OPERATION】不能为空");
}
Operation operationModel = operationService.queryOperationByErpWorkCenter(site, erpWorkCenter);
if (operationModel == null) {
throw BusinessException.build("ERP工作中心【" +erpWorkCenter+"】对应的MES工序未维护");
@ -517,7 +522,7 @@ public class InterfaceServiceImpl implements InterfaceService {
String stepId = routerStepDto.getSTEP_ID();
String erpWorkCenter = routerStepDto.getOPERATION().trim();
if (StringUtil.isBlank(erpWorkCenter)) {
throw BusinessException.build("步骤标识【" +stepId+ "】下ERP工作中心不能为空");
continue;
}
if (StringUtil.isBlank(entryRouterStep)) {
@ -835,21 +840,25 @@ public class InterfaceServiceImpl implements InterfaceService {
}
//打印模板参数
JSONObject jsonObject = new JSONObject();
jsonObject.put("ITEM", item);
jsonObject.put("ITEM_DESC", itemModel.getDescription());
jsonObject.put("SUPPLIER", supplier);
jsonObject.put("INVENTORY", inventory);
List<LabelPrintDto> labelPrintDtoList = new ArrayList<>();
LabelPrintDto labelPrintDto = new LabelPrintDto();
labelPrintDto.setSite(site);
labelPrintDto.setPrintTemplate(Constants.PRINT_TYPE_INV);
labelPrintDto.setItem(item);
labelPrintDto.setItemDescription(itemModel.getDescription());
labelPrintDto.setSupplier(supplier);
labelPrintDto.setBatch(inventory);
labelPrintDtoList.add(labelPrintDto);
//记录打印数据
PrintLog printLog = new PrintLog();
printLog.setHandle(UUID.randomUUID().toString());
printLog.setSite(site);
printLog.setCategory("INV");
printLog.setCategory(Constants.PRINT_TYPE_INV);
printLog.setPrintName("");
printLog.setPrintTemplate("INV_LABEL");
printLog.setPrintParam(jsonObject.toJSONString());
printLog.setPrintTemplate(Constants.PRINT_TYPE_INV);
printLog.setPrintParam(JSON.toJSONString(labelPrintDtoList));
printLog.setInventory(inventory);
printLog.setItemBo(itemModel.getHandle());
printLog.setIsPrint("false");

@ -183,7 +183,7 @@ public class ResrceController {
List<Resrce> result;
try {
String site = CommonMethods.getSite();
String [] userArray = new String[]{};
String [] userArray = new String[1];
if (StringUtils.notBlank(user)) {
if (user.contains(",")) {
userArray = user.split(",");

@ -599,7 +599,7 @@
</select>
<select id="selectResourceListByUT" resultMap="BaseResultMap">
SELECT DISTINCT RS.HANDLE, RS.SITE, RS.RESRCE, RS.DESCRIPTION, RS.STATUS_BO, RS.PROCESS_RESOURCE, RS.OPERATION_BO, RS.VALID_FROM, RS.VALID_TO, RS.SETUP_STATE, RS.SETUP_DESCRIPTION, RS.CNC_MACHINE, RS.PENDING_STATUS_BO, RS.PENDING_REASON_CODE_BO, RS.PENDING_RESOURCE_RC_BO, RS.PENDING_COMMENTS, RS.CREATED_DATE_TIME, RS.MODIFIED_DATE_TIME, RS.ERP_PLANT_MAINT_ORDER, RS.ERP_EQUIPMENT_NUMBER, RS.ERP_INTERNAL_ID, RS.ERP_CAPACITY_CATEGORY
SELECT RS.HANDLE, RS.SITE, RS.RESRCE, RS.DESCRIPTION, RS.STATUS_BO, RS.PROCESS_RESOURCE, RS.OPERATION_BO, RS.VALID_FROM, RS.VALID_TO, RS.SETUP_STATE, RS.CREATED_DATE_TIME, RS.MODIFIED_DATE_TIME
FROM RESRCE RS
INNER JOIN RESOURCE_TYPE_RESOURCE RTR ON RTR.RESOURCE_BO = RS.HANDLE
INNER JOIN RESOURCE_TYPE RT ON RT.HANDLE = RTR.RESOURCE_TYPE_BO
@ -609,5 +609,6 @@
<foreach collection="userList" item="item" open="(" close=")" separator="," >
#{item}
</foreach>
GROUP BY RS.HANDLE, RS.SITE, RS.RESRCE, RS.DESCRIPTION, RS.STATUS_BO, RS.PROCESS_RESOURCE, RS.OPERATION_BO, RS.VALID_FROM, RS.VALID_TO, RS.SETUP_STATE, RS.CREATED_DATE_TIME, RS.MODIFIED_DATE_TIME
</select>
</mapper>

Loading…
Cancel
Save