Merge branch 'develop' into dev_zhangke
This commit is contained in:
commit
7b0734bb32
|
|
@ -93,7 +93,7 @@ public class InventoryController extends BaseController {
|
|||
@GetMapping("check/getTaskItems")
|
||||
public ApiResult<List<InventoryCheckTaskItemVO>> getTaskItems(@Valid @RequestParam(required = false) Long id) {
|
||||
List<WmsInventoryCheckTaskItem> taskItems = Objects.isNull(id) ? Collections.emptyList() : inventoryCheckTaskItemService.lambdaQuery().eq(WmsInventoryCheckTaskItem::getTaskId, id).list();
|
||||
List<WarehouseVO> warehouseVOS = warehouseService.getEnableList(null);
|
||||
List<WarehouseSimpleVO> warehouseVOS = warehouseService.getEnableList(null);
|
||||
List<InventoryCheckTaskItemVO> vos = new ArrayList<>();
|
||||
warehouseVOS.forEach(warehouseVO -> {
|
||||
WmsInventoryCheckTaskItem item = taskItems.stream().filter(taskItem -> Objects.equals(taskItem.getWarehouseId(), warehouseVO.getId())).findFirst().orElse(null);
|
||||
|
|
@ -107,8 +107,8 @@ public class InventoryController extends BaseController {
|
|||
.setChargeUserId(Objects.isNull(item) ? null : item.getChargeUserId())
|
||||
.setChargeUserName(Objects.isNull(item) ? "" : item.getChargeUserName())
|
||||
.setAddress(warehouseVO.getAddress())
|
||||
.setUserName(warehouseVO.getUserName())
|
||||
.setPhone(warehouseVO.getPhone())
|
||||
// .setUserName(warehouseVO.getUserName())
|
||||
// .setPhone(warehouseVO.getPhone())
|
||||
);
|
||||
});
|
||||
return ApiResult.success(vos);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public class OutPurchaseController extends BaseController {
|
|||
public ApiResult<ZWM3A05VO> searchSAP(@Valid @RequestBody @NotNull zwm3A05QO request) {
|
||||
ZWM3A05VO result = sapService.zwm3A05(request);
|
||||
result.getItems().parallelStream().forEach(it -> {
|
||||
it.setBinNos(binService.getBinNos(it.getMatnr(), it.getWerks(), it.getLgort()));
|
||||
it.setBinNos(binService.getBinNos(it.getMatnr(), result.getWerks(), it.getLgort()));
|
||||
});
|
||||
return ApiResult.success(result);
|
||||
}
|
||||
|
|
@ -107,14 +107,15 @@ public class OutPurchaseController extends BaseController {
|
|||
item.setId(IdUtil.getSnowflakeNextId());
|
||||
item.setOrderId(order.getId());
|
||||
item.setNum(BigDecimal.ZERO);
|
||||
item.setWerks(request.getWerks());
|
||||
if (CollectionUtil.isNotEmpty(it.getQrCodes())) {
|
||||
it.getQrCodes().forEach(qrCode -> {
|
||||
MaterialQRCodeContentDTO dto = NoUtil.getMaterialQRCodeContent(qrCode);
|
||||
MaterialQRCodeContentDTO dto = NoUtil.getMaterialQRCodeContent(qrCode.getContent());
|
||||
VUtil.trueThrowBusinessError(!StrUtil.equals(dto.getMaterialNo(), it.getMatnr()))
|
||||
.throwMessage("物料" + it.getMatnr() + "与二维码不匹配");
|
||||
VUtil.trueThrowBusinessError(!check(dto, it.getCharg(), it.getSernrs()))
|
||||
.throwMessage("物料" + it.getMatnr() + "包含不符合批次号和序列号的扫码记录");
|
||||
item.setNum(item.getNum().add(dto.getNum()));
|
||||
item.setNum(item.getNum().add(qrCode.getNum()));
|
||||
records.add(new OutMaterialScanRecord()
|
||||
.setSource(6)
|
||||
.setSourceId(order.getId())
|
||||
|
|
@ -122,7 +123,7 @@ public class OutPurchaseController extends BaseController {
|
|||
.setTicketId(order.getId())
|
||||
.setTicketItemId(item.getId())
|
||||
.setMaterialNo(dto.getMaterialNo())
|
||||
.setContent(qrCode)
|
||||
.setContent(qrCode.getContent())
|
||||
.setBatchNo(dto.getBatchNo())
|
||||
.setSerialNo(dto.getSerialNo())
|
||||
.setUniqNo(dto.getUniqNo())
|
||||
|
|
@ -137,10 +138,10 @@ public class OutPurchaseController extends BaseController {
|
|||
);
|
||||
});
|
||||
}
|
||||
VUtil.trueThrowBusinessError(it.getNum().compareTo(item.getTemng()) > 0)
|
||||
.throwMessage("物料" + it.getMatnr() + "的扫码数量大于退货数量");
|
||||
VUtil.trueThrowBusinessError(item.getNum().compareTo(it.getNum()) != 0)
|
||||
.throwMessage("物料" + it.getMatnr() + "的扫码数量不一致");
|
||||
// VUtil.trueThrowBusinessError(it.getNum().compareTo(item.getTemng()) > 0)
|
||||
// .throwMessage("物料" + it.getMatnr() + "的扫码数量大于退货数量");
|
||||
// VUtil.trueThrowBusinessError(item.getNum().compareTo(it.getNum()) != 0)
|
||||
// .throwMessage("物料" + it.getMatnr() + "的扫码数量不一致");
|
||||
items.add(item);
|
||||
if (item.getNum().compareTo(BigDecimal.ZERO) > 0) {
|
||||
input1.add(new ZWM3A06Input1DTO()
|
||||
|
|
@ -148,10 +149,10 @@ public class OutPurchaseController extends BaseController {
|
|||
.setRetpo(it.getRetpo())
|
||||
.setMatnr(it.getMatnr())
|
||||
.setMaktx(it.getMaktx())
|
||||
.setErfmg(it.getNum())
|
||||
.setErfmg(item.getNum())
|
||||
.setMeins(it.getMeins())
|
||||
.setCharg(it.getCharg())
|
||||
.setWerks(it.getWerks())
|
||||
.setWerks(item.getWerks())
|
||||
.setLgort(it.getLgort())
|
||||
.setLfbja(it.getLfbja())
|
||||
.setLfbnr(it.getLfbnr())
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.nflg.wms.common.pojo.qo.EnableQO;
|
|||
import com.nflg.wms.common.pojo.qo.WarehouseAddQO;
|
||||
import com.nflg.wms.common.pojo.qo.WarehouseSearchQO;
|
||||
import com.nflg.wms.common.pojo.qo.WarehouseUpdateQO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseSimpleVO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseVO;
|
||||
import com.nflg.wms.repository.entity.DictionaryItem;
|
||||
import com.nflg.wms.starter.BaseController;
|
||||
|
|
@ -118,7 +119,7 @@ public class WarehouseController extends BaseController {
|
|||
* @param factoryNo 工厂编号
|
||||
*/
|
||||
@GetMapping("getEnableList")
|
||||
public ApiResult<List<WarehouseVO>> getEnableList(@Valid @RequestParam(required = false) String factoryNo) {
|
||||
public ApiResult<List<WarehouseSimpleVO>> getEnableList(@Valid @RequestParam(required = false) String factoryNo) {
|
||||
return ApiResult.success(warehouseControllerService.getEnableList(factoryNo));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,10 @@ public class SapService {
|
|||
JCoTable ot1 = function.getTableParameterList().getTable("OUTPUT1");
|
||||
VUtil.trueThrowBusinessError(ot1.getNumRows() == 0).throwMessage("没有订单数据");
|
||||
ot1.setRow(0);
|
||||
ZWM3A05VO vo = new ZWM3A05VO().setEbeln(ot1.getString("EBELN")).setLifnr(ot1.getString("LIFNR"));
|
||||
ZWM3A05VO vo = new ZWM3A05VO()
|
||||
.setEbeln(ot1.getString("EBELN"))
|
||||
.setLifnr(ot1.getString("LIFNR"))
|
||||
.setWerks(ot1.getString("WERKS"));
|
||||
vo.setItems(JCoUtil.toBeanList(ot1, ZWM3A05ItemVO.class));
|
||||
|
||||
JCoTable ot2 = function.getTableParameterList().getTable("OUTPUT2");
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import com.nflg.wms.common.pojo.qo.EnableQO;
|
|||
import com.nflg.wms.common.pojo.qo.WarehouseAddQO;
|
||||
import com.nflg.wms.common.pojo.qo.WarehouseSearchQO;
|
||||
import com.nflg.wms.common.pojo.qo.WarehouseUpdateQO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseSimpleVO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseVO;
|
||||
import com.nflg.wms.common.util.DateTimeUtil;
|
||||
import com.nflg.wms.common.util.EecExcelUtil;
|
||||
|
|
@ -217,7 +218,7 @@ public class WarehouseControllerService {
|
|||
.writeTo(response.getOutputStream());
|
||||
}
|
||||
|
||||
public List<WarehouseVO> getEnableList(String factoryNo) {
|
||||
public List<WarehouseSimpleVO> getEnableList(String factoryNo) {
|
||||
return warehouseService.getEnableList(factoryNo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package com.nflg.wms.admin.util;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.MapperFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.json.JsonMapper;
|
||||
import com.nflg.wms.common.util.BeanUtil;
|
||||
import com.sap.conn.jco.*;
|
||||
|
||||
|
|
@ -11,8 +13,10 @@ import java.util.stream.Collectors;
|
|||
|
||||
public class JCoUtil {
|
||||
|
||||
private static final ObjectMapper MAPPER = new ObjectMapper()
|
||||
.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
|
||||
private static final ObjectMapper MAPPER = JsonMapper.builder()
|
||||
.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES)
|
||||
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
|
||||
.build();
|
||||
|
||||
/**
|
||||
* 将 JCoTable 转换为 Java Bean 列表
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.nflg.wms.common.pojo.dto;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.nflg.wms.common.util.BomUtil;
|
||||
import com.nflg.wms.common.util.DateTimeUtil;
|
||||
import lombok.Data;
|
||||
|
|
@ -118,6 +119,7 @@ public class DepartmentMaterialReturnSlipDTO {
|
|||
return Objects.isNull(num) ? bdmng : num;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
private String key;
|
||||
|
||||
public String getKey() {
|
||||
|
|
|
|||
|
|
@ -1,29 +1,14 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class QRCodeQO {
|
||||
public class QRCodeQO extends QRCodeQO1 {
|
||||
|
||||
/**
|
||||
* 项id
|
||||
*/
|
||||
@NotNull
|
||||
private Long itemId;
|
||||
|
||||
/**
|
||||
* 二维码内容
|
||||
*/
|
||||
@NotBlank
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@NotNull
|
||||
private BigDecimal num;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class QRCodeQO1 {
|
||||
|
||||
/**
|
||||
* 二维码内容
|
||||
*/
|
||||
@NotBlank
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@NotNull
|
||||
private BigDecimal num;
|
||||
}
|
||||
|
|
@ -74,13 +74,13 @@ public class InventoryCheckTaskItemVO {
|
|||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 责任人
|
||||
*/
|
||||
private String userName;
|
||||
// /**
|
||||
// * 责任人
|
||||
// */
|
||||
// private String userName;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
// /**
|
||||
// * 联系电话
|
||||
// */
|
||||
// private String phone;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WarehouseSimpleVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 仓库编码
|
||||
*/
|
||||
private String no;
|
||||
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 所属工厂名称
|
||||
*/
|
||||
private String factoryName;
|
||||
|
||||
/**
|
||||
* 所在地点
|
||||
*/
|
||||
private String address;
|
||||
}
|
||||
|
|
@ -5,19 +5,7 @@ import lombok.Data;
|
|||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class WarehouseVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 仓库编码
|
||||
*/
|
||||
private String no;
|
||||
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
private String name;
|
||||
public class WarehouseVO extends WarehouseSimpleVO {
|
||||
|
||||
/**
|
||||
* 责任人
|
||||
|
|
@ -34,11 +22,6 @@ public class WarehouseVO {
|
|||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 所在地点
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
|
|
@ -83,9 +66,4 @@ public class WarehouseVO {
|
|||
* 所属工厂
|
||||
*/
|
||||
private Long factoryId;
|
||||
|
||||
/**
|
||||
* 所属工厂名称
|
||||
*/
|
||||
private String factoryName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.nflg.wms.common.pojo.qo.QRCodeQO1;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
|
|
@ -18,6 +19,10 @@ public class ZWM3A05ItemVO {
|
|||
*/
|
||||
private String ebelp;
|
||||
|
||||
public String getEbelp() {
|
||||
return StrUtil.removeAllPrefix(ebelp, "0");
|
||||
}
|
||||
|
||||
/**
|
||||
* 退货项目
|
||||
*/
|
||||
|
|
@ -74,11 +79,6 @@ public class ZWM3A05ItemVO {
|
|||
*/
|
||||
private String lgort;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
private String werks;
|
||||
|
||||
/**
|
||||
* 批次号列表
|
||||
*/
|
||||
|
|
@ -89,17 +89,17 @@ public class ZWM3A05ItemVO {
|
|||
*/
|
||||
private String binNos;
|
||||
|
||||
/**
|
||||
* 实际退货数量(扫码后计算)
|
||||
*/
|
||||
private BigDecimal num;
|
||||
|
||||
public BigDecimal getNum() {
|
||||
return Optional.ofNullable(num).orElse(BigDecimal.ZERO);
|
||||
}
|
||||
// /**
|
||||
// * 实际退货数量(扫码后计算)
|
||||
// */
|
||||
// private BigDecimal num;
|
||||
//
|
||||
// public BigDecimal getNum() {
|
||||
// return Optional.ofNullable(num).orElse(BigDecimal.ZERO);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 二维码列表
|
||||
*/
|
||||
private List<String> qrCodes = new ArrayList<>();
|
||||
private List<QRCodeQO1> qrCodes = new ArrayList<>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,11 @@ public class ZWM3A05VO {
|
|||
*/
|
||||
private String lifnr;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
private String werks;
|
||||
|
||||
@Valid
|
||||
private List<ZWM3A05ItemVO> items = new ArrayList<>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ 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.WarehouseSearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseSimpleVO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseVO;
|
||||
import com.nflg.wms.repository.entity.WmsWarehouse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -26,7 +27,7 @@ public interface WmsWarehouseMapper extends BaseMapper<WmsWarehouse> {
|
|||
|
||||
List<WarehouseVO> searchNonPage(@Param("request") WarehouseSearchQO request);
|
||||
|
||||
List<WarehouseVO> getEnableList(String factoryNo);
|
||||
List<WarehouseSimpleVO> getEnableList(String factoryNo);
|
||||
|
||||
List<WarehouseVO> getListByIds(List<Long> list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nflg.wms.common.pojo.qo.EnableQO;
|
||||
import com.nflg.wms.common.pojo.qo.WarehouseSearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseSimpleVO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseVO;
|
||||
import com.nflg.wms.repository.entity.WmsWarehouse;
|
||||
import jakarta.validation.Valid;
|
||||
|
|
@ -37,7 +38,7 @@ public interface IWmsWarehouseService extends IService<WmsWarehouse> {
|
|||
|
||||
List<WarehouseVO> searchNonPage(@Valid WarehouseSearchQO request);
|
||||
|
||||
List<WarehouseVO> getEnableList(String factoryNo);
|
||||
List<WarehouseSimpleVO> getEnableList(String factoryNo);
|
||||
|
||||
List<WarehouseVO> getListByIds(List<Long> list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nflg.wms.common.pojo.qo.EnableQO;
|
||||
import com.nflg.wms.common.pojo.qo.WarehouseSearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseSimpleVO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseVO;
|
||||
import com.nflg.wms.common.util.UserUtil;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
|
|
@ -106,7 +107,7 @@ public class WmsWarehouseServiceImpl extends ServiceImpl<WmsWarehouseMapper, Wms
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<WarehouseVO> getEnableList(String factoryNo) {
|
||||
public List<WarehouseSimpleVO> getEnableList(String factoryNo) {
|
||||
return baseMapper.getEnableList(factoryNo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
order by w.id desc
|
||||
</select>
|
||||
|
||||
<select id="getEnableList" resultType="com.nflg.wms.common.pojo.vo.WarehouseVO">
|
||||
<select id="getEnableList" resultType="com.nflg.wms.common.pojo.vo.WarehouseSimpleVO">
|
||||
select w.*, di.name as factory_name
|
||||
from wms_warehouse w
|
||||
left join dictionary_item di on w.factory_id = di.id
|
||||
|
|
|
|||
Loading…
Reference in New Issue