Fancy
2024-06-21 8d97b3e1102752d5ca023ef88817032997144b04
plan add note
6个文件已修改
119 ■■■■■ 已修改文件
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaAssemblyWorkLast.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/PltStationMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/StaAssemblyWorkLastMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderCtrl.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java 78 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaAssemblyWorkLast.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import jakarta.validation.constraints.NotNull;
@@ -34,6 +35,9 @@
    @NotNull(message="[用户实体编号]不能为空")
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    public Long userId;
    @TableField(exist = false)
    public String userName;
    /**
    * 生产线实体编号
    */
@@ -46,6 +50,10 @@
    @NotNull(message="[工站实体编号]不能为空")
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    public Long stationId;
    @TableField(exist = false)
    public String stationName;
    /**
    * 组装生产任务实体编号
    */
pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml
@@ -73,7 +73,7 @@
    select 
    <include refid="Base_Column_List" />
    from ba_user
    where id = #{id} and disabled!=1 and deleted!=1
    where id = #{id}
  </select>
  <select id="selectSomeCount" parameterType="java.util.Map" resultType="java.lang.Long">
pms-parent/pms-global/src/main/resources/mapper/PltStationMapper.xml
@@ -24,6 +24,9 @@
    <select id="selectLineNameById" parameterType="java.lang.Long" resultType="String">
        select name from plt_production_line where id = #{lineId}
    </select>
    <select id="selectNameByStationId" parameterType="java.lang.Long" resultType="String">
        select name from plt_station where id = #{id}
    </select>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
pms-parent/pms-global/src/main/resources/mapper/StaAssemblyWorkLastMapper.xml
@@ -17,6 +17,10 @@
            <result property="startTime" column="start_time" jdbcType="TIMESTAMP"/>
            <result property="endTime" column="end_time" jdbcType="TIMESTAMP"/>
            <result property="assistants" column="assistants" jdbcType="VARCHAR"/>
            <association property="userName" column="user_id" javaType="java.lang.Long"
                     select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectNameByUserId" fetchType="eager" />
            <association property="stationName" column="station_id" javaType="java.lang.Long"
                     select="com.dy.pmsGlobal.daoPlt.PltStationMapper.selectNameByStationId" fetchType="eager" />
    </resultMap>
    <sql id="Base_Column_List">
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderCtrl.java
@@ -2,6 +2,8 @@
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.pmsGlobal.pojoBa.BaUser;
import com.dy.pmsGlobal.pojoPlt.PltStation;
import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan;
import com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast;
import lombok.extern.slf4j.Slf4j;
@@ -23,18 +25,24 @@
        this.sv = workOrderSv;
    }
    /**
     * 查询用户信息
     * @param
     * @return
     */
    @GetMapping(path="getUserInfo")
    public BaseResponse<BaUser> getUserInfo(String userId) throws Exception {
        BaUser userInfo  = sv.getUserInfo(userId);
        return BaseResponseUtils.buildSuccess(userInfo);
    }
    /**
     * 查询工站是否已经被占用
     * @param
     * @return
     */
    @GetMapping(path="checkStationUsed")
    public BaseResponse<Boolean> isStationUsed(QueryVo last){
        String message = sv.checkStationUsed(last);
        if ("FALSE".equals(message.split("\\^")[0])) {
            return BaseResponseUtils.buildFail(message.split("\\^")[1]);
        } else {
            return BaseResponseUtils.buildSuccess(true);
        }
    @GetMapping(path="getStationInfo")
    public BaseResponse<PltStation> getStationInfo(String stationId){
        PltStation stationInfo  = sv.getStationInfo(stationId);
        return BaseResponseUtils.buildSuccess(stationInfo);
    }
    /**
     * 查询全部执行中的组装任务清单
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java
@@ -2,6 +2,7 @@
import com.alibaba.excel.util.StringUtils;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.GlException;
import com.dy.pmsGlobal.daoBa.BaUserMapper;
import com.dy.pmsGlobal.daoOth.OthFileMapper;
import com.dy.pmsGlobal.daoPlt.PltStationMapper;
@@ -62,47 +63,35 @@
        this.othFileMapper = othFileMapper;
    }
    public String checkUser(String id){
    public BaUser getUserInfo(String id){
        Long userId = null;
        String message = "USER";
        if(StringUtils.isBlank(id)){
            message = "FALSE^员工编码不能为空";
            return message;
        }
        //工站103
        if((!StringUtils.isBlank(id)) && id.toString().startsWith("103")){
            message = checkStation(id);
            return message;
            throw new RuntimeException("员工编码不能为空");
        }
        //用户101
        if(id.toString().startsWith("101")){
        if(id.startsWith("101")){
            userId = Long.parseLong(id.toString().substring(3));
        }else{
            userId = Long.parseLong(id.toString());
        }
        BaUser userInfo = baUserDao.selectByPrimaryKey(userId);
        if(userInfo == null){
            message = "FALSE^员工编码:"+ userId +"不在系统中,请先维护员工信息";
            return message;
            throw new RuntimeException("员工编码:"+ userId +"不在系统中,请先维护员工信息");
        }else if(userInfo.getDisabled()){
            throw new RuntimeException("员工("+userInfo.getName()+")编码:"+ userId +"在系统已禁用,请先启用员工");
        }else if(userInfo.getDeleted()){
            throw new RuntimeException("员工("+userInfo.getName()+")编码:"+ userId +"在系统已删除,请先恢复员工信息");
        }
        message += "^"+ userId;
        return message;
        return userInfo;
    }
    public String checkStation(String id){
    public PltStation getStationInfo(String id){
        Long stationId = null;
        String message = "STATION";
        if(StringUtils.isBlank(id)){
            message = "FALSE^工站编码不能为空";
            return message;
        }
        //用户101
        if((!StringUtils.isBlank(id)) && id.toString().startsWith("101")){
            message = checkUser(id);
            return message;
            throw new RuntimeException("工站编码不能为空");
        }
        //工站103
        if(id.toString().startsWith("103")){
        if(id.startsWith("103")){
            stationId = Long.parseLong(id.toString().substring(3));
        }else{
            stationId = Long.parseLong(id.toString());
@@ -111,19 +100,36 @@
        record.setId(stationId);
        List<PltStation> stationInfo = pltStationDao.selectStationList(record);
        if(stationInfo.size() == 0){
            message = "FALSE^工站编码:"+ stationId +"不在系统中,请先维护工站信息";
            return message;
            throw new RuntimeException("工站编码:"+ stationId +"不在系统中,请先维护工站信息");
        }
       //检查工站
        message += "^"+ stationId;
        return message;
        //检查表中stationId是否已经存在
        StaAssemblyWorkLast param = new StaAssemblyWorkLast();
        param.setStationId(stationId);
        param.setStatus(1);
        List<StaAssemblyWorkLast> userStationList = assemblyWorkLastDao.selectList(param);
        if(userStationList.size() > 0){
            throw new RuntimeException("员工("+userStationList.get(0).getUserName()+")编码:"+ userStationList.get(0).getUserId() + "已经绑定该工站("+userStationList.get(0).getStationName()+")编码:" + userStationList.get(0).getStationId() + ".请先让其解绑");
    }
    public String checkStationUsed(QueryVo last){
        return stationInfo.get(0);
    }
    public String checkUserAndStation(QueryVo last){
        String message = "OK";
        Long userId = null;
        Long stationId = null;
        String userMsg = checkUser(last.getUserId());
        String stationMsg = checkStation(last.getStationId());
        String userMsg ="";// checkUser(last.getUserId());
        String stationMsg = "";//checkStationUsed(last.getStationId());
        //工站103
        if(last.getUserId().startsWith("103")){
            stationId = getStationInfo(last.getUserId()).getId();
        }else{
            userId = getUserInfo(last.getUserId()).getId();
        }
        if(last.getStationId().startsWith("103")){
            stationId = getStationInfo(last.getStationId()).getId();
        }else{
            //userMsg = checkUser(last.getStationId());
        }
        if(userMsg.startsWith("FALSE") || stationMsg.startsWith("FALSE")){
            if(userMsg.startsWith("FALSE") && stationMsg.startsWith("FALSE")){
                message = userMsg +","+ stationMsg.split("\\^")[1];
@@ -149,14 +155,6 @@
            message = "FALSE^员工编码:"+ last.getUserId() + "或工站编码:" + last.getStationId() + "不正确,请检查";
            return message;
        }
        //检查表中stationId是否已经存在
        StaAssemblyWorkLast param = new StaAssemblyWorkLast();
        param.setStationId(stationId);
        param.setStatus(1);
        List<StaAssemblyWorkLast> userStationList = assemblyWorkLastDao.selectList(param);
        if(userStationList.size() > 0){
            message = "FALSE^员工编码:"+ userStationList.get(0).getUserId() + "已经绑定该工站编码:" + userStationList.get(0).getStationId() + ".请先让其解绑";
        }//message = "OK^员工编码:"+ userId+ "已经绑定该工站编码:" + stationId + ".验证通过";
        return message;
    }
    public List<PrAssemblyPlan> selectAssyPlanList(PrAssemblyPlan params){