车辆出入厂流程管理

This commit is contained in:
王帅 2025-06-13 14:18:31 +08:00
parent da468a0af5
commit c690338c16
11 changed files with 359 additions and 6 deletions

View File

@ -184,7 +184,7 @@ public class VehicleInOutController extends JeecgController<VehicleInOut, IVehic
@PostMapping(value = "/handleConfirm")
public Result<String> handleConfirm(@RequestBody VehicleInOut vehicleInOut) {
VehicleInOut byId = vehicleInOutService.getById(vehicleInOut.getId());
if (vehicleInOut.getCurrentStatus() != null && Integer.parseInt(vehicleInOut.getCurrentStatus()) <= Integer.parseInt(byId.getCurrentStatus())) {
if (vehicleInOut.getCurrentStatus() != null && Integer.parseInt(vehicleInOut.getCurrentStatus()) - 1 != Integer.parseInt(byId.getCurrentStatus())) {
return Result.error("操作失败,请按照流程操作!");
}
if (TmsConstants.currentStatus_2.equals(vehicleInOut.getCurrentStatus())) {

View File

@ -98,7 +98,7 @@ public class VehicleInOut implements Serializable {
@Excel(name = "出厂门", width = 15)
@ApiModelProperty(value = "出厂门")
private java.lang.String exitFactoryDoor;
/**当前状态 创建-0,预约入厂-1,对接人确认-2,审核入库-3,审核出厂-4*/
/**当前状态 创建-0,预约入厂-1,装车审核-2,审核入厂-3,审核出厂-4*/
@Excel(name = "当前状态", width = 15, dicCode = "currentStatus")
@Dict(dicCode = "currentStatus")
@ApiModelProperty(value = "当前状态")

View File

@ -0,0 +1,202 @@
package org.jeecg.modules.tms.carinout.vehicleinoutcheck.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.tms.carinout.vehicleinout.entity.VehicleInOut;
import org.jeecg.modules.tms.carinout.vehicleinout.service.IVehicleInOutService;
import org.jeecg.modules.tms.carinout.vehicleinoutcheck.entity.VehicleInOutCheck;
import org.jeecg.modules.tms.carinout.vehicleinoutcheck.service.IVehicleInOutCheckService;
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 org.jeecg.modules.tms.constant.TmsConstants;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 对账
* @Author: jeecg-boot
* @Date: 2025-06-13
* @Version: V1.0
*/
@Api(tags="对账")
@RestController
@RequestMapping("/vehicleinoutcheck/vehicleInOutCheck")
@Slf4j
public class VehicleInOutCheckController extends JeecgController<VehicleInOutCheck, IVehicleInOutCheckService> {
@Autowired
private IVehicleInOutCheckService vehicleInOutCheckService;
@Autowired
private IVehicleInOutService vehicleInOutService;
/**
* 分页列表查询
*
* @param vehicleInOutCheck
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "对账-分页列表查询")
@ApiOperation(value="对账-分页列表查询", notes="对账-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<VehicleInOutCheck>> queryPageList(VehicleInOutCheck vehicleInOutCheck,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<VehicleInOutCheck> queryWrapper = QueryGenerator.initQueryWrapper(vehicleInOutCheck, req.getParameterMap());
Page<VehicleInOutCheck> page = new Page<VehicleInOutCheck>(pageNo, pageSize);
IPage<VehicleInOutCheck> pageList = vehicleInOutCheckService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param vehicleInOutCheck
* @return
*/
@AutoLog(value = "对账-添加")
@ApiOperation(value="对账-添加", notes="对账-添加")
//@RequiresPermissions("org.jeecg.modules.tms:tms_vehicle_in_out_check:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody VehicleInOutCheck vehicleInOutCheck) {
VehicleInOut byId = vehicleInOutService.getById(vehicleInOutCheck.getId());
if (!TmsConstants.currentStatus_4.equals(byId.getCurrentStatus())) {
return Result.error("操作失败,请按照流程操作!");
}
LambdaQueryWrapper<VehicleInOutCheck> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(VehicleInOutCheck::getVehicleInOutId, vehicleInOutCheck.getId());
vehicleInOutCheckService.remove(lambdaQueryWrapper);
List<VehicleInOutCheck> vehicleInOutCheckList = vehicleInOutCheck.getVehicleInOutCheckList();
vehicleInOutCheckList.forEach(item -> {
item.setVehicleInOutId(vehicleInOutCheck.getId());
});
vehicleInOutCheckService.saveBatch(vehicleInOutCheckList);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param vehicleInOutCheck
* @return
*/
@AutoLog(value = "对账-编辑")
@ApiOperation(value="对账-编辑", notes="对账-编辑")
//@RequiresPermissions("org.jeecg.modules.tms:tms_vehicle_in_out_check:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody VehicleInOutCheck vehicleInOutCheck) {
vehicleInOutCheckService.updateById(vehicleInOutCheck);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "对账-通过id删除")
@ApiOperation(value="对账-通过id删除", notes="对账-通过id删除")
//@RequiresPermissions("org.jeecg.modules.tms:tms_vehicle_in_out_check:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
vehicleInOutCheckService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "对账-批量删除")
@ApiOperation(value="对账-批量删除", notes="对账-批量删除")
//@RequiresPermissions("org.jeecg.modules.tms:tms_vehicle_in_out_check:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.vehicleInOutCheckService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "对账-通过id查询")
@ApiOperation(value="对账-通过id查询", notes="对账-通过id查询")
@GetMapping(value = "/queryById")
public Result<VehicleInOutCheck> queryById(@RequestParam(name="id",required=true) String id) {
VehicleInOutCheck vehicleInOutCheck = vehicleInOutCheckService.getById(id);
if(vehicleInOutCheck==null) {
return Result.error("未找到对应数据");
}
return Result.OK(vehicleInOutCheck);
}
/**
* 导出excel
*
* @param request
* @param vehicleInOutCheck
*/
//@RequiresPermissions("org.jeecg.modules.tms:tms_vehicle_in_out_check:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, VehicleInOutCheck vehicleInOutCheck) {
return super.exportXls(request, vehicleInOutCheck, VehicleInOutCheck.class, "对账");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
//@RequiresPermissions("tms_vehicle_in_out_check:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, VehicleInOutCheck.class);
}
@GetMapping(value = "/getByVehicleInOutId")
public Result<?> getByVehicleInOutId(@RequestParam(name="vehicleInOutId",required=true) String vehicleInOutId) {
LambdaQueryWrapper<VehicleInOutCheck> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(VehicleInOutCheck::getVehicleInOutId, vehicleInOutId);
List<VehicleInOutCheck> list = vehicleInOutCheckService.list(lambdaQueryWrapper);
return Result.OK(list);
}
}

View File

@ -0,0 +1,77 @@
package org.jeecg.modules.tms.carinout.vehicleinoutcheck.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import java.util.List;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 对账
* @Author: jeecg-boot
* @Date: 2025-06-13
* @Version: V1.0
*/
@Data
@TableName("tms_vehicle_in_out_check")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tms_vehicle_in_out_check对象", description="对账")
public class VehicleInOutCheck implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
/**费用类型*/
@Excel(name = "费用类型", width = 15)
@ApiModelProperty(value = "费用类型")
private String expenseType;
/**价格*/
@Excel(name = "价格", width = 15)
@ApiModelProperty(value = "价格")
private BigDecimal price;
/**发票*/
@Excel(name = "发票", width = 15)
@ApiModelProperty(value = "发票")
private String invoice;
/**车辆出入厂id*/
@Excel(name = "车辆出入厂id", width = 15)
@ApiModelProperty(value = "车辆出入厂id")
private String vehicleInOutId;
@TableField(exist = false)
List<VehicleInOutCheck> vehicleInOutCheckList;
@TableField(exist = false)
private boolean selected = false;
}

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.tms.carinout.vehicleinoutcheck.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.tms.carinout.vehicleinoutcheck.entity.VehicleInOutCheck;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 对账
* @Author: jeecg-boot
* @Date: 2025-06-13
* @Version: V1.0
*/
public interface VehicleInOutCheckMapper extends BaseMapper<VehicleInOutCheck> {
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.tms.carinout.vehicleinoutcheck.mapper.VehicleInOutCheckMapper">
</mapper>

View File

@ -0,0 +1,14 @@
package org.jeecg.modules.tms.carinout.vehicleinoutcheck.service;
import org.jeecg.modules.tms.carinout.vehicleinoutcheck.entity.VehicleInOutCheck;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 对账
* @Author: jeecg-boot
* @Date: 2025-06-13
* @Version: V1.0
*/
public interface IVehicleInOutCheckService extends IService<VehicleInOutCheck> {
}

View File

@ -0,0 +1,19 @@
package org.jeecg.modules.tms.carinout.vehicleinoutcheck.service.impl;
import org.jeecg.modules.tms.carinout.vehicleinoutcheck.entity.VehicleInOutCheck;
import org.jeecg.modules.tms.carinout.vehicleinoutcheck.mapper.VehicleInOutCheckMapper;
import org.jeecg.modules.tms.carinout.vehicleinoutcheck.service.IVehicleInOutCheckService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 对账
* @Author: jeecg-boot
* @Date: 2025-06-13
* @Version: V1.0
*/
@Service
public class VehicleInOutCheckServiceImpl extends ServiceImpl<VehicleInOutCheckMapper, VehicleInOutCheck> implements IVehicleInOutCheckService {
}

View File

@ -193,6 +193,14 @@ public class VehicleInOutDetailController extends JeecgController<VehicleInOutDe
public Result<String> confirm(@RequestBody VehicleInOutDetailParam vehicleInOutDetailParam) {
List<VehicleInOutDetail> deliveryDetailList = vehicleInOutDetailParam.getDeliveryDetailList();
String carNumId = vehicleInOutDetailParam.getCarNum();
VehicleInOut byId = vehicleInOutService.getById(carNumId);
/*if (vehicleInOutDetailParam.getCurrentStatus() != null && Integer.parseInt(vehicleInOutDetailParam.getCurrentStatus()) - 1 != Integer.parseInt(byId.getCurrentStatus())) {
return Result.error("操作失败,请按照流程操作!");
}*/
if (!TmsConstants.currentStatus_2.equals(byId.getCurrentStatus()) &&
!TmsConstants.currentStatus_3.equals(byId.getCurrentStatus())) {
return Result.error("操作失败,请按照流程操作!");
}
LambdaQueryWrapper<VehicleInOutDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(VehicleInOutDetail::getVehicleInOutId, carNumId);
vehicleInOutDetailService.remove(lambdaQueryWrapper);
@ -205,4 +213,14 @@ public class VehicleInOutDetailController extends JeecgController<VehicleInOutDe
vehicleInOutService.updateById(vehicleInOut);
return Result.OK("车牌绑定成功!");
}
@GetMapping(value = "/getByVehicleInOutId")
public Result<?> getByVehicleInOutId(@RequestParam(name="vehicleInOutId",required=true) String vehicleInOutId) {
LambdaQueryWrapper<VehicleInOutDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(VehicleInOutDetail::getVehicleInOutId, vehicleInOutId);
List<VehicleInOutDetail> list = vehicleInOutDetailService.list(lambdaQueryWrapper);
return Result.OK(list);
}
}

View File

@ -4,10 +4,8 @@ import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
@ -63,4 +61,6 @@ public class VehicleInOutDetail implements Serializable {
@Excel(name = "车辆出入厂流程管理id", width = 15)
@ApiModelProperty(value = "车辆出入厂流程管理id")
private String vehicleInOutId;
@TableField(exist = false)
private boolean selected = false;
}

View File

@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;