|
@@ -102,9 +102,10 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
|
|
|
if (syShippingDetailsItemList.size() == 0) {
|
|
|
throw new JeecgBootException("表体信息不能为空!");
|
|
|
}
|
|
|
- syShippingDetailsService.syShippingDetailsAdd(syShippingDetails);
|
|
|
- result.success("添加成功!");
|
|
|
- result.setResult(syShippingDetails);
|
|
|
+ SyShippingDetails syShippingDetailstEntity = syShippingDetailsService.syShippingDetailsAdd(syShippingDetails);
|
|
|
+ result.setSuccess(true);
|
|
|
+ result.setMessage("添加成功!");
|
|
|
+ result.setResult(syShippingDetailstEntity);
|
|
|
}catch (Exception ex){
|
|
|
ex.printStackTrace();
|
|
|
log.error("保存失败:" + ex.getMessage());
|
|
@@ -124,9 +125,33 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
|
|
|
@AutoLog(value = "发运明细主表-编辑")
|
|
|
@ApiOperation(value="发运明细主表-编辑", notes="发运明细主表-编辑")
|
|
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
- public Result<?> edit(@RequestBody SyShippingDetails syShippingDetails) {
|
|
|
- syShippingDetailsService.updateById(syShippingDetails);
|
|
|
- return Result.OK("编辑成功!");
|
|
|
+ public Result<SyShippingDetails> edit(@RequestBody SyShippingDetails syShippingDetails) {
|
|
|
+
|
|
|
+ Result<SyShippingDetails> result = new Result<SyShippingDetails>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ String id = syShippingDetails.getId();
|
|
|
+ if (oConvertUtils.isEmpty(id)){
|
|
|
+ throw new JeecgBootException("对象ID不能为空");
|
|
|
+ }
|
|
|
+ List<SyShippingDetailsItem> syShippingDetailsItemList = syShippingDetails.getSyShippingDetailsItemList();
|
|
|
+ if(syShippingDetailsItemList.size()==0){
|
|
|
+ throw new JeecgBootException("表体数据不能为空!");
|
|
|
+ }
|
|
|
+ SyShippingDetails shippingDetails = syShippingDetailsService.syShippingDetailsEdit(syShippingDetails);
|
|
|
+ result.setMessage("修改成功");
|
|
|
+ result.setSuccess(true);
|
|
|
+ result.setResult(shippingDetails);
|
|
|
+
|
|
|
+ }catch (Exception ex){
|
|
|
+ ex.printStackTrace();
|
|
|
+ log.error("保存失败:" + ex.getMessage());
|
|
|
+ result.error500("保存失败:" + ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -146,15 +171,36 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
|
|
|
/**
|
|
|
* 批量删除
|
|
|
*
|
|
|
- * @param ids
|
|
|
+ * @param id
|
|
|
* @return
|
|
|
*/
|
|
|
@AutoLog(value = "发运明细主表-批量删除")
|
|
|
@ApiOperation(value="发运明细主表-批量删除", notes="发运明细主表-批量删除")
|
|
|
@DeleteMapping(value = "/deleteBatch")
|
|
|
- public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
|
- this.syShippingDetailsService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
- return Result.OK("批量删除成功!");
|
|
|
+ public Result<Integer> deleteBatch(@RequestParam(name="id",required=true) String id) {
|
|
|
+
|
|
|
+ Result<Integer> result = new Result<>();
|
|
|
+
|
|
|
+ if(oConvertUtils.isEmpty(id)){
|
|
|
+ throw new JeecgBootException("ID不能为空!");
|
|
|
+ }
|
|
|
+ //判断是由有该数据
|
|
|
+ SyShippingDetails shippingDetails = syShippingDetailsService.getById(id);
|
|
|
+ if(oConvertUtils.isEmpty(shippingDetails)){
|
|
|
+ throw new JeecgBootException("未找到该数据!");
|
|
|
+ }
|
|
|
+ //判断是否已提交
|
|
|
+ if(shippingDetails.getState().equals("1")){
|
|
|
+ throw new JeecgBootException("该单据已提交,不允许删除!");
|
|
|
+ }
|
|
|
+
|
|
|
+ int size = syShippingDetailsService.syShippingDetailsDelete(id);
|
|
|
+ if(size>0){
|
|
|
+ result.setSuccess(true);
|
|
|
+ result.setMessage("删除成功");
|
|
|
+ result.setResult(size);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -221,10 +267,10 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
|
|
|
* @param response
|
|
|
* @return
|
|
|
*/
|
|
|
- @AutoLog(value = "发运明细查询订单")
|
|
|
- @ApiOperation(value="发运明细查询订单", notes="发运明细查询订单")
|
|
|
- @GetMapping(value = "/queryOrderData")
|
|
|
- public Result<IPage<OrderDataVo>> queryOrderData(String orderNumber,String pkOrg,
|
|
|
+ @AutoLog(value = "发运明细查询订单")
|
|
|
+ @ApiOperation(value="发运明细查询订单", notes="发运明细查询订单")
|
|
|
+ @GetMapping(value = "/queryOrderData")
|
|
|
+ public Result<IPage<OrderDataVo>> queryOrderData(String orderNumber,String pkOrg,
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
HttpServletRequest request, HttpServletResponse response){
|
|
@@ -251,4 +297,42 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @AutoLog(value = "发运明细提交")
|
|
|
+ @ApiOperation(value = "发运明细提交",notes="发运明细提交")
|
|
|
+ @PostMapping(value = "/syShippingDetailsSubmit")
|
|
|
+ public Result<SyShippingDetails> syShippingDetailsSubmit(@RequestParam(name="id",required=true) String id) {
|
|
|
+
|
|
|
+ Result<SyShippingDetails> result = new Result<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
+ if(oConvertUtils.isEmpty(id)){
|
|
|
+ throw new JeecgBootException("未拿到ID");
|
|
|
+ }
|
|
|
+ //判断是否有该数据
|
|
|
+ SyShippingDetails shippingDetails = syShippingDetailsService.getById(id);
|
|
|
+ if(oConvertUtils.isEmpty(shippingDetails)){
|
|
|
+ throw new JeecgBootException("未找到该数据!");
|
|
|
+ }
|
|
|
+ //判断是否已提交
|
|
|
+ if(shippingDetails.getState().equals("1")){
|
|
|
+ throw new JeecgBootException("该单据已提交,不允许再次提交!");
|
|
|
+ }
|
|
|
+ shippingDetails.setState("1");
|
|
|
+ syShippingDetailsService.updateById(shippingDetails);
|
|
|
+
|
|
|
+ result.setMessage("提交成功!");
|
|
|
+ result.setSuccess(true);
|
|
|
+ result.setResult(shippingDetails);
|
|
|
+
|
|
|
+ }catch (Exception ex){
|
|
|
+ ex.printStackTrace();
|
|
|
+ log.error("提交失败:" + ex.getMessage());
|
|
|
+ result.error500("提交失败:" + ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|