职等职级 实体类 查询接口
parent
af42fe2e12
commit
276247c161
@ -1,16 +0,0 @@
|
||||
package com.engine.organization.biz;
|
||||
|
||||
import com.engine.organization.entity.scheme.param.SchemeSearchParam;
|
||||
import com.engine.organization.entity.scheme.po.SchemePO;
|
||||
import com.engine.organization.mapper.scheme.SchemeMapper;
|
||||
import com.engine.organization.util.page.PageInfo;
|
||||
import com.engine.organization.util.page.PageUtil;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SchemeBiz {
|
||||
|
||||
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
package com.engine.organization.cmd.scheme;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.organization.component.OrganizationWeaTable;
|
||||
import com.engine.organization.entity.scheme.vo.SchemeTableVO;
|
||||
import com.engine.organization.util.db.DBType;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*查询职等职级列表
|
||||
*/
|
||||
public class SchemeListCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public SchemeListCmd(Map<String, Object> params, User user) {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
OrganizationWeaTable<SchemeTableVO> table = new OrganizationWeaTable<>(user,SchemeTableVO.class);
|
||||
|
||||
String sqlWhere = buildSqlWhere(params);
|
||||
table.setSqlwhere(sqlWhere);
|
||||
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
return result.getResultMap();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询条件
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
private String buildSqlWhere(Map<String, Object> params) {
|
||||
DBType dbType = DBType.get(new RecordSet().getDBType());
|
||||
String sqlWhere = " where delete_type ='0' ";
|
||||
String name = (String) params.get("name");
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
sqlWhere += " AND scheme_name " + dbType.like(name);
|
||||
}
|
||||
String no = (String) params.get("no");
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
sqlWhere += " AND scheme_no " + dbType.like(no);
|
||||
}
|
||||
return sqlWhere;
|
||||
}
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
package com.engine.organization.cmd.scheme;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.organization.entity.scheme.po.SchemePO;
|
||||
import com.engine.organization.exception.OrganizationRunTimeException;
|
||||
import com.engine.organization.mapper.scheme.SchemeMapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class SchemeSaveCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public SchemeSaveCmd(Map<String, Object> params, User user) {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>(16);
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SchemeMapper mapper = sqlSession.getMapper(SchemeMapper.class);
|
||||
|
||||
List<SchemePO> list = mapper.listByNo(Util.null2String(this.params.get("scheme_no")));
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
throw new OrganizationRunTimeException("编号不允许重复");
|
||||
}
|
||||
|
||||
SchemePO schemePO = SchemePO.convertToPO(params, (long) user.getUID());
|
||||
mapper.insertIgnoreNull(schemePO);
|
||||
|
||||
sqlSession.commit();
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue