| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- package xin.glue.ui.Z;
- import com.posdata.glue.biz.activity.PosActivity;
- import com.posdata.glue.biz.constants.PosBizControlConstants;
- 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;
- /**
- * 通过订单用途名称查询数据,判定是否存在该名称;防止重复名称录入
- * @author KangMiao
- * @Date 2015-6-19 上午09:30:01
- *
- */
- public class PosGetCDNM extends PosActivity {
- public String runActivity(PosContext context) {
- //订单用途代码
- String[] lmcd = (String[]) context.get("lmcd");
- // 订单用途名称
- String[] lmnm = (String[]) context.get("lmnm");
- PosGenericDao dao = this.getDao("mesdao");
- String retStr = "0"; //0表示不存在可以添加,1表示可以修改,2表示已存在该名称不能添加;
- PosParameter param = new PosParameter();
- param.setWhereClauseParameter(0, lmnm[0]);
- PosRowSet rowset = dao.find("UIZ010010.getCDNM.Select",param);
- PosRow row = null;
- if (rowset != null && rowset.count() > 0) {
- if(rowset.count() == 1) {
- try {
- if(rowset.hasNext()) {
- row = rowset.next();
- Object SM_CD = row.getAttribute("SM_CD"); //订单用途代码
- //Object SM_CFNM = row.getAttribute("SM_CFNM");
- if(null != SM_CD && !SM_CD.equals(lmcd[0])) {
- retStr = "2";
- }
- }
- } catch (Exception e) {
- // TODO: handle exception
- }
- } else {
- retStr = "2";
- }
- }
- context.put("returnInfoMsg", retStr);
- return PosBizControlConstants.SUCCESS;
- }
- }
|