代码调整、修改设备检测人bug
This commit is contained in:
@@ -63,6 +63,11 @@ public class PreDetectionController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 程控源-源通讯校验
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@PostMapping("/ytxCheckSimulate")
|
@PostMapping("/ytxCheckSimulate")
|
||||||
@OperateInfo
|
@OperateInfo
|
||||||
@ApiOperation("源通讯校验")
|
@ApiOperation("源通讯校验")
|
||||||
@@ -74,7 +79,7 @@ public class PreDetectionController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模拟检测
|
* 程控源检测
|
||||||
*/
|
*/
|
||||||
@PostMapping("/startSimulateTest")
|
@PostMapping("/startSimulateTest")
|
||||||
@OperateInfo
|
@OperateInfo
|
||||||
@@ -87,7 +92,7 @@ public class PreDetectionController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关闭检测
|
* 关闭检测-程控源
|
||||||
*/
|
*/
|
||||||
@PostMapping("/closeSimulateTest")
|
@PostMapping("/closeSimulateTest")
|
||||||
@OperateInfo
|
@OperateInfo
|
||||||
|
|||||||
@@ -1074,7 +1074,7 @@ public class SocketDevResponseService {
|
|||||||
checkDataParam.setIsValueTypeName(false);
|
checkDataParam.setIsValueTypeName(false);
|
||||||
List<String> valueType = iPqScriptCheckDataService.getValueType(checkDataParam);
|
List<String> valueType = iPqScriptCheckDataService.getValueType(checkDataParam);
|
||||||
|
|
||||||
iPqDevService.updateResult(param.getDevIds(), valueType, param.getCode());
|
iPqDevService.updateResult(param.getDevIds(), valueType, param.getCode(),param.getUserId());
|
||||||
CnSocketUtil.quitSend(param);
|
CnSocketUtil.quitSend(param);
|
||||||
}
|
}
|
||||||
successComm.clear();
|
successComm.clear();
|
||||||
|
|||||||
@@ -63,4 +63,6 @@ public class PreDetectionParam {
|
|||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
private Boolean sendWebMsg;
|
private Boolean sendWebMsg;
|
||||||
|
|
||||||
|
private String userId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ public class PreDetectionServiceImpl implements PreDetectionService {
|
|||||||
checkDataParam.setIsValueTypeName(false);
|
checkDataParam.setIsValueTypeName(false);
|
||||||
List<String> valueType = iPqScriptCheckDataService.getValueType(checkDataParam);
|
List<String> valueType = iPqScriptCheckDataService.getValueType(checkDataParam);
|
||||||
|
|
||||||
iPqDevService.updateResult(param.getDevIds(), valueType, param.getCode());
|
iPqDevService.updateResult(param.getDevIds(), valueType, param.getCode(),param.getUserId());
|
||||||
CnSocketUtil.quitSend(param);
|
CnSocketUtil.quitSend(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class PqDevController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "file", value = "被检设备数据文件", required = true),
|
@ApiImplicitParam(name = "file", value = "被检设备数据文件", required = true),
|
||||||
@ApiImplicitParam(name = "patternId", value = "模式id", required = true)
|
@ApiImplicitParam(name = "patternId", value = "模式id", required = true)
|
||||||
})
|
})
|
||||||
public HttpResult<String> importDev(@RequestParam("file") MultipartFile file, @RequestParam("patternId") String patternId, HttpServletResponse response) {
|
public HttpResult<Object> importDev(@RequestParam("file") MultipartFile file, @RequestParam("patternId") String patternId, HttpServletResponse response) {
|
||||||
String methodDescribe = getMethodDescribe("importDev");
|
String methodDescribe = getMethodDescribe("importDev");
|
||||||
LogUtil.njcnDebug(log, "{},上传文件为:{}", methodDescribe, file.getOriginalFilename());
|
LogUtil.njcnDebug(log, "{},上传文件为:{}", methodDescribe, file.getOriginalFilename());
|
||||||
boolean fileType = FileUtil.judgeFileIsExcel(file.getOriginalFilename());
|
boolean fileType = FileUtil.judgeFileIsExcel(file.getOriginalFilename());
|
||||||
@@ -187,14 +187,14 @@ public class PqDevController extends BaseController {
|
|||||||
@PostMapping("/documented")
|
@PostMapping("/documented")
|
||||||
@ApiOperation("设备归档")
|
@ApiOperation("设备归档")
|
||||||
@ApiImplicitParam(name = "id", value = "设备id", required = true)
|
@ApiImplicitParam(name = "id", value = "设备id", required = true)
|
||||||
public HttpResult<List<PqDev>> documented(@RequestBody List<String> ids) {
|
public HttpResult<Boolean> documented(@RequestBody List<String> ids) {
|
||||||
String methodDescribe = getMethodDescribe("documented");
|
String methodDescribe = getMethodDescribe("documented");
|
||||||
LogUtil.njcnDebug(log, "{},设备id为:{}", methodDescribe, ids);
|
LogUtil.njcnDebug(log, "{},设备id为:{}", methodDescribe, ids);
|
||||||
boolean result = pqDevService.documented(ids);
|
boolean result = pqDevService.documented(ids);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,5 +41,12 @@ public interface PqDevMapper extends MPJBaseMapper<PqDev> {
|
|||||||
* @param testState
|
* @param testState
|
||||||
*/
|
*/
|
||||||
void updatePlanTestState(@Param("planId")String planId, @Param("testState")Integer testState);
|
void updatePlanTestState(@Param("planId")String planId, @Param("testState")Integer testState);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据计划id获取脚本id
|
||||||
|
*
|
||||||
|
* @param planId
|
||||||
|
*/
|
||||||
|
String getScriptIdByPlanId(String planId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,8 @@
|
|||||||
update ad_plan set Test_State = #{testState} where id = #{planId}
|
update ad_plan set Test_State = #{testState} where id = #{planId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="getScriptIdByPlanId" resultType="java.lang.String">
|
||||||
|
SELECT Script_Id FROM ad_plan WHERE id = #{planId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@@ -151,9 +151,10 @@ public interface IPqDevService extends IService<PqDev> {
|
|||||||
* @param ids
|
* @param ids
|
||||||
* @param valueType
|
* @param valueType
|
||||||
* @param code
|
* @param code
|
||||||
|
* @param userId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean updateResult(List<String> ids, List<String> valueType, String code);
|
boolean updateResult(List<String> ids, List<String> valueType, String code,String userId);
|
||||||
|
|
||||||
void updatePqDevReportState(String devId, int i);
|
void updatePqDevReportState(String devId, int i);
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,11 @@ import com.njcn.gather.device.pojo.vo.ProvinceDevExcel;
|
|||||||
import com.njcn.gather.device.service.IPqDevService;
|
import com.njcn.gather.device.service.IPqDevService;
|
||||||
import com.njcn.gather.monitor.pojo.po.PqMonitor;
|
import com.njcn.gather.monitor.pojo.po.PqMonitor;
|
||||||
import com.njcn.gather.monitor.service.IPqMonitorService;
|
import com.njcn.gather.monitor.service.IPqMonitorService;
|
||||||
|
import com.njcn.gather.plan.pojo.po.AdPlan;
|
||||||
|
import com.njcn.gather.plan.service.IAdPlanService;
|
||||||
import com.njcn.gather.pojo.enums.DetectionResponseEnum;
|
import com.njcn.gather.pojo.enums.DetectionResponseEnum;
|
||||||
|
import com.njcn.gather.report.pojo.DevReportParam;
|
||||||
|
import com.njcn.gather.report.service.IPqReportService;
|
||||||
import com.njcn.gather.storage.service.DetectionDataDealService;
|
import com.njcn.gather.storage.service.DetectionDataDealService;
|
||||||
import com.njcn.gather.system.cfg.pojo.enums.SceneEnum;
|
import com.njcn.gather.system.cfg.pojo.enums.SceneEnum;
|
||||||
import com.njcn.gather.system.cfg.pojo.po.SysTestConfig;
|
import com.njcn.gather.system.cfg.pojo.po.SysTestConfig;
|
||||||
@@ -495,11 +499,12 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean updateResult(List<String> ids, List<String> valueType, String code) {
|
public boolean updateResult(List<String> ids, List<String> valueType, String code,String userId) {
|
||||||
if (CollUtil.isNotEmpty(ids)) {
|
if (CollUtil.isNotEmpty(ids)) {
|
||||||
SysTestConfig config = sysTestConfigService.getOneConfig();
|
SysTestConfig config = sysTestConfigService.getOneConfig();
|
||||||
Map<String, Integer> result = detectionDataDealService.devResult(ids, valueType, code);
|
Map<String, Integer> result = detectionDataDealService.devResult(ids, valueType, code);
|
||||||
List<PqDev> list = this.list(new LambdaQueryWrapper<PqDev>().in(PqDev::getId, ids));
|
List<PqDev> list = this.list(new LambdaQueryWrapper<PqDev>().in(PqDev::getId, ids));
|
||||||
|
|
||||||
for (PqDev pqDev : list) {
|
for (PqDev pqDev : list) {
|
||||||
if (result.containsKey(pqDev.getId())) {
|
if (result.containsKey(pqDev.getId())) {
|
||||||
Integer checkState;
|
Integer checkState;
|
||||||
@@ -518,7 +523,7 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
.set(PqDev::getReCheckNum, i)
|
.set(PqDev::getReCheckNum, i)
|
||||||
.set(PqDev::getCheckState, checkState)
|
.set(PqDev::getCheckState, checkState)
|
||||||
.set(PqDev::getCheckResult, result.get(pqDev.getId()))
|
.set(PqDev::getCheckResult, result.get(pqDev.getId()))
|
||||||
.set(PqDev::getCheckBy, RequestUtil.getUserId())
|
.set(PqDev::getCheckBy, userId)
|
||||||
.set(PqDev::getCheckTime, LocalDateTime.now())
|
.set(PqDev::getCheckTime, LocalDateTime.now())
|
||||||
.set(PqDev::getReportState, DevReportStateEnum.NOT_GENERATED.getValue())
|
.set(PqDev::getReportState, DevReportStateEnum.NOT_GENERATED.getValue())
|
||||||
.eq(PqDev::getId, pqDev.getId()));
|
.eq(PqDev::getId, pqDev.getId()));
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ public class AdPlanController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "file", value = "检测计划数据文件", required = true),
|
@ApiImplicitParam(name = "file", value = "检测计划数据文件", required = true),
|
||||||
@ApiImplicitParam(name = "pattern", value = "模式Id", required = true)
|
@ApiImplicitParam(name = "pattern", value = "模式Id", required = true)
|
||||||
})
|
})
|
||||||
public HttpResult<String> importPlan(@RequestParam("file") MultipartFile file, @RequestParam("patternId") String patternId, HttpServletResponse response) {
|
public HttpResult<Object> importPlan(@RequestParam("file") MultipartFile file, @RequestParam("patternId") String patternId, HttpServletResponse response) {
|
||||||
String methodDescribe = getMethodDescribe("importCNPlan");
|
String methodDescribe = getMethodDescribe("importCNPlan");
|
||||||
LogUtil.njcnDebug(log, "{},上传文件为:{}", methodDescribe, file.getOriginalFilename());
|
LogUtil.njcnDebug(log, "{},上传文件为:{}", methodDescribe, file.getOriginalFilename());
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
|||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@@ -70,7 +71,7 @@ public class ReportController extends BaseController {
|
|||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ApiOperation("分页查询报告模板")
|
@ApiOperation("分页查询报告模板")
|
||||||
@ApiImplicitParam(name = "param", value = "查询参数", required = true)
|
@ApiImplicitParam(name = "param", value = "查询参数", required = true)
|
||||||
public HttpResult<Page<PqReportVO>> list(@RequestBody ReportParam.QueryParam queryParam) {
|
public HttpResult<Page<PqReportVO>> list(@RequestBody @Validated ReportParam.QueryParam queryParam) {
|
||||||
String methodDescribe = getMethodDescribe("list");
|
String methodDescribe = getMethodDescribe("list");
|
||||||
LogUtil.njcnDebug(log, "{},查询参数为:{}", methodDescribe, queryParam);
|
LogUtil.njcnDebug(log, "{},查询参数为:{}", methodDescribe, queryParam);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqReportService.list(queryParam), methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqReportService.list(queryParam), methodDescribe);
|
||||||
@@ -90,7 +91,7 @@ public class ReportController extends BaseController {
|
|||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation("新增报告模板")
|
@ApiOperation("新增报告模板")
|
||||||
@ApiImplicitParam(name = "param", value = "报告模板参数", required = true)
|
@ApiImplicitParam(name = "param", value = "报告模板参数", required = true)
|
||||||
public HttpResult<Boolean> add(ReportParam reportParam) {
|
public HttpResult<Boolean> add(@RequestBody @Validated ReportParam reportParam) {
|
||||||
String methodDescribe = getMethodDescribe("add");
|
String methodDescribe = getMethodDescribe("add");
|
||||||
LogUtil.njcnDebug(log, "{},新增参数为:{}", methodDescribe, reportParam);
|
LogUtil.njcnDebug(log, "{},新增参数为:{}", methodDescribe, reportParam);
|
||||||
boolean result = pqReportService.add(reportParam);
|
boolean result = pqReportService.add(reportParam);
|
||||||
@@ -105,7 +106,7 @@ public class ReportController extends BaseController {
|
|||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ApiOperation("更新报告模板")
|
@ApiOperation("更新报告模板")
|
||||||
@ApiImplicitParam(name = "param", value = "报告模板参数", required = true)
|
@ApiImplicitParam(name = "param", value = "报告模板参数", required = true)
|
||||||
public HttpResult<Boolean> update(ReportParam.UpdateParam reportParam) {
|
public HttpResult<Boolean> update(@RequestBody @Validated ReportParam.UpdateParam reportParam) {
|
||||||
String methodDescribe = getMethodDescribe("update");
|
String methodDescribe = getMethodDescribe("update");
|
||||||
LogUtil.njcnDebug(log, "{},修改参数为:{}", methodDescribe, reportParam);
|
LogUtil.njcnDebug(log, "{},修改参数为:{}", methodDescribe, reportParam);
|
||||||
boolean result = pqReportService.update(reportParam);
|
boolean result = pqReportService.update(reportParam);
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public class ResultController extends BaseController {
|
|||||||
@PostMapping("/reCalculate")
|
@PostMapping("/reCalculate")
|
||||||
@ApiOperation("重新计算检测结果")
|
@ApiOperation("重新计算检测结果")
|
||||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||||
public HttpResult<Object> reCalculate(@RequestBody ResultParam.ChangeErrorSystemParam param) {
|
public HttpResult<Object> reCalculate(@RequestBody @Validated ResultParam.ChangeErrorSystemParam param) {
|
||||||
String methodDescribe = getMethodDescribe("reCalculate");
|
String methodDescribe = getMethodDescribe("reCalculate");
|
||||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, param);
|
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, param);
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ public class ResultController extends BaseController {
|
|||||||
@PostMapping("/changeErrorSystem")
|
@PostMapping("/changeErrorSystem")
|
||||||
@ApiOperation("更换误差体系")
|
@ApiOperation("更换误差体系")
|
||||||
@ApiImplicitParam(name = "param", value = "修改参数", required = true)
|
@ApiImplicitParam(name = "param", value = "修改参数", required = true)
|
||||||
public HttpResult<Object> changeErrorSystem(@RequestBody ResultParam.ChangeErrorSystemParam param) {
|
public HttpResult<Object> changeErrorSystem(@RequestBody @Validated ResultParam.ChangeErrorSystemParam param) {
|
||||||
String methodDescribe = getMethodDescribe("changeErrorSystem");
|
String methodDescribe = getMethodDescribe("changeErrorSystem");
|
||||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, param);
|
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, param);
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ public class PqScriptController extends BaseController {
|
|||||||
@GetMapping("/upgradeToTemplate")
|
@GetMapping("/upgradeToTemplate")
|
||||||
@ApiOperation("升级为模板")
|
@ApiOperation("升级为模板")
|
||||||
@ApiImplicitParam(name = "id", value = "检测脚本id", required = true)
|
@ApiImplicitParam(name = "id", value = "检测脚本id", required = true)
|
||||||
public HttpResult<Boolean> upgradeToTemplate(@RequestParam("id") String id, HttpServletRequest request) {
|
public HttpResult<Boolean> upgradeToTemplate(@RequestParam("id") String id) {
|
||||||
String methodDescribe = getMethodDescribe("upgradeToTemplate");
|
String methodDescribe = getMethodDescribe("upgradeToTemplate");
|
||||||
LogUtil.njcnDebug(log, "{},升级ID数据为:{}", methodDescribe, id);
|
LogUtil.njcnDebug(log, "{},升级ID数据为:{}", methodDescribe, id);
|
||||||
boolean result = pqScriptService.upgradeToTemplate(id);
|
boolean result = pqScriptService.upgradeToTemplate(id);
|
||||||
|
|||||||
@@ -62,9 +62,19 @@ public class SysTestConfigController extends BaseController {
|
|||||||
@GetMapping("/getCurrentScene")
|
@GetMapping("/getCurrentScene")
|
||||||
public HttpResult<String> getCurrentScene() {
|
public HttpResult<String> getCurrentScene() {
|
||||||
String methodDescribe = getMethodDescribe("getCurrentScene");
|
String methodDescribe = getMethodDescribe("getCurrentScene");
|
||||||
LogUtil.njcnDebug(log, "{},获取当前场景", methodDescribe);
|
LogUtil.njcnDebug(log, "{}", methodDescribe);
|
||||||
String currrentScene = sysTestConfigService.getCurrrentScene();
|
String currrentScene = sysTestConfigService.getCurrrentScene();
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, currrentScene, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, currrentScene, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("获取是否在检测时同时生成报告")
|
||||||
|
@GetMapping("/getAutoGenerate")
|
||||||
|
public HttpResult<Integer> getAutoGenerate() {
|
||||||
|
String methodDescribe = getMethodDescribe("getAutoGenerate");
|
||||||
|
LogUtil.njcnDebug(log, "{}", methodDescribe);
|
||||||
|
Integer autoGenerate = sysTestConfigService.getAutoGenerate();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, autoGenerate, methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,4 +37,11 @@ public interface ISysTestConfigService extends IService<SysTestConfig> {
|
|||||||
SysTestConfig getOneConfig();
|
SysTestConfig getOneConfig();
|
||||||
|
|
||||||
String getCurrrentScene();
|
String getCurrrentScene();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取是否在检测时自动生成报告
|
||||||
|
*
|
||||||
|
* @return 0-否,1-是
|
||||||
|
*/
|
||||||
|
Integer getAutoGenerate();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,4 +73,9 @@ public class SysTestConfigServiceImpl extends ServiceImpl<SysTestConfigMapper, S
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getAutoGenerate() {
|
||||||
|
return getOneConfig().getAutoGenerate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,14 +17,14 @@ public class DictDataExcel implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 字典数据表Id
|
* 字典数据表Id
|
||||||
*/
|
*/
|
||||||
@Excel(name = "字典数据id", width = 40)
|
// @Excel(name = "字典数据id", width = 40)
|
||||||
private String id;
|
// private String id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典类型表Id
|
* 字典类型表Id
|
||||||
*/
|
*/
|
||||||
@Excel(name = "字典类型id", width = 40)
|
// @Excel(name = "字典类型id", width = 40)
|
||||||
private String typeId;
|
// private String typeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 名称
|
* 名称
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.njcn.gather.system.dictionary.pojo.vo;
|
package com.njcn.gather.system.dictionary.pojo.vo;
|
||||||
|
|
||||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||||
import lombok.AllArgsConstructor;
|
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDateTime;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author caozehui
|
* @author caozehui
|
||||||
@@ -15,45 +15,42 @@ import java.time.LocalDateTime;
|
|||||||
public class DictTypeExcel implements Serializable {
|
public class DictTypeExcel implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
|
||||||
* 字典类型表Id
|
|
||||||
*/
|
|
||||||
@Excel(name = "id", width = 40)
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 名称
|
* 名称
|
||||||
*/
|
*/
|
||||||
@Excel(name = "名称", width = 20)
|
@Excel(name = "名称", width = 20, needMerge = true)
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编码
|
* 编码
|
||||||
*/
|
*/
|
||||||
@Excel(name = "编码", width = 20)
|
@Excel(name = "编码", width = 20, needMerge = true)
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排序
|
* 排序
|
||||||
*/
|
*/
|
||||||
@Excel(name = "排序", width = 15)
|
@Excel(name = "排序", width = 15, needMerge = true)
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开启等级:0-不开启;1-开启,默认不开启
|
* 开启等级:0-不开启;1-开启,默认不开启
|
||||||
*/
|
*/
|
||||||
@Excel(name = "开启等级", width = 15, replace = {"开启_1", "不开启_0"})
|
@Excel(name = "开启等级", width = 15, replace = {"开启_1", "不开启_0"}, needMerge = true)
|
||||||
private Integer openLevel;
|
private Integer openLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开启描述:0-不开启;1-开启,默认不开启
|
* 开启描述:0-不开启;1-开启,默认不开启
|
||||||
*/
|
*/
|
||||||
@Excel(name = "开启描述", width = 15, replace = {"开启_1", "不开启_0"})
|
@Excel(name = "开启描述", width = 15, replace = {"开启_1", "不开启_0"}, needMerge = true)
|
||||||
private Integer openDescribe;
|
private Integer openDescribe;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 描述
|
* 描述
|
||||||
*/
|
*/
|
||||||
@Excel(name = "描述", width = 50)
|
@Excel(name = "描述", width = 50, needMerge = true)
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
@ExcelCollection(name = "字典内容")
|
||||||
|
private List<DictDataExcel> dictDataExcels;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,14 @@ public interface IDictDataService extends IService<DictData> {
|
|||||||
*/
|
*/
|
||||||
Page<DictData> getDictDataByTypeId(DictDataParam.QueryParam queryParam);
|
Page<DictData> getDictDataByTypeId(DictDataParam.QueryParam queryParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典类型id查询该类型下所有字典数据
|
||||||
|
*
|
||||||
|
* @param typeId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DictData> listDictDataByTypeId(String typeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典类型id查询字典信息
|
* 根据字典类型id查询字典信息
|
||||||
* @param typeId 字典类型id
|
* @param typeId 字典类型id
|
||||||
|
|||||||
@@ -64,6 +64,11 @@ public class DictDataServiceImpl extends ServiceImpl<DictDataMapper, DictData> i
|
|||||||
return this.baseMapper.selectPage(new Page<>(PageFactory.getPageNum(queryParam), PageFactory.getPageSize(queryParam)), queryWrapper);
|
return this.baseMapper.selectPage(new Page<>(PageFactory.getPageNum(queryParam), PageFactory.getPageSize(queryParam)), queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DictData> listDictDataByTypeId(String typeId) {
|
||||||
|
return this.lambdaQuery().eq(DictData::getTypeId, typeId).eq(DictData::getState, DataStateEnum.ENABLE.getCode()).list();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DictData> getDictDataByTypeId(String typeId) {
|
public List<DictData> getDictDataByTypeId(String typeId) {
|
||||||
return this.lambdaQuery().eq(DictData::getTypeId, typeId).eq(DictData::getState, DataStateEnum.ENABLE.getCode()).list();
|
return this.lambdaQuery().eq(DictData::getTypeId, typeId).eq(DictData::getState, DataStateEnum.ENABLE.getCode()).list();
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ import com.njcn.common.pojo.exception.BusinessException;
|
|||||||
import com.njcn.db.mybatisplus.constant.DbConstant;
|
import com.njcn.db.mybatisplus.constant.DbConstant;
|
||||||
import com.njcn.gather.system.dictionary.mapper.DictTypeMapper;
|
import com.njcn.gather.system.dictionary.mapper.DictTypeMapper;
|
||||||
import com.njcn.gather.system.dictionary.pojo.param.DictTypeParam;
|
import com.njcn.gather.system.dictionary.pojo.param.DictTypeParam;
|
||||||
|
import com.njcn.gather.system.dictionary.pojo.po.DictData;
|
||||||
import com.njcn.gather.system.dictionary.pojo.po.DictType;
|
import com.njcn.gather.system.dictionary.pojo.po.DictType;
|
||||||
|
import com.njcn.gather.system.dictionary.pojo.vo.DictDataExcel;
|
||||||
import com.njcn.gather.system.dictionary.pojo.vo.DictTypeExcel;
|
import com.njcn.gather.system.dictionary.pojo.vo.DictTypeExcel;
|
||||||
import com.njcn.gather.system.dictionary.service.IDictDataService;
|
import com.njcn.gather.system.dictionary.service.IDictDataService;
|
||||||
import com.njcn.gather.system.dictionary.service.IDictTypeService;
|
import com.njcn.gather.system.dictionary.service.IDictTypeService;
|
||||||
@@ -23,6 +25,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -100,7 +103,16 @@ public class DictTypeServiceImpl extends ServiceImpl<DictTypeMapper, DictType> i
|
|||||||
}
|
}
|
||||||
queryWrapper.ne("sys_dict_type.state", DataStateEnum.DELETED.getCode());
|
queryWrapper.ne("sys_dict_type.state", DataStateEnum.DELETED.getCode());
|
||||||
List<DictType> dictTypes = this.list(queryWrapper);
|
List<DictType> dictTypes = this.list(queryWrapper);
|
||||||
List<DictTypeExcel> dictTypeVOS = BeanUtil.copyToList(dictTypes, DictTypeExcel.class);
|
|
||||||
|
List<DictTypeExcel> dictTypeVOS = new ArrayList<>();
|
||||||
|
dictTypes.forEach(dictType -> {
|
||||||
|
DictTypeExcel dictTypeExcel = BeanUtil.copyProperties(dictType, DictTypeExcel.class);
|
||||||
|
List<DictData> dictDataList = dictDataService.listDictDataByTypeId(dictType.getId());
|
||||||
|
List<DictDataExcel> dictDataExcels = BeanUtil.copyToList(dictDataList, DictDataExcel.class);
|
||||||
|
dictTypeExcel.setDictDataExcels(dictDataExcels);
|
||||||
|
dictTypeVOS.add(dictTypeExcel);
|
||||||
|
});
|
||||||
|
|
||||||
ExcelUtil.exportExcel("字典类型导出数据.xlsx", "字典类型", DictTypeExcel.class, dictTypeVOS);
|
ExcelUtil.exportExcel("字典类型导出数据.xlsx", "字典类型", DictTypeExcel.class, dictTypeVOS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ public class AuthController extends BaseController {
|
|||||||
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("name", user.getName());
|
map.put("name", user.getName());
|
||||||
|
map.put("id", user.getId());
|
||||||
|
|
||||||
token.setUserInfo(map);
|
token.setUserInfo(map);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user