Merge branch 'dev' of http://git.znkjfw.com/ak/zn-cloud into frx

This commit is contained in:
furongxin 2024-09-25 18:47:06 +08:00
commit 6cc33737b9
13 changed files with 55 additions and 7 deletions

View File

@ -78,6 +78,14 @@ public class BpmOASupplierProcurementPlanController {
return success(BeanUtils.toBean(pageResult, BpmOASupplierProcurementPlanRespVO.class));
}
@GetMapping("/getPlanItem")
@Operation(summary = "获得供应商采购计划商品列表")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
public CommonResult<List<BpmOASupplierProcurementPlanItemRespVO>> getPlanItem(@RequestParam("id") Long id) {
List<BpmOASupplierProcurementPlanItemDO> items = oaSupplierProcurementPlanItemService.getByProcurementPlanId(id);
List<BpmOASupplierProcurementPlanItemRespVO> itemVos = BeanUtils.toBean(items, BpmOASupplierProcurementPlanItemRespVO.class);
return success(itemVos);
}
@GetMapping("/getListBySupplierId")
@Operation(summary = "根据供应商id获取采购计划列表")

View File

@ -48,6 +48,9 @@ public class BpmOASupplierProcurementPlanPageReqVO extends PageParam {
@Schema(description = "是否上传凭证 0否 1是")
private Integer certificateFlag;
@Schema(description = "是否已分配到资产中 0否 1是", example = "5984")
private Integer assignedFlag;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;

View File

@ -17,6 +17,9 @@ public class BpmOASupplierProcurementPlanReqVO {
@Schema(description = "供应商id", example = "123")
private Long supplierId;
@Schema(description = "是否已分配到资产中 0否 1是", example = "5984")
private Integer assignedFlag;
@Schema(description = "流程实例的编号", example = "5984")
private String processInstanceId;

View File

@ -41,6 +41,9 @@ public class BpmOASupplierProcurementPlanRespVO {
@Schema(description = "备注")
private String remark;
@Schema(description = "是否已分配到资产中 0否 1是", example = "5984")
private Integer assignedFlag;
@Schema(description = "流程实例的编号", example = "5984")
private String processInstanceId;

View File

@ -42,6 +42,9 @@ public class BpmOASupplierProcurementPlanSaveReqVO {
@Schema(description = "备注")
private String remark;
@Schema(description = "是否已分配到资产中 0否 1是", example = "5984")
private Integer assignedFlag;
@Schema(description = "流程实例的编号", example = "5984")
private String processInstanceId;

View File

@ -18,7 +18,6 @@ public class BpmOASupplierPurchasePaymentSaveReqVO {
private Long id;
@Schema(description = "申请人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "14357")
@NotNull(message = "申请人的用户编号不能为空")
private Long userId;
@Schema(description = "供应商id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13580")

View File

@ -70,6 +70,10 @@ public class BpmOASupplierProcurementPlanDO extends BaseDO {
* 备注
*/
private String remark;
/**
* 是否已分配到资产中 0否 1是
*/
private Integer assignedFlag;
/**
* 流程实例的编号
*/

View File

@ -165,10 +165,11 @@ public class BpmOASupplierProcurementPlanServiceImpl extends BpmOABaseService im
public void uploadDeliveryReceipt(TheArrivalFileItemsVO vo) {
BpmOASupplierProcurementPlanDO supplierProcurementPlanDO = oaSupplierProcurementPlanMapper.selectById(vo.getId());
//判断是否需要更新到资产
Boolean updateAssetFlag = false;
if (CollectionUtil.isEmpty(supplierProcurementPlanDO.getTheArrivalFileItems())) {
boolean updateAssetFlag = false;
if (supplierProcurementPlanDO.getAssignedFlag() == 0) {
updateAssetFlag = true;
}
supplierProcurementPlanDO.setAssignedFlag(1);
supplierProcurementPlanDO.setTheArrivalFileItems(vo.getTheArrivalFileItems());
oaSupplierProcurementPlanMapper.updateById(supplierProcurementPlanDO);
// ----- 如果需要更新到资产 -

View File

@ -22,6 +22,7 @@ import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService;
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
import cn.iocoder.yudao.module.system.api.supplier.SupplierApi;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -66,7 +67,8 @@ public class BpmOASupplierPurchasePaymentServiceImpl extends BpmOABaseService im
private BpmOASupplierProcurementPlanMapper supplierProcurementPlanMapper;
@Resource
private BpmOASupplierProcurementPlanItemMapper supplierProcurementPlanItemMapper;
@Resource
private SupplierApi supplierApi;
/**
* 供应商采购支付
@ -76,9 +78,9 @@ public class BpmOASupplierPurchasePaymentServiceImpl extends BpmOABaseService im
@Override
public Long createOASupplierPurchasePayment(BpmOASupplierPurchasePaymentSaveReqVO createReqVO) {
// 插入
Long userId = WebFrameworkUtils.getLoginUserId();
BpmOASupplierPurchasePaymentDO supplierPurchasePaymentDO = BeanUtils.toBean(createReqVO, BpmOASupplierPurchasePaymentDO.class);
supplierPurchasePaymentMapper.insert(supplierPurchasePaymentDO);
Long userId = WebFrameworkUtils.getLoginUserId();
// 发起 BPM 流程
Map<String, Object> processInstanceVariables = new HashMap<>();
@ -118,7 +120,10 @@ public class BpmOASupplierPurchasePaymentServiceImpl extends BpmOABaseService im
@Override
public BpmOASupplierPurchasePaymentDO getOASupplierPurchasePayment(Long id) {
BpmOASupplierPurchasePaymentDO supplierPurchasePaymentDO = supplierPurchasePaymentMapper.getById(id);
BpmOASupplierPurchasePaymentDO supplierPurchasePaymentDO = supplierPurchasePaymentMapper.selectById(id);
// 根据supplierId 供应商id查询供应商
CommonResult<String> result = supplierApi.getNameById(supplierPurchasePaymentDO.getSupplierId());
supplierPurchasePaymentDO.setSupplierName(result.getData());
List<Long> supplierProcurementPlanIds = Arrays.stream(supplierPurchasePaymentDO.getSupplierProcurementPlanIds().split(",")).map(Long::valueOf).collect(Collectors.toList());
List<BpmOASupplierProcurementPlanDO> planDOS = supplierProcurementPlanMapper.selectList(new LambdaQueryWrapper<BpmOASupplierProcurementPlanDO>().in(BpmOASupplierProcurementPlanDO::getId, supplierProcurementPlanIds));
List<BpmOASupplierProcurementPlanItemDO> planItemDOS = supplierProcurementPlanItemMapper.selectList(new LambdaQueryWrapper<BpmOASupplierProcurementPlanItemDO>().in(BpmOASupplierProcurementPlanItemDO::getProcurementPlanId, supplierProcurementPlanIds));

View File

@ -1,14 +1,16 @@
package cn.iocoder.yudao.module.system.api.supplier;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.api.subscribe.dto.SubscribeMessageReqDTO;
import cn.iocoder.yudao.module.system.api.supplier.dto.SupplierRpcDTO;
import cn.iocoder.yudao.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@Tag(name = "RPC 服务 - 供应商新增编辑")
@ -20,4 +22,9 @@ public interface SupplierApi {
@Operation(summary = "新增编辑供应商")
CommonResult saveOrEdit(@RequestBody SupplierRpcDTO supplier);
@GetMapping(PREFIX + "/getNameById")
@Operation(summary = "获取供应商名称")
@Parameter(name = "id", description = "供应商id", example = "1", required = true)
CommonResult<String> getNameById(@RequestParam("id") Long id);
}

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.api.supplier;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.api.supplier.dto.SupplierRpcDTO;
import cn.iocoder.yudao.module.system.dal.dataobject.supplier.SupplierDO;
import cn.iocoder.yudao.module.system.service.supplier.SupplierService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;
@ -23,4 +24,10 @@ public class SupplierApiImpl implements SupplierApi {
supplierService.saveOrEdit(supplier);
return success(true);
}
@Override
public CommonResult<String> getNameById(Long id) {
SupplierDO supplier = supplierService.getSupplier(id);
return success(supplier == null ? "其他" : supplier.getSupplierName());
}
}

View File

@ -14,4 +14,6 @@ public class UserPageDTO extends PageParam {
private String name;
@Schema(description = "状态0正常 1停用不传则全部", example = "1")
private Integer status;
@Schema(description = "部门id", example = "1")
private Long deptId;
}

View File

@ -73,6 +73,9 @@
#{groupId}
</foreach>
</if>
<if test="dto.deptId != null">
and a.dept_id = #{dto.deptId}
</if>
<if test="dto.name != null and dto.name != ''">
and a.nickname like concat('%', #{dto.name}, '%')
</if>