zhou zhou
5 小时以前 a3b3e3ac062d8ac4c1d66d7b2a992720ea5e7ca2
#站点库位管理
4个文件已修改
210 ■■■■■ 已修改文件
rsf-server/src/main/java/com/vincent/rsf/server/api/controller/pda/PdaOtherController.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/api/entity/params/PdaGeneralParam.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/api/service/PdaOtherService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/PdaOtherServiceImpl.java 165 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/api/controller/pda/PdaOtherController.java
@@ -45,4 +45,33 @@
        return pdaOtherService.inspectConfirm2(generalParam);
    }
    @RequestMapping(value = "/other/station/page")
    public R stationPage(@RequestParam String staNo,
                          @RequestParam(defaultValue = "1") Integer curr,
                          @RequestParam(defaultValue = "5") Integer limit) {
        return pdaOtherService.stationPage(staNo,curr,limit);
    }
    @PostMapping(value = "/other/staOperate")
    public R staOperate(@RequestBody PdaGeneralParam generalParam) {
        return pdaOtherService.staOperate(generalParam,getLoginUser());
    }
    @RequestMapping(value = "/other/loc/page")
    public R locPage(@RequestParam String locNo,
                         @RequestParam(defaultValue = "1") Integer curr,
                         @RequestParam(defaultValue = "5") Integer limit) {
        return pdaOtherService.locPage(locNo,curr,limit);
    }
    @PostMapping(value = "/other/locOperate")
    public R locOperate(@RequestBody PdaGeneralParam generalParam) {
        return pdaOtherService.locOperate(generalParam,getLoginUser());
    }
}
rsf-server/src/main/java/com/vincent/rsf/server/api/entity/params/PdaGeneralParam.java
@@ -19,4 +19,11 @@
    private List<LocItem> matnrList;
    /**
     * 站点操作类型:1.解禁 2.禁用 3.释放
     */
    private Integer staOperateType;
    private String locNo;
}
rsf-server/src/main/java/com/vincent/rsf/server/api/service/PdaOtherService.java
@@ -2,6 +2,7 @@
import com.vincent.rsf.framework.common.R;
import com.vincent.rsf.server.api.entity.params.PdaGeneralParam;
import com.vincent.rsf.server.system.entity.User;
public interface PdaOtherService {
    R transferPage(String orderNo, Integer curr, Integer limit);
@@ -11,4 +12,12 @@
    R inspectConfirm(PdaGeneralParam generalParam);
    R inspectConfirm2(PdaGeneralParam generalParam);
    R stationPage(String staNo, Integer curr, Integer limit);
    R staOperate(PdaGeneralParam generalParam, User user);
    R locPage(String locNo, Integer curr, Integer limit);
    R locOperate(PdaGeneralParam generalParam, User loginUser);
}
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/PdaOtherServiceImpl.java
@@ -7,17 +7,22 @@
import com.vincent.rsf.framework.exception.CoolException;
import com.vincent.rsf.server.api.entity.params.PdaGeneralParam;
import com.vincent.rsf.server.api.service.PdaOtherService;
import com.vincent.rsf.server.manager.entity.BasStation;
import com.vincent.rsf.server.manager.entity.Loc;
import com.vincent.rsf.server.manager.entity.LocItem;
import com.vincent.rsf.server.manager.entity.Transfer;
import com.vincent.rsf.server.manager.enums.LocStatusType;
import com.vincent.rsf.server.manager.enums.LocStsType;
import com.vincent.rsf.server.manager.service.BasStationService;
import com.vincent.rsf.server.manager.service.LocItemService;
import com.vincent.rsf.server.manager.service.LocService;
import com.vincent.rsf.server.manager.service.TransferService;
import com.vincent.rsf.server.system.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
@Service
@@ -30,6 +35,9 @@
    private LocService locService;
    @Autowired
    private LocItemService locItemService;
    @Autowired
    private BasStationService basStationService;
    @Override
    public R transferPage(String orderNo, Integer curr, Integer limit) {
@@ -113,4 +121,161 @@
        }
        return R.ok();
    }
    @Override
    public R stationPage(String staNo, Integer curr, Integer limit) {
        Page<BasStation> page = new Page<>(curr, limit);
        LambdaQueryWrapper<BasStation> basStationLambdaQueryWrapper = new LambdaQueryWrapper<>();
        basStationLambdaQueryWrapper.eq(!Cools.isEmpty(staNo), BasStation::getStationName, staNo);
        Page<BasStation> page1 = basStationService.page(page, basStationLambdaQueryWrapper);
        return R.ok(page1);
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R staOperate(PdaGeneralParam generalParam, User user) {
        switch (generalParam.getStaOperateType()){
            case 1:
                stationDisabled(generalParam.getTransferStationNo(),user);
                break;
            case 2:
                stationLiftTheBan(generalParam.getTransferStationNo(),user);
                break;
            case 3:
                stationRelease(generalParam.getTransferStationNo(),user);
                break;
            default:
                break;
        }
        return R.ok();
    }
    @Transactional(rollbackFor = Exception.class)
    public void stationDisabled(String transferStationNo,User user){
        BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, transferStationNo));
        if (Cools.isEmpty(basStation)) {
            throw new CoolException("未找到正确的站点");
        }
        if (basStation.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) || basStation.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type)) {
            throw new CoolException("当前站点正在工作");
        }
        basStation.setUseStatus(LocStsType.LOC_STS_TYPE_X.type);
        basStation.setUpdateBy(user.getId());
        basStation.setUpdateTime(new Date());
        basStationService.updateById(basStation);
    }
    @Transactional(rollbackFor = Exception.class)
    public void stationLiftTheBan(String transferStationNo,User user){
        BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, transferStationNo));
        if (Cools.isEmpty(basStation)) {
            throw new CoolException("未找到正确的站点");
        }
        if (basStation.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) || basStation.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type)) {
            throw new CoolException("当前站点正在工作");
        }
        basStation.setUseStatus(Cools.isEmpty(basStation.getBarcode())?LocStsType.LOC_STS_TYPE_O.type:LocStsType.LOC_STS_TYPE_F.type);
        basStation.setUpdateBy(user.getId());
        basStation.setUpdateTime(new Date());
        basStationService.updateById(basStation);
    }
    @Transactional(rollbackFor = Exception.class)
    public void stationRelease(String transferStationNo,User user){
        BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, transferStationNo));
        if (Cools.isEmpty(basStation)) {
            throw new CoolException("未找到正确的站点");
        }
        if (basStation.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) || basStation.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type)) {
            throw new CoolException("当前站点正在工作");
        }
        basStation.setUseStatus(LocStsType.LOC_STS_TYPE_O.type);
        basStation.setBarcode(null);
        basStation.setUpdateBy(user.getId());
        basStation.setUpdateTime(new Date());
        basStationService.updateById(basStation);
    }
    @Override
    public R locPage(String locNo, Integer curr, Integer limit) {
        Page<Loc> page = new Page<>(curr, limit);
        LambdaQueryWrapper<Loc> basStationLambdaQueryWrapper = new LambdaQueryWrapper<>();
        basStationLambdaQueryWrapper.eq(!Cools.isEmpty(locNo), Loc::getCode, locNo);
        Page<Loc> page1 = locService.page(page, basStationLambdaQueryWrapper);
        return R.ok(page1);
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R locOperate(PdaGeneralParam generalParam, User user) {
        switch (generalParam.getStaOperateType()){
            case 1:
                locDisabled(generalParam.getLocNo(),user);
                break;
            case 2:
                locLiftTheBan(generalParam.getLocNo(),user);
                break;
            case 3:
                locRelease(generalParam.getLocNo(),user);
                break;
            default:
                break;
        }
        return R.ok();
    }
    @Transactional(rollbackFor = Exception.class)
    public void locDisabled(String transferStationNo,User user){
        Loc lco = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, transferStationNo));
        if (Cools.isEmpty(lco)) {
            throw new CoolException("未找到正确的库位");
        }
        if (lco.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) || lco.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type)) {
            throw new CoolException("当前站点正在工作");
        }
        lco.setUseStatus(LocStsType.LOC_STS_TYPE_X.type);
        lco.setUpdateBy(user.getId());
        lco.setUpdateTime(new Date());
        locService.updateById(lco);
    }
    @Transactional(rollbackFor = Exception.class)
    public void locLiftTheBan(String transferStationNo,User user){
        Loc lco = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, transferStationNo));
        if (Cools.isEmpty(lco)) {
            throw new CoolException("未找到正确的库位");
        }
        if (lco.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) || lco.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type)) {
            throw new CoolException("当前库位正在工作");
        }
        lco.setUseStatus(Cools.isEmpty(lco.getBarcode())?LocStsType.LOC_STS_TYPE_O.type:LocStsType.LOC_STS_TYPE_F.type);
        lco.setUpdateBy(user.getId());
        lco.setUpdateTime(new Date());
        locService.updateById(lco);
    }
    @Transactional(rollbackFor = Exception.class)
    public void locRelease(String transferStationNo,User user){
        Loc lco = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, transferStationNo));
        if (Cools.isEmpty(lco)) {
            throw new CoolException("未找到正确的库位");
        }
        if (lco.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) || lco.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type)) {
            throw new CoolException("当前库位正在工作");
        }
        lco.setUseStatus(LocStsType.LOC_STS_TYPE_O.type);
        lco.setBarcode(null);
        lco.setUpdateBy(user.getId());
        lco.setUpdateTime(new Date());
        locService.updateById(lco);
    }
}