简单操作

这是一个关于DQFNAction类中删除TBFtLog记录的Java代码片段。通过传入的log_id和tf_id,从数据库中查找并删除对应的TBFtLog对象,并重定向到dqfnLotDetailUI.action页面。
摘要由CSDN通过智能技术生成

package com.system.dqfn.action;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.system.action.SystemAction;
import com.system.common.PageParam;
import com.system.db.C3P0Utils;
import com.system.dqfn.model.DQFNBom;
import com.system.dqfn.model.DQFNFtzk;
import com.system.dqfn.model.DQFNPlan;
import com.system.dqfn.model.DQFNPlanBom;
import com.system.dqfn.model.DQFNTcline;
import com.system.dqfn.model.DQFNWP6;
import com.system.dqfn.model.FTLabel;
import com.system.dqfn.model.TBFtLog;
import com.system.dqfn.util.DQFNValidate;
import com.system.dqfn.util.ReflectUtils;
import com.system.dqfn.util.TclineUtils;
import com.system.dqfn.util.ToSendZKThread;
import com.system.dqfn.util.ValidateResult;
import com.system.model.Encfor;
import com.system.model.Protype;
import com.system.utils.UserUtils;
import com.system.utils.UuidUtil;
@SuppressWarnings(“serial”)
public class DQFNFtAction extends SystemAction {

private PageParam page;

public PageParam getPage() {
	return page;
}

/**
 * 批量删除
 * */

@SuppressWarnings("unchecked")
public void toDel(){
	String tf_lot=res.getParameter(request, "tf_lot", "");
	String tf_id=res.getParameter(request, "tf_id", "");
	String hql = "from TBFtLog l where l.tf_lot = '"+ tf_lot+"'";
	System.out.println(hql);
	String sql="from TBFtLog l where l.tf_lot = '"+ tf_id+"'";
	System.out.println(sql);
	List<TBFtLog> listlog = (List<TBFtLog>) dqfnService.findByHql(hql);
	for(TBFtLog log: listlog){
		dqfnService.delete(log);
	}
	try {
		response.sendRedirect("dqfnAction!dqfnLotDetailUI.action?flag=&page.name="
				+ res.getParameter(request, "className", "") + "&tf_id=" + tf_id);
	} catch (Exception e) {
	}
	
}


// 中转到添加确认页面
@SuppressWarnings("unchecked")
public void toAdd() {
	String className = res.getParameter(request, "className", "");
	String tf_id = res.getParameter(request, "tf_id", "");
	String flag = res.getParameter(request, "flag", "");
	String tf_lot = res.getParameter(request, "tf_lot", "");
	if ("bat".equals(flag)) {
		// 添加01-12片信息
		TBFtLog log = new TBFtLog();
		String str = "";
		for (int i = 1; i < 13; i++) {
			str = "00" + i;
			str = str.substring(str.length() - 2);
			log.setTf_id(UuidUtil.get32UUID());
			log.setTf_lot(tf_lot);
			log.setTf_p1(str);
			// 保存之前须判断
			try {
				Object obj = Class.forName("com.system.dqfn.model." + className).newInstance();
				obj = systemService.findObjectByHql("from " + className + " where tf_lot= '" + tf_lot + "'");
				String tf_dingdan = ReflectUtils.invokeGetter(obj, "tf_dingdan");
				DQFNPlan plan = dqfnPlanService.findById("from DQFNPlan where tf_id='" + tf_dingdan + "'");
				DQFNBom bom = (DQFNBom) systemService
						.findObjectByHql("from DQFNBom where tf_id='" + plan.getTf_bom() + "' ");
				DQFNPlanBom _bom = (DQFNPlanBom) systemService
						.findObjectByHql("from  DQFNPlanBom where tf_id='" + plan.getTf_bom() + "'");
				Protype protype = protypeService
						.findById(_bom != null ? _bom.getTf_protype() : bom.getTf_protype());
				String hql = "from TBFtLog l where l.tf_lot = '" + tf_lot + "' and l.tf_p1 = '" + str + "'";
				List<TBFtLog> listlog = (List<TBFtLog>) dqfnService.findByHql(hql);
				if (listlog.size() > 0) {
					log = listlog.get(0);
					dqfnService.update(log);
				} else {
					log.setTf_id(UuidUtil.get32UUID());
					log.setTf_tr("");
					log.setTf_protype(protype.getTf_name());
					log.setTf_cc("");
					log.setTf_p2("");
					log.setTf_p3("");
					log.setTf_p4("");
					log.setTf_p5("");
					log.setTf_ng1("0");
					log.setTf_ng2("0");
					log.setTf_ng3("0");
					log.setTf_ng4("0");
					log.setTf_ng5("0");
	
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值