Commit d73a618c authored by 吴江's avatar 吴江

Merge branch 'developer' into 'fb_jxiop_V1.1.0_230316'

Developer See merge request !19
parents d2a5d936 54232d71
package com.yeejoin.amos.boot.module.tzs.api.dto;
import lombok.Data;
/**
* @Author cpp
* @Description
* @Date 2023/3/16
*/
@Data
public class JgAllDto {
private static final long serialVersionUID = 1L;
private String SEQUENCE_NBR;
private String orgBranchName;
private String ORG_BRANCH_CODE;
private String USE_UNIT_NAME;
private String USE_UNIT_CREDIT_CODE;
private String EQU_LIST_CODE;
private String EQU_LIST;
private String EQU_CATEGORY;
private String USE_ORG_CODE;
private String CODE96333;
private String EQU_CODE;
private String SUPERVISORY_CODE;
private String USE_PLACE;
private String ADDRESS;
private String EQU_STATE;
private String CLAIM_STATUS;
}
package com.yeejoin.amos.boot.module.tzs.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
@AllArgsConstructor
@Getter
public enum EquimentEnum {
/**
* 设备状态枚举
*
*/
XINZENG("新增",0),
ZAIYONG("在用",1),
TINGYONG("停用",2),
BAOFEI("报废",3),
ZHUXIAO("注销",4),
QIANCHU("迁出",5),
CHAICHU("拆除",6),
MULUWAI("目录外",7),
FEIFASHEBEI("非法设备",8);
String name;
Integer code;
public static Map<Integer,String> getName=new HashMap<>();
public static Map<String,Integer> getCode=new HashMap<>();
static {
for (EquimentEnum e : EquimentEnum.values()){
getName.put(e.code, e.name);
getCode.put(e.name, e.code);
}
}
}
......@@ -211,7 +211,7 @@ public class EquipmentCategoryController extends BaseController {
@GetMapping(value = "/getTable")
@ApiOperation(httpMethod = "GET", value = "设备认领和设备管理通用接口", notes = "设备认领和设备管理通用接口")
public ResponseModel<Page<Map<String,Object>>> getTable(@RequestParam Map<String,Object> map) {
return equipmentCategoryServiceImpl.getTable(map);
return ResponseHelper.buildResponse(equipmentCategoryServiceImpl.getTable(map));
}
......@@ -224,4 +224,13 @@ public class EquipmentCategoryController extends BaseController {
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getChildren")
@ApiOperation(httpMethod = "GET", value = "通过设备种类code获取设备类别", notes = "通过设备种类code获取设备类别")
public ResponseModel<List<EquipmentCategory>> getChildren(String code) {
return ResponseHelper.buildResponse(equipmentCategoryServiceImpl.getChildren(code));
}
}
package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.EquipmentCategory;
import com.yeejoin.amos.boot.module.tzs.api.entity.RescueStation;
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.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.tzs.api.mapper.CategoryOtherInfoMapper;
......@@ -278,14 +281,19 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
* * 如果为企业添加使用单位查询参数(USE_UNIT_CREDIT_CODE)
*/
private static final String LEVEL = "company";
private static final String EQUSTATE = "EQU_STATE";
public ResponseModel<Page<Map<String, Object>>> getTable(Map<String, Object> map) {
public Page<Map<String, Object>> getTable(Map<String, Object> map) {
if (!ValidationUtil.isEmpty(map.get(EQUSTATE))) {
map.put(EQUSTATE, EquimentEnum.getCode.get(map.get(EQUSTATE).toString()).toString());
}
ResponseModel<Page<Map<String, Object>>> model = new ResponseModel<>();
JSONObject object = getCompanyType();
String leve = object.getString("leve");
String code = object.getString("companyCode");
if (!ValidationUtil.isEmpty(leve)) {
if (LEVEL.equals(leve)) {
if (LEVEL.equals(LEVEL)) {
//企业
map.put("USE_UNIT_CREDIT_CODE", code);
model = idxFeignService.getPage(map);
......@@ -295,12 +303,23 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
model = idxFeignService.getPage(map);
}
}
return model;
//设备状态码对应枚举值
List<Map<String, Object>> records = model.getResult().getRecords();
List<Map<String, Object>> result = new ArrayList<>();
for (Map<String, Object> record : records) {
Integer integer = Integer.valueOf(record.get(EQUSTATE).toString());
String status = EquimentEnum.getName.get(integer);
record.put(EQUSTATE, status);
result.add(record);
}
Page<Map<String, Object>> mapPage = model.getResult().setRecords(result);
return mapPage;
}
private static final String TABLENAME="tableName";
private static final String TABLENAME = "tableName";
public List<Map<String, Object>> scalp(Map<String, Object> map) {
List<Map<String, Object>> list =new ArrayList<>();
List<Map<String, Object>> list = new ArrayList<>();
if (!ValidationUtil.isEmpty(map.get("orgBranchName"))) {
list = equipmentCategoryMapper.getSrcee(map.get(TABLENAME).toString(),
map.get("orgBranchName").toString(), null, null, null, null);
......@@ -315,13 +334,27 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
if (!ValidationUtil.isEmpty(map.get("usePlace"))) {
list = equipmentCategoryMapper.getSrcee(map.get(TABLENAME).toString(),
null, null,null , map.get("usePlace").toString(), null);
null, null, null, map.get("usePlace").toString(), null);
}
if (!ValidationUtil.isEmpty(map.get("equState"))) {
list = equipmentCategoryMapper.getSrcee(map.get(TABLENAME).toString(),
null, null,null , null, map.get("equState").toString());
null, null, null, null, map.get("equState").toString());
}
return list;
}
/**
* 设备字典,通过设备父类code,获得子类
*/
public List<EquipmentCategory> getChildren(String code) {
LambdaQueryWrapper<EquipmentCategory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(EquipmentCategory::getCode, code);
EquipmentCategory equipmentCategory = baseMapper.selectOne(wrapper);
LambdaQueryWrapper<EquipmentCategory> wrapper2 = new LambdaQueryWrapper<>();
wrapper2.eq(EquipmentCategory::getParentId, equipmentCategory.getId());
List<EquipmentCategory> equipmentCategories = baseMapper.selectList(wrapper2);
return equipmentCategories;
}
}
......@@ -4,47 +4,37 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.ugp.api.Enum.NoticeStatusEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectResourceEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.WhetherItPassEnum;
import com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant;
import com.yeejoin.amos.boot.module.ugp.api.dto.*;
import com.yeejoin.amos.boot.module.ugp.api.entity.*;
import com.yeejoin.amos.boot.module.ugp.api.mapper.InstallNoticeMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IInstallNoticeService;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.InstallNotice;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.yeejoin.amos.boot.module.ugp.biz.fegin.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.*;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import springfox.documentation.spring.web.json.Json;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 安装告知表
......@@ -382,8 +372,11 @@ public class InstallNoticeController extends BaseController {
@PostMapping(value = "/saveOrUpdate")
@ApiOperation(value = "新增/修改安装告知表信息", notes = "新增/修改安装告知表信息")
public ResponseModel<InstallNoticeDto> saveOrUpdate(@RequestBody JSONObject jsonObject) {
InstallNoticeDto model = JSON.parseObject(JSON.toJSONString(jsonObject.get("installNoticeInfo")), InstallNoticeDto.class);
Project project = projectServiceImpl.getById(model.getProjectId());
InstallNoticeDto model = JSON.parseObject(JSON.toJSONString(jsonObject.get("noticeInfo")), InstallNoticeDto.class);
Long projectId = Long.valueOf(String.valueOf(jsonObject.get("projectId")));
Project project = projectServiceImpl.getById(projectId);
model.setProjectId(projectId);
model.setNoticeStatus(String.valueOf(jsonObject.get("noticeStatus")));
LambdaQueryWrapper<InstallNotice> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(InstallNotice::getProjectId, model.getProjectId());
lambdaQueryWrapper.eq(InstallNotice::getIsDelete, Boolean.FALSE);
......@@ -396,8 +389,8 @@ public class InstallNoticeController extends BaseController {
installNotice.setNoticeDate(new Date());
installNotice.setOrganizationCode(orgServiceImpl.getOrgUsr().getBizOrgCode());
iInstallNoticeService.saveOrUpdate(installNotice);
if (NoticeStatusEnum.已提交.getName().equals(model.getNoticeStatus())) {
projectInitiationServiceImpl.execute(project.getInstanceId(), model, WhetherItPassEnum.PASS.getCode(), null);
if (!WhetherItPassEnum.SAVE.getCode().equals(model.getNoticeStatus())) {
projectInitiationServiceImpl.execute(project.getInstanceId(), model, model.getNoticeStatus(), null);
}
return ResponseHelper.buildResponse(model);
}
......@@ -415,7 +408,7 @@ public class InstallNoticeController extends BaseController {
return null;
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("installNoticeInfo",iInstallNoticeService.getInfoByProjectId(projectId));
jsonObject.put("noticeInfo",iInstallNoticeService.getInfoByProjectId(projectId));
jsonObject.put("projectInfo",projectServiceImpl.selectById(projectId));
return ResponseHelper.buildResponse(jsonObject);
}
......
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