1
This commit is contained in:
parent
b957b5a688
commit
e40990ee77
|
|
@ -69,7 +69,6 @@ public class AppPmsController extends BaseController {
|
||||||
if (groupedByGoodsCode.values().stream().anyMatch(list -> list.size() > 1)) {
|
if (groupedByGoodsCode.values().stream().anyMatch(list -> list.size() > 1)) {
|
||||||
return error("物料编号不能重复");
|
return error("物料编号不能重复");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断数据是否缺失
|
// 判断数据是否缺失
|
||||||
for(PmsOrderInRequest orderInRequest : orderInRequestList) {
|
for(PmsOrderInRequest orderInRequest : orderInRequestList) {
|
||||||
if (StringUtils.isEmpty(orderInRequest.getGoodsId())
|
if (StringUtils.isEmpty(orderInRequest.getGoodsId())
|
||||||
|
|
@ -91,7 +90,7 @@ public class AppPmsController extends BaseController {
|
||||||
appPmsOrderIn.setGoodsCode(orderInRequest.getGoodsCode());
|
appPmsOrderIn.setGoodsCode(orderInRequest.getGoodsCode());
|
||||||
appPmsOrderIn.setCreateTime(new Date());
|
appPmsOrderIn.setCreateTime(new Date());
|
||||||
appPmsOrderIn.setUpdateTime(new Date());
|
appPmsOrderIn.setUpdateTime(new Date());
|
||||||
appPmsOrderIn.setCreateBy(getUsername());
|
appPmsOrderIn.setCreateBy("手动入库");
|
||||||
appPmsOrderIn.setRemark("手动入库通知");
|
appPmsOrderIn.setRemark("手动入库通知");
|
||||||
|
|
||||||
appPmsOrderInService.insertAppPmsOrderIn(appPmsOrderIn);
|
appPmsOrderInService.insertAppPmsOrderIn(appPmsOrderIn);
|
||||||
|
|
@ -100,6 +99,51 @@ public class AppPmsController extends BaseController {
|
||||||
return AjaxResult.success("success");
|
return AjaxResult.success("success");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 其他物料入库单请求
|
||||||
|
*/
|
||||||
|
@ApiOperation("其他物料入库单请求")
|
||||||
|
@Log(title = "其他物料入库单请求", skipAuth = true)
|
||||||
|
@PostMapping("/orderInOthers")
|
||||||
|
@Anonymous
|
||||||
|
public AjaxResult manualOrderInOthers(@RequestBody PmsOrderInRequest orderInRequest) {
|
||||||
|
logger.info("手动入库单请求:{}", JSONObject.toJSONString(orderInRequest));
|
||||||
|
// 判断数据是否缺失
|
||||||
|
if (StringUtils.isEmpty(orderInRequest.getGoodsId())
|
||||||
|
|| StringUtils.isEmpty(orderInRequest.getGoodsDesc())
|
||||||
|
|| orderInRequest.getGoodsNum() == null || orderInRequest.getGoodsNum() <=0) {
|
||||||
|
return error("缺少请求数据。");
|
||||||
|
}
|
||||||
|
// 构造入库单
|
||||||
|
AppPmsOrderIn appPmsOrderIn = getAppPmsOrderInOthers(orderInRequest);
|
||||||
|
int result = appPmsOrderInService.insertAppPmsOrderIn(appPmsOrderIn);
|
||||||
|
if (result <= 0) {
|
||||||
|
return error("创建入库单失败");
|
||||||
|
}
|
||||||
|
return AjaxResult.success("success",appPmsOrderIn);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static AppPmsOrderIn getAppPmsOrderInOthers(PmsOrderInRequest orderInRequest) {
|
||||||
|
AppPmsOrderIn appPmsOrderIn = new AppPmsOrderIn();
|
||||||
|
String orderId= OrderCodeFactory.getOrderCode("RK", "");
|
||||||
|
BeanUtils.copyProperties(orderInRequest, appPmsOrderIn);
|
||||||
|
appPmsOrderIn.setId(OrderCodeFactory.getOrderCode("",""));
|
||||||
|
appPmsOrderIn.setListId(orderId);
|
||||||
|
appPmsOrderIn.setOrderType(orderInRequest.getOrderType());
|
||||||
|
appPmsOrderIn.setOrderId(UUID.randomUUID().toString());
|
||||||
|
appPmsOrderIn.setGoodsNum(BigDecimal.valueOf(orderInRequest.getGoodsNum()));
|
||||||
|
appPmsOrderIn.setUsedNum(BigDecimal.ZERO);
|
||||||
|
appPmsOrderIn.setRemainingNum(BigDecimal.valueOf(orderInRequest.getGoodsNum()));
|
||||||
|
appPmsOrderIn.setOrderStatus(0);
|
||||||
|
appPmsOrderIn.setGoodsCode(orderInRequest.getGoodsCode());
|
||||||
|
appPmsOrderIn.setCreateTime(new Date());
|
||||||
|
appPmsOrderIn.setUpdateTime(new Date());
|
||||||
|
appPmsOrderIn.setCreateBy("其他物料入库");
|
||||||
|
appPmsOrderIn.setRemark("其他物料入库通知");
|
||||||
|
return appPmsOrderIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新手动入库单请求
|
* 更新手动入库单请求
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ public class SecurityConfig
|
||||||
requests.antMatchers("/login", "/register", "/captchaImage").permitAll()
|
requests.antMatchers("/login", "/register", "/captchaImage").permitAll()
|
||||||
// 静态资源,可匿名访问
|
// 静态资源,可匿名访问
|
||||||
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
||||||
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**","/app/pms/orderIn", "/app/pmsOrderOut/**", "/app/task/sendLocation", "/app/task/taskResult","/app/task/createOutRequest", "/system/storage/**", "/app/location/count/**", "/app/vehicle/**", "/app/goods/getGoodsInfoByCode/**").permitAll()
|
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**","/app/pms/orderIn", "/app/pmsOrderOut/**", "/app/task/sendLocation", "/app/task/taskResult","/app/task/createOutRequest", "/system/storage/**", "/app/location/count/**", "/app/vehicle/**", "/app/goods/getGoodsInfoByCode/**","/app/pms/**").permitAll()
|
||||||
// 除上面外的所有请求全部需要鉴权认证
|
// 除上面外的所有请求全部需要鉴权认证
|
||||||
.anyRequest().authenticated();
|
.anyRequest().authenticated();
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user