Fancy
2024-08-27 d72163a55b0b666b9810d5ffefd8fd82e617f5e2
add userList
4个文件已修改
52 ■■■■■ 已修改文件
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoBa/BaUserMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleCtrl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleSv.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoBa/BaUserMapper.java
@@ -25,6 +25,8 @@
    BaUser login(Map<String, Object> params) ;
    List<BaUser> getUserList() ;
    Long selectSomeCount(Map<String, Object> params) ;
    List<BaUser> selectSome(Map<String, Object> params) ;
pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml
@@ -84,6 +84,13 @@
    where disabled!=1 and deleted!=1 and phone=#{phone} and password=#{password}
  </select>
  <select id="getUserList" resultMap="loginResultMap" >
    select
    <include refid="Login_Column_List" />
    from ba_user
    where disabled!=1 and deleted!=1
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="oneResultMap">
    <!--@mbg.generated-->
    select 
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleCtrl.java
@@ -6,6 +6,7 @@
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.aop.Log;
import com.dy.pmsGlobal.pojoBa.BaUser;
import com.dy.pmsGlobal.pojoPr.PrSchedule;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
@@ -101,6 +102,17 @@
        QueryResultVo<List<PrSchedule>> list = sv.selectSome(vo) ;
        return BaseResponseUtils.buildSuccess(list);
    }
    /**
     * 根据ID查询
     * @return
     */
    @GetMapping(path="getUserList")
    @SsoPowerAop(power = "-1")
    @Log("查询系统中操作人员信息")
    public BaseResponse<List<BaUser>> getUserList(){
        List<BaUser> userList = sv.selectById();
        return BaseResponseUtils.buildSuccess(userList);
    }
    @PostMapping(path="export")
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/schedule/ScheduleSv.java
@@ -1,10 +1,13 @@
package com.dy.pmsProduct.schedule;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.daoBa.BaPrivilegeMapper;
import com.dy.pmsGlobal.daoBa.BaUserMapper;
import com.dy.pmsGlobal.daoPlt.PltStationMapper;
import com.dy.pmsGlobal.daoPr.PrAssemblyPlanMapper;
import com.dy.pmsGlobal.daoPr.PrScheduleMapper;
import com.dy.pmsGlobal.daoPr.PrScheduleRelMapper;
import com.dy.pmsGlobal.pojoBa.BaUser;
import com.dy.pmsGlobal.pojoPlt.PltStation;
import com.dy.pmsGlobal.pojoPr.PrSchedule;
import com.dy.pmsGlobal.pojoPr.PrScheduleRel;
@@ -25,39 +28,53 @@
    private PrScheduleRelMapper scheduleRelDao;
    private PrAssemblyPlanMapper assemblyPlanDao;
    private PltStationMapper stationDao;
    private BaUserMapper baUserDao;
    @Autowired
    public void setStationDao(PltStationMapper stationDao) {
        this.stationDao = stationDao;
    }
    @Autowired
    public void setScheduleRelDao(PrScheduleRelMapper scheduleRelDao) {
        this.scheduleRelDao = scheduleRelDao;
    }
    @Autowired
    public void setAssemblyPlanDao(PrAssemblyPlanMapper assemblyPlanDao) {
        this.assemblyPlanDao = assemblyPlanDao;
    }
    @Autowired
    public void setScheduleDao(PrScheduleMapper scheduleDao) {
        this.scheduleDao = scheduleDao;
    }
    @Autowired
    private void setBaUserMapper(BaUserMapper baUserDao) {
        this.baUserDao = baUserDao;
    }
    @Transactional
    public int save(PrSchedule schedule) {
        int count = scheduleDao.insertSelective(schedule);
        saveRel(schedule);
        return count;
    }
    @Transactional
    public int update(PrSchedule schedule) {
        scheduleRelDao.deleteByScheduleId(schedule.id);
        saveRel(schedule);
        return scheduleDao.updateByPrimaryKeySelective(schedule);
    }
    private void saveRel(PrSchedule schedule) {
        schedule.relList.forEach(rel ->validateRelData(rel, schedule));
        schedule.relList.forEach(rel -> validateRelData(rel, schedule));
        schedule.relList.forEach(rel -> scheduleRelDao.insertSelective(rel));
    }
    private void validateRelData(PrScheduleRel rel,PrSchedule schedule) {
    private void validateRelData(PrScheduleRel rel, PrSchedule schedule) {
        validatePlan(rel);
        validateStation(rel);
        rel.scheduleId = schedule.id;
@@ -87,11 +104,16 @@
        return scheduleDao.selectByPrimaryKey(id);
    }
    public List<BaUser> selectById() {
        List<BaUser> userList = baUserDao.getUserList();
        return userList;
    }
    public QueryResultVo<List<PrSchedule>> selectSome(QueryVo vo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo);
        //查询符合条件的记录总数
        Long itemTotal = scheduleDao.selectSomeCount(params);
        QueryResultVo<List<PrSchedule>> rsVo = new QueryResultVo<>(vo.pageSize, vo.pageCurr) ;
        QueryResultVo<List<PrSchedule>> rsVo = new QueryResultVo<>(vo.pageSize, vo.pageCurr);
        //计算分页等信息
        rsVo.calculateAndSet(itemTotal, params);
        //查询符合条件的记录
@@ -100,8 +122,7 @@
    }
    public List<Map<String, Object>> selectPlan(QueryVo vo) {
        List<Map<String,Object>> list = assemblyPlanDao.selectByPlanName(vo.planName);
        List<Map<String, Object>> list = assemblyPlanDao.selectByPlanName(vo.planName);
        return list;
    }