935090232@qq.com
2022-02-22 bbe0a2fd03063316e50cf141986bda984599bbda
zq-erp/src/main/java/com/matrix/system/hiveErp/action/AchieveRuleAction.java
@@ -15,7 +15,6 @@
import com.matrix.system.hive.action.util.QueryUtil;
import com.matrix.system.hive.bean.AchieveRule;
import com.matrix.system.hive.dao.AchieveRuleDao;
import com.matrix.system.hive.plugin.util.CollectionUtils;
import com.matrix.system.hiveErp.pojo.AchieveRuleItem;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
@@ -46,11 +45,8 @@
    @PostMapping("/add")
    public AjaxResult add(@RequestBody @Validated AchieveRule achieveRule) {
        WebUtil.setSessionAttribute(MatrixConstance.LOGIN_KEY,sysUsersDao.selectById(2L));
        if(CollectionUtils.isEmpty(achieveRule.getRuleItemList())){
            return AjaxResult.buildFailInstance("规则设置不能为空");
        }
        String rules = JSONUtil.toJsonStr(achieveRule.getRuleItemList());
        achieveRule.setRules(rules);
@@ -72,14 +68,11 @@
     */
    @PostMapping("/update")
    public AjaxResult update(@RequestBody @Validated AchieveRule achieveRule) {
        WebUtil.setSessionAttribute(MatrixConstance.LOGIN_KEY,sysUsersDao.selectById(2L));
        if (achieveRule.getId() == null) {
            return AjaxResult.buildFailInstance("id不能为空");
        }
        if(CollectionUtils.isEmpty(achieveRule.getRuleItemList())){
            return AjaxResult.buildFailInstance("规则设置不能为空");
        }
        String rules = JSONUtil.toJsonStr(achieveRule.getRuleItemList());
        achieveRule.setRules(rules);
@@ -99,7 +92,7 @@
    @GetMapping("/removeById/{id}")
    public AjaxResult removeById(@PathVariable Long id) {
        achieveRuleDao.deleteById(id);
        return AjaxResult.buildFailInstance("删除成功");
        return AjaxResult.buildSuccessInstance("删除成功");
    }
@@ -110,8 +103,8 @@
     * @return
     */
    @PostMapping("/selectList")
    public AjaxResult removeById(@RequestBody BasePageQueryDto pageDto) {
        WebUtil.setSessionAttribute(MatrixConstance.LOGIN_KEY,sysUsersDao.selectById(2L));
    public AjaxResult selectList(@RequestBody BasePageQueryDto pageDto) {
        SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        Page<AchieveRule> page = new Page<>(pageDto.getPageNum(), pageDto.getPageSize());
        LambdaQueryWrapper<AchieveRule> lambdaQueryWrapper = new LambdaQueryWrapper<AchieveRule>()
@@ -129,5 +122,8 @@
        return result;
    }
    @PostMapping("/selectListForm")
    public AjaxResult selectListForm(BasePageQueryDto pageDto) {
        return selectList(pageDto);
    }
}