add:生产下料同步
This commit is contained in:
@@ -25,7 +25,7 @@ public class SecurityUtils {
|
||||
public static CurrentUser getCurrentUser() {
|
||||
Object loginInfo = StpUtil.getExtra("loginInfo");
|
||||
if (loginInfo==null){
|
||||
throw new BadRequestException("用户信息获取失败");
|
||||
return CurrentUser.getDefaultUser();
|
||||
}
|
||||
return JSONObject.parseObject(String.valueOf(loginInfo),CurrentUser.class);
|
||||
|
||||
@@ -46,13 +46,7 @@ public class SecurityUtils {
|
||||
* @return 系统用户名称
|
||||
*/
|
||||
public static String getCurrentNickName() {
|
||||
// CurrentUser user = getCurrentUser();
|
||||
// if (user!=null){
|
||||
// return user.getPresonName();
|
||||
// }
|
||||
// return null;
|
||||
//tofix postMan测试,完成后改回
|
||||
return "admin";
|
||||
return getCurrentUser().getPresonName();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,9 +55,7 @@ public class SecurityUtils {
|
||||
* @return 系统用户Id
|
||||
*/
|
||||
public static String getCurrentUserId() {
|
||||
//return getCurrentUser().getId();
|
||||
//tofix postMan测试,完成后改回
|
||||
return "1";
|
||||
return getCurrentUser().getId();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,7 +64,6 @@ public class SecurityUtils {
|
||||
*/
|
||||
@Deprecated
|
||||
public static Long getDeptId() {
|
||||
// return getCurrentUser().getUser().getDept().getId();
|
||||
return 1L;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class CurrentUser implements Serializable {
|
||||
CurrentUser def = new CurrentUser();
|
||||
def.setId("2");
|
||||
def.setUsername("default");
|
||||
def.setPresonName("外部系统用户");
|
||||
def.setPresonName("默认用户");
|
||||
return def;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.nl.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Data
|
||||
@Configuration
|
||||
@ConfigurationProperties("printer")
|
||||
public class PrinterProperties {
|
||||
|
||||
private String ip = "192.168.1.100";
|
||||
|
||||
private int port = 9100;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package org.nl.wms.ext_manage.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wms.ext_manage.service.dto.StructLineOfflineDTO;
|
||||
import org.nl.wms.sch_manage.service.core.tasks.StructOfflineTask;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* MES需求单同步接口
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("api/mes/structLine")
|
||||
@RequiredArgsConstructor
|
||||
public class MesStructLineController {
|
||||
|
||||
@Autowired
|
||||
private StructOfflineTask structOfflineTask;
|
||||
|
||||
/**
|
||||
* 结构车间生产下料同步接口
|
||||
* @param structLineOffline
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/offline")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> confirm(@RequestBody StructLineOfflineDTO structLineOffline) {
|
||||
structOfflineTask.offline(structLineOffline);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -64,16 +64,17 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
||||
|
||||
easMst.setBill_status(PurchaseBillStatus.CREATED.getCode());
|
||||
easMst.setModify_date(DateUtil.now());
|
||||
purchasemstMapper.insert(easMst);
|
||||
|
||||
for (Purchasedtl dtl : easDtlList) {
|
||||
purchasedtlMapper.insert(dtl);
|
||||
if (dtl.getHouse_code().contains("ZDLK")){
|
||||
//中鼎立库
|
||||
easMst.setForwardZD(1);
|
||||
//TODO 转发中鼎参数待确定
|
||||
wmsToZDWmdService.syncPurchaseReceiving(new JSONObject());
|
||||
}
|
||||
}
|
||||
purchasemstMapper.insert(easMst);
|
||||
|
||||
log.info("EAS采购入库单同步完成, billId: {}, 明细数: {}", billId, easDtlList.size());
|
||||
JSONObject result = new JSONObject();
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package org.nl.wms.ext_manage.service.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class StructLineOfflineDTO {
|
||||
/**
|
||||
* 产线编码
|
||||
*/
|
||||
@JsonProperty("LineCode")
|
||||
private String lineCode;
|
||||
|
||||
/**
|
||||
* 下料位置
|
||||
*/
|
||||
@JsonProperty("UnloadPort")
|
||||
private String unloadPort;
|
||||
|
||||
/**
|
||||
* 工单编码
|
||||
*/
|
||||
@JsonProperty("OrderCode")
|
||||
private String orderCode;
|
||||
|
||||
/**
|
||||
* 下料数量
|
||||
*/
|
||||
@JsonProperty("UnloadQty")
|
||||
private BigDecimal unloadQty;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@JsonProperty("MaterialCode")
|
||||
private String materialCode;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
@JsonProperty("MaterialName")
|
||||
private String materialName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonProperty("CreatedOn")
|
||||
private String createdOn;
|
||||
}
|
||||
@@ -63,4 +63,11 @@ public class PurchaseController {
|
||||
purchaseService.issueReturnBill(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/print")
|
||||
@Log("打印采购入库单")
|
||||
public ResponseEntity<Object> print(@RequestBody Set<String> ids) {
|
||||
purchaseService.print(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,5 +32,7 @@ public interface PurchaseService extends IService<Purchasemst> {
|
||||
|
||||
List<Purchasedtl> selectListByBillId(String billId);
|
||||
|
||||
void print(Set<String> ids);
|
||||
|
||||
List<PurchaseMatInfoVo> selectPdaInMat(HashMap of);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ public class Purchasemst implements Serializable {
|
||||
|
||||
private String order_type;
|
||||
|
||||
private Integer forwardZD;
|
||||
|
||||
private String supplier_code;
|
||||
|
||||
private String supplier_name;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
m.bill_id,
|
||||
m.order_no,
|
||||
m.order_type,
|
||||
m.forwardZD,
|
||||
m.supplier_code,
|
||||
m.supplier_name,
|
||||
m.creator,
|
||||
|
||||
@@ -28,10 +28,15 @@ import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.stockReturn.service.IPmStockReturnService;
|
||||
import org.nl.wms.warehouse_manage.stockReturn.service.dao.PmStockReturn;
|
||||
import org.nl.wms.warehouse_manage.stockReturn.service.enums.StockReturnStatusEnum;
|
||||
import org.nl.config.PrinterProperties;
|
||||
import org.nl.wms.pm_manage.purchase.util.ZplUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
|
||||
@Slf4j
|
||||
@@ -50,6 +55,9 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchasemstMapper, Purchase
|
||||
@Autowired
|
||||
private WmsToErpService wmsToErpService;
|
||||
|
||||
@Autowired
|
||||
private PrinterProperties printerProperties;
|
||||
|
||||
@Override
|
||||
public IPage<PurchasemstListVo> queryAll(Map whereJson, PageQuery page) {
|
||||
return purchasemstMapper.queryAllByPage(
|
||||
@@ -192,6 +200,38 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchasemstMapper, Purchase
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void print(Set<String> ids) {
|
||||
List<Purchasemst> mstList = purchasemstMapper.selectBatchIds(ids);
|
||||
if (ObjectUtil.isEmpty(mstList)) {
|
||||
throw new BadRequestException("未找到选中的单据");
|
||||
}
|
||||
StringBuilder allZpl = new StringBuilder();
|
||||
int labelCount = 0;
|
||||
for (Purchasemst mst : mstList) {
|
||||
List<Purchasedtl> dtlList = purchasedtlMapper.selectList(
|
||||
new LambdaQueryWrapper<Purchasedtl>()
|
||||
.eq(Purchasedtl::getBill_id, mst.getBill_id()));
|
||||
for (Purchasedtl dtl : dtlList) {
|
||||
String zpl = ZplUtil.generateLabel(
|
||||
dtl.getSku_name(), dtl.getSku_code(),
|
||||
dtl.getQty() != null ? dtl.getQty().stripTrailingZeros().toPlainString() : "0",
|
||||
dtl.getUnit(), mst.getBill_id(), dtl.getItem_no());
|
||||
allZpl.append(zpl);
|
||||
labelCount++;
|
||||
}
|
||||
}
|
||||
try (Socket socket = new Socket(printerProperties.getIp(), printerProperties.getPort());
|
||||
OutputStream out = socket.getOutputStream()) {
|
||||
out.write(allZpl.toString().getBytes(StandardCharsets.UTF_8));
|
||||
out.flush();
|
||||
} catch (Exception e) {
|
||||
log.error("打印失败, 打印机: {}:{}, 标签数: {}", printerProperties.getIp(), printerProperties.getPort(), labelCount, e);
|
||||
throw new BadRequestException("打印机连接失败: " + e.getMessage());
|
||||
}
|
||||
log.info("打印成功, 打印机: {}:{}, 标签数: {}", printerProperties.getIp(), printerProperties.getPort(), labelCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PurchaseMatInfoVo> pdaInboundSelectMatInfo(Map whereJson) {
|
||||
return purchasemstMapper.selectPdaInMat(whereJson);
|
||||
|
||||
@@ -13,6 +13,8 @@ public class PurchasemstListVo {
|
||||
|
||||
private String order_type;
|
||||
|
||||
private Integer forwardZD;
|
||||
|
||||
private String supplier_code;
|
||||
|
||||
private String supplier_name;
|
||||
|
||||
@@ -83,6 +83,7 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
|
||||
* @return SchBasePoint
|
||||
*/
|
||||
SchBasePoint selectByIdLock(String id);
|
||||
SchBasePoint selectByCode(String code);
|
||||
|
||||
/**
|
||||
* 释放点位
|
||||
|
||||
@@ -171,11 +171,5 @@ public abstract class AbstractTask {
|
||||
*/
|
||||
public abstract void cancel(String task_code);
|
||||
|
||||
/**
|
||||
* 回传mes
|
||||
* @param task_code 任务号
|
||||
*/
|
||||
public abstract void backMes(String task_code);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -130,9 +130,7 @@ public class BackInTask extends AbstractTask {
|
||||
this.cancelTask(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backMes(String task_code) {
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
public void finishTask(SchBaseTask taskObj) {
|
||||
|
||||
@@ -129,9 +129,7 @@ public class MoveTask extends AbstractTask {
|
||||
this.cancelTask(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backMes(String task_code) {
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
public void finishTask(SchBaseTask taskObj) {
|
||||
|
||||
@@ -130,9 +130,7 @@ public class PdaPointTask extends AbstractTask {
|
||||
this.cancelTask(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backMes(String task_code) {
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
public void finishTask(SchBaseTask taskObj) {
|
||||
|
||||
@@ -130,9 +130,6 @@ public class StInTask extends AbstractTask {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backMes(String task_code) {
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void finishTask(SchBaseTask taskObj) {
|
||||
|
||||
@@ -125,9 +125,7 @@ public class StOutTask extends AbstractTask {
|
||||
this.cancelTask(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backMes(String task_code) {
|
||||
}
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void finishTask(SchBaseTask taskObj) {
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
package org.nl.wms.sch_manage.service.core.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.BsrealStorattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.Sectattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
|
||||
import org.nl.wms.ext_manage.service.dto.StructLineOfflineDTO;
|
||||
import org.nl.wms.pm_manage.purchase.ListenerHandler.PurchaseListenerParams;
|
||||
import org.nl.wms.sch_manage.enums.StatusEnum;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.core.AbstractTask;
|
||||
import org.nl.wms.sch_manage.service.core.AcsTaskDto;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.IInBillService;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDtl;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dto.IOStorInvDisDto;
|
||||
import org.nl.wms.warehouse_manage.inventory.IStInventoryService;
|
||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static org.nl.wms.warehouse_manage.enums.IOSEnum.GROUP_PLATE_STATUS;
|
||||
|
||||
/**
|
||||
* 焊接区域半成品入库
|
||||
*/
|
||||
@Service
|
||||
public class StructOfflineTask extends AbstractTask {
|
||||
|
||||
@Autowired
|
||||
private IInBillService iInBillService;
|
||||
@Autowired
|
||||
private IMdPbGroupplateService iMdPbGroupplateService;
|
||||
|
||||
@Autowired
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
||||
@Autowired
|
||||
private IStructattrService iStructattrService;
|
||||
/**
|
||||
* 生成生产入库任务,任务完成
|
||||
*/
|
||||
public void offline(StructLineOfflineDTO offlineDTO){
|
||||
SchBasePoint schBasePoint = iSchBasePointService.selectByCode(offlineDTO.getUnloadPort());
|
||||
String storagevehicleCode = schBasePoint.getStoragevehicle_code();
|
||||
if (StringUtils.isEmpty(storagevehicleCode)){
|
||||
throw new BadRequestException("下线失败,下料点没有绑定托盘号");
|
||||
}
|
||||
final MdMeMaterialbase materialbase = iMdMeMaterialbaseService.getByCode(offlineDTO.getMaterialCode());
|
||||
if (materialbase == null){
|
||||
throw new BadRequestException("下线失败,物料编码未同步");
|
||||
}
|
||||
final GroupPlate plate = new GroupPlate();
|
||||
plate.setStoragevehicle_code(storagevehicleCode);
|
||||
plate.setGroup_id(IdUtil.getStringId());
|
||||
plate.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
plate.setCreate_name("MES");
|
||||
plate.setCreate_time(DateUtil.now());
|
||||
plate.setMaterial_code(materialbase.getMaterial_code());
|
||||
plate.setQty(offlineDTO.getUnloadQty());
|
||||
plate.setQty_unit_id(materialbase.getQty_unit_id());
|
||||
plate.setQty_unit_name(materialbase.getQty_unit_id());
|
||||
plate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘"));
|
||||
iMdPbGroupplateService.save(plate);
|
||||
//强制:下线点对应的区域就是半成品库区编码
|
||||
final String regionCode = schBasePoint.getRegion_code();
|
||||
List<Structattr> structattrs = iStructattrService.inBoundSectDiv(StrategyStructParam.builder()
|
||||
.ioType(StatusEnum.STRATEGY_TYPE.code("入库"))
|
||||
.sect_code(regionCode)
|
||||
.storagevehicle_code(plate.getStoragevehicle_code())
|
||||
.strategyMaters(new ArrayList<>())
|
||||
.build());
|
||||
final Structattr structattr = structattrs.get(0);
|
||||
// 组织主表数据
|
||||
Map<String, Object> jsonMst = new HashMap<>();
|
||||
jsonMst.put("stor_id", structattr.getStor_id());
|
||||
jsonMst.put("bill_status", IOSEnum.BILL_STATUS.code("分配完"));
|
||||
jsonMst.put("total_qty", plate.getQty());
|
||||
jsonMst.put("detail_count", 1);
|
||||
jsonMst.put("bill_type", IOSEnum.BILL_TYPE.code("生产入库"));
|
||||
jsonMst.put("biz_date", DateUtil.now());
|
||||
// 组织明细数据
|
||||
ArrayList<HashMap> tableData = new ArrayList<>();
|
||||
HashMap<String, Object> dtl = new HashMap<>();
|
||||
dtl.put("storagevehicle_code", plate.getStoragevehicle_code());
|
||||
dtl.put("material_id", materialbase.getMaterial_id());
|
||||
dtl.put("material_code", materialbase.getMaterial_code());
|
||||
dtl.put("material_name", materialbase.getMaterial_name());
|
||||
dtl.put("pcsn", plate.getPcsn());
|
||||
dtl.put("qty_unit_id", materialbase.getQty_unit_id());
|
||||
dtl.put("qty_unit_name", materialbase.getQty_unit_name());
|
||||
dtl.put("qty", plate.getQty());
|
||||
dtl.put("plan_qty", plate.getQty());
|
||||
// 调用新增
|
||||
tableData.add(dtl);
|
||||
jsonMst.put("tableData",tableData);
|
||||
String iostorinv_id = iInBillService.insertDtl(jsonMst);
|
||||
// 组织主数据
|
||||
JSONObject divStructParam= new JSONObject();
|
||||
divStructParam.put("checked", false);
|
||||
divStructParam.put("stor_code", structattr.getStor_code());
|
||||
divStructParam.put("sect_code", structattr.getSect_code());
|
||||
final JSONObject disRow = new JSONObject();
|
||||
divStructParam.put("dis_row", disRow);
|
||||
disRow.put("struct_code",structattr.getStruct_code());
|
||||
disRow.put("storagevehicle_code", plate.getStoragevehicle_code());
|
||||
disRow.put("iostorinv_id", iostorinv_id);
|
||||
// 调用分配,默认自动分配库位
|
||||
iInBillService.divStruct(divStructParam);
|
||||
// 下发任务
|
||||
// 组织 divPoint 参数
|
||||
Map<String, Object> divPointParam = new HashMap<>();
|
||||
divPointParam.put("point_code", offlineDTO.getUnloadPort());
|
||||
ArrayList<HashMap<String, String>> tableMater = new ArrayList<>();
|
||||
HashMap<String, String> materRow = new HashMap<>();
|
||||
materRow.put("iostorinv_id", iostorinv_id); // 入库单明细ID
|
||||
materRow.put("iostorinvdis_id", iostorinvdis_id); // 分配明细ID(如果有)
|
||||
materRow.put("storagevehicle_code", storagevehicleCode); // 载具编码
|
||||
tableMater.add(materRow);
|
||||
divPointParam.put("tableMater", tableMater);
|
||||
iInBillService.divPoint(divPointParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String create(JSONObject json) {
|
||||
|
||||
|
||||
String task_id = stInTask.create(task_form);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AcsTaskDto sendAcsParam(String taskId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateStatus(String task_code, TaskStatus status) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceFinish(String task_code) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(String task_code) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -130,9 +130,7 @@ public class VehicleInTask extends AbstractTask {
|
||||
this.cancelTask(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backMes(String task_code) {
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
public void finishTask(SchBaseTask taskObj) {
|
||||
|
||||
@@ -125,9 +125,7 @@ public class VehicleOutTask extends AbstractTask {
|
||||
this.cancelTask(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backMes(String task_code) {
|
||||
}
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void finishTask(SchBaseTask taskObj) {
|
||||
|
||||
@@ -195,6 +195,14 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
return pointMapper.selectByIdLock(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SchBasePoint selectByCode(String code) {
|
||||
if (StringUtils.isEmpty(code)){
|
||||
throw new BadRequestException("查询点位失败,编码为空");
|
||||
}
|
||||
return this.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code,code));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unLockPoint(String point_code) {
|
||||
this.update(
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
@@ -28,6 +29,7 @@ import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleinfoMappe
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyMater;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
|
||||
import org.nl.wms.basedata_manage.service.dto.StructattrChangeDto;
|
||||
import org.nl.wms.sch_manage.enums.StatusEnum;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.core.tasks.StInTask;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSConstant;
|
||||
@@ -369,6 +371,7 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
||||
String struct_name = "";
|
||||
//是否自动分配仓位
|
||||
Boolean checked = mst.getBoolean("checked");
|
||||
Structattr struct;
|
||||
if (ObjectUtil.isNotEmpty(checked) && checked) {
|
||||
//根据载具进行分配货位
|
||||
List<StrategyMater> maters = new ArrayList<>();
|
||||
@@ -382,31 +385,25 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
||||
}
|
||||
List<Structattr> structattrs = iStructattrService.inBoundSectDiv(
|
||||
StrategyStructParam.builder()
|
||||
.ioType(param.getString("ioType"))
|
||||
.ioType(StatusEnum.STRATEGY_TYPE.code("入库"))
|
||||
.sect_code(param.getString("sect_code"))
|
||||
.stor_code(param.getString("stor_code"))
|
||||
.storagevehicle_code(param.getString("storagevehicle_code"))
|
||||
.strategyMaters(maters)
|
||||
.build());
|
||||
Structattr struct = structattrs.get(0);
|
||||
struct = structattrs.get(0);
|
||||
} else {
|
||||
if (StringUtils.isEmpty(map.getString("struct_code"))){
|
||||
throw new BadRequestException("分配失败,手动分配struct_code为空");
|
||||
}
|
||||
struct = iStructattrService.findByCode(map.getString("struct_code"));
|
||||
}
|
||||
sect_id = struct.getSect_id();
|
||||
sect_code = struct.getSect_code();
|
||||
sect_name = struct.getSect_name();
|
||||
struct_id = struct.getStruct_id();
|
||||
struct_code = struct.getStruct_code();
|
||||
struct_name = struct.getStruct_name();
|
||||
} else {
|
||||
Structattr structattr = iStructattrService.findById(map.getString("struct_id"));
|
||||
MdPbStoragevehicleinfo mdPbStoragevehicleinfo = mdPbStoragevehicleinfoMapper.selectOne(new LambdaQueryWrapper<>(MdPbStoragevehicleinfo.class)
|
||||
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, map.get("storagevehicle_code"))
|
||||
);
|
||||
sect_id = map.getString("sect_id");
|
||||
sect_code = map.getString("sect_code");
|
||||
sect_name = map.getString("sect_name");
|
||||
struct_id = map.getString("struct_id");
|
||||
struct_code = map.getString("struct_code");
|
||||
struct_name = map.getString("struct_name");
|
||||
}
|
||||
JSONObject dis_map = new JSONObject();
|
||||
dis_map.put("sect_id", sect_id);
|
||||
dis_map.put("sect_code", sect_code);
|
||||
|
||||
@@ -96,13 +96,14 @@
|
||||
|
||||
<insert id="insertAllData">
|
||||
INSERT INTO md_pb_groupplate(
|
||||
group_id,storagevehicle_code,material_id,pcsn,qty,qty_unit_id,qty_unit_name,ext_code,load_port,create_id,create_name,create_time
|
||||
group_id,storagevehicle_code,material_id,material_code,pcsn,qty,qty_unit_id,qty_unit_name,ext_code,load_port,create_id,create_name,create_time
|
||||
) values
|
||||
<foreach collection="data" item="item" separator=",">
|
||||
(
|
||||
#{item.group_id},
|
||||
#{item.storagevehicle_code},
|
||||
#{item.material_id},
|
||||
#{item.material_code},
|
||||
#{item.pcsn},
|
||||
#{item.qty},
|
||||
#{item.qty_unit_id},
|
||||
|
||||
@@ -24,7 +24,7 @@ public class InteractionController {
|
||||
}
|
||||
|
||||
@PostMapping("/blank")
|
||||
@Log("产线下料半成品入库请求")
|
||||
@Log("产线下线半成品入库请求")
|
||||
public ResponseEntity<Object> blank()
|
||||
{
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ public class ProductGroupServiceImpl implements IProductGroupService {
|
||||
json.put("load_port", dto.getLoadPort());
|
||||
json.put("storagevehicle_code", dto.getPalletCode());
|
||||
json.put("material_id", bomData.getMaterialCode());
|
||||
json.put("material_code", bomData.getMaterialCode());
|
||||
json.put("pcsn", "");
|
||||
json.put("qty_unit_id", bomData.getUnit());
|
||||
json.put("qty_unit_name", bomData.getUnit());
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button slot="right" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">强制回传</el-button>
|
||||
<el-button slot="right" class="filter-item" type="success" size="mini" @click="issueReturnBill">条码打印</el-button>
|
||||
<el-button slot="right" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">下发回传单</el-button>
|
||||
<el-button slot="right" class="filter-item" type="primary" icon="el-icon-printer" size="mini" :disabled="audit_flag" @click="printBill">打印</el-button>
|
||||
</crudOperation>
|
||||
<el-table ref="table" v-loading="crud.loading" size="mini" :data="crud.data" highlight-current-row style="width: 100%;" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange" @select="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
@@ -48,6 +48,35 @@
|
||||
<el-table-column label="明细数" align="center" prop="dtl_count" width="80" />
|
||||
<el-table-column label="单据总数" align="center" prop="total_qty" width="80" />
|
||||
<el-table-column label="入库数量" align="center" prop="instock_qty" width="80" />
|
||||
<el-table-column label="转发中鼎" align="center" prop="forwardZD" width="80">
|
||||
<template slot-scope="scope">
|
||||
<p v-if="scope.row.forwardZD == '0'">-</p>
|
||||
<template v-else-if="scope.row.forwardZD == '1'">
|
||||
<el-popconfirm
|
||||
confirm-button-text="是"
|
||||
cancel-button-text="否"
|
||||
icon="el-icon-info"
|
||||
icon-color="red"
|
||||
title="是否重新转发中鼎?"
|
||||
@confirm="toForwardZD"
|
||||
>
|
||||
<a slot="reference" style="color: red;text-decoration: underline">失败</a>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
<!-- <a style="color: red;text-decoration: underline" v-else-if="scope.row.forwardZD == '1'">-->
|
||||
<!-- <el-popconfirm-->
|
||||
<!-- class="box-item"-->
|
||||
<!-- title="是否重新转发?"-->
|
||||
<!-- placement="top-start"-->
|
||||
<!-- >-->
|
||||
<!-- <template #reference>-->
|
||||
<!-- 失败-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-popconfirm>-->
|
||||
<!-- </a>-->
|
||||
<p v-else>成功</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="supplier_code" width="120" label="供应商编码" />
|
||||
<el-table-column show-overflow-tooltip prop="supplier_name" width="150" label="供应商名称" />
|
||||
<el-table-column show-overflow-tooltip prop="creator" width="100" label="创建人" />
|
||||
@@ -137,6 +166,9 @@ export default {
|
||||
const s = String(d.getSeconds()).padStart(2, '0')
|
||||
return y + '-' + m + '-' + day + ' ' + h + ':' + min + ':' + s
|
||||
},
|
||||
toForwardZD() {
|
||||
console.log(123)
|
||||
},
|
||||
toView(index, row) {
|
||||
this.mstrow = row
|
||||
this.viewShow = true
|
||||
@@ -183,6 +215,26 @@ export default {
|
||||
this.crud.notify('下发失败', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
printBill() {
|
||||
const selections = this.crud.selections
|
||||
if (!selections || selections.length === 0) {
|
||||
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const ids = selections.map(s => s.id)
|
||||
const billIds = selections.map(s => s.bill_id).join('、')
|
||||
this.$confirm('确认打印以下单据的物料标签?\n' + billIds, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudPurchase.print(ids).then(() => {
|
||||
this.crud.notify('打印指令已发送', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
this.crud.notify('打印失败', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
})
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,4 +39,12 @@ export function issueReturnBill(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, get, issueReturnBill }
|
||||
export function print(ids) {
|
||||
return request({
|
||||
url: '/api/purchasemst/print',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, get, issueReturnBill, print }
|
||||
|
||||
@@ -27,6 +27,7 @@ const zh = {
|
||||
'库位绑定/解绑',
|
||||
'平库调拨出库',
|
||||
'线边领料出库',
|
||||
'配盘出库',
|
||||
'配盘入库'
|
||||
// '空托上架/下架/注册/呼叫',
|
||||
// 'AGV配送',
|
||||
@@ -149,6 +150,35 @@ const zh = {
|
||||
complete: '完成',
|
||||
completeSuccess: '操作成功',
|
||||
},
|
||||
productGroup: {
|
||||
title: '配盘出库',
|
||||
workSect: '工作区',
|
||||
workSectPlaceholder: '请选择工作区',
|
||||
workSectRequired: '请选择工作区',
|
||||
palletCode: '托盘码',
|
||||
palletCodePlaceholder: '请扫描或输入托盘码',
|
||||
palletCodeRequired: '请输入托盘码',
|
||||
workOrder: '工单',
|
||||
workOrderPlaceholder: '请选择工单',
|
||||
workOrderRequired: '请选择工单',
|
||||
loadPort: '上料口',
|
||||
loadPortPlaceholder: '请选择上料口',
|
||||
loadPortRequired: '请选择上料口',
|
||||
total: '共{0}条',
|
||||
noData: '暂无物料',
|
||||
noOrder: '暂无工单',
|
||||
noPort: '请先选择工单',
|
||||
materialCode: '物料编码',
|
||||
materialName: '物料名称',
|
||||
bomQty: '需求数量',
|
||||
useBomQty: '已用数量',
|
||||
planQty: '待配数量',
|
||||
inputQty: '配盘数量',
|
||||
inputQtyPlaceholder: '请输入数量',
|
||||
unit: '单位',
|
||||
confirm: '确定',
|
||||
submitSuccess: '提交成功',
|
||||
},
|
||||
}
|
||||
|
||||
const en = {
|
||||
@@ -176,8 +206,9 @@ const en = {
|
||||
'Putaway',
|
||||
'Inventory Query',
|
||||
'Bind/Unbind',
|
||||
'Picking Hall',
|
||||
'Containerless Receive',
|
||||
'Flat Outbound',
|
||||
'Line Picking',
|
||||
'Product Group',
|
||||
'Empty Pallet Ops',
|
||||
'AGV Delivery',
|
||||
'Manual Inventory',
|
||||
@@ -300,6 +331,35 @@ const en = {
|
||||
complete: 'Complete',
|
||||
completeSuccess: 'Success',
|
||||
},
|
||||
productGroup: {
|
||||
title: 'Product Group',
|
||||
workSect: 'Work Area',
|
||||
workSectPlaceholder: 'Select work area',
|
||||
workSectRequired: 'Work area is required',
|
||||
palletCode: 'Pallet Code',
|
||||
palletCodePlaceholder: 'Scan or enter pallet code',
|
||||
palletCodeRequired: 'Pallet code is required',
|
||||
workOrder: 'Work Order',
|
||||
workOrderPlaceholder: 'Select work order',
|
||||
workOrderRequired: 'Work order is required',
|
||||
loadPort: 'Load Port',
|
||||
loadPortPlaceholder: 'Select load port',
|
||||
loadPortRequired: 'Load port is required',
|
||||
total: 'Total {0} items',
|
||||
noData: 'No materials',
|
||||
noOrder: 'No work orders',
|
||||
noPort: 'Please select work order first',
|
||||
materialCode: 'Material Code',
|
||||
materialName: 'Material Name',
|
||||
bomQty: 'BOM Qty',
|
||||
useBomQty: 'Used Qty',
|
||||
planQty: 'Pending Qty',
|
||||
inputQty: 'Group Qty',
|
||||
inputQtyPlaceholder: 'Enter qty',
|
||||
unit: 'Unit',
|
||||
confirm: 'Confirm',
|
||||
submitSuccess: 'Submitted successfully',
|
||||
},
|
||||
}
|
||||
|
||||
const messages = {zh, en}
|
||||
|
||||
@@ -55,6 +55,12 @@ const routes = [
|
||||
component: () => import('@/views/FlatOutBound.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: '/product-group',
|
||||
name: 'ProductGroup',
|
||||
component: () => import('@/views/ProductGroup.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: '/developing',
|
||||
name: 'Developing',
|
||||
|
||||
@@ -41,9 +41,6 @@ const menuIcons = [
|
||||
'gift-o',
|
||||
'bag-o',
|
||||
'apps-o',
|
||||
'records',
|
||||
'todo-list-o',
|
||||
'records',
|
||||
]
|
||||
|
||||
const menuRoutes = {
|
||||
@@ -54,7 +51,8 @@ const menuRoutes = {
|
||||
4: '/inventory',
|
||||
5: '/bind-unbind',
|
||||
6: '/flat-outbound',
|
||||
7: '/flat-outbound',
|
||||
7: '/developing',
|
||||
8: '/product-group',
|
||||
}
|
||||
|
||||
function onMenuClick(index) {
|
||||
|
||||
Reference in New Issue
Block a user