@@ -41,4 +41,6 @@ public interface QtkServicehallRepo extends AbstractJpaRepo<QtkServiceHall, Stri | |||
@Query("from QtkServiceHall where serviceHallId=?1") | |||
List<QtkServiceHall> listBy(String serviceHallId); | |||
@Query("from QtkServiceHall where agencyId = ?1") | |||
List<QtkServiceHall> listByAgencyId(String agencyId); | |||
} |
@@ -7,6 +7,7 @@ import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
import java.time.LocalDate; | |||
import java.time.LocalDateTime; | |||
@ApiModel(description = "仓库管理分页查询") | |||
@@ -22,8 +23,8 @@ public class InvwWarehousePageRequestDTO extends AbstractStaffBizPageRequestDTO | |||
@ApiModelProperty(value = "渠道编号") | |||
private String agencyId;//渠道编号 | |||
@ApiModelProperty(value = "创建时间开始") | |||
private LocalDateTime insertTimeStart;//创建时间开始 | |||
private LocalDate insertTimeStart;//创建时间开始 | |||
@ApiModelProperty(value = "创建时间结束") | |||
private LocalDateTime insertTimeEnd;//创建时间结束 | |||
private LocalDate insertTimeEnd;//创建时间结束 | |||
} |
@@ -38,10 +38,16 @@ public class InvwWarehouseManagerImpl extends AbstractInvwManager implements Inv | |||
public Pagination page(InvwWarehousePageRequestDTO request) throws ManagerException { | |||
InvwWarehousePageRequest req = new InvwWarehousePageRequest(); | |||
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()); | |||
if (staff == null) throw new ManagerException("员工非法!"); | |||
// 如果不是管理员,只能查询本渠道的仓库 | |||
if(!"MANAGER".equals(staff.getIdentityType())){ | |||
if (!"MANAGER".equals(staff.getIdentityType())) { | |||
String agencyId = staff.getAgencyId(); | |||
if (!hasText(agencyId)) throw new ManagerException("渠道获取失败!"); | |||
req.setAgencyId(agencyId); |
@@ -1,5 +1,6 @@ | |||
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.ExcelProperty; | |||
import com.alibaba.excel.annotation.write.style.*; | |||
@@ -9,6 +10,8 @@ import lombok.Setter; | |||
import java.io.Serializable; | |||
import java.time.LocalDateTime; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
@HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER) | |||
@HeadFontStyle(fontHeightInPoints = 12) | |||
@@ -27,31 +30,31 @@ public class InvwQryCardBatchExcelModel implements Serializable { | |||
@ExcelProperty(value = "批次申请日期") | |||
private String batchDate; | |||
@ColumnWidth(10) | |||
@ColumnWidth(15) | |||
@ExcelProperty(value = "卡片类型") | |||
private String cardType; | |||
@ColumnWidth(20) | |||
@ColumnWidth(25) | |||
@ExcelProperty(value = "卡片起始号") | |||
private String startNum; | |||
@ColumnWidth(20) | |||
@ColumnWidth(25) | |||
@ExcelProperty(value = "卡片结束号") | |||
private String endNum; | |||
@ColumnWidth(15) | |||
@ExcelProperty(value = "批次总张数") | |||
private String totalCount; | |||
private Integer totalCount; | |||
@ColumnWidth(10) | |||
@ColumnWidth(15) | |||
@ExcelProperty(value = "申请状态") | |||
private String status; | |||
@ColumnWidth(10) | |||
@ColumnWidth(15) | |||
@ExcelProperty(value = "卡片版本号") | |||
private Integer cardVersion; | |||
@ColumnWidth(10) | |||
@ColumnWidth(15) | |||
@ExcelProperty(value = "设备类型") | |||
private String seType; | |||
@@ -59,11 +62,62 @@ public class InvwQryCardBatchExcelModel implements Serializable { | |||
@ExcelProperty(value = "发行方代码") | |||
private String orgId; | |||
@ColumnWidth(15) | |||
@ColumnWidth(20) | |||
@ExcelProperty(value = "渠道") | |||
private String chanel; | |||
@ColumnWidth(20) | |||
@ExcelProperty(value = "入库时间") | |||
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 ""; | |||
} | |||
} |
@@ -1,5 +1,6 @@ | |||
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.ExcelProperty; | |||
import com.alibaba.excel.annotation.write.style.*; | |||
@@ -22,19 +23,19 @@ public class InvwQryCardsExcelModel { | |||
@ExcelProperty(value = "批次号") | |||
private String batchNo; | |||
@ColumnWidth(20) | |||
@ColumnWidth(25) | |||
@ExcelProperty(value = "卡号") | |||
private String cardNo; | |||
@ColumnWidth(10) | |||
@ColumnWidth(20) | |||
@ExcelProperty(value = "卡片厂商") | |||
private String provider; | |||
@ColumnWidth(10) | |||
@ColumnWidth(15) | |||
@ExcelProperty(value = "卡片类型") | |||
private String cardType; | |||
@ColumnWidth(10) | |||
@ColumnWidth(15) | |||
@ExcelProperty(value = "发行状态") | |||
private Integer status; | |||
@@ -54,7 +55,7 @@ public class InvwQryCardsExcelModel { | |||
@ExcelProperty(value = "发行次数") | |||
private Integer issueCount; | |||
@ColumnWidth(10) | |||
@ColumnWidth(15) | |||
@ExcelProperty(value = "渠道") | |||
private String chanel; | |||
@@ -62,11 +63,29 @@ public class InvwQryCardsExcelModel { | |||
@ExcelProperty(value = "渠道ID") | |||
private String chanelId; | |||
@ColumnWidth(10) | |||
@ColumnWidth(15) | |||
@ExcelProperty(value = "卡片厂商代码") | |||
private String providerID; | |||
@ColumnWidth(20) | |||
@ExcelProperty(value = "入库时间") | |||
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 ""; | |||
} | |||
} | |||
} |
@@ -26,7 +26,7 @@ public class InvwQryObuBatchExcelModel { | |||
@ExcelProperty(value = "批次申请日期") | |||
private String applyDate; | |||
@ColumnWidth(10) | |||
@ColumnWidth(15) | |||
@ExcelProperty(value = "OBU类型") | |||
private String obuType; | |||
@@ -38,23 +38,30 @@ public class InvwQryObuBatchExcelModel { | |||
@ExcelProperty(value = "OBU结束号") | |||
private String endNum; | |||
@ColumnWidth(20) | |||
@ColumnWidth(25) | |||
@ExcelProperty(value = "卡片起始号") | |||
private String startCardNum; | |||
@ColumnWidth(20) | |||
@ColumnWidth(25) | |||
@ExcelProperty(value = "卡片结束号") | |||
private String endCardNum; | |||
@ColumnWidth(10) | |||
@ColumnWidth(15) | |||
@ExcelProperty(value = "批次总张数") | |||
private String totalCount; | |||
@ColumnWidth(10) | |||
@ColumnWidth(20) | |||
@ExcelProperty(value = "渠道名称") | |||
private String chanel; | |||
@ColumnWidth(20) | |||
@ExcelProperty(value = "入库时间") | |||
private LocalDateTime insertTime; | |||
public String getObuType() { | |||
if(obuType != null) { | |||
return this.obuType.equals("0")?"单片OBU":"双片OBU"; | |||
} | |||
return ""; | |||
} | |||
} |
@@ -1,5 +1,6 @@ | |||
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.ExcelProperty; | |||
import com.alibaba.excel.annotation.write.style.*; | |||
@@ -18,63 +19,81 @@ import java.time.LocalDateTime; | |||
@Setter | |||
public class InvwQryObusExcelModel { | |||
@ColumnWidth(10) | |||
@ColumnWidth(20) | |||
@ExcelProperty(value = "批次号", index = 1) | |||
private String batchNo; | |||
@ColumnWidth(10) | |||
@ColumnWidth(20) | |||
@ExcelProperty(value = "合同序列号", index = 3) | |||
private String serialNo; | |||
@ColumnWidth(10) | |||
@ColumnWidth(20) | |||
@ExcelProperty(value = "卡号", index = 4) | |||
private String cardNo; | |||
@ColumnWidth(10) | |||
@ColumnWidth(15) | |||
@ExcelProperty(value = "卡片类型", index = 5) | |||
private String cardType; | |||
@ColumnWidth(10) | |||
@ColumnWidth(15) | |||
@ExcelProperty(value = "卡片厂商", index = 6) | |||
private String provider; | |||
@ColumnWidth(10) | |||
@ColumnWidth(15) | |||
@ExcelProperty(value = "卡片厂商代码", index = 7) | |||
private String providerId; | |||
@ColumnWidth(10) | |||
@ColumnWidth(20) | |||
@ExcelProperty(value = "激活日期", index = 8) | |||
private String activeDate; | |||
@ColumnWidth(10) | |||
@ColumnWidth(15) | |||
@ExcelProperty(value = "发行状态", index = 9) | |||
private Integer status; | |||
@ColumnWidth(10) | |||
@ColumnWidth(20) | |||
@ExcelProperty(value = "一发日期", index = 10) | |||
private String formatTime; | |||
@ColumnWidth(10) | |||
@ColumnWidth(20) | |||
@ExcelProperty(value = "二发/客服日期", index = 11) | |||
private String lastUpdateTime; | |||
@ColumnWidth(10) | |||
@ColumnWidth(20) | |||
@ExcelProperty(value = "OBU物理号", index = 12) | |||
private String obuMac; | |||
@ColumnWidth(10) | |||
@ColumnWidth(20) | |||
@ExcelProperty(value = "卡片SNR", index = 13) | |||
private String cardSnr; | |||
@ColumnWidth(10) | |||
@ColumnWidth(15) | |||
@ExcelProperty(value = "渠道", index = 14) | |||
private String chanel; | |||
@ColumnWidth(10) | |||
@ColumnWidth(15) | |||
@ExcelProperty(value = "渠道ID", index = 15) | |||
private String chanelId; | |||
@ColumnWidth(10) | |||
@ColumnWidth(20) | |||
@ExcelProperty(value = "入库时间", index = 16) | |||
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 ""; | |||
} | |||
} | |||
} |
@@ -48,6 +48,13 @@ public class ServiceHallController extends MyValidController{ | |||
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 | |||
@ApiOperation(value = "获取网点编号") | |||
@PostMapping(value = "/getServiceHallId") |
@@ -33,5 +33,5 @@ public interface ServiceHallManager { | |||
String registerLocationBath(ServiceHallRegisterLocationBatchReqDTO reqDto) throws ManagerException; | |||
List<ServiceHallSonQueryModel> serviceHallGetByAgencyId(ServiceHallGetIdRequestDTO reqDto); | |||
} |
@@ -332,6 +332,19 @@ public class ServiceHallManagerImpl extends AbstractManager implements ServiceHa | |||
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) { | |||
List<String> serviceHalls = serviceHallRepo.findSerHalIdByAgencyId(agencyId); | |||
List<Long> serviceHallIds = serviceHalls.stream().map(Long::valueOf).collect(Collectors.toList()); |