生成船期管理后端代码

This commit is contained in:
2026-03-03 17:45:03 +08:00
parent d81b94031b
commit eff1760244
20 changed files with 342 additions and 147 deletions

View File

@ -84,11 +84,7 @@ public class MeaPurIntController {
@ApiOperation(value="根据id查询LngMeaPurInt信息")
@SaCheckPermission("meaPurInt:detail")
public R info(@RequestParam Long id){
LngMeaPurInt lngMeaPurInt = meaPurIntService.getById(id);
if (lngMeaPurInt == null) {
return R.error("找不到此数据!");
}
return R.ok(BeanUtil.toBean(lngMeaPurInt, LngMeaPurIntVo.class));
return R.ok(meaPurIntService.getMeaPurIntById(id));
}
@GetMapping(value = "/datalog")
@ -119,7 +115,7 @@ public class MeaPurIntController {
@ApiOperation(value = "删除")
@SaCheckPermission("meaPurInt:delete")
public R delete(@Valid @RequestBody List<Long> ids){
return R.ok(dataService.deleteByIds(UpdateLngMeaPurIntDto.class, ids));
return R.ok(dataService.deleteByIds(UpdateLngMeaPurIntDto.class, ids));
}

View File

@ -1,36 +1,38 @@
package com.xjrsoft.module.ship.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import java.util.List;
import javax.validation.Valid;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.xjrsoft.common.constant.GlobalConstant;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.utils.VoToColumnUtil;
import com.xjrsoft.module.ship.dto.AddLngOpsPurIntDto;
import com.xjrsoft.module.ship.dto.UpdateLngOpsPurIntDto;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.ship.dto.LngOpsPurIntPageDto;
import com.xjrsoft.module.ship.dto.UpdateLngOpsPurIntDto;
import com.xjrsoft.module.ship.entity.LngOpsPurInt;
import com.xjrsoft.module.ship.service.IOpsPurIntService;
import com.xjrsoft.module.ship.vo.LngOpsPurIntPageVo;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.ship.vo.LngOpsPurIntVo;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @title: 采购执行
@ -75,11 +77,8 @@ public class OpsPurIntController {
@ApiOperation(value="根据id查询LngOpsPurInt信息")
@SaCheckPermission("opsPurInt:detail")
public R info(@RequestParam Long id){
LngOpsPurInt lngOpsPurInt = opsPurIntService.getById(id);
if (lngOpsPurInt == null) {
return R.error("找不到此数据!");
}
return R.ok(BeanUtil.toBean(lngOpsPurInt, LngOpsPurIntVo.class));
return R.ok(opsPurIntService.getOpsPurIntById(id));
}
@GetMapping(value = "/datalog")

View File

@ -74,11 +74,7 @@ public class OpsSalesIntController {
@ApiOperation(value="根据id查询LngOpsSalesInt信息")
@SaCheckPermission("opsSalesInt:detail")
public R info(@RequestParam Long id){
LngOpsSalesInt lngOpsSalesInt = opsSalesIntService.getById(id);
if (lngOpsSalesInt == null) {
return R.error("找不到此数据!");
}
return R.ok(BeanUtil.toBean(lngOpsSalesInt, LngOpsSalesIntVo.class));
return R.ok(opsSalesIntService.getOpsSalesIntById(id));
}
@GetMapping(value = "/datalog")

View File

@ -0,0 +1,117 @@
package com.xjrsoft.module.ship.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.xjrsoft.common.constant.GlobalConstant;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.utils.VoToColumnUtil;
import com.xjrsoft.module.ship.dto.AddLngShipScheduleDto;
import com.xjrsoft.module.ship.dto.UpdateLngShipScheduleDto;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.xjrsoft.module.ship.dto.LngShipSchedulePageDto;
import com.xjrsoft.module.ship.entity.LngShipSchedule;
import com.xjrsoft.module.ship.service.IShipScheduleService;
import com.xjrsoft.module.ship.vo.LngShipSchedulePageVo;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.ship.vo.LngShipScheduleVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @title: 船期计划排布
* @Author 管理员
* @Date: 2026-03-03
* @Version 1.0
*/
@RestController
@RequestMapping("/ship" + "/shipSchedule")
@Api(value = "/ship" + "/shipSchedule",tags = "船期计划排布代码")
@AllArgsConstructor
public class ShipScheduleController {
private final IShipScheduleService shipScheduleService;
private final DatalogService dataService;
@GetMapping(value = "/page")
@ApiOperation(value="LngShipSchedule列表(分页)")
@SaCheckPermission("shipSchedule:list")
public R page(@Valid LngShipSchedulePageDto dto){
LambdaQueryWrapper<LngShipSchedule> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper
.eq(ObjectUtil.isNotNull(dto.getId()),LngShipSchedule::getId,dto.getId())
.like(StrUtil.isNotBlank(dto.getSsNo()),LngShipSchedule::getSsNo,dto.getSsNo())
.eq(ObjectUtil.isNotNull(dto.getKId()),LngShipSchedule::getKId,dto.getKId())
.like(StrUtil.isNotBlank(dto.getLongSpotCode()),LngShipSchedule::getLongSpotCode,dto.getLongSpotCode())
.eq(ObjectUtil.isNotNull(dto.getComId()),LngShipSchedule::getComId,dto.getComId())
//.between(ObjectUtil.isNotNull(dto.getDateEtaStart()) && ObjectUtil.isNotNull(dto.getDateEtaEnd()),LngShipSchedule::getDateEta,dto.getDateEtaStart(),dto.getDateEtaEnd())
.like(StrUtil.isNotBlank(dto.getStaCode()),LngShipSchedule::getStaCode,dto.getStaCode())
.like(StrUtil.isNotBlank(dto.getSuName()),LngShipSchedule::getSuName,dto.getSuName())
.like(StrUtil.isNotBlank(dto.getSsTypeCode()),LngShipSchedule::getSsTypeCode,dto.getSsTypeCode())
.eq(ObjectUtil.isNotNull(dto.getOpsPurId()),LngShipSchedule::getOpsPurId,dto.getOpsPurId())
.eq(ObjectUtil.isNotNull(dto.getOpsSalesId()),LngShipSchedule::getOpsSalesId,dto.getOpsSalesId())
.orderByDesc(LngShipSchedule::getId)
.select(LngShipSchedule.class,x -> VoToColumnUtil.fieldsToColumns(LngShipSchedulePageVo.class).contains(x.getProperty()));
IPage<LngShipSchedule> page = shipScheduleService.page(ConventPage.getPage(dto), queryWrapper);
PageOutput<LngShipSchedulePageVo> pageOutput = ConventPage.getPageOutput(page, LngShipSchedulePageVo.class);
return R.ok(pageOutput);
}
@GetMapping(value = "/info")
@ApiOperation(value="根据id查询LngShipSchedule信息")
@SaCheckPermission("shipSchedule:detail")
public R info(@RequestParam Long id){
return R.ok(shipScheduleService.getShipScheduleById(id));
}
@GetMapping(value = "/datalog")
@ApiOperation(value="根据id查询LngShipSchedule数据详细日志")
@SaCheckPermission("shipSchedule:datalog")
public R datalog(@RequestParam Long id){
List<DataChangeLogVo> logs = dataService.findLogsByEntityId(UpdateLngShipScheduleDto.class,id);
return R.ok(logs);
}
@PostMapping
@ApiOperation(value = "新增LngShipSchedule")
@SaCheckPermission("shipSchedule:add")
public R add(@Valid @RequestBody UpdateLngShipScheduleDto dto){
UpdateLngShipScheduleDto res = dataService.insert(dto);
return R.ok(res.getId());
}
@PutMapping
@ApiOperation(value = "修改LngShipSchedule")
@SaCheckPermission("shipSchedule:edit")
public R update(@Valid @RequestBody UpdateLngShipScheduleDto dto){
return R.ok(dataService.updateById(dto));
}
@DeleteMapping
@ApiOperation(value = "删除")
@SaCheckPermission("shipSchedule:delete")
public R delete(@Valid @RequestBody List<Long> ids){
return R.ok(dataService.deleteByIds(UpdateLngShipScheduleDto.class, ids));
}
}

View File

@ -1,12 +1,8 @@
package com.xjrsoft.module.ship.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.yulichang.base.MPJBaseService;
import com.github.yulichang.extension.mapping.base.MPJDeepService;
import com.github.yulichang.extension.mapping.base.MPJRelationService;
import com.xjrsoft.module.ship.entity.LngMeaPurInt;
import lombok.Data;
import java.util.List;
import com.xjrsoft.module.ship.vo.LngMeaPurIntVo;
/**
* @title: service
@ -16,4 +12,6 @@ import java.util.List;
*/
public interface IMeaPurIntService extends IService<LngMeaPurInt> {
LngMeaPurIntVo getMeaPurIntById(Long id);
}

View File

@ -1,12 +1,8 @@
package com.xjrsoft.module.ship.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.yulichang.base.MPJBaseService;
import com.github.yulichang.extension.mapping.base.MPJDeepService;
import com.github.yulichang.extension.mapping.base.MPJRelationService;
import com.xjrsoft.module.ship.entity.LngOpsPurInt;
import lombok.Data;
import java.util.List;
import com.xjrsoft.module.ship.vo.LngOpsPurIntVo;
/**
* @title: service
@ -16,4 +12,6 @@ import java.util.List;
*/
public interface IOpsPurIntService extends IService<LngOpsPurInt> {
LngOpsPurIntVo getOpsPurIntById(Long id);
}

View File

@ -1,12 +1,8 @@
package com.xjrsoft.module.ship.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.yulichang.base.MPJBaseService;
import com.github.yulichang.extension.mapping.base.MPJDeepService;
import com.github.yulichang.extension.mapping.base.MPJRelationService;
import com.xjrsoft.module.ship.entity.LngOpsSalesInt;
import lombok.Data;
import java.util.List;
import com.xjrsoft.module.ship.vo.LngOpsSalesIntVo;
/**
* @title: service
@ -16,4 +12,6 @@ import java.util.List;
*/
public interface IOpsSalesIntService extends IService<LngOpsSalesInt> {
LngOpsSalesIntVo getOpsSalesIntById(Long id);
}

View File

@ -1,12 +1,8 @@
package com.xjrsoft.module.ship.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.yulichang.base.MPJBaseService;
import com.github.yulichang.extension.mapping.base.MPJDeepService;
import com.github.yulichang.extension.mapping.base.MPJRelationService;
import com.xjrsoft.module.ship.entity.LngShipSchedule;
import lombok.Data;
import java.util.List;
import com.xjrsoft.module.ship.vo.LngShipScheduleVo;
/**
* @title: service
@ -16,4 +12,6 @@ import java.util.List;
*/
public interface IShipScheduleService extends IService<LngShipSchedule> {
LngShipScheduleVo getShipScheduleById(Long id);
}

View File

@ -1,17 +1,23 @@
package com.xjrsoft.module.ship.service.impl;
import java.util.List;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.pictc.enums.BusinessCode;
import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.module.ship.entity.LngMeaPurInt;
import com.xjrsoft.module.ship.entity.LngOpsPurInt;
import com.xjrsoft.module.ship.mapper.LngMeaPurIntMapper;
import com.xjrsoft.module.ship.service.IMeaPurIntService;
import com.xjrsoft.module.ship.vo.LngMeaPurIntVo;
import com.xjrsoft.module.ship.vo.LngOpsPurIntVo;
import com.xjrsoft.module.system.client.IFileClient;
import com.xjrsoft.module.system.vo.LngFileUploadVo;
import cn.hutool.core.bean.BeanUtil;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
/**
* @title: service
@ -22,4 +28,19 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@Service
@AllArgsConstructor
public class MeaPurIntServiceImpl extends ServiceImpl<LngMeaPurIntMapper, LngMeaPurInt> implements IMeaPurIntService {
private final IFileClient fileClient;
@Override
public LngMeaPurIntVo getMeaPurIntById(Long id) {
LngMeaPurInt lngMeaPurInt = this.getById(id);
if (lngMeaPurInt == null) {
throw new BusinessException(BusinessCode.of(10500, "找不到此数据!"));
}
LngMeaPurIntVo vo = BeanUtil.toBean(lngMeaPurInt, LngMeaPurIntVo.class);
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_mea_pur_int", "fileList", vo.getId());
vo.setFileList(fileList);
return vo;
}
}

View File

@ -1,17 +1,21 @@
package com.xjrsoft.module.ship.service.impl;
import java.util.List;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.pictc.enums.BusinessCode;
import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.module.ship.entity.LngOpsPurInt;
import com.xjrsoft.module.ship.mapper.LngOpsPurIntMapper;
import com.xjrsoft.module.ship.service.IOpsPurIntService;
import com.xjrsoft.module.ship.vo.LngOpsPurIntVo;
import com.xjrsoft.module.system.client.IFileClient;
import com.xjrsoft.module.system.vo.LngFileUploadVo;
import cn.hutool.core.bean.BeanUtil;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
/**
* @title: service
@ -22,4 +26,19 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@Service
@AllArgsConstructor
public class OpsPurIntServiceImpl extends ServiceImpl<LngOpsPurIntMapper, LngOpsPurInt> implements IOpsPurIntService {
private final IFileClient fileClient;
@Override
public LngOpsPurIntVo getOpsPurIntById(Long id) {
LngOpsPurInt lngOpsPurInt = this.getById(id);
if (lngOpsPurInt == null) {
throw new BusinessException(BusinessCode.of(10500, "找不到此数据!"));
}
LngOpsPurIntVo vo = BeanUtil.toBean(lngOpsPurInt, LngOpsPurIntVo.class);
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_ops_pur_int", "fileList", vo.getId());
vo.setFileList(fileList);
return vo;
}
}

View File

@ -1,17 +1,23 @@
package com.xjrsoft.module.ship.service.impl;
import java.util.List;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.pictc.enums.BusinessCode;
import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.module.ship.entity.LngOpsSalesInt;
import com.xjrsoft.module.ship.entity.LngShipSchedule;
import com.xjrsoft.module.ship.mapper.LngOpsSalesIntMapper;
import com.xjrsoft.module.ship.service.IOpsSalesIntService;
import com.xjrsoft.module.ship.vo.LngOpsSalesIntVo;
import com.xjrsoft.module.ship.vo.LngShipScheduleVo;
import com.xjrsoft.module.system.client.IFileClient;
import com.xjrsoft.module.system.vo.LngFileUploadVo;
import cn.hutool.core.bean.BeanUtil;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
/**
* @title: service
@ -22,4 +28,19 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@Service
@AllArgsConstructor
public class OpsSalesIntServiceImpl extends ServiceImpl<LngOpsSalesIntMapper, LngOpsSalesInt> implements IOpsSalesIntService {
private final IFileClient fileClient;
@Override
public LngOpsSalesIntVo getOpsSalesIntById(Long id) {
LngOpsSalesInt lngOpsSalesInt = this.getById(id);
if (lngOpsSalesInt == null) {
throw new BusinessException(BusinessCode.of(10500, "找不到此数据!"));
}
LngOpsSalesIntVo vo = BeanUtil.toBean(lngOpsSalesInt, LngOpsSalesIntVo.class);
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_ops_sales_int", "fileList", vo.getId());
vo.setFileList(fileList);
return vo;
}
}

View File

@ -1,12 +1,20 @@
package com.xjrsoft.module.ship.service.impl;
import java.util.List;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pictc.enums.BusinessCode;
import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.module.ship.entity.LngShipSchedule;
import com.xjrsoft.module.ship.mapper.LngShipScheduleMapper;
import com.xjrsoft.module.ship.service.IShipScheduleService;
import com.xjrsoft.module.ship.vo.LngShipScheduleVo;
import com.xjrsoft.module.system.client.IFileClient;
import com.xjrsoft.module.system.vo.LngFileUploadVo;
import cn.hutool.core.bean.BeanUtil;
import lombok.AllArgsConstructor;
/**
@ -18,4 +26,18 @@ import lombok.AllArgsConstructor;
@Service
@AllArgsConstructor
public class ShipScheduleServiceImpl extends ServiceImpl<LngShipScheduleMapper, LngShipSchedule> implements IShipScheduleService {
private final IFileClient fileClient;
@Override
public LngShipScheduleVo getShipScheduleById(Long id) {
LngShipSchedule lngShipSchedule = this.getById(id);
if (lngShipSchedule == null) {
throw new BusinessException(BusinessCode.of(10500, "找不到此数据!"));
}
LngShipScheduleVo vo = BeanUtil.toBean(lngShipSchedule, LngShipScheduleVo.class);
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_ship_schedule", "fileList", vo.getId());
vo.setFileList(fileList);
return vo;
}
}