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")
|
@PostMapping(value="/editBatch")
|
||||||
public Result<?> editBatch(@RequestBody ProductsParam productsParam) {
|
public Result<?> editBatch(@RequestBody ProductsParam productsParam) {
|
||||||
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
List<Product> products = new ArrayList<>();
|
List<Product> products = new ArrayList<>();
|
||||||
for(String id : productsParam.getIds()) {
|
for(String id : productsParam.getIds()) {
|
||||||
Product product = new Product();
|
Product product = new Product();
|
||||||
product.setId(id);
|
product.setId(id);
|
||||||
product.setWeight(productsParam.getWeight());
|
product.setWeight(productsParam.getWeight());
|
||||||
|
product.setUpdateBy(sysUser.getUsername());
|
||||||
products.add(product);
|
products.add(product);
|
||||||
}
|
}
|
||||||
productService.updateWeightBatch(products);
|
productService.updateWeightBatch(products);
|
||||||
|
|
|
@ -8,6 +8,11 @@
|
||||||
<foreach collection="products" separator=" " open="" close="" index="index" item="item">
|
<foreach collection="products" separator=" " open="" close="" index="index" item="item">
|
||||||
when #{item.id} then #{item.weight}
|
when #{item.id} then #{item.weight}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
end,
|
||||||
|
update_by = case id
|
||||||
|
<foreach collection="products" separator=" " open="" close="" index="index" item="item">
|
||||||
|
when #{item.id} then #{item.updateBy}
|
||||||
|
</foreach>
|
||||||
end
|
end
|
||||||
where id in
|
where id in
|
||||||
<foreach collection="products" separator="," open="(" close=")" index="index" item="item">
|
<foreach collection="products" separator="," open="(" close=")" index="index" item="item">
|
||||||
|
|
Loading…
Reference in New Issue