mirror of https://github.com/jeecgboot/jeecg-boot
update by is now updated
parent
255e304fd3
commit
7ac881f83c
1100
hs_err_pid12060.log
1100
hs_err_pid12060.log
File diff suppressed because one or more lines are too long
|
@ -263,11 +263,13 @@ public class ProductController {
|
|||
|
||||
@PostMapping(value="/editBatch")
|
||||
public Result<?> editBatch(@RequestBody ProductsParam productsParam) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
List<Product> products = new ArrayList<>();
|
||||
for(String id : productsParam.getIds()) {
|
||||
Product product = new Product();
|
||||
product.setId(id);
|
||||
product.setWeight(productsParam.getWeight());
|
||||
product.setUpdateBy(sysUser.getUsername());
|
||||
products.add(product);
|
||||
}
|
||||
productService.updateWeightBatch(products);
|
||||
|
|
|
@ -8,6 +8,11 @@
|
|||
<foreach collection="products" separator=" " open="" close="" index="index" item="item">
|
||||
when #{item.id} then #{item.weight}
|
||||
</foreach>
|
||||
end,
|
||||
update_by = case id
|
||||
<foreach collection="products" separator=" " open="" close="" index="index" item="item">
|
||||
when #{item.id} then #{item.updateBy}
|
||||
</foreach>
|
||||
end
|
||||
where id in
|
||||
<foreach collection="products" separator="," open="(" close=")" index="index" item="item">
|
||||
|
|
Loading…
Reference in New Issue