Commit 47f779ab by 吴迪

修改

parent 048b8b2c
package io.office.modules.manage.controller; package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.shiro.authz.annotation.RequiresPermissions; import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
import io.office.modules.manage.entity.PlanBranchEntity;
import io.office.modules.manage.service.PlanBranchService;
import io.office.modules.manage.vo.request.PlanBranchVo;
import io.office.modules.sys.controller.AbstractController;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import io.office.modules.manage.entity.PlanBranchEntity; import java.util.Arrays;
import io.office.modules.manage.service.PlanBranchService; import java.util.Map;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
/** /**
...@@ -28,7 +26,7 @@ import io.office.common.utils.R; ...@@ -28,7 +26,7 @@ import io.office.common.utils.R;
*/ */
@RestController @RestController
@RequestMapping("/planbranch") @RequestMapping("/planbranch")
public class PlanBranchController { public class PlanBranchController extends AbstractController {
@Autowired @Autowired
private PlanBranchService planBranchService; private PlanBranchService planBranchService;
...@@ -104,4 +102,16 @@ public class PlanBranchController { ...@@ -104,4 +102,16 @@ public class PlanBranchController {
@RequestMapping("/batchUpdateStatus")
// @RequiresPermissions("manage:planbranch:delete")
public R batchUpdateStatus(@RequestBody PlanBranchVo planBranchVo){
planBranchService.batchUpdateStatus(planBranchVo,getUser());
return R.ok();
}
} }
package io.office.modules.manage.dao; package io.office.modules.manage.dao;
import io.office.modules.manage.entity.PlanBranchEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.office.modules.manage.entity.PlanBranchEntity;
import io.office.modules.manage.vo.request.PlanBranchVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
/** /**
...@@ -14,4 +15,5 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -14,4 +15,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface PlanBranchDao extends BaseMapper<PlanBranchEntity> { public interface PlanBranchDao extends BaseMapper<PlanBranchEntity> {
void batchUpdateStatus(PlanBranchVo planBranchVo);
} }
...@@ -3,6 +3,8 @@ package io.office.modules.manage.service; ...@@ -3,6 +3,8 @@ package io.office.modules.manage.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils; import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.PlanBranchEntity; import io.office.modules.manage.entity.PlanBranchEntity;
import io.office.modules.manage.vo.request.PlanBranchVo;
import io.office.modules.sys.entity.SysUserEntity;
import java.util.Map; import java.util.Map;
...@@ -16,5 +18,7 @@ import java.util.Map; ...@@ -16,5 +18,7 @@ import java.util.Map;
public interface PlanBranchService extends IService<PlanBranchEntity> { public interface PlanBranchService extends IService<PlanBranchEntity> {
PageUtils queryPage(Map<String, Object> params); PageUtils queryPage(Map<String, Object> params);
void batchUpdateStatus(PlanBranchVo planBranchVo, SysUserEntity user);
} }
package io.office.modules.manage.service.impl; package io.office.modules.manage.service.impl;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.utils.PageUtils; import io.office.common.utils.PageUtils;
import io.office.common.utils.Query; import io.office.common.utils.Query;
import io.office.modules.manage.dao.PlanBranchDao; import io.office.modules.manage.dao.PlanBranchDao;
import io.office.modules.manage.entity.PlanBranchEntity; import io.office.modules.manage.entity.PlanBranchEntity;
import io.office.modules.manage.service.PlanBranchService; import io.office.modules.manage.service.PlanBranchService;
import io.office.modules.manage.vo.request.PlanBranchVo;
import io.office.modules.sys.entity.SysUserEntity;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.Map;
@Service("planBranchService") @Service("planBranchService")
...@@ -28,4 +31,12 @@ public class PlanBranchServiceImpl extends ServiceImpl<PlanBranchDao, PlanBranch ...@@ -28,4 +31,12 @@ public class PlanBranchServiceImpl extends ServiceImpl<PlanBranchDao, PlanBranch
return new PageUtils(page); return new PageUtils(page);
} }
@Override
public void batchUpdateStatus(PlanBranchVo planBranchVo, SysUserEntity user) {
planBranchVo.setLasteditor(user.getUsername());
planBranchVo.setUpdatetime(new Date());
baseMapper.batchUpdateStatus(planBranchVo);
}
} }
\ No newline at end of file
package io.office.modules.manage.vo.request;
import io.office.modules.manage.entity.PlanBranchEntity;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
*
* 
 @description:
*
* @author wudi
* @date 21:05 2022/5/5
*/
@Data
public class PlanBranchVo extends PlanBranchEntity implements Serializable {
private List<String> ids;
}
...@@ -18,4 +18,36 @@ ...@@ -18,4 +18,36 @@
</resultMap> </resultMap>
<update id="batchUpdateStatus" parameterType="io.office.modules.manage.vo.request.PlanBranchVo">
update Plan_branch set updatetime = #{updatetime}
<if test="state!=null and state!=''">
, state =#{state}
</if>
<if test="lasteditor!=null and lasteditor!=''">
, lasteditor =#{lasteditor}
</if>
<if test="ppath!=null">
, ppath =#{ppath}
</if>
<if test="checkflag!=null and checkflag!=''">
, checkflag =#{checkflag}
</if>
<where>
<if test="ids!=null and ids.size>0">
id in(
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</if>
</where>
</update>
</mapper> </mapper>
\ 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