新增工程领退及差缺台账查询与导出功能,优化部分字段非空校验,新增自定义Redis序列化器支持
This commit is contained in:
parent
0aa7264a61
commit
1bb27209ee
|
|
@ -3,6 +3,7 @@ package com.bonus.aqgqj.business.backstage.controller.inventory;
|
|||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import com.bonus.aqgqj.business.backstage.entity.ProjectMaterialLedger;
|
||||
import com.bonus.aqgqj.business.backstage.entity.inventory.InventoryCountVo;
|
||||
import com.bonus.aqgqj.business.backstage.service.inventory.InventoryCountService;
|
||||
import com.bonus.aqgqj.manager.annotation.DecryptAndVerify;
|
||||
|
|
@ -37,6 +38,44 @@ public class InventoryCountController {
|
|||
@Resource(name = "InventoryCountService")
|
||||
private InventoryCountService service;
|
||||
|
||||
/**
|
||||
* 查询工程领退及差缺台账
|
||||
* @param dto query参数
|
||||
* @return PageInfo<ProjectMaterialLedger>
|
||||
*/
|
||||
@GetMapping("queryLedgerListByProjectAndModel")
|
||||
@DecryptAndVerify(decryptedClass = ProjectMaterialLedger.class)
|
||||
public PageInfo<ProjectMaterialLedger> queryLedgerListByProjectAndModel(EncryptedReq<ProjectMaterialLedger> dto) {
|
||||
List<ProjectMaterialLedger> projectMaterialLedgers = service.queryLedgerListByProjectAndModel(dto.getData());
|
||||
return new PageInfo<>(projectMaterialLedgers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工程领退及差缺台账导出方法
|
||||
*/
|
||||
@GetMapping("exportLedgerListByProjectAndModel")
|
||||
@DecryptAndVerify(decryptedClass = ProjectMaterialLedger.class)
|
||||
public void exportLedgerListByProjectAndModel(HttpServletResponse response, EncryptedReq<ProjectMaterialLedger> dto) {
|
||||
try {
|
||||
List<ProjectMaterialLedger> list = service.queryLedgerListByProjectAndModel(dto.getData());
|
||||
final int[] num = {1};
|
||||
list.forEach(vo -> {
|
||||
vo.setId(num[0]);
|
||||
num[0]++;
|
||||
});
|
||||
ExportParams exportParams = new ExportParams("工程领退及差缺台账", "工程领退及差缺台账", ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, ProjectMaterialLedger.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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 库存统计列表
|
||||
*
|
||||
|
|
|
|||
|
|
@ -195,6 +195,9 @@ public class PlanApplyController {
|
|||
num[0]++;
|
||||
});
|
||||
ExportParams exportParams = new ExportParams("安全工器具明细", "安全工器具明细", ExcelType.XSSF);
|
||||
if (!list.isEmpty()) {
|
||||
exportParams = new ExportParams(list.get(0).getProjectName() + "--安全工器具明细", "安全工器具明细", ExcelType.XSSF);
|
||||
}
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, PlanDetailVo.class, list);
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("安全工器具明细" + ".xlsx", "UTF-8"));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,102 @@
|
|||
package com.bonus.aqgqj.business.backstage.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author : 阮世耀
|
||||
* @version : 1.0
|
||||
* @PackagePath: com.bonus.aqgqj.business.backstage.entity
|
||||
* @CreateTime: 2025-05-24 17:05
|
||||
* @Description: 工程物资台账
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProjectMaterialLedger {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private Integer proId;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
@Excel(name = "工程名称", width = 70)
|
||||
private String proName;
|
||||
|
||||
/**
|
||||
* 领用单位
|
||||
*/
|
||||
private String leaseUnit;
|
||||
|
||||
/**
|
||||
* 物资类型、名称、规格型号
|
||||
*/
|
||||
@Excel(name = "物资类型", width = 18)
|
||||
private String type;
|
||||
|
||||
@Excel(name = "物资名称", width = 18)
|
||||
private String name;
|
||||
|
||||
@Excel(name = "规格型号", width = 18)
|
||||
private String model;
|
||||
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 物资规格型号id
|
||||
*/
|
||||
private Integer modelId;
|
||||
|
||||
/**
|
||||
* 需用数量
|
||||
*/
|
||||
@Excel(name = "需用数量", width = 16)
|
||||
private Double needNum = 0.00;
|
||||
|
||||
/**
|
||||
* 采购量--出库
|
||||
*/
|
||||
@Excel(name = "采购量", width = 16)
|
||||
private Double totalCg = 0.00;
|
||||
|
||||
/**
|
||||
* 利库量--出库
|
||||
*/
|
||||
@Excel(name = "利库量", width = 16)
|
||||
private Double totalLk = 0.00;
|
||||
|
||||
/**
|
||||
* 出库量--出库
|
||||
*/
|
||||
@Excel(name = "出库量", width = 16)
|
||||
private Double totalCk = 0.00;
|
||||
|
||||
/**
|
||||
* 退货量--退库
|
||||
*/
|
||||
@Excel(name = "退货量", width = 16)
|
||||
private Double totalBack = 0.00;
|
||||
|
||||
/**
|
||||
* 差缺量
|
||||
*/
|
||||
@Excel(name = "差缺量", width = 16)
|
||||
private Double totalDiff = 0.00;
|
||||
|
||||
/**
|
||||
* 差缺状态 1-缺货 2-不缺货
|
||||
*/
|
||||
private Integer isShortage;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注", width = 16)
|
||||
private String remark;
|
||||
}
|
||||
|
|
@ -54,7 +54,7 @@ public class PlanApplyVo {
|
|||
/**
|
||||
* 施工地点
|
||||
*/
|
||||
@NotBlank(message = "施工地点不能为空", groups = {PlanApplyVo.addApplyPlan.class,PlanApplyVo.editApplyPlan.class})
|
||||
// @NotBlank(message = "施工地点不能为空", groups = {PlanApplyVo.addApplyPlan.class,PlanApplyVo.editApplyPlan.class})
|
||||
@Length(max = 120, message = "施工地点字符长度不能超过120", groups = {PlanApplyVo.addApplyPlan.class,PlanApplyVo.editApplyPlan.class})
|
||||
private String projectContent;
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -82,6 +82,11 @@ public class PlanDetailVo {
|
|||
@Excel(name = "单位", width = 20.0, orderNum = "4")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 新增条件限制
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class BidProAddVo {
|
|||
/**
|
||||
* 施工地点
|
||||
*/
|
||||
@NotBlank(message = "施工地点不能为空", groups = {addBidPro.class,editBidPro.class})
|
||||
// @NotBlank(message = "施工地点不能为空", groups = {addBidPro.class,editBidPro.class})
|
||||
@Length(max = 128, message = "施工地点字符长度不能超过128",groups = {addBidPro.class,editBidPro.class})
|
||||
private String constructionsite;
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class ProAddVo {
|
|||
/**
|
||||
* 施工地点
|
||||
*/
|
||||
@NotBlank(message = "施工地点不能为空", groups = {addPro.class,editPro.class})
|
||||
// @NotBlank(message = "施工地点不能为空", groups = {addPro.class,editPro.class})
|
||||
@Length(max = 128, message = "施工地点字符长度不能超过128",groups = {addPro.class,editPro.class})
|
||||
private String constructionsite;
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.aqgqj.business.backstage.mapper.inventory;
|
||||
|
||||
import com.bonus.aqgqj.business.backstage.entity.ProjectMaterialLedger;
|
||||
import com.bonus.aqgqj.business.backstage.entity.inventory.InventoryCountVo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
|
@ -15,6 +16,16 @@ import java.util.List;
|
|||
@Repository("InventoryCountMapper")
|
||||
public interface InventoryCountMapper {
|
||||
|
||||
/**
|
||||
* 查询工程的物资出库数量,根据工程及物资型号分组
|
||||
*/
|
||||
List<ProjectMaterialLedger> getProjectOutListGroupModel(ProjectMaterialLedger vo);
|
||||
|
||||
/**
|
||||
* 查询工程的物资退货数量,根据工程及物资型号分组
|
||||
*/
|
||||
List<ProjectMaterialLedger> getProjectBackListGroupModel(ProjectMaterialLedger vo);
|
||||
|
||||
/**
|
||||
* 库存统计列表
|
||||
* @return List<InventoryCountVo>
|
||||
|
|
|
|||
|
|
@ -207,7 +207,8 @@ public class PurchaseServiceImpl implements PurchaseService {
|
|||
return ServerResponse.createErroe("请填写经办人");
|
||||
}
|
||||
if(StringHelper.isEmpty(outPlanVo.getAddress())){
|
||||
return ServerResponse.createErroe("请填写收获日期");
|
||||
outPlanVo.setAddress("无");
|
||||
// return ServerResponse.createErroe("请填写收获地址");
|
||||
}
|
||||
if(files==null || files.length<1){
|
||||
return ServerResponse.createErroe("请上传附件");
|
||||
|
|
@ -351,7 +352,8 @@ public class PurchaseServiceImpl implements PurchaseService {
|
|||
return ServerResponse.createErroe("请填写经办人");
|
||||
}
|
||||
if(StringHelper.isEmpty(outPlanVo.getAddress())){
|
||||
return ServerResponse.createErroe("请填写收获日期");
|
||||
outPlanVo.setAddress("无");
|
||||
// return ServerResponse.createErroe("请填写收获地址");
|
||||
}
|
||||
|
||||
List<OutPlanVoDetails> detailsList=outPlanVo.getDetailsList();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.bonus.aqgqj.business.backstage.service.inventory;
|
||||
|
||||
import com.bonus.aqgqj.business.backstage.entity.ProjectMaterialLedger;
|
||||
import com.bonus.aqgqj.business.backstage.entity.inventory.InventoryApplyVo;
|
||||
import com.bonus.aqgqj.business.backstage.entity.inventory.InventoryCountVo;
|
||||
import com.bonus.aqgqj.manager.webResult.ServerResponse;
|
||||
|
||||
|
|
@ -14,6 +16,11 @@ import java.util.List;
|
|||
*/
|
||||
public interface InventoryCountService {
|
||||
|
||||
/**
|
||||
* 工程领退及差缺台账
|
||||
*/
|
||||
List<ProjectMaterialLedger> queryLedgerListByProjectAndModel(ProjectMaterialLedger vo);
|
||||
|
||||
/**
|
||||
*库存统计列表
|
||||
* @param data
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.aqgqj.business.backstage.service.inventory;
|
||||
|
||||
import com.bonus.aqgqj.business.backstage.entity.ProjectMaterialLedger;
|
||||
import com.bonus.aqgqj.business.backstage.entity.inventory.InventoryCountVo;
|
||||
import com.bonus.aqgqj.business.backstage.mapper.inventory.InventoryCountMapper;
|
||||
import com.bonus.aqgqj.manager.webResult.ServerResponse;
|
||||
|
|
@ -7,7 +8,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @className:InventoryCountServiceImpl
|
||||
|
|
@ -22,6 +24,112 @@ public class InventoryCountServiceImpl implements InventoryCountService{
|
|||
|
||||
@Resource(name = "InventoryCountMapper")
|
||||
private InventoryCountMapper mapper;
|
||||
|
||||
/**
|
||||
* 工程领退及差缺台账
|
||||
*/
|
||||
@Override
|
||||
public List<ProjectMaterialLedger> queryLedgerListByProjectAndModel(ProjectMaterialLedger vo) {
|
||||
// 1. 查询工程物资出库数据
|
||||
List<ProjectMaterialLedger> outRecords = mapper.getProjectOutListGroupModel(vo);
|
||||
|
||||
// 2. 查询工程物资退料数据
|
||||
List<ProjectMaterialLedger> returnRecords = mapper.getProjectBackListGroupModel(vo);
|
||||
|
||||
// 3. 按工程和modelId分组
|
||||
Map<String, ProjectMaterialLedger> outMap = outRecords.stream()
|
||||
.collect(Collectors.toMap(
|
||||
record -> record.getProId() + "_" + record.getModelId(),
|
||||
record -> record,
|
||||
(existing, replacement) -> {
|
||||
// 累加出库数量
|
||||
existing.setTotalCk(existing.getTotalCk() + replacement.getTotalCg() + replacement.getTotalLk());
|
||||
return existing;
|
||||
}
|
||||
));
|
||||
|
||||
Map<String, ProjectMaterialLedger> returnMap = returnRecords.stream()
|
||||
.collect(Collectors.toMap(
|
||||
record -> record.getProId() + "_" + record.getModelId(),
|
||||
record -> record,
|
||||
(existing, replacement) -> {
|
||||
// 累加退料数量
|
||||
existing.setTotalBack(existing.getTotalBack() + replacement.getTotalBack());
|
||||
return existing;
|
||||
}
|
||||
));
|
||||
|
||||
// 4. 计算差缺量
|
||||
List<ProjectMaterialLedger> result = new ArrayList<>();
|
||||
Set<String> allKeys = new HashSet<>();
|
||||
allKeys.addAll(outMap.keySet());
|
||||
allKeys.addAll(returnMap.keySet());
|
||||
|
||||
for (String key : allKeys) {
|
||||
ProjectMaterialLedger outRecord = outMap.get(key);
|
||||
ProjectMaterialLedger returnRecord = returnMap.get(key);
|
||||
|
||||
ProjectMaterialLedger ledger = computeDiffData(outRecord, returnRecord);
|
||||
|
||||
// 前端筛选,判断是否是差缺再进行返回
|
||||
if (vo.getIsShortage() == null || vo.getIsShortage() == 0) {
|
||||
result.add(ledger);
|
||||
} else if (vo.getIsShortage() == 1 && ledger.getTotalDiff() > 0) {
|
||||
result.add(ledger);
|
||||
} else if (vo.getIsShortage() == 2 && ledger.getTotalDiff() <= 0) {
|
||||
result.add(ledger);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算差缺量
|
||||
* @param outRecord 出库数量
|
||||
* @param returnRecord 退料数量
|
||||
* @return ProjectMaterialLedger
|
||||
*/
|
||||
private static ProjectMaterialLedger computeDiffData(ProjectMaterialLedger outRecord, ProjectMaterialLedger returnRecord) {
|
||||
// 1.新建一个对象
|
||||
ProjectMaterialLedger ledger = new ProjectMaterialLedger();
|
||||
if (returnRecord == null) { returnRecord = new ProjectMaterialLedger();}
|
||||
|
||||
// 2.设置数量
|
||||
ledger.setTotalCg(outRecord != null ? outRecord.getTotalCg() : 0.00);
|
||||
ledger.setTotalLk(outRecord != null ? outRecord.getTotalLk() : 0.00);
|
||||
ledger.setTotalBack(returnRecord.getTotalBack() != null ? returnRecord.getTotalBack() : 0.00);
|
||||
ledger.setTotalCk(outRecord != null ? outRecord.getTotalCk() : 0.00);
|
||||
ledger.setNeedNum(outRecord != null ? outRecord.getNeedNum() : 0.00);
|
||||
|
||||
// 3.设置工程信息
|
||||
ledger.setProId(outRecord != null ? outRecord.getProId() : returnRecord.getProId());
|
||||
ledger.setProName(outRecord != null ? outRecord.getProName() : returnRecord.getProName());
|
||||
ledger.setLeaseUnit(outRecord != null ? outRecord.getLeaseUnit() : returnRecord.getLeaseUnit());
|
||||
|
||||
// 4.设置物料信息
|
||||
ledger.setType(outRecord != null ? outRecord.getType() : returnRecord.getType());
|
||||
ledger.setName(outRecord != null ? outRecord.getName() : returnRecord.getName());
|
||||
ledger.setModel(outRecord != null ? outRecord.getModel() : returnRecord.getModel());
|
||||
ledger.setUnit(outRecord != null ? outRecord.getUnit() : returnRecord.getUnit());
|
||||
ledger.setModelId(outRecord != null ? outRecord.getModelId() : returnRecord.getModelId());
|
||||
|
||||
// 计算差缺量 = 出库数量 - 退料数量
|
||||
ledger.setTotalDiff(ledger.getTotalCk() - ledger.getTotalBack());
|
||||
|
||||
// 5.设置差缺状态
|
||||
if (ledger.getTotalDiff() > 0) {
|
||||
ledger.setIsShortage(1);
|
||||
} else if (ledger.getTotalDiff() < 0) {
|
||||
ledger.setIsShortage(0);
|
||||
} else {
|
||||
ledger.setIsShortage(2);
|
||||
}
|
||||
return ledger;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<InventoryCountVo> getInventoryCountList(InventoryCountVo data) {
|
||||
List<InventoryCountVo> list = null;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
package com.bonus.aqgqj.manager.common.config;
|
||||
|
||||
import org.springframework.data.redis.serializer.RedisSerializer;
|
||||
import org.springframework.data.redis.serializer.SerializationException;
|
||||
import org.springframework.util.SerializationUtils;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* 自定义 Redis 序列化器
|
||||
* @author 阮世耀
|
||||
*/
|
||||
public class CustomRedisSerializer implements RedisSerializer<Object> {
|
||||
|
||||
@Override
|
||||
public byte[] serialize(Object object) throws SerializationException {
|
||||
// 使用默认的序列化逻辑
|
||||
return SerializationUtils.serialize(object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object deserialize(byte[] bytes) throws SerializationException {
|
||||
if (bytes == null) {
|
||||
return null;
|
||||
}
|
||||
try (ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
|
||||
ObjectInputStream objectInputStream = new CustomObjectInputStream(byteArrayInputStream)) {
|
||||
return objectInputStream.readObject();
|
||||
} catch (IOException | ClassNotFoundException e) {
|
||||
throw new SerializationException("Failed to deserialize object", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义 ObjectInputStream,用于修复类路径
|
||||
*/
|
||||
private static class CustomObjectInputStream extends ObjectInputStream {
|
||||
public CustomObjectInputStream(InputStream in) throws IOException {
|
||||
super(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
|
||||
try {
|
||||
// 默认尝试加载类
|
||||
return super.resolveClass(desc);
|
||||
} catch (ClassNotFoundException e) {
|
||||
// 如果类路径不对,手动指定正确的类路径
|
||||
return Class.forName("com.bonus.aqgqj.manager.security.entity.SelfUserEntity");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,13 @@
|
|||
package com.bonus.aqgqj.manager.common.util;
|
||||
|
||||
import com.bonus.aqgqj.manager.common.config.CustomRedisSerializer;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.BoundSetOperations;
|
||||
import org.springframework.data.redis.core.HashOperations;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.ValueOperations;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
|
|
@ -104,8 +106,14 @@ public class RedisService
|
|||
*/
|
||||
public <T> T getCacheObject(final String key)
|
||||
{
|
||||
// 设置键的序列化器
|
||||
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
// 设置值的序列化器为自定义的序列化器
|
||||
redisTemplate.setValueSerializer(new CustomRedisSerializer());
|
||||
|
||||
ValueOperations<String, T> operation = redisTemplate.opsForValue();
|
||||
return operation.get(key);
|
||||
T t = operation.get(key);
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@ public class TokenConstants
|
|||
* 令牌自定义标识
|
||||
*/
|
||||
public static final String AUTHENTICATION = "Authorization";
|
||||
|
||||
public static final String AUTHENTICATION_PARAM1= "auth";
|
||||
|
||||
public static final String AUTHENTICATION_PARAM = "token";
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -46,9 +46,18 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
|
|||
filterChain.doFilter(request, response);
|
||||
return;
|
||||
}
|
||||
if (uri.contains(".jpg") || uri.contains(".png") || uri.contains(".jpeg") || uri.contains("onlinePreview")) {
|
||||
filterChain.doFilter(request, response);
|
||||
return;
|
||||
}
|
||||
if (uri.contains(".xlsx") || uri.contains(".pdf") || uri.contains(".xls") || uri.contains(".docx") || uri.contains(".doc")) {
|
||||
filterChain.doFilter(request, response);
|
||||
return;
|
||||
}
|
||||
if(StringUtils.isEmpty(jwtToken)){
|
||||
System.err.println("----------------->");
|
||||
ResultUtil.responseJson(response,ResultUtil.resultCode(401,"登录过期,请先登录"));
|
||||
System.err.println("异常401,token信息:" + jwtToken + ",地址" + uri);
|
||||
return;
|
||||
}
|
||||
//解析token
|
||||
|
|
|
|||
|
|
@ -0,0 +1,50 @@
|
|||
# 配置端口
|
||||
server:
|
||||
port: 21520
|
||||
servlet:
|
||||
context-path:
|
||||
max-http-header-size: 10240
|
||||
spring:
|
||||
# 配置数据源
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://192.168.0.14:4417/gzimtcs?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true
|
||||
# username: root
|
||||
# password: Bonus@admin123!
|
||||
url: jdbc:mysql://127.0.0.1:3306/gzimt250319?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false
|
||||
username: ruanliang
|
||||
password: ruanliang@MYSQL
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
redis:
|
||||
host: localhost
|
||||
port: 6379
|
||||
database: 7
|
||||
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: -1
|
||||
max-request-size: -1
|
||||
#mapper配置
|
||||
mybatis:
|
||||
mapper-locations: classpath:mappers/**/*Mapper.xml,mappers/**/**/*Mapper.xml
|
||||
#日志配置
|
||||
logging:
|
||||
config: classpath:logback-boot.xml
|
||||
log:
|
||||
level:
|
||||
root: info
|
||||
my: debug
|
||||
file: logs/sys-back.log
|
||||
maxsize: 30MB
|
||||
#是否开启安全模式
|
||||
zhly:
|
||||
aq:
|
||||
enable: false
|
||||
|
||||
file:
|
||||
upload_path:
|
||||
windows: D://files/zg_gqj
|
||||
linux: /home/zg_gqj/files
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
# 配置端口
|
||||
server:
|
||||
port: 21520
|
||||
servlet:
|
||||
context-path: /gz_aqgqj
|
||||
max-http-header-size: 10240
|
||||
spring:
|
||||
# 配置数据源
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://10.1.0.141:13306/gzimt1.0?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true
|
||||
username: root
|
||||
password: gsyfq@09mysql!
|
||||
# url: jdbc:mysql://127.0.0.1:3306/gzimt?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false
|
||||
# username: zhz_root
|
||||
# password: Zhz@12345
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
redis:
|
||||
host: 10.1.0.141
|
||||
port: 6379
|
||||
password: Bonus@admin123!
|
||||
database: 7
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: -1
|
||||
max-request-size: -1
|
||||
#mapper配置
|
||||
mybatis:
|
||||
mapper-locations: classpath:mappers/**/*Mapper.xml,mappers/**/**/*Mapper.xml
|
||||
#日志配置
|
||||
logging:
|
||||
config: classpath:logback-boot.xml
|
||||
log:
|
||||
level:
|
||||
root: info
|
||||
my: debug
|
||||
file: logs/sys-back.log
|
||||
maxsize: 30MB
|
||||
#是否开启安全模式
|
||||
zhly:
|
||||
aq:
|
||||
enable: false
|
||||
|
||||
file:
|
||||
upload_path:
|
||||
windows: D://files/zg_gqj
|
||||
linux: /home/zg_gqj/files
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
# 配置端口
|
||||
server:
|
||||
port: 21520
|
||||
servlet:
|
||||
context-path: /gz-aqgqj
|
||||
max-http-header-size: 10240
|
||||
spring:
|
||||
# 配置数据源
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.0.16:4419/gzimtcs?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true
|
||||
username: root
|
||||
password: Bonus@admin123!
|
||||
# url: jdbc:mysql://localhost:13306/gzimt250319?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false
|
||||
# username: root
|
||||
# password: liang971108@Sun
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
redis:
|
||||
host: 192.168.0.16
|
||||
port: 2001
|
||||
password: Zhzbns@Redis123!
|
||||
database: 1
|
||||
# database: 7
|
||||
# host: 127.0.0.1
|
||||
# port: 6379
|
||||
# password: liang971108lu@L
|
||||
|
||||
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: -1
|
||||
max-request-size: -1
|
||||
#mapper配置
|
||||
mybatis:
|
||||
mapper-locations: classpath:mappers/**/*Mapper.xml,mappers/**/**/*Mapper.xml
|
||||
#日志配置
|
||||
logging:
|
||||
config: classpath:logback-boot.xml
|
||||
log:
|
||||
level:
|
||||
root: info
|
||||
my: debug
|
||||
file: logs/sys-back.log
|
||||
maxsize: 30MB
|
||||
#是否开启安全模式
|
||||
zhly:
|
||||
aq:
|
||||
enable: false
|
||||
|
||||
file:
|
||||
upload_path:
|
||||
windows: D://files/zg_gqj
|
||||
linux: /home/zg_gqj/files
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,56 +1,3 @@
|
|||
# 配置端口
|
||||
server:
|
||||
port: 21520
|
||||
servlet:
|
||||
context-path: /gz-aqgqj
|
||||
max-http-header-size: 10240
|
||||
spring:
|
||||
# 配置数据源
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.0.16:4419/gzimtcs?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true
|
||||
username: root
|
||||
password: Bonus@admin123!
|
||||
# url: jdbc:mysql://localhost:13306/gzimt250319?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false
|
||||
# username: root
|
||||
# password: liang971108@Sun
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
redis:
|
||||
host: 192.168.0.16
|
||||
port: 2001
|
||||
password: Zhzbns@Redis123!
|
||||
database: 1
|
||||
# database: 7
|
||||
# host: 127.0.0.1
|
||||
# port: 6379
|
||||
# password: liang971108lu@L
|
||||
|
||||
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: -1
|
||||
max-request-size: -1
|
||||
#mapper配置
|
||||
mybatis:
|
||||
mapper-locations: classpath:mappers/**/*Mapper.xml,mappers/**/**/*Mapper.xml
|
||||
#日志配置
|
||||
logging:
|
||||
config: classpath:logback-boot.xml
|
||||
log:
|
||||
level:
|
||||
root: info
|
||||
my: debug
|
||||
file: logs/sys-back.log
|
||||
maxsize: 30MB
|
||||
#是否开启安全模式
|
||||
zhly:
|
||||
aq:
|
||||
enable: false
|
||||
|
||||
file:
|
||||
upload_path:
|
||||
windows: e://files/zg_gqj
|
||||
linux: /home/zg_gqj/files
|
||||
|
||||
|
||||
|
||||
profiles:
|
||||
active: prod
|
||||
|
|
@ -3,6 +3,52 @@
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.aqgqj.business.backstage.mapper.inventory.InventoryCountMapper">
|
||||
|
||||
<select id="getProjectOutListGroupModel" resultType="com.bonus.aqgqj.business.backstage.entity.ProjectMaterialLedger">
|
||||
SELECT
|
||||
p.ID AS proId, p.`NAME` AS proName,
|
||||
o.model_id AS modelId, -- 设备类型字段
|
||||
o.type,o.`name`,o.model,o.unit,
|
||||
SUM(o.cg_num) AS totalCg,
|
||||
SUM(o.lk_num) AS totalLk,
|
||||
SUM(o.need_num) AS needNum, -- 需求数量
|
||||
SUM(o.cg_num + o.lk_num) as totalCk -- 总出库数量
|
||||
FROM
|
||||
st_plan_out_details o
|
||||
JOIN
|
||||
st_plan_out spo ON o.out_id = spo.id -- 关联出库表
|
||||
JOIN
|
||||
bm_project p ON spo.pro_id = p.ID -- 关联工程表
|
||||
<where>
|
||||
<if test="proName != null and proName != ''">
|
||||
AND p.`NAME` LIKE CONCAT('%',#{proName},'%')
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
p.ID,
|
||||
o.model_id
|
||||
</select>
|
||||
|
||||
<select id="getProjectBackListGroupModel" resultType="com.bonus.aqgqj.business.backstage.entity.ProjectMaterialLedger">
|
||||
SELECT
|
||||
p.ID AS proId, p.`NAME` AS proName,
|
||||
b.model_id AS modelId, -- 设备类型字段
|
||||
SUM(b.num) AS totalBack -- 总退货数量
|
||||
FROM
|
||||
st_back_details b
|
||||
JOIN
|
||||
st_back_apply sba ON b.apply_id = sba.id -- 关联退料申请表
|
||||
JOIN
|
||||
bm_project p ON sba.project_id = p.ID -- 关联工程表
|
||||
<where>
|
||||
<if test="proName != null and proName != ''">
|
||||
AND p.`NAME` LIKE CONCAT('%',#{proName},'%')
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
p.ID,
|
||||
b.model_id
|
||||
</select>
|
||||
|
||||
<!--库存统计列表-->
|
||||
<select id="getInventoryCountList"
|
||||
resultType="com.bonus.aqgqj.business.backstage.entity.inventory.InventoryCountVo">
|
||||
|
|
@ -33,6 +79,7 @@
|
|||
</if>
|
||||
order by smt.create_time desc
|
||||
</select>
|
||||
|
||||
<!--数据概览-->
|
||||
<select id="getTypeCount" resultType="java.lang.Integer">
|
||||
SELECT IFNULL(COUNT(*),0) AS num FROM st_ma_type where `level`= '1' AND is_active= '0'
|
||||
|
|
|
|||
|
|
@ -180,12 +180,15 @@
|
|||
spd.need_num AS needNum,
|
||||
spd.need_day AS needDay,
|
||||
spd.back_date AS backDate,
|
||||
bp.`NAME` AS projectName,
|
||||
spd.remark,
|
||||
spd.type,
|
||||
spd.name,
|
||||
spd.model,
|
||||
spd.unit
|
||||
FROM st_plan_details spd
|
||||
LEFT JOIN st_plan_apply spa ON spd.apply_id = spa.id
|
||||
LEFT JOIN bm_project bp ON spa.project_id = bp.ID
|
||||
WHERE apply_id = #{id}
|
||||
<if test="name!=null and name!=''">
|
||||
AND spd.name = #{name}
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@
|
|||
and pro.name like concat('%',#{proName},'%')
|
||||
</if>
|
||||
GROUP BY spa.project_id
|
||||
ORDER BY spa.create_time DESC
|
||||
<if test="status!=null and status!=''">
|
||||
<if test='status=="0"'>
|
||||
HAVING (SUM(spa.ck_num)+sum(spa.lk_num))=0
|
||||
|
|
@ -97,9 +98,8 @@
|
|||
HAVING ((SUM(spa.ck_num)+sum(spa.lk_num) )>=SUM(spa.need_num))
|
||||
</if>
|
||||
</if>
|
||||
|
||||
ORDER BY spa.update_time desc
|
||||
</select>
|
||||
|
||||
<select id="getProMoney" resultType="java.lang.String">
|
||||
select SUM(pos.cg_num*sct.price) money
|
||||
from st_plan_out_sup pos
|
||||
|
|
|
|||
Loading…
Reference in New Issue