|
|
|
@ -1,8 +1,12 @@
|
|
|
|
|
package weaver.formmode.customjavacode.modeexpand;
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
import com.engine.common.util.DbTools;
|
|
|
|
|
import com.engine.common.util.ParamUtil;
|
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
|
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
import weaver.hrm.User;
|
|
|
|
@ -30,6 +34,7 @@ public class DeleteCheckCalendar extends AbstractModeExpandJavaCodeNew {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public Map<String, String> doModeExpand(Map<String, Object> param) {
|
|
|
|
|
|
|
|
|
|
Map<String, String> result = new HashMap<String, String>();
|
|
|
|
|
try {
|
|
|
|
|
User user = (User)param.get("user");
|
|
|
|
@ -40,13 +45,21 @@ public class DeleteCheckCalendar extends AbstractModeExpandJavaCodeNew {
|
|
|
|
|
billid = Util.getIntValue(requestInfo.getRequestid());
|
|
|
|
|
modeid = Util.getIntValue(requestInfo.getWorkflowid());
|
|
|
|
|
if(billid > 0 && modeid > 0){
|
|
|
|
|
//------请在下面编写业务逻辑代码------
|
|
|
|
|
String sql = "select count(id) refcount from uf_jcl_kq_glpb where qyrl = "+billid;
|
|
|
|
|
List<Map<String,Object>> calendarList = DbTools.getSqlToList(sql);
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
if (Integer.parseInt(calendarList.get(0).get("refcount").toString())==0){
|
|
|
|
|
//result.put("errmsg","企业日历id="+billid+" 没有被规律排班引用,可以放心删除");
|
|
|
|
|
result.put("flag", "true");
|
|
|
|
|
rs.writeLog("企业日历id="+billid+" 没有被规律排班引用,可以放心删除");
|
|
|
|
|
}else {
|
|
|
|
|
result.put("errmsg", "企业日历id="+billid+" 有被【"+calendarList.get(0).get("refcount")+"】个规律排班引用,不能删除");
|
|
|
|
|
result.put("flag", "false");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
result.put("errmsg","测试删除校验逻辑撰写");
|
|
|
|
|
result.put("flag", "false");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
result.put("errmsg","自定义出错信息");
|
|
|
|
|
result.put("errmsg","删除逻辑校验失败");
|
|
|
|
|
result.put("flag", "false");
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|