diff --git a/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinout/controller/VehicleInOutController.java b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinout/controller/VehicleInOutController.java index 840179c..73c2956 100644 --- a/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinout/controller/VehicleInOutController.java +++ b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinout/controller/VehicleInOutController.java @@ -184,7 +184,7 @@ public class VehicleInOutController extends JeecgController 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())) { diff --git a/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinout/entity/VehicleInOut.java b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinout/entity/VehicleInOut.java index 8aa1d21..1cf881c 100644 --- a/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinout/entity/VehicleInOut.java +++ b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinout/entity/VehicleInOut.java @@ -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 = "当前状态") diff --git a/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutcheck/controller/VehicleInOutCheckController.java b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutcheck/controller/VehicleInOutCheckController.java new file mode 100644 index 0000000..b3ff797 --- /dev/null +++ b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutcheck/controller/VehicleInOutCheckController.java @@ -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 { + @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> queryPageList(VehicleInOutCheck vehicleInOutCheck, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(vehicleInOutCheck, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage 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 add(@RequestBody VehicleInOutCheck vehicleInOutCheck) { + VehicleInOut byId = vehicleInOutService.getById(vehicleInOutCheck.getId()); + if (!TmsConstants.currentStatus_4.equals(byId.getCurrentStatus())) { + return Result.error("操作失败,请按照流程操作!"); + } + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(VehicleInOutCheck::getVehicleInOutId, vehicleInOutCheck.getId()); + vehicleInOutCheckService.remove(lambdaQueryWrapper); + List 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 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 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 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 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 lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(VehicleInOutCheck::getVehicleInOutId, vehicleInOutId); + List list = vehicleInOutCheckService.list(lambdaQueryWrapper); + return Result.OK(list); + } +} diff --git a/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutcheck/entity/VehicleInOutCheck.java b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutcheck/entity/VehicleInOutCheck.java new file mode 100644 index 0000000..1ecc2ee --- /dev/null +++ b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutcheck/entity/VehicleInOutCheck.java @@ -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 vehicleInOutCheckList; + @TableField(exist = false) + private boolean selected = false; +} diff --git a/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutcheck/mapper/VehicleInOutCheckMapper.java b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutcheck/mapper/VehicleInOutCheckMapper.java new file mode 100644 index 0000000..0b2dcaa --- /dev/null +++ b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutcheck/mapper/VehicleInOutCheckMapper.java @@ -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 { + +} diff --git a/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutcheck/mapper/xml/VehicleInOutCheckMapper.xml b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutcheck/mapper/xml/VehicleInOutCheckMapper.xml new file mode 100644 index 0000000..e9fd577 --- /dev/null +++ b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutcheck/mapper/xml/VehicleInOutCheckMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutcheck/service/IVehicleInOutCheckService.java b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutcheck/service/IVehicleInOutCheckService.java new file mode 100644 index 0000000..20970ee --- /dev/null +++ b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutcheck/service/IVehicleInOutCheckService.java @@ -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 { + +} diff --git a/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutcheck/service/impl/VehicleInOutCheckServiceImpl.java b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutcheck/service/impl/VehicleInOutCheckServiceImpl.java new file mode 100644 index 0000000..d2adb7b --- /dev/null +++ b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutcheck/service/impl/VehicleInOutCheckServiceImpl.java @@ -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 implements IVehicleInOutCheckService { + +} diff --git a/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutdetail/controller/VehicleInOutDetailController.java b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutdetail/controller/VehicleInOutDetailController.java index f1710a6..0d678c4 100644 --- a/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutdetail/controller/VehicleInOutDetailController.java +++ b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutdetail/controller/VehicleInOutDetailController.java @@ -193,6 +193,14 @@ public class VehicleInOutDetailController extends JeecgController confirm(@RequestBody VehicleInOutDetailParam vehicleInOutDetailParam) { List 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 lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(VehicleInOutDetail::getVehicleInOutId, carNumId); vehicleInOutDetailService.remove(lambdaQueryWrapper); @@ -205,4 +213,14 @@ public class VehicleInOutDetailController extends JeecgController getByVehicleInOutId(@RequestParam(name="vehicleInOutId",required=true) String vehicleInOutId) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(VehicleInOutDetail::getVehicleInOutId, vehicleInOutId); + List list = vehicleInOutDetailService.list(lambdaQueryWrapper); + return Result.OK(list); + } + + } diff --git a/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutdetail/entity/VehicleInOutDetail.java b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutdetail/entity/VehicleInOutDetail.java index 8fbbd2a..7f90511 100644 --- a/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutdetail/entity/VehicleInOutDetail.java +++ b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutdetail/entity/VehicleInOutDetail.java @@ -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; } diff --git a/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutdetail/entity/VehicleInOutDetailParam.java b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutdetail/entity/VehicleInOutDetailParam.java index 2151eaf..54dc1a9 100644 --- a/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutdetail/entity/VehicleInOutDetailParam.java +++ b/jeecg-boot/jeecg-module-tms/src/main/java/org/jeecg/modules/tms/carinout/vehicleinoutdetail/entity/VehicleInOutDetailParam.java @@ -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;