修改bug

This commit is contained in:
haozq 2024-11-15 10:38:25 +08:00
parent 9fceb1844f
commit 06f892ba7e
8 changed files with 83 additions and 24 deletions

View File

@ -84,7 +84,9 @@ public class PartApplyAppVo extends PageInfo {
/**
* 创建人
*/
private String creater;
private String creator;
@Excel(name = "联系电话", width = 10.0, orderNum = "4")
private String phone;

View File

@ -93,8 +93,8 @@ public class PartApplyAppServiceImp {
try{
Long userId= Objects.requireNonNull(UserUtil.getLoginUser()).getUserId();
String userName=UserUtil.getLoginUser().getUsername();
if(StringHelper.isEmpty(dto.getCreater())){
dto.setCreater(userId.toString());
if(StringHelper.isEmpty(dto.getCreator())){
dto.setCreator(userId.toString());
}
if(StringHelper.isEmpty(dto.getUserName())){
dto.setUserName(userName);

View File

@ -1,25 +1,28 @@
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.PaTypeVo;
import com.bonus.gzgqj.business.bases.entity.PartBackVo;
import com.bonus.gzgqj.business.bases.entity.PartCheckVo;
import com.bonus.gzgqj.business.bases.entity.ProjectInfoVo;
import com.bonus.gzgqj.business.bases.entity.*;
import com.bonus.gzgqj.business.bases.service.StatisticsServiceImpl;
import com.bonus.gzgqj.business.plan.entity.FileUploadVo;
import com.bonus.gzgqj.business.plan.entity.PlanApplyBeanPlanExport;
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.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -38,7 +41,7 @@ public class StatisticsController {
private StatisticsServiceImpl service;
/**
* 领料出库 查询
* 数据预览库存
* @return
*/
@GetMapping("getPaTypeStatistics")
@ -47,7 +50,7 @@ public class StatisticsController {
return ServerResponse.createSuccess(map);
}
/**
* 分页查询配件入库
* 库存统计分页查询
* @param dto
* @return
*/
@ -61,11 +64,37 @@ public class StatisticsController {
}
/**
* 导出需求计划
* @param
* @param
* @param
*/
@PostMapping("exportPaTypeList")
public void export(HttpServletRequest request, HttpServletResponse response, @RequestBody PaTypeVo dto) {
try {
List<PaTypeVo> 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 dto
* @return
*/
@ -81,7 +110,7 @@ public class StatisticsController {
/**
* 查询工程领用信息
* 工程统计详情查询
* @return
*/
@PostMapping("getProDetails")
@ -118,4 +147,15 @@ public class StatisticsController {
return pageInfo;
}
}

View File

@ -1,5 +1,6 @@
package com.bonus.gzgqj.business.bases.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
/**
@ -9,6 +10,10 @@ import lombok.Data;
@Data
public class PaTypeVo {
@Excel(name = "序号", width = 10.0, orderNum = "0")
private int xh;
private int id;
/**
* 父id
@ -17,6 +22,7 @@ public class PaTypeVo {
/**
* 名称
*/
@Excel(name = "配件名称", width = 10.0, orderNum = "3")
private String name;
/**
* 等级
@ -25,14 +31,17 @@ public class PaTypeVo {
/**
* 数量
*/
@Excel(name = "库存", width = 10.0, orderNum = "6")
private int num;
/**
* 价格
*/
@Excel(name = "单价", width = 10.0, orderNum = "7")
private String price;
/**
* 单位
*/
@Excel(name = "计量单位", width = 10.0, orderNum = "5")
private String unit;
/**
* 重量
@ -52,10 +61,12 @@ public class PaTypeVo {
/**
* 信号
*/
@Excel(name = "规格型号", width = 10.0, orderNum = "4")
private String model;
/**
* 类型
*/
@Excel(name = "配件类型", width = 10.0, orderNum = "2")
private String type;

View File

@ -46,7 +46,7 @@ public class PartCheckDetailsVo {
/**
* 配件类型
*/
@Excel(name = "单位", width = 10.0, orderNum = "5")
@Excel(name = "单位", width = 10.0, orderNum = "4")
private String partUnit;
private String remark;
@ -58,20 +58,23 @@ public class PartCheckDetailsVo {
/**
* 盘点前-库存数量
*/
@Excel(name = "库存量", width = 10.0, orderNum = "5")
@Excel(name = "库存量", width = 10.0, orderNum = "6")
private int num;
/**
* 盘盈
*/
@Excel(name = "盘盈量", width = 10.0, orderNum = "5")
@Excel(name = "盘盈量", width = 10.0, orderNum = "7")
private int addNum;
/**
* 盘亏
*/
@Excel(name = "盘亏量", width = 10.0, orderNum = "5")
@Excel(name = "盘亏量", width = 10.0, orderNum = "8")
private int subNum;
@Excel(name = "单价", width = 10.0, orderNum = "4")
@Excel(name = "单价", width = 10.0, orderNum = "9")
private String price;
@Excel(name = "金额", width = 10.0, orderNum = "10")
private String money;
}

View File

@ -191,7 +191,7 @@ public class PartApplyServiceImpl implements PartApplyService{
List<PartApplyDetailAppVo> details=mapper.getDetailsList(det);
String userName=UserUtil.getLoginUser().getUsername();
//出库数据 维护
userPartInfoService.insert(details,vo.getCreater(),vo.getUserName());
userPartInfoService.insert(details,vo.getCreator(),vo.getUserName());
details.forEach(detail->{
String partId=detail.getPartId();
int applyNum=detail.getApplyNum();

View File

@ -41,12 +41,13 @@ public class UserPartInfoServiceImpl {
user.setPartType(vo.getPartType());
user.setPartModel(vo.getPartModel());
user.setUserName(userName);
user.setPartUnit(vo.getPartUnit());
user.setLyNum(vo.getApplyNum());
user.setGhNum(0);
mapper.insertData(user);
}else{
info.setLyNum(info.getLyNum()+vo.getApplyNum());
mapper.updateData(user);
mapper.updateData(info);
}
}
}

View File

@ -60,8 +60,10 @@
</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,ppd.remark,
ppd.part_type partType, ppd.part_name partName, ppd.part_model partModel,ppd.part_unit partUnit
ppd.part_type partType, ppd.part_name partName, ppd.part_model partModel,ppd.part_unit partUnit,pt.price ,
(pt.price*ppd.apply_num ) money
from t_part_apply_details ppd
LEFT JOIN pa_type pt on pt.id=ppd.part_id
where ppd.apply_id=#{id}
<if test="partType!=null and partType !=''">
and ppd.part_type like concat('%',#{partType},'%')