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