|
@@ -0,0 +1,82 @@
|
|
|
+package com.fjhx.oa.service.seal.impl;
|
|
|
+
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.fjhx.oa.entity.seal.dto.SealConfigDto;
|
|
|
+import com.fjhx.oa.entity.seal.dto.SealConfigSelectDto;
|
|
|
+import com.fjhx.oa.entity.seal.po.SealConfig;
|
|
|
+import com.fjhx.oa.entity.seal.vo.SealConfigVo;
|
|
|
+import com.fjhx.oa.mapper.seal.SealConfigMapper;
|
|
|
+import com.fjhx.oa.service.seal.SealConfigService;
|
|
|
+import com.fjhx.tenant.utils.DeptUstil;
|
|
|
+import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
+import com.ruoyi.common.utils.wrapper.SqlField;
|
|
|
+import com.ruoyi.system.utils.UserUtil;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 印章管理 服务实现类
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author
|
|
|
+ * @since 2024-04-09
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class SealConfigServiceImpl extends ServiceImpl<SealConfigMapper, SealConfig> implements SealConfigService {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Page<SealConfigVo> getPage(SealConfigSelectDto dto) {
|
|
|
+ IWrapper<SealConfig> wrapper = getWrapper();
|
|
|
+
|
|
|
+ wrapper.keyword(dto.getKeyword(), new SqlField("sc", SealConfig::getName), new SqlField("sc", SealConfig::getRemark));
|
|
|
+ wrapper.eq("sc", SealConfig::getType, dto.getType());
|
|
|
+ wrapper.eq("sc", SealConfig::getCustodyUserId, dto.getCustodyUserId());
|
|
|
+ wrapper.eq("sc", SealConfig::getCustodyDeptId, dto.getCustodyDeptId());
|
|
|
+
|
|
|
+ wrapper.orderByDesc("sc", SealConfig::getId);
|
|
|
+ Page<SealConfigVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
+ List<SealConfigVo> records = page.getRecords();
|
|
|
+ setInfo(records);
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public SealConfigVo detail(Long id) {
|
|
|
+ SealConfig SealConfig = this.getById(id);
|
|
|
+ SealConfigVo result = BeanUtil.toBean(SealConfig, SealConfigVo.class);
|
|
|
+ setInfo(Arrays.asList(result));
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ void setInfo(List<SealConfigVo> records) {
|
|
|
+ if (ObjectUtil.isEmpty(records)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ UserUtil.assignmentNickName(records, SealConfigVo::getCustodyUserId, SealConfigVo::setCustodyUserName);
|
|
|
+ DeptUstil.assignmentNickName(records, SealConfigVo::getCustodyDeptId, SealConfigVo::setCustodyDeptName);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void add(SealConfigDto sealConfigDto) {
|
|
|
+ this.save(sealConfigDto);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void edit(SealConfigDto sealConfigDto) {
|
|
|
+ this.updateById(sealConfigDto);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void delete(Long id) {
|
|
|
+ this.removeById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|