Browse Source

opt: 区域锁定功能优化

master
yanps 2 months ago
parent
commit
f2bde5c656
  1. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml
  2. 17
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java

4
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml

@ -59,8 +59,8 @@
</select>
<select id="selectPointByRegion" resultType="com.alibaba.fastjson.JSONObject"
parameterType="java.lang.String">
select point_code, point_name
select point_code, point_name,point_status
from sch_base_point
where region_code = #{regionCode}
where region_code = #{regionCode} and point_type is null
</select>
</mapper>

17
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java

@ -74,10 +74,9 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
private ISysParamService iSysParamService;
private final Object lock = new Object();
private final Object lock2 = new Object();
private final Object lock3 = new Object();
private final Object lock4 = new Object();
@Override
@ -520,12 +519,22 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
@Override
public List<JSONObject> selectPointByRegion(String regionCode) {
return pointMapper.selectPointByRegion(regionCode);
List<JSONObject> jsonObjectList = pointMapper.selectPointByRegion(regionCode);
jsonObjectList.stream().forEach(jsonObject -> {
if (ObjectUtil.isNotEmpty(jsonObject.get("point_status"))) {
if (jsonObject.get("point_status").equals(GoodsEnum.EMPTY_PALLETS.getValue()) || jsonObject.get("point_status").equals(GoodsEnum.IN_STOCK.getValue())) {
jsonObject.put("point_status", "1");
}
}else{
jsonObject.put("point_status", "0");
}
});
return jsonObjectList;
}
@Override
public SchBasePoint selectPointByEmpAndRegion(String region_code, String vehicle_code, String s) {
synchronized (lock2) {
synchronized (lock4) {
//查询载具的类型
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.getById(vehicle_code);
if (ObjectUtil.isEmpty(mdBaseVehicle)) throw new BadRequestException("载具类型不存在!");

Loading…
Cancel
Save