发货 流程
This commit is contained in:
parent
580e4d573d
commit
8205c8eaa7
|
|
@ -11,10 +11,7 @@ import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
@ -33,12 +30,22 @@ public class PlanOutController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private PlanOutService service;
|
private PlanOutService service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发货 统计查询
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("getStatistics")
|
||||||
|
public ServerResponse getStatistics(HttpServletRequest request) {
|
||||||
|
return service.getStatistics();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据详情分页接口
|
* 数据详情分页接口
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("getProPlanPage")
|
@GetMapping("getProPlanPage")
|
||||||
@DecryptAndVerify(decryptedClass = ProPlanInfoVo.class)
|
@DecryptAndVerify(decryptedClass = ProPlanInfoVo.class)
|
||||||
public PageInfo<ProPlanInfoVo> getProPlanPage(EncryptedReq<ProPlanInfoVo> dto) {
|
public PageInfo<ProPlanInfoVo> getProPlanPage(EncryptedReq<ProPlanInfoVo> dto) {
|
||||||
PageHelper.startPage(dto.getData().getPageNum(),dto.getData().getPageSize());
|
PageHelper.startPage(dto.getData().getPageNum(),dto.getData().getPageSize());
|
||||||
|
|
@ -51,7 +58,7 @@ public class PlanOutController {
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("getPorInfoDetail")
|
@GetMapping("getPorInfoDetail")
|
||||||
@DecryptAndVerify(decryptedClass = ProNeedInfo.class)
|
@DecryptAndVerify(decryptedClass = ProNeedInfo.class)
|
||||||
public PageInfo<ProNeedInfo> getPorInfoDetail(EncryptedReq<ProNeedInfo> dto) {
|
public PageInfo<ProNeedInfo> getPorInfoDetail(EncryptedReq<ProNeedInfo> dto) {
|
||||||
PageHelper.startPage(dto.getData().getPageNum(),dto.getData().getPageSize());
|
PageHelper.startPage(dto.getData().getPageNum(),dto.getData().getPageSize());
|
||||||
|
|
@ -66,17 +73,14 @@ public class PlanOutController {
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("getProDevSelected")
|
@GetMapping("getProDevSelected")
|
||||||
@DecryptAndVerify(decryptedClass = ProDevSelect.class)
|
@DecryptAndVerify(decryptedClass = ProDevSelect.class)
|
||||||
public ServerResponse getProDevSelected(EncryptedReq<ProDevSelect> dto) {
|
public ServerResponse getProDevSelected(EncryptedReq<ProDevSelect> dto) {
|
||||||
return service.getProDevSelected(dto.getData());
|
return service.getProDevSelected(dto.getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发货接口
|
* 发货接口
|
||||||
* -一级+二级
|
|
||||||
* @param
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("insertProOutPutInfo")
|
@PostMapping("insertProOutPutInfo")
|
||||||
|
|
@ -87,4 +91,5 @@ public class PlanOutController {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
||||||
@Data
|
@Data
|
||||||
public class ProPlanInfoVo extends PageInfo {
|
public class ProPlanInfoVo extends PageInfo {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工程id
|
* 工程id
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -38,4 +38,10 @@ public interface PlanOutService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
ServerResponse insertProOutPutInfo(HttpServletRequest request, MultipartFile[] files);
|
ServerResponse insertProOutPutInfo(HttpServletRequest request, MultipartFile[] files);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询统计信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ServerResponse getStatistics();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import com.bonus.gzgqj.business.utils.SystemUtils;
|
||||||
import com.bonus.gzgqj.manager.common.util.*;
|
import com.bonus.gzgqj.manager.common.util.*;
|
||||||
import com.bonus.gzgqj.manager.webResult.ServerResponse;
|
import com.bonus.gzgqj.manager.webResult.ServerResponse;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.ListUtils;
|
import org.apache.commons.collections4.ListUtils;
|
||||||
|
|
@ -26,7 +27,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
|
@ -133,8 +134,9 @@ public class PlanOutServiceImpl implements PlanOutService{
|
||||||
//计算 本次全部发货数量及整改数量 最后同步到 工程 -计划-发货统计表中
|
//计算 本次全部发货数量及整改数量 最后同步到 工程 -计划-发货统计表中
|
||||||
int allFhNum=0;
|
int allFhNum=0;
|
||||||
int allTzNum=0;
|
int allTzNum=0;
|
||||||
|
int excNum=0;
|
||||||
//处理 发货单
|
//处理 发货单
|
||||||
boolean a= planOutInfo(list,vo,allFhNum,allTzNum);
|
boolean a= planOutInfo(list,vo,allFhNum,allTzNum,excNum);
|
||||||
if(!a){
|
if(!a){
|
||||||
return ServerResponse.createErroe("发货失败");
|
return ServerResponse.createErroe("发货失败");
|
||||||
}
|
}
|
||||||
|
|
@ -158,7 +160,21 @@ public class PlanOutServiceImpl implements PlanOutService{
|
||||||
return ServerResponse.createSuccess();
|
return ServerResponse.createSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean planOutInfo(List<ProOutDetail> list,ProOutInfoVo vo,int allFhNum, int allTzNum){
|
@Override
|
||||||
|
public ServerResponse getStatistics() {
|
||||||
|
try{
|
||||||
|
Map<String,String> map= Maps.newHashMap();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error(e.toString(),e);
|
||||||
|
}
|
||||||
|
return ServerResponse.createSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean planOutInfo(List<ProOutDetail> list,ProOutInfoVo vo,int allFhNum, int allTzNum,int excNum){
|
||||||
try {
|
try {
|
||||||
for (ProOutDetail details:list){
|
for (ProOutDetail details:list){
|
||||||
allFhNum=allFhNum+details.getFhNum();
|
allFhNum=allFhNum+details.getFhNum();
|
||||||
|
|
@ -169,6 +185,10 @@ public class PlanOutServiceImpl implements PlanOutService{
|
||||||
mapper.deleteProOut(vo);
|
mapper.deleteProOut(vo);
|
||||||
return false;
|
return false;
|
||||||
}else{
|
}else{
|
||||||
|
//需要的数量
|
||||||
|
int needNum=data.getNeedNum();
|
||||||
|
|
||||||
|
|
||||||
ProNeedInfo insertObj=new ProNeedInfo();
|
ProNeedInfo insertObj=new ProNeedInfo();
|
||||||
BeanUtils.copyProperties(insertObj,data);
|
BeanUtils.copyProperties(insertObj,data);
|
||||||
insertObj.setOutId(vo.getId());
|
insertObj.setOutId(vo.getId());
|
||||||
|
|
|
||||||
|
|
@ -31,11 +31,16 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
|
||||||
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException, IOException, ServletException {
|
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException, IOException, ServletException {
|
||||||
//获取token
|
//获取token
|
||||||
String jwtToken = SecurityUtils.getToken(request);
|
String jwtToken = SecurityUtils.getToken(request);
|
||||||
if (!StringUtils.hasText(jwtToken)) {
|
String uri=request.getRequestURI();
|
||||||
//放行
|
System.err.println(uri);
|
||||||
|
if("/login/userLogin".equals(uri)){
|
||||||
filterChain.doFilter(request, response);
|
filterChain.doFilter(request, response);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(StringUtils.isEmpty(jwtToken)){
|
||||||
|
ResultUtil.responseJson(response,ResultUtil.resultCode(401,"请先登录"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
//解析token
|
//解析token
|
||||||
try {
|
try {
|
||||||
Claims claims = JwtUtils.parseToken(jwtToken);
|
Claims claims = JwtUtils.parseToken(jwtToken);
|
||||||
|
|
@ -48,16 +53,13 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
|
||||||
ResultUtil.responseJson(response,ResultUtil.resultCode(401,"请先登录"));
|
ResultUtil.responseJson(response,ResultUtil.resultCode(401,"请先登录"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// SelfUserEntity loginUser = tokenService.getLoginUser(request);
|
SelfUserEntity loginUser = tokenService.getLoginUser(request);
|
||||||
SelfUserEntity loginUser = new SelfUserEntity();
|
|
||||||
loginUser.setUserId(1L);
|
|
||||||
loginUser.setUsername("!Admin");
|
|
||||||
if(Objects.isNull(loginUser)){
|
if(Objects.isNull(loginUser)){
|
||||||
ResultUtil.responseJson(response,ResultUtil.resultCode(401,"登录过期,请重新登录"));
|
ResultUtil.responseJson(response,ResultUtil.resultCode(401,"登录过期,请重新登录"));
|
||||||
return;
|
return;
|
||||||
}else{
|
}else{
|
||||||
// 验证令牌有效期,相差不足10分钟,自动刷新缓存
|
// 验证令牌有效期,相差不足10分钟,自动刷新缓存
|
||||||
// tokenService.verifyToken(loginUser);
|
tokenService.verifyToken(loginUser);
|
||||||
//存入SecurityContextHolder
|
//存入SecurityContextHolder
|
||||||
//TODO 获取权限信息封装到Authentication中
|
//TODO 获取权限信息封装到Authentication中
|
||||||
UsernamePasswordAuthenticationToken authenticationToken =
|
UsernamePasswordAuthenticationToken authenticationToken =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue