Browse Source

库存

master
yangpeilai 1 month ago
parent
commit
64155f2876

+ 2
- 0
gly-base-core/src/main/java/cn/com/taiji/core/repo/jpa/basic/QtkServicehallRepo.java View File

@Query("from QtkServiceHall where serviceHallId=?1") @Query("from QtkServiceHall where serviceHallId=?1")
List<QtkServiceHall> listBy(String serviceHallId); List<QtkServiceHall> listBy(String serviceHallId);


@Query("from QtkServiceHall where agencyId = ?1")
List<QtkServiceHall> listByAgencyId(String agencyId);
} }

+ 3
- 2
zhywpt-app-invw/src/main/java/cn/com/taiji/invw/dto/warehouse/InvwWarehousePageRequestDTO.java View File

import lombok.Setter; import lombok.Setter;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;


import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;


@ApiModel(description = "仓库管理分页查询") @ApiModel(description = "仓库管理分页查询")
@ApiModelProperty(value = "渠道编号") @ApiModelProperty(value = "渠道编号")
private String agencyId;//渠道编号 private String agencyId;//渠道编号
@ApiModelProperty(value = "创建时间开始") @ApiModelProperty(value = "创建时间开始")
private LocalDateTime insertTimeStart;//创建时间开始
private LocalDate insertTimeStart;//创建时间开始
@ApiModelProperty(value = "创建时间结束") @ApiModelProperty(value = "创建时间结束")
private LocalDateTime insertTimeEnd;//创建时间结束
private LocalDate insertTimeEnd;//创建时间结束


} }

+ 7
- 1
zhywpt-app-invw/src/main/java/cn/com/taiji/invw/manager/warehouse/InvwWarehouseManagerImpl.java View File

public Pagination page(InvwWarehousePageRequestDTO request) throws ManagerException { public Pagination page(InvwWarehousePageRequestDTO request) throws ManagerException {
InvwWarehousePageRequest req = new InvwWarehousePageRequest(); InvwWarehousePageRequest req = new InvwWarehousePageRequest();
BeanUtils.copyProperties(request, req); BeanUtils.copyProperties(request, req);
if (request.getInsertTimeStart() != null) {
req.setInsertTimeStart(request.getInsertTimeStart().atStartOfDay());
}
if (request.getInsertTimeEnd() != null) {
req.setInsertTimeEnd(request.getInsertTimeEnd().plusDays(1).atStartOfDay());
}
Staff staff = staffRepo.findByStaffId(request.getStaffId()); Staff staff = staffRepo.findByStaffId(request.getStaffId());
if (staff == null) throw new ManagerException("员工非法!"); if (staff == null) throw new ManagerException("员工非法!");
// 如果不是管理员,只能查询本渠道的仓库 // 如果不是管理员,只能查询本渠道的仓库
if(!"MANAGER".equals(staff.getIdentityType())){
if (!"MANAGER".equals(staff.getIdentityType())) {
String agencyId = staff.getAgencyId(); String agencyId = staff.getAgencyId();
if (!hasText(agencyId)) throw new ManagerException("渠道获取失败!"); if (!hasText(agencyId)) throw new ManagerException("渠道获取失败!");
req.setAgencyId(agencyId); req.setAgencyId(agencyId);

+ 62
- 8
zhywpt-app-invw/src/main/java/cn/com/taiji/invw/model/card/InvwQryCardBatchExcelModel.java View File

package cn.com.taiji.invw.model.card; package cn.com.taiji.invw.model.card;


import cn.com.taiji.common.pub.StringTools;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.*; import com.alibaba.excel.annotation.write.style.*;


import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;


@HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER) @HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)
@HeadFontStyle(fontHeightInPoints = 12) @HeadFontStyle(fontHeightInPoints = 12)
@ExcelProperty(value = "批次申请日期") @ExcelProperty(value = "批次申请日期")
private String batchDate; private String batchDate;


@ColumnWidth(10)
@ColumnWidth(15)
@ExcelProperty(value = "卡片类型") @ExcelProperty(value = "卡片类型")
private String cardType; private String cardType;


@ColumnWidth(20)
@ColumnWidth(25)
@ExcelProperty(value = "卡片起始号") @ExcelProperty(value = "卡片起始号")
private String startNum; private String startNum;


@ColumnWidth(20)
@ColumnWidth(25)
@ExcelProperty(value = "卡片结束号") @ExcelProperty(value = "卡片结束号")
private String endNum; private String endNum;


@ColumnWidth(15) @ColumnWidth(15)
@ExcelProperty(value = "批次总张数") @ExcelProperty(value = "批次总张数")
private String totalCount;
private Integer totalCount;


@ColumnWidth(10)
@ColumnWidth(15)
@ExcelProperty(value = "申请状态") @ExcelProperty(value = "申请状态")
private String status; private String status;


@ColumnWidth(10)
@ColumnWidth(15)
@ExcelProperty(value = "卡片版本号") @ExcelProperty(value = "卡片版本号")
private Integer cardVersion; private Integer cardVersion;


@ColumnWidth(10)
@ColumnWidth(15)
@ExcelProperty(value = "设备类型") @ExcelProperty(value = "设备类型")
private String seType; private String seType;


@ExcelProperty(value = "发行方代码") @ExcelProperty(value = "发行方代码")
private String orgId; private String orgId;


@ColumnWidth(15)
@ColumnWidth(20)
@ExcelProperty(value = "渠道") @ExcelProperty(value = "渠道")
private String chanel; private String chanel;


@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty(value = "入库时间") @ExcelProperty(value = "入库时间")
private LocalDateTime insertTime; private LocalDateTime insertTime;

//卡片类型 03-应急卡;22-储值卡;23-记账卡
public String getCardType() {
if (StringTools.hasText(this.cardType)) {
return this.cardType.equals("03") ? "应急卡" : this.cardType.equals("22") ? "储值卡" : "记账卡";
}
return "";
}

//申请状态 APP-申请中 ISSUEING-发行中 DONE-发行完成 PERMIT-审批完成[数据就绪] REJECT-拒绝 JUDGEING-审批中 REJNOTRDY-驳回,待修正 FAIL-失败 APPROVAL-审批通过[待预制] PRECUT-预制数据中
public String getStatus() {
if (StringTools.hasText(this.status)) {
statusMap.forEach((k, v) -> {
if (this.status.equals(k)) {
this.status = v;
}
});
}
return "";
}

//定义一个map,申请状态
private Map<String, String> statusMap = new HashMap<>(){{
put("APP", "申请中");
put("ISSUEING", "发行中");
put("DONE", "发行完成");
put("PERMIT", "审批完成[数据就绪]");
put("REJECT", "拒绝");
put("JUDGEING", "审批中");
put("REJNOTRDY", "驳回,待修正");
put("FAIL", "失败");
put("APPROVAL", "审批通过[待预制]");
put("PRECUT", "预制数据中");
put("FINISH", "完成");
}};

//设备类型 CARD-卡 SCOBU-单片OBU
public String getSeType() {
if (StringTools.hasText(this.seType)) {
return this.seType.equals("CARD") ? "卡" : "单片OBU";
}
return "";
}

//发行方代码 01-贵州工行 02-黔通智联 03-贵州建行
public String getOrgId() {
if (StringTools.hasText(this.orgId)) {
return this.orgId.equals("01") ? "贵州工行" : this.orgId.equals("02") ? "黔通智联" : "贵州建行";
}
return "";
}
} }

+ 25
- 6
zhywpt-app-invw/src/main/java/cn/com/taiji/invw/model/card/InvwQryCardsExcelModel.java View File

package cn.com.taiji.invw.model.card; package cn.com.taiji.invw.model.card;


import cn.com.taiji.common.pub.StringTools;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.*; import com.alibaba.excel.annotation.write.style.*;
@ExcelProperty(value = "批次号") @ExcelProperty(value = "批次号")
private String batchNo; private String batchNo;


@ColumnWidth(20)
@ColumnWidth(25)
@ExcelProperty(value = "卡号") @ExcelProperty(value = "卡号")
private String cardNo; private String cardNo;


@ColumnWidth(10)
@ColumnWidth(20)
@ExcelProperty(value = "卡片厂商") @ExcelProperty(value = "卡片厂商")
private String provider; private String provider;


@ColumnWidth(10)
@ColumnWidth(15)
@ExcelProperty(value = "卡片类型") @ExcelProperty(value = "卡片类型")
private String cardType; private String cardType;


@ColumnWidth(10)
@ColumnWidth(15)
@ExcelProperty(value = "发行状态") @ExcelProperty(value = "发行状态")
private Integer status; private Integer status;


@ExcelProperty(value = "发行次数") @ExcelProperty(value = "发行次数")
private Integer issueCount; private Integer issueCount;


@ColumnWidth(10)
@ColumnWidth(15)
@ExcelProperty(value = "渠道") @ExcelProperty(value = "渠道")
private String chanel; private String chanel;


@ExcelProperty(value = "渠道ID") @ExcelProperty(value = "渠道ID")
private String chanelId; private String chanelId;


@ColumnWidth(10)
@ColumnWidth(15)
@ExcelProperty(value = "卡片厂商代码") @ExcelProperty(value = "卡片厂商代码")
private String providerID; private String providerID;


@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty(value = "入库时间") @ExcelProperty(value = "入库时间")
private LocalDateTime insertTime; private LocalDateTime insertTime;

//卡片类型 03-应急卡;22-储值卡;23-记账卡
public String getCardType() {
if (StringTools.hasText(this.cardType)) {
return this.cardType.equals("03") ? "应急卡" : this.cardType.equals("22") ? "储值卡" : "记账卡";
}
return "";
}

public String getStatus(){
if(this.status==1) {
return "流通中";
}else if(this.status==2){
return "一发成功";
}else {
return "";
}
}
} }

+ 12
- 5
zhywpt-app-invw/src/main/java/cn/com/taiji/invw/model/obu/InvwQryObuBatchExcelModel.java View File

@ExcelProperty(value = "批次申请日期") @ExcelProperty(value = "批次申请日期")
private String applyDate; private String applyDate;


@ColumnWidth(10)
@ColumnWidth(15)
@ExcelProperty(value = "OBU类型") @ExcelProperty(value = "OBU类型")
private String obuType; private String obuType;


@ExcelProperty(value = "OBU结束号") @ExcelProperty(value = "OBU结束号")
private String endNum; private String endNum;


@ColumnWidth(20)
@ColumnWidth(25)
@ExcelProperty(value = "卡片起始号") @ExcelProperty(value = "卡片起始号")
private String startCardNum; private String startCardNum;


@ColumnWidth(20)
@ColumnWidth(25)
@ExcelProperty(value = "卡片结束号") @ExcelProperty(value = "卡片结束号")
private String endCardNum; private String endCardNum;


@ColumnWidth(10)
@ColumnWidth(15)
@ExcelProperty(value = "批次总张数") @ExcelProperty(value = "批次总张数")
private String totalCount; private String totalCount;


@ColumnWidth(10)
@ColumnWidth(20)
@ExcelProperty(value = "渠道名称") @ExcelProperty(value = "渠道名称")
private String chanel; private String chanel;


@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty(value = "入库时间") @ExcelProperty(value = "入库时间")
private LocalDateTime insertTime; private LocalDateTime insertTime;

public String getObuType() {
if(obuType != null) {
return this.obuType.equals("0")?"单片OBU":"双片OBU";
}
return "";
}
} }

+ 34
- 15
zhywpt-app-invw/src/main/java/cn/com/taiji/invw/model/obu/InvwQryObusExcelModel.java View File

package cn.com.taiji.invw.model.obu; package cn.com.taiji.invw.model.obu;


import cn.com.taiji.common.pub.StringTools;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.*; import com.alibaba.excel.annotation.write.style.*;
@Setter @Setter
public class InvwQryObusExcelModel { public class InvwQryObusExcelModel {


@ColumnWidth(10)
@ColumnWidth(20)
@ExcelProperty(value = "批次号", index = 1) @ExcelProperty(value = "批次号", index = 1)
private String batchNo; private String batchNo;


@ColumnWidth(10)
@ColumnWidth(20)
@ExcelProperty(value = "合同序列号", index = 3) @ExcelProperty(value = "合同序列号", index = 3)
private String serialNo; private String serialNo;


@ColumnWidth(10)
@ColumnWidth(20)
@ExcelProperty(value = "卡号", index = 4) @ExcelProperty(value = "卡号", index = 4)
private String cardNo; private String cardNo;


@ColumnWidth(10)
@ColumnWidth(15)
@ExcelProperty(value = "卡片类型", index = 5) @ExcelProperty(value = "卡片类型", index = 5)
private String cardType; private String cardType;


@ColumnWidth(10)
@ColumnWidth(15)
@ExcelProperty(value = "卡片厂商", index = 6) @ExcelProperty(value = "卡片厂商", index = 6)
private String provider; private String provider;


@ColumnWidth(10)
@ColumnWidth(15)
@ExcelProperty(value = "卡片厂商代码", index = 7) @ExcelProperty(value = "卡片厂商代码", index = 7)
private String providerId; private String providerId;


@ColumnWidth(10)
@ColumnWidth(20)
@ExcelProperty(value = "激活日期", index = 8) @ExcelProperty(value = "激活日期", index = 8)
private String activeDate; private String activeDate;


@ColumnWidth(10)
@ColumnWidth(15)
@ExcelProperty(value = "发行状态", index = 9) @ExcelProperty(value = "发行状态", index = 9)
private Integer status; private Integer status;


@ColumnWidth(10)
@ColumnWidth(20)
@ExcelProperty(value = "一发日期", index = 10) @ExcelProperty(value = "一发日期", index = 10)
private String formatTime; private String formatTime;


@ColumnWidth(10)
@ColumnWidth(20)
@ExcelProperty(value = "二发/客服日期", index = 11) @ExcelProperty(value = "二发/客服日期", index = 11)
private String lastUpdateTime; private String lastUpdateTime;


@ColumnWidth(10)
@ColumnWidth(20)
@ExcelProperty(value = "OBU物理号", index = 12) @ExcelProperty(value = "OBU物理号", index = 12)
private String obuMac; private String obuMac;


@ColumnWidth(10)
@ColumnWidth(20)
@ExcelProperty(value = "卡片SNR", index = 13) @ExcelProperty(value = "卡片SNR", index = 13)
private String cardSnr; private String cardSnr;


@ColumnWidth(10)
@ColumnWidth(15)
@ExcelProperty(value = "渠道", index = 14) @ExcelProperty(value = "渠道", index = 14)
private String chanel; private String chanel;


@ColumnWidth(10)
@ColumnWidth(15)
@ExcelProperty(value = "渠道ID", index = 15) @ExcelProperty(value = "渠道ID", index = 15)
private String chanelId; private String chanelId;


@ColumnWidth(10)
@ColumnWidth(20)
@ExcelProperty(value = "入库时间", index = 16) @ExcelProperty(value = "入库时间", index = 16)
private LocalDateTime insertTime; private LocalDateTime insertTime;

//卡片类型 03-应急卡;22-储值卡;23-记账卡
public String getCardType() {
if (StringTools.hasText(this.cardType)) {
return this.cardType.equals("03") ? "应急卡" : this.cardType.equals("22") ? "储值卡" : "记账卡";
}
return "";
}

public String getStatus(){
if(this.status==1) {
return "流通中";
}else if(this.status==2){
return "一发成功";
}else {
return "";
}
}
} }

+ 7
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/api/ServiceHallController.java View File

return ApiResponse.of(query); return ApiResponse.of(query);
} }


//根据渠道编号查询网点
@ApiOperation(value = "根据渠道编号查询网点")
@PostMapping(value = "/serviceHallGetByAgencyId")
public ApiResponse<List<ServiceHallSonQueryModel>> serviceHallGetByAgencyId(@Validated @RequestBody ServiceHallGetIdRequestDTO reqDto) throws ManagerException {
return ApiResponse.of(manager.serviceHallGetByAgencyId(reqDto));
}

//网点子级节点查询 todo //网点子级节点查询 todo
@ApiOperation(value = "获取网点编号") @ApiOperation(value = "获取网点编号")
@PostMapping(value = "/getServiceHallId") @PostMapping(value = "/getServiceHallId")

+ 1
- 1
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/serviceHall/ServiceHallManager.java View File



String registerLocationBath(ServiceHallRegisterLocationBatchReqDTO reqDto) throws ManagerException; String registerLocationBath(ServiceHallRegisterLocationBatchReqDTO reqDto) throws ManagerException;


List<ServiceHallSonQueryModel> serviceHallGetByAgencyId(ServiceHallGetIdRequestDTO reqDto);
} }

+ 13
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/serviceHall/ServiceHallManagerImpl.java View File

return path == null ? null : minioUtil.getOuterUrl(path); return path == null ? null : minioUtil.getOuterUrl(path);
} }


@Override
public List<ServiceHallSonQueryModel> serviceHallGetByAgencyId(ServiceHallGetIdRequestDTO reqDto) {
List<QtkServiceHall> serviceHalls = serviceHallRepo.listByAgencyId(reqDto.getAgencyId());
List<ServiceHallSonQueryModel> queryModels = new ArrayList<>();
serviceHalls.forEach(serviceHall -> {
ServiceHallSonQueryModel queryModel = new ServiceHallSonQueryModel();
queryModel.setServicehallId(serviceHall.getServiceHallId());
queryModel.setServicehallName(serviceHall.getName());
queryModels.add(queryModel);
});
return queryModels;
}

private Long getServiceHallId(String agencyId) { private Long getServiceHallId(String agencyId) {
List<String> serviceHalls = serviceHallRepo.findSerHalIdByAgencyId(agencyId); List<String> serviceHalls = serviceHallRepo.findSerHalIdByAgencyId(agencyId);
List<Long> serviceHallIds = serviceHalls.stream().map(Long::valueOf).collect(Collectors.toList()); List<Long> serviceHallIds = serviceHalls.stream().map(Long::valueOf).collect(Collectors.toList());

Loading…
Cancel
Save