配件批量审核
This commit is contained in:
parent
f815734fda
commit
8a283c3bfa
|
|
@ -13,12 +13,15 @@ import java.util.List;
|
||||||
* @author 黑子
|
* @author 黑子
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class PartApplyAppVo extends PageInfo {
|
|
||||||
|
public class PartApplyAppVo extends PageInfo implements java.io.Serializable {
|
||||||
|
|
||||||
@Excel(name = "序号", width = 10.0, orderNum = "0")
|
@Excel(name = "序号", width = 10.0, orderNum = "0")
|
||||||
private int xh;
|
private int xh;
|
||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
|
private List<String> idList;
|
||||||
/**
|
/**
|
||||||
* 编码
|
* 编码
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.bonus.gzgqj.business.bases.controller;
|
||||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.bonus.gzgqj.business.app.entity.PartApplyAppVo;
|
import com.bonus.gzgqj.business.app.entity.PartApplyAppVo;
|
||||||
import com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo;
|
import com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo;
|
||||||
import com.bonus.gzgqj.business.bases.entity.PartInputDetails;
|
import com.bonus.gzgqj.business.bases.entity.PartInputDetails;
|
||||||
|
|
@ -36,6 +37,7 @@ import java.util.List;
|
||||||
@RequestMapping("/backstage/partApply")
|
@RequestMapping("/backstage/partApply")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class PartApplyController {
|
public class PartApplyController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PartApplyService service;
|
private PartApplyService service;
|
||||||
|
|
||||||
|
|
@ -62,6 +64,7 @@ public class PartApplyController {
|
||||||
public ServerResponse getPartDetails(EncryptedReq<PartApplyAppVo> dto) {
|
public ServerResponse getPartDetails(EncryptedReq<PartApplyAppVo> dto) {
|
||||||
return service.getPartDetails(dto.getData());
|
return service.getPartDetails(dto.getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 领料出库 查询
|
* 领料出库 查询
|
||||||
* @param dto
|
* @param dto
|
||||||
|
|
@ -75,6 +78,7 @@ public class PartApplyController {
|
||||||
PageInfo<PartApplyDetailAppVo> pageInfo = new PageInfo<>(list);
|
PageInfo<PartApplyDetailAppVo> pageInfo = new PageInfo<>(list);
|
||||||
return pageInfo;
|
return pageInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出需求计划
|
* 导出需求计划
|
||||||
* @param
|
* @param
|
||||||
|
|
@ -102,6 +106,7 @@ public class PartApplyController {
|
||||||
log.error(e.toString(), e);
|
log.error(e.toString(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出需求计划详情
|
* 导出需求计划详情
|
||||||
* @param request
|
* @param request
|
||||||
|
|
@ -131,7 +136,6 @@ public class PartApplyController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据审核
|
* 数据审核
|
||||||
* @param dto
|
* @param dto
|
||||||
|
|
@ -143,7 +147,21 @@ public class PartApplyController {
|
||||||
return service.auditData(dto.getData());
|
return service.auditData(dto.getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据审核--批量审核
|
||||||
|
*/
|
||||||
|
@PostMapping("batchAudit")
|
||||||
|
@DecryptAndVerify(decryptedClass = PartApplyAppVo.class)
|
||||||
|
public ServerResponse batchAudit(EncryptedReq<PartApplyAppVo> dto) {
|
||||||
|
PartApplyAppVo data = dto.getData();
|
||||||
|
ServerResponse serverResponse = null;
|
||||||
|
for (String id : data.getIdList()) {
|
||||||
|
PartApplyAppVo cloned = ObjectUtil.cloneByStream(data);
|
||||||
|
cloned.setId(id);
|
||||||
|
serverResponse = service.auditData(cloned);
|
||||||
|
}
|
||||||
|
return serverResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,23 +28,38 @@ import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配件管理 入库
|
* 配件管理 入库
|
||||||
|
*
|
||||||
* @author 黑子
|
* @author 黑子
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class PartApplyServiceImpl implements PartApplyService {
|
public class PartApplyServiceImpl implements PartApplyService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
UserPartInfoServiceImpl userPartInfoService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private PartApplyMapper mapper;
|
private PartApplyMapper mapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private FileUploadService uploadService;
|
private FileUploadService uploadService;
|
||||||
|
|
||||||
@Autowired
|
public static String transBast64(String url) {
|
||||||
UserPartInfoServiceImpl userPartInfoService;
|
try {
|
||||||
|
if (StringHelper.isEmpty(url)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
Path path = Paths.get(url);
|
||||||
|
byte[] fileBytes = Files.readAllBytes(path);
|
||||||
|
return Base64.getEncoder().encodeToString(fileBytes);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.toString(), e);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 申请记录列表查询
|
* 申请记录列表查询
|
||||||
|
*
|
||||||
* @param data
|
* @param data
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -61,6 +76,7 @@ public class PartApplyServiceImpl implements PartApplyService{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询申请记录详情
|
* 查询申请记录详情
|
||||||
|
*
|
||||||
* @param data
|
* @param data
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -91,6 +107,7 @@ public class PartApplyServiceImpl implements PartApplyService{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询申请记录详情
|
* 查询申请记录详情
|
||||||
|
*
|
||||||
* @param data
|
* @param data
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -102,11 +119,12 @@ public class PartApplyServiceImpl implements PartApplyService{
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.toString(), e);
|
log.error(e.toString(), e);
|
||||||
}
|
}
|
||||||
return new ArrayList<PartApplyDetailAppVo>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 审核 数据
|
* 审核 数据
|
||||||
|
*
|
||||||
* @param data
|
* @param data
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -142,10 +160,9 @@ public class PartApplyServiceImpl implements PartApplyService{
|
||||||
return ServerResponse.createErroe("审核失败");
|
return ServerResponse.createErroe("审核失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 出库-接口
|
* 出库-接口
|
||||||
|
*
|
||||||
* @param request
|
* @param request
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -213,24 +230,4 @@ public class PartApplyServiceImpl implements PartApplyService{
|
||||||
return ServerResponse.createErroe("出库失败");
|
return ServerResponse.createErroe("出库失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String transBast64(String url){
|
|
||||||
try{
|
|
||||||
if(StringHelper.isEmpty(url)){
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
Path path = Paths.get(url);
|
|
||||||
byte[] fileBytes = Files.readAllBytes(path);
|
|
||||||
return Base64.getEncoder().encodeToString(fileBytes);
|
|
||||||
}catch (Exception e){
|
|
||||||
log.error(e.toString(),e);
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
System.err.println(transBast64("D:\\files\\zg_gqj\\20241109\\173113057456537938315.jpg"));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -212,10 +212,10 @@ public class PlanApplicationServiceImp implements PlanApplicationService {
|
||||||
Row row = sheet.getRow(i);
|
Row row = sheet.getRow(i);
|
||||||
PlanDevBean data = new PlanDevBean();
|
PlanDevBean data = new PlanDevBean();
|
||||||
// 获取全部列的值
|
// 获取全部列的值
|
||||||
data.setPpName(row.getCell(1).getStringCellValue()); //物资类型
|
data.setPpName(row.getCell(1).getStringCellValue().trim()); //物资类型
|
||||||
data.setpName(row.getCell(2).getStringCellValue()); //物资名称
|
data.setpName(row.getCell(2).getStringCellValue().trim()); //物资名称
|
||||||
data.setName(row.getCell(3).getStringCellValue()); //物资型号
|
data.setName(row.getCell(3).getStringCellValue().trim()); //物资型号
|
||||||
data.setUnit(row.getCell(4).getStringCellValue()); //单位
|
data.setUnit(row.getCell(4).getStringCellValue().trim()); //单位
|
||||||
data.setNeedNum((int)row.getCell(5).getNumericCellValue()); //数量
|
data.setNeedNum((int)row.getCell(5).getNumericCellValue()); //数量
|
||||||
// data.setTimes(row.getCell(6).getStringCellValue()); //时间
|
// data.setTimes(row.getCell(6).getStringCellValue()); //时间
|
||||||
Cell cell = row.getCell(6); // 假设时间是在第7列(0-based index 6)
|
Cell cell = row.getCell(6); // 假设时间是在第7列(0-based index 6)
|
||||||
|
|
@ -255,7 +255,7 @@ public class PlanApplicationServiceImp implements PlanApplicationService {
|
||||||
workbook.close();
|
workbook.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(dataList!=null && !dataList.isEmpty()){
|
if (!dataList.isEmpty()) {
|
||||||
for (PlanDevBean planDevBean : dataList) {
|
for (PlanDevBean planDevBean : dataList) {
|
||||||
//根据物资类型,物资名称,物资型号 去数据库查询是否存在
|
//根据物资类型,物资名称,物资型号 去数据库查询是否存在
|
||||||
PlanDevBean bean = dao.getExist(planDevBean);
|
PlanDevBean bean = dao.getExist(planDevBean);
|
||||||
|
|
@ -268,7 +268,8 @@ public class PlanApplicationServiceImp implements PlanApplicationService {
|
||||||
}
|
}
|
||||||
// 如果存在数据库中不存在的数据,返回提示
|
// 如果存在数据库中不存在的数据,返回提示
|
||||||
if (!nonExistList.isEmpty()) {
|
if (!nonExistList.isEmpty()) {
|
||||||
return ServerResponse.createError("导入失败,以下数据在数据库中不存在", nonExistList);
|
return ServerResponse.createSuccess("导入成功,有部分物资不存在", dataList);
|
||||||
|
// return ServerResponse.createError("导入失败,以下数据在数据库中不存在", nonExistList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ServerResponse.createSuccess("导入成功", dataList);
|
return ServerResponse.createSuccess("导入成功", dataList);
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,6 @@
|
||||||
LEFT JOIN mm_type mt1 on mt.PARENT_ID=mt1.id and mt1.IS_ACTIVE=1
|
LEFT JOIN mm_type mt1 on mt.PARENT_ID=mt1.id and mt1.IS_ACTIVE=1
|
||||||
LEFT JOIN mm_type mt2 on mt1.PARENT_ID=mt2.id and mt2.IS_ACTIVE=1
|
LEFT JOIN mm_type mt2 on mt1.PARENT_ID=mt2.id and mt2.IS_ACTIVE=1
|
||||||
WHERE mt.IS_ACTIVE=1
|
WHERE mt.IS_ACTIVE=1
|
||||||
and mt.IS_LABEL=1
|
|
||||||
and mt2.`NAME` = #{param.ppName}
|
and mt2.`NAME` = #{param.ppName}
|
||||||
and mt1.`NAME` = #{param.pName}
|
and mt1.`NAME` = #{param.pName}
|
||||||
and mt.`NAME` = #{param.name}
|
and mt.`NAME` = #{param.name}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue