Commit 37487322 authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents dbe6fe0e 22ffd63e
...@@ -27,38 +27,43 @@ import java.util.Map; ...@@ -27,38 +27,43 @@ import java.util.Map;
* @date 2019-06-03 15:57:13 * @date 2019-06-03 15:57:13
*/ */
@Service @Service
public class CofigBiz extends BaseBiz<CofigMapper,Cofig> { public class CofigBiz extends BaseBiz<CofigMapper, Cofig> {
public List<Cofig> getConfigByType(List<Integer> list){ public List<Cofig> getConfigByType(List<Integer> list) {
return mapper.getAllByType(list); Example example = new Example(Cofig.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("isDel", 0);
criteria.andIn("type", list);
return mapper.selectByExample(example);
} }
/** /**
* 修改配置 * 修改配置
*
* @param cofig * @param cofig
* @return * @return
*/ */
@CacheClear(pre = "app:withdrawrule{1.type}") @CacheClear(pre = "app:withdrawrule{1.type}")
public int updateConfig(Cofig cofig) { public int updateConfig(Cofig cofig) {
EntityUtils.setUpdatedInfo(cofig); EntityUtils.setUpdatedInfo(cofig);
return mapper.updateByPrimaryKeySelective(cofig); return mapper.updateByPrimaryKeySelective(cofig);
} }
@Cache(key = "app:withdrawrule:88") @Cache(key = "app:withdrawrule:88")
public WithDrawRuleVo getWithDrawRule(){ public WithDrawRuleVo getWithDrawRule() {
WithDrawRuleVo withDrawRuleVo = new WithDrawRuleVo(); WithDrawRuleVo withDrawRuleVo = new WithDrawRuleVo();
Example example = new Example(Cofig.class); Example example = new Example(Cofig.class);
Example.Criteria criteria = example.createCriteria(); Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("type",88); criteria.andEqualTo("type", 88);
List<Cofig> cofigs = mapper.selectByExample(example); List<Cofig> cofigs = mapper.selectByExample(example);
if (CollectionUtils.isEmpty(cofigs)){ if (CollectionUtils.isEmpty(cofigs)) {
return withDrawRuleVo; return withDrawRuleVo;
} }
Cofig cofig = cofigs.get(0); Cofig cofig = cofigs.get(0);
withDrawRuleVo = JSON.parseObject(cofig.getParams(),WithDrawRuleVo.class); withDrawRuleVo = JSON.parseObject(cofig.getParams(), WithDrawRuleVo.class);
withDrawRuleVo.setDescription(cofig.getValue()); withDrawRuleVo.setDescription(cofig.getValue());
return withDrawRuleVo; return withDrawRuleVo;
} }
public void updateConfigStatus(int id) { public void updateConfigStatus(int id) {
...@@ -72,10 +77,10 @@ public class CofigBiz extends BaseBiz<CofigMapper,Cofig> { ...@@ -72,10 +77,10 @@ public class CofigBiz extends BaseBiz<CofigMapper,Cofig> {
Query query = new Query(params); Query query = new Query(params);
Example example = new Example(Cofig.class); Example example = new Example(Cofig.class);
Example.Criteria criteria = example.createCriteria(); Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("isDel",0); criteria.andEqualTo("isDel", 0);
PageDataVO<Cofig> cofigPage = PageDataVO.pageInfo(query.getPage(), query.getLimit(), () -> mapper.selectByExample(example)); PageDataVO<Cofig> cofigPage = PageDataVO.pageInfo(query.getPage(), query.getLimit(), () -> mapper.selectByExample(example));
return new TableResultResponse<>(cofigPage.getTotalCount(),cofigPage.getData()) ; return new TableResultResponse<>(cofigPage.getTotalCount(), cofigPage.getData());
} }
} }
\ No newline at end of file
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