Commit 9f4ef69e authored by tianyiming's avatar tianyiming

编辑及列表不能分页

parent ad73ca01
...@@ -216,6 +216,14 @@ public class SuperviseController { ...@@ -216,6 +216,14 @@ public class SuperviseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "数据状态修改")
@PostMapping(value = "/update/dateStatus")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<Object> updateStatus(@RequestBody Map<String, Object> map) {
return ResponseHelper.buildResponse(createCodeService.updateStatus(map));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "检验检测信息") @ApiOperation(value = "检验检测信息")
@GetMapping(value = "/inspectionInfo") @GetMapping(value = "/inspectionInfo")
@RestEventTrigger(value = "openapiLogEventHandler") @RestEventTrigger(value = "openapiLogEventHandler")
......
...@@ -14,4 +14,8 @@ public class CreateCodeService { ...@@ -14,4 +14,8 @@ public class CreateCodeService {
public Map<String,Object> createCode(Map<String, Object> map) { public Map<String,Object> createCode(Map<String, Object> map) {
return tzsServiceFeignClient.createCode(map).getResult(); return tzsServiceFeignClient.createCode(map).getResult();
} }
public Object updateStatus(Map<String, Object> map) {
return tzsServiceFeignClient.updateStatus(map).getResult();
}
} }
...@@ -14,7 +14,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -14,7 +14,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@FeignClient(name = "TZS", path = "/tzs", configuration = @FeignClient(name = "TZS-tym", path = "/tzs", configuration =
{MultipartSupportConfig.class}) {MultipartSupportConfig.class})
public interface TzsServiceFeignClient { public interface TzsServiceFeignClient {
...@@ -37,6 +37,16 @@ public interface TzsServiceFeignClient { ...@@ -37,6 +37,16 @@ public interface TzsServiceFeignClient {
@RequestMapping(value = "/equipment-category/createSupervisorCode", method = RequestMethod.POST) @RequestMapping(value = "/equipment-category/createSupervisorCode", method = RequestMethod.POST)
ResponseModel<Map<String, Object>> createCode(@RequestBody Map<String, Object> map); ResponseModel<Map<String, Object>> createCode(@RequestBody Map<String, Object> map);
/**
* 修改数据状态
*
* @param map 请求体
* @return
*/
@RequestMapping(value = "/equipment-category/updateOtherInfo", method = RequestMethod.POST)
ResponseModel<Object> updateStatus(@RequestBody Map<String, Object> map);
/** /**
* 检验检测信息(查询) * 检验检测信息(查询)
* *
......
...@@ -64,4 +64,8 @@ public class CategoryOtherInfo{ ...@@ -64,4 +64,8 @@ public class CategoryOtherInfo{
@ApiModelProperty(value = "认领状态:6035代表已认领,6036代表待认领,6037代表拒领") @ApiModelProperty(value = "认领状态:6035代表已认领,6036代表待认领,6037代表拒领")
@TableField("CLAIM_STATUS") @TableField("CLAIM_STATUS")
private String claimStatus; private String claimStatus;
@ApiModelProperty(value = "编辑状态")
@TableField("EDIT_STATUS")
private String editStatus;
} }
...@@ -23,4 +23,5 @@ public interface CategoryOtherInfoMapper extends BaseMapper<CategoryOtherInfo> { ...@@ -23,4 +23,5 @@ public interface CategoryOtherInfoMapper extends BaseMapper<CategoryOtherInfo> {
int updateCode(String supervisorCode, String equState); int updateCode(String supervisorCode, String equState);
int updateOtherInfo(String supervisorCode, String editStatus);
} }
...@@ -30,4 +30,6 @@ public interface IEquipmentCategoryService { ...@@ -30,4 +30,6 @@ public interface IEquipmentCategoryService {
Map<String,Object> getCategoryAndDefineByRecord(String rowId); Map<String,Object> getCategoryAndDefineByRecord(String rowId);
List<CategoryOtherInfo> checkCode(Map<String,Object> obj); List<CategoryOtherInfo> checkCode(Map<String,Object> obj);
List<String> updateOtherInfo(Map<String, Object> map);
} }
...@@ -57,4 +57,11 @@ ...@@ -57,4 +57,11 @@
SET status = #{equState} SET status = #{equState}
WHERE SUPERVISORY_CODE = #{supervisorCode} WHERE SUPERVISORY_CODE = #{supervisorCode}
</update> </update>
<update id="updateOtherInfo">
UPDATE idx_biz_jg_other_info
SET "EDIT_STATUS" = #{editStatus}
WHERE "SUPERVISORY_CODE" = #{supervisorCode}
</update>
</mapper> </mapper>
...@@ -198,6 +198,17 @@ public class EquipmentCategoryController extends BaseController { ...@@ -198,6 +198,17 @@ public class EquipmentCategoryController extends BaseController {
return ResponseHelper.buildResponse(equipmentCategoryService.createSupervisorCode(map,null)); return ResponseHelper.buildResponse(equipmentCategoryService.createSupervisorCode(map,null));
} }
/**
* 修改数据状态是否显示编辑按钮
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/updateOtherInfo", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "修改数据状态", notes = "修改数据状态")
public ResponseModel<Object> updateOtherInfo(@RequestBody Map<String,Object> map) {
return ResponseHelper.buildResponse(equipmentCategoryService.updateOtherInfo(map));
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/checkCode", method = RequestMethod.POST) @RequestMapping(value = "/checkCode", method = RequestMethod.POST)
@ApiOperation(httpMethod = "post", value = "校验96333码", notes = "校验96333码") @ApiOperation(httpMethod = "post", value = "校验96333码", notes = "校验96333码")
......
...@@ -10,9 +10,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey; ...@@ -10,9 +10,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.EquInfoDto; import com.yeejoin.amos.boot.module.tzs.api.dto.EquInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.EquipmentCategoryDto; import com.yeejoin.amos.boot.module.tzs.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo; import com.yeejoin.amos.boot.module.tzs.api.entity.*;
import com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.tzs.api.entity.SupervisoryCodeInfo;
import com.yeejoin.amos.boot.module.tzs.api.enums.EquimentEnum; import com.yeejoin.amos.boot.module.tzs.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.tzs.api.enums.EquipmentCategoryEnum; import com.yeejoin.amos.boot.module.tzs.api.enums.EquipmentCategoryEnum;
import com.yeejoin.amos.boot.module.tzs.api.enums.EquipmentClassifityEnum; import com.yeejoin.amos.boot.module.tzs.api.enums.EquipmentClassifityEnum;
...@@ -352,6 +350,21 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -352,6 +350,21 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return codeList; return codeList;
} }
@Override
public List<String> updateOtherInfo(Map<String, Object> map) {
List<String> supervisoryCodeList = (ArrayList) map.get("supervisoryCode");
List<String> list = new ArrayList<>();
for (String supervisoryCode : supervisoryCodeList) {
CategoryOtherInfo categoryOtherInfo = categoryOtherInfoMapper.selectOne(new QueryWrapper<CategoryOtherInfo>().eq("SUPERVISORY_CODE", supervisoryCode));
if (ObjectUtils.isEmpty(categoryOtherInfo)) {
list.add(supervisoryCode + ":对应的数据修改失败,请查询对应监管码是否正确");
} else {
list.add(supervisoryCode + (categoryOtherInfoMapper.updateOtherInfo(supervisoryCode, "1") == 1 ? ":对应的数据已经修改成功" : ":对应的数据修改失败,请查询对应监管码是否正确"));
}
}
return list;
}
/** /**
* 获取行政区划以市或区的list集合 * 获取行政区划以市或区的list集合
* *
...@@ -543,37 +556,37 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -543,37 +556,37 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
ResponseModel<Page<Map<String, Object>>> model = new ResponseModel<>(); ResponseModel<Page<Map<String, Object>>> model = new ResponseModel<>();
List<JSONObject> objectList = getCompanyType(); List<JSONObject> objectList = getCompanyType();
List<Map<String, Object>> res = new ArrayList<>(); List<Map<String, Object>> res = new ArrayList<>();
Long total = 0L;
for (JSONObject object : objectList) { for (JSONObject object : objectList) {
String level = object.getString("level"); String level = object.getString("level");
String code = object.getString("orgCode"); String code = object.getString("orgCode");
String companyCode = object.getString("companyCode"); String companyCode = object.getString("companyCode");
if (!ValidationUtil.isEmpty(level)) { if (!ValidationUtil.isEmpty(level)) {
ResponseModel<Page<Map<String, Object>>> m=new ResponseModel<>(); ResponseModel<Page<Map<String, Object>>> m = new ResponseModel<>();
if (LEVEL.equals(level)) { if (LEVEL.equals(level)) {
//企业 //企业
map.put("USE_UNIT_CREDIT_CODE", companyCode); map.put("USE_UNIT_CREDIT_CODE", companyCode);
m= idxFeignService.getPage(map); m = idxFeignService.getPage(map);
map.remove("USE_UNIT_CREDIT_CODE"); map.remove("USE_UNIT_CREDIT_CODE");
} else { } else {
//监管单位 //监管单位
map.put("ORG_BRANCH_CODE", code); map.put("ORG_BRANCH_CODE", code);
m = idxFeignService.getPage(map); m = idxFeignService.getPage(map);
map.remove("ORG_BRANCH_CODE"); map.remove("ORG_BRANCH_CODE");
} }
if (!ValidationUtil.isEmpty(m)&&!ValidationUtil.isEmpty(m.getResult())&&!ValidationUtil.isEmpty(m.getResult().getRecords())) { total += m.getResult().getTotal();
if (!ValidationUtil.isEmpty(m) && !ValidationUtil.isEmpty(m.getResult()) && !ValidationUtil.isEmpty(m.getResult().getRecords())) {
res.addAll(m.getResult().getRecords()); res.addAll(m.getResult().getRecords());
} }
} }
} }
Page<Map<String, Object>> objectPage = new Page<>(); Page<Map<String, Object>> objectPage = new Page<>();
objectPage.setRecords(res); objectPage.setRecords(res);
objectPage.setTotal(total);
objectPage.setSize(Long.valueOf(map.get("size").toString()));
objectPage.setCurrent(Long.valueOf(map.get("number").toString()));
model.setResult(objectPage); model.setResult(objectPage);
if (!ValidationUtil.isEmpty(res)) {
model.getResult().setTotal(res.size());
}
//设备状态码对应枚举值 //设备状态码对应枚举值
List<Map<String, Object>> records = model.getResult().getRecords(); List<Map<String, Object>> records = model.getResult().getRecords();
List<Map<String, Object>> result = new ArrayList<>(); List<Map<String, Object>> result = new ArrayList<>();
......
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