|
|
@ -9,25 +9,34 @@ import com.gaotao.modules.boxManage.data.SoReceivePalletsData; |
|
|
import com.gaotao.modules.boxManage.service.BoxForNotificationService; |
|
|
import com.gaotao.modules.boxManage.service.BoxForNotificationService; |
|
|
import com.gaotao.modules.outboundNotification.entity.OutboundNotificationDetailEntity; |
|
|
import com.gaotao.modules.outboundNotification.entity.OutboundNotificationDetailEntity; |
|
|
import com.gaotao.modules.outboundNotification.entity.vo.OutboundNotificationHeadVo; |
|
|
import com.gaotao.modules.outboundNotification.entity.vo.OutboundNotificationHeadVo; |
|
|
|
|
|
import com.gaotao.modules.schedule.mapper.ProcedureMapper; |
|
|
import com.gaotao.modules.sys.entity.SysUserEntity; |
|
|
import com.gaotao.modules.sys.entity.SysUserEntity; |
|
|
import com.gaotao.modules.trans.entity.TransNoControl; |
|
|
import com.gaotao.modules.trans.entity.TransNoControl; |
|
|
import com.gaotao.modules.trans.service.TransNoControlService; |
|
|
import com.gaotao.modules.trans.service.TransNoControlService; |
|
|
import com.gaotao.modules.inventoryStock.entity.InventoryStock; |
|
|
import com.gaotao.modules.inventoryStock.entity.InventoryStock; |
|
|
import org.apache.shiro.SecurityUtils; |
|
|
import org.apache.shiro.SecurityUtils; |
|
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
import static com.gaotao.modules.outboundNotification.service.impl.OutboundNotificationServiceImpl.convertToSQLString; |
|
|
import static com.gaotao.modules.outboundNotification.service.impl.OutboundNotificationServiceImpl.convertToSQLString; |
|
|
|
|
|
|
|
|
@Service |
|
|
@Service |
|
|
public class BoxForNotificationServiceImpl implements BoxForNotificationService { |
|
|
public class BoxForNotificationServiceImpl implements BoxForNotificationService { |
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(BoxForNotificationServiceImpl.class); |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private TransNoControlService transNoService; |
|
|
private TransNoControlService transNoService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private BoxForNotificationMapper boxForNotificationMapper; |
|
|
private BoxForNotificationMapper boxForNotificationMapper; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ProcedureMapper procedureMapper; |
|
|
@Override |
|
|
@Override |
|
|
public List<SoReceiveBoxesData> searchSoReceiveBoxesData(SoReceiveBoxesData data) { |
|
|
public List<SoReceiveBoxesData> searchSoReceiveBoxesData(SoReceiveBoxesData data) { |
|
|
return boxForNotificationMapper.searchSoReceiveBoxesData(data); |
|
|
return boxForNotificationMapper.searchSoReceiveBoxesData(data); |
|
|
@ -477,4 +486,47 @@ public class BoxForNotificationServiceImpl implements BoxForNotificationService |
|
|
palletData.setPalletNo(inData.getPalletNo()); |
|
|
palletData.setPalletNo(inData.getPalletNo()); |
|
|
boxForNotificationMapper.updatePalletBoxesQty(palletData); |
|
|
boxForNotificationMapper.updatePalletBoxesQty(palletData); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
@Transactional |
|
|
|
|
|
public void completePacking(OutboundNotificationHeadVo data) { |
|
|
|
|
|
logger.info("开始完成包装,出库单号: {}", data.getOrderNo()); |
|
|
|
|
|
SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
// 调用存储过程创建检验任务 |
|
|
|
|
|
List<Object> params = new ArrayList<>(); |
|
|
|
|
|
params.add(data.getSite()); // @site |
|
|
|
|
|
params.add(data.getBuNo()); // @bu_no |
|
|
|
|
|
params.add(data.getRelatedOrderNo()); // @order_no 销售订单号 |
|
|
|
|
|
params.add(data.getRelatedOrderLineNo()); // @seq_no 销售订单行号 |
|
|
|
|
|
params.add(""); // @roll_no 空字符串 |
|
|
|
|
|
params.add(data.getRequiredQty()); // @roll_qty 要求发货数量 |
|
|
|
|
|
params.add(data.getOrderQty()); // @order_qty 销售订单数量 |
|
|
|
|
|
params.add(sysUserEntity.getUsername()); // @username 当前登录人 |
|
|
|
|
|
params.add(data.getCustomerId()); // @Supplier_id 客户编码 |
|
|
|
|
|
params.add("OQC"); // @type 'OQC' |
|
|
|
|
|
params.add("销售订单"); // @document_type '销售订单' |
|
|
|
|
|
params.add(data.getOrderNo()); // @document_no 销售出库单号 |
|
|
|
|
|
|
|
|
|
|
|
logger.info("调用存储过程创建检验任务,出库单号: {}, 销售订单号: {}", data.getOrderNo(), data.getRelatedOrderNo()); |
|
|
|
|
|
|
|
|
|
|
|
// 调用存储过程 |
|
|
|
|
|
List<Map<String, Object>> resultList = procedureMapper.getProcedureData("getInspectionTaskAutomatically", params); |
|
|
|
|
|
|
|
|
|
|
|
// 判断是否成功 |
|
|
|
|
|
if (resultList != null && !resultList.isEmpty()) { |
|
|
|
|
|
String code = String.valueOf(resultList.get(0).get("code")); |
|
|
|
|
|
if ("400".equalsIgnoreCase(code)) { |
|
|
|
|
|
String msg = String.valueOf(resultList.get(0).get("message")); |
|
|
|
|
|
throw new RuntimeException("创建检验任务失败: " + msg); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
logger.info("包装完成,检验任务已创建,出库单号: {}", data.getOrderNo()); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
logger.error("完成包装失败,出库单号: {}, 错误信息: {}", data.getOrderNo(), e.getMessage(), e); |
|
|
|
|
|
throw new RuntimeException("完成包装失败: " + e.getMessage(), e); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |