update by is now updated

pull/6221/head
Gauthier LO 2023-08-04 15:02:30 +02:00
parent 255e304fd3
commit 7ac881f83c
3 changed files with 7 additions and 1100 deletions

File diff suppressed because one or more lines are too long

View File

@ -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);

View File

@ -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">