|
|
@@ -11,6 +11,7 @@ import com.yunfeiyun.agmp.common.utils.img.enums.BusType;
|
|
|
import com.yunfeiyun.agmp.common.web.system.domain.SysCusarea;
|
|
|
import com.yunfeiyun.agmp.common.web.system.domain.SysRes;
|
|
|
import com.yunfeiyun.agmp.common.web.system.service.ISysCusareaService;
|
|
|
+import com.yunfeiyun.agmp.common.web.system.service.ISysResService;
|
|
|
import com.yunfeiyun.agmp.tss.domain.*;
|
|
|
import com.yunfeiyun.agmp.tss.domain.reqvo.SelectCountOfScreenReqVo;
|
|
|
import com.yunfeiyun.agmp.tss.domain.reqvo.TssTracecodeapplyReqVo;
|
|
|
@@ -51,6 +52,8 @@ public class TssTracecodeapplyServiceImpl implements ITssTracecodeapplyService {
|
|
|
|
|
|
@Resource
|
|
|
private ResManager resManager;
|
|
|
+ @Resource
|
|
|
+ private ISysResService sysResService;
|
|
|
|
|
|
@Resource
|
|
|
private WmsFinishgoodsMapper wmsFinishgoodsMapper;
|
|
|
@@ -199,14 +202,14 @@ public class TssTracecodeapplyServiceImpl implements ITssTracecodeapplyService {
|
|
|
TssSourceinfo tssSourceinfo = tssSourceinfoMapper.selectTssSourceinfoByTarcecodeapplyno(tarcecodeapplyno,tid);
|
|
|
result.put("sourceInfoName",tssSourceinfo.getSourceinfoName());
|
|
|
// 查询农产品头像
|
|
|
- List<SysRes> goodsImg = resManager.queryRes(tssSourceinfo.getSourceinfoId(),ResConstants.BizType.SOURCE_INFO_AVATAR.getKey());
|
|
|
+ List<SysRes> goodsImg = sysResService.selectResByBusIdAndTid(tssSourceinfo.getSourceinfoId(),ResConstants.BizType.SOURCE_INFO_AVATAR.getKey(),tid);
|
|
|
if(!goodsImg.isEmpty()){
|
|
|
// 写入农产品头像
|
|
|
result.put("goodsImg",goodsImg.get(0).getResUrl());
|
|
|
}
|
|
|
|
|
|
if(tssSourceinfo.getSourceinfoFiguretatus().equals("1")){
|
|
|
- List<SysRes> figureRes = resManager.queryRes(tssSourceinfo.getSourceinfoId(),ResConstants.BizType.SOURCE_INFO_FIGURE.getKey());
|
|
|
+ List<SysRes> figureRes = sysResService.selectResByBusIdAndTid(tssSourceinfo.getSourceinfoId(),ResConstants.BizType.SOURCE_INFO_FIGURE.getKey(),tid);
|
|
|
packageFigureObject(result,figureRes);
|
|
|
}else {
|
|
|
MppTask mppTaskQuery = new MppTask();
|
|
|
@@ -214,7 +217,7 @@ public class TssTracecodeapplyServiceImpl implements ITssTracecodeapplyService {
|
|
|
mppTaskQuery.setStockId(tssTracecodeapply.get(0).getStockId());
|
|
|
List<MppTask> mppTaskList = mppTaskMapper.selectMppTaskList(mppTaskQuery);
|
|
|
if(!mppTaskList.isEmpty()){
|
|
|
- List<SysRes> figureRes = resManager.queryRes(mppTaskList.get(0).getTaskId(),ResConstants.BizType.FINISH_GOODS_PERIOD.getKey());
|
|
|
+ List<SysRes> figureRes = sysResService.selectResByBusIdAndTid(mppTaskList.get(0).getTaskId(),ResConstants.BizType.FINISH_GOODS_PERIOD.getKey(),tid);
|
|
|
packageFigureObject(result,figureRes);
|
|
|
}
|
|
|
}
|
|
|
@@ -223,7 +226,7 @@ public class TssTracecodeapplyServiceImpl implements ITssTracecodeapplyService {
|
|
|
// 查询质检记录
|
|
|
if(tssSourceinfo.getSourceinfoQualitystatus().equals("1")){
|
|
|
qualityBizId = tssSourceinfo.getSourceinfoId();
|
|
|
- sysRes = resManager.queryRes(qualityBizId,ResConstants.BizType.SOURCE_INFO_QUALITY.getKey());
|
|
|
+ sysRes = sysResService.selectResByBusIdAndTid(qualityBizId,ResConstants.BizType.SOURCE_INFO_QUALITY.getKey(),tid);
|
|
|
}else {
|
|
|
MppQualitycheck mppQualitycheckQuery = new MppQualitycheck();
|
|
|
mppQualitycheckQuery.setFinishgoodsId(wmsFinishgoods.getFinishgoodsId());
|
|
|
@@ -233,7 +236,7 @@ public class TssTracecodeapplyServiceImpl implements ITssTracecodeapplyService {
|
|
|
throw new BizException(ErrorCode.MPP_QUALITY_CHECK_NOT_EXIST);
|
|
|
}
|
|
|
qualityBizId = mppQualitycheckList.get(0).getQualitycheckId();
|
|
|
- sysRes = resManager.queryRes(qualityBizId,ResConstants.BizType.MPPQUALITYCHECK.getKey());
|
|
|
+ sysRes = sysResService.selectResByBusIdAndTid(qualityBizId,ResConstants.BizType.MPPQUALITYCHECK.getKey(),tid);
|
|
|
}
|
|
|
List<String> qualityCheckUrls = sysRes.stream().map(SysRes::getResUrl).collect(Collectors.toList());
|
|
|
JSONObject qualityCheckInfo = new JSONObject();
|
|
|
@@ -257,7 +260,8 @@ public class TssTracecodeapplyServiceImpl implements ITssTracecodeapplyService {
|
|
|
TssSourceperiod tssSourceperiodQuery = new TssSourceperiod();
|
|
|
tssSourceperiodQuery.setSourceinfoId(tssSourceinfo.getSourceinfoId());
|
|
|
tssSourceperiodQuery.setSourceperiodParentid("0");
|
|
|
- List<TssSourceperiod> tssSourceperiodList = tssSourceperiodMapper.selectTssSourceperiodWithResList(tssSourceperiodQuery, PolicyService.enabledOssCloudPolicy());
|
|
|
+ tssSourceperiodQuery.setTid(tid);
|
|
|
+ List<TssSourceperiod> tssSourceperiodList = tssSourceperiodMapper.selectTssSourceperiodWithResList(tssSourceperiodQuery, PolicyService.enabledOssCloudPolicy(),tid);
|
|
|
packageSourcePeriod(result,tssSourceperiodList);
|
|
|
|
|
|
}else {
|
|
|
@@ -280,7 +284,8 @@ public class TssTracecodeapplyServiceImpl implements ITssTracecodeapplyService {
|
|
|
tssSourceEnvironment.setTid(tid);
|
|
|
List<TssSourceEnvironment> tssSourceEnvironments = tssSourceEnvironmentMapper.selectTssSourceEnvironmentList(tssSourceEnvironment);
|
|
|
for(TssSourceEnvironment tssSourceEnvironment1 : tssSourceEnvironments){
|
|
|
- List<SysRes> environmentRes = resManager.queryRes(tssSourceEnvironment1.getSourceEnvironmentId(),ResConstants.BizType.SOURCE_INFO_ENVIRONMENT.getKey());
|
|
|
+
|
|
|
+ List<SysRes> environmentRes = sysResService.selectResByBusIdAndTid(tssSourceEnvironment1.getSourceEnvironmentId(),ResConstants.BizType.SOURCE_INFO_ENVIRONMENT.getKey(),tid);
|
|
|
if(environmentRes.size() > 0){
|
|
|
tssSourceEnvironment1.setEnvironmentResIds(environmentRes.get(0).getResId());
|
|
|
tssSourceEnvironment1.setEnvironmentPreviews(environmentRes.get(0).getResUrl());
|
|
|
@@ -307,14 +312,14 @@ public class TssTracecodeapplyServiceImpl implements ITssTracecodeapplyService {
|
|
|
tssSourceperiodQuery.setSourceperiodParentid(tssSourceperiodId);
|
|
|
tssSourceperiodQuery.setTid(tid);
|
|
|
List<TssSourceperiod> tssSourceperiodList = tssSourceperiodMapper.selectTssSourceperiodList(tssSourceperiodQuery);
|
|
|
- packageSourcePeriodInfo(result,tssSourceperiodList);
|
|
|
+ packageSourcePeriodInfo(result,tssSourceperiodList,tid);
|
|
|
|
|
|
}else {
|
|
|
TssGoodsperiodrcd tssGoodsperiodrcd = new TssGoodsperiodrcd();
|
|
|
tssGoodsperiodrcd.setTid(tid);
|
|
|
tssGoodsperiodrcd.setGoodsperiodrcdParentid(tssSourceperiodId);
|
|
|
List<TssGoodsperiodrcd> tssGoodsperiodrcds = tssGoodsperiodrcdMapper.selectTssGoodsperiodrcdList(tssGoodsperiodrcd);
|
|
|
- packageGoodsPeriodInfo(result,tssGoodsperiodrcds);
|
|
|
+ packageGoodsPeriodInfo(result,tssGoodsperiodrcds,tid);
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
@@ -356,7 +361,7 @@ public class TssTracecodeapplyServiceImpl implements ITssTracecodeapplyService {
|
|
|
JSONObject checkComponyJSON = JSONObject.from(checkCompony);
|
|
|
checkComponyJSON.put("qualityInspector",mppQualitycheck.getQualityInspector());
|
|
|
result.put("checkCompony",checkComponyJSON);
|
|
|
- List<SysRes> sysResList = resManager.queryRes(wmsFinishgoods.getFinishgoodsId(),ResConstants.BizType.FINISH_GOODS_OUT_ADD_PERIOD.getKey());
|
|
|
+ List<SysRes> sysResList = sysResService.selectResByBusIdAndTid(wmsFinishgoods.getFinishgoodsId(),ResConstants.BizType.FINISH_GOODS_OUT_ADD_PERIOD.getKey(),tid);
|
|
|
result.put("processImgs",sysResList);
|
|
|
return result;
|
|
|
}
|
|
|
@@ -399,9 +404,9 @@ public class TssTracecodeapplyServiceImpl implements ITssTracecodeapplyService {
|
|
|
}).collect(Collectors.toList());
|
|
|
result.put("tssSourceperiod",tssSourceperiodList);
|
|
|
}
|
|
|
- public void packageSourcePeriodInfo(JSONObject result,List<TssSourceperiod> periods){
|
|
|
+ public void packageSourcePeriodInfo(JSONObject result,List<TssSourceperiod> periods,String tid){
|
|
|
List<JSONObject> tssSourceperiodList = periods.stream().sorted(Comparator.comparing(TssSourceperiod::getSourceperiodFmstaskrcdcreateddate)).map(item->{
|
|
|
- List<SysRes> sysResList = resManager.queryRes(item.getSourceperiodId(),null);
|
|
|
+ List<SysRes> sysResList = sysResService.selectResByBusIdAndTid(item.getSourceperiodId(),ResConstants.BizType.PERIOD.getKey(),tid );
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("id",item.getSourceperiodId());
|
|
|
jsonObject.put("date",item.getSourceperiodFmstaskrcdcreateddate());
|
|
|
@@ -412,9 +417,9 @@ public class TssTracecodeapplyServiceImpl implements ITssTracecodeapplyService {
|
|
|
}).collect(Collectors.toList());
|
|
|
result.put("tssSourceperiod",tssSourceperiodList);
|
|
|
}
|
|
|
- public void packageGoodsPeriodInfo(JSONObject result,List<TssGoodsperiodrcd> periods){
|
|
|
+ public void packageGoodsPeriodInfo(JSONObject result,List<TssGoodsperiodrcd> periods,String tid){
|
|
|
List<JSONObject> tssSourceperiodList = periods.stream().sorted(Comparator.comparing(TssGoodsperiodrcd::getGoodsperiodrcdFmstaskcreateddate)).map(item->{
|
|
|
- List<SysRes> sysResList = resManager.queryRes(item.getGoodsperiodrcdId(),null);
|
|
|
+ List<SysRes> sysResList = sysResService.selectResByBusIdAndTid(item.getGoodsperiodrcdId(),ResConstants.BizType.PERIOD.getKey(),tid);
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("id",item.getGoodsperiodrcdId());
|
|
|
jsonObject.put("date",item.getGoodsperiodrcdFmstaskcreateddate());
|