Commit f55256b0 authored by 曹盼盼's avatar 曹盼盼

加耐压假数据

parent 8dee2924
package com.yeejoin.amos.boot.module.ugp.api.mapper; package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.SmartListDto; import com.yeejoin.amos.boot.module.ugp.api.dto.SmartListDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Verify; import com.yeejoin.amos.boot.module.ugp.api.entity.Verify;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...@@ -23,7 +24,7 @@ public interface VerifyMapper extends BaseMapper<Verify> { ...@@ -23,7 +24,7 @@ public interface VerifyMapper extends BaseMapper<Verify> {
* @return * @return
*/ */
List<Verify> commonality(String stage,SmartListDto smartListDto, List listId); Page<Verify> commonality(Page<Verify> page,String stage, SmartListDto smartListDto, List listId );
@Select("select * from tz_ugp_verify where target_info = #{targetInfo}") @Select("select * from tz_ugp_verify where target_info = #{targetInfo}")
Verify selectByTargetInfo(String targetInfo); Verify selectByTargetInfo(String targetInfo);
......
package com.yeejoin.amos.boot.module.ugp.biz.controller; package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.sun.org.apache.bcel.internal.generic.NEW;
import com.yeejoin.amos.boot.module.ugp.api.Enum.StageEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.StageEnum;
import com.yeejoin.amos.boot.module.ugp.api.dto.*; import com.yeejoin.amos.boot.module.ugp.api.dto.*;
import com.yeejoin.amos.boot.module.ugp.api.entity.Verify; import com.yeejoin.amos.boot.module.ugp.api.entity.Verify;
...@@ -304,8 +306,11 @@ public class VerifyController extends BaseController { ...@@ -304,8 +306,11 @@ public class VerifyController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/lookWeld") @GetMapping(value = "/lookWeld")
@ApiOperation(httpMethod = "GET", value = "耐压所属焊口查看", notes = "耐压所属焊口查看") @ApiOperation(httpMethod = "GET", value = "耐压所属焊口查看", notes = "耐压所属焊口查看")
public ResponseModel<JSONObject> lookWeld(@RequestParam Long sequenceNbr) { public ResponseModel<Page<Object>> lookWeld(@RequestParam Long sequenceNbr) {
return ResponseHelper.buildResponse(verifyServiceImpl.getWeldLook(sequenceNbr)); Page<Object> objectPage = new Page<>( );
JSONArray dataList = verifyServiceImpl.getWeldLook(sequenceNbr);
objectPage.setRecords(dataList);
return ResponseHelper.buildResponse(objectPage);
} }
} }
......
...@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.module.ugp.api.service.IVerifyService; ...@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.module.ugp.api.service.IVerifyService;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify; import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import jnr.ffi.Struct; import jnr.ffi.Struct;
import lombok.var;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -120,16 +121,11 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -120,16 +121,11 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
public Page<SmartListDto> commonality(String stage, Page<SmartListDto> page, SmartListDto smartListDto){ public Page<SmartListDto> commonality(String stage, Page<SmartListDto> page, SmartListDto smartListDto){
//新加获取项目列表 Page<Verify> objectPage = new Page<>( );
List<Project> projectList = projectResourceService.getProjectList( ); objectPage.setCurrent(page.getCurrent());
List<Long> listId = new ArrayList<>( ); objectPage.setSize(page.getSize());
for (Project project : projectList) { Page<Verify> pageDto=verifyMapper.commonality(objectPage,stage,smartListDto,null );
listId.add(project.getSequenceNbr()); List<Verify> verifyList =pageDto.getRecords();
}
List<Verify> verifyList=null;
if (listId != null && listId.size()>0) {
verifyList = verifyMapper.commonality(stage,smartListDto,listId);
}
List<SmartListDto> dtoList =new ArrayList<>(); List<SmartListDto> dtoList =new ArrayList<>();
//进入焊前 //进入焊前
if (verifyList !=null && verifyList.size() !=0){ if (verifyList !=null && verifyList.size() !=0){
...@@ -463,6 +459,36 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -463,6 +459,36 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
} }
//效验通过 //效验通过
this.addSuccessData(verify,null,jsonObject); this.addSuccessData(verify,null,jsonObject);
/**注意: app那边没有 暂时耐压假数据*/
Verify v1 = new Verify( );
JSONObject object = new JSONObject( );
object.put("pressureTest","10Mpa");
object.put("stage","耐压");
object.put("code",code);
object.put("pressureId",1587252459623968770L);
object.put("welderId",welderId);
object.put("photo","upload/ugp/amos_studio/E47A1E7D1BD4517B20923F108FC03F1.jpg");
object.put("location","经纬度");
object.put("projectId",projectId);
Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR));
int month = calendar.get(Calendar.MONTH) + 1;
int day = calendar.get(Calendar.DATE);
StringBuffer stringBuffer = new StringBuffer( );
stringBuffer.append(year).append(month).append(day).append("-")
.append(UUID.randomUUID().toString().substring(UUID.randomUUID().toString().length()-4));
jsonObject.put("pressureNumber",stringBuffer.toString());
String info = object.toJSONString();
v1.setTargetInfo(info);
v1.setProjectId(projectId);//项目id
v1.setType(TYPE);//检验方式
v1.setVerifyTime(time);
v1.setCode(code);
v1.setStage(StageEnum.管道耐压.getStage());
v1.setSubmitTime(time);
this.addSuccessData(v1,null,object);
} }
//耐压 //耐压
if (stage.equals(StageEnum.管道耐压.getVerifyName())){ if (stage.equals(StageEnum.管道耐压.getVerifyName())){
...@@ -677,12 +703,12 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -677,12 +703,12 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
verify.setStatus(VerifyEnum.已通过.getStatus()); verify.setStatus(VerifyEnum.已通过.getStatus());
try { try {
//智能监检管理表添加数据 //智能监检管理表添加数据
this.save(verify); this.save(verify);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace( ); e.printStackTrace( );
} }
//焊口表修改状态 //焊口表修改状态
if (codeArray ==null || codeArray.length==0) { if (codeArray ==null) {
String targetInfo = verify.getTargetInfo( ); String targetInfo = verify.getTargetInfo( );
JSONObject jsonObject = JSONObject.parseObject(targetInfo); JSONObject jsonObject = JSONObject.parseObject(targetInfo);
String code = jsonObject.getString("code");//获取焊口编号 String code = jsonObject.getString("code");//获取焊口编号
...@@ -706,7 +732,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -706,7 +732,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
} }
} }
} }
if (codeArray !=null && codeArray.length>0) { if (codeArray !=null) {
for (String code : codeArray) { for (String code : codeArray) {
if (!ValidationUtil.isEmpty(code)&& verify.getProjectId() !=null) { if (!ValidationUtil.isEmpty(code)&& verify.getProjectId() !=null) {
Weld weld=weldMapper.getWeldByCodeAndProjectId(code, verify.getProjectId()); Weld weld=weldMapper.getWeldByCodeAndProjectId(code, verify.getProjectId());
...@@ -847,18 +873,19 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -847,18 +873,19 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
} }
return oldPhoto; return oldPhoto;
} }
private static final String HEGE ="合格"; private static final String HEGE ="合格";
private static final String NOTHEGE ="不合格"; private static final String NOTHEGE ="不合格";
//耐压所属焊口查看 //耐压所属焊口查看
public JSONObject getWeldLook(Long sequenceNbr){ public JSONArray getWeldLook(Long sequenceNbr){
JSONObject object = new JSONObject( ); JSONObject object = new JSONObject( );
JSONArray jsonArray = new JSONArray( );
if (sequenceNbr != null) { if (sequenceNbr != null) {
Verify verify = verifyMapper.selectById(sequenceNbr); //耐压信息 Verify verify = verifyMapper.selectById(sequenceNbr); //耐压信息
if (verify != null ) { if (verify != null ) {
String codes = verify.getCode( ); String codes = verify.getCode( );
if (!ValidationUtil.isEmpty(codes)) { if (!ValidationUtil.isEmpty(codes)) {
String[] codeArray = codes.split(","); String[] codeArray = codes.split(",");
int num =1;
for (String code : codeArray) { for (String code : codeArray) {
//查工艺 //查工艺
object.put("code",code); object.put("code",code);
...@@ -895,7 +922,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -895,7 +922,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
object.put("peopleStatus",NOTHEGE); object.put("peopleStatus",NOTHEGE);
} }
} }
if (ve != null) { if (ve != null) {
String status = ve.getStatus(); String status = ve.getStatus();
if (VerifyEnum.已通过.getStatus().equals(status)) { if (VerifyEnum.已通过.getStatus().equals(status)) {
...@@ -915,10 +941,11 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -915,10 +941,11 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
} }
} }
} }
jsonArray.add(object);
} }
} }
} }
} }
return object; return jsonArray;
} }
} }
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