Commit e418e2b1 authored by qinhu's avatar qinhu

解决循环依赖

parent 84ed6ad9
......@@ -27,6 +27,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sun.org.apache.xpath.internal.operations.Bool;
import lombok.Data;
import net.bytebuddy.description.field.FieldDescription;
import org.apache.commons.io.filefilter.FalseFileFilter;
import org.apache.commons.lang3.StringUtils;
......@@ -2641,17 +2642,25 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
private String mapStringToMap(String str) {
str = str.substring(1, str.length() - 1);
String[] strs = str.split(",");
Map<String, String> map = new HashMap<>(strs.length);
for (String string : strs) {
String key = string.split(":")[0];
String value = string.split(":")[1];
map.put(key, value);
}
List<MapObj> mapObjs = JSON.parseArray(str, MapObj.class);
Map<String,String> map = new HashMap<>();
mapObjs.forEach(arg->map.put(arg.getName(),arg.getValue()));
return JSON.toJSONString(map);
}
@Data
public static class MapObj{
String name;
String value;
}
/**
* 根据样品检测列表获取报告管理首页
*
......
......@@ -18,6 +18,7 @@ import cn.wise.sc.cement.business.entity.SysGroup;
import cn.wise.sc.cement.business.entity.SysPost;
import cn.wise.sc.cement.business.entity.SysUser;
import cn.wise.sc.cement.business.entity.TeamGroup;
import cn.wise.sc.cement.business.mapper.EntrustMapper;
import cn.wise.sc.cement.business.mapper.PrecipriceMapper;
import cn.wise.sc.cement.business.model.BaseResponse;
import cn.wise.sc.cement.business.model.LoginUser;
......@@ -75,7 +76,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
final
IEntrustService iEntrustService;
EntrustMapper iEntrustService;
final
ISampleService iSampleService;
final
......@@ -97,7 +98,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
final
ISampleDistributionService iSampleDistributionService;
public PrecipriceServiceImpl(IEntrustService iEntrustService,
public PrecipriceServiceImpl(EntrustMapper iEntrustService,
ISampleService iSampleService,
INormProductionService iNormProductionService,
ISysUserService iSysUserService,
......@@ -133,7 +134,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
Assert.notNull(sampleId, "样品id不能为空!");
Assert.notNull(type, "处理项类型不能为空!");
//获取项目编号和名字
Entrust entrust = iEntrustService.getById(entrustId);
Entrust entrust = iEntrustService.selectById(entrustId);
if (BeanUtil.isEmpty(entrust)) {
log.debug("产值记录新增失败,项目没找到!");
throw new IllegalArgumentException("无效的项目id!");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment