【allowOverTask】是否允许超库存发货,【allowOverStock】是否允许超量报工

dev
siontion 5 months ago
parent 3080c89815
commit d291428c35

@ -2,21 +2,26 @@ package com.chanko.yunxi.mes.module.biz.controller.admin.app;
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
import com.chanko.yunxi.mes.module.biz.controller.admin.app.vo.OverTaskVO;
import com.chanko.yunxi.mes.module.biz.controller.admin.procedure.vo.ProcedureRespVO;
import com.chanko.yunxi.mes.module.biz.controller.admin.workshop.vo.WorkshopRespVO;
import com.chanko.yunxi.mes.module.biz.controller.admin.app.vo.AppVersionVO;
import com.chanko.yunxi.mes.module.biz.dal.dataobject.plan.PlanWorkshopDO;
import com.chanko.yunxi.mes.module.biz.dal.dataobject.procedure.ProcedureDO;
import com.chanko.yunxi.mes.module.biz.dal.dataobject.systemparameters.SystemParametersDO;
import com.chanko.yunxi.mes.module.biz.dal.dataobject.taskdispatch.TaskDispatchDO;
import com.chanko.yunxi.mes.module.biz.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
import com.chanko.yunxi.mes.module.biz.dal.dataobject.workshop.WorkshopDO;
import com.chanko.yunxi.mes.module.biz.dal.mysql.procedure.ProcedureMapper;
import com.chanko.yunxi.mes.module.biz.dal.mysql.systemparameters.SystemParametersMapper;
import com.chanko.yunxi.mes.module.biz.dal.mysql.workshop.WorkshopMapper;
import com.chanko.yunxi.mes.module.biz.enums.SystemParmetersEnum;
import com.chanko.yunxi.mes.module.infra.dal.dataobject.file.FileDO;
import com.chanko.yunxi.mes.module.infra.service.file.FileService;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jodd.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
@ -51,6 +56,9 @@ public class AdminAppController {
@Resource
private ProcedureMapper procedureMapper;
@Resource
private SystemParametersMapper systemParametersMapper;
@GetMapping("/latest")
@Operation(summary = "获取最新app版本")
@ -94,4 +102,19 @@ public class AdminAppController {
;
return success(BeanUtils.toBean(procedureMapper.selectList(query), ProcedureRespVO.class));
}
@GetMapping("/allow-over-task")
@Operation(summary = "是否允许超量报工")
public CommonResult<OverTaskVO> allowOverTask(){
SystemParametersDO systemParametersDO = systemParametersMapper.selectOne("code", SystemParmetersEnum.OVERTASK_CENTER_LIST.getDescription());
OverTaskVO overTaskVO = new OverTaskVO();
if(systemParametersDO == null){
overTaskVO.setIsAllow("0");
overTaskVO.setWorkShops("");
}else{
overTaskVO.setIsAllow(StringUtil.isNotEmpty(systemParametersDO.getCurrentValue())?"1":"0");
overTaskVO.setWorkShops(systemParametersDO.getCurrentValue());
}
return success(overTaskVO);
}
}

@ -0,0 +1,23 @@
package com.chanko.yunxi.mes.module.biz.controller.admin.app.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* app
* @author chenxi
* @date 2024-04-25 09:56
*/
@Data
public class OverTaskVO {
@Schema(description = "")
private String isAllow;
@Schema(description = "允许的车间列表")
private String workShops;
}

@ -6,20 +6,25 @@ import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils;
import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog;
import com.chanko.yunxi.mes.module.biz.controller.admin.app.vo.OverTaskVO;
import com.chanko.yunxi.mes.module.biz.controller.admin.storage.vo.StoragePageReqVO;
import com.chanko.yunxi.mes.module.biz.controller.admin.storage.vo.StorageRespVO;
import com.chanko.yunxi.mes.module.biz.controller.admin.storage.vo.StorageSaveReqVO;
import com.chanko.yunxi.mes.module.biz.dal.dataobject.storage.StorageDO;
import com.chanko.yunxi.mes.module.biz.dal.dataobject.storagelog.StorageLogDO;
import com.chanko.yunxi.mes.module.biz.dal.dataobject.storagemat.StorageMatDO;
import com.chanko.yunxi.mes.module.biz.dal.dataobject.systemparameters.SystemParametersDO;
import com.chanko.yunxi.mes.module.biz.dal.mysql.systemparameters.SystemParametersMapper;
import com.chanko.yunxi.mes.module.biz.enums.StockTypeEnum;
import com.chanko.yunxi.mes.module.biz.enums.StorageStatusEnum;
import com.chanko.yunxi.mes.module.biz.enums.SystemParmetersEnum;
import com.chanko.yunxi.mes.module.biz.service.storage.StorageService;
import com.chanko.yunxi.mes.module.biz.service.storagelog.StorageLogService;
import com.chanko.yunxi.mes.module.biz.service.storagemat.StorageMatService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jodd.util.StringUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -142,4 +147,18 @@ public class StorageController {
BeanUtils.toBean(list, StorageRespVO.class));
}
@Resource
private SystemParametersMapper systemParametersMapper;
@GetMapping("/allow-over-stock")
@Operation(summary = "是否出库允许超库存发货")
public CommonResult<Boolean> allowOverStock(){
SystemParametersDO systemParametersDO = systemParametersMapper.selectOne("code", SystemParmetersEnum.NEGATIVE_INVENTORY_SWITCH.getDescription());
boolean isAllow = false;
if(systemParametersDO != null && systemParametersDO.getCurrentValue().equals("1")){
isAllow = true;
}
return success(isAllow);
}
}

Loading…
Cancel
Save