add:增加一键解锁点位功能

This commit is contained in:
2026-06-16 17:59:26 +08:00
parent 9c4e0f16ab
commit 8a075f3023
8 changed files with 150 additions and 24 deletions

View File

@@ -197,9 +197,9 @@ public class MdMeMaterialbaseServiceImpl extends ServiceImpl<MdMeMaterialbaseMap
}
List<Structattr> insertList = new ArrayList<>();
Set<String> existCodesInFile = new HashSet<>();
final String SECT_ID = "1985610807760785408";
final String SECT_CODE = "1BC";
final String SECT_NAME = "1楼半成品";
final String SECT_ID = "2005471899915784192";
final String SECT_CODE = "1BCDJQ";
final String SECT_NAME = "1楼半成品待检区";
final String STOR_ID = "1985609997907791872";
final String STOR_CODE = "firstfloorBC";
final String STOR_NAME = "1楼半成品";

View File

@@ -37,6 +37,7 @@ import org.nl.wms.sch_manage.enums.StatusEnum;
import org.nl.wms.warehouse_manage.enums.IOSEnum;
import org.nl.wms.warehouse_manage.record.service.IStIvtStructivtflowService;
import org.nl.wms.warehouse_manage.record.service.dao.StIvtStructivtflow;
import org.nl.wms.warehouse_manage.record.service.dao.mapper.StIvtStructivtflowMapper;
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
import org.springframework.beans.factory.annotation.Autowired;
@@ -82,10 +83,11 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
@Autowired
private IStSectStrategyService iStSectStrategyService;
@Autowired
private StIvtStructivtflowMapper stIvtStructivtflowMapper;
@Override
public IPage<Structattr> queryAll(Map whereJson, PageQuery page) {
String search = (String) whereJson.get("search");
String stor_id = (String) whereJson.get("stor_id");
String sect_id = (String) whereJson.get("sect_id");
@@ -146,6 +148,29 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
return structattrMapper.selectPage(new Page<>(page.getPage() + 1, page.getSize()), queryWrapper);
}
@Transactional(rollbackFor = Exception.class)
public void syncStorageVehicleCode() {
//查询st_ivt_structivtflow表范围为update_time大于'2026-06-14 10:18:00'的数据,
//根据update_time升序遍历集合如果growth=true则代表新增库存把vehicle_code更新到st_ivt_structattr表的storagevehicle_code字段中
//如果growth==false则代表减少库存把vehicle_code更新到st_ivt_structattr表的storagevehicle_code字段为NULL
List<StIvtStructivtflow> list = stIvtStructivtflowMapper.selectList(
new LambdaQueryWrapper<StIvtStructivtflow>()
.gt(StIvtStructivtflow::getUpdate_time, "2026-06-14 10:18:00")
.orderByAsc(StIvtStructivtflow::getUpdate_time)
);
for (StIvtStructivtflow r : list) {
LambdaUpdateWrapper<Structattr> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(Structattr::getUpdate_time, DateUtil.now());
if (Boolean.TRUE.equals(r.getGrowth())) {
updateWrapper.set(Structattr::getStoragevehicle_code, r.getVehicle_code());
} else {
updateWrapper.set(Structattr::getStoragevehicle_code, null);
}
updateWrapper.eq(Structattr::getStruct_code, r.getStruct_code());
this.update(updateWrapper);
}
}
/**
* 超托库位搜索条件
*/
@@ -255,6 +280,9 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
if (ObjectUtil.isEmpty(dto.getWidth())) {
lambdaUpdateWrapper.set(Structattr::getWidth, null);
}
if (ObjectUtil.isEmpty(dto.getWidth())) {
lambdaUpdateWrapper.set(Structattr::getWidth, null);
}
if (ObjectUtil.isEmpty(dto.getStoragevehicle_code())) {
lambdaUpdateWrapper.set(Structattr::getStoragevehicle_code, null);
}

View File

@@ -108,4 +108,11 @@ public class SchBasePointController {
schBasePointService.changeLock(points);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("释放出库点")
@PostMapping("/relse")
public ResponseEntity<Object> relse(@RequestBody List<String> pointCodes) {
schBasePointService.relse(pointCodes);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@@ -113,4 +113,11 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
*/
List<SchBasePoint> checkEndPointTask(String regionCode, String getLockType, String sortType, String
pointType, String pointCode, String vehicleIsNull, boolean isFourPoint);
/**
* 释放出库点
*
* @param pointCodes 点位编码列表
*/
void relse(List<String> pointCodes);
}

View File

@@ -217,6 +217,25 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
return pointMapper.selectByIdLock(id);
}
@Override
@Transactional
public void relse(List<String> pointCodes) {
String now = DateUtil.now();
String userId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
LambdaUpdateWrapper<SchBasePoint> wrapper = new LambdaUpdateWrapper<>();
wrapper.in(SchBasePoint::getPoint_code, pointCodes)
.set(SchBasePoint::getLock_up, false)
.set(SchBasePoint::getPoint_status, "1")
.set(SchBasePoint::getIs_has_workder,"0")
.set(SchBasePoint::getVehicle_code, null)
.set(SchBasePoint::getUpdate_id, userId)
.set(SchBasePoint::getUpdate_name, nickName)
.set(SchBasePoint::getUpdate_time, now);
this.update(wrapper);
log.info(nickName+"在:"+now+",手动一键解锁了出库区点位:"+pointCodes);
}
@Override
public void unLockPoint(String point_code) {
this.update(