Compare commits
5 Commits
374ec166a2
...
4a9aad9eb4
| Author | SHA1 | Date |
|---|---|---|
|
|
4a9aad9eb4 | |
|
|
e918caa8b8 | |
|
|
2e172a4451 | |
|
|
a8c911dcad | |
|
|
a975aa9cda |
|
|
@ -18,10 +18,7 @@ import com.nflg.wms.admin.util.ThymeleafUtil;
|
|||
import com.nflg.wms.common.constant.Constant;
|
||||
import com.nflg.wms.common.pojo.ApiResult;
|
||||
import com.nflg.wms.common.pojo.PageData;
|
||||
import com.nflg.wms.common.pojo.dto.DeliverNormalOrderItemDTO;
|
||||
import com.nflg.wms.common.pojo.dto.InventoryDTO;
|
||||
import com.nflg.wms.common.pojo.dto.MaterialQRCodeContentDTO;
|
||||
import com.nflg.wms.common.pojo.dto.ZWM00MB007DTO;
|
||||
import com.nflg.wms.common.pojo.dto.*;
|
||||
import com.nflg.wms.common.pojo.qo.*;
|
||||
import com.nflg.wms.common.pojo.vo.InProduceOrderMaterialVO;
|
||||
import com.nflg.wms.common.pojo.vo.WmsInProduceOrderItemVO;
|
||||
|
|
@ -399,13 +396,18 @@ public class InProduceOrderController extends BaseController {
|
|||
VUtil.trueThrowBusinessError(CollectionUtil.isNotEmpty(materialNos))
|
||||
.throwMessage("以下物料的扫码数量与收货数量不一致:"+StrUtil.join(",", materialNos));
|
||||
//同步入库信息到SAP
|
||||
sapService.zwm00_mb107(order.getOrderNo(), UserUtil.getUserName(),list.stream().map(it-> new Zwm00Mb107QO()
|
||||
Zwm00Mb107DTO dto = sapService.zwm00_mb107(order.getOrderNo(), UserUtil.getUserName(), list.stream().map(it -> new Zwm00Mb107QO()
|
||||
.setPWERK(it.getFactoryNo())
|
||||
.setPSMNG(it.getNum())
|
||||
.setAMEIN(it.getUnit())
|
||||
.setLGORT(it.getWarehouseNo())
|
||||
.setCHARG(it.getBatchNo())).toList(),null
|
||||
.setCHARG(it.getBatchNo())).toList(), null
|
||||
);
|
||||
produceOrderService.lambdaUpdate()
|
||||
.set(WmsInProduceOrder::getMjahr, dto.getE_MJAHR())
|
||||
.set(WmsInProduceOrder::getMblnr, dto.getE_MBLNR())
|
||||
.eq(WmsInProduceOrder::getId, order.getId())
|
||||
.update();
|
||||
|
||||
order.setState((short)1);
|
||||
order.setUpdateBy(UserUtil.getUserName());
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.nflg.wms.common.pojo.dto.MaterialQRCodeContentDTO;
|
|||
import com.nflg.wms.common.pojo.qo.*;
|
||||
import com.nflg.wms.common.pojo.vo.InventoryCheckTaskItemVO;
|
||||
import com.nflg.wms.common.pojo.vo.InventoryCheckTaskVO;
|
||||
import com.nflg.wms.common.pojo.vo.InventoryVO;
|
||||
import com.nflg.wms.common.pojo.vo.WmsInventoryCheckTaskItemMaterialVO;
|
||||
import com.nflg.wms.common.util.UserUtil;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
|
|
@ -21,6 +22,7 @@ import com.nflg.wms.repository.entity.WmsInventoryCheckTaskItemMaterial;
|
|||
import com.nflg.wms.repository.service.IWmsInventoryCheckTaskItemMaterialService;
|
||||
import com.nflg.wms.repository.service.IWmsInventoryCheckTaskItemService;
|
||||
import com.nflg.wms.repository.service.IWmsInventoryCheckTaskService;
|
||||
import com.nflg.wms.repository.service.IWmsInventoryService;
|
||||
import com.nflg.wms.starter.BaseController;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
|
|
@ -41,6 +43,9 @@ import java.util.Objects;
|
|||
@RequestMapping("/inventory")
|
||||
public class InventoryController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IWmsInventoryService inventoryService;
|
||||
|
||||
@Resource
|
||||
private IWmsInventoryCheckTaskService inventoryCheckTaskService;
|
||||
|
||||
|
|
@ -53,6 +58,15 @@ public class InventoryController extends BaseController {
|
|||
@Resource
|
||||
private IWmsInventoryCheckTaskItemMaterialService inventoryCheckTaskItemMaterialService;
|
||||
|
||||
/**
|
||||
* 库存查看
|
||||
* @param request 请求参数
|
||||
*/
|
||||
@PostMapping("search")
|
||||
public ApiResult<PageData<InventoryVO>> search(@Valid @RequestBody InventorySearchQO request) {
|
||||
return ApiResult.success(inventoryService.search(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存库存盘点任务
|
||||
* @param request 请求参数
|
||||
|
|
@ -67,8 +81,8 @@ public class InventoryController extends BaseController {
|
|||
* 查询库存盘点任务
|
||||
* @param request 请求参数
|
||||
*/
|
||||
@PostMapping("search")
|
||||
public ApiResult<PageData<InventoryCheckTaskVO>> search(@Valid @RequestBody InventoryCheckTaskSearchQO request) {
|
||||
@PostMapping("/check/search")
|
||||
public ApiResult<PageData<InventoryCheckTaskVO>> searchCheckTask(@Valid @RequestBody InventoryCheckTaskSearchQO request) {
|
||||
return ApiResult.success(inventoryCheckTaskService.search(request));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class OutPurchaseController extends BaseController {
|
|||
*/
|
||||
@GetMapping("getForOut")
|
||||
public ApiResult<Zim001QueryResultDTO> getForOut(String orderNo){
|
||||
Zim001QueryResultDTO result = sapService.zim001query(orderNo);
|
||||
Zim001QueryResultDTO result = sapService.zwm3A05(orderNo, null, null);
|
||||
result.getItem1().parallelStream().forEach(it->{
|
||||
it.setBinNos(binService.getBinNos(it.getMATNR(),it.getWERKS(),it.getLGORT()));
|
||||
});
|
||||
|
|
@ -119,7 +119,7 @@ public class OutPurchaseController extends BaseController {
|
|||
VUtil.trueThrowBusinessError(CollectionUtil.isNotEmpty(errors)).throwMessage("以下物料的批次号不符合要求:"+StrUtil.join(",",errors));
|
||||
//扣减库存
|
||||
inventoryService.out(inventories);
|
||||
sapService.zim001(request);
|
||||
sapService.zwm3A06(request);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -111,15 +111,19 @@ public class SapService {
|
|||
/**
|
||||
* 查询采购单退库信息
|
||||
* @param orderNo 采购单号
|
||||
* @param supplierNo 供应商编号
|
||||
* @param materialNo 物料编号
|
||||
*/
|
||||
public Zim001QueryResultDTO zim001query(String orderNo) {
|
||||
public Zim001QueryResultDTO zwm3A05(String orderNo, String supplierNo, String materialNo) {
|
||||
Map<String, Object> parameters = new HashMap<>();
|
||||
parameters.put("EBELN", orderNo);
|
||||
parameters.put("I_EBELN", orderNo);
|
||||
parameters.put("I_LIFNR", supplierNo);
|
||||
parameters.put("I_MATNR", materialNo);
|
||||
|
||||
Zim001QueryResultDTO result=new Zim001QueryResultDTO();
|
||||
JCoFunction function = exec("ZIM_001_QUERY", parameters, null);
|
||||
JCoFunction function = exec("ZWM3A05", parameters, null);
|
||||
|
||||
JCoStructure structure = function.getExportParameterList().getStructure("OUTPUT");
|
||||
JCoStructure structure = function.getExportParameterList().getStructure("E_RETURN");
|
||||
VUtil.trueThrowBusinessError(!StrUtil.equals(structure.getString("TYPE"), "S"))
|
||||
.throwMessage("SAP错误:" + structure.getString("MSG"));
|
||||
|
||||
|
|
@ -162,7 +166,10 @@ public class SapService {
|
|||
return result;
|
||||
}
|
||||
|
||||
public void zim001(Zim001QueryResultDTO dto){
|
||||
public void zwm3A06(Zim001QueryResultDTO dto) {
|
||||
Map<String, Object> parameters = new HashMap<>();
|
||||
parameters.put("I_EBELN", dto.getItem1().get(0).getEBELN());
|
||||
|
||||
Map<String, List<Map<String, Object>>> tables = new HashMap<>();
|
||||
List<Map<String, Object>> list1 = new ArrayList<>();
|
||||
dto.getItem1().forEach(item -> {
|
||||
|
|
@ -194,7 +201,7 @@ public class SapService {
|
|||
});
|
||||
tables.put("INPUT2", list2);
|
||||
|
||||
JCoParameterList jparameters = execReturnParameter("ZIM_001", null, tables);
|
||||
JCoParameterList jparameters = execReturnParameter("ZWM3A06", parameters, tables);
|
||||
JCoStructure structure=jparameters.getStructure("OUTPUT");
|
||||
VUtil.trueThrowBusinessError(!StrUtil.equals(structure.getString("TYPE"), "S"))
|
||||
.throwMessage("SAP错误:" + structure.getString("MSG"));
|
||||
|
|
|
|||
|
|
@ -27,6 +27,26 @@ public class SapMetaPrintTest {
|
|||
printMeta("ZWM00_MB107");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void ZIM_001_QUERY() throws JCoException {
|
||||
printMeta("ZIM_001_QUERY");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void ZWM3A05() throws JCoException {
|
||||
printMeta("ZWM3A05");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void ZIM_001() throws JCoException {
|
||||
printMeta("ZIM_001");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void ZWM3A06() throws JCoException {
|
||||
printMeta("ZWM3A06");
|
||||
}
|
||||
|
||||
public void printMeta(String functionName) throws JCoException {
|
||||
functionName = functionName.toUpperCase();
|
||||
JCoFunction function = repository.getFunction(functionName);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class InventorySearchQO extends PageQO {
|
||||
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNo;
|
||||
|
||||
/**
|
||||
* 工厂编号
|
||||
*/
|
||||
private String factoryNo;
|
||||
|
||||
/**
|
||||
* 仓库编号
|
||||
*/
|
||||
private String warehouseNo;
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class InventoryVO {
|
||||
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 工厂编号
|
||||
*/
|
||||
private String factoryNo;
|
||||
|
||||
/**
|
||||
* 仓库编号
|
||||
*/
|
||||
private String warehouseNo;
|
||||
|
||||
/**
|
||||
* 储位编号
|
||||
*/
|
||||
private String binNos;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal num;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNumber;
|
||||
}
|
||||
|
|
@ -1,6 +1,10 @@
|
|||
package com.nflg.wms.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.wms.common.pojo.qo.InventorySearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.InventoryVO;
|
||||
import com.nflg.wms.repository.entity.WmsInventory;
|
||||
|
||||
/**
|
||||
|
|
@ -13,4 +17,5 @@ import com.nflg.wms.repository.entity.WmsInventory;
|
|||
*/
|
||||
public interface WmsInventoryMapper extends BaseMapper<WmsInventory> {
|
||||
|
||||
IPage<InventoryVO> search(InventorySearchQO request, Page<Object> objectPage);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
package com.nflg.wms.repository.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nflg.wms.common.pojo.dto.InventoryDTO;
|
||||
import com.nflg.wms.common.pojo.qo.InventorySearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.InventoryVO;
|
||||
import com.nflg.wms.repository.entity.WmsInventory;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -19,4 +23,6 @@ public interface IWmsInventoryService extends IService<WmsInventory> {
|
|||
void out(List<InventoryDTO> inventories);
|
||||
|
||||
void in(List<InventoryDTO> inventories);
|
||||
|
||||
IPage<InventoryVO> search(@Valid InventorySearchQO request);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,9 +2,13 @@ package com.nflg.wms.repository.service.impl;
|
|||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nflg.wms.common.exception.NflgException;
|
||||
import com.nflg.wms.common.pojo.dto.InventoryDTO;
|
||||
import com.nflg.wms.common.pojo.qo.InventorySearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.InventoryVO;
|
||||
import com.nflg.wms.common.util.UserUtil;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
import com.nflg.wms.repository.entity.WmsInventory;
|
||||
|
|
@ -103,4 +107,9 @@ public class WmsInventoryServiceImpl extends ServiceImpl<WmsInventoryMapper, Wms
|
|||
updateBatchById(forUpdate);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<InventoryVO> search(InventorySearchQO request) {
|
||||
return baseMapper.search(request, new Page<>(request.getPage(), request.getPageSize()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,4 +2,25 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nflg.wms.repository.mapper.WmsInventoryMapper">
|
||||
|
||||
<select id="search" resultType="com.nflg.wms.common.pojo.vo.InventoryVO">
|
||||
SELECT i.*,get_binnos(s.id) AS "bin_nos"
|
||||
FROM wms_inventory i
|
||||
LEFT JOIN dictionary_item di ON di."value"=i.factory_no
|
||||
LEFT JOIN wms_warehouse wh ON wh.factory_id=di."id"
|
||||
LEFT JOIN wms_storage s ON i.material_no=s.material_no and wh."id"=s.warehouse_id
|
||||
<where>
|
||||
<if test="request.materialNo != null and request.materialNo!=''">
|
||||
AND i.material_no=#{request.materialNo}
|
||||
</if>
|
||||
<if test="request.factoryNo != null and request.factoryNo!=''">
|
||||
AND i.factory_no=#{request.factoryNo}
|
||||
</if>
|
||||
<if test="request.warehouseNo != null and request.warehouseNo!=''">
|
||||
AND i.warehouse_no=#{request.warehouseNo}
|
||||
</if>
|
||||
<if test="request.batchNo != null and request.batchNo!=''">
|
||||
AND i.batch_number= #{request.batchNo}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue