| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- package xin.glue.nui.G.G02;
- import com.posdata.glue.PosException;
- import com.posdata.glue.biz.constants.PosBizControlConstants;
- import com.posdata.glue.biz.control.PosBizControlIF;
- import com.posdata.glue.biz.control.PosBizProvider;
- import com.posdata.glue.context.PosContext;
- import com.posdata.glue.dao.PosGenericDao;
- import com.posdata.glue.dao.vo.PosParameter;
- import com.posdata.glue.dao.vo.PosRow;
- import com.posdata.glue.dao.vo.PosRowSet;
- import com.posdata.glue.msg.PosMESMessageImpl;
- import com.posdata.glue.msg.PosMessage;
- import com.posdata.glue.scheduling.PosQuartzJobBean;
- import com.posdata.glue.transaction.PosTransactionManager;
- import com.posdata.glue.util.log.PosLog;
- import com.posdata.glue.util.log.PosLogFactory;
- import org.quartz.JobExecutionContext;
- public class SMSDailyProduct extends PosQuartzJobBean {
- protected PosGenericDao dao = (PosGenericDao)
- PosContext.getBeanFactory().getBeanObject("mesdao");
- private PosTransactionManager transaction =
- (PosTransactionManager) PosContext.getBeanFactory().getBeanObject("tx1");
- protected PosLog log = PosLogFactory.getLogger(getClass());
-
- protected void executeJob(JobExecutionContext arg0)
- {
-
- log.logInfo("SMSDailyProduct executeJob start " );
-
- PosRowSet RepChVO = dao.find("UIG020210_DAILY_CH.select" );
-
-
- while(RepChVO.hasNext()) {
- PosRow RepChROW = RepChVO.next();
-
- String PRODNM_CD = (String)RepChROW.getAttribute("PRODNM_CD");
- String DAY_CH_CNT = (String)RepChROW.getAttribute("DAY_CH_CNT");
- String DAY_CH_WGT = (String)RepChROW.getAttribute("DAY_CH_WGT");
-
- PosParameter param1 = new PosParameter();
- param1.setValueParamter(0,PRODNM_CD );
- PosRowSet RepExistVO = dao.find("UIG020210_CH_EXIST.select",param1 );
-
- if (RepExistVO.hasNext()) {
- PosRow RepExistROW = RepExistVO.next();
-
- PosParameter param2 = new PosParameter();
- param2.setValueParamter(0,DAY_CH_CNT );
- param2.setValueParamter(1,DAY_CH_WGT );
- param2.setValueParamter(2,PRODNM_CD );
-
- dao.update("UIG020210_DAILY_CH.update",param2);
-
-
- } else {
- PosParameter param2 = new PosParameter();
- param2.setValueParamter(0,PRODNM_CD );
- param2.setValueParamter(1,DAY_CH_CNT );
- param2.setValueParamter(2,DAY_CH_WGT );
- dao.update("UIG020210_DAILY_CH.insert",param2);
- }
-
-
- }
-
-
- PosRowSet RepSlabVO = dao.find("UIG020210_DAILY_SLAB.select" );
-
- while(RepSlabVO.hasNext()) {
- PosRow RepSlabROW = RepSlabVO.next();
- String SLAB_RT = (String)RepSlabROW.getAttribute("SLAB_RT");
- String DAY_SLAB_CNT = (String)RepSlabROW.getAttribute("DAY_SLAB_CNT");
- String DAY_SLAB_WGT = (String)RepSlabROW.getAttribute("DAY_SLAB_WGT");
-
- PosParameter param3 = new PosParameter();
- param3.setValueParamter(0,SLAB_RT );
- PosRowSet RepExistVO = dao.find("UIG020210_CH_EXIST.select",param3 );
-
- if (RepExistVO.hasNext()) {
- PosRow RepExistROW = RepExistVO.next();
-
- PosParameter param4 = new PosParameter();
- param4.setValueParamter(0,DAY_SLAB_WGT );
- param4.setValueParamter(1,SLAB_RT );
-
- dao.update("UIG020210_DAILY_SLAB.update",param4);
-
-
- } else {
- PosParameter param4 = new PosParameter();
- param4.setValueParamter(0,SLAB_RT );
- param4.setValueParamter(1,DAY_SLAB_WGT );
- dao.update("UIG020210_DAILY_SLAB.insert",param4);
- }
-
- }
-
- PosRowSet RepTrbVO = dao.find("UIG020210_DAILY_TRB.select" );
- while(RepTrbVO.hasNext()) {
- PosRow RepTrbROW = RepTrbVO.next();
- String RST_CHEM_TRB_CNT = (String)RepTrbROW.getAttribute("RST_CHEM_TRB_CNT");
- String RST_CHEM_TRB_QTY = (String)RepTrbROW.getAttribute("RST_CHEM_TRB_QTY");
- String RST_NONORD_CNT = (String)RepTrbROW.getAttribute("RST_NONORD_CNT");
- String RST_NONORD_QTY = (String)RepTrbROW.getAttribute("RST_NONORD_QTY");
- String RST_QLTY_TRB_CNT = (String)RepTrbROW.getAttribute("RST_QLTY_TRB_CNT");
- String RST_QLTY_TRB_QTY = (String)RepTrbROW.getAttribute("RST_QLTY_TRB_QTY");
- String RST_PRT_SCR_QTY = (String)RepTrbROW.getAttribute("RST_PRT_SCR_QTY");
- String RST_ALL_SCR_QTY = (String)RepTrbROW.getAttribute("RST_ALL_SCR_QTY");
-
- PosParameter param5 = new PosParameter();
- param5.setValueParamter(0,"N" );
- PosRowSet RepExistVO = dao.find("UIG020210_CH_EXIST.select",param5 );
-
- if (RepExistVO.hasNext()) {
- PosRow RepExistROW = RepExistVO.next();
-
- PosParameter param6 = new PosParameter();
- param6.setValueParamter(0,RST_NONORD_CNT );
- param6.setValueParamter(1,RST_NONORD_QTY );
- param6.setValueParamter(2,RST_CHEM_TRB_CNT );
- param6.setValueParamter(3,RST_CHEM_TRB_QTY );
- param6.setValueParamter(4,RST_QLTY_TRB_CNT );
- param6.setValueParamter(5,RST_QLTY_TRB_QTY );
- param6.setValueParamter(6,RST_PRT_SCR_QTY );
- param6.setValueParamter(7,RST_ALL_SCR_QTY );
-
- dao.update("UIG020210_DAILY_TRB.update",param6);
-
-
- } else {
- PosParameter param6 = new PosParameter();
- param6.setValueParamter(0,RST_NONORD_CNT );
- param6.setValueParamter(1,RST_NONORD_QTY );
- param6.setValueParamter(2,RST_CHEM_TRB_CNT );
- param6.setValueParamter(3,RST_CHEM_TRB_QTY );
- param6.setValueParamter(4,RST_QLTY_TRB_CNT );
- param6.setValueParamter(5,RST_QLTY_TRB_QTY );
- param6.setValueParamter(6,RST_PRT_SCR_QTY );
- param6.setValueParamter(7,RST_ALL_SCR_QTY );
- dao.update("UIG020210_DAILY_TRB.insert",param6);
- }
-
- }
- log.logInfo("SMSDailyProduct END " );
-
- }
-
- }
|