|
@@ -1,11 +1,27 @@
|
|
|
package com.rongwei.bscommon.sys.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.date.DateTime;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
+import com.rongwei.bscommon.sys.service.ZhcxPmqManagementDistributionDetailService;
|
|
|
+import com.rongwei.bscommon.sys.service.ZhcxPmqManagementRecoredService;
|
|
|
+import com.rongwei.bscommon.sys.utils.CommonUtils;
|
|
|
+import com.rongwei.bsentity.domain.ZhcxPmqManagementDistributionDetailDo;
|
|
|
import com.rongwei.bsentity.domain.ZhcxPmqManagementLogDo;
|
|
|
import com.rongwei.bscommon.sys.dao.ZhcxPmqManagementLogDao;
|
|
|
import com.rongwei.bscommon.sys.service.ZhcxPmqManagementLogService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.rongwei.bsentity.domain.ZhcxPmqManagementRecoredDo;
|
|
|
+import com.rongwei.rwadmincommon.system.vo.SysUserVo;
|
|
|
+import com.rongwei.rwcommon.base.R;
|
|
|
+import com.rongwei.rwcommon.utils.SecurityUtil;
|
|
|
+import com.rongwei.rwcommon.utils.StringUtils;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
+import java.util.Objects;
|
|
|
+
|
|
|
/**
|
|
|
* <p>
|
|
|
* 三单管理_操作日志 服务实现类
|
|
@@ -15,6 +31,59 @@ import org.springframework.stereotype.Service;
|
|
|
* @since 2024-11-22
|
|
|
*/
|
|
|
@Service
|
|
|
+@Slf4j
|
|
|
public class ZhcxPmqManagementLogServiceImpl extends ServiceImpl<ZhcxPmqManagementLogDao, ZhcxPmqManagementLogDo> implements ZhcxPmqManagementLogService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ZhcxPmqManagementDistributionDetailService detailService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ZhcxPmqManagementRecoredService recoredService;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public R logForSecondFloor(String id, String type) {
|
|
|
+ ZhcxPmqManagementRecoredDo recoredDo = recoredService.getById(id);
|
|
|
+ Date nowDate = DateUtil.parse(DateUtil.now(), "yyyy-MM-dd HH:mm:ss");
|
|
|
+ // 获取当前操作人
|
|
|
+ SysUserVo currentUser = CommonUtils.getCurrentUser();
|
|
|
+ if(Objects.isNull(currentUser) || StringUtils.isEmpty(currentUser.getId())){
|
|
|
+ return R.error("无法获取当前操作人");
|
|
|
+ }
|
|
|
+ ZhcxPmqManagementLogDo zhcxPmqManagementLogDo = new ZhcxPmqManagementLogDo();
|
|
|
+ zhcxPmqManagementLogDo.setId(SecurityUtil.getUUID())
|
|
|
+ .setOperator(currentUser.getName())
|
|
|
+ .setOperatorid(currentUser.getId())
|
|
|
+ .setOperationtype(type)
|
|
|
+ .setOperationtime(nowDate)
|
|
|
+ .setPmqmid(recoredDo.getPmqmid())
|
|
|
+ .setRecoredid(id);
|
|
|
+ this.save(zhcxPmqManagementLogDo);
|
|
|
+ log.info("记录日志");
|
|
|
+ return R.ok("记录日志");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public R logFoThirdFloor(String id, String type) {
|
|
|
+ ZhcxPmqManagementDistributionDetailDo detailDo = detailService.getById(id);
|
|
|
+ ZhcxPmqManagementRecoredDo recoredDo = recoredService.getById(detailDo.getPid());
|
|
|
+ Date nowDate = DateUtil.parse(DateUtil.now(), "yyyy-MM-dd HH:mm:ss");
|
|
|
+ // 获取当前操作人
|
|
|
+ SysUserVo currentUser = CommonUtils.getCurrentUser();
|
|
|
+ if(Objects.isNull(currentUser) || StringUtils.isEmpty(currentUser.getId())){
|
|
|
+ return R.error("无法获取当前操作人");
|
|
|
+ }
|
|
|
+ ZhcxPmqManagementLogDo zhcxPmqManagementLogDo = new ZhcxPmqManagementLogDo();
|
|
|
+ zhcxPmqManagementLogDo.setId(SecurityUtil.getUUID())
|
|
|
+ .setOperator(currentUser.getName())
|
|
|
+ .setOperatorid(currentUser.getId())
|
|
|
+ .setOperationtype(type)
|
|
|
+ .setOperationtime(nowDate)
|
|
|
+ .setPmqmid(recoredDo.getPmqmid())
|
|
|
+ .setRecoredid(recoredDo.getId())
|
|
|
+ .setDistributionid(detailDo.getDistributid())
|
|
|
+ .setDetailid(id);
|
|
|
+ this.save(zhcxPmqManagementLogDo);
|
|
|
+ log.info("记录日志");
|
|
|
+ return R.ok("记录日志");
|
|
|
+ }
|
|
|
}
|