地磅代码修改

This commit is contained in:
Administrator 2023-03-22 16:28:44 +08:00
parent 99c3867cf6
commit df90b4f1e6
12 changed files with 152 additions and 86 deletions

View File

@ -1,6 +1,7 @@
package com.zhgd.xmgl.modules.weight.controller; package com.zhgd.xmgl.modules.weight.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -122,9 +123,10 @@ public class GoodsNameController {
* @return * @return
*/ */
@ApiOperation(value = "删除货名信息", notes = "删除货名信息", httpMethod = "POST") @ApiOperation(value = "删除货名信息", notes = "删除货名信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "货名ID", paramType = "query", required = true, dataType = "Integer")
@PostMapping(value = "/delete") @PostMapping(value = "/delete")
public Result<GoodsName> delete(@RequestParam(name = "id", required = true) String id) { public Result<GoodsName> delete(@RequestBody String id) {
JSONObject jsonObject = JSON.parseObject(id, JSONObject.class);
id = String.valueOf(jsonObject.get("id"));
Result<GoodsName> result = new Result<GoodsName>(); Result<GoodsName> result = new Result<GoodsName>();
GoodsName goodsName = goodsNameService.getById(id); GoodsName goodsName = goodsNameService.getById(id);
if (goodsName == null) { if (goodsName == null) {

View File

@ -1,6 +1,8 @@
package com.zhgd.xmgl.modules.weight.controller; package com.zhgd.xmgl.modules.weight.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -122,9 +124,10 @@ public class ReceivingForwardingUnitController {
* @return * @return
*/ */
@ApiOperation(value = "删除收发货单位信息", notes = "删除收发货单位信息", httpMethod = "POST") @ApiOperation(value = "删除收发货单位信息", notes = "删除收发货单位信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "收发货单位ID", paramType = "query", required = true, dataType = "Integer")
@PostMapping(value = "/delete") @PostMapping(value = "/delete")
public Result<ReceivingForwardingUnit> delete(@RequestParam(name = "id", required = true) String id) { public Result<ReceivingForwardingUnit> delete(@RequestBody String id) {
JSONObject jsonObject = JSON.parseObject(id, JSONObject.class);
id = String.valueOf(jsonObject.get("id"));
Result<ReceivingForwardingUnit> result = new Result<ReceivingForwardingUnit>(); Result<ReceivingForwardingUnit> result = new Result<ReceivingForwardingUnit>();
ReceivingForwardingUnit receivingForwardingUnit = receivingForwardingUnitService.getById(id); ReceivingForwardingUnit receivingForwardingUnit = receivingForwardingUnitService.getById(id);
if (receivingForwardingUnit == null) { if (receivingForwardingUnit == null) {

View File

@ -1,47 +1,50 @@
package com.zhgd.xmgl.modules.weight.controller; package com.zhgd.xmgl.modules.weight.controller;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.jeecg.common.util.oConvertUtils;
import com.zhgd.xmgl.modules.weight.entity.WeighBookVehicleInfo; import com.zhgd.xmgl.modules.weight.entity.WeighBookVehicleInfo;
import com.zhgd.xmgl.modules.weight.enums.WeighingTypeEnum;
import com.zhgd.xmgl.modules.weight.service.IWeighBookVehicleInfoService; import com.zhgd.xmgl.modules.weight.service.IWeighBookVehicleInfoService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.jeecg.common.util.oConvertUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @Title: Controller * @Title: Controller
* @Description: 过磅预约车辆信息 * @Description: 过磅预约车辆信息
* @author pds * @author pds
* @date 2023-03-21 * @date 2023-03-21
* @version V1.0 * @version V1.0
*/ */
@RestController @RestController
@ -51,23 +54,26 @@ import com.alibaba.fastjson.JSON;
public class WeighBookVehicleInfoController { public class WeighBookVehicleInfoController {
@Autowired @Autowired
private IWeighBookVehicleInfoService weighBookVehicleInfoService; private IWeighBookVehicleInfoService weighBookVehicleInfoService;
/** /**
* 分页列表查询 * 分页列表查询
*
* @param weighBookVehicleInfo * @param weighBookVehicleInfo
* @param pageNo * @param pageNo
* @param pageSize * @param pageSize
* @param lastAdddatetime 现场上次拉取的时间
* @param req * @param req
* @return * @return
*/ */
@ApiOperation(value = " 分页列表查询过磅预约车辆信息信息", notes = "分页列表查询过磅预约车辆信息信息", httpMethod="GET") @ApiOperation(value = " 分页列表查询过磅预约车辆信息信息", notes = "分页列表查询过磅预约车辆信息信息", httpMethod = "GET")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result<IPage<WeighBookVehicleInfo>> queryPageList(WeighBookVehicleInfo weighBookVehicleInfo, public Result<IPage<WeighBookVehicleInfo>> queryPageList(WeighBookVehicleInfo weighBookVehicleInfo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, String lastAdddatetime, HttpServletRequest req) {
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<WeighBookVehicleInfo>> result = new Result<IPage<WeighBookVehicleInfo>>(); Result<IPage<WeighBookVehicleInfo>> result = new Result<IPage<WeighBookVehicleInfo>>();
QueryWrapper<WeighBookVehicleInfo> queryWrapper = QueryGenerator.initQueryWrapper(weighBookVehicleInfo, req.getParameterMap()); QueryWrapper<WeighBookVehicleInfo> queryWrapper = QueryGenerator.initQueryWrapper(weighBookVehicleInfo, req.getParameterMap());
if (StringUtils.isNotBlank(lastAdddatetime)) {
DateTime dateTime = DateUtil.parse(lastAdddatetime);
queryWrapper.lambda().ge(WeighBookVehicleInfo::getAddDateTime, dateTime);
}
Page<WeighBookVehicleInfo> page = new Page<WeighBookVehicleInfo>(pageNo, pageSize); Page<WeighBookVehicleInfo> page = new Page<WeighBookVehicleInfo>(pageNo, pageSize);
IPage<WeighBookVehicleInfo> pageList = weighBookVehicleInfoService.page(page, queryWrapper); IPage<WeighBookVehicleInfo> pageList = weighBookVehicleInfoService.page(page, queryWrapper);
result.setSuccess(true); result.setSuccess(true);
@ -105,41 +111,43 @@ public class WeighBookVehicleInfoController {
public Result<WeighBookVehicleInfo> edit(@RequestBody WeighBookVehicleInfo weighBookVehicleInfo) { public Result<WeighBookVehicleInfo> edit(@RequestBody WeighBookVehicleInfo weighBookVehicleInfo) {
Result<WeighBookVehicleInfo> result = new Result<WeighBookVehicleInfo>(); Result<WeighBookVehicleInfo> result = new Result<WeighBookVehicleInfo>();
WeighBookVehicleInfo weighBookVehicleInfoEntity = weighBookVehicleInfoService.getById(weighBookVehicleInfo.getId()); WeighBookVehicleInfo weighBookVehicleInfoEntity = weighBookVehicleInfoService.getById(weighBookVehicleInfo.getId());
if(weighBookVehicleInfoEntity==null) { if (weighBookVehicleInfoEntity == null) {
result.error500("未找到对应实体"); result.error500("未找到对应实体");
}else { } else {
weighBookVehicleInfoService.updateById(weighBookVehicleInfo); weighBookVehicleInfoService.updateById(weighBookVehicleInfo);
result.success("修改成功!"); result.success("修改成功!");
} }
return result; return result;
} }
/** /**
* 通过id删除 * 通过id删除
*
* @param id * @param id
* @return * @return
*/ */
@ApiOperation(value = "删除过磅预约车辆信息信息", notes = "删除过磅预约车辆信息信息" , httpMethod="POST") @ApiOperation(value = "删除过磅预约车辆信息信息", notes = "删除过磅预约车辆信息信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "过磅预约车辆信息ID", paramType = "query", required = true, dataType = "Integer")
@PostMapping(value = "/delete") @PostMapping(value = "/delete")
public Result<WeighBookVehicleInfo> delete(@RequestParam(name="id",required=true) String id) { public Result<WeighBookVehicleInfo> delete(@RequestBody String id) {
JSONObject jsonObject = JSON.parseObject(id, JSONObject.class);
id = String.valueOf(jsonObject.get("id"));
Result<WeighBookVehicleInfo> result = new Result<WeighBookVehicleInfo>(); Result<WeighBookVehicleInfo> result = new Result<WeighBookVehicleInfo>();
WeighBookVehicleInfo weighBookVehicleInfo = weighBookVehicleInfoService.getById(id); WeighBookVehicleInfo weighBookVehicleInfo = weighBookVehicleInfoService.getById(id);
if(weighBookVehicleInfo==null) { if (weighBookVehicleInfo == null) {
result.error500("未找到对应实体"); result.error500("未找到对应实体");
}else { } else {
boolean ok = weighBookVehicleInfoService.removeById(id); boolean ok = weighBookVehicleInfoService.removeById(id);
if(ok) { if (ok) {
result.success("删除成功!"); result.success("删除成功!");
} }
} }
return result; return result;
} }
/** /**
* 批量删除 * 批量删除
* @param ids * @param ids
* @return * @return
*/ */
@ -220,32 +228,42 @@ public class WeighBookVehicleInfoController {
@ApiOperation(value = "通过excel导入过磅预约车辆信息信息", notes = "通过excel导入过磅预约车辆信息信息", httpMethod="POST") @ApiOperation(value = "通过excel导入过磅预约车辆信息信息", notes = "通过excel导入过磅预约车辆信息信息", httpMethod="POST")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象 MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams(); ImportParams params = new ImportParams();
params.setTitleRows(2); params.setTitleRows(2);
params.setHeadRows(1); params.setHeadRows(1);
params.setNeedSave(true); params.setNeedSave(true);
try { try {
List<WeighBookVehicleInfo> listWeighBookVehicleInfos = ExcelImportUtil.importExcel(file.getInputStream(), WeighBookVehicleInfo.class, params); List<WeighBookVehicleInfo> listWeighBookVehicleInfos = ExcelImportUtil.importExcel(file.getInputStream(), WeighBookVehicleInfo.class, params);
for (WeighBookVehicleInfo weighBookVehicleInfoExcel : listWeighBookVehicleInfos) { for (WeighBookVehicleInfo weighBookVehicleInfoExcel : listWeighBookVehicleInfos) {
weighBookVehicleInfoService.save(weighBookVehicleInfoExcel); weighBookVehicleInfoService.save(weighBookVehicleInfoExcel);
} }
return Result.ok("文件导入成功!数据行数:" + listWeighBookVehicleInfos.size()); return Result.ok("文件导入成功!数据行数:" + listWeighBookVehicleInfos.size());
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error(e.getMessage());
return Result.error("文件导入失败!"); return Result.error("文件导入失败!");
} finally { } finally {
try { try {
file.getInputStream().close(); file.getInputStream().close();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
} }
return Result.ok("文件导入失败!"); return Result.ok("文件导入失败!");
} }
/**
* 获取所有过磅类型列表
*
* @return
*/
@GetMapping("/weighingType")
@ApiOperation(value = "获取所有过磅类型列表", notes = "获取所有过磅类型列表", httpMethod = "GET")
public Result<List<WeighingTypeEnum>> getWeighingTypeEnums() {
return Result.success(Arrays.stream(WeighingTypeEnum.values()).collect(Collectors.toList()));
}
} }

View File

@ -1,5 +1,6 @@
package com.zhgd.xmgl.modules.weight.controller; package com.zhgd.xmgl.modules.weight.controller;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -120,9 +121,10 @@ public class WeighInfoController {
* @return * @return
*/ */
@ApiOperation(value = "删除称重记录表信息", notes = "删除称重记录表信息" , httpMethod="POST") @ApiOperation(value = "删除称重记录表信息", notes = "删除称重记录表信息" , httpMethod="POST")
@ApiImplicitParam(name = "id", value = "称重记录表ID", paramType = "query", required = true, dataType = "Integer")
@PostMapping(value = "/delete") @PostMapping(value = "/delete")
public Result<WeighInfo> delete(@RequestParam(name="id",required=true) String id) { public Result<WeighInfo> delete(@RequestBody String id) {
JSONObject jsonObject = JSON.parseObject(id, JSONObject.class);
id = String.valueOf(jsonObject.get("id"));
Result<WeighInfo> result = new Result<WeighInfo>(); Result<WeighInfo> result = new Result<WeighInfo>();
WeighInfo weighInfo = weighInfoService.getById(id); WeighInfo weighInfo = weighInfoService.getById(id);
if(weighInfo==null) { if(weighInfo==null) {

View File

@ -1,6 +1,7 @@
package com.zhgd.xmgl.modules.weight.controller; package com.zhgd.xmgl.modules.weight.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -122,9 +123,10 @@ public class WeighPicController {
* @return * @return
*/ */
@ApiOperation(value = "删除称重图片信息", notes = "删除称重图片信息", httpMethod = "POST") @ApiOperation(value = "删除称重图片信息", notes = "删除称重图片信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "称重图片ID", paramType = "query", required = true, dataType = "Integer")
@PostMapping(value = "/delete") @PostMapping(value = "/delete")
public Result<WeighPic> delete(@RequestParam(name = "id", required = true) String id) { public Result<WeighPic> delete(@RequestBody String id) {
JSONObject jsonObject = JSON.parseObject(id, JSONObject.class);
id = String.valueOf(jsonObject.get("id"));
Result<WeighPic> result = new Result<WeighPic>(); Result<WeighPic> result = new Result<WeighPic>();
WeighPic weighPic = weighPicService.getById(id); WeighPic weighPic = weighPicService.getById(id);
if (weighPic == null) { if (weighPic == null) {

View File

@ -26,7 +26,7 @@ public class GoodsName implements Serializable {
/**主键id*/ /**主键id*/
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value="主键id") @ApiModelProperty(value="主键id")
private java.lang.Integer id ; private java.lang.Long id ;
/**货名*/ /**货名*/
@Excel(name = "货名", width = 15) @Excel(name = "货名", width = 15)
@ApiModelProperty(value="货名") @ApiModelProperty(value="货名")

View File

@ -26,7 +26,7 @@ public class ReceivingForwardingUnit implements Serializable {
/**主键id*/ /**主键id*/
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value="主键id") @ApiModelProperty(value="主键id")
private java.lang.Integer id ; private java.lang.Long id ;
/**单位名称*/ /**单位名称*/
@Excel(name = "单位名称", width = 15) @Excel(name = "单位名称", width = 15)
@ApiModelProperty(value="单位名称") @ApiModelProperty(value="单位名称")

View File

@ -26,7 +26,7 @@ public class WeighBookVehicleInfo implements Serializable {
/**主键id*/ /**主键id*/
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value="主键id") @ApiModelProperty(value="主键id")
private java.lang.Integer id ; private java.lang.Long id ;
/**车牌号码*/ /**车牌号码*/
@Excel(name = "车牌号码", width = 15) @Excel(name = "车牌号码", width = 15)
@ApiModelProperty(value="车牌号码") @ApiModelProperty(value="车牌号码")

View File

@ -26,7 +26,7 @@ public class WeighInfo implements Serializable {
/**id*/ /**id*/
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value="id") @ApiModelProperty(value="id")
private java.lang.Integer id ; private java.lang.Long id ;
/**流水号*/ /**流水号*/
@Excel(name = "流水号", width = 15) @Excel(name = "流水号", width = 15)
@ApiModelProperty(value="流水号") @ApiModelProperty(value="流水号")

View File

@ -29,7 +29,7 @@ public class WeighPic implements Serializable {
*/ */
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键id") @ApiModelProperty(value = "主键id")
private java.lang.Integer id; private java.lang.Long id;
/** /**
* 称重记录ID * 称重记录ID
*/ */

View File

@ -0,0 +1,38 @@
package com.zhgd.xmgl.modules.weight.enums;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* 过磅类型注解
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum WeighingTypeEnum {
PURCHASED_OVER_THE_SCALE(1, "采购过磅"),
销售过磅SOLD_OVER_POUNDS(2, "销售过磅"),
WEIGHED_INSIDE(3, "内部过磅"),
OTHER_OVERWEIGHS(4, "其他过磅"),
;
private int id;
private String name;
WeighingTypeEnum(int id, String name) {
this.id = id;
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -121,9 +121,10 @@ public class ${entityName}Controller {
* @return * @return
*/ */
@ApiOperation(value = "删除${tableVo.ftlDescription}信息", notes = "删除${tableVo.ftlDescription}信息" , httpMethod="POST") @ApiOperation(value = "删除${tableVo.ftlDescription}信息", notes = "删除${tableVo.ftlDescription}信息" , httpMethod="POST")
@ApiImplicitParam(name = "id", value = "${tableVo.ftlDescription}ID", paramType = "query", required = true, dataType = "Integer")
@PostMapping(value = "/delete") @PostMapping(value = "/delete")
public Result<${entityName}> delete(@RequestParam(name="id",required=true) String id) { public Result<${entityName}> delete(@RequestBody String id) {
JSONObject jsonObject = JSON.parseObject(id, JSONObject.class);
id = String.valueOf(jsonObject.get("id"));
Result<${entityName}> result = new Result<${entityName}>(); Result<${entityName}> result = new Result<${entityName}>();
${entityName} ${entityName?uncap_first} = ${entityName?uncap_first}Service.getById(id); ${entityName} ${entityName?uncap_first} = ${entityName?uncap_first}Service.getById(id);
if(${entityName?uncap_first}==null) { if(${entityName?uncap_first}==null) {