|
|
@ -64,6 +64,9 @@ public class EquipmentRentalRecordsServiceImpl extends ServiceImpl<EquipmentRent
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private EquipmentService equipmentService;
|
|
|
|
private EquipmentService equipmentService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private EnterpriseMerchantsService enterpriseMerchantsService;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<EquipmentRentalRecordsEntity> getList(EquipmentRentalRecordsPagination equipmentRentalRecordsPagination) {
|
|
|
|
public List<EquipmentRentalRecordsEntity> getList(EquipmentRentalRecordsPagination equipmentRentalRecordsPagination) {
|
|
|
|
return getTypeList(equipmentRentalRecordsPagination, equipmentRentalRecordsPagination.getDataType());
|
|
|
|
return getTypeList(equipmentRentalRecordsPagination, equipmentRentalRecordsPagination.getDataType());
|
|
|
@ -311,7 +314,7 @@ public class EquipmentRentalRecordsServiceImpl extends ServiceImpl<EquipmentRent
|
|
|
|
public String update(String id, EquipmentRentalRecordsEntity entity) {
|
|
|
|
public String update(String id, EquipmentRentalRecordsEntity entity) {
|
|
|
|
//判断设备是否是可用状态
|
|
|
|
//判断设备是否是可用状态
|
|
|
|
EquipmentEntity equipment = equipmentService.getById(entity.getEquipmentId());
|
|
|
|
EquipmentEntity equipment = equipmentService.getById(entity.getEquipmentId());
|
|
|
|
if ("1".equals(equipment.getStatus())){
|
|
|
|
if ("1".equals(equipment.getStatus())) {
|
|
|
|
return "该设备未归还,不可删除!";
|
|
|
|
return "该设备未归还,不可删除!";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//异步更改状态
|
|
|
|
//异步更改状态
|
|
|
@ -372,13 +375,14 @@ public class EquipmentRentalRecordsServiceImpl extends ServiceImpl<EquipmentRent
|
|
|
|
equipmentRentalRecordsForm = JsonUtil.getJsonToBean(
|
|
|
|
equipmentRentalRecordsForm = JsonUtil.getJsonToBean(
|
|
|
|
generaterSwapUtil.swapDatetime(EquipmentRentalRecordsConstant.getFormData(), equipmentRentalRecordsForm), EquipmentRentalRecordsForm.class);
|
|
|
|
generaterSwapUtil.swapDatetime(EquipmentRentalRecordsConstant.getFormData(), equipmentRentalRecordsForm), EquipmentRentalRecordsForm.class);
|
|
|
|
EquipmentRentalRecordsEntity entity = JsonUtil.getJsonToBean(equipmentRentalRecordsForm, EquipmentRentalRecordsEntity.class);
|
|
|
|
EquipmentRentalRecordsEntity entity = JsonUtil.getJsonToBean(equipmentRentalRecordsForm, EquipmentRentalRecordsEntity.class);
|
|
|
|
|
|
|
|
EquipmentEntity equipment = equipmentService.getById(equipmentRentalRecordsForm.getEquipmentId());
|
|
|
|
|
|
|
|
if (ObjectUtil.isNotNull(equipment)) {
|
|
|
|
|
|
|
|
entity.setEquipmentCoding(equipment.getCode());
|
|
|
|
|
|
|
|
entity.setEquipmentName(equipment.getName());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
String merchantName = enterpriseMerchantsService.findNameById(equipmentRentalRecordsForm.getMerchantId());
|
|
|
|
if (isSave) {
|
|
|
|
if (isSave) {
|
|
|
|
//查询设备
|
|
|
|
//查询设备
|
|
|
|
EquipmentEntity equipment = equipmentService.getById(equipmentRentalRecordsForm.getEquipmentId());
|
|
|
|
|
|
|
|
if (ObjectUtil.isNotNull(equipment)){
|
|
|
|
|
|
|
|
entity.setEquipmentCoding(equipment.getCode());
|
|
|
|
|
|
|
|
entity.setEquipmentName(equipment.getName());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
String mainId = RandomUtil.uuId();
|
|
|
|
String mainId = RandomUtil.uuId();
|
|
|
|
entity.setCreationTime(DateUtil.getNowDate());
|
|
|
|
entity.setCreationTime(DateUtil.getNowDate());
|
|
|
|
entity.setId(mainId);
|
|
|
|
entity.setId(mainId);
|
|
|
@ -390,6 +394,7 @@ public class EquipmentRentalRecordsServiceImpl extends ServiceImpl<EquipmentRent
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
entity.setCreationTime(DateUtil.getNowDate());
|
|
|
|
entity.setCreationTime(DateUtil.getNowDate());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
entity.setMerchantName(merchantName);
|
|
|
|
boolean result = this.saveOrUpdate(entity);
|
|
|
|
boolean result = this.saveOrUpdate(entity);
|
|
|
|
if (result) {
|
|
|
|
if (result) {
|
|
|
|
String status;
|
|
|
|
String status;
|
|
|
|