修改校验位置
This commit is contained in:
parent
1025a26f3e
commit
dac30f4d99
|
|
@ -52,6 +52,10 @@ public class InvoicingApi {
|
|||
@AutoLog(value = "采购单-采购信息-添加",clientType="app", operateType = 2)
|
||||
@PostMapping(value = "/addShoppingCartList")
|
||||
public Result<String> addShoppingCartList(@RequestBody List<QgdInfoEntity> infoList) {
|
||||
Map<String, Object> pddMap = invoicingApi.queryPddStartInfo(null);
|
||||
if(!toBoolean(pddMap.get("success"))){
|
||||
return Result.error(pddMap.get("message").toString());
|
||||
}
|
||||
Integer maxCount = 100;//购物车最大数量
|
||||
String result = invoicingApi.addShoppingCartList(infoList,maxCount);
|
||||
if("1".equals( result)){
|
||||
|
|
@ -72,6 +76,10 @@ public class InvoicingApi {
|
|||
@AutoLog(value = "采购单-修改购物车采购信息",clientType="app", operateType = 3)
|
||||
@PostMapping(value = "/eddShoppingCartList")
|
||||
public Result<String> eddShoppingCartList(@RequestBody QgdInfoEntity qgdInfoEntity) {
|
||||
Map<String, Object> pddMap = invoicingApi.queryPddStartInfo(null);
|
||||
if(!toBoolean(pddMap.get("success"))){
|
||||
return Result.error(pddMap.get("message").toString());
|
||||
}
|
||||
String result = invoicingApi.eddShoppingCartList(qgdInfoEntity);
|
||||
if("1".equals( result)){
|
||||
return Result.error("采购信息已存在,不可重复采购!");
|
||||
|
|
@ -85,6 +93,10 @@ public class InvoicingApi {
|
|||
@AutoLog(value = "采购单-生成采购单预览信息",clientType="app")
|
||||
@PostMapping(value = "/generatedPurchaseViewOrder")
|
||||
public Result<Object> generatedPurchaseViewOrder(@RequestBody List<QgdInfoEntity> infoList, HttpServletRequest req) {
|
||||
Map<String, Object> pddMap = invoicingApi.queryPddStartInfo(null);
|
||||
if(!toBoolean(pddMap.get("success"))){
|
||||
return Result.error(pddMap.get("message").toString());
|
||||
}
|
||||
Map<String,Object> list = invoicingApi.generatedPurchaseViewOrder(infoList);
|
||||
if(list.get("status").equals("2")){
|
||||
return Result.error(list.get("errorMessage").toString());
|
||||
|
|
@ -95,6 +107,11 @@ public class InvoicingApi {
|
|||
@AutoLog(value = "采购单-生成采购单信息",clientType="app",operateType = 2)
|
||||
@PostMapping(value = "/generatedPurchaseOrder")
|
||||
public Result<List<CgdMainEntity>> generatedPurchaserder(@RequestBody List<CgdMainEntity> cgdMainList, HttpServletRequest req) {
|
||||
|
||||
Map<String, Object> pddMap = invoicingApi.queryPddStartInfo(null);
|
||||
if(!toBoolean(pddMap.get("success"))){
|
||||
return Result.error(pddMap.get("message").toString());
|
||||
}
|
||||
List<CgdMainEntity> list = invoicingApi.generatedPurchaserder(cgdMainList);
|
||||
return Result.OK("操作成功");
|
||||
}
|
||||
|
|
@ -335,6 +352,10 @@ public class InvoicingApi {
|
|||
@AutoLog(value = "采购单-库存预警添加全部物料",clientType="app", operateType = 2)
|
||||
@PostMapping(value = "/addWaringAll")
|
||||
public Result<String> addWaringAll(@RequestBody CgdInfoEntity cgdInfoEntityDto) {
|
||||
Map<String, Object> pddMap = invoicingApi.queryPddStartInfo(null);
|
||||
if(!toBoolean(pddMap.get("success"))){
|
||||
return Result.error(pddMap.get("message").toString());
|
||||
}
|
||||
if(StringUtils.isEmpty(cgdInfoEntityDto.getNuId())){
|
||||
return Result.error("请选择仓库");
|
||||
}
|
||||
|
|
@ -353,6 +374,10 @@ public class InvoicingApi {
|
|||
@AutoLog(value = "采购单-拣货物料",clientType="app", operateType = 2)
|
||||
@PostMapping(value = "/pickingInfo")
|
||||
public Result<Map<String,Object>> pickingInfo(@RequestBody CgdInfoEntity cgdInfoEntityDto) {
|
||||
Map<String, Object> pddMap = invoicingApi.queryPddStartInfo(null);
|
||||
if(!toBoolean(pddMap.get("success"))){
|
||||
return Result.error(pddMap.get("message").toString());
|
||||
}
|
||||
Map<String,Object> result = invoicingApi.pickingInfo(cgdInfoEntityDto);
|
||||
if(StringUtils.equals("2",result.get("status").toString())){
|
||||
return Result.error("入库数量错误,超过采购数量");
|
||||
|
|
@ -367,6 +392,10 @@ public class InvoicingApi {
|
|||
@AutoLog(value = "采购单-改价",clientType="app", operateType = 3)
|
||||
@PostMapping(value = "/editPrice")
|
||||
public Result<Map<String,String>> editPrice(@RequestBody CgdInfoEntity cgdInfoEntityDto) {
|
||||
Map<String, Object> pddMap = invoicingApi.queryPddStartInfo(null);
|
||||
if(!toBoolean(pddMap.get("success"))){
|
||||
return Result.error(pddMap.get("message").toString());
|
||||
}
|
||||
Map<String,String> result = invoicingApi.editPrice(cgdInfoEntityDto);
|
||||
// if(StringUtils.equals("2",result)){
|
||||
// return Result.error("入库数量错误,超过采购数量");
|
||||
|
|
@ -447,4 +476,12 @@ public class InvoicingApi {
|
|||
Map<String, Object> pageList = invoicingApi.queryCrkInfoNumList(pageNo, pageSize, crkInfoEntity,req);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
public static boolean toBoolean(Object obj) {
|
||||
if (obj != null && !(Boolean) obj) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,4 +89,6 @@ public interface IInvoicingApi {
|
|||
IPage<WarehouseMaterialCrkInfoEntity> queryCrkInfoList(Integer pageNo, Integer pageSize, WarehouseMaterialCrkInfoEntity crkInfoEntity, HttpServletRequest req);
|
||||
|
||||
Map<String, Object> queryCrkInfoNumList(Integer pageNo, Integer pageSize, WarehouseMaterialCrkInfoEntity crkInfoEntity, HttpServletRequest req);
|
||||
|
||||
Map<String, Object> queryPddStartInfo(Object o);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import io.swagger.models.auth.In;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
|
|
@ -187,10 +188,6 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
@Override
|
||||
public Map<String,Object> generatedPurchaseViewOrder(List<QgdInfoEntity> infoEntityList) {
|
||||
|
||||
Map<String, Object> pddMap = pddApi.queryPddStartInfo(null);
|
||||
if(!toBoolean(pddMap.get("success"))){
|
||||
throw new IllegalArgumentException(pddMap.get("message").toString());
|
||||
}
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
|
|
@ -358,17 +355,9 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
|
||||
}
|
||||
|
||||
public static boolean toBoolean(Object obj) {
|
||||
Boolean result = toBoolean(obj);
|
||||
return result != null ? result : true;
|
||||
}
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<CgdMainEntity> generatedPurchaserder(List<CgdMainEntity> cgdMainList) {
|
||||
Map<String, Object> pddMap = pddApi.queryPddStartInfo(null);
|
||||
if(!toBoolean(pddMap.get("success"))){
|
||||
throw new IllegalArgumentException(pddMap.get("message").toString());
|
||||
}
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String qgdDate = new SimpleDateFormat("yyyyMMdd").format(new Date());
|
||||
|
|
@ -570,10 +559,6 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
|
||||
@Override
|
||||
public String voidedCgdMain(CgdMainEntity cgdMainEntity) {
|
||||
Map<String, Object> pddMap = pddApi.queryPddStartInfo(null);
|
||||
if(!toBoolean(pddMap.get("success"))){
|
||||
throw new IllegalArgumentException(pddMap.get("message").toString());
|
||||
}
|
||||
NuInvoicingCgdMain cgdMainPar = baseMapper.selectById(cgdMainEntity.getId());
|
||||
if (!"0".equals(cgdMainPar.getStatus())){
|
||||
//不是待入库状态,不可进行作废操作,请刷新页面
|
||||
|
|
@ -697,11 +682,6 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
|
||||
@Override
|
||||
public String addShoppingCartList(List<QgdInfoEntity> infoList,Integer maxCount) {
|
||||
|
||||
Map<String, Object> pddMap = pddApi.queryPddStartInfo(null);
|
||||
if(!toBoolean(pddMap.get("success"))){
|
||||
throw new IllegalArgumentException(pddMap.get("message").toString());
|
||||
}
|
||||
String nuId = infoList.get(0).getNuId();
|
||||
if(StringUtils.isEmpty(nuId)){
|
||||
return "3";//护理单元为空
|
||||
|
|
@ -780,10 +760,6 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
}
|
||||
@Override
|
||||
public String eddShoppingCartList(QgdInfoEntity info) {
|
||||
Map<String, Object> pddMap = pddApi.queryPddStartInfo(null);
|
||||
if(!toBoolean(pddMap.get("success"))){
|
||||
throw new IllegalArgumentException(pddMap.get("message").toString());
|
||||
}
|
||||
QgdInfo qgdInfo = new QgdInfo();
|
||||
BeanUtils.copyProperties(info,qgdInfo);
|
||||
|
||||
|
|
@ -936,12 +912,6 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
|
||||
@Override
|
||||
public String addWaringAll(CgdInfoEntity cgdInfoEntityDto, Integer maxCount) {
|
||||
|
||||
Map<String, Object> pddMap = pddApi.queryPddStartInfo(null);
|
||||
if(!toBoolean(pddMap.get("success"))){
|
||||
throw new IllegalArgumentException(pddMap.get("message").toString());
|
||||
}
|
||||
|
||||
List<QgdInfo> listqg = qgdInfoMapper.selectList(new QueryWrapper<QgdInfo>().eq("nu_id",cgdInfoEntityDto.getNuId()));
|
||||
if(listqg.size()>=maxCount){
|
||||
return "4";//购物车最大数量为100,请购数量超出限制
|
||||
|
|
@ -1051,10 +1021,6 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String,Object> pickingInfo(CgdInfoEntity cgdInfoEntityDto) {
|
||||
Map<String, Object> pddMap = pddApi.queryPddStartInfo(null);
|
||||
if(!toBoolean(pddMap.get("success"))){
|
||||
throw new IllegalArgumentException(pddMap.get("message").toString());
|
||||
}
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if(loginUser == null || StringUtils.isBlank(loginUser.getRealname())){
|
||||
|
|
@ -1245,10 +1211,6 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
|
||||
@Override
|
||||
public Map<String,String> editPrice(CgdInfoEntity cgdInfoEntityDto) {
|
||||
Map<String, Object> pddMap = pddApi.queryPddStartInfo(null);
|
||||
if(!toBoolean(pddMap.get("success"))){
|
||||
throw new IllegalArgumentException(pddMap.get("message").toString());
|
||||
}
|
||||
Map<String,String> map = new HashMap<>();
|
||||
NuInvoicingCgdInfo cgdInfo = new NuInvoicingCgdInfo();
|
||||
cgdInfo.setId(cgdInfoEntityDto.getId());
|
||||
|
|
@ -1434,4 +1396,9 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryPddStartInfo(Object o) {
|
||||
return pddApi.queryPddStartInfo(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue