1.工厂人员考勤机打卡记录管理
2.连调供应商OA管理 3.连调供应商商品OA管理 4.资产管理新增业务类型 1行政类型 2生产类型 消耗类型 1固定资产 2消耗品 5.调整获取用户列表接口区分工厂/行政人员 6.供应商采购计划管理 7.供应商采购付款管理
This commit is contained in:
parent
1708943c9d
commit
caac59ea07
@ -0,0 +1,83 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan.BpmOASupplierProcurementPlanItemRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan.BpmOASupplierProcurementPlanPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan.BpmOASupplierProcurementPlanRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan.BpmOASupplierProcurementPlanSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierProcurementPlanDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierProcurementPlanItemDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASupplierProcurementPlanItemService;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASupplierProcurementPlanService;
|
||||||
|
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.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 供应商采购计划")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bpm/oa-supplier-procurement-plan")
|
||||||
|
@Validated
|
||||||
|
public class BpmOASupplierProcurementPlanController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOASupplierProcurementPlanService oaSupplierProcurementPlanService;
|
||||||
|
@Resource
|
||||||
|
private BpmOASupplierProcurementPlanItemService oaSupplierProcurementPlanItemService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建供应商采购计划")
|
||||||
|
@PreAuthorize("@ss.hasPermission('bpm:oa-supplier-procurement-plan:create')")
|
||||||
|
public CommonResult<Long> createOaSupplierProcurementPlan(@Valid @RequestBody BpmOASupplierProcurementPlanSaveReqVO createReqVO) {
|
||||||
|
return success(oaSupplierProcurementPlanService.createOaSupplierProcurementPlan(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新供应商采购计划")
|
||||||
|
@PreAuthorize("@ss.hasPermission('bpm:oa-supplier-procurement-plan:update')")
|
||||||
|
public CommonResult<Boolean> updateOaSupplierProcurementPlan(@Valid @RequestBody BpmOASupplierProcurementPlanSaveReqVO updateReqVO) {
|
||||||
|
oaSupplierProcurementPlanService.updateOaSupplierProcurementPlan(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除供应商采购计划")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('bpm:oa-supplier-procurement-plan:delete')")
|
||||||
|
public CommonResult<Boolean> deleteOaSupplierProcurementPlan(@RequestParam("id") Long id) {
|
||||||
|
oaSupplierProcurementPlanService.deleteOaSupplierProcurementPlan(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得供应商采购计划")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('bpm:oa-supplier-procurement-plan:query')")
|
||||||
|
public CommonResult<BpmOASupplierProcurementPlanRespVO> getOaSupplierProcurementPlan(@RequestParam("id") Long id) {
|
||||||
|
BpmOASupplierProcurementPlanDO oaSupplierProcurementPlan = oaSupplierProcurementPlanService.getOaSupplierProcurementPlan(id);
|
||||||
|
BpmOASupplierProcurementPlanRespVO vo = BeanUtils.toBean(oaSupplierProcurementPlan, BpmOASupplierProcurementPlanRespVO.class);
|
||||||
|
List<BpmOASupplierProcurementPlanItemDO> items = oaSupplierProcurementPlanItemService.getByProcurementPlanId(id);
|
||||||
|
List<BpmOASupplierProcurementPlanItemRespVO> itemVos = BeanUtils.toBean(items, BpmOASupplierProcurementPlanItemRespVO.class);
|
||||||
|
vo.setItems(itemVos);
|
||||||
|
return success(BeanUtils.toBean(oaSupplierProcurementPlan, BpmOASupplierProcurementPlanRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得供应商采购计划分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('bpm:oa-supplier-procurement-plan:query')")
|
||||||
|
public CommonResult<PageResult<BpmOASupplierProcurementPlanRespVO>> getOaSupplierProcurementPlanPage(@Valid BpmOASupplierProcurementPlanPageReqVO pageReqVO) {
|
||||||
|
PageResult<BpmOASupplierProcurementPlanDO> pageResult = oaSupplierProcurementPlanService.getOaSupplierProcurementPlanPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, BpmOASupplierProcurementPlanRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,73 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierpurchasepayment.BpmOASupplierPurchasePaymentPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierpurchasepayment.BpmOASupplierPurchasePaymentRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierpurchasepayment.BpmOASupplierPurchasePaymentSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierPurchasePaymentDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASupplierPurchasePaymentService;
|
||||||
|
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.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 供应商采购付款")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bpm/OA-supplier-purchase-payment")
|
||||||
|
@Validated
|
||||||
|
public class BpmOASupplierPurchasePaymentController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOASupplierPurchasePaymentService oASupplierPurchasePaymentServiceBpm;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建供应商采购付款")
|
||||||
|
@PreAuthorize("@ss.hasPermission('bpm:OA-supplier-purchase-payment:create')")
|
||||||
|
public CommonResult<Long> createOASupplierPurchasePayment(@Valid @RequestBody BpmOASupplierPurchasePaymentSaveReqVO createReqVO) {
|
||||||
|
return success(oASupplierPurchasePaymentServiceBpm.createOASupplierPurchasePayment(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新供应商采购付款")
|
||||||
|
@PreAuthorize("@ss.hasPermission('bpm:OA-supplier-purchase-payment:update')")
|
||||||
|
public CommonResult<Boolean> updateOASupplierPurchasePayment(@Valid @RequestBody BpmOASupplierPurchasePaymentSaveReqVO updateReqVO) {
|
||||||
|
oASupplierPurchasePaymentServiceBpm.updateOASupplierPurchasePayment(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除供应商采购付款")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('bpm:OA-supplier-purchase-payment:delete')")
|
||||||
|
public CommonResult<Boolean> deleteOASupplierPurchasePayment(@RequestParam("id") Long id) {
|
||||||
|
oASupplierPurchasePaymentServiceBpm.deleteOASupplierPurchasePayment(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得供应商采购付款")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('bpm:OA-supplier-purchase-payment:query')")
|
||||||
|
public CommonResult<BpmOASupplierPurchasePaymentRespVO> getOASupplierPurchasePayment(@RequestParam("id") Long id) {
|
||||||
|
BpmOASupplierPurchasePaymentDO oASupplierPurchasePayment = oASupplierPurchasePaymentServiceBpm.getOASupplierPurchasePayment(id);
|
||||||
|
return success(BeanUtils.toBean(oASupplierPurchasePayment, BpmOASupplierPurchasePaymentRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得供应商采购付款分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('bpm:OA-supplier-purchase-payment:query')")
|
||||||
|
public CommonResult<PageResult<BpmOASupplierPurchasePaymentRespVO>> getOASupplierPurchasePaymentPage(@Valid BpmOASupplierPurchasePaymentPageReqVO pageReqVO) {
|
||||||
|
PageResult<BpmOASupplierPurchasePaymentDO> pageResult = oASupplierPurchasePaymentServiceBpm.getOASupplierPurchasePaymentPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, BpmOASupplierPurchasePaymentRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.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 BpmOASupplierProcurementPlanItemPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "申请人的用户编号", example = "29804")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "供应商采购计划id", example = "12127")
|
||||||
|
private Long procurementPlanId;
|
||||||
|
|
||||||
|
@Schema(description = "工厂编号", example = "31764")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "供应商商品id", example = "31243")
|
||||||
|
private Long supplierProductId;
|
||||||
|
|
||||||
|
@Schema(description = "数量")
|
||||||
|
private Integer num;
|
||||||
|
|
||||||
|
@Schema(description = "供应商价格", example = "30063")
|
||||||
|
private BigDecimal supplierPrice;
|
||||||
|
|
||||||
|
@Schema(description = "实际价格", example = "21988")
|
||||||
|
private BigDecimal actualPrice;
|
||||||
|
|
||||||
|
@Schema(description = "收货地址")
|
||||||
|
private String shippingAddress;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你说的对")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 供应商采购计划子 Response VO")
|
||||||
|
@Data
|
||||||
|
public class BpmOASupplierProcurementPlanItemRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26923")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "申请人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "29804")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "供应商采购计划id", requiredMode = Schema.RequiredMode.REQUIRED, example = "12127")
|
||||||
|
private Long procurementPlanId;
|
||||||
|
|
||||||
|
@Schema(description = "工厂编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "31764")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "供应商商品id", requiredMode = Schema.RequiredMode.REQUIRED, example = "31243")
|
||||||
|
private Long supplierProductId;
|
||||||
|
|
||||||
|
@Schema(description = "供应商商品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "12127")
|
||||||
|
private String supplierProductName;
|
||||||
|
|
||||||
|
@Schema(description = "资产类型id", requiredMode = Schema.RequiredMode.REQUIRED, example = "12127")
|
||||||
|
private Long typeId;
|
||||||
|
|
||||||
|
@Schema(description = "数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Integer num;
|
||||||
|
|
||||||
|
@Schema(description = "供应商价格", example = "30063")
|
||||||
|
private BigDecimal supplierPrice;
|
||||||
|
|
||||||
|
@Schema(description = "实际价格", example = "21988")
|
||||||
|
private BigDecimal actualPrice;
|
||||||
|
|
||||||
|
@Schema(description = "收货地址")
|
||||||
|
private String shippingAddress;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你说的对")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 供应商采购计划子新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class BpmOASupplierProcurementPlanItemSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26923")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "申请人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "29804")
|
||||||
|
@NotNull(message = "申请人的用户编号不能为空")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "供应商采购计划id", requiredMode = Schema.RequiredMode.REQUIRED, example = "12127")
|
||||||
|
@NotNull(message = "供应商采购计划id不能为空")
|
||||||
|
private Long procurementPlanId;
|
||||||
|
|
||||||
|
@Schema(description = "供应商商品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "12127")
|
||||||
|
private String supplierProductName;
|
||||||
|
|
||||||
|
@Schema(description = "资产类型id", requiredMode = Schema.RequiredMode.REQUIRED, example = "12127")
|
||||||
|
private Long typeId;
|
||||||
|
|
||||||
|
@Schema(description = "工厂编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "31764")
|
||||||
|
@NotNull(message = "工厂编号不能为空")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "供应商商品id", requiredMode = Schema.RequiredMode.REQUIRED, example = "31243")
|
||||||
|
@NotNull(message = "供应商商品id不能为空")
|
||||||
|
private Long supplierProductId;
|
||||||
|
|
||||||
|
@Schema(description = "数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "数量不能为空")
|
||||||
|
private Integer num;
|
||||||
|
|
||||||
|
@Schema(description = "供应商价格", example = "30063")
|
||||||
|
private BigDecimal supplierPrice;
|
||||||
|
|
||||||
|
@Schema(description = "实际价格", example = "21988")
|
||||||
|
private BigDecimal actualPrice;
|
||||||
|
|
||||||
|
@Schema(description = "收货地址")
|
||||||
|
private String shippingAddress;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你说的对")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.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 BpmOASupplierProcurementPlanPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "申请人的用户编号", example = "31616")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "供应商id", example = "123")
|
||||||
|
private Long supplierId;
|
||||||
|
|
||||||
|
@Schema(description = "供应商名称", example = "张三")
|
||||||
|
private String supplierName;
|
||||||
|
|
||||||
|
@Schema(description = "结算方式(字典值)")
|
||||||
|
private Integer settlementMethod;
|
||||||
|
|
||||||
|
@Schema(description = "公司账号", example = "13404")
|
||||||
|
private String companyAccount;
|
||||||
|
|
||||||
|
@Schema(description = "银行开户行")
|
||||||
|
private String bankAccountOpeningBank;
|
||||||
|
|
||||||
|
@Schema(description = "结算日")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private String[] settlementDate;
|
||||||
|
|
||||||
|
@Schema(description = "申请结果")
|
||||||
|
private Integer result;
|
||||||
|
|
||||||
|
@Schema(description = "流程实例的编号", example = "5984")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
@Schema(description = "是否结算 0待结算 1已结算(未付款) 2已付款")
|
||||||
|
private Integer settlementFlag;
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 供应商采购计划 Response VO")
|
||||||
|
@Data
|
||||||
|
public class BpmOASupplierProcurementPlanRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "29981")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "申请人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "31616")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "供应商id", example = "123")
|
||||||
|
private Long supplierId;
|
||||||
|
|
||||||
|
@Schema(description = "供应商名称", example = "张三")
|
||||||
|
private String supplierName;
|
||||||
|
|
||||||
|
@Schema(description = "结算方式(字典值)")
|
||||||
|
private Integer settlementMethod;
|
||||||
|
|
||||||
|
@Schema(description = "公司账号", example = "13404")
|
||||||
|
private String companyAccount;
|
||||||
|
|
||||||
|
@Schema(description = "银行开户行")
|
||||||
|
private String bankAccountOpeningBank;
|
||||||
|
|
||||||
|
@Schema(description = "结算日")
|
||||||
|
private String settlementDate;
|
||||||
|
|
||||||
|
@Schema(description = "申请结果", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Integer result;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "流程实例的编号", example = "5984")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "采购凭证", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private List<UploadUserFile> purchaseFileItems;
|
||||||
|
|
||||||
|
@Schema(description = "到货凭证", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private List<UploadUserFile> theArrivalFileItems;
|
||||||
|
|
||||||
|
@Schema(description = "是否结算 0待结算 1已结算(未付款) 2已付款")
|
||||||
|
private Integer settlementFlag;
|
||||||
|
|
||||||
|
@Schema(description = "子列表")
|
||||||
|
private List<BpmOASupplierProcurementPlanItemRespVO> items;
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 供应商采购计划新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class BpmOASupplierProcurementPlanSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "29981")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "申请人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "31616")
|
||||||
|
@NotNull(message = "申请人的用户编号不能为空")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "供应商id", example = "123")
|
||||||
|
private Long supplierId;
|
||||||
|
|
||||||
|
@Schema(description = "供应商名称", example = "张三")
|
||||||
|
private String supplierName;
|
||||||
|
|
||||||
|
@Schema(description = "结算方式(字典值)")
|
||||||
|
private Integer settlementMethod;
|
||||||
|
|
||||||
|
@Schema(description = "公司账号", example = "13404")
|
||||||
|
private String companyAccount;
|
||||||
|
|
||||||
|
@Schema(description = "银行开户行")
|
||||||
|
private String bankAccountOpeningBank;
|
||||||
|
|
||||||
|
@Schema(description = "结算日")
|
||||||
|
private String settlementDate;
|
||||||
|
|
||||||
|
@Schema(description = "申请结果", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Integer result;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "流程实例的编号", example = "5984")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "子列表", example = "5984")
|
||||||
|
private List<BpmOASupplierProcurementPlanItemSaveReqVO> items;
|
||||||
|
|
||||||
|
@Schema(description = "采购凭证", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private List<UploadUserFile> purchaseFileItems;
|
||||||
|
|
||||||
|
@Schema(description = "到货凭证", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private List<UploadUserFile> theArrivalFileItems;
|
||||||
|
|
||||||
|
@Schema(description = "是否结算 0待结算 1已结算(未付款) 2已付款")
|
||||||
|
private Integer settlementFlag;
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierpurchasepayment;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.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 BpmOASupplierPurchasePaymentPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "申请人的用户编号", example = "14357")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "供应商id", example = "13580")
|
||||||
|
private Long supplierId;
|
||||||
|
|
||||||
|
@Schema(description = "结算方式(字典值)")
|
||||||
|
private Integer settlementMethod;
|
||||||
|
|
||||||
|
@Schema(description = "供应商采购计划ids")
|
||||||
|
private String supplierProcurementPlanIds;
|
||||||
|
|
||||||
|
@Schema(description = "总支付金额")
|
||||||
|
private BigDecimal totalMoney;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你猜")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
|
private List<UploadUserFile> fileItems;
|
||||||
|
|
||||||
|
@Schema(description = "结果")
|
||||||
|
private Integer result;
|
||||||
|
|
||||||
|
@Schema(description = "流程实例ID", example = "11647")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierpurchasepayment;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 供应商采购付款 Response VO")
|
||||||
|
@Data
|
||||||
|
public class BpmOASupplierPurchasePaymentRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "29286")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "申请人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "14357")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "供应商id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13580")
|
||||||
|
private Long supplierId;
|
||||||
|
|
||||||
|
@Schema(description = "结算方式(字典值)")
|
||||||
|
private Integer settlementMethod;
|
||||||
|
|
||||||
|
@Schema(description = "供应商采购计划ids")
|
||||||
|
private String supplierProcurementPlanIds;
|
||||||
|
|
||||||
|
@Schema(description = "总支付金额")
|
||||||
|
private BigDecimal totalMoney;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你猜")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
|
private List<UploadUserFile> fileItems;
|
||||||
|
|
||||||
|
@Schema(description = "结果", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Integer result;
|
||||||
|
|
||||||
|
@Schema(description = "流程实例ID", example = "11647")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierpurchasepayment;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 供应商采购付款新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class BpmOASupplierPurchasePaymentSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "29286")
|
||||||
|
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")
|
||||||
|
@NotNull(message = "供应商id不能为空")
|
||||||
|
private Long supplierId;
|
||||||
|
|
||||||
|
@Schema(description = "结算方式(字典值)")
|
||||||
|
private Integer settlementMethod;
|
||||||
|
|
||||||
|
@Schema(description = "供应商采购计划ids")
|
||||||
|
private String supplierProcurementPlanIds;
|
||||||
|
|
||||||
|
@Schema(description = "总支付金额")
|
||||||
|
private BigDecimal totalMoney;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你猜")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
|
private List<UploadUserFile> fileItems;
|
||||||
|
|
||||||
|
@Schema(description = "结果", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "结果不能为空")
|
||||||
|
private Integer result;
|
||||||
|
|
||||||
|
@Schema(description = "流程实例ID", example = "11647")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.convert.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan.BpmOASupplierProcurementPlanSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierProcurementPlanDO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author yj
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BpmOASupplierProcurementPlanConvert {
|
||||||
|
|
||||||
|
BpmOASupplierProcurementPlanConvert INSTANCE = Mappers.getMapper(BpmOASupplierProcurementPlanConvert.class);
|
||||||
|
|
||||||
|
BpmOASupplierProcurementPlanDO convert(BpmOASupplierProcurementPlanSaveReqVO createReqVO);
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.convert.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan.BpmOASupplierProcurementPlanItemSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierProcurementPlanItemDO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author yj
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BpmOASupplierProcurementPlanItemConvert {
|
||||||
|
|
||||||
|
BpmOASupplierProcurementPlanItemConvert INSTANCE = Mappers.getMapper(BpmOASupplierProcurementPlanItemConvert.class);
|
||||||
|
|
||||||
|
List<BpmOASupplierProcurementPlanItemDO> convert(List<BpmOASupplierProcurementPlanItemSaveReqVO> items);
|
||||||
|
}
|
@ -55,7 +55,7 @@ public class FinancialPaymentDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
private String reason;
|
private String reason;
|
||||||
/**
|
/**
|
||||||
* 流程类型 1现金支出 2备用金 3采购付款 4报销
|
* 流程类型 1现金支出 2备用金 3采购付款 4报销 5供应商采购付款
|
||||||
*/
|
*/
|
||||||
private Integer type;
|
private Integer type;
|
||||||
/**
|
/**
|
||||||
|
@ -69,5 +69,5 @@ public class BpmOACashDO extends BaseDO {
|
|||||||
* 附件基本信息
|
* 附件基本信息
|
||||||
*/
|
*/
|
||||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
private List<UploadUserFile> fileItems ;
|
private List<UploadUserFile> fileItems;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,92 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商采购计划 DO
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@TableName(value = "bpm_oa_supplier_procurement_plan", autoResultMap = true)
|
||||||
|
@KeySequence("bpm_oa_supplier_procurement_plan_seq")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class BpmOASupplierProcurementPlanDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 申请人的用户编号
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商id
|
||||||
|
*/
|
||||||
|
private Long supplierId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商名称
|
||||||
|
*/
|
||||||
|
private String supplierName;
|
||||||
|
/**
|
||||||
|
* 结算方式(字典值)
|
||||||
|
*/
|
||||||
|
private Integer settlementMethod;
|
||||||
|
/**
|
||||||
|
* 公司账号
|
||||||
|
*/
|
||||||
|
private String companyAccount;
|
||||||
|
/**
|
||||||
|
* 银行开户行
|
||||||
|
*/
|
||||||
|
private String bankAccountOpeningBank;
|
||||||
|
/**
|
||||||
|
* 结算日
|
||||||
|
*/
|
||||||
|
private String settlementDate;
|
||||||
|
/**
|
||||||
|
* 申请结果
|
||||||
|
*/
|
||||||
|
private Integer result;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 流程实例的编号
|
||||||
|
*/
|
||||||
|
private String processInstanceId;
|
||||||
|
/**
|
||||||
|
* 采购凭证
|
||||||
|
*/
|
||||||
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
|
private List<UploadUserFile> purchaseFileItems;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 到货凭证
|
||||||
|
*/
|
||||||
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
|
private List<UploadUserFile> theArrivalFileItems;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否结算 0待结算 1已结算(未付款) 2已付款
|
||||||
|
*/
|
||||||
|
private Integer settlementFlag;
|
||||||
|
}
|
@ -0,0 +1,76 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商采购计划子 DO
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@TableName("bpm_oa_supplier_procurement_plan_item")
|
||||||
|
@KeySequence("bpm_oa_supplier_procurement_plan_item_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class BpmOASupplierProcurementPlanItemDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 申请人的用户编号
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 供应商采购计划id
|
||||||
|
*/
|
||||||
|
private Long procurementPlanId;
|
||||||
|
/**
|
||||||
|
* 工厂编号
|
||||||
|
*/
|
||||||
|
private Long factoryId;
|
||||||
|
/**
|
||||||
|
* 供应商商品id
|
||||||
|
*/
|
||||||
|
private Long supplierProductId;
|
||||||
|
/**
|
||||||
|
* 供应商商品名称
|
||||||
|
*/
|
||||||
|
private String supplierProductName;
|
||||||
|
/**
|
||||||
|
* 资产类型id
|
||||||
|
*/
|
||||||
|
private Long typeId;
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
private Integer num;
|
||||||
|
/**
|
||||||
|
* 供应商价格
|
||||||
|
*/
|
||||||
|
private BigDecimal supplierPrice;
|
||||||
|
/**
|
||||||
|
* 实际价格
|
||||||
|
*/
|
||||||
|
private BigDecimal actualPrice;
|
||||||
|
/**
|
||||||
|
* 收货地址
|
||||||
|
*/
|
||||||
|
private String shippingAddress;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商采购付款 DO
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@TableName(value = "bpm_oa_supplier_purchase_payment", autoResultMap = true)
|
||||||
|
@KeySequence("bpm_oa_supplier_purchase_payment_seq")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class BpmOASupplierPurchasePaymentDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 申请人的用户编号
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 供应商id
|
||||||
|
*/
|
||||||
|
private Long supplierId;
|
||||||
|
/**
|
||||||
|
* 结算方式(字典值)
|
||||||
|
*/
|
||||||
|
private Integer settlementMethod;
|
||||||
|
/**
|
||||||
|
* 供应商采购计划ids
|
||||||
|
*/
|
||||||
|
private String supplierProcurementPlanIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总支付金额
|
||||||
|
*/
|
||||||
|
private BigDecimal totalMoney;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 附件信息
|
||||||
|
*/
|
||||||
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
|
private List<UploadUserFile> fileItems;
|
||||||
|
/**
|
||||||
|
* 结果
|
||||||
|
*/
|
||||||
|
private Integer result;
|
||||||
|
/**
|
||||||
|
* 流程实例ID
|
||||||
|
*/
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.mysql.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan.BpmOASupplierProcurementPlanItemPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierProcurementPlanItemDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商采购计划子 Mapper
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BpmOASupplierProcurementPlanItemMapper extends BaseMapperX<BpmOASupplierProcurementPlanItemDO> {
|
||||||
|
|
||||||
|
default PageResult<BpmOASupplierProcurementPlanItemDO> selectPage(BpmOASupplierProcurementPlanItemPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<BpmOASupplierProcurementPlanItemDO>()
|
||||||
|
.eqIfPresent(BpmOASupplierProcurementPlanItemDO::getUserId, reqVO.getUserId())
|
||||||
|
.eqIfPresent(BpmOASupplierProcurementPlanItemDO::getProcurementPlanId, reqVO.getProcurementPlanId())
|
||||||
|
.eqIfPresent(BpmOASupplierProcurementPlanItemDO::getFactoryId, reqVO.getFactoryId())
|
||||||
|
.eqIfPresent(BpmOASupplierProcurementPlanItemDO::getSupplierProductId, reqVO.getSupplierProductId())
|
||||||
|
.eqIfPresent(BpmOASupplierProcurementPlanItemDO::getNum, reqVO.getNum())
|
||||||
|
.eqIfPresent(BpmOASupplierProcurementPlanItemDO::getSupplierPrice, reqVO.getSupplierPrice())
|
||||||
|
.eqIfPresent(BpmOASupplierProcurementPlanItemDO::getActualPrice, reqVO.getActualPrice())
|
||||||
|
.eqIfPresent(BpmOASupplierProcurementPlanItemDO::getShippingAddress, reqVO.getShippingAddress())
|
||||||
|
.eqIfPresent(BpmOASupplierProcurementPlanItemDO::getRemark, reqVO.getRemark())
|
||||||
|
.betweenIfPresent(BpmOASupplierProcurementPlanItemDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(BpmOASupplierProcurementPlanItemDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.mysql.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan.BpmOASupplierProcurementPlanPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierProcurementPlanDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商采购计划 Mapper
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BpmOASupplierProcurementPlanMapper extends BaseMapperX<BpmOASupplierProcurementPlanDO> {
|
||||||
|
|
||||||
|
default PageResult<BpmOASupplierProcurementPlanDO> selectPage(BpmOASupplierProcurementPlanPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<BpmOASupplierProcurementPlanDO>()
|
||||||
|
.eqIfPresent(BpmOASupplierProcurementPlanDO::getUserId, reqVO.getUserId())
|
||||||
|
.likeIfPresent(BpmOASupplierProcurementPlanDO::getSupplierName, reqVO.getSupplierName())
|
||||||
|
.eqIfPresent(BpmOASupplierProcurementPlanDO::getSettlementMethod, reqVO.getSettlementMethod())
|
||||||
|
.eqIfPresent(BpmOASupplierProcurementPlanDO::getSettlementFlag, reqVO.getSettlementFlag())
|
||||||
|
.eqIfPresent(BpmOASupplierProcurementPlanDO::getCompanyAccount, reqVO.getCompanyAccount())
|
||||||
|
.eqIfPresent(BpmOASupplierProcurementPlanDO::getBankAccountOpeningBank, reqVO.getBankAccountOpeningBank())
|
||||||
|
.betweenIfPresent(BpmOASupplierProcurementPlanDO::getSettlementDate, reqVO.getSettlementDate())
|
||||||
|
.eqIfPresent(BpmOASupplierProcurementPlanDO::getResult, reqVO.getResult())
|
||||||
|
.eqIfPresent(BpmOASupplierProcurementPlanDO::getProcessInstanceId, reqVO.getProcessInstanceId())
|
||||||
|
.betweenIfPresent(BpmOASupplierProcurementPlanDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(BpmOASupplierProcurementPlanDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.mysql.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierpurchasepayment.BpmOASupplierPurchasePaymentPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierPurchasePaymentDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商采购付款 Mapper
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BpmOASupplierPurchasePaymentMapper extends BaseMapperX<BpmOASupplierPurchasePaymentDO> {
|
||||||
|
|
||||||
|
default PageResult<BpmOASupplierPurchasePaymentDO> selectPage(BpmOASupplierPurchasePaymentPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<BpmOASupplierPurchasePaymentDO>()
|
||||||
|
.eqIfPresent(BpmOASupplierPurchasePaymentDO::getUserId, reqVO.getUserId())
|
||||||
|
.eqIfPresent(BpmOASupplierPurchasePaymentDO::getSupplierId, reqVO.getSupplierId())
|
||||||
|
.eqIfPresent(BpmOASupplierPurchasePaymentDO::getSettlementMethod, reqVO.getSettlementMethod())
|
||||||
|
.eqIfPresent(BpmOASupplierPurchasePaymentDO::getSupplierProcurementPlanIds, reqVO.getSupplierProcurementPlanIds())
|
||||||
|
.eqIfPresent(BpmOASupplierPurchasePaymentDO::getRemark, reqVO.getRemark())
|
||||||
|
.eqIfPresent(BpmOASupplierPurchasePaymentDO::getFileItems, reqVO.getFileItems())
|
||||||
|
.eqIfPresent(BpmOASupplierPurchasePaymentDO::getResult, reqVO.getResult())
|
||||||
|
.eqIfPresent(BpmOASupplierPurchasePaymentDO::getProcessInstanceId, reqVO.getProcessInstanceId())
|
||||||
|
.betweenIfPresent(BpmOASupplierPurchasePaymentDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(BpmOASupplierPurchasePaymentDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan.BpmOASupplierProcurementPlanItemPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan.BpmOASupplierProcurementPlanItemSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierProcurementPlanItemDO;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商采购计划子 Service 接口
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
public interface BpmOASupplierProcurementPlanItemService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建供应商采购计划子
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createOaSupplierProcurementPlanItem(@Valid BpmOASupplierProcurementPlanItemSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新供应商采购计划子
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateOaSupplierProcurementPlanItem(@Valid BpmOASupplierProcurementPlanItemSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除供应商采购计划子
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteOaSupplierProcurementPlanItem(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得供应商采购计划子
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 供应商采购计划子
|
||||||
|
*/
|
||||||
|
BpmOASupplierProcurementPlanItemDO getOaSupplierProcurementPlanItem(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得供应商采购计划子分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 供应商采购计划子分页
|
||||||
|
*/
|
||||||
|
PageResult<BpmOASupplierProcurementPlanItemDO> getOaSupplierProcurementPlanItemPage(BpmOASupplierProcurementPlanItemPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据采购计划id获取列表
|
||||||
|
*
|
||||||
|
* @param procurementPlanId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<BpmOASupplierProcurementPlanItemDO> getByProcurementPlanId(Long procurementPlanId);
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan.BpmOASupplierProcurementPlanItemPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan.BpmOASupplierProcurementPlanItemSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierProcurementPlanItemDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOASupplierProcurementPlanItemMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商采购计划子 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class BpmOASupplierProcurementPlanItemServiceImpl implements BpmOASupplierProcurementPlanItemService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOASupplierProcurementPlanItemMapper oaSupplierProcurementPlanItemMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createOaSupplierProcurementPlanItem(BpmOASupplierProcurementPlanItemSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
BpmOASupplierProcurementPlanItemDO oaSupplierProcurementPlanItem = BeanUtils.toBean(createReqVO, BpmOASupplierProcurementPlanItemDO.class);
|
||||||
|
oaSupplierProcurementPlanItemMapper.insert(oaSupplierProcurementPlanItem);
|
||||||
|
// 返回
|
||||||
|
return oaSupplierProcurementPlanItem.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateOaSupplierProcurementPlanItem(BpmOASupplierProcurementPlanItemSaveReqVO updateReqVO) {
|
||||||
|
// 更新
|
||||||
|
BpmOASupplierProcurementPlanItemDO updateObj = BeanUtils.toBean(updateReqVO, BpmOASupplierProcurementPlanItemDO.class);
|
||||||
|
oaSupplierProcurementPlanItemMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteOaSupplierProcurementPlanItem(Long id) {
|
||||||
|
// 删除
|
||||||
|
oaSupplierProcurementPlanItemMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BpmOASupplierProcurementPlanItemDO getOaSupplierProcurementPlanItem(Long id) {
|
||||||
|
return oaSupplierProcurementPlanItemMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<BpmOASupplierProcurementPlanItemDO> getOaSupplierProcurementPlanItemPage(BpmOASupplierProcurementPlanItemPageReqVO pageReqVO) {
|
||||||
|
return oaSupplierProcurementPlanItemMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BpmOASupplierProcurementPlanItemDO> getByProcurementPlanId(Long procurementPlanId) {
|
||||||
|
return oaSupplierProcurementPlanItemMapper.selectList(new LambdaQueryWrapper<BpmOASupplierProcurementPlanItemDO>()
|
||||||
|
.eq(BpmOASupplierProcurementPlanItemDO::getProcurementPlanId, procurementPlanId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan.BpmOASupplierProcurementPlanPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan.BpmOASupplierProcurementPlanSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierProcurementPlanDO;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商采购计划 Service 接口
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
public interface BpmOASupplierProcurementPlanService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建供应商采购计划
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createOaSupplierProcurementPlan(@Valid BpmOASupplierProcurementPlanSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新供应商采购计划
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateOaSupplierProcurementPlan(@Valid BpmOASupplierProcurementPlanSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除供应商采购计划
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteOaSupplierProcurementPlan(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得供应商采购计划
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 供应商采购计划
|
||||||
|
*/
|
||||||
|
BpmOASupplierProcurementPlanDO getOaSupplierProcurementPlan(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得供应商采购计划分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 供应商采购计划分页
|
||||||
|
*/
|
||||||
|
PageResult<BpmOASupplierProcurementPlanDO> getOaSupplierProcurementPlanPage(BpmOASupplierProcurementPlanPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新工作任务的状态
|
||||||
|
*
|
||||||
|
* @param processInstanceId 流程实例id
|
||||||
|
* @param id 编号
|
||||||
|
* @param result 结果
|
||||||
|
*/
|
||||||
|
void updateSupplierProcurementPlanResult(String processInstanceId, Long id, Integer result);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新结算方式
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @param settlementFlag
|
||||||
|
*/
|
||||||
|
void batchEditSettlementFlag(List<Long> ids, Integer settlementFlag);
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan.BpmOASupplierProcurementPlanPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierprocurementplan.BpmOASupplierProcurementPlanSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOASupplierProcurementPlanConvert;
|
||||||
|
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOASupplierProcurementPlanItemConvert;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierProcurementPlanDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierProcurementPlanItemDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOASupplierProcurementPlanItemMapper;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOASupplierProcurementPlanMapper;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商采购计划 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class BpmOASupplierProcurementPlanServiceImpl extends BpmOABaseService implements BpmOASupplierProcurementPlanService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOASupplierProcurementPlanMapper oaSupplierProcurementPlanMapper;
|
||||||
|
@Resource
|
||||||
|
private BpmOASupplierProcurementPlanItemMapper oaSupplierProcurementPlanItemMapper;
|
||||||
|
@Resource
|
||||||
|
private BpmProcessInstanceApi processInstanceApi;
|
||||||
|
@Resource
|
||||||
|
private BpmHistoryProcessInstanceService historyProcessInstanceService;
|
||||||
|
// @Resource
|
||||||
|
// private BpmProcessInstanceService processInstanceService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 供应商资产采购申请 KEY
|
||||||
|
*/
|
||||||
|
public static final String PROCESS_KEY = "oa_supplier_procurement_plan_2";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createOaSupplierProcurementPlan(BpmOASupplierProcurementPlanSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
BpmOASupplierProcurementPlanDO oaSupplierProcurementPlan = BeanUtils.toBean(createReqVO, BpmOASupplierProcurementPlanDO.class);
|
||||||
|
oaSupplierProcurementPlanMapper.insert(oaSupplierProcurementPlan);
|
||||||
|
// 返回
|
||||||
|
Long userId = WebFrameworkUtils.getLoginUserId();
|
||||||
|
createReqVO.setUserId(userId);
|
||||||
|
// 采购支付对象转换
|
||||||
|
BpmOASupplierProcurementPlanDO oaSupplierProcurementPlanDO = BpmOASupplierProcurementPlanConvert.INSTANCE.convert(createReqVO);
|
||||||
|
oaSupplierProcurementPlanMapper.insert(oaSupplierProcurementPlanDO);
|
||||||
|
|
||||||
|
// 子列表转换
|
||||||
|
List<BpmOASupplierProcurementPlanItemDO> items = BpmOASupplierProcurementPlanItemConvert.INSTANCE.convert(createReqVO.getItems());
|
||||||
|
for (BpmOASupplierProcurementPlanItemDO item : items) {
|
||||||
|
item.setProcurementPlanId(oaSupplierProcurementPlanDO.getId());
|
||||||
|
item.setUserId(userId);
|
||||||
|
}
|
||||||
|
oaSupplierProcurementPlanItemMapper.insertBatch(items);
|
||||||
|
// 发起 BPM 流程
|
||||||
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
|
String processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||||
|
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||||
|
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(oaSupplierProcurementPlan.getId()))).getCheckedData();
|
||||||
|
|
||||||
|
// 将工作流的编号,更新到 OA 采购单中
|
||||||
|
oaSupplierProcurementPlanMapper.updateById(new BpmOASupplierProcurementPlanDO().setId(oaSupplierProcurementPlan.getId()).setProcessInstanceId(processInstanceId));
|
||||||
|
|
||||||
|
// 判断是否为重新发起的流程
|
||||||
|
if (createReqVO.getProcessInstanceId() != null && createReqVO.getResult() == 3) {
|
||||||
|
historyProcessInstanceService.createHistoryProcessInstance(processInstanceId, createReqVO.getProcessInstanceId());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<UploadUserFile> purchaseFileItems = createReqVO.getPurchaseFileItems();
|
||||||
|
//这里的逻辑,如果fileItems不为空,且有数据,那么说明是上传了附件的,则需要更工作流文件表对应的实例Id
|
||||||
|
if (purchaseFileItems != null && !purchaseFileItems.isEmpty()) {
|
||||||
|
uploadBpmFileProcessInstanceId(processInstanceId, purchaseFileItems);
|
||||||
|
}
|
||||||
|
// List<UploadUserFile> theArrivalFileItems = createReqVO.getTheArrivalFileItems();
|
||||||
|
// //这里的逻辑,如果fileItems不为空,且有数据,那么说明是上传了附件的,则需要更工作流文件表对应的实例Id
|
||||||
|
// if (theArrivalFileItems != null && !theArrivalFileItems.isEmpty()) {
|
||||||
|
// uploadBpmFileProcessInstanceId(processInstanceId, theArrivalFileItems);
|
||||||
|
// }
|
||||||
|
// 返回
|
||||||
|
return oaSupplierProcurementPlanDO.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateOaSupplierProcurementPlan(BpmOASupplierProcurementPlanSaveReqVO updateReqVO) {
|
||||||
|
// 更新
|
||||||
|
BpmOASupplierProcurementPlanDO updateObj = BeanUtils.toBean(updateReqVO, BpmOASupplierProcurementPlanDO.class);
|
||||||
|
oaSupplierProcurementPlanMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteOaSupplierProcurementPlan(Long id) {
|
||||||
|
// 删除
|
||||||
|
oaSupplierProcurementPlanMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BpmOASupplierProcurementPlanDO getOaSupplierProcurementPlan(Long id) {
|
||||||
|
return oaSupplierProcurementPlanMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<BpmOASupplierProcurementPlanDO> getOaSupplierProcurementPlanPage(BpmOASupplierProcurementPlanPageReqVO pageReqVO) {
|
||||||
|
return oaSupplierProcurementPlanMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateSupplierProcurementPlanResult(String processInstanceId, Long id, Integer result) {
|
||||||
|
oaSupplierProcurementPlanMapper.updateById(new BpmOASupplierProcurementPlanDO().setId(id).setResult(result).setProcessInstanceId(processInstanceId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void batchEditSettlementFlag(List<Long> ids, Integer settlementFlag) {
|
||||||
|
oaSupplierProcurementPlanMapper.update(new BpmOASupplierProcurementPlanDO().setSettlementFlag(settlementFlag),
|
||||||
|
new LambdaQueryWrapper<BpmOASupplierProcurementPlanDO>()
|
||||||
|
.in(BpmOASupplierProcurementPlanDO::getId, ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||||
|
|
||||||
|
import javax.validation.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierpurchasepayment.BpmOASupplierPurchasePaymentPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierpurchasepayment.BpmOASupplierPurchasePaymentSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierPurchasePaymentDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商采购付款 Service 接口
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
public interface BpmOASupplierPurchasePaymentService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建供应商采购付款
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createOASupplierPurchasePayment(@Valid BpmOASupplierPurchasePaymentSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新供应商采购付款
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateOASupplierPurchasePayment(@Valid BpmOASupplierPurchasePaymentSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除供应商采购付款
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteOASupplierPurchasePayment(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得供应商采购付款
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 供应商采购付款
|
||||||
|
*/
|
||||||
|
BpmOASupplierPurchasePaymentDO getOASupplierPurchasePayment(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得供应商采购付款分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 供应商采购付款分页
|
||||||
|
*/
|
||||||
|
PageResult<BpmOASupplierPurchasePaymentDO> getOASupplierPurchasePaymentPage(BpmOASupplierPurchasePaymentPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新工作任务的状态
|
||||||
|
*
|
||||||
|
* @param processInstanceId 流程实例id
|
||||||
|
* @param id 编号
|
||||||
|
* @param result 结果
|
||||||
|
*/
|
||||||
|
void updateSupplierPurchasePaymentResult(String processInstanceId, Long id, Integer result);
|
||||||
|
}
|
@ -0,0 +1,151 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierpurchasepayment.BpmOASupplierPurchasePaymentPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplierpurchasepayment.BpmOASupplierPurchasePaymentSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierPurchasePaymentDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmProcessInstanceExtDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOASupplierPurchasePaymentMapper;
|
||||||
|
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.user.AdminUserApi;
|
||||||
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||||
|
import org.flowable.engine.runtime.ProcessInstance;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商采购付款 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class BpmOASupplierPurchasePaymentServiceImpl extends BpmOABaseService implements BpmOASupplierPurchasePaymentService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOASupplierPurchasePaymentMapper supplierPurchasePaymentMapper;
|
||||||
|
@Resource
|
||||||
|
private BpmProcessInstanceApi processInstanceApi;
|
||||||
|
@Resource
|
||||||
|
@Lazy // 解决循环依赖
|
||||||
|
private BpmHistoryProcessInstanceService historyProcessInstanceService;
|
||||||
|
@Resource
|
||||||
|
private BpmProcessInstanceService processInstanceService;
|
||||||
|
@Resource
|
||||||
|
private BpmOASupplierProcurementPlanService supplierProcurementPlanService;
|
||||||
|
@Resource
|
||||||
|
private FinancialPaymentService financialPaymentService;
|
||||||
|
@Resource
|
||||||
|
private AdminUserApi userApi;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商采购支付
|
||||||
|
*/
|
||||||
|
public static final String PROCESS_KEY = "oa_supplier_purchase_payment_2";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createOASupplierPurchasePayment(BpmOASupplierPurchasePaymentSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
BpmOASupplierPurchasePaymentDO supplierPurchasePaymentDO = BeanUtils.toBean(createReqVO, BpmOASupplierPurchasePaymentDO.class);
|
||||||
|
supplierPurchasePaymentMapper.insert(supplierPurchasePaymentDO);
|
||||||
|
Long userId = WebFrameworkUtils.getLoginUserId();
|
||||||
|
|
||||||
|
// 发起 BPM 流程
|
||||||
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
|
String processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||||
|
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||||
|
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(supplierPurchasePaymentDO.getId()))).getCheckedData();
|
||||||
|
|
||||||
|
// 将工作流的编号,更新到 OA 采购单中
|
||||||
|
supplierPurchasePaymentMapper.updateById(new BpmOASupplierPurchasePaymentDO().setId(supplierPurchasePaymentDO.getId()).setProcessInstanceId(processInstanceId));
|
||||||
|
|
||||||
|
// 判断是否为重新发起的流程
|
||||||
|
if (createReqVO.getProcessInstanceId() != null && createReqVO.getResult() == 3) {
|
||||||
|
historyProcessInstanceService.createHistoryProcessInstance(processInstanceId, createReqVO.getProcessInstanceId());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<UploadUserFile> fileItems = createReqVO.getFileItems();
|
||||||
|
//这里的逻辑,如果fileItems不为空,且有数据,那么说明是上传了附件的,则需要更工作流文件表对应的实例Id
|
||||||
|
if (fileItems != null && !fileItems.isEmpty()) {
|
||||||
|
uploadBpmFileProcessInstanceId(processInstanceId, fileItems);
|
||||||
|
}
|
||||||
|
// 返回
|
||||||
|
return supplierPurchasePaymentDO.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateOASupplierPurchasePayment(BpmOASupplierPurchasePaymentSaveReqVO updateReqVO) {
|
||||||
|
// 更新
|
||||||
|
BpmOASupplierPurchasePaymentDO updateObj = BeanUtils.toBean(updateReqVO, BpmOASupplierPurchasePaymentDO.class);
|
||||||
|
supplierPurchasePaymentMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteOASupplierPurchasePayment(Long id) {
|
||||||
|
// 删除
|
||||||
|
supplierPurchasePaymentMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BpmOASupplierPurchasePaymentDO getOASupplierPurchasePayment(Long id) {
|
||||||
|
return supplierPurchasePaymentMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<BpmOASupplierPurchasePaymentDO> getOASupplierPurchasePaymentPage(BpmOASupplierPurchasePaymentPageReqVO pageReqVO) {
|
||||||
|
return supplierPurchasePaymentMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateSupplierPurchasePaymentResult(String processInstanceId, Long id, Integer result) {
|
||||||
|
//审核通过 (最后节点)
|
||||||
|
if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) {
|
||||||
|
ProcessInstance instance = processInstanceService.getProcessInstance(processInstanceId);
|
||||||
|
if (instance.isEnded()) {
|
||||||
|
// -- 获取到供应商和商品的信息 - 插入到具体到业务表中
|
||||||
|
BpmOASupplierPurchasePaymentDO supplierPurchasePaymentDO = supplierPurchasePaymentMapper.selectById(id);
|
||||||
|
List<Long> supplierProcurementPlanIds = Arrays.stream(supplierPurchasePaymentDO.getSupplierProcurementPlanIds().split(",")).map(Long::valueOf).collect(Collectors.toList());
|
||||||
|
// -- 批量更新结算方式
|
||||||
|
supplierProcurementPlanService.batchEditSettlementFlag(supplierProcurementPlanIds, 1);
|
||||||
|
CommonResult<AdminUserRespDTO> user = userApi.getUser(supplierPurchasePaymentDO.getUserId());
|
||||||
|
BpmProcessInstanceExtDO processInstance = processInstanceService.getProcessInstanceDO(processInstanceId);
|
||||||
|
// -- 插入到财务支付表中
|
||||||
|
financialPaymentService.save(new FinancialPaymentDO()
|
||||||
|
.setUserId(supplierPurchasePaymentDO.getUserId())
|
||||||
|
.setDeptId(user.getData() == null ? null : user.getData().getDeptId())
|
||||||
|
.setProcessInstanceId(supplierPurchasePaymentDO.getProcessInstanceId())
|
||||||
|
.setReason(supplierPurchasePaymentDO.getRemark())
|
||||||
|
.setObjectId(id)
|
||||||
|
.setType(5)
|
||||||
|
.setStatus(0)
|
||||||
|
.setAmountPayable(supplierPurchasePaymentDO.getTotalMoney())
|
||||||
|
.setProcessInstanceName(processInstance.getName())
|
||||||
|
.setBeginTime(processInstance.getCreateTime())
|
||||||
|
.setEndTime(processInstance.getEndTime())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
supplierPurchasePaymentMapper.updateById(new BpmOASupplierPurchasePaymentDO().setId(id).setResult(result).setProcessInstanceId(processInstanceId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa.listener;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEvent;
|
||||||
|
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASupplierProcurementPlanService;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASupplierProcurementPlanServiceImpl;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASupplierService;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOaSupplierServiceImpl;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 合同审批单的结果的监听器实现类
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class BpmOASupplierProcurementPlanResultListener extends BpmProcessInstanceResultEventListener {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOASupplierProcurementPlanService supplierProcurementPlanService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getProcessDefinitionKey() {
|
||||||
|
return BpmOASupplierProcurementPlanServiceImpl.PROCESS_KEY;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onEvent(BpmProcessInstanceResultEvent event) {
|
||||||
|
supplierProcurementPlanService.updateSupplierProcurementPlanResult(event.getId(), Long.parseLong(event.getBusinessKey()), event.getResult());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa.listener;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEvent;
|
||||||
|
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASupplierPurchasePaymentService;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASupplierPurchasePaymentServiceImpl;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 合同审批单的结果的监听器实现类
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class BpmOASupplierPurchasePaymentResultListener extends BpmProcessInstanceResultEventListener {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOASupplierPurchasePaymentService supplierPurchasePaymentService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getProcessDefinitionKey() {
|
||||||
|
return BpmOASupplierPurchasePaymentServiceImpl.PROCESS_KEY;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onEvent(BpmProcessInstanceResultEvent event) {
|
||||||
|
supplierPurchasePaymentService.updateSupplierPurchasePaymentResult(event.getId(), Long.parseLong(event.getBusinessKey()), event.getResult());
|
||||||
|
}
|
||||||
|
}
|
@ -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="cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOASupplierProcurementPlanItemMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
@ -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="cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOASupplierProcurementPlanMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
@ -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="cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOASupplierPurchasePaymentMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
@ -1,11 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.system.controller;
|
package cn.iocoder.yudao.module.system.controller;
|
||||||
|
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
|
||||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.attendance.dto.AttendancePunchDTO;
|
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.attendance.vo.AttendancePunchVO;
|
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.group.AttendanceGroupDO;
|
|
||||||
import cn.iocoder.yudao.module.system.service.attendance.AttendanceService;
|
import cn.iocoder.yudao.module.system.service.attendance.AttendanceService;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -18,7 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.annotation.security.PermitAll;
|
import javax.annotation.security.PermitAll;
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 资产")
|
@Tag(name = "管理后台 - 考勤机打卡")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/v1")
|
@RequestMapping("/api/v1")
|
||||||
@Validated
|
@Validated
|
||||||
@ -31,28 +27,6 @@ public class AttendanceEquipmentController {
|
|||||||
@PermitAll
|
@PermitAll
|
||||||
public JSONObject verifyUser(@RequestBody JSONObject object) {
|
public JSONObject verifyUser(@RequestBody JSONObject object) {
|
||||||
TenantContextHolder.setTenantId(1L);
|
TenantContextHolder.setTenantId(1L);
|
||||||
// TODO: 2024/6/4 暂时写死
|
return attendanceService.attendanceMachineCheck(object);
|
||||||
JSONObject result = new JSONObject().set("Result", 0).set("Msg", "识别通过");
|
|
||||||
JSONObject content = new JSONObject();
|
|
||||||
content.set("voice_code", -2);
|
|
||||||
result.set("Content", content);
|
|
||||||
log.info("verifyUser: {}", object);
|
|
||||||
try {
|
|
||||||
String sn = object.getStr("sn");
|
|
||||||
String userId = object.getStr("user_id");
|
|
||||||
content.set("user_id", userId);
|
|
||||||
AttendancePunchVO punch = attendanceService.punch(new AttendancePunchDTO()
|
|
||||||
.setUserId(Long.valueOf(userId))
|
|
||||||
.setPunchType(AttendanceGroupDO.PUNCH_TYPE_ATTENDANCE_MACHINE)
|
|
||||||
.setSn(sn));
|
|
||||||
content.set("voice_text", punch.getStatus() == 0 ? "打卡成功" : (punch.getStatus() == 1 ? "迟到打卡成功" : "早退打卡成功"));
|
|
||||||
} catch (ServiceException e) {
|
|
||||||
content.set("voice_text", e.getMessage());
|
|
||||||
} catch (Exception e) {
|
|
||||||
content.set("voice_text", "系统错误");
|
|
||||||
} finally {
|
|
||||||
result.set("Content", content);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,33 +1,31 @@
|
|||||||
package cn.iocoder.yudao.module.system.controller.admin.assets;
|
package cn.iocoder.yudao.module.system.controller.admin.assets;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
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 cn.iocoder.yudao.framework.common.pojo.PageParam;
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
import cn.iocoder.yudao.module.system.controller.admin.assets.vo.AssetsTypePageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.assets.vo.AssetsTypeRespVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.assets.vo.*;
|
import cn.iocoder.yudao.module.system.controller.admin.assets.vo.AssetsTypeSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.assets.AssetsTypeDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.AssetsTypeDO;
|
||||||
import cn.iocoder.yudao.module.system.service.assets.AssetsTypeService;
|
import cn.iocoder.yudao.module.system.service.assets.AssetsTypeService;
|
||||||
|
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.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 资产类型")
|
@Tag(name = "管理后台 - 资产类型")
|
||||||
@RestController
|
@RestController
|
||||||
@ -71,8 +69,8 @@ public class AssetsTypeController {
|
|||||||
|
|
||||||
@GetMapping("/getAllList")
|
@GetMapping("/getAllList")
|
||||||
@Operation(summary = "获取全部类型")
|
@Operation(summary = "获取全部类型")
|
||||||
public CommonResult<List<AssetsTypeRespVO>> getAllList() {
|
public CommonResult<List<AssetsTypeRespVO>> getAllList(@RequestParam(required = false, defaultValue = "1") Integer businessType) {
|
||||||
List<AssetsTypeDO> assetsTypes = assetsTypeService.getAllList();
|
List<AssetsTypeDO> assetsTypes = assetsTypeService.getAllList(businessType);
|
||||||
return success(BeanUtils.toBean(assetsTypes, AssetsTypeRespVO.class));
|
return success(BeanUtils.toBean(assetsTypes, AssetsTypeRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,12 +96,12 @@ public class AssetsTypeController {
|
|||||||
@PreAuthorize("@ss.hasPermission('system:assets-type:export')")
|
@PreAuthorize("@ss.hasPermission('system:assets-type:export')")
|
||||||
@OperateLog(type = EXPORT)
|
@OperateLog(type = EXPORT)
|
||||||
public void exportAssetsTypeExcel(@Valid AssetsTypePageReqVO pageReqVO,
|
public void exportAssetsTypeExcel(@Valid AssetsTypePageReqVO pageReqVO,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
List<AssetsTypeDO> list = assetsTypeService.getAssetsTypePage(pageReqVO).getList();
|
List<AssetsTypeDO> list = assetsTypeService.getAssetsTypePage(pageReqVO).getList();
|
||||||
// 导出 Excel
|
// 导出 Excel
|
||||||
ExcelUtils.write(response, "资产类型.xls", "数据", AssetsTypeRespVO.class,
|
ExcelUtils.write(response, "资产类型.xls", "数据", AssetsTypeRespVO.class,
|
||||||
BeanUtils.toBean(list, AssetsTypeRespVO.class));
|
BeanUtils.toBean(list, AssetsTypeRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.system.controller.admin.assets.vo;
|
package cn.iocoder.yudao.module.system.controller.admin.assets.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
@ -25,6 +26,9 @@ public class AssetsPageReqVO extends PageParam {
|
|||||||
@Schema(description = "资产状态 -1无状态 0空闲 1使用中 2维修 3损坏 (资产类型按单件时候有意义)", example = "1")
|
@Schema(description = "资产状态 -1无状态 0空闲 1使用中 2维修 3损坏 (资产类型按单件时候有意义)", example = "1")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "业务类型 1行政类型 2生产类型", example = "1")
|
||||||
|
private Integer businessType;
|
||||||
|
|
||||||
@Schema(description = "资产单位")
|
@Schema(description = "资产单位")
|
||||||
private String util;
|
private String util;
|
||||||
|
|
||||||
|
@ -21,6 +21,12 @@ public class AssetsTypePageReqVO extends PageParam {
|
|||||||
@Schema(description = "类型 0按量 1按单件", example = "1")
|
@Schema(description = "类型 0按量 1按单件", example = "1")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "业务类型 1行政类型 2生产类型", example = "1")
|
||||||
|
private Integer businessType;
|
||||||
|
|
||||||
|
@Schema(description = "消耗类型 1固定资产 2消耗品", example = "1")
|
||||||
|
private Integer consumeType;
|
||||||
|
|
||||||
@Schema(description = "上级资产类型id", example = "27306")
|
@Schema(description = "上级资产类型id", example = "27306")
|
||||||
private Long pid;
|
private Long pid;
|
||||||
|
|
||||||
|
@ -29,6 +29,13 @@ public class AssetsTypeRespVO {
|
|||||||
@ExcelProperty("类型 0按量 1按单件")
|
@ExcelProperty("类型 0按量 1按单件")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "业务类型 1行政类型 2生产类型", example = "1")
|
||||||
|
@ExcelProperty("业务类型 1行政类型 2生产类型")
|
||||||
|
private Integer businessType;
|
||||||
|
|
||||||
|
@Schema(description = "消耗类型 1固定资产 2消耗品", example = "1")
|
||||||
|
private Integer consumeType;
|
||||||
|
|
||||||
@Schema(description = "上级资产类型id", example = "27306")
|
@Schema(description = "上级资产类型id", example = "27306")
|
||||||
@ExcelProperty("上级资产类型id")
|
@ExcelProperty("上级资产类型id")
|
||||||
private Long pid;
|
private Long pid;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.system.controller.admin.assets.vo;
|
package cn.iocoder.yudao.module.system.controller.admin.assets.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -19,6 +20,12 @@ public class AssetsTypeSaveReqVO {
|
|||||||
@Schema(description = "类型 0按量 1按单件", example = "1")
|
@Schema(description = "类型 0按量 1按单件", example = "1")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "业务类型 1行政类型 2生产类型", example = "1")
|
||||||
|
private Integer businessType;
|
||||||
|
|
||||||
|
@Schema(description = "消耗类型 1固定资产 2消耗品", example = "1")
|
||||||
|
private Integer consumeType;
|
||||||
|
|
||||||
@Schema(description = "上级资产类型id", example = "27306")
|
@Schema(description = "上级资产类型id", example = "27306")
|
||||||
private Long pid;
|
private Long pid;
|
||||||
|
|
||||||
|
@ -0,0 +1,81 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.attendance;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.attendance.vo.AttendanceFactoryPunchRecordPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.attendance.vo.AttendanceFactoryPunchRecordRespVO;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.attendance.vo.AttendanceFactoryPunchRecordSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.factorypunchrecord.AttendanceFactoryPunchRecordDO;
|
||||||
|
import cn.iocoder.yudao.module.system.service.attendance.factorypunchrecord.AttendanceFactoryPunchRecordService;
|
||||||
|
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 cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 工厂员工打卡记录")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/attendance-factory-punch-record")
|
||||||
|
@Validated
|
||||||
|
public class AttendanceFactoryPunchRecordController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AttendanceFactoryPunchRecordService attendanceFactoryPunchRecordService;
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新工厂员工打卡记录")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:attendance-factory-punch-record:update')")
|
||||||
|
public CommonResult<Boolean> updateAttendanceFactoryPunchRecord(@Valid @RequestBody AttendanceFactoryPunchRecordSaveReqVO updateReqVO) {
|
||||||
|
attendanceFactoryPunchRecordService.updateAttendanceFactoryPunchRecord(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得工厂员工打卡记录")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:attendance-factory-punch-record:query')")
|
||||||
|
public CommonResult<AttendanceFactoryPunchRecordRespVO> getAttendanceFactoryPunchRecord(@RequestParam("id") Long id) {
|
||||||
|
AttendanceFactoryPunchRecordDO attendanceFactoryPunchRecord = attendanceFactoryPunchRecordService.getAttendanceFactoryPunchRecord(id);
|
||||||
|
return success(BeanUtils.toBean(attendanceFactoryPunchRecord, AttendanceFactoryPunchRecordRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得工厂员工打卡记录分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:attendance-factory-punch-record:query')")
|
||||||
|
public CommonResult<PageResult<AttendanceFactoryPunchRecordRespVO>> getAttendanceFactoryPunchRecordPage(@Valid AttendanceFactoryPunchRecordPageReqVO pageReqVO) {
|
||||||
|
PageResult<AttendanceFactoryPunchRecordDO> pageResult = attendanceFactoryPunchRecordService.getAttendanceFactoryPunchRecordPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, AttendanceFactoryPunchRecordRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出工厂员工打卡记录 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:attendance-factory-punch-record:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportAttendanceFactoryPunchRecordExcel(@Valid AttendanceFactoryPunchRecordPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<AttendanceFactoryPunchRecordDO> list = attendanceFactoryPunchRecordService.getAttendanceFactoryPunchRecordPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "工厂员工打卡记录.xls", "数据", AttendanceFactoryPunchRecordRespVO.class,
|
||||||
|
BeanUtils.toBean(list, AttendanceFactoryPunchRecordRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.attendance.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.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 AttendanceFactoryPunchRecordPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "考勤用户id", example = "10616")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "部门id", example = "5051")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
@Schema(description = "工厂id", example = "32372")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "设备序列号(考勤机打卡有)")
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
@Schema(description = "日期yyyy-MM-dd格式 (实际是哪一天)")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private String[] actualDayTime;
|
||||||
|
|
||||||
|
@Schema(description = "打卡时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] punchTime;
|
||||||
|
|
||||||
|
@Schema(description = "图片")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.attendance.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 工厂员工打卡记录 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class AttendanceFactoryPunchRecordRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "20527")
|
||||||
|
@ExcelProperty("编号")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "考勤用户id", example = "10616")
|
||||||
|
@ExcelProperty("考勤用户id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "考勤用户名称", example = "10616")
|
||||||
|
@ExcelProperty("考勤用户名称")
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
@Schema(description = "部门id", example = "5051")
|
||||||
|
@ExcelProperty("部门id")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
@Schema(description = "部门名称", example = "5051")
|
||||||
|
@ExcelProperty("部门名称")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32372")
|
||||||
|
@ExcelProperty("工厂id")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "32372")
|
||||||
|
@ExcelProperty("工厂名称")
|
||||||
|
private String factoryName;
|
||||||
|
|
||||||
|
@Schema(description = "设备序列号(考勤机打卡有)")
|
||||||
|
@ExcelProperty("设备序列号(考勤机打卡有)")
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
@Schema(description = "日期yyyy-MM-dd格式 (实际是哪一天)")
|
||||||
|
@ExcelProperty("日期yyyy-MM-dd格式 (实际是哪一天)")
|
||||||
|
private String actualDayTime;
|
||||||
|
|
||||||
|
@Schema(description = "打卡时间")
|
||||||
|
@ExcelProperty("打卡时间")
|
||||||
|
private LocalDateTime punchTime;
|
||||||
|
|
||||||
|
@Schema(description = "图片")
|
||||||
|
@ExcelProperty("图片")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.attendance.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 工厂员工打卡记录新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class AttendanceFactoryPunchRecordSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "20527")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "考勤用户id", example = "10616")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "部门id", example = "5051")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32372")
|
||||||
|
@NotNull(message = "工厂id不能为空")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "设备序列号(考勤机打卡有)")
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
@Schema(description = "日期yyyy-MM-dd格式 (实际是哪一天)")
|
||||||
|
private String actualDayTime;
|
||||||
|
|
||||||
|
@Schema(description = "打卡时间")
|
||||||
|
private LocalDateTime punchTime;
|
||||||
|
|
||||||
|
@Schema(description = "图片")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
}
|
@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import cn.iocoder.yudao.module.system.api.supplier.dto.SupplierRpcDTO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.supplier.vo.SupplierPageReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.supplier.vo.SupplierPageReqVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.supplier.vo.SupplierProductRespVO;
|
import cn.iocoder.yudao.module.system.controller.admin.supplier.vo.SupplierProductRespVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.supplier.vo.SupplierRespVO;
|
import cn.iocoder.yudao.module.system.controller.admin.supplier.vo.SupplierRespVO;
|
||||||
@ -41,18 +42,20 @@ public class SupplierController {
|
|||||||
@Resource
|
@Resource
|
||||||
private SupplierProductService supplierProductService;
|
private SupplierProductService supplierProductService;
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PutMapping("/edit")
|
||||||
@Operation(summary = "创建供应商列表(OA已审核通过后插入)")
|
|
||||||
@PreAuthorize("@ss.hasPermission('system:supplier:create')")
|
|
||||||
public CommonResult<Long> createSupplier(@Valid @RequestBody SupplierSaveReqVO createReqVO) {
|
|
||||||
return success(supplierService.createSupplier(createReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新供应商列表(OA已审核通过后插入)")
|
@Operation(summary = "更新供应商列表(OA已审核通过后插入)")
|
||||||
@PreAuthorize("@ss.hasPermission('system:supplier:update')")
|
@PreAuthorize("@ss.hasPermission('system:supplier:update')")
|
||||||
public CommonResult<Boolean> updateSupplier(@Valid @RequestBody SupplierSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> edit(@Valid @RequestBody SupplierRpcDTO supplierRpcDTO) {
|
||||||
supplierService.updateSupplier(updateReqVO);
|
supplierService.saveOrEdit(supplierRpcDTO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PutMapping("/editStatus")
|
||||||
|
@Operation(summary = "更新供应商状态")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:supplier:update')")
|
||||||
|
public CommonResult<Boolean> editStatus(@Valid @RequestBody SupplierSaveReqVO vo) {
|
||||||
|
supplierService.editStatus(vo);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,6 +81,21 @@ public class SupplierController {
|
|||||||
return success(vo);
|
return success(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/allList")
|
||||||
|
@Operation(summary = "获得供应商列表")
|
||||||
|
public CommonResult<List<SupplierRespVO>> productList() {
|
||||||
|
List<SupplierDO> items = supplierService.allList();
|
||||||
|
return success(BeanUtils.toBean(items, SupplierRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/productList")
|
||||||
|
@Operation(summary = "获得供应商商品列表")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
public CommonResult<List<SupplierProductRespVO>> productList(@RequestParam("id") Long id) {
|
||||||
|
List<SupplierProductDO> items = supplierProductService.getBySupplierId(id);
|
||||||
|
return success(BeanUtils.toBean(items, SupplierProductRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得供应商列表(OA已审核通过后插入)分页")
|
@Operation(summary = "获得供应商列表(OA已审核通过后插入)分页")
|
||||||
@PreAuthorize("@ss.hasPermission('system:supplier:query')")
|
@PreAuthorize("@ss.hasPermission('system:supplier:query')")
|
||||||
|
@ -43,7 +43,7 @@ public class SupplierSaveReqVO {
|
|||||||
@Schema(description = "银行开户行")
|
@Schema(description = "银行开户行")
|
||||||
private String bankAccountOpeningBank;
|
private String bankAccountOpeningBank;
|
||||||
|
|
||||||
@Schema(description = "银行开户行")
|
@Schema(description = "状态 0禁用 1启用")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
|
@ -109,6 +109,7 @@ public class UserController {
|
|||||||
userService.updateFieldwork(reqVO.getId(), reqVO.getFieldworkFlag());
|
userService.updateFieldwork(reqVO.getId(), reqVO.getFieldworkFlag());
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/gpsPosition")
|
@GetMapping("/gpsPosition")
|
||||||
@Operation(summary = "GPS用户全量更新")
|
@Operation(summary = "GPS用户全量更新")
|
||||||
public CommonResult<Boolean> gpsFullUserUpdate() {
|
public CommonResult<Boolean> gpsFullUserUpdate() {
|
||||||
@ -157,8 +158,8 @@ public class UserController {
|
|||||||
|
|
||||||
@GetMapping({"/list-all-simple", "/simple-list"})
|
@GetMapping({"/list-all-simple", "/simple-list"})
|
||||||
@Operation(summary = "获取用户精简信息列表", description = "只包含被开启的用户,主要用于前端的下拉选项")
|
@Operation(summary = "获取用户精简信息列表", description = "只包含被开启的用户,主要用于前端的下拉选项")
|
||||||
public CommonResult<List<UserSimpleRespVO>> getSimpleUserList() {
|
public CommonResult<List<UserSimpleRespVO>> getSimpleUserList(@RequestParam(required = false, defaultValue = "1") Integer userType) {
|
||||||
List<AdminUserDO> list = userService.getUserListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
List<AdminUserDO> list = userService.getUserListByStatus(userType, CommonStatusEnum.ENABLE.getStatus());
|
||||||
// 拼接数据
|
// 拼接数据
|
||||||
Map<Long, DeptDO> deptMap = deptService.getDeptMap(
|
Map<Long, DeptDO> deptMap = deptService.getDeptMap(
|
||||||
convertList(list, AdminUserDO::getDeptId));
|
convertList(list, AdminUserDO::getDeptId));
|
||||||
@ -168,8 +169,8 @@ public class UserController {
|
|||||||
@GetMapping({"/list-all"})
|
@GetMapping({"/list-all"})
|
||||||
@Operation(summary = "获取用户精简信息列表", description = "只包含被开启的用户,主要用于前端的下拉选项,无数据权限")
|
@Operation(summary = "获取用户精简信息列表", description = "只包含被开启的用户,主要用于前端的下拉选项,无数据权限")
|
||||||
@DataPermission(enable = false)
|
@DataPermission(enable = false)
|
||||||
public CommonResult<List<UserSimpleRespVO>> getAllUserList() {
|
public CommonResult<List<UserSimpleRespVO>> getAllUserList(@RequestParam(required = false, defaultValue = "1") Integer userType) {
|
||||||
List<AdminUserDO> list = userService.getUserListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
List<AdminUserDO> list = userService.getUserListByStatus(userType, CommonStatusEnum.ENABLE.getStatus());
|
||||||
// 拼接数据
|
// 拼接数据
|
||||||
Map<Long, DeptDO> deptMap = deptService.getDeptMap(
|
Map<Long, DeptDO> deptMap = deptService.getDeptMap(
|
||||||
convertList(list, AdminUserDO::getDeptId));
|
convertList(list, AdminUserDO::getDeptId));
|
||||||
|
@ -38,6 +38,14 @@ public class AssetsTypeDO extends BaseDO {
|
|||||||
* 类型 0按量 1按单件
|
* 类型 0按量 1按单件
|
||||||
*/
|
*/
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
/**
|
||||||
|
* 业务类型 1行政类型 2生产类型
|
||||||
|
*/
|
||||||
|
private Integer businessType;
|
||||||
|
/**
|
||||||
|
* 消耗类型 1固定资产 2消耗品
|
||||||
|
*/
|
||||||
|
private Integer consumeType;
|
||||||
/**
|
/**
|
||||||
* 类型编码(最后一级才有)
|
* 类型编码(最后一级才有)
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,70 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.dal.dataobject.attendance.factorypunchrecord;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂员工打卡记录 DO
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@TableName("kq_attendance_factory_punch_record")
|
||||||
|
@KeySequence("kq_attendance_factory_punch_record_seq")
|
||||||
|
// 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class AttendanceFactoryPunchRecordDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 考勤用户id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 部门id
|
||||||
|
*/
|
||||||
|
private Long deptId;
|
||||||
|
/**
|
||||||
|
* 工厂id
|
||||||
|
*/
|
||||||
|
private Long factoryId;
|
||||||
|
/**
|
||||||
|
* 设备序列号(考勤机打卡有)
|
||||||
|
*/
|
||||||
|
private String sn;
|
||||||
|
/**
|
||||||
|
* 日期yyyy-MM-dd格式 (实际是哪一天)
|
||||||
|
*/
|
||||||
|
private String actualDayTime;
|
||||||
|
/**
|
||||||
|
* 打卡时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime punchTime;
|
||||||
|
/**
|
||||||
|
* 图片
|
||||||
|
*/
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String factoryName;
|
||||||
|
}
|
@ -24,6 +24,7 @@ public interface AssetsTypeMapper extends BaseMapperX<AssetsTypeDO> {
|
|||||||
.likeIfPresent(AssetsTypeDO::getName, reqVO.getName())
|
.likeIfPresent(AssetsTypeDO::getName, reqVO.getName())
|
||||||
.eqIfPresent(AssetsTypeDO::getType, reqVO.getType())
|
.eqIfPresent(AssetsTypeDO::getType, reqVO.getType())
|
||||||
.eqIfPresent(AssetsTypeDO::getPid, reqVO.getPid())
|
.eqIfPresent(AssetsTypeDO::getPid, reqVO.getPid())
|
||||||
|
.eqIfPresent(AssetsTypeDO::getBusinessType, reqVO.getBusinessType())
|
||||||
.betweenIfPresent(AssetsTypeDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(AssetsTypeDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.orderByDesc(AssetsTypeDO::getId));
|
.orderByDesc(AssetsTypeDO::getId));
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,42 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.dal.mysql.attendance.factorypunchrecord;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.attendance.vo.AttendanceFactoryPunchRecordPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.factorypunchrecord.AttendanceFactoryPunchRecordDO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂员工打卡记录 Mapper
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AttendanceFactoryPunchRecordMapper extends BaseMapperX<AttendanceFactoryPunchRecordDO> {
|
||||||
|
|
||||||
|
default PageResult<AttendanceFactoryPunchRecordDO> selectPage(AttendanceFactoryPunchRecordPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<AttendanceFactoryPunchRecordDO>()
|
||||||
|
.eqIfPresent(AttendanceFactoryPunchRecordDO::getUserId, reqVO.getUserId())
|
||||||
|
.eqIfPresent(AttendanceFactoryPunchRecordDO::getDeptId, reqVO.getDeptId())
|
||||||
|
.eqIfPresent(AttendanceFactoryPunchRecordDO::getFactoryId, reqVO.getFactoryId())
|
||||||
|
.eqIfPresent(AttendanceFactoryPunchRecordDO::getSn, reqVO.getSn())
|
||||||
|
.betweenIfPresent(AttendanceFactoryPunchRecordDO::getActualDayTime, reqVO.getActualDayTime())
|
||||||
|
.betweenIfPresent(AttendanceFactoryPunchRecordDO::getPunchTime, reqVO.getPunchTime())
|
||||||
|
.eqIfPresent(AttendanceFactoryPunchRecordDO::getImage, reqVO.getImage())
|
||||||
|
.betweenIfPresent(AttendanceFactoryPunchRecordDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(AttendanceFactoryPunchRecordDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分野获取
|
||||||
|
*
|
||||||
|
* @param vo
|
||||||
|
* @param objectPage
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<AttendanceFactoryPunchRecordDO> getAttendanceFactoryPunchRecordPage(@Param("vo") AttendanceFactoryPunchRecordPageReqVO vo, @Param("page") Page<Object> objectPage);
|
||||||
|
}
|
@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.system.controller.admin.user.vo.factoryUser.Facto
|
|||||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserPageReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserPageReqVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserRespVO;
|
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserRespVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSimpleRespVO;
|
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSimpleRespVO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.assets.AssetsTypeDO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
@ -61,11 +62,10 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
|||||||
return selectList(new LambdaQueryWrapperX<AdminUserDO>().like(AdminUserDO::getNickname, nickname));
|
return selectList(new LambdaQueryWrapperX<AdminUserDO>().like(AdminUserDO::getNickname, nickname));
|
||||||
}
|
}
|
||||||
|
|
||||||
default List<AdminUserDO> selectListByStatus(Integer status) {
|
default List<AdminUserDO> selectListByStatus(Integer userType, Integer status) {
|
||||||
|
|
||||||
return selectList(new LambdaQueryWrapperX<AdminUserDO>()
|
return selectList(new LambdaQueryWrapperX<AdminUserDO>()
|
||||||
.eq(AdminUserDO::getStatus, status)
|
.eq(AdminUserDO::getStatus, status)
|
||||||
.eq(AdminUserDO::getUserType, 1));
|
.eqIfPresent(AdminUserDO::getUserType, userType));
|
||||||
}
|
}
|
||||||
|
|
||||||
default List<AdminUserDO> selectListByDeptIds(Collection<Long> deptIds, Integer status) {
|
default List<AdminUserDO> selectListByDeptIds(Collection<Long> deptIds, Integer status) {
|
||||||
|
@ -66,7 +66,7 @@ public interface AssetsTypeService {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<AssetsTypeDO> getAllList();
|
List<AssetsTypeDO> getAllList(Integer businessType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据资产名称 获得指定资产类型信息
|
* 根据资产名称 获得指定资产类型信息
|
||||||
|
@ -65,8 +65,9 @@ public class AssetsTypeServiceImpl implements AssetsTypeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AssetsTypeDO> getAllList() {
|
public List<AssetsTypeDO> getAllList(Integer businessType) {
|
||||||
return assetsTypeMapper.selectList();
|
return assetsTypeMapper.selectList(new LambdaQueryWrapper<AssetsTypeDO>()
|
||||||
|
.eq(AssetsTypeDO::getBusinessType, businessType));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.system.service.attendance;
|
package cn.iocoder.yudao.module.system.service.attendance;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.attendance.dto.*;
|
import cn.iocoder.yudao.module.system.controller.admin.attendance.dto.*;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.attendance.vo.*;
|
import cn.iocoder.yudao.module.system.controller.admin.attendance.vo.*;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.addressgroup.AttendanceAddressGroupItemDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.addressgroup.AttendanceAddressGroupItemDO;
|
||||||
@ -151,4 +152,12 @@ public interface AttendanceService {
|
|||||||
* @param dto
|
* @param dto
|
||||||
*/
|
*/
|
||||||
void replacementCard(AttendanceReplacementCardDTO dto);
|
void replacementCard(AttendanceReplacementCardDTO dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤机打卡
|
||||||
|
*
|
||||||
|
* @param object
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
JSONObject attendanceMachineCheck(JSONObject object);
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ import cn.hutool.json.JSONObject;
|
|||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import cn.iocoder.yudao.framework.common.Constants;
|
import cn.iocoder.yudao.framework.common.Constants;
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
|
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
||||||
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
||||||
import cn.iocoder.yudao.framework.common.util.distance.GeoUtil;
|
import cn.iocoder.yudao.framework.common.util.distance.GeoUtil;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.attendance.dto.*;
|
import cn.iocoder.yudao.module.system.controller.admin.attendance.dto.*;
|
||||||
@ -22,6 +23,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.attendance.group.Attendance
|
|||||||
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.groupshift.AttendanceGroupShiftDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.groupshift.AttendanceGroupShiftDO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.groupshiftitem.AttendanceGroupShiftItemDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.groupshiftitem.AttendanceGroupShiftItemDO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.punchrecord.AttendancePunchRecordDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.punchrecord.AttendancePunchRecordDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
@ -30,6 +32,7 @@ import cn.iocoder.yudao.module.system.dal.mysql.attendance.punchrecord.Attendanc
|
|||||||
import cn.iocoder.yudao.module.system.dal.mysql.dept.PostMapper;
|
import cn.iocoder.yudao.module.system.dal.mysql.dept.PostMapper;
|
||||||
import cn.iocoder.yudao.module.system.handler.PunchHandler;
|
import cn.iocoder.yudao.module.system.handler.PunchHandler;
|
||||||
import cn.iocoder.yudao.module.system.service.attendance.addressgroup.AttendanceAddressGroupItemService;
|
import cn.iocoder.yudao.module.system.service.attendance.addressgroup.AttendanceAddressGroupItemService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.attendance.factorypunchrecord.AttendanceFactoryPunchRecordService;
|
||||||
import cn.iocoder.yudao.module.system.service.attendance.group.AttendanceGroupService;
|
import cn.iocoder.yudao.module.system.service.attendance.group.AttendanceGroupService;
|
||||||
import cn.iocoder.yudao.module.system.service.attendance.groupshift.AttendanceGroupShiftService;
|
import cn.iocoder.yudao.module.system.service.attendance.groupshift.AttendanceGroupShiftService;
|
||||||
import cn.iocoder.yudao.module.system.service.attendance.groupshiftitem.AttendanceGroupShiftItemService;
|
import cn.iocoder.yudao.module.system.service.attendance.groupshiftitem.AttendanceGroupShiftItemService;
|
||||||
@ -38,6 +41,7 @@ import cn.iocoder.yudao.module.system.service.attendance.groupuser.AttendanceGro
|
|||||||
import cn.iocoder.yudao.module.system.service.attendance.punch.PunchService;
|
import cn.iocoder.yudao.module.system.service.attendance.punch.PunchService;
|
||||||
import cn.iocoder.yudao.module.system.service.attendance.punch.dto.AttendanceOnTheDayDTO;
|
import cn.iocoder.yudao.module.system.service.attendance.punch.dto.AttendanceOnTheDayDTO;
|
||||||
import cn.iocoder.yudao.module.system.service.attendance.punchrecord.AttendancePunchRecordService;
|
import cn.iocoder.yudao.module.system.service.attendance.punchrecord.AttendancePunchRecordService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
||||||
import cn.iocoder.yudao.module.system.service.dict.DictDataService;
|
import cn.iocoder.yudao.module.system.service.dict.DictDataService;
|
||||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||||
import com.alibaba.excel.EasyExcel;
|
import com.alibaba.excel.EasyExcel;
|
||||||
@ -91,7 +95,8 @@ public class AttendanceServiceImpl implements AttendanceService {
|
|||||||
private AttendancePunchRecordMapper attendancePunchRecordMapper;
|
private AttendancePunchRecordMapper attendancePunchRecordMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private AdminUserService adminUserService;
|
private AdminUserService adminUserService;
|
||||||
|
@Resource
|
||||||
|
private AttendanceFactoryPunchRecordService attendanceFactoryPunchRecordService;
|
||||||
@Resource
|
@Resource
|
||||||
private AttendanceGroupMapper attendanceGroupMapper;
|
private AttendanceGroupMapper attendanceGroupMapper;
|
||||||
@Resource
|
@Resource
|
||||||
@ -104,6 +109,8 @@ public class AttendanceServiceImpl implements AttendanceService {
|
|||||||
private DictDataService dictDataService;
|
private DictDataService dictDataService;
|
||||||
@Resource
|
@Resource
|
||||||
private AttendanceAddressGroupItemService attendanceAddressGroupItemService;
|
private AttendanceAddressGroupItemService attendanceAddressGroupItemService;
|
||||||
|
@Resource
|
||||||
|
private DeptService deptService;
|
||||||
|
|
||||||
|
|
||||||
// 定义一些常量以提高代码的可读性和可维护性
|
// 定义一些常量以提高代码的可读性和可维护性
|
||||||
@ -225,7 +232,7 @@ public class AttendanceServiceImpl implements AttendanceService {
|
|||||||
.eq(AttendancePunchRecordDO::getUserId, dto.getUserId())
|
.eq(AttendancePunchRecordDO::getUserId, dto.getUserId())
|
||||||
.eq(AttendancePunchRecordDO::getDayTime, pageVO.getTargetDayStr())
|
.eq(AttendancePunchRecordDO::getDayTime, pageVO.getTargetDayStr())
|
||||||
.eq(AttendancePunchRecordDO::getNextDayFlag, Constants.TRUE)
|
.eq(AttendancePunchRecordDO::getNextDayFlag, Constants.TRUE)
|
||||||
.eq(AttendancePunchRecordDO::getStatus, AttendanceOnTheDayDTO.PUNCH_STATUS_UN_PUNCH)
|
.in(AttendancePunchRecordDO::getStatus, Arrays.asList(AttendanceOnTheDayDTO.PUNCH_STATUS_UN_PUNCH, AttendanceOnTheDayDTO.ASK_FOR_LEAVE))
|
||||||
.eq(AttendancePunchRecordDO::getWorkType, attendancePunchRecordSaveReqVO.getWorkType())
|
.eq(AttendancePunchRecordDO::getWorkType, attendancePunchRecordSaveReqVO.getWorkType())
|
||||||
.eq(AttendancePunchRecordDO::getAttendanceGroupShiftItemId, attendancePunchRecordSaveReqVO.getAttendanceGroupShiftItemId())
|
.eq(AttendancePunchRecordDO::getAttendanceGroupShiftItemId, attendancePunchRecordSaveReqVO.getAttendanceGroupShiftItemId())
|
||||||
);
|
);
|
||||||
@ -1056,6 +1063,54 @@ public class AttendanceServiceImpl implements AttendanceService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject attendanceMachineCheck(JSONObject object) {
|
||||||
|
JSONObject result = new JSONObject().set("Result", 0).set("Msg", "识别通过");
|
||||||
|
JSONObject content = new JSONObject();
|
||||||
|
content.set("voice_code", -2);
|
||||||
|
result.set("Content", content);
|
||||||
|
log.info("verifyUser: {}", object);
|
||||||
|
try {
|
||||||
|
String sn = object.getStr("sn");
|
||||||
|
String userId = object.getStr("user_id");
|
||||||
|
content.set("user_id", userId);
|
||||||
|
// -- 判断当前是否是工厂用户 - 是的话走工厂员工考勤记录即可;否则走考勤组正常打卡
|
||||||
|
AdminUserDO user = adminUserService.getUser(Long.valueOf(userId));
|
||||||
|
if (user == null || user.getStatus() == 1) {
|
||||||
|
content.set("voice_text", "无效用户");
|
||||||
|
} else {
|
||||||
|
// -- 公司用户
|
||||||
|
if (user.getUserType() == 1) {
|
||||||
|
AttendancePunchVO punch = this.punch(new AttendancePunchDTO()
|
||||||
|
.setUserId(Long.valueOf(userId))
|
||||||
|
.setPunchType(AttendanceGroupDO.PUNCH_TYPE_ATTENDANCE_MACHINE)
|
||||||
|
.setSn(sn));
|
||||||
|
content.set("voice_text", punch.getStatus() == 0 ? "打卡成功" : (punch.getStatus() == 1 ? "迟到打卡成功" : "早退打卡成功"));
|
||||||
|
} else {
|
||||||
|
LocalDateTime thisTime = LocalDateTime.now();
|
||||||
|
String actualDayTime = thisTime.format(Constants.REPO_DATE_FORMAT);
|
||||||
|
//获取当前登陆用户部门
|
||||||
|
DeptDO deptDO = deptService.getDept(user.getDeptId());
|
||||||
|
// -- 工厂用户
|
||||||
|
attendanceFactoryPunchRecordService.createAttendanceFactoryPunchRecord(new AttendanceFactoryPunchRecordSaveReqVO()
|
||||||
|
.setUserId(user.getId())
|
||||||
|
.setDeptId(user.getDeptId())
|
||||||
|
.setFactoryId(deptDO.getFactoryId())
|
||||||
|
.setSn(sn)
|
||||||
|
.setActualDayTime(actualDayTime)
|
||||||
|
.setPunchTime(thisTime));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (ServiceException e) {
|
||||||
|
content.set("voice_text", e.getMessage());
|
||||||
|
} catch (Exception e) {
|
||||||
|
content.set("voice_text", "系统错误");
|
||||||
|
} finally {
|
||||||
|
result.set("Content", content);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void useReplacementCardNum(Long userId) {
|
public void useReplacementCardNum(Long userId) {
|
||||||
userId = userId == null ? getLoginUserId() : userId;
|
userId = userId == null ? getLoginUserId() : userId;
|
||||||
|
@ -0,0 +1,56 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.service.attendance.factorypunchrecord;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.attendance.vo.AttendanceFactoryPunchRecordPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.attendance.vo.AttendanceFactoryPunchRecordSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.factorypunchrecord.AttendanceFactoryPunchRecordDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂员工打卡记录 Service 接口
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
public interface AttendanceFactoryPunchRecordService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建工厂员工打卡记录
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createAttendanceFactoryPunchRecord(@Valid AttendanceFactoryPunchRecordSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新工厂员工打卡记录
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateAttendanceFactoryPunchRecord(@Valid AttendanceFactoryPunchRecordSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工厂员工打卡记录
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteAttendanceFactoryPunchRecord(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得工厂员工打卡记录
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 工厂员工打卡记录
|
||||||
|
*/
|
||||||
|
AttendanceFactoryPunchRecordDO getAttendanceFactoryPunchRecord(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得工厂员工打卡记录分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 工厂员工打卡记录分页
|
||||||
|
*/
|
||||||
|
PageResult<AttendanceFactoryPunchRecordDO> getAttendanceFactoryPunchRecordPage(AttendanceFactoryPunchRecordPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.service.attendance.factorypunchrecord;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.attendance.vo.AttendanceFactoryPunchRecordPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.attendance.vo.AttendanceFactoryPunchRecordSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.factorypunchrecord.AttendanceFactoryPunchRecordDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.mysql.attendance.factorypunchrecord.AttendanceFactoryPunchRecordMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
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 cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂员工打卡记录 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 艾楷
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class AttendanceFactoryPunchRecordServiceImpl implements AttendanceFactoryPunchRecordService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AttendanceFactoryPunchRecordMapper attendanceFactoryPunchRecordMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createAttendanceFactoryPunchRecord(AttendanceFactoryPunchRecordSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
AttendanceFactoryPunchRecordDO attendanceFactoryPunchRecord = BeanUtils.toBean(createReqVO, AttendanceFactoryPunchRecordDO.class);
|
||||||
|
attendanceFactoryPunchRecordMapper.insert(attendanceFactoryPunchRecord);
|
||||||
|
// 返回
|
||||||
|
return attendanceFactoryPunchRecord.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateAttendanceFactoryPunchRecord(AttendanceFactoryPunchRecordSaveReqVO updateReqVO) {
|
||||||
|
// 更新
|
||||||
|
AttendanceFactoryPunchRecordDO updateObj = BeanUtils.toBean(updateReqVO, AttendanceFactoryPunchRecordDO.class);
|
||||||
|
attendanceFactoryPunchRecordMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteAttendanceFactoryPunchRecord(Long id) {
|
||||||
|
// 删除
|
||||||
|
attendanceFactoryPunchRecordMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AttendanceFactoryPunchRecordDO getAttendanceFactoryPunchRecord(Long id) {
|
||||||
|
return attendanceFactoryPunchRecordMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<AttendanceFactoryPunchRecordDO> getAttendanceFactoryPunchRecordPage(AttendanceFactoryPunchRecordPageReqVO pageReqVO) {
|
||||||
|
IPage<AttendanceFactoryPunchRecordDO> vos = attendanceFactoryPunchRecordMapper.getAttendanceFactoryPunchRecordPage(pageReqVO, MyBatisUtils.buildPage(pageReqVO));
|
||||||
|
return new PageResult<>(vos.getRecords(), vos.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -123,7 +123,7 @@ public class NoticeServiceImpl implements NoticeService {
|
|||||||
//全员推送
|
//全员推送
|
||||||
case 0:
|
case 0:
|
||||||
//获得用户信息
|
//获得用户信息
|
||||||
userDOs = userService.getUserListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
userDOs = userService.getUserListByStatus(null, CommonStatusEnum.ENABLE.getStatus());
|
||||||
break;
|
break;
|
||||||
//部门推送
|
//部门推送
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package cn.iocoder.yudao.module.system.service.supplier;
|
package cn.iocoder.yudao.module.system.service.supplier;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import javax.validation.*;
|
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.supplier.vo.*;
|
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.supplier.SupplierProductDO;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
import cn.iocoder.yudao.module.system.controller.admin.supplier.vo.SupplierProductPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.supplier.vo.SupplierProductSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.supplier.SupplierProductDO;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 供应商商品 Service 接口
|
* 供应商商品 Service 接口
|
||||||
@ -54,6 +55,7 @@ public interface SupplierProductService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取列表
|
* 获取列表
|
||||||
|
*
|
||||||
* @param supplierId
|
* @param supplierId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.system.controller.admin.supplier.vo.SupplierSaveR
|
|||||||
import cn.iocoder.yudao.module.system.dal.dataobject.supplier.SupplierDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.supplier.SupplierDO;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 供应商列表(OA已审核通过后插入) Service 接口
|
* 供应商列表(OA已审核通过后插入) Service 接口
|
||||||
@ -59,4 +60,18 @@ public interface SupplierService {
|
|||||||
* @param supplier
|
* @param supplier
|
||||||
*/
|
*/
|
||||||
void saveOrEdit(SupplierRpcDTO supplier);
|
void saveOrEdit(SupplierRpcDTO supplier);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新状态
|
||||||
|
*
|
||||||
|
* @param vo
|
||||||
|
*/
|
||||||
|
void editStatus(SupplierSaveReqVO vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有供应商
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SupplierDO> allList();
|
||||||
}
|
}
|
||||||
|
@ -76,8 +76,11 @@ public class SupplierServiceImpl implements SupplierService {
|
|||||||
if (supplier.getId() == null) {
|
if (supplier.getId() == null) {
|
||||||
supplierMapper.insert(supplierDO);
|
supplierMapper.insert(supplierDO);
|
||||||
if (CollectionUtil.isNotEmpty(products)) {
|
if (CollectionUtil.isNotEmpty(products)) {
|
||||||
supplierProductMapper.insertBatch(products);
|
for (SupplierProductDO product : products) {
|
||||||
|
product.setSupplierId(supplierDO.getId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
supplierProductMapper.insertBatch(products);
|
||||||
} else {
|
} else {
|
||||||
supplierMapper.updateById(supplierDO);
|
supplierMapper.updateById(supplierDO);
|
||||||
// -- 操作子表
|
// -- 操作子表
|
||||||
@ -96,4 +99,15 @@ public class SupplierServiceImpl implements SupplierService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void editStatus(SupplierSaveReqVO vo) {
|
||||||
|
SupplierDO supplier = BeanUtils.toBean(vo, SupplierDO.class);
|
||||||
|
supplierMapper.updateById(supplier);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SupplierDO> allList() {
|
||||||
|
return supplierMapper.selectList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -279,10 +279,11 @@ public interface AdminUserService {
|
|||||||
/**
|
/**
|
||||||
* 获得指定状态的用户们
|
* 获得指定状态的用户们
|
||||||
*
|
*
|
||||||
* @param status 状态
|
* @param userType 用户类型 1:公司用户 2:工厂用户
|
||||||
|
* @param status
|
||||||
* @return 用户们
|
* @return 用户们
|
||||||
*/
|
*/
|
||||||
List<AdminUserDO> getUserListByStatus(Integer status);
|
List<AdminUserDO> getUserListByStatus(Integer userType, Integer status);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断密码是否匹配
|
* 判断密码是否匹配
|
||||||
|
@ -337,7 +337,7 @@ public class AdminUserServiceImpl implements AdminUserService {
|
|||||||
List<Long> deptCondition = deptList.stream().map(DeptDO::getId).collect(Collectors.toList());
|
List<Long> deptCondition = deptList.stream().map(DeptDO::getId).collect(Collectors.toList());
|
||||||
return userMapper.selectList(new LambdaQueryWrapper<AdminUserDO>()
|
return userMapper.selectList(new LambdaQueryWrapper<AdminUserDO>()
|
||||||
.in(AdminUserDO::getDeptId, deptCondition)
|
.in(AdminUserDO::getDeptId, deptCondition)
|
||||||
.eq(AdminUserDO::getUserType, 1)
|
.eq(AdminUserDO::getUserType, 2)
|
||||||
.eq(AdminUserDO::getStatus, 0));
|
.eq(AdminUserDO::getStatus, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -654,8 +654,8 @@ public class AdminUserServiceImpl implements AdminUserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AdminUserDO> getUserListByStatus(Integer status) {
|
public List<AdminUserDO> getUserListByStatus(Integer userType, Integer status) {
|
||||||
return userMapper.selectListByStatus(status);
|
return userMapper.selectListByStatus(userType, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -55,6 +55,9 @@
|
|||||||
<if test="reqVO.distributeFlag != null and reqVO.distributeFlag == 1">
|
<if test="reqVO.distributeFlag != null and reqVO.distributeFlag == 1">
|
||||||
and a.stock > 0
|
and a.stock > 0
|
||||||
</if>
|
</if>
|
||||||
|
<if test="reqVO.businessType != null">
|
||||||
|
and b.business_type = #{reqVO.businessType}
|
||||||
|
</if>
|
||||||
<if test="reqVO.name != null and reqVO.name != ''">
|
<if test="reqVO.name != null and reqVO.name != ''">
|
||||||
and a.name like concat('%', #{reqVO.name}, '%')
|
and a.name like concat('%', #{reqVO.name}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
@ -0,0 +1,45 @@
|
|||||||
|
<?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="cn.iocoder.yudao.module.system.dal.mysql.attendance.factorypunchrecord.AttendanceFactoryPunchRecordMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
<select id="getAttendanceFactoryPunchRecordPage"
|
||||||
|
resultType="cn.iocoder.yudao.module.system.dal.dataobject.attendance.factorypunchrecord.AttendanceFactoryPunchRecordDO">
|
||||||
|
SELECT a.*,
|
||||||
|
b.nickname as userName,
|
||||||
|
c.name as deptName,
|
||||||
|
d.name as factoryName
|
||||||
|
FROM kq_attendance_factory_punch_record as a
|
||||||
|
left join system_users as b on a.user_id = b.id
|
||||||
|
left join system_dept as c on a.dept_id = c.id
|
||||||
|
left join sf_factory_info as d on a.factory_id = d.id
|
||||||
|
<where>
|
||||||
|
<if test="vo.userId != null">
|
||||||
|
AND a.user_id = #{vo.userId}
|
||||||
|
</if>
|
||||||
|
<if test="vo.deptId != null">
|
||||||
|
AND a.dept_id = #{vo.deptId}
|
||||||
|
</if>
|
||||||
|
<if test="vo.factoryId != null">
|
||||||
|
AND a.factory_id = #{vo.factoryId}
|
||||||
|
</if>
|
||||||
|
<if test="vo.sn != null">
|
||||||
|
AND a.sn like concat('%', #{vo.sn}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="vo.punchTime != null and vo.punchTime.length > 0">
|
||||||
|
<if test="vo.punchTime[0] != null">
|
||||||
|
and a.punch_time >= #{vo.punchTime[0]}
|
||||||
|
</if>
|
||||||
|
<if test="vo.beginTime[1] != null">
|
||||||
|
and a.punch_time <= #{vo.punchTime[1]}
|
||||||
|
</if>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
@ -708,7 +708,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest {
|
|||||||
Integer status = CommonStatusEnum.DISABLE.getStatus();
|
Integer status = CommonStatusEnum.DISABLE.getStatus();
|
||||||
|
|
||||||
// 调用
|
// 调用
|
||||||
List<AdminUserDO> result = userService.getUserListByStatus(status);
|
List<AdminUserDO> result = userService.getUserListByStatus(status, CommonStatusEnum.ENABLE.getStatus());
|
||||||
// 断言
|
// 断言
|
||||||
assertEquals(1, result.size());
|
assertEquals(1, result.size());
|
||||||
assertEquals(user, result.get(0));
|
assertEquals(user, result.get(0));
|
||||||
|
Loading…
Reference in New Issue
Block a user