|
|
|
@ -8,7 +8,9 @@ import com.engine.organization.entity.scheme.vo.SchemeTableVO;
|
|
|
|
|
import com.engine.organization.exception.OrganizationRunTimeException;
|
|
|
|
|
import com.engine.organization.mapper.scheme.SchemeMapper;
|
|
|
|
|
import com.engine.organization.service.SchemeService;
|
|
|
|
|
import com.engine.organization.util.OrganizationAssert;
|
|
|
|
|
import com.engine.organization.util.db.DBType;
|
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
|
import com.weaverboot.frame.ioc.anno.classAnno.WeaIocService;
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
@ -34,29 +36,21 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> save(Map<String, Object> params) {
|
|
|
|
|
Map<String, Object> apidatas = new HashMap<String, Object>(16);
|
|
|
|
|
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
|
|
|
|
try {
|
|
|
|
|
SchemeMapper mapper = sqlSession.getMapper(SchemeMapper.class);
|
|
|
|
|
|
|
|
|
|
SchemeMapper mapper = MapperProxyFactory.getProxy(SchemeMapper.class);
|
|
|
|
|
List<SchemePO> list = mapper.listByNo(Util.null2String(params.get("scheme_no")));
|
|
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
|
|
throw new OrganizationRunTimeException("编号不允许重复");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OrganizationAssert.notEmpty(list,"");
|
|
|
|
|
SchemePO schemePO = SchemePO.convertToPO(params, (long) user.getUID());
|
|
|
|
|
mapper.insertIgnoreNull(schemePO);
|
|
|
|
|
|
|
|
|
|
sqlSession.commit();
|
|
|
|
|
} finally {
|
|
|
|
|
sqlSession.close();
|
|
|
|
|
}
|
|
|
|
|
return apidatas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> listPage(Map<String, Object> params) {
|
|
|
|
|
OrganizationWeaTable<SchemeTableVO> table = new OrganizationWeaTable<>(user,SchemeTableVO.class);
|
|
|
|
|
OrganizationWeaTable<SchemeTableVO> table = new OrganizationWeaTable<>(user, SchemeTableVO.class);
|
|
|
|
|
|
|
|
|
|
String sqlWhere = buildSqlWhere(params);
|
|
|
|
|
table.setSqlwhere(sqlWhere);
|
|
|
|
@ -70,6 +64,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询条件
|
|
|
|
|
*
|
|
|
|
|
* @param params
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|