Fancy
2024-10-17 451eada4d42593de866b6fe150129ec12079a452
pms-parent/pms-test/src/main/java/com/dy/pmsTest/command/CommandSv.java
@@ -1,14 +1,20 @@
package com.dy.pmsTest.command;
import com.dy.common.webFilter.UserTokenContext;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.daoPr.PrOrderItemMapper;
import com.dy.pmsGlobal.daoPr.PrOrderMapper;
import com.dy.pmsGlobal.daoTst.TstCommandMapper;
import com.dy.pmsGlobal.pojoBa.BaUser;
import com.dy.pmsGlobal.pojoTst.TstCommand;
import com.dy.pmsGlobal.util.UserUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -16,10 +22,15 @@
@Service
public class CommandSv {
    private TstCommandMapper dao;
    private UserUtil userUtil;
    @Autowired
    public void setDao(TstCommandMapper dao) {
        this.dao = dao;
    }
    @Autowired
    public void setUserUtil(UserUtil userUtil) {
        this.userUtil = userUtil;
    }
    @Transactional
@@ -27,6 +38,13 @@
        if(dao.selectByNameId(command.id,command.proId,command.name)>0){
            throw new RuntimeException("指令名称已存在");
        }
        command.disabled = false;
        command.deleted = false;
     /*   BaUser loginUser = userUtil.getUser(UserTokenContext.get());
        if (loginUser != null) {
            command.createBy = loginUser.id;
        }*/
        command.createDate = new Date();
        int count = dao.insertSelective(command);
        return count;
    }
@@ -47,12 +65,17 @@
        if(dao.selectByNameId(command.id,command.proId,command.name)>0){
            throw new RuntimeException("指令名称已存在");
        }
        /*   BaUser loginUser = userUtil.getUser(UserTokenContext.get());
        if (loginUser != null) {
            command.updatedBy = loginUser.id;
        }*/
        command.updatedDate = new Date();
        int count = dao.updateByPrimaryKeySelective(command);
        return count;
    }
    public TstCommand selectById(String lineId) {
        return dao.selectByPrimaryKey(Long.valueOf(lineId));
    public TstCommand selectById(String id) {
        return dao.selectByPrimaryKey(Long.valueOf(id));
    }
    /**