|
@@ -7,12 +7,14 @@ import com.huimv.receive.common.utils.Result;
|
|
|
import com.huimv.receive.common.utils.ResultCode;
|
|
|
import com.huimv.receive.entity.BaseLocation;
|
|
|
import com.huimv.receive.entity.BaseProcess;
|
|
|
+import com.huimv.receive.entity.vo.BaseProcessVo;
|
|
|
import com.huimv.receive.mapper.BaseProcessMapper;
|
|
|
import com.huimv.receive.service.IBaseLocationService;
|
|
|
import com.huimv.receive.service.IBaseProcessService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -30,24 +32,22 @@ public class BaseProcessServiceImpl extends ServiceImpl<BaseProcessMapper, BaseP
|
|
|
@Autowired
|
|
|
private IBaseLocationService baseLocationService;
|
|
|
@Override
|
|
|
- public Result getOne(Integer userId ,String farmId,String vistitType) {
|
|
|
- BaseProcess one = this.getOne(new QueryWrapper<BaseProcess>().eq("admission_user_id", userId).orderByDesc("id").last("limit 1"));
|
|
|
- if (ObjectUtil.isNotEmpty(one)){
|
|
|
- return new Result(ResultCode.SUCCESS,one);
|
|
|
+ public Result getOne(Map<String, String> map) {
|
|
|
+ String id = map.get("processId");
|
|
|
+ BaseProcess byId = this.getById(id);
|
|
|
+ String[] allLocation = byId.getAllLocation().split(",");
|
|
|
+ String[] allLocationId = byId.getAllLocationId().split(",");
|
|
|
+ String[] allLocationStatus = byId.getAllLocationStatus().split(",");
|
|
|
+ List list = new ArrayList();
|
|
|
+ for (int i = 0; i < allLocation.length; i++) {
|
|
|
+ BaseProcessVo baseProcessVo = new BaseProcessVo();
|
|
|
+ baseProcessVo.setAllLocation(allLocation[i]);
|
|
|
+ baseProcessVo.setAllLocationId(allLocationId[i]);
|
|
|
+ baseProcessVo.setAllLocationSatus(allLocationStatus[i]);
|
|
|
+ list.add(baseProcessVo);
|
|
|
}
|
|
|
- BaseProcess baseProcess = new BaseProcess();
|
|
|
- List<BaseLocation> list = baseLocationService.list(new QueryWrapper<BaseLocation>().eq("farm_id", farmId).eq("vistit_type", vistitType));
|
|
|
- StringBuilder allLocation = new StringBuilder();
|
|
|
- StringBuilder allLocationId = new StringBuilder();
|
|
|
- StringBuilder allLocationStatus = new StringBuilder();
|
|
|
- for (BaseLocation baseLocation : list) {
|
|
|
- allLocation.append(baseLocation.getLocationName()).append(",");
|
|
|
- allLocationId.append(baseLocation.getId()).append(",");
|
|
|
- allLocationStatus.append("0").append(",");
|
|
|
- }
|
|
|
- baseProcess.setAllLocation(allLocation.toString());
|
|
|
- baseProcess.setAllLocationId(allLocationId.toString());
|
|
|
- baseProcess.setAllLocationStatus(allLocationStatus.toString());
|
|
|
- return new Result(ResultCode.SUCCESS,baseProcess);
|
|
|
+
|
|
|
+
|
|
|
+ return new Result(ResultCode.SUCCESS,list);
|
|
|
}
|
|
|
}
|