|
|
@@ -8,6 +8,7 @@ import com.github.pagehelper.PageInfo;
|
|
|
import com.sckw.core.model.constant.Global;
|
|
|
import com.sckw.core.model.page.PageRes;
|
|
|
import com.sckw.core.utils.IdWorker;
|
|
|
+import com.sckw.core.utils.StringUtils;
|
|
|
import com.sckw.core.utils.TenantUtil;
|
|
|
import com.sckw.core.web.response.HttpResult;
|
|
|
import com.sckw.mine.common.OrderServerCommon;
|
|
|
@@ -17,6 +18,7 @@ import com.sckw.mine.entity.req.MineralAggregateInsertParam;
|
|
|
import com.sckw.mine.entity.req.MineralAggregateUpdateParam;
|
|
|
import com.sckw.mine.entity.res.KwBusinessMineralAggregateDetailRes;
|
|
|
import com.sckw.mine.entity.res.MineralAggregateListRes;
|
|
|
+import com.sckw.mine.enums.MineralAggregateTypeEnum;
|
|
|
import com.sckw.mine.mapper.MineralAggregateMapper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -87,21 +89,31 @@ public class MineralAggregateService {
|
|
|
throw new RuntimeException("当前名称已存在");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
int ret = mineralAggregateMapper.aggreUpdate(param);
|
|
|
return ret>0?HttpResult.ok():HttpResult.error();
|
|
|
}
|
|
|
|
|
|
|
|
|
public KwBusinessMineralAggregateDetailRes detail(String id) {
|
|
|
- return mineralAggregateMapper.load(id);
|
|
|
+ KwBusinessMineralAggregateDetailRes load = mineralAggregateMapper.load(id);
|
|
|
+ load.setStatusStr(load.getStatus()==1?"启用":"禁用");
|
|
|
+ load.setTypeStr(MineralAggregateTypeEnum.getNameByCode(load.getType()));
|
|
|
+ return load;
|
|
|
}
|
|
|
|
|
|
|
|
|
public HttpResult pageList(MineralAggPageListParam param) {
|
|
|
|
|
|
+ String tenant = TenantUtil.getTenant();
|
|
|
+ if (StringUtils.isNotBlank(tenant)) {
|
|
|
+ param.setTenantId(tenant);
|
|
|
+ }
|
|
|
PageHelper.startPage(param.getPage(), param.getPageSize());
|
|
|
List<MineralAggregateListRes> businessTruckPageListRes = mineralAggregateMapper.mineAggregatePageList(param);
|
|
|
+ businessTruckPageListRes.forEach(e -> {
|
|
|
+ e.setTypeStr(MineralAggregateTypeEnum.getNameByCode(e.getType()));
|
|
|
+ e.setStatusStr(e.getStatus()==1?"启用":"禁用");
|
|
|
+ });
|
|
|
return HttpResult.ok(new PageRes<>(new PageInfo<>(businessTruckPageListRes)));
|
|
|
}
|
|
|
|