Merge branch 'dev' into prd

# Conflicts:
#	mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/DataImportServiceImpl.java
This commit is contained in:
tangyu 2025-01-17 14:22:36 +08:00
commit 3b65b9a092
8 changed files with 53 additions and 24 deletions

View File

@ -21,8 +21,8 @@ import java.util.List;
@FeignClient(contextId = "remoteWmsInventoryRecordService", value = "mom-wms-biz")
public interface RemoteWmsInventoryRecordService {
@GetMapping("/wms-inventoryRecord/api/{type}")
R<List<InventoryRecord>> getByType(@PathVariable("type") String type);
@GetMapping("/wms-inventoryRecord/api/{type}/{isSap}")
R<List<InventoryRecord>> getByType(@PathVariable("type") String type, @PathVariable("isSap") String isSap);
@GetMapping("/wms-inventoryRecord/{handle}")
R<InventoryRecord> getById(@PathVariable("handle") String handle);

View File

@ -315,6 +315,8 @@ public class InventoryRecordDTO extends InventoryRecord {
private String uom;
private String isSap;

View File

@ -348,6 +348,9 @@ public class InventoryRecord extends Model<InventoryRecord> {
@ApiModelProperty(value = "膜卷类型")
private String uom;
@ApiModelProperty(value = "是否走已SAP")
private String isSap;
public static String genHandle(String site, String barcode) {
return HandleBoProcessor.genHandle(KW_WMS_INVENTORY_BO, site, barcode);

View File

@ -69,9 +69,9 @@ public class InventoryRecordController {
}
@ApiOperation(value = "通过类型查询", notes = "通过类型查询")
@GetMapping("/api/{type}")
public R<List<InventoryRecord>> getByType(@PathVariable("type") String type) {
return R.ok(inventoryRecordService.selectBySyncStatusAndType(type));
@GetMapping("/api/{type}/{isSap}")
public R<List<InventoryRecord>> getByType(@PathVariable("type") String type,@PathVariable("isSap") String isSap) {
return R.ok(inventoryRecordService.selectBySyncStatusAndType(type,isSap));
}
@ApiOperation(value = "通过状态类型查询", notes = "通过状态类型查询")

View File

@ -1,6 +1,7 @@
package com.foreverwin.mom.wms.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mom.wms.dto.InventoryRecordDTO;
import com.foreverwin.mom.wms.entity.InventoryRecord;
@ -15,7 +16,7 @@ public interface InventoryRecordService extends IService<InventoryRecord> {
InventoryRecord getByCode(String site, String code);
List<InventoryRecord> selectBySyncStatusAndType(String type);
List<InventoryRecord> selectBySyncStatusAndType(String type, String isSap);
List<InventoryRecord> selectBySyncStatus();
@ -26,4 +27,8 @@ public interface InventoryRecordService extends IService<InventoryRecord> {
InventoryRecord getByitemDescAndWorkshopNumber(String itemDesc, String workshopNumber,String mainQty,String site);
List<InventoryRecordDTO> selectByIsSap(String isSap);
void updateIsSapById(String sid, String site, String isSap);
}

View File

@ -582,12 +582,12 @@ public class DataImportServiceImpl implements DataImportService {
return;
}
boolean isUpdate = false;
InventoryRecord inventory = null;
InventoryRecord inventoryRecord = null;
if (StrUtil.isBlank(data.getBarcode())) {
errorMessage.append(MessageFormat.format("第{0}行;条码不能为空 \n", row));
} else {
inventory = inventoryRecordService.getByCode(site, data.getBarcode());
if (inventory != null) {
inventoryRecord = inventoryRecordService.getByCode(site, data.getBarcode());
if (inventoryRecord != null) {
isUpdate = true;
}
Integer row_ = uniqueMap.get(data.getBarcode());
@ -598,7 +598,7 @@ public class DataImportServiceImpl implements DataImportService {
}
}
importInventoryRecordValidate(site, user, row, data, errorMessage, inventory != null ? update : insert, logs, inventory);
importInventoryRecordValidate(site, user, row, data, errorMessage, inventoryRecord != null ? update : insert, logs, inventoryRecord);
}
@ -613,13 +613,11 @@ public class DataImportServiceImpl implements DataImportService {
if (errorMessage.length() < 1) {
if (CollectionUtil.isNotEmpty(insert)) {
inventoryRecordService.saveBatch(insert);
for (InventoryRecord inventoryRecord : insert){
processInventoryRecord(inventoryRecord, site);
}
}
if (CollectionUtil.isNotEmpty(update)) {
inventoryRecordService.updateBatchById(update);
}
inventoryLogService.saveBatch(logs);
}
return errorMessage.toString();
}
@ -805,6 +803,8 @@ public class DataImportServiceImpl implements DataImportService {
inventoryRecord.setExternalLot(zExternalLotRecord.getExternalLot());
}
processInventoryRecord(inventoryRecord,site,logs,pdt );
@ -995,9 +995,8 @@ public class DataImportServiceImpl implements DataImportService {
}
}
private void processInventoryRecord(InventoryRecord inventoryRecord, String site) {
private void processInventoryRecord(InventoryRecord inventoryRecord, String site,Vector<InventoryLog> logs,LocalDateTime pdt) {
String user = SecurityUtils.getUserName();
String erpInventory = inventoryRecord.getErpInventory();
String barcode = inventoryRecord.getBarcode();
String status = inventoryRecord.getStatus();
@ -1029,15 +1028,16 @@ public class DataImportServiceImpl implements DataImportService {
inventory.setOriginalQty(qtyDones);
inventory.setQtyOnHand(qtyDones);
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
inventory.setProductionDate(LocalDate.parse(dateOfManufacture, dateTimeFormatter).atTime(0, 0));
inventory.setProductionDate(pdt);
inventory.setQualityInspectionStatus(grade);
inventory.setRollType(uom);
inventory.setAuxiliaryUnit(subUom);
inventory.setAuxiliaryOty(subQty);
inventoryService.createInventory(inventory);
logs.add(inventoryLogService.buildLog(user, inventory.getInventoryId(), null, null, Constant.CHANGE_TYPE_IMPORT_SAVE,
null, inventory.getQtyOnHand(), null, "万润委外工厂库存导入", null, null, inventory));
inventoryService.save(inventory);
}
}

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mom.wms.dto.InventoryRecordDTO;
import com.foreverwin.mom.wms.entity.InventoryRecord;
import com.foreverwin.mom.wms.mapper.InventoryRecordMapper;
import com.foreverwin.mom.wms.service.InventoryRecordService;
@ -12,7 +13,6 @@ import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.List;
@Service
@ -40,8 +40,8 @@ public class InventoryRecordServiceImpl extends ServiceImpl<InventoryRecordMappe
}
@Override
public List<InventoryRecord> selectBySyncStatusAndType(String type){
return inventoryRecordMapper.selectBySyncStatusAndType(type);
public List<InventoryRecord> selectBySyncStatusAndType(String type,String isSap){
return inventoryRecordMapper.selectBySyncStatusAndType(type,isSap);
}
@Override
@ -61,4 +61,15 @@ public class InventoryRecordServiceImpl extends ServiceImpl<InventoryRecordMappe
}
@Override
public List<InventoryRecordDTO> selectByIsSap(String isSap) {
return inventoryRecordMapper.selectByIsSap(isSap);
}
@Override
public void updateIsSapById(String sid, String site, String isSap) {
inventoryRecordMapper.updateIsSapById(sid, site, isSap);
}
}

View File

@ -24,8 +24,16 @@ public interface InventoryRecordMapper extends BaseMapper<InventoryRecord> {
@Select("SELECT * FROM inventory_records WHERE sid = #{sid}")
InventoryRecord selectBySid(String sid);
@Select("SELECT * FROM inventory_records WHERE type = #{type} and sync_status!= 'S'")
List<InventoryRecord> selectBySyncStatusAndType(String type);
@Select("SELECT * FROM inventory_records WHERE type = #{type} and is_sap = #{isSap}")
List<InventoryRecord> selectBySyncStatusAndType(@Param("type") String type,@Param("isSap") String isSap);
@Select("SELECT * FROM inventory_records WHERE is_sap = #{isSap}")
List<InventoryRecordDTO> selectByIsSap(String isSap);
@Select("UPDATE inventory_records SET is_sap = #{isSap} WHERE sid = #{sid} and site = #{site}")
void updateIsSapById( @Param("sid") String sid,@Param("site") String site, @Param("isSap") String isSap);
@Select("SELECT so.SHOP_ORDER, i.SITE, i.ITEM, CF1.FIELD_VALUE AS RESERVED, CF2.FIELD_VALUE AS RESERVED_SEQ " +
"FROM wip.shop_order so " +