岗位添加层级和成本,应收管理添加回款明细
This commit is contained in:
parent
3e69eb4c49
commit
2ab727e6e2
@ -136,7 +136,7 @@ public interface ErrorCodeConstants {
|
||||
|
||||
ErrorCode ORDER_YF_NOT_EXISTS = new ErrorCode(1_011_001, "应付记录不存在");
|
||||
ErrorCode ORDER_YS_NOT_EXISTS = new ErrorCode(1_011_001, "应收记录不存在");
|
||||
|
||||
ErrorCode ORDER_YS_DETAIL_NOT_EXISTS = new ErrorCode(1_011_001, "应收记录明细不存在");
|
||||
ErrorCode SALE_ORDER_COST_DETAIL_NOT_EXISTS = new ErrorCode(1_011_001, "项目订单成本汇算明细不存在");
|
||||
/************责任人管理***********/
|
||||
ErrorCode OWNER_NOT_EXISTS = new ErrorCode(1_013_001, "人员配置主数据维护错误,请确认!");
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.orderys.vo;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.orderysdetail.vo.OrderYsDetailSaveReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.orderysdetail.OrderYsDetailDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
@ -40,5 +42,7 @@ public class OrderYsSaveReqVO {
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String rem;
|
||||
@Schema(description = "收款明细")
|
||||
private List<OrderYsDetailDO> orderYsDetails;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,102 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.orderysdetail;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.orderysdetail.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.orderysdetail.OrderYsDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.service.orderysdetail.OrderYsDetailService;
|
||||
|
||||
@Tag(name = "管理后台 - 应收记录表明细")
|
||||
@RestController
|
||||
@RequestMapping("/heli/order-ys-detail")
|
||||
@Validated
|
||||
public class OrderYsDetailController {
|
||||
|
||||
@Resource
|
||||
private OrderYsDetailService orderYsDetailService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建应收记录表明细")
|
||||
@PreAuthorize("@ss.hasPermission('heli:order-ys-detail:create')")
|
||||
public CommonResult<Integer> createOrderYsDetail(@Valid @RequestBody OrderYsDetailSaveReqVO createReqVO) {
|
||||
return success(orderYsDetailService.createOrderYsDetail(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新应收记录表明细")
|
||||
@PreAuthorize("@ss.hasPermission('heli:order-ys-detail:update')")
|
||||
public CommonResult<Boolean> updateOrderYsDetail(@Valid @RequestBody OrderYsDetailSaveReqVO updateReqVO) {
|
||||
orderYsDetailService.updateOrderYsDetail(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除应收记录表明细")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('heli:order-ys-detail:delete')")
|
||||
public CommonResult<Boolean> deleteOrderYsDetail(@RequestParam("id") Integer id) {
|
||||
orderYsDetailService.deleteOrderYsDetail(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得应收记录表明细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:order-ys-detail:query')")
|
||||
public CommonResult<OrderYsDetailRespVO> getOrderYsDetail(@RequestParam("id") Integer id) {
|
||||
OrderYsDetailDO orderYsDetail = orderYsDetailService.getOrderYsDetail(id);
|
||||
return success(BeanUtils.toBean(orderYsDetail, OrderYsDetailRespVO.class));
|
||||
}
|
||||
@GetMapping("/getOrderYsDetails")
|
||||
@Operation(summary = "获得应收记录表明细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('heli:order-ys-detail:query')")
|
||||
public CommonResult<List<OrderYsDetailRespVO>> getOrderYsDetails(@RequestParam("id") Integer id) {
|
||||
List<OrderYsDetailDO> orderYsDetail = orderYsDetailService.getOrderYsDetails(id);
|
||||
return success(BeanUtils.toBean(orderYsDetail, OrderYsDetailRespVO.class));
|
||||
}
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得应收记录表明细分页")
|
||||
@PreAuthorize("@ss.hasPermission('heli:order-ys-detail:query')")
|
||||
public CommonResult<PageResult<OrderYsDetailRespVO>> getOrderYsDetailPage(@Valid OrderYsDetailPageReqVO pageReqVO) {
|
||||
PageResult<OrderYsDetailDO> pageResult = orderYsDetailService.getOrderYsDetailPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, OrderYsDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出应收记录表明细 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('heli:order-ys-detail:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportOrderYsDetailExcel(@Valid OrderYsDetailPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<OrderYsDetailDO> list = orderYsDetailService.getOrderYsDetailPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "应收记录表明细.xls", "数据", OrderYsDetailRespVO.class,
|
||||
BeanUtils.toBean(list, OrderYsDetailRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.orderysdetail.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 应收记录表明细分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class OrderYsDetailPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "回款金额")
|
||||
private BigDecimal cgYishou;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String rem;
|
||||
|
||||
@Schema(description = "回款日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDate[] paymentDate;
|
||||
|
||||
@Schema(description = "回款类型", example = "2")
|
||||
private String cgType;
|
||||
|
||||
@Schema(description = "应收id", example = "30630")
|
||||
private Integer cgId;
|
||||
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.orderysdetail.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 应收记录表明细 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class OrderYsDetailRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2612")
|
||||
@ExcelProperty("主键")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "回款金额")
|
||||
@ExcelProperty("回款金额")
|
||||
private BigDecimal cgYishou;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String rem;
|
||||
|
||||
@Schema(description = "回款日期")
|
||||
@ExcelProperty("回款日期")
|
||||
private LocalDate paymentDate;
|
||||
|
||||
@Schema(description = "回款类型", example = "2")
|
||||
@ExcelProperty("回款类型")
|
||||
private String cgType;
|
||||
|
||||
@Schema(description = "应收id", example = "30630")
|
||||
@ExcelProperty("应收id")
|
||||
private Integer cgId;
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.orderysdetail.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 应收记录表明细新增/修改 Request VO")
|
||||
@Data
|
||||
public class OrderYsDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2612")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "回款金额")
|
||||
private BigDecimal cgYishou;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String rem;
|
||||
|
||||
@Schema(description = "回款日期")
|
||||
private LocalDate paymentDate;
|
||||
|
||||
@Schema(description = "回款类型", example = "2")
|
||||
private String cgType;
|
||||
|
||||
@Schema(description = "应收id", example = "30630")
|
||||
private Integer cgId;
|
||||
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.dataobject.orderysdetail;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 应收记录表明细 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("cg_order_ys_detail")
|
||||
@KeySequence("cg_order_ys_detail_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrderYsDetailDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 回款金额
|
||||
*/
|
||||
private BigDecimal cgYishou;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String rem;
|
||||
/**
|
||||
* 回款日期
|
||||
*/
|
||||
private LocalDate paymentDate;
|
||||
/**
|
||||
* 回款类型
|
||||
*/
|
||||
private String cgType;
|
||||
/**
|
||||
* 应收id
|
||||
*/
|
||||
private Integer cgId;
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.mysql.orderysdetail;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.orderysdetail.OrderYsDetailDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.orderysdetail.vo.*;
|
||||
|
||||
/**
|
||||
* 应收记录表明细 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderYsDetailMapper extends BaseMapperX<OrderYsDetailDO> {
|
||||
|
||||
default PageResult<OrderYsDetailDO> selectPage(OrderYsDetailPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<OrderYsDetailDO>()
|
||||
.betweenIfPresent(OrderYsDetailDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(OrderYsDetailDO::getCgYishou, reqVO.getCgYishou())
|
||||
.eqIfPresent(OrderYsDetailDO::getRem, reqVO.getRem())
|
||||
.betweenIfPresent(OrderYsDetailDO::getPaymentDate, reqVO.getPaymentDate())
|
||||
.eqIfPresent(OrderYsDetailDO::getCgType, reqVO.getCgType())
|
||||
.eqIfPresent(OrderYsDetailDO::getCgId, reqVO.getCgId())
|
||||
.orderByDesc(OrderYsDetailDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -2,7 +2,13 @@ package com.chanko.yunxi.mes.module.heli.service.orderys;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.orderysdetail.vo.OrderYsDetailSaveReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderSaveReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.orderysdetail.OrderYsDetailDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.orderysdetail.OrderYsDetailMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.service.customer.CustomerService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
@ -12,6 +18,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.orderys.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.orderys.OrderYsDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
@ -36,6 +44,8 @@ public class OrderYsServiceImpl implements OrderYsService {
|
||||
private OrderYsMapper orderYsMapper;
|
||||
@Resource
|
||||
private CustomerService customerService;
|
||||
@Resource
|
||||
private OrderYsDetailMapper OrderYsDetailMapper;
|
||||
|
||||
@Override
|
||||
public Integer createOrderYs(OrderYsSaveReqVO createReqVO) {
|
||||
@ -53,6 +63,17 @@ public class OrderYsServiceImpl implements OrderYsService {
|
||||
// 更新
|
||||
OrderYsDO updateObj = BeanUtils.toBean(updateReqVO, OrderYsDO.class);
|
||||
orderYsMapper.updateById(updateObj);
|
||||
//插入子表
|
||||
createOrUpdateOrderYsDetails(updateReqVO.getOrderYsDetails());
|
||||
}
|
||||
|
||||
private void createOrUpdateOrderYsDetails(List<OrderYsDetailDO> orderYsDetails) {
|
||||
// 分组更新与插入
|
||||
List<OrderYsDetailDO> updateList = orderYsDetails.stream().filter(o -> o.getId() != null).collect(Collectors.toList());
|
||||
List<OrderYsDetailDO> insertList = orderYsDetails.stream().filter(o -> o.getId() == null).collect(Collectors.toList());
|
||||
|
||||
if(!updateList.isEmpty()) OrderYsDetailMapper.updateBatch(updateList);
|
||||
if(!insertList.isEmpty()) OrderYsDetailMapper.insertBatch(insertList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -61,6 +82,8 @@ public class OrderYsServiceImpl implements OrderYsService {
|
||||
validateOrderYsExists(id);
|
||||
// 删除
|
||||
orderYsMapper.deleteById(id);
|
||||
LambdaUpdateWrapper<OrderYsDetailDO> eq = new UpdateWrapper<OrderYsDetailDO>().lambda().eq(OrderYsDetailDO::getCgId, id);
|
||||
OrderYsDetailMapper.delete(eq);
|
||||
}
|
||||
|
||||
private void validateOrderYsExists(Integer id) {
|
||||
|
@ -0,0 +1,56 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.orderysdetail;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.orderysdetail.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.orderysdetail.OrderYsDetailDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 应收记录表明细 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface OrderYsDetailService {
|
||||
|
||||
/**
|
||||
* 创建应收记录表明细
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createOrderYsDetail(@Valid OrderYsDetailSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新应收记录表明细
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateOrderYsDetail(@Valid OrderYsDetailSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除应收记录表明细
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteOrderYsDetail(Integer id);
|
||||
|
||||
/**
|
||||
* 获得应收记录表明细
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 应收记录表明细
|
||||
*/
|
||||
OrderYsDetailDO getOrderYsDetail(Integer id);
|
||||
|
||||
List<OrderYsDetailDO> getOrderYsDetails(Integer id);
|
||||
/**
|
||||
* 获得应收记录表明细分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 应收记录表明细分页
|
||||
*/
|
||||
PageResult<OrderYsDetailDO> getOrderYsDetailPage(OrderYsDetailPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.orderysdetail;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.orderysdetail.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.orderysdetail.OrderYsDetailDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.orderysdetail.OrderYsDetailMapper;
|
||||
|
||||
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 应收记录表明细 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class OrderYsDetailServiceImpl implements OrderYsDetailService {
|
||||
|
||||
@Resource
|
||||
private OrderYsDetailMapper orderYsDetailMapper;
|
||||
|
||||
@Override
|
||||
public Integer createOrderYsDetail(OrderYsDetailSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
OrderYsDetailDO orderYsDetail = BeanUtils.toBean(createReqVO, OrderYsDetailDO.class);
|
||||
orderYsDetailMapper.insert(orderYsDetail);
|
||||
// 返回
|
||||
return orderYsDetail.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOrderYsDetail(OrderYsDetailSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateOrderYsDetailExists(updateReqVO.getId());
|
||||
// 更新
|
||||
OrderYsDetailDO updateObj = BeanUtils.toBean(updateReqVO, OrderYsDetailDO.class);
|
||||
orderYsDetailMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteOrderYsDetail(Integer id) {
|
||||
// 校验存在
|
||||
validateOrderYsDetailExists(id);
|
||||
// 删除
|
||||
orderYsDetailMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateOrderYsDetailExists(Integer id) {
|
||||
if (orderYsDetailMapper.selectById(id) == null) {
|
||||
throw exception(ORDER_YS_DETAIL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderYsDetailDO getOrderYsDetail(Integer id) {
|
||||
return orderYsDetailMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderYsDetailDO> getOrderYsDetails(Integer id) {
|
||||
LambdaQueryWrapper<OrderYsDetailDO> eq = new LambdaQueryWrapper<OrderYsDetailDO>().eq(OrderYsDetailDO::getCgId, id);
|
||||
return orderYsDetailMapper.selectList(eq);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<OrderYsDetailDO> getOrderYsDetailPage(OrderYsDetailPageReqVO pageReqVO) {
|
||||
return orderYsDetailMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<?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="com.chanko.yunxi.mes.module.heli.dal.mysql.orderysdetail.OrderYsDetailMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -38,6 +38,10 @@ public class PostRespVO {
|
||||
|
||||
@Schema(description = "备注", example = "快乐的备注")
|
||||
private String remark;
|
||||
@Schema(description = "层级", example = "层级")
|
||||
private String grade;
|
||||
@Schema(description = "岗位成本", example = "岗位成本")
|
||||
private String gradeCost;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
@ -36,5 +36,9 @@ public class PostSaveReqVO {
|
||||
|
||||
@Schema(description = "备注", example = "快乐的备注")
|
||||
private String remark;
|
||||
@Schema(description = "层级", example = "层级")
|
||||
private String grade;
|
||||
@Schema(description = "岗位成本", example = "岗位成本")
|
||||
private String gradeCost;
|
||||
|
||||
}
|
@ -46,5 +46,13 @@ public class PostDO extends BaseDO {
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 层级
|
||||
*/
|
||||
private String grade;
|
||||
/**
|
||||
* 岗位成本
|
||||
*/
|
||||
private String gradeCost;
|
||||
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ export interface OrderYsVO {
|
||||
cgYishou: number
|
||||
cgTypee: number
|
||||
rem: string
|
||||
orderYsDetails:any[];
|
||||
}
|
||||
|
||||
// 查询应收记录分页
|
||||
|
43
mes-ui/mes-ui-admin-vue3/src/api/heli/orderysdetail/index.ts
Normal file
43
mes-ui/mes-ui-admin-vue3/src/api/heli/orderysdetail/index.ts
Normal file
@ -0,0 +1,43 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface OrderYsDetailVO {
|
||||
id: number
|
||||
cgYishou: number
|
||||
rem: string
|
||||
paymentDate: localdate
|
||||
cgType: string
|
||||
cgId: number
|
||||
}
|
||||
|
||||
// 查询应收记录表明细分页
|
||||
export const getOrderYsDetailPage = async (params) => {
|
||||
return await request.get({ url: `/heli/order-ys-detail/page`, params })
|
||||
}
|
||||
|
||||
// 查询应收记录表明细详情
|
||||
export const getOrderYsDetail = async (id: number) => {
|
||||
return await request.get({ url: `/heli/order-ys-detail/get?id=` + id })
|
||||
}
|
||||
// 查询根据应收id查询应收记录表明细
|
||||
export const getOrderYsDetails = async (id: number) => {
|
||||
return await request.get({ url: `/heli/order-ys-detail/getOrderYsDetails?id=` + id })
|
||||
}
|
||||
// 新增应收记录表明细
|
||||
export const createOrderYsDetail = async (data: OrderYsDetailVO) => {
|
||||
return await request.post({ url: `/heli/order-ys-detail/create`, data })
|
||||
}
|
||||
|
||||
// 修改应收记录表明细
|
||||
export const updateOrderYsDetail = async (data: OrderYsDetailVO) => {
|
||||
return await request.put({ url: `/heli/order-ys-detail/update`, data })
|
||||
}
|
||||
|
||||
// 删除应收记录表明细
|
||||
export const deleteOrderYsDetail = async (id: number) => {
|
||||
return await request.delete({ url: `/heli/order-ys-detail/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出应收记录表明细 Excel
|
||||
export const exportOrderYsDetail = async (params) => {
|
||||
return await request.download({ url: `/heli/order-ys-detail/export-excel`, params })
|
||||
}
|
@ -277,7 +277,8 @@ export enum DICT_TYPE {
|
||||
HELI_YINGFU_MONEY = 'heli_yingfu_money',
|
||||
HELI_PLANTYPE = 'heli_planType',//生产进度报表中生产状态
|
||||
HELI_PG_PLANTYPE = 'heli_pg_planType',//生产进度报表中派工是否完成状态
|
||||
|
||||
HELI_GRADE='heli_grade',
|
||||
HELI_CGTYPE='heli_cgType'
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="1200px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
@ -7,11 +7,14 @@
|
||||
label-width="160px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="项目编号" prop="code">
|
||||
<el-input v-model="formData.code" placeholder="请输入项目编号" disabled/>
|
||||
<el-row>
|
||||
|
||||
|
||||
<el-form-item label="项目编号" prop="code" width="200px">
|
||||
<el-input v-model="formData.code" placeholder="请输入项目编号" disabled class="!w-220px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input v-model="formData.projectName" placeholder="请输入项目名称" disabled/>
|
||||
<el-input v-model="formData.projectName" placeholder="请输入项目名称" disabled class="!w-220px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="生成日期" prop="cgTime" >
|
||||
<el-date-picker
|
||||
@ -19,23 +22,28 @@
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择生成日期" disabled
|
||||
class="!w-220px"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="客户名称" prop="cgKhname" >
|
||||
<el-input v-model="formData.cgKhname" placeholder="请输入客户名称" disabled/>
|
||||
<el-input v-model="formData.cgKhname" placeholder="请输入客户名称" disabled class="!w-220px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="应收金额" prop="cgYs" >
|
||||
<el-input v-model="formData.cgYs" placeholder="请输入应收金额" disabled/>
|
||||
<el-input v-model="formData.cgYs" placeholder="请输入应收金额" disabled class="!w-220px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="已收金额" prop="cgYishou">
|
||||
<el-input v-model="formData.cgYishou" placeholder="请输入已收金额" />
|
||||
<el-input v-model="formData.cgYishou" placeholder="请输入已收金额" disabled class="!w-220px"/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="是否回款完成" prop="cgTypee" >
|
||||
<el-select
|
||||
v-model="formData.cgTypee"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
class="!w-220px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.HELI_YINGFU_MONEY)"
|
||||
@ -46,9 +54,73 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="rem">
|
||||
<el-input v-model="formData.rem" placeholder="请输入备注" />
|
||||
<el-input v-model="formData.rem" placeholder="请输入备注" class="!w-220px"/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-card class="hl-card-info">
|
||||
<template #header>
|
||||
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">回款明细信息</span>
|
||||
</template>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-card class="hl-incard">
|
||||
<el-col>
|
||||
<el-button type="primary" size="large" @click="onAddItem">新增</el-button>
|
||||
</el-col>
|
||||
<el-form ref="subFormRef" :model="formData.orderYsDetails" label-width="0">
|
||||
<el-table :data="formData.orderYsDetails" class="hl-table">
|
||||
<el-table-column type="index" label="序号" align="center" min-width="60" fixed />
|
||||
<el-table-column prop="paymentDate" min-width="150" label="回款日期" align="center">
|
||||
<template #default="scope">
|
||||
<el-form-item label="回款日期" prop="paymentDate" label-width="90">
|
||||
<el-date-picker :disabled="scope.row.id"
|
||||
v-model="scope.row.paymentDate"
|
||||
type="date"
|
||||
value-format=""
|
||||
placeholder="选择回款日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="postId" min-width="150" label="回款类型" align="center">
|
||||
<template #default="scope">
|
||||
<el-form-item label="回款类型" prop="cgType" label-width="90">
|
||||
<el-select
|
||||
v-model="scope.row.cgType" :disabled="scope.row.id"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
@change="getGradeCost">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.HELI_CGTYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="description" min-width="180" label="回款金额" align="center">
|
||||
<template #default="scope">
|
||||
<el-form-item label="回款金额" prop="cgYishou" label-width="90">
|
||||
<el-input v-model="scope.row.cgYishou" placeholder="请输入回款金额" @change="sum" :disabled="scope.row.id"/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="120" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button link type="danger" size="small" @click.prevent="onDeleteItem(scope.$index)" v-if="!scope.row.id">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
@ -57,7 +129,14 @@
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import * as OrderYsApi from '@/api/heli/orderys'
|
||||
import {DICT_TYPE, getIntDictOptions} from "@/utils/dict";
|
||||
import * as OrderYsDetailApi from '@/api/heli/orderysdetail'
|
||||
import {DICT_TYPE, getIntDictOptions, getStrDictOptions} from "@/utils/dict";
|
||||
import CompositionSelect from "@/views/heli/hlvuestyle/compositionSelect.vue";
|
||||
import EquipSelect from "@/views/heli/hlvuestyle/equipSelect.vue";
|
||||
import * as ProjectOrderApi from "@/api/heli/projectorder";
|
||||
import * as UserApi from "@/api/system/user";
|
||||
import * as FpUserDetailApi from "@/api/heli/fpuserdetail";
|
||||
import {number} from "vue-types";
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
@ -73,9 +152,11 @@ const formData = ref({
|
||||
cgTime: undefined,
|
||||
cgKhname: undefined,
|
||||
cgYs: undefined,
|
||||
cgYishou: undefined,
|
||||
cgYishou: 0,
|
||||
cgTypee: undefined,
|
||||
orderYsDetails: [],
|
||||
rem: undefined,
|
||||
|
||||
})
|
||||
const formRules = reactive({
|
||||
})
|
||||
@ -92,27 +173,59 @@ const open = async (type: string, id?: number) => {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await OrderYsApi.getOrderYs(id)
|
||||
formData.value.orderYsDetails= await OrderYsDetailApi.getOrderYsDetails(id)
|
||||
formData.value.orderYsDetails.map(o=>{
|
||||
o.cgType=Number( o.cgType)
|
||||
let date = new Date();
|
||||
date.setFullYear(o.paymentDate[0]);
|
||||
date.setMonth(o.paymentDate[1]-1);
|
||||
date.setDate(o.paymentDate[2]);
|
||||
o.paymentDate=date
|
||||
})
|
||||
console.log(formData.value.orderYsDetails)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
/** 新增子项按钮操作 */
|
||||
const onAddItem = () => {
|
||||
const row = {
|
||||
id: undefined,
|
||||
cgYishou: undefined,
|
||||
paymentDate:new Date(),
|
||||
cgType: undefined,
|
||||
cgId: undefined,
|
||||
}
|
||||
row.cgId = formData.value.id
|
||||
|
||||
formData.value.orderYsDetails.push(row)
|
||||
}
|
||||
/** 删除子项操作 */
|
||||
const onDeleteItem = async (index) => {
|
||||
formData.value.orderYsDetails.splice(index, 1)
|
||||
}
|
||||
const sum = async () => {
|
||||
formData.value.cgYishou=formData.value.orderYsDetails.reduce((sum, item) => sum + Number(item.cgYishou), 0);
|
||||
}
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
if (formData.value.cgYishou!=''&&formData.value.cgYishou!=undefined){
|
||||
if (formData.value.cgYishou<formData.value.cgYs&&formData.value.cgTypee==2){
|
||||
await message.confirm("已收金额小于应收金额,回款未完成,请确认")
|
||||
}else if (formData.value.cgYishou>=formData.value.cgYs&&formData.value.cgTypee==1){
|
||||
await message.confirm("已收金额大于等于应收金额,回款已完成,请确认")
|
||||
}
|
||||
}
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as OrderYsApi.OrderYsVO
|
||||
console.log(data)
|
||||
if (formType.value === 'create') {
|
||||
await OrderYsApi.createOrderYs(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
@ -127,7 +240,6 @@ const submitForm = async () => {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
|
@ -7,11 +7,29 @@
|
||||
:rules="formRules"
|
||||
label-width="108px"
|
||||
>
|
||||
<el-form-item label="岗位编码" prop="code" >
|
||||
<el-input v-model="formData.code" placeholder="请输入岗位编码" class="!w-250px" :disabled="flag"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入岗位名称" class="!w-250px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位编码" prop="code">
|
||||
<el-input v-model="formData.code" placeholder="请输入岗位编码" class="!w-250px" />
|
||||
<el-form-item label="岗位层级" prop="grade">
|
||||
<el-select
|
||||
v-model="formData.grade"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
@change="getGradeCost">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.HELI_GRADE)"
|
||||
:key="dict.label"
|
||||
:label="dict.label"
|
||||
:value="dict.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位成本" prop="gradeCost">
|
||||
<el-input-number v-model="formData.gradeCost" :min="0" controls-position="right" class="!w-250px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位顺序" prop="sort">
|
||||
<el-input-number v-model="formData.sort" :min="0" controls-position="right" class="!w-250px" />
|
||||
@ -48,6 +66,7 @@ const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const flag = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
@ -57,7 +76,9 @@ const formData = ref({
|
||||
code: '',
|
||||
sort: 0,
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
remark: ''
|
||||
remark: '',
|
||||
gradeCost:'',
|
||||
grade:'',
|
||||
})
|
||||
const formRules = reactive({
|
||||
name: [{ required: true, message: '岗位名称不能为空', trigger: 'blur' }],
|
||||
@ -73,6 +94,9 @@ const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
if (formType.value!='create'){
|
||||
flag.value=true
|
||||
}
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
@ -88,6 +112,19 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const getGradeCost = async (val) => {
|
||||
if (val==''){
|
||||
formData.value.gradeCost=''
|
||||
}else {
|
||||
var intDictOptions = getIntDictOptions(DICT_TYPE.HELI_GRADE);
|
||||
intDictOptions.filter(item=>{
|
||||
if (item.label==val){
|
||||
formData.value.gradeCost=item.value
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
if (!formRef) return
|
||||
|
@ -66,9 +66,11 @@
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true" class="hl-table">
|
||||
<el-table-column type="index" width="100" label="序号" align="center" />
|
||||
<el-table-column label="岗位名称" align="center" prop="name" />
|
||||
<el-table-column label="岗位编码" align="center" prop="code" />
|
||||
<el-table-column label="岗位顺序" align="center" prop="sort" />
|
||||
<el-table-column label="岗位名称" align="center" prop="name" />
|
||||
<el-table-column label="岗位层级" align="center" prop="grade" />
|
||||
<el-table-column label="岗位成本" align="center" prop="gradeCost" />
|
||||
<!-- <el-table-column label="岗位顺序" align="center" prop="sort" />-->
|
||||
<el-table-column label="岗位备注" align="center" prop="remark" />
|
||||
<el-table-column label="启用状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
|
Loading…
Reference in New Issue
Block a user