| | |
| | | |
| | | boolean exists(String name, Long id); |
| | | |
| | | PrAssemblyPlan selectByDeviceNo(String proCode, String batchNumber); |
| | | |
| | | List<PrAssemblyPlan> selectAssyPlanList(PrAssemblyPlan params); |
| | | |
| | | List<PrAssemblyPlan> selectAssyPlanSimplify(PrAssemblyPlan params); |
| | |
| | | <association property="processName" column="process_id" javaType="java.lang.Long" |
| | | select="com.dy.pmsGlobal.daoPr.PrProductionProcessMapper.selectProcessNameById" fetchType="eager" /> |
| | | <collection property="process" ofType="com.dy.pmsGlobal.pojoPr.PrProductionProcess" |
| | | select="com.dy.pmsGlobal.daoPr.PrProductionProcessMapper.selectByPrimaryKey" fetchType="eager" column="process_id" /> |
| | | select="com.dy.pmsGlobal.daoPr.PrProductionProcessMapper.selectByPrimaryKey" fetchType="eager" |
| | | column="process_id"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="PlanResultMap" type="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan"> |
| | |
| | | <result property="inputNumber" column="input_number" jdbcType="INTEGER"/> |
| | | <result property="outputNumber" column="output_number" jdbcType="INTEGER"/> |
| | | <collection property="process" ofType="com.dy.pmsGlobal.pojoPr.PrProductionProcess" |
| | | select="com.dy.pmsGlobal.daoPr.PrProductionProcessMapper.selectByProcessId" fetchType="eager" column="process_id" /> |
| | | select="com.dy.pmsGlobal.daoPr.PrProductionProcessMapper.selectByProcessId" fetchType="eager" |
| | | column="process_id"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,pro_id,batch_id, |
| | | id |
| | | ,pro_id,batch_id, |
| | | process_id,name,number, |
| | | status,creator, |
| | | dt,start_date,end_date, |
| | | deleted,content,input_number,output_number |
| | | </sql> |
| | | |
| | | <sql id="part_Column_List"> |
| | | ${alias}.id, |
| | | ${alias}.pro_id, |
| | | ${alias}.batch_id, |
| | | ${alias}.process_id, |
| | | ${alias}.name, |
| | | ${alias}.number, |
| | | ${alias}.status, |
| | | ${alias}.creator, |
| | | ${alias}.dt, |
| | | ${alias}.start_date, |
| | | ${alias}.end_date, |
| | | ${alias}.deleted, |
| | | ${alias}.content, |
| | | ${alias}.input_number, |
| | | ${alias}.output_number |
| | | </sql> |
| | | <select id="selectPlanNamesByProcessId" resultType="java.lang.String" > |
| | | select GROUP_CONCAT(name SEPARATOR ',') |
| | | from pr_assembly_plan |
| | | where process_id = #{processId} and deleted = 0 |
| | | where process_id = #{processId} |
| | | and deleted = 0 |
| | | </select> |
| | | <select id="processIsQuote" resultType="java.lang.Boolean" parameterType="java.lang.Long"> |
| | | select count(1) |
| | |
| | | </if> |
| | | </select> |
| | | <select id="selectNameByPlanId" parameterType="java.lang.Long" resultType="String"> |
| | | select name from pr_assembly_plan where id = #{id} |
| | | select name |
| | | from pr_assembly_plan |
| | | where id = #{id} |
| | | </select> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | |
| | | from pr_production_node |
| | | where process_id = #{processId,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="selectAssyPlanSimplify" resultMap="PlanResultMap" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan"> |
| | | |
| | | <select id="selectByDeviceNo" parameterType="java.lang.String" resultMap="PlanResultMap"> |
| | | select |
| | | <include refid="part_Column_List"> |
| | | <property name="alias" value="p"/> |
| | | </include> |
| | | from pr_assembly_plan p,plt_product pp,pr_batch_number b |
| | | where p.pro_id = pp.id and p.batch_id = b.id |
| | | and pp.code = #{proCode,jdbcType=VARCHAR} |
| | | and b.batch_number = #{batchNumber,jdbcType=VARCHAR} |
| | | </select> |
| | | |
| | | <select id="selectAssyPlanSimplify" resultMap="PlanResultMap" |
| | | parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from pr_assembly_plan |
| | |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from pr_assembly_plan |
| | | delete |
| | | from pr_assembly_plan |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan" useGeneratedKeys="true"> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan" |
| | | useGeneratedKeys="true"> |
| | | insert into pr_assembly_plan |
| | | ( id,pro_id,batch_id |
| | | ,process_id,name,number |
| | |
| | | ,#{processId,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{number,jdbcType=INTEGER} |
| | | ,#{status,jdbcType=TINYINT},#{creator,jdbcType=VARCHAR} |
| | | ,#{dt,jdbcType=TIMESTAMP},#{startDate,jdbcType=VARCHAR},#{endDate,jdbcType=VARCHAR} |
| | | ,#{deleted,jdbcType=TINYINT},#{content,jdbcType=VARCHAR},#{inputNumber,jdbcType=INTEGER},#{outputNumber,jdbcType=INTEGER}) |
| | | , #{deleted,jdbcType=TINYINT}, #{content,jdbcType=VARCHAR}, #{inputNumber,jdbcType=INTEGER} |
| | | , #{outputNumber,jdbcType=INTEGER}) |
| | | </insert> |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan" useGeneratedKeys="true"> |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan" |
| | | useGeneratedKeys="true"> |
| | | insert into pr_assembly_plan |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan"> |
| | | update pr_assembly_plan |
| | | set |
| | | pro_id = #{proId,jdbcType=BIGINT}, |
| | | set pro_id = #{proId,jdbcType=BIGINT}, |
| | | batch_id = #{batchId,jdbcType=BIGINT}, |
| | | process_id = #{processId,jdbcType=BIGINT}, |
| | | name = #{name,jdbcType=VARCHAR}, |
| | |
| | | </select> |
| | | |
| | | <update id="deleteLogicById" parameterType="java.lang.Long"> |
| | | update pr_assembly_plan set deleted = 1 |
| | | update pr_assembly_plan |
| | | set deleted = 1 |
| | | where id = #{id} |
| | | </update> |
| | | </mapper> |
| | |
| | | import com.dy.pmsGlobal.pojoPlt.PltProductParams; |
| | | import com.dy.pmsGlobal.pojoPlt.PltProductQualityInspectionItems; |
| | | import com.dy.pmsGlobal.pojoPlt.PltProductTestInspectionItems; |
| | | import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan; |
| | | import com.dy.pmsGlobal.pojoPr.PrProductionNode; |
| | | import com.dy.pmsGlobal.pojoSta.StaDeviceLife; |
| | | import com.dy.pmsGlobal.pojoSta.StaDeviceProductionLog; |
| | |
| | | List<StaDeviceProductionLog> result = sv.queryLogByDeviceNo(deviceNo); |
| | | return BaseResponseUtils.buildSuccess(result); |
| | | } |
| | | @GetMapping(path = "queryPlanByDeviceNo") |
| | | public BaseResponse<PrAssemblyPlan> queryPlanByDeviceNo(String deviceNo) { |
| | | log.info("AssemblyStepCtrl.queryLogByDeviceNo():" + deviceNo); |
| | | PrAssemblyPlan result = sv.queryPlanByDeviceNo(deviceNo); |
| | | return BaseResponseUtils.buildSuccess(result); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /* public PrAssemblyPlan queryPlanByDeviceNo(String deviceNo) { |
| | | //查询产品所在的任务 |
| | | public PrAssemblyPlan queryPlanByDeviceNo(String deviceNo) { |
| | | String proCode = ""; |
| | | String lotCode = ""; |
| | | if (StringUtils.isNotEmpty(deviceNo) && deviceNo.length() == 22) { |
| | | proCode = deviceNo.substring(3,6); |
| | | lotCode = deviceNo.substring(6,15); |
| | | } |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("deviceNo", deviceNo); |
| | | map.put("proName", ""); |
| | | map.put("proType", ""); |
| | | map.put("proId", ""); |
| | | map.put("proCode", ""); |
| | | //判断是不是是本厂物料 |
| | | if(CollectionUtils.isEmpty(productList)){ |
| | | productList = productDao.selectAll(null); |
| | | PrAssemblyPlan plan = assemblyPlanDao.selectByDeviceNo(proCode,lotCode); |
| | | if(plan != null){ |
| | | plan.setBatchNo(lotCode); |
| | | } |
| | | PltProduct product = null; |
| | | |
| | | if (product != null) { |
| | | map.put("deviceNo", deviceNo); |
| | | map.put("proName", product.getName()); |
| | | map.put("proType", product.getType()); |
| | | BigInteger proId = BigInteger.valueOf(product.getId()); |
| | | map.put("proId", proId.toString()); |
| | | map.put("proCode",product.getCode()); |
| | | return plan; |
| | | } |
| | | return map; |
| | | } |
| | | */ |
| | | public List<StaDeviceLife> queryLifeByDeviceNo(String deviceNo) { |
| | | return deviceLifeDao.selectByDeviceNo(deviceNo); |
| | | } |