智慧梁场修改
This commit is contained in:
parent
028b5b91aa
commit
9498ec272b
@ -145,7 +145,6 @@ public class SmartBeamFieldBeamController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "smartBeamFieldBeamId", value = "智慧梁场-梁ID", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "smartBeamFieldSaveBeamPedestalId", value = "智慧梁场-存梁台座id", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String")
|
||||
})
|
||||
@PostMapping(value = "/bindSaveBeamForBeam")
|
||||
public Result bindSaveBeamForBeam(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
|
||||
@ -161,14 +161,22 @@ public class SmartBeamFieldBeamServiceImpl extends ServiceImpl<SmartBeamFieldBea
|
||||
.eq(SmartBeamFieldBeamToSaveBeamPedestal::getIsSaveBeam, 1)
|
||||
);
|
||||
if (CollUtil.isNotEmpty(smartBeamFieldBeamToSaveBeamPedestals) && smartBeamFieldBeamToSaveBeamPedestals.size() >= 2) {
|
||||
throw new OpenAlertException(String.format("该存梁台座已存两个梁,不能再添加梁"));
|
||||
throw new OpenAlertException("该存梁台座已存两个梁,不能再添加梁");
|
||||
}
|
||||
String projectSn = MapUtils.getString(paramMap, "projectSn");
|
||||
if (CollUtil.isNotEmpty(smartBeamFieldBeamToSaveBeamPedestalMapper.selectList(new LambdaQueryWrapper<SmartBeamFieldBeamToSaveBeamPedestal>()
|
||||
.eq(SmartBeamFieldBeamToSaveBeamPedestal::getSmartBeamFieldSaveBeamPedestalId, smartBeamFieldSaveBeamPedestalId)
|
||||
.eq(SmartBeamFieldBeamToSaveBeamPedestal::getSmartBeamFieldBeamId, smartBeamFieldBeamId)
|
||||
.eq(SmartBeamFieldBeamToSaveBeamPedestal::getIsSaveBeam, 1)
|
||||
))) {
|
||||
throw new OpenAlertException("该存梁台座已存在该梁");
|
||||
}
|
||||
|
||||
SmartBeamFieldBeam beam = getById(smartBeamFieldBeamId);
|
||||
SmartBeamFieldBeamToSaveBeamPedestal saveBeamPedestalBeam = new SmartBeamFieldBeamToSaveBeamPedestal();
|
||||
saveBeamPedestalBeam.setSmartBeamFieldSaveBeamPedestalId(smartBeamFieldSaveBeamPedestalId);
|
||||
saveBeamPedestalBeam.setSmartBeamFieldBeamId(smartBeamFieldBeamId);
|
||||
saveBeamPedestalBeam.setIsSaveBeam(1);
|
||||
saveBeamPedestalBeam.setProjectSn(projectSn);
|
||||
saveBeamPedestalBeam.setProjectSn(beam.getProjectSn());
|
||||
smartBeamFieldBeamToSaveBeamPedestalMapper.insert(saveBeamPedestalBeam);
|
||||
}
|
||||
|
||||
|
||||
@ -73,9 +73,10 @@ public class SmartBeamFieldProductionLineServiceImpl extends ServiceImpl<SmartBe
|
||||
List<SmartBeamFieldProductionLineToMakeBeamPedestal> productionLineMakeBeamPedestalList = smartBeamFieldProduZctionLine.getProductionLineMakeBeamPedestalList();
|
||||
if (CollUtil.isNotEmpty(productionLineMakeBeamPedestalList)) {
|
||||
for (SmartBeamFieldProductionLineToMakeBeamPedestal smartBeamFieldProductionLineToMakeBeamPedestal : productionLineMakeBeamPedestalList) {
|
||||
smartBeamFieldProductionLineToMakeBeamPedestal.setId(null);
|
||||
smartBeamFieldProductionLineToMakeBeamPedestal.setSmartBeamFieldProductionLineId(smartBeamFieldProduZctionLine.getId());
|
||||
if (smartBeamFieldProductionLineToMakeBeamPedestal.getSmartBeamFieldMakeBeamPedestalId() == null) {
|
||||
throw new OpenAlertException("智慧梁场-制梁台座id不能为空");
|
||||
throw new OpenAlertException("productionLineMakeBeamPedestalList[i].smartBeamFieldMakeBeamPedestalId(智慧梁场-制梁台座id)不能为空");
|
||||
}
|
||||
smartBeamFieldProductionLineToMakeBeamPedestal.setProjectSn(smartBeamFieldProduZctionLine.getProjectSn());
|
||||
smartBeamFieldProductionLineToMakeBeamPedestalMapper.insert(smartBeamFieldProductionLineToMakeBeamPedestal);
|
||||
|
||||
@ -139,7 +139,11 @@ public class SmartBeamFieldSaveBeamPedestalServiceImpl extends ServiceImpl<Smart
|
||||
public void changeSaveBeam(SmartBeamFieldSaveBeamPedestal smartBeamFieldSaveBeamPedestal) {
|
||||
Long id = smartBeamFieldSaveBeamPedestal.getId();
|
||||
if (id == null) {
|
||||
throw new OpenAlertException("智慧梁场-存梁台座id不能为空");
|
||||
throw new OpenAlertException("id(智慧梁场-存梁台座id)不能为空");
|
||||
}
|
||||
String projectSn = smartBeamFieldSaveBeamPedestal.getProjectSn();
|
||||
if (StrUtil.isBlank(projectSn)) {
|
||||
throw new OpenAlertException("projectSn不能为空");
|
||||
}
|
||||
smartBeamFieldBeamToSaveBeamPedestalMapper.update(null, new LambdaUpdateWrapper<SmartBeamFieldBeamToSaveBeamPedestal>()
|
||||
.set(SmartBeamFieldBeamToSaveBeamPedestal::getIsSaveBeam, 0)
|
||||
@ -148,13 +152,12 @@ public class SmartBeamFieldSaveBeamPedestalServiceImpl extends ServiceImpl<Smart
|
||||
if (CollUtil.isNotEmpty(beamList)) {
|
||||
for (SmartBeamFieldBeam beam : beamList) {
|
||||
SmartBeamFieldBeamToSaveBeamPedestal smartBeamFieldBeamToSaveBeamPedestal = new SmartBeamFieldBeamToSaveBeamPedestal();
|
||||
|
||||
String projectSn = smartBeamFieldSaveBeamPedestal.getProjectSn();
|
||||
if (StrUtil.isBlank(projectSn)) {
|
||||
throw new OpenAlertException("projectSn不能为空");
|
||||
}
|
||||
smartBeamFieldBeamToSaveBeamPedestal.setSmartBeamFieldSaveBeamPedestalId(id);
|
||||
smartBeamFieldBeamToSaveBeamPedestal.setSmartBeamFieldBeamId(beam.getId());
|
||||
Long id1 = beam.getId();
|
||||
if (id1 == null) {
|
||||
throw new OpenAlertException("beamList[i].id(智慧梁场-梁id)不能为空");
|
||||
}
|
||||
smartBeamFieldBeamToSaveBeamPedestal.setSmartBeamFieldBeamId(id1);
|
||||
smartBeamFieldBeamToSaveBeamPedestal.setIsSaveBeam(1);
|
||||
smartBeamFieldBeamToSaveBeamPedestal.setProjectSn(projectSn);
|
||||
smartBeamFieldBeamToSaveBeamPedestalMapper.insert(smartBeamFieldBeamToSaveBeamPedestal);
|
||||
|
||||
@ -87,7 +87,7 @@ public class ${entityName}Controller {
|
||||
*/
|
||||
@ApiOperation(value = "添加${tableVo.ftlDescription}信息", notes = "添加${tableVo.ftlDescription}信息" , httpMethod="POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<${entityName}> add(@RequestBody ${entityName} ${entityName?uncap_first}) {
|
||||
public Result<${entityName}> add(@RequestBody @Validate ${entityName} ${entityName?uncap_first}) {
|
||||
${entityName?uncap_first}Service.add(${entityName?uncap_first});
|
||||
return Result.ok();
|
||||
}
|
||||
@ -99,7 +99,7 @@ public class ${entityName}Controller {
|
||||
*/
|
||||
@ApiOperation(value = "编辑${tableVo.ftlDescription}信息", notes = "编辑${tableVo.ftlDescription}信息" , httpMethod="POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<${entityName}> edit(@RequestBody ${entityName} ${entityName?uncap_first}) {
|
||||
public Result<${entityName}> edit(@RequestBody @Validate ${entityName} ${entityName?uncap_first}) {
|
||||
${entityName?uncap_first}Service.edit(${entityName?uncap_first});
|
||||
return Result.ok();
|
||||
}
|
||||
@ -147,37 +147,4 @@ public class ${entityName}Controller {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
@ApiOperation(value = "导出excel${tableVo.ftlDescription}信息", notes = "导出excel${tableVo.ftlDescription}信息" , httpMethod="POST")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<${entityName}> queryWrapper = null;
|
||||
try {
|
||||
String paramsStr = request.getParameter("paramsStr");
|
||||
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
||||
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
||||
${entityName} ${entityName?uncap_first} = JSON.parseObject(deString, ${entityName}.class);
|
||||
queryWrapper = QueryGenerator.initQueryWrapper(${entityName?uncap_first}, request.getParameterMap());
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<${entityName}> pageList = ${entityName?uncap_first}Service.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "${tableVo.ftlDescription}列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, ${entityName}.class);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}列表数据", "导出人:Jeecg", "导出信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user