发货 流程
This commit is contained in:
parent
c365b3a5f9
commit
8c0baa7280
|
|
@ -12,7 +12,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
|
|||
/**
|
||||
* @author 黑子
|
||||
*/
|
||||
@MapperScan({"com.bonus.gzgqj.*.*.dao", "com.bonus.gzgqj.*.dao"})
|
||||
@MapperScan({"com.bonus.gzgqj.**.dao", "com.bonus.gzgqj.**.mapper"})
|
||||
@SpringBootApplication(exclude={MongoAutoConfiguration.class})
|
||||
@EnableAsync
|
||||
public class SpringBootSecurityApplication implements CommandLineRunner {
|
||||
|
|
@ -20,7 +20,7 @@ public class SpringBootSecurityApplication implements CommandLineRunner {
|
|||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SpringBootSecurityApplication.class, args);
|
||||
System.err.println("智能安全带实时监测启动成功!");
|
||||
System.err.println("贵州机具后台管理系统启动成功!");
|
||||
}
|
||||
|
||||
@Async
|
||||
|
|
|
|||
|
|
@ -0,0 +1,90 @@
|
|||
package com.bonus.gzgqj.business.plan.controller;
|
||||
|
||||
import com.bonus.gzgqj.business.plan.entity.ProDevSelect;
|
||||
import com.bonus.gzgqj.business.plan.entity.ProNeedInfo;
|
||||
import com.bonus.gzgqj.business.plan.entity.ProPlanInfoVo;
|
||||
import com.bonus.gzgqj.business.plan.service.PlanOutService;
|
||||
import com.bonus.gzgqj.manager.annotation.DecryptAndVerify;
|
||||
import com.bonus.gzgqj.manager.core.entity.EncryptedReq;
|
||||
import com.bonus.gzgqj.manager.webResult.ServerResponse;
|
||||
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.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 出库 控制层
|
||||
*
|
||||
|
||||
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/backstage/planOut")
|
||||
@Slf4j
|
||||
public class PlanOutController {
|
||||
|
||||
@Autowired
|
||||
private PlanOutService service;
|
||||
|
||||
/**
|
||||
* 数据详情分页接口
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("getProPlanPage")
|
||||
@DecryptAndVerify(decryptedClass = ProPlanInfoVo.class)
|
||||
public PageInfo<ProPlanInfoVo> getProPlanPage(EncryptedReq<ProPlanInfoVo> dto) {
|
||||
PageHelper.startPage(dto.getData().getPageNum(),dto.getData().getPageSize());
|
||||
PageInfo<ProPlanInfoVo> pageInfo = service.getProPlanPage(dto.getData());;
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发货查询接口
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("getPorInfoDetail")
|
||||
@DecryptAndVerify(decryptedClass = ProNeedInfo.class)
|
||||
public PageInfo<ProNeedInfo> getPorInfoDetail(EncryptedReq<ProNeedInfo> dto) {
|
||||
PageHelper.startPage(dto.getData().getPageNum(),dto.getData().getPageSize());
|
||||
PageInfo<ProNeedInfo> pageInfo = service.getPorInfoDetail(dto.getData());;
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询下拉选
|
||||
* -一级+二级
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("getProDevSelected")
|
||||
@DecryptAndVerify(decryptedClass = ProDevSelect.class)
|
||||
public ServerResponse getProDevSelected(EncryptedReq<ProDevSelect> dto) {
|
||||
return service.getProDevSelected(dto.getData());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发货接口
|
||||
* -一级+二级
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("insertProOutPutInfo")
|
||||
public ServerResponse insertProOutPutInfo(HttpServletRequest request, @RequestParam("file[]") MultipartFile[] files) {
|
||||
return service.insertProOutPutInfo(request,files);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.bonus.gzgqj.business.plan.entity;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PageInfo {
|
||||
|
||||
|
||||
private Integer pageNum;
|
||||
|
||||
private Integer pageSize;
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.bonus.gzgqj.business.plan.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import org.omg.CORBA.PRIVATE_MEMBER;
|
||||
|
||||
@Data
|
||||
public class ProAddInfoDetails {
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 型号
|
||||
*/
|
||||
private String module;
|
||||
/**
|
||||
* 类型id
|
||||
*/
|
||||
private String moduleId;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 发货数量
|
||||
*/
|
||||
private int fhNum;
|
||||
/**
|
||||
* 所需数量
|
||||
*/
|
||||
private int needNum;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String needType;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.bonus.gzgqj.business.plan.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import org.omg.CORBA.PRIVATE_MEMBER;
|
||||
|
||||
@Data
|
||||
public class ProDevSelect {
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String pId;
|
||||
|
||||
private String pName;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String ppName;
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
private String num;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String proId;
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package com.bonus.gzgqj.business.plan.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 工程需要数据
|
||||
*/
|
||||
@Data
|
||||
public class ProNeedInfo extends PageInfo {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private String proId;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String module;
|
||||
/**
|
||||
* 规格id
|
||||
*/
|
||||
private String moduleId;
|
||||
/**
|
||||
* 需求类型 1计划 2新增
|
||||
*/
|
||||
private String needType;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 需要数量
|
||||
*/
|
||||
private int needNum;
|
||||
/**
|
||||
* 发货数量
|
||||
*/
|
||||
private int fhNum;
|
||||
/**
|
||||
* 调整量
|
||||
*/
|
||||
private int tzNum;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remarks;
|
||||
/**
|
||||
* 差额
|
||||
*/
|
||||
private String diff;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String outId;
|
||||
|
||||
/**
|
||||
* 数据源 1 计划 2 新增
|
||||
*/
|
||||
private String dataType;
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.bonus.gzgqj.business.plan.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class ProOutDetail {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 发货数量
|
||||
*/
|
||||
private int fhNum;
|
||||
/**
|
||||
* 挺住数量
|
||||
*/
|
||||
private int tzNum;
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private String proId;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remarks;
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.bonus.gzgqj.business.plan.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 出货 实体类
|
||||
*/
|
||||
@Data
|
||||
public class ProOutInfoVo {
|
||||
|
||||
|
||||
private String id;
|
||||
/**
|
||||
* 发货人
|
||||
*/
|
||||
private String userName;
|
||||
/**
|
||||
* 发货时间
|
||||
*/
|
||||
private String createDay;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remarks;
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private String proId;
|
||||
/**
|
||||
* 出货集合
|
||||
*/
|
||||
private List<ProOutDetail> list;
|
||||
/**
|
||||
* 新增数据集合
|
||||
*/
|
||||
private List<ProAddInfoDetails> addList;
|
||||
|
||||
private String creater;
|
||||
|
||||
private String createUser;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.bonus.gzgqj.business.plan.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProPlanInfoVo extends PageInfo {
|
||||
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private String proId;
|
||||
|
||||
/**
|
||||
* 计划 量
|
||||
*/
|
||||
private int planNum;
|
||||
/**
|
||||
* 出库单量
|
||||
*/
|
||||
private int recordNum;
|
||||
|
||||
/**
|
||||
* 需用数量
|
||||
*/
|
||||
private int needNum;
|
||||
/**
|
||||
* 出库量
|
||||
*/
|
||||
private int outNum;
|
||||
|
||||
/**
|
||||
* 出库量
|
||||
*/
|
||||
private int tzNum;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private int status;
|
||||
/**
|
||||
* 最后发货时间
|
||||
*/
|
||||
private String lastDay;
|
||||
|
||||
/**
|
||||
* 进度
|
||||
*/
|
||||
private String progress;
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
private String proName;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
package com.bonus.gzgqj.business.plan.mapper;
|
||||
|
||||
import com.bonus.gzgqj.business.plan.entity.*;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface PlanOutMapper {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<ProPlanInfoVo> getProPlanPage(ProPlanInfoVo data);
|
||||
|
||||
/**
|
||||
* 分页查询工程 发货信息
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<ProNeedInfo> getPorInfoDetail(ProNeedInfo data);
|
||||
|
||||
/**
|
||||
* 下拉选
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<ProDevSelect> getProDevSelected(ProDevSelect data);
|
||||
|
||||
/**
|
||||
* 二级下拉选
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<ProDevSelect> getDevChilderList(ProDevSelect data);
|
||||
|
||||
/**
|
||||
* 新增出库 记录
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
int insertProOutInfo(ProOutInfoVo vo);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param details
|
||||
* @return
|
||||
*/
|
||||
ProNeedInfo getProNeedInfo(ProOutDetail details);
|
||||
|
||||
/**
|
||||
* 删除树
|
||||
* @param vo
|
||||
*/
|
||||
void deleteProOut(ProOutInfoVo vo);
|
||||
|
||||
/**
|
||||
* 插入 计划数据
|
||||
* @param data
|
||||
*/
|
||||
int insertProNeedDetails(ProNeedInfo data);
|
||||
|
||||
/**
|
||||
* 更新 工程 -计划-发货
|
||||
* @param data
|
||||
*/
|
||||
void updateNeedInfo(ProNeedInfo data);
|
||||
|
||||
/**
|
||||
* 插入工程-计划-发货-信息
|
||||
* @param insertObj
|
||||
*/
|
||||
void addNeedInfo(ProNeedInfo insertObj);
|
||||
|
||||
/**
|
||||
* 查询 工程统计 表
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
ProPlanInfoVo getProPlanInfo(ProOutInfoVo vo);
|
||||
|
||||
/**
|
||||
* 更新 工程-计划-统计数据
|
||||
* @param data
|
||||
*/
|
||||
void updatePriPlanInfo(ProPlanInfoVo data);
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.bonus.gzgqj.business.plan.service;
|
||||
|
||||
import com.bonus.gzgqj.business.plan.entity.ProDevSelect;
|
||||
import com.bonus.gzgqj.business.plan.entity.ProNeedInfo;
|
||||
import com.bonus.gzgqj.business.plan.entity.ProPlanInfoVo;
|
||||
import com.bonus.gzgqj.manager.webResult.ServerResponse;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public interface PlanOutService {
|
||||
/**
|
||||
* 分页查询工程分页接口
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
PageInfo<ProPlanInfoVo> getProPlanPage(ProPlanInfoVo data);
|
||||
|
||||
/**
|
||||
* 分页查询工程发货信息
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
PageInfo<ProNeedInfo> getPorInfoDetail(ProNeedInfo data);
|
||||
|
||||
/**
|
||||
* 查询工程下拉选
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
ServerResponse getProDevSelected(ProDevSelect data);
|
||||
|
||||
/**
|
||||
* 出货接口
|
||||
* @param request
|
||||
* @param files
|
||||
* @return
|
||||
*/
|
||||
ServerResponse insertProOutPutInfo(HttpServletRequest request, MultipartFile[] files);
|
||||
}
|
||||
|
|
@ -0,0 +1,216 @@
|
|||
package com.bonus.gzgqj.business.plan.service;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.bonus.gzgqj.business.plan.entity.*;
|
||||
import com.bonus.gzgqj.business.plan.mapper.PlanOutMapper;
|
||||
import com.bonus.gzgqj.manager.common.util.R;
|
||||
import com.bonus.gzgqj.manager.common.util.SecurityUtils;
|
||||
import com.bonus.gzgqj.manager.common.util.StringHelper;
|
||||
import com.bonus.gzgqj.manager.common.util.StringUtils;
|
||||
import com.bonus.gzgqj.manager.webResult.ServerResponse;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.omg.CORBA.INTERNAL;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PlanOutServiceImpl implements PlanOutService{
|
||||
|
||||
@Autowired
|
||||
private PlanOutMapper mapper;
|
||||
/**
|
||||
* 查询工程需要的系那个
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public PageInfo<ProPlanInfoVo> getProPlanPage(ProPlanInfoVo data) {
|
||||
List<ProPlanInfoVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getProPlanPage(data);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
PageInfo<ProPlanInfoVo> pageInfo = new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询 工程 发货详情
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public PageInfo<ProNeedInfo> getPorInfoDetail(ProNeedInfo data) {
|
||||
List<ProNeedInfo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getPorInfoDetail(data);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
PageInfo<ProNeedInfo> pageInfo = new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 拆线呢 工程设备下拉选
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse getProDevSelected(ProDevSelect data) {
|
||||
List<ProDevSelect> list = new ArrayList<>();
|
||||
try {
|
||||
if(StringHelper.isEmpty(data.getPId())) {
|
||||
list = mapper.getProDevSelected(data);
|
||||
}else{
|
||||
list = mapper.getDevChilderList(data);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createSuccess(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 出货接口开发
|
||||
* @param request
|
||||
* @param files
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse insertProOutPutInfo(HttpServletRequest request, MultipartFile[] files) {
|
||||
try {
|
||||
String params=request.getParameter("params");
|
||||
//数据 转化
|
||||
ProOutInfoVo vo= JSON.parseObject(params,ProOutInfoVo.class);
|
||||
if(StringHelper.isEmpty(vo.getUserName())){
|
||||
return ServerResponse.createErroe("请填写发货人");
|
||||
}
|
||||
if(StringHelper.isEmpty(vo.getCreateDay())){
|
||||
return ServerResponse.createErroe("请填写发货时间");
|
||||
}
|
||||
if(files==null || files.length<=0){
|
||||
return ServerResponse.createErroe("未上传出货单");
|
||||
}
|
||||
List<ProOutDetail> list=vo.getList();
|
||||
if(CollectionUtil.isEmpty(list)){
|
||||
return ServerResponse.createErroe("请填写出货数量");
|
||||
}
|
||||
List<ProAddInfoDetails> addList=vo.getAddList();
|
||||
long userId= SecurityUtils.getUserId();
|
||||
String userName=SecurityUtils.getUsername();
|
||||
System.err.println("us===="+userId+"========="+userName);
|
||||
//出库记录单存储
|
||||
vo.setCreater(userId+"");
|
||||
int num=mapper.insertProOutInfo(vo);
|
||||
if(num>0){
|
||||
//计算 本次全部发货数量及整改数量 最后同步到 工程 -计划-发货统计表中
|
||||
int allFhNum=0;
|
||||
int allTzNum=0;
|
||||
for (ProOutDetail details:list){
|
||||
allFhNum=allFhNum+details.getFhNum();
|
||||
allTzNum=allTzNum+details.getTzNum();
|
||||
//获取 计划数据
|
||||
ProNeedInfo data=mapper.getProNeedInfo(details);
|
||||
if(data==null){
|
||||
mapper.deleteProOut(vo);
|
||||
return ServerResponse.createErroe("未找到发货内容,发货失败");
|
||||
}else{
|
||||
ProNeedInfo insertObj=new ProNeedInfo();
|
||||
BeanUtils.copyProperties(insertObj,data);
|
||||
insertObj.setOutId(vo.getId());
|
||||
insertObj.setDataType("1");
|
||||
insertObj.setFhNum(details.getFhNum());
|
||||
insertObj.setTzNum(details.getTzNum());
|
||||
insertObj.setRemarks(details.getRemarks());
|
||||
int num2=mapper.insertProNeedDetails(insertObj);
|
||||
if(num2>=0){
|
||||
//更新 工程-计划-发货 清单表
|
||||
int fhNum=data.getFhNum();
|
||||
int tzNum=data.getFhNum();
|
||||
data.setRemarks(details.getRemarks());
|
||||
int fhNum2=details.getFhNum();
|
||||
int tzNum2=details.getFhNum();
|
||||
data.setFhNum(fhNum+fhNum2);
|
||||
data.setTzNum(tzNum+tzNum2);
|
||||
mapper.updateNeedInfo(data);
|
||||
}else {
|
||||
return ServerResponse.createErroe("发货失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
//是否有 新增
|
||||
if(StringUtils.isNotEmpty(addList)){
|
||||
//全部新增发货清单
|
||||
for (ProAddInfoDetails details:addList){
|
||||
allFhNum=allFhNum+details.getFhNum();
|
||||
ProNeedInfo insertObj=new ProNeedInfo();
|
||||
insertObj.setOutId(vo.getId());
|
||||
insertObj.setDataType("1");
|
||||
insertObj.setFhNum(details.getFhNum());
|
||||
insertObj.setTzNum(0);
|
||||
insertObj.setType(details.getType());
|
||||
insertObj.setName(details.getName());
|
||||
insertObj.setModule(details.getModule());
|
||||
insertObj.setModuleId(details.getModuleId());
|
||||
insertObj.setUnit(details.getUnit());
|
||||
insertObj.setRemarks(details.getRemark());
|
||||
insertObj.setDataType("2");
|
||||
insertObj.setProId(vo.getProId());
|
||||
//添加 记录清单
|
||||
int num2=mapper.insertProNeedDetails(insertObj);
|
||||
if(num2>=0){
|
||||
//新增 工程-计划-发货 清单表
|
||||
mapper.addNeedInfo(insertObj);
|
||||
}else {
|
||||
return ServerResponse.createErroe("发货失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
//更新工程 总数据信息
|
||||
ProPlanInfoVo data= mapper.getProPlanInfo(vo);
|
||||
int recordNum=data.getRecordNum();
|
||||
int outNum= data.getOutNum();
|
||||
int needNum= data.getNeedNum();
|
||||
recordNum=recordNum+1;
|
||||
outNum=outNum+allFhNum;
|
||||
data.setRecordNum(recordNum);
|
||||
//发货数量
|
||||
data.setOutNum(outNum);
|
||||
//调整数量
|
||||
data.setTzNum(allTzNum);
|
||||
//更新 发货状态
|
||||
if(needNum>outNum+allTzNum){
|
||||
data.setStatus(1);
|
||||
}else {
|
||||
data.setStatus(2);
|
||||
}
|
||||
data.setLastDay(vo.getCreateDay());
|
||||
//更新 工程-计划 -统计表
|
||||
mapper.updatePriPlanInfo(data);
|
||||
|
||||
}else {
|
||||
return ServerResponse.createErroe("发货失败");
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createSuccess();
|
||||
}
|
||||
}
|
||||
|
|
@ -36,6 +36,8 @@ public class DecryptAndVerifyAspect {
|
|||
if (encryptedReq == null) {
|
||||
// throw new DecryptAndVerifyException(joinPoint.getSignature().getName() + ",参数中无待解密类");
|
||||
}
|
||||
|
||||
|
||||
String decryptedData = decryptAndVerify(encryptedReq);
|
||||
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
|
||||
DecryptAndVerify annotation = methodSignature.getMethod().getAnnotation(DecryptAndVerify.class);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,97 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.gzgqj.business.plan.mapper.PlanOutMapper">
|
||||
<insert id="insertProOutInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_plan_out( pro_id, consignor, shipment_date, remarks, create_time, create_day, creater
|
||||
)VALUES (#{proId},#{userName},#{createDay},#{remarks},now(),CURRENT_DATE,#{creater})
|
||||
</insert>
|
||||
<insert id="insertProNeedDetails">
|
||||
insert into t_plan_out_detail(
|
||||
out_id, type, name, module, unit, module_id, fh_num, tz_num, remarks, data_type )values (
|
||||
#{outId},#{type},#{name},#{module},#{unit},#{moduleId},#{fhNum},#{tzNum},#{remarks},#{dataType} )
|
||||
</insert>
|
||||
<insert id="addNeedInfo">
|
||||
insert into t_pro_need_info (
|
||||
pro_id, type, name, module, module_id, need_type, unit, need_num, fh_num, tz_num, remarks
|
||||
) values (#{proId},#{type},#{name},#{module},#{moduleId},#{needType},#{unit},#{needNum},#{fhNum},#{tzNum},#{remarks})
|
||||
</insert>
|
||||
<update id="updateNeedInfo">
|
||||
update t_pro_need_info set fh_num=#{fhNum} ,tz_num=#{tzNum},remarks=#{remarks}
|
||||
where id=#{id}
|
||||
</update>
|
||||
<!--更新 统计数量-->
|
||||
<update id="updatePriPlanInfo">
|
||||
update t_pro_plan_info set record_num=#{recordNum},out_num=#{outNum},tz_num=#{tzNum},last_day=#{lastDay},
|
||||
status=#{status}
|
||||
where pro_id=#{proId}
|
||||
</update>
|
||||
<delete id="deleteProOut">
|
||||
delete from t_plan_out where id=#{id}
|
||||
</delete>
|
||||
|
||||
<select id="getProPlanPage" resultType="com.bonus.gzgqj.business.plan.entity.ProPlanInfoVo">
|
||||
select
|
||||
ppi.pro_id proId, ppi.need_num needNum,pro.`NAME` proName,tz_num,
|
||||
ppi.plan_num planNum,ppi.record_num recordNum,
|
||||
ppi.out_num outNum, ppi.status,IFNULL((out_num+tz_num)*100/need_num ,0) progress,
|
||||
ppi.last_day lastDay
|
||||
from t_pro_plan_info ppi
|
||||
LEFT JOIN bm_project pro on ppi.pro_id=pro.id
|
||||
<where>
|
||||
<if test="status!=null and status!=''">
|
||||
and ppi.status=#{status}
|
||||
</if>
|
||||
<if test="proName!=null and proName!=''">
|
||||
and pro.`NAME` like concat('%',#{proName},'%')
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
<select id="getPorInfoDetail" resultType="com.bonus.gzgqj.business.plan.entity.ProNeedInfo">
|
||||
select pni.id,pni.pro_id proId,pni.type,pni.name,pni.module,pni.module_id,pni.need_type needType,
|
||||
IFNULL(pni.unit,'-') unit ,pni.need_num needNum ,pni.fh_num fhNum ,pro.`NAME` proName ,IF(pni.need_num-pni.fh_num<0,0,pni.need_num-pni.fh_num) diff
|
||||
from t_pro_need_info pni
|
||||
LEFT JOIN bm_project pro on pni.pro_id=pro.id
|
||||
<where>
|
||||
<if test="module!=null and module!=''">
|
||||
and pni.`module` like concat('%',#{module},'%')
|
||||
</if>
|
||||
<if test="name!=null and name!=''">
|
||||
and pni.`name` like concat('%',#{name},'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getProDevSelected" resultType="com.bonus.gzgqj.business.plan.entity.ProDevSelect">
|
||||
select distinct mt.id ,mt.`NAME`,mt.parent_id
|
||||
from mm_type mt
|
||||
where mt.`LEVEL`=3 and mt.IS_ACTIVE=1
|
||||
</select>
|
||||
<select id="getDevChilderList" resultType="com.bonus.gzgqj.business.plan.entity.ProDevSelect">
|
||||
select distinct mt.id ,mt.`NAME`,mt.parent_id pId,mt.UNIT,mt.NUM,mt1.`NAME` pName,mt2.`NAME` ppName
|
||||
from mm_type mt
|
||||
LEFT JOIN mm_type mt1 on mt.PARENT_ID=mt1.id and mt.`LEVEL`=4 and mt1.`LEVEL`=3 and mt1.IS_ACTIVE=1
|
||||
LEFT JOIN mm_type mt2 on mt1.PARENT_ID=mt2.id and mt1.`LEVEL`=3 and mt2.IS_ACTIVE=1
|
||||
LEFT JOIN t_pro_need_info pni on pni.module_id=mt.id
|
||||
where mt.`LEVEL`=4 and mt.IS_ACTIVE=1 and pni.id is null
|
||||
and pni.pro_id=#{proId} and mt.parent_id=#{pId}
|
||||
</select>
|
||||
<select id="getProNeedInfo" resultType="com.bonus.gzgqj.business.plan.entity.ProNeedInfo">
|
||||
select id, pro_id proId,type, name,
|
||||
module,module_id moduleId,need_type needType,unit,need_num needNum,fh_num fhNum
|
||||
,tz_num tzNum,remarks
|
||||
from t_pro_need_info
|
||||
WHERE id=#{id}
|
||||
</select>
|
||||
<select id="getProPlanInfo" resultType="com.bonus.gzgqj.business.plan.entity.ProPlanInfoVo">
|
||||
select
|
||||
ppi.pro_id proId, ppi.need_num needNum,
|
||||
ppi.plan_num planNum,ppi.record_num recordNum,
|
||||
ppi.out_num outNum, ppi.status,
|
||||
ppi.last_day lastDay
|
||||
from t_pro_plan_info ppi
|
||||
where ppi.pro_id=#{proId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue