This commit is contained in:
parent
8fddc51659
commit
2e0661fbd4
|
|
@ -62,4 +62,7 @@ public class PartApplyDetailAppVo {
|
|||
@Excel(name = "单价", width = 10.0, orderNum = "6")
|
||||
private String price;
|
||||
|
||||
@Excel(name = "备注", width = 10.0, orderNum = "9")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class PartApplyController {
|
|||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("getPartDetails")
|
||||
@GetMapping("getPartDetails")
|
||||
@DecryptAndVerify(decryptedClass = PartApplyAppVo.class)
|
||||
public ServerResponse getPartDetails(EncryptedReq<PartApplyAppVo> dto) {
|
||||
return service.getPartDetails(dto.getData());
|
||||
|
|
@ -145,15 +145,6 @@ public class PartApplyController {
|
|||
|
||||
|
||||
|
||||
/**
|
||||
* 图片文件上传
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("uploadImage")
|
||||
public ServerResponse uploadImage(HttpServletRequest request, @RequestParam("file[]") MultipartFile[] files) {
|
||||
return service.uploadImage(request,files);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -162,9 +153,8 @@ public class PartApplyController {
|
|||
* @return
|
||||
*/
|
||||
@PostMapping("partOutInfo")
|
||||
@DecryptAndVerify(decryptedClass = PartApplyAppVo.class)
|
||||
public ServerResponse partOutInfo(EncryptedReq<PartApplyAppVo> dto) {
|
||||
return service.partOutInfo(dto.getData());
|
||||
public ServerResponse partOutInfo(HttpServletRequest request, @RequestParam("file[]") MultipartFile[] files) {
|
||||
return service.partOutInfo(request,files);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,32 @@
|
|||
package com.bonus.gzgqj.business.bases.controller;
|
||||
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyAppVo;
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.PartBackDetailsVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.PartBackVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.UserPatypeInfo;
|
||||
import com.bonus.gzgqj.business.bases.service.PartBackService;
|
||||
import com.bonus.gzgqj.business.plan.entity.PlanApplyBeanPlanExport;
|
||||
import com.bonus.gzgqj.business.plan.entity.PlanDataDetailBean;
|
||||
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.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -88,6 +98,62 @@ public class PartBackController {
|
|||
return pageInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出需求计划
|
||||
* @param
|
||||
* @param
|
||||
* @param
|
||||
*/
|
||||
@PostMapping("export")
|
||||
public void export(HttpServletRequest request, HttpServletResponse response, @RequestBody PartBackVo dto) {
|
||||
try {
|
||||
List<PartBackVo> list = service.findByPage(dto);;
|
||||
final int[] num = {1};
|
||||
list.forEach(vo->{
|
||||
vo.setXh(num[0]);
|
||||
num[0]++;
|
||||
});
|
||||
ExportParams exportParams = new ExportParams("配件入库", "配件入库", ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, PlanApplyBeanPlanExport.class, list);
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("配件入库" + ".xlsx", "UTF-8"));
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 导出需求计划详情
|
||||
* @param request
|
||||
* @param response
|
||||
* @param
|
||||
*/
|
||||
@PostMapping("exportDetail")
|
||||
public void exportDetail(HttpServletRequest request, HttpServletResponse response,@RequestBody PartBackVo dto) {
|
||||
try {
|
||||
List<PartBackDetailsVo> list = service.getInfoDetailsList(dto);;
|
||||
final int[] num = {1};
|
||||
list.forEach(vo->{
|
||||
vo.setXh(num[0]);
|
||||
num[0]++;
|
||||
});
|
||||
ExportParams exportParams = new ExportParams("配件入库明细", "配件入库明细", ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, PlanDataDetailBean.class, list);
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("配件入库明细" + ".xlsx", "UTF-8"));
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询配件类型
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.gzgqj.business.bases.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
|
|
@ -8,6 +9,11 @@ import lombok.Data;
|
|||
*/
|
||||
@Data
|
||||
public class PartBackDetailsVo {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@Excel(name = "序号", width = 10.0, orderNum = "0")
|
||||
private int xh;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
|
|
@ -18,6 +24,7 @@ public class PartBackDetailsVo {
|
|||
/**
|
||||
* 回退
|
||||
*/
|
||||
@Excel(name = "退库数量", width = 10.0, orderNum = "5")
|
||||
private int backNum;
|
||||
|
||||
|
||||
|
|
@ -28,23 +35,29 @@ public class PartBackDetailsVo {
|
|||
/**
|
||||
* 配件类型
|
||||
*/
|
||||
@Excel(name = "配件类型", width = 10.0, orderNum = "1")
|
||||
private String partType;
|
||||
/**
|
||||
* 配件名称
|
||||
*/
|
||||
@Excel(name = "配件名称", width = 10.0, orderNum = "2")
|
||||
private String partName;
|
||||
|
||||
/**
|
||||
* 配件类型
|
||||
*/
|
||||
@Excel(name = "规格型号", width = 10.0, orderNum = "3")
|
||||
private String partModel;
|
||||
|
||||
/**
|
||||
* 配件类型
|
||||
*/
|
||||
@Excel(name = "单位", width = 10.0, orderNum = "4")
|
||||
private String partUnit;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
||||
@Excel(name = "备注", width = 10.0, orderNum = "6")
|
||||
private String remark;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.gzgqj.business.bases.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.bonus.gzgqj.business.plan.entity.FileUploadVo;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -12,13 +13,22 @@ import java.util.List;
|
|||
*/
|
||||
@Data
|
||||
public class PartBackVo {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@Excel(name = "序号", width = 10.0, orderNum = "0")
|
||||
private int xh;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
|
||||
private String id;
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
@Excel(name = "退料单编号", width = 10.0, orderNum = "1")
|
||||
private String code;
|
||||
/**
|
||||
* 回退人
|
||||
|
|
@ -27,6 +37,7 @@ public class PartBackVo {
|
|||
/**
|
||||
* 回退人名称
|
||||
*/
|
||||
@Excel(name = "退料人", width = 10.0, orderNum = "4")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
|
|
@ -36,6 +47,7 @@ public class PartBackVo {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Excel(name = "退料时间", width = 10.0, orderNum = "5")
|
||||
private String createTime;
|
||||
/**
|
||||
* 创建人
|
||||
|
|
@ -48,6 +60,7 @@ public class PartBackVo {
|
|||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注", width = 10.0, orderNum = "7")
|
||||
private String remark;
|
||||
|
||||
private String type;
|
||||
|
|
@ -55,6 +68,9 @@ public class PartBackVo {
|
|||
* 关键字
|
||||
*/
|
||||
private String keyWord;
|
||||
|
||||
@Excel(name = "联系电话", width = 10.0, orderNum = "6")
|
||||
private String phone;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
|
|
@ -63,7 +79,7 @@ public class PartBackVo {
|
|||
* 结束时间
|
||||
*/
|
||||
private String endDay;
|
||||
|
||||
@Excel(name = "退料数量", width = 10.0, orderNum = "2")
|
||||
private int backNum;
|
||||
/**
|
||||
* 详情集合
|
||||
|
|
|
|||
|
|
@ -34,20 +34,14 @@ public interface PartApplyService {
|
|||
*/
|
||||
ServerResponse auditData(PartApplyAppVo data);
|
||||
|
||||
/**
|
||||
* 图片文件上传
|
||||
* @param request
|
||||
* @param files
|
||||
* @return
|
||||
*/
|
||||
ServerResponse uploadImage(HttpServletRequest request, MultipartFile[] files);
|
||||
|
||||
|
||||
/**
|
||||
* 出库
|
||||
* @param data
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
ServerResponse partOutInfo(PartApplyAppVo data);
|
||||
ServerResponse partOutInfo(HttpServletRequest request, MultipartFile[] files );
|
||||
|
||||
/**
|
||||
* 分页查询详情
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.gzgqj.business.bases.service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyAppVo;
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.AuditRecord;
|
||||
|
|
@ -141,15 +142,20 @@ public class PartApplyServiceImpl implements PartApplyService{
|
|||
return ServerResponse.createErroe("审核失败");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 上传图片
|
||||
* 出库-接口
|
||||
* @param request
|
||||
* @param files
|
||||
* @return
|
||||
*/
|
||||
public ServerResponse uploadImage(HttpServletRequest request, MultipartFile[] files) {
|
||||
@Override
|
||||
public ServerResponse partOutInfo(HttpServletRequest request, MultipartFile[] files) {
|
||||
List<PartApplyAppVo> list=new ArrayList<>();
|
||||
try{
|
||||
String id=request.getParameter("params");
|
||||
String param=request.getParameter("params");
|
||||
PartApplyAppVo data= JSON.parseObject(param,PartApplyAppVo.class);
|
||||
String id=data.getId();
|
||||
if(StringHelper.isEmpty(id)){
|
||||
return ServerResponse.createErroe("请选择出库记录");
|
||||
}
|
||||
|
|
@ -157,27 +163,10 @@ public class PartApplyServiceImpl implements PartApplyService{
|
|||
return ServerResponse.createErroe("请先上传文件");
|
||||
}
|
||||
List<FileUploadVo> fileList=uploadService.uploadImage(files,id,"t_part_apply","出库附件");
|
||||
if(StringUtils.isEmpty(fileList) || fileList.size()!=files.length){
|
||||
return ServerResponse.createErroe("文件上传成功");
|
||||
if(fileList.size()!=files.length){
|
||||
return ServerResponse.createErroe("出库失败");
|
||||
}
|
||||
return ServerResponse.createSuccess("文件上传成功","文件上传成功");
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("文件上传失败");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库-接口
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse partOutInfo(PartApplyAppVo data) {
|
||||
List<PartApplyAppVo> list=new ArrayList<>();
|
||||
try{
|
||||
String id=data.getId();
|
||||
PartApplyAppVo vo=mapper.getAuditStatus(data);
|
||||
if(!"2".equals(vo.getStatus())){
|
||||
return ServerResponse.createSuccess("该数据状态已变更,请刷新数据重试");
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@
|
|||
<!--差人申请详情-->
|
||||
<insert id="insertDetails">
|
||||
insert into t_part_apply_details(
|
||||
apply_id, part_id, apply_num,
|
||||
apply_id, part_id, apply_num,remark,
|
||||
part_type, part_name, part_model,part_unit ) values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{param.id},#{item.partId},#{item.applyNum},
|
||||
(#{param.id},#{item.partId},#{item.applyNum},#{item.remark},
|
||||
#{item.partType},#{item.partName},#{item.partModel},#{item.partUnit})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
|
|
|||
|
|
@ -59,10 +59,19 @@
|
|||
where tpa.id=#{id}
|
||||
</select>
|
||||
<select id="getDetailsList" resultType="com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo">
|
||||
select ppd.id,ppd.apply_id applyId, ppd.part_id partId, ppd.apply_num applyNum,
|
||||
select ppd.id,ppd.apply_id applyId, ppd.part_id partId, ppd.apply_num applyNum,ppd.remark,
|
||||
ppd.part_type partType, ppd.part_name partName, ppd.part_model partModel,ppd.part_unit partUnit
|
||||
from t_part_apply_details ppd
|
||||
where ppd.apply_id=#{id}
|
||||
<if test="partType!=null and partType !=''">
|
||||
and ppd.part_type like concat('%',#{partType},'%')
|
||||
</if>
|
||||
<if test="partName!=null and partName !=''">
|
||||
and ppd.part_name like concat('%',#{partName},'%')
|
||||
</if>
|
||||
<if test="partModel!=null and partModel !=''">
|
||||
and ppd.part_model like concat('%',#{partModel},'%')
|
||||
</if>
|
||||
</select>
|
||||
<!--审核状态-->
|
||||
<select id="getAuditStatus" resultType="com.bonus.gzgqj.business.app.entity.PartApplyAppVo">
|
||||
|
|
|
|||
|
|
@ -76,6 +76,15 @@
|
|||
part_name partName, part_model partModel, part_unit partUnit, remark
|
||||
FROM t_part_back_details
|
||||
WHERE back_id=#{id}
|
||||
<if test="partType!=null and partType !=''">
|
||||
and part_type like concat('%',#{partType},'%')
|
||||
</if>
|
||||
<if test="partName!=null and partName !=''">
|
||||
and part_name like concat('%',#{partName},'%')
|
||||
</if>
|
||||
<if test="partModel!=null and partModel !=''">
|
||||
and part_model like concat('%',#{partModel},'%')
|
||||
</if>
|
||||
</select>
|
||||
<select id="getInfoDetails" resultType="com.bonus.gzgqj.business.bases.entity.PartBackVo">
|
||||
select tpb.id, tpb.code, tpb.creator,pu.TELPHONE phone ,tpb.back_num backNum,tpb.user_name userName
|
||||
|
|
|
|||
Loading…
Reference in New Issue