|
|
@@ -13,9 +13,11 @@ import com.sckw.core.utils.TenantUtil;
|
|
|
import com.sckw.core.web.response.HttpResult;
|
|
|
import com.sckw.mine.common.OrderServerCommon;
|
|
|
import com.sckw.mine.entity.KwBusinessMineralAggregate;
|
|
|
+import com.sckw.mine.entity.KwBusinessNode;
|
|
|
import com.sckw.mine.entity.req.MineralAggPageListParam;
|
|
|
import com.sckw.mine.entity.req.MineralAggregateInsertParam;
|
|
|
import com.sckw.mine.entity.req.MineralAggregateUpdateParam;
|
|
|
+import com.sckw.mine.entity.req.StatusActionReq;
|
|
|
import com.sckw.mine.entity.res.KwBusinessMineralAggregateDetailRes;
|
|
|
import com.sckw.mine.entity.res.MineralAggregateListRes;
|
|
|
import com.sckw.mine.enums.MineralAggregateTypeEnum;
|
|
|
@@ -96,7 +98,7 @@ public class MineralAggregateService {
|
|
|
public KwBusinessMineralAggregateDetailRes detail(String id) {
|
|
|
KwBusinessMineralAggregateDetailRes load = mineralAggregateMapper.load(id);
|
|
|
load.setStatusStr(load.getStatus()==1?"启用":"禁用");
|
|
|
- load.setTypeStr(MineralAggregateTypeEnum.getNameByCode(load.getType()));
|
|
|
+ load.setTypeStr(MineralAggregateTypeEnum.getNameByCode(Integer.valueOf(load.getType())));
|
|
|
return load;
|
|
|
}
|
|
|
|
|
|
@@ -110,11 +112,40 @@ public class MineralAggregateService {
|
|
|
PageHelper.startPage(param.getPage(), param.getPageSize());
|
|
|
List<MineralAggregateListRes> businessTruckPageListRes = mineralAggregateMapper.mineAggregatePageList(param);
|
|
|
businessTruckPageListRes.forEach(e -> {
|
|
|
- e.setTypeStr(MineralAggregateTypeEnum.getNameByCode(e.getType()));
|
|
|
+ if (ObjectUtils.isNotNull(e.getType())){
|
|
|
+ e.setTypeStr(MineralAggregateTypeEnum.getNameByCode(Integer.valueOf(e.getType())));
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotNull(e.getUnit())){
|
|
|
+ e.setUnitStr(e.getUnit()=="1"?"吨":"件");
|
|
|
+ }
|
|
|
e.setStatusStr(e.getStatus()==1?"启用":"禁用");
|
|
|
- e.setUnitStr(e.getUnit()==1?"吨":"件");
|
|
|
});
|
|
|
return HttpResult.ok(new PageRes<>(new PageInfo<>(businessTruckPageListRes)));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @Description: 状态操作(停用 启用) 1=启用 2=禁用
|
|
|
+ * @Author: Lt
|
|
|
+ * @Date: 2024/5/31 11:34
|
|
|
+ */
|
|
|
+ public HttpResult statusAction(StatusActionReq param)
|
|
|
+ {
|
|
|
+ if (StringUtils.isBlank(param.getId())) {
|
|
|
+ throw new RuntimeException("id必填");
|
|
|
+ }
|
|
|
+ if(param.getStatus()==null) {
|
|
|
+ throw new RuntimeException("状态必填");
|
|
|
+ }
|
|
|
+ KwBusinessMineralAggregate kwBusinessNode = mineralAggregateMapper.selectById(param.getId());
|
|
|
+ if (ObjectUtils.isNull(kwBusinessNode)) {
|
|
|
+ throw new RuntimeException("当前数据不存在,请检查");
|
|
|
+ }
|
|
|
+
|
|
|
+ int i = mineralAggregateMapper.statusAction(param.getId(), param.getStatus());
|
|
|
+ if (i>0) {
|
|
|
+ return HttpResult.ok("操作成功");
|
|
|
+ }
|
|
|
+ return HttpResult.error("操作失败");
|
|
|
+ }
|
|
|
+
|
|
|
}
|