设计完工产值
This commit is contained in:
@ -140,13 +140,29 @@ public class BusMrpBaseController extends BaseController {
|
||||
return toAjax(busMrpBaseService.importData(dto));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取到物资状态为已完成的版本
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseDoc:obtainTheVersion")
|
||||
@GetMapping("/obtainTheVersion")
|
||||
public R<List<BusBillofquantitiesVersions>> obtainTheVersion(Long projectId) {
|
||||
List<BusBillofquantitiesVersions> list = busBillofquantitiesVersionsService.list(Wrappers.<BusBillofquantitiesVersions>lambdaQuery()
|
||||
.eq(BusBillofquantitiesVersions::getProjectId, projectId)
|
||||
.eq(BusBillofquantitiesVersions::getStatus, BusinessStatusEnum.FINISH.getStatus())
|
||||
);
|
||||
if (!list.isEmpty()){
|
||||
throw new ServiceException("请先完成物资工程量清单");
|
||||
}
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工程量清单列表
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseDoc:add")
|
||||
@GetMapping("/engineeringList")
|
||||
public R<List<BusBillofquantities>> obtainTheList(Long projectId) {
|
||||
|
||||
BusBillofquantitiesVersions one = busBillofquantitiesVersionsService.getOne(Wrappers.<BusBillofquantitiesVersions>lambdaQuery()
|
||||
.eq(BusBillofquantitiesVersions::getWorkOrderType, "3") //物资工程量清单
|
||||
.eq(BusBillofquantitiesVersions::getProjectId, projectId)
|
||||
@ -159,7 +175,6 @@ public class BusMrpBaseController extends BaseController {
|
||||
List<BusBillofquantities> list = busBillofquantitiesService.list(Wrappers.<BusBillofquantities>lambdaQuery()
|
||||
.eq(BusBillofquantities::getVersions, one.getVersions())
|
||||
);
|
||||
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,105 @@
|
||||
package org.dromara.out.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.out.domain.vo.BusProcurementVo;
|
||||
import org.dromara.out.domain.bo.BusProcurementBo;
|
||||
import org.dromara.out.service.IBusProcurementService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 产值-采购完成产值
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-23
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/out/procurement")
|
||||
public class BusProcurementController extends BaseController {
|
||||
|
||||
private final IBusProcurementService busProcurementService;
|
||||
|
||||
/**
|
||||
* 查询产值-采购完成产值列表
|
||||
*/
|
||||
@SaCheckPermission("out:procurement:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusProcurementVo> list(BusProcurementBo bo, PageQuery pageQuery) {
|
||||
return busProcurementService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出产值-采购完成产值列表
|
||||
*/
|
||||
@SaCheckPermission("out:procurement:export")
|
||||
@Log(title = "产值-采购完成产值", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BusProcurementBo bo, HttpServletResponse response) {
|
||||
List<BusProcurementVo> list = busProcurementService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "产值-采购完成产值", BusProcurementVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取产值-采购完成产值详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("out:procurement:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusProcurementVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busProcurementService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产值-采购完成产值
|
||||
*/
|
||||
@SaCheckPermission("out:procurement:add")
|
||||
@Log(title = "产值-采购完成产值", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusProcurementBo bo) {
|
||||
return toAjax(busProcurementService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产值-采购完成产值
|
||||
*/
|
||||
@SaCheckPermission("out:procurement:edit")
|
||||
@Log(title = "产值-采购完成产值", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusProcurementBo bo) {
|
||||
return toAjax(busProcurementService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产值-采购完成产值
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("out:procurement:remove")
|
||||
@Log(title = "产值-采购完成产值", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busProcurementService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@ -6,6 +6,10 @@ import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.out.domain.BusProcurement;
|
||||
import org.dromara.out.domain.bo.PurchaseValueAReq;
|
||||
import org.dromara.out.domain.bo.PurchaseValueAupReq;
|
||||
import org.dromara.out.domain.vo.PurchaseValueARes;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
@ -134,4 +138,29 @@ public class OutMonthPlanController extends BaseController {
|
||||
@NotNull(message = "计划月份不能为空") String planMonth) {
|
||||
return R.ok(outMonthPlanService.infoByPlanMonth(projectId,planMonth));
|
||||
}
|
||||
|
||||
|
||||
//================================采购完工产值================================
|
||||
|
||||
/**
|
||||
* 采购完工产值对甲
|
||||
*/
|
||||
@SaCheckPermission("out:monthPlan:purchaseValueA")
|
||||
@Log(title = "采购完工产值对甲乙", businessType = BusinessType.UPDATE)
|
||||
@GetMapping("/purchaseValueA")
|
||||
public R<List<BusProcurement>> purchaseValueA(PurchaseValueAReq req) {
|
||||
return R.ok(outMonthPlanService.purchaseValueA(req));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改采购完工产值对甲
|
||||
*/
|
||||
@SaCheckPermission("out:monthPlan:purchaseValueAup")
|
||||
@Log(title = "修改采购完工产值对甲", businessType = BusinessType.UPDATE)
|
||||
@GetMapping("/purchaseValueAup")
|
||||
public R<Boolean> purchaseValueAup(PurchaseValueAupReq req) {
|
||||
return R.ok(outMonthPlanService.purchaseValueAup(req));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,67 @@
|
||||
package org.dromara.out.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 产值-采购完成产值对象 bus_procurement
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_procurement")
|
||||
public class BusProcurement extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 接收数量
|
||||
*/
|
||||
private BigDecimal acceptedQuantity;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -38,11 +38,6 @@ public class OutMonthPlanAudit extends BaseEntity {
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 计划产值
|
||||
*/
|
||||
private BigDecimal planValue;
|
||||
|
||||
/**
|
||||
* 设计产值
|
||||
*/
|
||||
|
@ -0,0 +1,60 @@
|
||||
package org.dromara.out.domain.bo;
|
||||
|
||||
import org.dromara.out.domain.BusProcurement;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 产值-采购完成产值业务对象 bus_procurement
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusProcurement.class, reverseConvertGenerate = false)
|
||||
public class BusProcurementBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 接收数量
|
||||
*/
|
||||
private Long acceptedQuantity;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private Long unitPrice;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -39,11 +39,6 @@ public class OutMonthPlanAuditBo extends BaseEntity {
|
||||
@NotBlank(message = "类型不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 计划产值
|
||||
*/
|
||||
@NotNull(message = "计划产值不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private BigDecimal planValue;
|
||||
|
||||
/**
|
||||
* 设计产值
|
||||
|
@ -0,0 +1,29 @@
|
||||
package org.dromara.out.domain.bo;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author 铁憨憨
|
||||
* @Date 2025/8/22 23:13
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class PurchaseValueAReq implements Serializable {
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@NotNull
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 类型 1:采购完工产值对甲 2:采购完工产值对乙
|
||||
*/
|
||||
@NotNull
|
||||
private Integer type;
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package org.dromara.out.domain.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Author 铁憨憨
|
||||
* @Date 2025/8/23 2:31
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class PurchaseValueAupReq implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 修改金额
|
||||
*/
|
||||
private BigDecimal unitPrice;
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package org.dromara.out.domain.vo;
|
||||
|
||||
import org.dromara.out.domain.BusProcurement;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 产值-采购完成产值视图对象 bus_procurement
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-23
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusProcurement.class)
|
||||
public class BusProcurementVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ExcelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@ExcelProperty(value = "规格")
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@ExcelProperty(value = "单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 接收数量
|
||||
*/
|
||||
@ExcelProperty(value = "接收数量")
|
||||
private Long acceptedQuantity;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
@ExcelProperty(value = "价格")
|
||||
private Long unitPrice;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package org.dromara.out.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author 铁憨憨
|
||||
* @Date 2025/8/22 23:22
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class PurchaseValueARes implements Serializable {
|
||||
/**
|
||||
* 类型 1对甲 2对乙
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String num;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Integer quantity;
|
||||
|
||||
/**
|
||||
* 验收
|
||||
*/
|
||||
private Integer acceptanceReceive;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.out.mapper;
|
||||
|
||||
import org.dromara.out.domain.BusProcurement;
|
||||
import org.dromara.out.domain.vo.BusProcurementVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 产值-采购完成产值Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-23
|
||||
*/
|
||||
public interface BusProcurementMapper extends BaseMapperPlus<BusProcurement, BusProcurementVo> {
|
||||
|
||||
}
|
@ -2,11 +2,13 @@ package org.dromara.out.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.dromara.out.domain.BusProcurement;
|
||||
import org.dromara.out.domain.OutMonthPlan;
|
||||
import org.dromara.out.domain.vo.OutMonthPlanVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 月度产值计划Mapper接口
|
||||
@ -25,4 +27,8 @@ public interface OutMonthPlanMapper extends BaseMapperPlus<OutMonthPlan, OutMont
|
||||
"</script>"
|
||||
})
|
||||
BigDecimal getDesignValueByProjectId(@Param("projectId") Long projectId,@Param("planMonth") String planMonth);
|
||||
|
||||
List<BusProcurement> purchaseValueAA(@Param("projectId") Long projectId);
|
||||
|
||||
List<BusProcurement> purchaseValueBB(@Param("projectId") Long projectId);
|
||||
}
|
||||
|
@ -0,0 +1,70 @@
|
||||
package org.dromara.out.service;
|
||||
|
||||
import org.dromara.out.domain.vo.BusProcurementVo;
|
||||
import org.dromara.out.domain.bo.BusProcurementBo;
|
||||
import org.dromara.out.domain.BusProcurement;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 产值-采购完成产值Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-23
|
||||
*/
|
||||
public interface IBusProcurementService extends IService<BusProcurement>{
|
||||
|
||||
/**
|
||||
* 查询产值-采购完成产值
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 产值-采购完成产值
|
||||
*/
|
||||
BusProcurementVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询产值-采购完成产值列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 产值-采购完成产值分页列表
|
||||
*/
|
||||
TableDataInfo<BusProcurementVo> queryPageList(BusProcurementBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的产值-采购完成产值列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 产值-采购完成产值列表
|
||||
*/
|
||||
List<BusProcurementVo> queryList(BusProcurementBo bo);
|
||||
|
||||
/**
|
||||
* 新增产值-采购完成产值
|
||||
*
|
||||
* @param bo 产值-采购完成产值
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusProcurementBo bo);
|
||||
|
||||
/**
|
||||
* 修改产值-采购完成产值
|
||||
*
|
||||
* @param bo 产值-采购完成产值
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusProcurementBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除产值-采购完成产值信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -1,6 +1,9 @@
|
||||
package org.dromara.out.service;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.dromara.out.domain.BusProcurement;
|
||||
import org.dromara.out.domain.bo.PurchaseValueAReq;
|
||||
import org.dromara.out.domain.bo.PurchaseValueAupReq;
|
||||
import org.dromara.out.domain.vo.OutMonthPlanVo;
|
||||
import org.dromara.out.domain.bo.OutMonthPlanBo;
|
||||
import org.dromara.out.domain.OutMonthPlan;
|
||||
@ -8,6 +11,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.out.domain.vo.PurchaseValueARes;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -96,4 +100,14 @@ public interface IOutMonthPlanService extends IService<OutMonthPlan>{
|
||||
*/
|
||||
List<OutMonthPlanVo> infoByPlanMonth(Long projectId, String planMonth);
|
||||
|
||||
/**
|
||||
* 采购完工产值对甲
|
||||
*/
|
||||
List<BusProcurement> purchaseValueA(PurchaseValueAReq req);
|
||||
|
||||
/**
|
||||
* 修改采购完工产值对甲
|
||||
*/
|
||||
Boolean purchaseValueAup(PurchaseValueAupReq req);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,135 @@
|
||||
package org.dromara.out.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.out.domain.bo.BusProcurementBo;
|
||||
import org.dromara.out.domain.vo.BusProcurementVo;
|
||||
import org.dromara.out.domain.BusProcurement;
|
||||
import org.dromara.out.mapper.BusProcurementMapper;
|
||||
import org.dromara.out.service.IBusProcurementService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 产值-采购完成产值Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-23
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusProcurementServiceImpl extends ServiceImpl<BusProcurementMapper, BusProcurement> implements IBusProcurementService {
|
||||
|
||||
private final BusProcurementMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询产值-采购完成产值
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 产值-采购完成产值
|
||||
*/
|
||||
@Override
|
||||
public BusProcurementVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询产值-采购完成产值列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 产值-采购完成产值分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusProcurementVo> queryPageList(BusProcurementBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusProcurement> lqw = buildQueryWrapper(bo);
|
||||
Page<BusProcurementVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的产值-采购完成产值列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 产值-采购完成产值列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusProcurementVo> queryList(BusProcurementBo bo) {
|
||||
LambdaQueryWrapper<BusProcurement> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusProcurement> buildQueryWrapper(BusProcurementBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusProcurement> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusProcurement::getId);
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), BusProcurement::getName, bo.getName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSpecification()), BusProcurement::getSpecification, bo.getSpecification());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUnit()), BusProcurement::getUnit, bo.getUnit());
|
||||
lqw.eq(bo.getAcceptedQuantity() != null, BusProcurement::getAcceptedQuantity, bo.getAcceptedQuantity());
|
||||
lqw.eq(bo.getUnitPrice() != null, BusProcurement::getUnitPrice, bo.getUnitPrice());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产值-采购完成产值
|
||||
*
|
||||
* @param bo 产值-采购完成产值
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusProcurementBo bo) {
|
||||
BusProcurement add = MapstructUtils.convert(bo, BusProcurement.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产值-采购完成产值
|
||||
*
|
||||
* @param bo 产值-采购完成产值
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusProcurementBo bo) {
|
||||
BusProcurement update = MapstructUtils.convert(bo, BusProcurement.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusProcurement entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除产值-采购完成产值信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -19,8 +19,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.out.domain.BusProcurement;
|
||||
import org.dromara.out.domain.OutConstructionValue;
|
||||
import org.dromara.out.domain.OutMonthPlanAudit;
|
||||
import org.dromara.out.domain.bo.PurchaseValueAReq;
|
||||
import org.dromara.out.domain.bo.PurchaseValueAupReq;
|
||||
import org.dromara.out.domain.vo.PurchaseValueARes;
|
||||
import org.dromara.out.service.IBusProcurementService;
|
||||
import org.dromara.out.service.IOutConstructionValueService;
|
||||
import org.dromara.out.service.IOutMonthPlanAuditService;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -55,6 +60,8 @@ public class OutMonthPlanServiceImpl extends ServiceImpl<OutMonthPlanMapper, Out
|
||||
|
||||
private final IOutConstructionValueService constructionValueService;
|
||||
|
||||
private final IBusProcurementService busProcurementService;
|
||||
|
||||
|
||||
private final IBusMaterialsorderService busMaterialsorderService;
|
||||
/**
|
||||
@ -232,6 +239,46 @@ public class OutMonthPlanServiceImpl extends ServiceImpl<OutMonthPlanMapper, Out
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BusProcurement> purchaseValueA(PurchaseValueAReq req) {
|
||||
//1、为1查询出数据,存储到数据表,并返回数据
|
||||
if ("1".equals(req.getType())){
|
||||
List<BusProcurement> busProcurements = baseMapper.purchaseValueAA(req.getProjectId());
|
||||
//查询出现有的数据busProcurements1,如果busProcurements的数据已经在busProcurements1中(根据名称和规格)就修改,否则保存
|
||||
List<BusProcurement> busProcurements1 = busProcurementService.list(Wrappers.<BusProcurement>lambdaQuery()
|
||||
.eq(BusProcurement::getProjectId, req.getProjectId())
|
||||
);
|
||||
for (BusProcurement busProcurement : busProcurements) {
|
||||
for (BusProcurement procurement : busProcurements1) {
|
||||
if (busProcurement.getName().equals(procurement.getName()) && busProcurement.getSpecification().equals(procurement.getSpecification())){
|
||||
busProcurement.setId(procurement.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存
|
||||
boolean b = busProcurementService.saveOrUpdateBatch(busProcurements);
|
||||
if (!b) {
|
||||
throw new ServiceException("保存失败");
|
||||
}
|
||||
return busProcurementService.list(Wrappers.<BusProcurement>lambdaQuery()
|
||||
.eq(BusProcurement::getProjectId, req.getProjectId())
|
||||
);
|
||||
}
|
||||
//2、为2查询出数据,直接返回
|
||||
else if ("2".equals(req.getType())){
|
||||
return baseMapper.purchaseValueBB(req.getProjectId());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean purchaseValueAup(PurchaseValueAupReq req) {
|
||||
BusProcurement busProcurement = new BusProcurement();
|
||||
busProcurement.setId(req.getId());
|
||||
busProcurement.setUnitPrice(req.getUnitPrice());
|
||||
return busProcurementService.updateById(busProcurement);
|
||||
}
|
||||
|
||||
/**
|
||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||
* 正常使用只需#processEvent.flowCode=='leave1'
|
||||
|
@ -0,0 +1,7 @@
|
||||
<?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.dromara.out.mapper.BusProcurementMapper">
|
||||
|
||||
</mapper>
|
@ -4,4 +4,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.out.mapper.OutMonthPlanMapper">
|
||||
|
||||
|
||||
<select id="purchaseValueAA" resultType="org.dromara.out.domain.BusProcurement">
|
||||
SELECT
|
||||
b.name,
|
||||
b.specification,
|
||||
b.unit,
|
||||
(SELECT SUM(accepted_quantity) FROM mat_material_receive_item WHERE project_id = #{projectId} and name = b.name and specification = b.specification) as acceptedQuantity,
|
||||
a.unit_price,
|
||||
DATE_FORMAT(b.create_time,'%Y-%m') as yf
|
||||
FROM
|
||||
bus_bidding_limit_list as a
|
||||
RIGHT JOIN mat_material_receive_item as b on b.`name` = a.`name` and b.specification = a.specification
|
||||
WHERE
|
||||
b.project_id = #{projectId}
|
||||
GROUP BY yf,b.name,b.specification
|
||||
</select>
|
||||
|
||||
<select id="purchaseValueBB" resultType="org.dromara.out.domain.BusProcurement">
|
||||
SELECT
|
||||
b.name,
|
||||
b.specification,
|
||||
b.unit,
|
||||
(SELECT SUM(accepted_quantity) FROM mat_material_receive_item WHERE project_id = #{projectId} and name = b.name and specification = b.specification) as acceptedQuantity,
|
||||
(SELECT unit_price FROM bus_billofquantities_limit_list WHERE project_id = #{projectId} and type = 3 and name = b.name and specification = b.specification GROUP BY name,specification) as unitPrice,
|
||||
DATE_FORMAT(b.create_time,'%Y-%m') as yf
|
||||
FROM
|
||||
mat_material_receive_item AS b
|
||||
WHERE
|
||||
b.project_id = #{projectId}
|
||||
GROUP BY yf,b.name,b.specification
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
Reference in New Issue
Block a user