@@ -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"); | |||
// } | |||
// } | |||
// } | |||
} | |||
} | |||
} |
@@ -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"); | |||
// } | |||
// | |||
// } | |||
} | |||
} | |||
} |
@@ -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 { |
@@ -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 { |
@@ -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"); | |||
// } | |||
// } | |||
// } | |||
} | |||
} | |||
@@ -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("卡号段已存在!"); | |||
// } | |||
// } | |||
// } | |||
} | |||
} | |||
@@ -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时有值 | |||
} |