Commit db134027 by wancheng

Merge remote-tracking branch 'origin/dev' into dev

parents 74eadc32 6038b534
...@@ -12,7 +12,6 @@ import com.baosight.hggp.util.AssertUtils; ...@@ -12,7 +12,6 @@ import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.DateUtils; import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo; import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
...@@ -113,7 +112,6 @@ public class ServiceHGPZ009 extends ServiceBase { ...@@ -113,7 +112,6 @@ public class ServiceHGPZ009 extends ServiceBase {
* @param resultRows * @param resultRows
*/ */
private void checkSaveData(List<Map> resultRows) { private void checkSaveData(List<Map> resultRows) {
// 数据校验
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HGPZ009 fPz009 = new HGPZ009(); HGPZ009 fPz009 = new HGPZ009();
fPz009.fromMap(resultRows.get(i)); fPz009.fromMap(resultRows.get(i));
...@@ -158,34 +156,6 @@ public class ServiceHGPZ009 extends ServiceBase { ...@@ -158,34 +156,6 @@ public class ServiceHGPZ009 extends ServiceBase {
} }
/** /**
* 新增操作.
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "配置管理", operType = "新增", operDesc = "新增")
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HGPZ009 fPz009 = new HGPZ009();
fPz009.fromMap(resultRows.get(i));
this.add(fPz009);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 用户关联角色 * 用户关联角色
* *
* @param hgpz009 * @param hgpz009
...@@ -196,7 +166,7 @@ public class ServiceHGPZ009 extends ServiceBase { ...@@ -196,7 +166,7 @@ public class ServiceHGPZ009 extends ServiceBase {
inInfoRowMap.put("memberId", userId); inInfoRowMap.put("memberId", userId);
inInfoRowMap.put("memberName", hgpz009.getAccountName()); inInfoRowMap.put("memberName", hgpz009.getAccountName());
// TODO 该用户组固定不能修改,代码中其他地方有写死的地方 // TODO 该用户组固定不能修改,代码中其他地方有写死的地方
inInfoRowMap.put("parentId", "companyManage"); inInfoRowMap.put("parentId", CommonConstant.Field.COMPANY_MANAGE);
inInfoRowMap.put("parentName", "企业管理员"); inInfoRowMap.put("parentName", "企业管理员");
inInfoRowMap.put("memberType", "USER"); inInfoRowMap.put("memberType", "USER");
EiInfo inInfo = new EiInfo(); EiInfo inInfo = new EiInfo();
...@@ -215,7 +185,6 @@ public class ServiceHGPZ009 extends ServiceBase { ...@@ -215,7 +185,6 @@ public class ServiceHGPZ009 extends ServiceBase {
* @param fPz009 * @param fPz009
*/ */
private void insertOrg(HGPZ009 fPz009) { private void insertOrg(HGPZ009 fPz009) {
List<Map> newRows = new ArrayList<>();
Map row = new HashMap(); Map row = new HashMap();
row.put("orgId", fPz009.getAccountCode()); row.put("orgId", fPz009.getAccountCode());
row.put("orgEname", fPz009.getAccountCode()); row.put("orgEname", fPz009.getAccountCode());
...@@ -229,6 +198,7 @@ public class ServiceHGPZ009 extends ServiceBase { ...@@ -229,6 +198,7 @@ public class ServiceHGPZ009 extends ServiceBase {
row.put("factoryName", ""); row.put("factoryName", "");
row.put("companyCode", fPz009.getAccountCode()); row.put("companyCode", fPz009.getAccountCode());
row.put("companyName", fPz009.getAccountName()); row.put("companyName", fPz009.getAccountName());
List<Map> newRows = new ArrayList<>();
newRows.add(row); newRows.add(row);
EiInfo call = new EiInfo(); EiInfo call = new EiInfo();
call.set("list", newRows); call.set("list", newRows);
...@@ -240,32 +210,6 @@ public class ServiceHGPZ009 extends ServiceBase { ...@@ -240,32 +210,6 @@ public class ServiceHGPZ009 extends ServiceBase {
} }
/** /**
* 修改操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "企业管理", operType = "修改", operDesc = "修改操作")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
for (int i = 0; i < resultRows.size(); i++) {
HGPZ009 hppz009 = new HGPZ009();
hppz009.fromMap(resultRows.get(i));
DaoUtils.update(HGPZ009.UPDATE, hppz009);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
* 删除操作 * 删除操作
* *
* @param inInfo * @param inInfo
......
...@@ -200,9 +200,10 @@ public class SqlMapDaoLogProxy extends SqlMapDao { ...@@ -200,9 +200,10 @@ public class SqlMapDaoLogProxy extends SqlMapDao {
* @param parameters * @param parameters
*/ */
private void setDataAuth(String name, Object parameters) { private void setDataAuth(String name, Object parameters) {
// 需要过滤部分sql name,否则会形成死循环 // 需要过滤部分sql name,否则会形成死循环;admin账户不需要校验
String loginName = UserSessionUtils.getLoginName();
String[] serviceFilter = {"HGXSUser", "HGXSOrg", "HGXSUserGroup", "HGPZ009.query", "HGPZ010.query"}; String[] serviceFilter = {"HGXSUser", "HGXSOrg", "HGXSUserGroup", "HGPZ009.query", "HGPZ010.query"};
if (StringUtils.startsWithAny(name, serviceFilter)) { if (StringUtils.startsWithAny(name, serviceFilter) || "admin".equalsIgnoreCase(loginName)) {
return; return;
} }
// 是否启用数据权限 // 是否启用数据权限
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment