NutzCN Logo
问答 这是一个打印功能但是从那能看出来呢
发布于 2642天前 作者 悟丶静心 1610 次浏览 复制 上一个帖子 下一个帖子
标签:
@Ok("raw:json")
	public String print(String work_no, String caozuoyuan) {
		Sql sql2 = Sqls
				.queryRecord("select printpc from PrintServerset where billkind = '维修派工单'");
		dao.execute(sql2);
		List<Record> res2 = sql2.getList(Record.class);
		if (res2.size() > 0) {
			String printpc = res2.get(0).getString("printpc");
			Sql sql1 = Sqls
					.queryRecord("insert into PrintServerLog(printdate,billkind,billno,printczy,printpc,printsource,flag_print ) values (getdate(),'维修派工单','"
							+ work_no
							+ "','"
							+ caozuoyuan
							+ "','"
							+ printpc
							+ "',1,0)");
			dao.execute(sql1);
			return jsons.json(1, 1, 1, "成功");
		}
		return jsons.json(1, 1, 0, "维修派工单没有找到!");
	}
5 回复

目测是这方法会插入一个打印任务, 然后,另外一个线程/进程轮询这个表,然后执行之

@Ok("raw:json")
	public String jiesuan_3(String caozuoyuanid, String work_no, String che_no,int isPrint) {
		// 当前操作员
		List<userEntity> list_user = dao.query(userEntity.class,
				Cnd.where("name", "=", caozuoyuanid));
		if (list_user.size() > 0) {
			userEntity user = list_user.get(0);
			// 6.//
			Sql sql6 = Sqls
					.queryRecord("select sys_jiag_low,sys_SetPrice from sm_system_info");
			dao.execute(sql6);
			List<Record> res6 = sql6.getList(Record.class);
			int sys_jiag_low = res6.get(0).getInt("sys_jiag_low");
			int sys_SetPrice = res6.get(0).getInt("sys_SetPrice");
			if (sys_jiag_low == 0) {
				Sql sql61 = Sqls
						.queryRecord("select gongsino from work_pz_gz where work_no = '"
								+ work_no + "'");
				dao.execute(sql61);
				List<Record> res61 = sql61.getList(Record.class);
				if(res61!=null && res61.size()>0){
					String gongsino = res61.get(0).getString("gongsino");
					if (sys_SetPrice == 0) {
						Sql sql62 = Sqls
								.queryRecord("select  gongsino from sm_gongsi where gongsi_xz = 1");
						dao.execute(sql62);
						List<Record> res62 = sql62.getList(Record.class);
						gongsino = res62.get(0).getString("gongsino");
					}
	
					Sql sql62 = Sqls
							.queryRecord("select count(*) as cnt from work_ll_gz a,kucshp_zk b where a.peij_no = b.peij_no and isnull(a.peij_dj,0) < isnull(b.jiag_low,0) and a.work_no = '"
									+ work_no + "' and  b.gongsino = " + gongsino);
					dao.execute(sql62);
					List<Record> res62 = sql62.getList(Record.class);
					int cnt62 = res62.get(0).getInt("cnt");
	
					if (cnt62 > 0)
						return jsons.json(1, 1, 0, "\"本单据中有销价小于最低售价的配件,不能完成结算!\"");
				}
			}
			// 7.//

			Sql sql71 = Sqls
					.queryRecord("select Card_JifenType,Card_JiFenlv from cardsysset");
			dao.execute(sql71);
			List<Record> res71 = sql71.getList(Record.class);
			String Card_JifenType = res71.get(0).getString("Card_JifenType");
			String Card_JiFenlv = res71.get(0).getString("Card_JiFenlv");

			Sql sql72 = Sqls
					.queryRecord("update work_pz_gz set work_jifen_sum= (select isnull(xche_ssje,0) from work_pz_gz where work_no = '"
							+ work_no
							+ "') * "
							+ Card_JiFenlv
							+ " where Work_No='" + work_no + "'");
			dao.execute(sql72);
			// 8.//
			Sql sql81 = Sqls
					.queryRecord("select count(*) as cnt from ( select 1 as a  from work_mx_sj where work_no = '"
							+ work_no
							+ "' and  wxxm_no in (select wxxm_no from work_weixiu_sm where  isnull(wxxm_by,0)  = 1 ) union   select 1 as a  from work_mx_gz where work_no = '"
							+ work_no
							+ "' and  wxxm_no in (select wxxm_no from work_weixiu_sm where  isnull(wxxm_by,0)  = 1 ) )  a");
			dao.execute(sql81);
			List<Record> res81 = sql81.getList(Record.class);
			int cnt81 = res81.get(0).getInt("cnt");

			if (cnt81 > 0) {
				Sql sql82 = Sqls
						.queryRecord("select convert(varchar(10),isnull(che_next_byrq,getdate()),120) as Che_Next_byrq ,isnull(che_baoyanglicheng,0) as che_baoyanglicheng,isnull(che_next_licheng,0) as che_next_licheng from work_cheliang_sm  where che_no = '"
								+ che_no + "'");
				dao.execute(sql82);
				List<Record> res82 = sql82.getList(Record.class);
				String Che_Next_byrq = res82.get(0).getString("Che_Next_byrq");
				String che_baoyanglicheng = res82.get(0).getString(
						"che_baoyanglicheng");
				String che_next_licheng = res82.get(0).getString(
						"che_next_licheng");
				if (!"".equals(Che_Next_byrq)) {
					Sql sql83 = Sqls
							.queryRecord("select isnull(che_rjlc,0) as che_rjlc,isnull(che_baoyanglicheng,0) as Che_ByZq from work_cheliang_sm  where che_no = '"
									+ che_no + "'");
					dao.execute(sql83);
					List<Record> res83 = sql83.getList(Record.class);
					int che_rjlc = res83.get(0).getInt("che_rjlc");
					int Che_ByZq = res83.get(0).getInt("Che_ByZq");
					if ((che_rjlc != 0) && (Che_ByZq != 0)) {
						double Che_NextDays = Che_ByZq / che_rjlc;
						Sql sql84 = Sqls
								.queryRecord("update work_cheliang_sm set flag_notsendmsg = 0, che_prior_byrq = che_next_byrq ,che_prior_licheng = "
										+ che_next_licheng
										+ " where  che_no = '" + che_no + "'");
						dao.execute(sql84);
						Sql sql85 = Sqls
								.queryRecord("update work_cheliang_sm set  che_next_byrq =  DATEADD(day, "
										+ Che_NextDays
										+ ", getdate()), che_next_licheng = isnull(che_prior_licheng,0)+ "
										+ che_baoyanglicheng
										+ " where che_no = '" + che_no + "'");
						dao.execute(sql85);
					}
				}
			}
			// 9.//
			if(isPrint==1){
				Sql sql90 = Sqls
						.queryRecord("select printpc from PrintServerset where billkind = '快修单'");
				dao.execute(sql90);
				List<Record> res190 = sql90.getList(Record.class);
				if(res190!=null && res190.size()>0){
				String jgss190 = res190.get(0).getString("printpc");
				Sql sql9 = Sqls
						.queryRecord("insert into PrintServerLog(printdate,billkind,billno,printczy,printpc,printsource,flag_print )  values (getdate(),'快修单','"
								+ work_no
								+ "','"
								+ caozuoyuanid
								+ "','"
								+ jgss190
								+ "',1,0)");
				dao.execute(sql9);
				}
			}
			
			Sql sqlcjn3_1 = Sqls.create("update work_pz_gz set xche_yeje = xche_ysje - xche_ssje where work_no = '"+work_no+"' ");
			
			
			dao.execute(sqlcjn3_1);
			
			
			
			// 10.//
			Sql sql101 = Sqls
					.queryRecord("delete from work_fkdw_list where work_no = '"
							+ work_no + "'");
			dao.execute(sql101);
			Sql sql102 = Sqls
					.queryRecord("insert into work_fkdw_list(work_no,kehu_no,che_no, xche_fkdw_no, xche_fkdw_mc, xche_ysje, xche_ssje, xche_yhje, xche_yeje)     select work_no,kehu_no,che_no, kehu_no, kehu_mc, xche_ysje, xche_ssje, xche_yhje, xche_yeje    from work_pz_gz where work_no='"
							+ work_no + "'");
			dao.execute(sql102);
			Sql sql103 = Sqls
					.queryRecord("select isnull(flag_cardjs,0) as card_js ,isnull(xche_ssje,0) as jzje,isnull(zhifu_card_xj,0) as card_zhifu_xj , isnull(yh_zhanghao,'现金') as yh_zhanghao,kehu_no,Card_no ,ZhiFu_Card_No,   isnull(xche_ssje,0)  as Card_Ssje  from work_pz_gz where work_no = '"
							+ work_no + "'");
			dao.execute(sql103);
			List<Record> res103 = sql103.getList(Record.class);
			int card_js = res103.get(0).getInt("card_js");
			double jzje = Double.parseDouble(res103.get(0).getString("jzje"));
			int card_zhifu_xj = res103.get(0).getInt("card_zhifu_xj");
			String yh_zhanghao = res103.get(0).getString("yh_zhanghao");
			String kehu_no = res103.get(0).getString("kehu_no");
			String Card_no = res103.get(0).getString("Card_no");
			String ZhiFu_Card_No = res103.get(0).getString("ZhiFu_Card_No");
//			if(card_js==1){
//				ZhiFu_Card_No = Card_no;
//			}
			int Card_Ssje = res103.get(0).getInt("Card_Ssje");
			Sql sql104 = Sqls
					.queryRecord("insert into work_pz_sj (work_no, kehu_no, kehu_sj, che_no, xche_sfbz, xche_sffl, xche_lc, xche_cy, xche_cclc, xche_last_lc,xche_last_jdrq,xche_jdrq, xche_gj, xche_wxjd,xche_yjwgrq, xche_wgrq, xche_pgcz, xche_jlr, xche_jlrq, xche_jsr, xche_jsrq,xche_fpfs, xche_fplv, xche_rgf, xche_rgsl, xche_rgse, xche_rgbh, xche_clf, xche_clsl, xche_clse, xche_clbh, xche_glf, xche_wjgf, xche_wjgcb, xche_qtf, xche_yhje, xche_ysje, xche_rgcb, xche_cb, xche_zxr, xche_qtxm, xche_wjgx, xche_yhyy, xche_gdfl, xche_wxfl, xche_bz, xche_cz, xche_jb, xche_jcr, xche_hjje, xche_ssje, xche_yeje, xche_jsfs, dept_mc, flag_fast, card_no, card_kind, flag_cardjs,zhifu_card_no, zhifu_card_je,xche_kpje,xche_kpse,xche_fpno,zhifu_card_xj, xche_sbclf,xche_sbgsf,xche_sbgss,xche_sbgsff,xche_sbclcb,xche_bxclf,xche_bxclcb,xche_bxgsf,xche_bxgss,xche_bxgscb, card_itemrate,card_peijrate, gongsino, gongsimc, xche_wxxmlv, xche_peijlv,yh_zhanghao,xche_sjhk,xche_xzrgf_je,xche_xzclf_je,wxxm_tcje_sum,wxxm_zztcje_sum,peij_tcje_sum,che_zjno,xche_wxxm_yhje,xche_peij_yhje,work_jifen_sum,cangk_dm,flag_pad)  select work_no,kehu_no,kehu_sj,che_no,xche_sfbz,xche_sffl,xche_lc,xche_cy,isnull(xche_lc,0), isnull(xche_last_lc,0),xche_last_jdrq,xche_jdrq,xche_gj,xche_wxjd, xche_yjwgrq,xche_jsrq,  xche_pgcz,xche_jlr,xche_jlrq,xche_jsr, xche_jsrq,xche_fpfs,xche_fplv,xche_rgf,xche_rgsl,xche_rgse,xche_rgbh, xche_clf,xche_clsl,xche_clse,xche_clbh,xche_glf,xche_wjgf,xche_wjgcb,xche_qtf,xche_yhje,xche_ysje,xche_rgcb,xche_cb, xche_zxr,xche_qtxm,xche_wjgx,xche_yhyy,xche_gdfl,xche_wxfl,xche_bz,xche_cz,xche_jb,xche_jcr,xche_hjje,xche_ssje, xche_yeje,xche_jsfs,dept_mc,isnull(flag_fast,0),card_no,card_kind, "
							+ card_js
							+ " ,zhifu_card_no,zhifu_card_je,xche_kpje,xche_kpse,xche_fpno,zhifu_card_xj, xche_sbclf,xche_sbgsf,xche_sbgss,xche_sbgsff,xche_sbclcb,xche_bxclf,xche_bxclcb,xche_bxgsf,xche_bxgss,xche_bxgscb, card_itemrate,card_peijrate,gongsino,gongsimc,xche_wxxmlv,xche_peijlv,yh_zhanghao,xche_sjhk,xche_xzrgf_je,xche_xzclf_je,wxxm_tcje_sum,wxxm_zztcje_sum,peij_tcje_sum,che_zjno, xche_wxxm_yhje,xche_peij_yhje,work_jifen_sum,cangk_dm ,1 from work_pz_gz where work_no = '"
							+ work_no + "'");
			dao.execute(sql104);
			// 插入维修项目数据
			Sql sql105 = Sqls
					.queryRecord("insert into work_mx_sj(work_no, wxxm_no, wxxm_mc, wxxm_gs, wxxm_khgs, wxxm_cb, wxxm_je, wxxm_ry,wxxm_zt, wxxm_bz, wxxm_zk,wxxm_yje,flag_xz,wxxm_mxcx,wxxm_dj,wxxm_tcfs,wxxm_tc,wxxm_tcje, wxxm_bjrq) select work_no, wxxm_no, wxxm_mc, wxxm_gs, wxxm_khgs, wxxm_cb, wxxm_je, wxxm_ry,wxxm_zt, wxxm_bz, wxxm_zk,wxxm_yje,flag_xz,wxxm_mxcx,wxxm_dj,wxxm_tcfs,wxxm_tc,wxxm_tcje, wxxm_bjrq from work_mx_gz where work_no= '"
							+ work_no + "'");
			dao.execute(sql105);
			// 插入外加工数据
			Sql sql106 = Sqls
					.queryRecord("insert into work_wjg_sj(work_no, wxxm_no, wxxm_mc, wxxm_cb, wxxm_je, wxxm_bz) select work_no, wxxm_no, wxxm_mc, wxxm_cb, wxxm_je, wxxm_bz from work_wjg_gz where work_no= '"
							+ work_no + "'");
			dao.execute(sql106);
			// 插入检测项目数据
			Sql sql107 = Sqls
					.queryRecord("insert into check_mx_sj(work_no,check_project,flag_normal,flag_adjust,flag_suggest_replace,kehu_view) select work_no,check_project,flag_normal,flag_adjust,flag_suggest_replace,kehu_view from check_mx_gz where work_no= '"
							+ work_no + "'");
			dao.execute(sql107);
			// 插入检测项目数据
			Sql sql108 = Sqls
					.queryRecord("insert into work_ll_sj(work_no, peij_no, peij_sl, peij_dj, peij_je, peij_cb, peij_cbje, cangk_dm, peij_zt, peij_hw, peij_ry, peij_bz, flag_import, have_import, flag_chuku, peij_ydj, peij_yje, peij_zk, peij_sl_ls, peij_dw_ls, peij_dj_ls, danwei_bs_ls, reco_no1, flag_xz,peij_tcfs,peij_tc,peij_tcje,peij_jifen,peij_jifenlv ) select work_no,peij_no,peij_sl,peij_dj,peij_je,peij_cb,peij_cbje,cangk_dm,peij_zt,peij_hw,peij_ry,peij_bz,flag_import, have_import, flag_chuku, peij_ydj, peij_yje, peij_zk, peij_sl_ls, peij_dw, peij_dj_ls, danwei_bs_ls, reco_no, flag_xz,peij_tcfs,peij_tc,peij_tcje,peij_jifen,peij_jifenlv  from work_ll_gz where work_no= '"
							+ work_no + "'");
			dao.execute(sql108);
			// 插入派工数据
			Sql sql109 = Sqls
					.queryRecord("insert into Work_Pg_Sj(work_no, wxxm_no, reny_no, reny_mc, wxry_bm, wxry_cj, wxry_bz, paig_khgs, paig_khje, paig_pgsj, paig_bz, wxry_pg) select work_no, wxxm_no, reny_no, reny_mc, wxry_bm, wxry_cj, wxry_bz, paig_khgs, paig_khje, paig_pgsj, paig_bz, wxry_pg from Work_Pg_Gz where work_no= '"
							+ work_no + "'");
			dao.execute(sql109);
			
			Sql sql109_1 = Sqls
					.queryRecord("update work_pz_sj set xche_yhje = isnull(xche_peij_yhje,0)+ isnull(xche_wxxm_yhje,0)  where work_no = '"+work_no+"'");
			dao.execute(sql109_1);
			
			
			runCall("Wx_lingliao_chuku('" + work_no + "')");
			runCall("wx_weixiu_kuan('" + work_no + "')");
			runCall("wx_weixiu_piao('" + work_no + "')");
			runCall("Wx_Kuaixiu_JiesuanLs('" + work_no + "')");
			Sql sql110 = Sqls
					.queryRecord("update work_yuyue_pz set yuyue_progress='已离店' where work_no='"
							+ work_no + "'");
			dao.execute(sql110);
			if (jzje != 0 && card_js == 0) {
				if ("现金".equals(yh_zhanghao)) {
					Sql sql111 = Sqls
							.queryRecord("insert into jizhang_xjmx(kehu_no,yewu_jsfs,jizhang_name,jizhang_pz,jizhang_km,jizhang_jf,jizhang_rq,jizhang_jb,jizhang_cz,jizhang_bz,yewu_dh,yewu_xz,GongSiNo,GongSiMc) values('"
									+ kehu_no
									+ "','"
									+ yh_zhanghao
									+ "', '现金','"+work_no+"' ,'101' , '"
									+ jzje
									+ "',getdate() , '"+user.getName()+"' ,'"
									+ caozuoyuanid
									+ "' ,'收维修款' ,'"
									+ work_no
									+ "' ,2007 ,'"+user.getGongSiNo()+"' , '"+user.getGongSiMc()+"' )");
					dao.execute(sql111);
				} else {
					Sql sql112 = Sqls
							.queryRecord("insert into jizhang_xjmx(kehu_no,yewu_jsfs,jizhang_name,jizhang_pz,jizhang_km,jizhang_jf,jizhang_rq,jizhang_jb,jizhang_cz,jizhang_bz,yewu_dh,yewu_xz,GongSiNo,GongSiMc) values('"
									+ kehu_no
									+ "','"
									+ yh_zhanghao
									+ "','"
									+ yh_zhanghao
									+ "','"
									+ work_no
									+ "' ,'101' ,@jzje,getdate() , '"+user.getName()+"' ,'"
									+ caozuoyuanid
									+ "' ,'收维修款' ,'"
									+ work_no
									+ "' ,2007 ,'"+user.getGongSiNo()+"' ,'"+user.getGongSiMc()+"' )");
					dao.execute(sql112);
				}
			}
			if (card_zhifu_xj != 0) {
				if ("现金".equals(yh_zhanghao)) {
					Sql sql113 = Sqls
							.queryRecord("insert into jizhang_xjmx(kehu_no,yewu_jsfs,jizhang_name,jizhang_pz,jizhang_km,jizhang_jf,jizhang_rq,jizhang_jb,jizhang_cz,jizhang_bz,yewu_dh,yewu_xz,GongSiNo,GongSiMc) values('"
									+ kehu_no
									+ "','"
									+ yh_zhanghao
									+ "', '现金','"
									+ work_no
									+ "' ,'101' ,'"
									+ card_zhifu_xj
									+ "', getdate() , '"+user.getName()+"' , '"
									+ caozuoyuanid
									+ "' , '收维修款'  ,'"
									+ work_no
									+ "' , 2007 ,'"+user.getGongSiNo()+"' ,  '"+user.getGongSiMc()+"' )");
					dao.execute(sql113);
				} else {
					Sql sql114 = Sqls
							.queryRecord("insert into jizhang_xjmx(kehu_no,yewu_jsfs,jizhang_name,jizhang_pz,jizhang_km,jizhang_jf,jizhang_rq,jizhang_jb,jizhang_cz,jizhang_bz,yewu_dh,yewu_xz,GongSiNo,GongSiMc) values('"
									+ kehu_no
									+ "','"
									+ yh_zhanghao
									+ "','"
									+ yh_zhanghao
									+ "','"
									+ work_no
									+ "' ,'101' ,'"
									+ card_zhifu_xj
									+ "',getdate() , '"+user.getName()+"' ,'"
									+ caozuoyuanid
									+ "' ,'收维修款'  ,'"
									+ work_no
									+ "' ,2007 ,'"+user.getGongSiNo()+"' ,  '"+user.getGongSiMc()+"' )");
					dao.execute(sql114);
				}
			}			
			Sql sql116 = Sqls
					.queryRecord("select sum(peij_jifen) as cardjifen  from work_ll_sj where work_no= '"
							+ work_no + "' and peij_zt='正常'");
			dao.execute(sql116);
			List<Record> res116 = sql116.getList(Record.class);
			int cardjifen = res116.get(0).getInt("cardjifen");
			// 会员积分等处理
			if (card_js == 1) {
				Sql sql114 = Sqls
						.queryRecord("update kehu_card set card_xiaozje= card_xiaozje + "
								+ Card_Ssje
								+ "   where card_no= '"
								+ ZhiFu_Card_No + "'");
				dao.execute(sql114);
				Sql sql115 = Sqls
						.queryRecord("select Card_JifenType,Card_JiFenlv from cardsysset");
				dao.execute(sql115);
				List<Record> res115 = sql115.getList(Record.class);
				Card_JifenType = res115.get(0).getString("Card_JifenType");
				Card_JiFenlv = res115.get(0).getString("Card_JiFenlv");
				if (!"".equals(ZhiFu_Card_No)) {
					if ("true".equals(Card_JifenType)) {
						
						System.out.println("111************************"+"update kehu_card set card_jifen=Card_jifen+"
										+ Card_Ssje
										+ "*"
										+ Card_JiFenlv
										+ "	 ,card_leftjf=card_leftjf+"
										+ Card_Ssje
										+ "*"
										+ Card_JiFenlv
										+ " where  card_no='"
										+ ZhiFu_Card_No + "'");
						Sql sql = Sqls
								.queryRecord("update kehu_card set card_jifen=Card_jifen+"
										+ Card_Ssje
										+ "*"
										+ Card_JiFenlv
										+ "	 ,card_leftjf=card_leftjf+"
										+ Card_Ssje
										+ "*"
										+ Card_JiFenlv
										+ " where  card_no='"
										+ ZhiFu_Card_No + "'");
						dao.execute(sql);
					} else {System.out.println("222************************"+"update kehu_card set card_jifen=Card_jifen+"
							+ cardjifen
							+ " , card_leftjf=card_leftjf+"
							+ cardjifen
							+ "   where card_no='"
							+ ZhiFu_Card_No + "'");
						Sql sql = Sqls
								.queryRecord("update kehu_card set card_jifen=Card_jifen+"
										+ cardjifen
										+ " , card_leftjf=card_leftjf+"
										+ cardjifen
										+ "   where card_no='"
										+ ZhiFu_Card_No + "'");
						dao.execute(sql);
						Sql sql117 = Sqls
								.queryRecord("select Card_jifen,Flag_Update,Card_Kind from kehu_card where card_no ='"
										+ ZhiFu_Card_No + "'");
						dao.execute(sql117);
						List<Record> res117 = sql117.getList(Record.class);
						if (res117.size() > 0) {
							String Card_Jf = res117.get(0).getString("Card_jifen");
							String Flag_Update = res117.get(0).getString(
									"Flag_Update");
							String OldCard_Kind = res117.get(0).getString(
									"Card_Kind");

							//
							Sql sql118 = Sqls
									.queryRecord("select top 1 cardkind from cardkind where card_jfmin<="
											+ Card_Jf + " order by card_jfmin desc");
							dao.execute(sql118);
							List<Record> res118 = sql118.getList(Record.class);
							String NewCardKind = res118.get(0)
									.getString("cardkind");
							if ("1".equals(Flag_Update) && "".equals(NewCardKind)
									&& OldCard_Kind.equals(NewCardKind)
									&& Card_Ssje > 0) {
								Sql sql119 = Sqls
										.queryRecord("insert into cardkindrename(card_no,oldcard_kind,newcard_kind,czy,ddate,demo)values("
												+ Card_no
												+ ","
												+ OldCard_Kind
												+ ","
												+ NewCardKind
												+ ",'"
												+ caozuoyuanid
												+ "',getdate(),'会员积分升级')");
								dao.execute(sql119);
								Sql sql120 = Sqls
										.queryRecord("update kehu_card set card_kind="
												+ NewCardKind
												+ " where card_no= '"
												+ ZhiFu_Card_No + "'");
								dao.execute(sql120);
							}
						}
					}
				}				
			}


			// 积分,消费的记录
			if (!"".equals(Card_no)) {
				Sql sql121 = Sqls
						.queryRecord("select  wxxm_no from work_mx_sj where work_no = '"
								+ work_no + "'");
				dao.execute(sql121);
				List<Record> res121 = sql121.getList(Record.class);
				for (Record rec : res121) {
					String wxxm_no = rec.getString("wxxm_no");
					Sql sql122 = Sqls
							.queryRecord("select isnull(wxxm_cs,0)-isnull(wxxm_yqcs,0) as jg from kehu_carddetail where card_no='"
									+ Card_no
									+ "' and wxxm_no='"
									+ wxxm_no
									+ "'");
					dao.execute(sql122);
					List<Record> res122 = sql122.getList(Record.class);
					if (res122.size() > 0) {
						int jg = res122.get(0).getInt("jg");
						if (jg > 0) {
							Sql sql123 = Sqls
									.queryRecord("update kehu_carddetail set wxxm_yqcs=wxxm_yqcs+1  where card_no="
											+ Card_no
											+ " and wxxm_no='"
											+ wxxm_no + "'");
							dao.execute(sql123);
							Sql sql124 = Sqls
									.queryRecord("update work_mx_sj set Flag_WxxcCs = 1 where work_no = '"
											+ work_no
											+ "' and  wxxm_no='"
											+ wxxm_no + "'");
							dao.execute(sql124);
						}
					}
				}
			}
			Sql sql125 = Sqls
					.queryRecord("select * from work_ll_sj where work_no = '"
							+ work_no + "'");
			dao.execute(sql125);
			List<Record> res125 = sql125.getList(Record.class);
			if (res125.size() > 0) {
				String peij_no = res125.get(0).getString("peij_no");
				int peij_sl = res125.get(0).getInt("peij_sl");
				String sql_126 = "select isnull(peij_card_sl,0)-isnull(peij_card_yqsl,0) as peij_sysl from kehu_carddetailpeij where peij_no ='"
						+ peij_no + "'";
				if (Card_no != null && Card_no.length() > 2) {
					sql_126 += " and Card_no='" + Card_no + "'";
				}
				Sql sql126 = Sqls.queryRecord(sql_126);
				dao.execute(sql126);
				List<Record> res126 = sql126.getList(Record.class);
				if (res126.size() > 0) {
					int peij_sysl = res126.get(0).getInt("peij_sysl");
					if (peij_sysl > 0) {
						if (peij_sysl - peij_sl >= 0) {
							Sql sql127 = Sqls
									.queryRecord("update kehu_carddetailpeij set peij_card_yqsl=isnull(peij_card_yqsl,0) + "
											+ peij_sl
											+ "	where card_no='"
											+ Card_no
											+ "' and peij_no='"
											+ peij_no + "'");
							dao.execute(sql127);
							// --更新work_ll_sj表中的Flag_peijcardSL(使用的会员卡中的数量),用于判断反结算时是否增加特殊配件数量
							Sql sql128 = Sqls
									.queryRecord(" update work_ll_sj set Flag_peijcardSL = "
											+ peij_sl
											+ " where work_no = '"
											+ work_no
											+ "' and peij_no = '"
											+ peij_no + "'");
							dao.execute(sql128);
						} else if (peij_sysl - peij_sl < 0) {
							Sql sql129 = Sqls
									.queryRecord("update work_ll_sj set Flag_peijcardSL = "
											+ peij_sysl
											+ " where work_no = '"
											+ work_no
											+ "' and peij_no = '"
											+ peij_no + "'");
							dao.execute(sql129);
							Sql sql130 = Sqls
									.queryRecord("update kehu_carddetailpeij set peij_card_yqsl=peij_card_yqsl + "
											+ peij_sysl
											+ " where card_no='"
											+ Card_no
											+ "' and peij_no='"
											+ peij_no + "'");
							dao.execute(sql130);
						}
					}
				}
			}
			if (card_js == 0) {
				Sql sql130 = Sqls
						.queryRecord("update kehu_card set card_xiaozje= card_xiaozje + "
								+ Card_Ssje
								+ "   where card_no= '"
								+ Card_no + "'");
				dao.execute(sql130);
				if ("true".equals(Card_JifenType)) {
					System.out.println("3******************************"+"update kehu_card set card_jifen=Card_jifen+"
									+ Card_Ssje
									+ "*"
									+ Card_JiFenlv
									+ " ,card_leftjf=card_leftjf+"
									+ Card_Ssje
									+ "*"
									+ Card_JiFenlv
									+ " where  card_no='"
									+ Card_no + "'");
					Sql sql131 = Sqls
							.queryRecord("update kehu_card set card_jifen=Card_jifen+"
									+ Card_Ssje
									+ "*"
									+ Card_JiFenlv
									+ " ,card_leftjf=card_leftjf+"
									+ Card_Ssje
									+ "*"
									+ Card_JiFenlv
									+ " where  card_no='"
									+ Card_no + "'");
					dao.execute(sql131);
				} else {
					System.out.println("4******************************"+"update kehu_card set card_jifen=Card_jifen+"
							+ cardjifen
							+ ",  card_leftjf=card_leftjf+"
							+ cardjifen
							+ "  where card_no='"
							+ Card_no
							+ "'");
					Sql sql131 = Sqls
							.queryRecord("update kehu_card set card_jifen=Card_jifen+"
									+ cardjifen
									+ ",  card_leftjf=card_leftjf+"
									+ cardjifen
									+ "  where card_no='"
									+ Card_no
									+ "'");
					dao.execute(sql131);

				}
			}
			
			return jsons.json(1, 1, 1, "\"结算完成\"");
		}
		return jsons.json(1, 1, 0, "\"操作员不存在\"");
	}

这个也有打印的功能但是我看不出来 大佬给看看 我这要做一个打印的接口 听说复制其中的就行但是他们也不知道是复制哪段

打印是那一段开始的

你们这样直接把参数拼入SQL,就不担心被注入吗?

这是外包做的我们这变刚接手

添加回复
请先登陆
回到顶部