feat(bucket):新增回收桶时,增加一层判断;

master
jiyufei 3 months ago
parent cf1f356c37
commit 75c4327733

@ -43,4 +43,11 @@ public interface RecycleDeviceConfigService extends IService<RecycleDeviceConfig
* @return map * @return map
*/ */
Map<String, RecycleDeviceConfigEntity> getConfigs(List<String> companyIds); Map<String, RecycleDeviceConfigEntity> getConfigs(List<String> companyIds);
/**
*
*
* @return entity
*/
RecycleDeviceConfigEntity getConfig();
} }

@ -430,4 +430,13 @@ public class RecycleDeviceConfigServiceImpl extends ServiceImpl<RecycleDeviceCon
} }
return list.stream().collect(Collectors.toMap(RecycleDeviceConfigEntity::getCompanyId, Function.identity())); return list.stream().collect(Collectors.toMap(RecycleDeviceConfigEntity::getCompanyId, Function.identity()));
} }
@Override
public RecycleDeviceConfigEntity getConfig() {
//根据当前登陆人获取统一配置
LambdaQueryWrapper<RecycleDeviceConfigEntity> wrapper = new LambdaQueryWrapper<>(RecycleDeviceConfigEntity.class)
.eq(RecycleDeviceConfigEntity::getCompanyId, userProvider.get().getOrganizeId())
.isNull(RecycleDeviceConfigEntity::getDeleteMark);
return this.getOne(wrapper);
}
} }

@ -197,4 +197,10 @@ public class RecycleDeviceConfigController {
return ActionResult.success(recycleDeviceConfigMap); return ActionResult.success(recycleDeviceConfigMap);
} }
@Operation(summary = "获取统一配置")
@GetMapping()
public ActionResult getConfig() {
return ActionResult.success(recycleDeviceConfigService.getConfig());
}
} }

@ -1072,7 +1072,32 @@ export default {
this.$store.commit("generator/UPDATE_RELATION_DATA", {}); this.$store.commit("generator/UPDATE_RELATION_DATA", {});
}, },
// //
initDefaultData() {}, initDefaultData() {
request({
url: `/api/scm/RecycleDeviceConfig`,
method: "GET"
}).then(res => {
this.priceDesc = res.data.deliveryPrice;
this.useUnifiedConfig = true;
if (res.data.fullSet == 0) {
this.fullSetDesc = "关闭";
} else {
this.fullSetDesc = "开启";
}
this.usefullSetConfig = true;
if (res.data.smogSet == 0) {
this.smogSetDesc = "关闭";
} else {
this.smogSetDesc = "开启";
}
this.useSmogSetConfig = true;
this.closeDelayDesc = res.data.closeDelay;
this.closeDelayConfig = true;
res.data.closeDelay = null;
this.warningWeightDesc = res.data.warningWeight;
this.warningWeightConfig = true;
});
},
// //
dataFormSubmit(type) { dataFormSubmit(type) {
if (this.dataForm.price == null && !this.useUnifiedConfig) { if (this.dataForm.price == null && !this.useUnifiedConfig) {

@ -664,6 +664,18 @@ export default {
this.initData(); this.initData();
}, },
addOrUpdateHandle(row, isDetail) { addOrUpdateHandle(row, isDetail) {
if (row == undefined) {
request({
url: `/api/scm/RecycleDeviceConfig`,
method: "GET"
}).then(res => {
if (res.data === null || res.data == undefined) {
this.$message.error('当前组织下,无设备柜配置,请先配置!');
this.formVisible = false;
return;
}
});
}
let id = row ? row.id : ""; let id = row ? row.id : "";
this.formVisible = true; this.formVisible = true;
this.$nextTick(() => { this.$nextTick(() => {

Loading…
Cancel
Save