Bläddra i källkod

1、invw入库调整

master
huminghao 2 månader sedan
förälder
incheckning
863e5843ab

+ 18
- 18
zhywpt-app-invw/src/main/java/cn/com/taiji/invw/dto/enter/InvwEnterApplyAddRequestDTO.java Visa fil

@@ -98,24 +98,24 @@ public class InvwEnterApplyAddRequestDTO extends AbstractStaffBizRequestDTO {
}
}

if (ObuType.SINGLE_CHIP.equals(obuType)){
if (cardType == null){
throw new ManagerException("单片式OBU时,卡类型必填");
}
for (EnterApplyDetailModel detailModel : enterApplyDetailModels) {
int obuNUm = new BigInteger(detailModel.getEndId()).subtract(new BigInteger(detailModel.getStartId())).intValueExact()+1;
int cardNUm = new BigInteger(detailModel.getEndCardId()).subtract(new BigInteger(detailModel.getStartCardId())).intValueExact()+1;
if (obuNUm != cardNUm){
throw new ManagerException("单片式OBU时,签的号段与卡的号段数量必须相同");
}
if (StringUtils.isEmpty(detailModel.getStartCardId()) || StringUtils.isEmpty(detailModel.getEndCardId())){
throw new ManagerException("单片式OBU时,卡的是的段号和结束段号必填");
}
if (detailModel.getStartCardId().length() != 20 || detailModel.getEndCardId().length() != 20){
throw new ManagerException("卡号长度必须为20");
}
}
}
// if (ObuType.SINGLE_CHIP.equals(obuType)){
// if (cardType == null){
// throw new ManagerException("单片式OBU时,卡类型必填");
// }
// for (EnterApplyDetailModel detailModel : enterApplyDetailModels) {
// int obuNUm = new BigInteger(detailModel.getEndId()).subtract(new BigInteger(detailModel.getStartId())).intValueExact()+1;
// int cardNUm = new BigInteger(detailModel.getEndCardId()).subtract(new BigInteger(detailModel.getStartCardId())).intValueExact()+1;
// if (obuNUm != cardNUm){
// throw new ManagerException("单片式OBU时,签的号段与卡的号段数量必须相同");
// }
// if (StringUtils.isEmpty(detailModel.getStartCardId()) || StringUtils.isEmpty(detailModel.getEndCardId())){
// throw new ManagerException("单片式OBU时,卡的是的段号和结束段号必填");
// }
// if (detailModel.getStartCardId().length() != 20 || detailModel.getEndCardId().length() != 20){
// throw new ManagerException("卡号长度必须为20");
// }
// }
// }
}
}
}

+ 22
- 22
zhywpt-app-invw/src/main/java/cn/com/taiji/invw/dto/enter/InvwEnterApplyCodeValidRequestDTO.java Visa fil

@@ -51,11 +51,11 @@ public class InvwEnterApplyCodeValidRequestDTO extends AbstractStaffBizRequestDT
@NotBlank
private String endId;

@ApiModelProperty(value = "单片式OBU时有值")
private String startCardId;
@ApiModelProperty(value = "单片式OBU时有值")
private String endCardId;
// @ApiModelProperty(value = "单片式OBU时有值")
// private String startCardId;
//
// @ApiModelProperty(value = "单片式OBU时有值")
// private String endCardId;


public void valid() throws ManagerException {
@@ -74,23 +74,23 @@ public class InvwEnterApplyCodeValidRequestDTO extends AbstractStaffBizRequestDT
if (startId.length() != 16 || endId.length() != 16){
throw new ManagerException("签号长度必须为16");
}
if (ObuType.SINGLE_CHIP.equals(obuType)){
if (cardType == null){
throw new ManagerException("单片式OBU时,卡类型必填");
}
if (StringUtils.isEmpty(startCardId) || StringUtils.isEmpty(endCardId)){
throw new ManagerException("单片式OBU时,卡的是的段号和结束段号必填");
}
int obuNUm = new BigInteger(endId).subtract(new BigInteger(startId)).intValueExact()+1;
int cardNUm = new BigInteger(endCardId).subtract(new BigInteger(startCardId)).intValueExact()+1;
if (obuNUm != cardNUm){
throw new ManagerException("单片式OBU时,签的号段与卡的号段数量必须相同");
}
if (startCardId.length() != 20 || endCardId.length() != 20){
throw new ManagerException("卡号长度必须为20");
}
}
// if (ObuType.SINGLE_CHIP.equals(obuType)){
// if (cardType == null){
// throw new ManagerException("单片式OBU时,卡类型必填");
// }
// if (StringUtils.isEmpty(startCardId) || StringUtils.isEmpty(endCardId)){
// throw new ManagerException("单片式OBU时,卡的是的段号和结束段号必填");
// }
// int obuNUm = new BigInteger(endId).subtract(new BigInteger(startId)).intValueExact()+1;
// int cardNUm = new BigInteger(endCardId).subtract(new BigInteger(startCardId)).intValueExact()+1;
// if (obuNUm != cardNUm){
// throw new ManagerException("单片式OBU时,签的号段与卡的号段数量必须相同");
// }
// if (startCardId.length() != 20 || endCardId.length() != 20){
// throw new ManagerException("卡号长度必须为20");
// }
//
// }
}
}
}

+ 1
- 1
zhywpt-app-invw/src/main/java/cn/com/taiji/invw/dto/enter/InvwEnterApplyParseExcelRequestDTO.java Visa fil

@@ -15,7 +15,7 @@ import javax.validation.constraints.NotBlank;
* @email: huminghao@mail.taiji.com.cn
* @version: 1.0
*/
@ApiModel(description = "入库申请查看详情请求")
@ApiModel(description = "解析excel请求")
@Getter
@Setter
public class InvwEnterApplyParseExcelRequestDTO extends AbstractStaffBizRequestDTO {

+ 1
- 1
zhywpt-app-invw/src/main/java/cn/com/taiji/invw/dto/enter/InvwEnterApplyParseExcelResponseDTO.java Visa fil

@@ -15,7 +15,7 @@ import java.util.List;
* @email: huminghao@mail.taiji.com.cn
* @version: 1.0
*/
@ApiModel(description = "入库申请查看详情响应")
@ApiModel(description = "解析excel响应")
@Getter
@Setter
public class InvwEnterApplyParseExcelResponseDTO extends BaseModel {

+ 18
- 18
zhywpt-app-invw/src/main/java/cn/com/taiji/invw/dto/enter/InvwEnterApplyUpdateRequestDTO.java Visa fil

@@ -103,24 +103,24 @@ public class InvwEnterApplyUpdateRequestDTO extends AbstractStaffBizRequestDTO {
}
}

if (ObuType.SINGLE_CHIP.equals(obuType)){
if (cardType == null){
throw new ManagerException("单片式OBU时,卡类型必填");
}
for (EnterApplyDetailModel detailModel : enterApplyDetailModels) {
int obuNUm = new BigInteger(detailModel.getEndId()).subtract(new BigInteger(detailModel.getStartId())).intValueExact()+1;
int cardNUm = new BigInteger(detailModel.getEndCardId()).subtract(new BigInteger(detailModel.getStartCardId())).intValueExact()+1;
if (obuNUm != cardNUm){
throw new ManagerException("单片式OBU时,签的号段与卡的号段数量必须相同");
}
if (StringUtils.isEmpty(detailModel.getStartCardId()) || StringUtils.isEmpty(detailModel.getEndCardId())){
throw new ManagerException("单片式OBU时,卡的是的段号和结束段号必填");
}
if (detailModel.getStartCardId().length() != 20 || detailModel.getEndCardId().length() != 20){
throw new ManagerException("卡号长度必须为20");
}
}
}
// if (ObuType.SINGLE_CHIP.equals(obuType)){
// if (cardType == null){
// throw new ManagerException("单片式OBU时,卡类型必填");
// }
// for (EnterApplyDetailModel detailModel : enterApplyDetailModels) {
// int obuNUm = new BigInteger(detailModel.getEndId()).subtract(new BigInteger(detailModel.getStartId())).intValueExact()+1;
// int cardNUm = new BigInteger(detailModel.getEndCardId()).subtract(new BigInteger(detailModel.getStartCardId())).intValueExact()+1;
// if (obuNUm != cardNUm){
// throw new ManagerException("单片式OBU时,签的号段与卡的号段数量必须相同");
// }
// if (StringUtils.isEmpty(detailModel.getStartCardId()) || StringUtils.isEmpty(detailModel.getEndCardId())){
// throw new ManagerException("单片式OBU时,卡的是的段号和结束段号必填");
// }
// if (detailModel.getStartCardId().length() != 20 || detailModel.getEndCardId().length() != 20){
// throw new ManagerException("卡号长度必须为20");
// }
// }
// }
}
}


+ 16
- 16
zhywpt-app-invw/src/main/java/cn/com/taiji/invw/manager/enter/InvwEnterApplyManagerImpl.java Visa fil

@@ -160,7 +160,7 @@ public class InvwEnterApplyManagerImpl extends AbstractInvwManager implements In
@Transactional(rollbackFor = Exception.class)
public InvwEnterApplyCancelResponseDTO cancel(InvwEnterApplyCancelRequestDTO dto) throws ServiceHandleException {
InvwEnterApply enterApply = repo.findById(dto.getId()).orElse(null);
enterApply.setApplyStatus(InvApplyStatus.REJECT);
enterApply.setApplyStatus(InvApplyStatus.CANCEL);
enterApply.setReason(dto.getReason());
repo.merge(enterApply);
persistOperateLog(OperateType.CANCEL_ENTER_APPLY, enterApply.getId(), dto.getOrderSource(), findOpenIdByToken(dto.getAccessToken()), "取消入库");
@@ -182,12 +182,12 @@ public class InvwEnterApplyManagerImpl extends AbstractInvwManager implements In
if (!CollectionTools.isEmpty(detailsList)) {
throw new ManagerException("签号段已存在!");
}
if (ObuType.SINGLE_CHIP.equals(dto.getObuType())) {
List<InvwCardDetails> cardDetailsList = cardDetailsRepo.queryByCardIdBetween(dto.getStartCardId(), dto.getEndCardId());
if (!CollectionTools.isEmpty(cardDetailsList)) {
throw new ManagerException("卡号段已存在!");
}
}
// if (ObuType.SINGLE_CHIP.equals(dto.getObuType())) {
// List<InvwCardDetails> cardDetailsList = cardDetailsRepo.queryByCardIdBetween(dto.getStartCardId(), dto.getEndCardId());
// if (!CollectionTools.isEmpty(cardDetailsList)) {
// throw new ManagerException("卡号段已存在!");
// }
// }
}
return new InvwEnterApplyCodeValidResponseDTO(true);
}
@@ -195,7 +195,7 @@ public class InvwEnterApplyManagerImpl extends AbstractInvwManager implements In
@Override
public InvwEnterApplyParseExcelResponseDTO parseExcel(InvwEnterApplyParseExcelRequestDTO dto) throws ManagerException {
File file = minioUtil.getFileByUrl(dto.getExcelUrl());
List<EnterApplyDetailModel> modelList = EasyExcelUtil.readExcelColToModelList(file, EnterApplyDetailModel.class,0);
List<EnterApplyDetailModel> modelList = EasyExcelUtil.readExcelColToModelList(file, EnterApplyDetailModel.class,1);
return new InvwEnterApplyParseExcelResponseDTO(modelList);
}

@@ -292,14 +292,14 @@ public class InvwEnterApplyManagerImpl extends AbstractInvwManager implements In
throw new ManagerException("签号段已存在!");
}
}
if (ObuType.SINGLE_CHIP.equals(obuType)) {
for (EnterApplyDetailModel detailModel : detailModels) {
List<InvwCardDetails> detailsList = cardDetailsRepo.queryByCardIdBetween(detailModel.getStartCardId(), detailModel.getEndCardId());
if (!CollectionTools.isEmpty(detailsList)) {
throw new ManagerException("卡号段已存在!");
}
}
}
// if (ObuType.SINGLE_CHIP.equals(obuType)) {
// for (EnterApplyDetailModel detailModel : detailModels) {
// List<InvwCardDetails> detailsList = cardDetailsRepo.queryByCardIdBetween(detailModel.getStartCardId(), detailModel.getEndCardId());
// if (!CollectionTools.isEmpty(detailsList)) {
// throw new ManagerException("卡号段已存在!");
// }
// }
// }
}
}


+ 5
- 5
zhywpt-app-invw/src/main/java/cn/com/taiji/invw/model/enter/EnterApplyDetailModel.java Visa fil

@@ -22,9 +22,9 @@ public class EnterApplyDetailModel extends BaseModel {
@ExcelProperty(index = 1)
private String endId; //结束编码

@ExcelProperty(index = 2)
private String startCardId;//单片式OBU时有值
@ExcelProperty(index = 3)
private String endCardId;//单片式OBU时有值
// @ExcelProperty(index = 2)
// private String startCardId;//单片式OBU时有值
//
// @ExcelProperty(index = 3)
// private String endCardId;//单片式OBU时有值
}

Laddar…
Avbryt
Spara