拦截-- 24小时制班次处理
parent
07303d2f80
commit
6845cc6198
@ -1,4 +0,0 @@
|
|||||||
package com.api.scxg.controller;
|
|
||||||
|
|
||||||
public class testController {
|
|
||||||
}
|
|
@ -0,0 +1,75 @@
|
|||||||
|
package com.customization.csxg;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.api.browser.bean.SearchConditionItem;
|
||||||
|
import com.engine.core.cfg.annotation.CommandDynamicProxy;
|
||||||
|
import com.engine.core.interceptor.AbstractCommandProxy;
|
||||||
|
import com.engine.core.interceptor.Command;
|
||||||
|
import com.engine.kq.cmd.shiftmanagement.GetShiftManagementBaseFormCmd;
|
||||||
|
import com.engine.kq.cmd.shiftmanagement.SaveShiftManagementBaseFormCmd;
|
||||||
|
import org.apache.tika.utils.StringUtils;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.general.BaseBean;
|
||||||
|
import weaver.general.Util;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static com.api.browser.util.ConditionType.CHECKBOX;
|
||||||
|
|
||||||
|
@CommandDynamicProxy(target = SaveShiftManagementBaseFormCmd.class )
|
||||||
|
public class SaveShiftManagementBaseFormCmdIntercept extends AbstractCommandProxy<Map<String,Object>> {
|
||||||
|
|
||||||
|
BaseBean basebean = new BaseBean();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> execute(Command<Map<String, Object>> command) {
|
||||||
|
|
||||||
|
basebean.writeLog("-----SaveShiftManagementBaseFormCmdIntercept Start-----");
|
||||||
|
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
|
||||||
|
SaveShiftManagementBaseFormCmd cmd = (SaveShiftManagementBaseFormCmd) command;
|
||||||
|
Map<String, Object> params = cmd.getParams();
|
||||||
|
basebean.writeLog("params: " + params);
|
||||||
|
|
||||||
|
Map<String, Object> result = nextExecute(cmd);
|
||||||
|
basebean.writeLog("result: " + result);
|
||||||
|
|
||||||
|
//增加对是否24小时制字段值的保存
|
||||||
|
Integer shifMaId = -1;
|
||||||
|
Integer status = Util.getIntValue(Util.null2String(result.get("status")));
|
||||||
|
basebean.writeLog("status: " + status);
|
||||||
|
|
||||||
|
if ( status != 1) {
|
||||||
|
shifMaId = Util.getIntValue(Util.null2String(result.get("id")));
|
||||||
|
}
|
||||||
|
basebean.writeLog("shifMaId: " + shifMaId);
|
||||||
|
|
||||||
|
if (shifMaId > 0 ) {
|
||||||
|
|
||||||
|
String datas = Util.null2String(params.get("data"));
|
||||||
|
basebean.writeLog("datas: " + datas);
|
||||||
|
|
||||||
|
JSONObject jsonObj = JSON.parseObject(datas);
|
||||||
|
Integer is24HourView = Util.getIntValue(Util.null2String(jsonObj.get("is24HourView")));
|
||||||
|
basebean.writeLog("is24HourView: " + is24HourView);
|
||||||
|
|
||||||
|
String syncIs24Sql = "update kq_ShiftManagement set is24HourView = ? where id = ? ";//同步是否24小时制字段值
|
||||||
|
if ( is24HourView ==-1 || is24HourView ==0) {//否
|
||||||
|
basebean.writeLog("is24HourView do 0 ");
|
||||||
|
rs.executeUpdate(syncIs24Sql,0,shifMaId);
|
||||||
|
} else {
|
||||||
|
basebean.writeLog("is24HourView do 1 ");
|
||||||
|
rs.executeUpdate(syncIs24Sql,1,shifMaId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
basebean.writeLog("-----SaveShiftManagementBaseFormCmdIntercept End-----");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue