|
|
|
@ -15,6 +15,7 @@ import com.alibaba.excel.EasyExcel;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import liquibase.pro.packaged.A;
|
|
|
|
|
import me.zhyd.oauth.log.Log;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
@ -83,6 +84,23 @@ public class InvoicesController {
|
|
|
|
|
return success(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PutMapping("/update/array")
|
|
|
|
|
@Operation(summary = "更新发票")
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('accounting:invoices:update')")
|
|
|
|
|
public CommonResult<Boolean> updateInvoicesArray(@Valid @RequestBody InvoicesUpdateArray updateArray) {
|
|
|
|
|
List<InvoicesDO> list = new LinkedList<>();
|
|
|
|
|
List<InvoicesDO> invoicesList = invoicesService.getInvoicesList(Arrays.asList(updateArray.getId()));
|
|
|
|
|
for (InvoicesDO in : invoicesList) {
|
|
|
|
|
if (in.getVoucherId() !=null){
|
|
|
|
|
return error(in.getVoucherId()+":该发票已被关联");
|
|
|
|
|
}
|
|
|
|
|
in.setVoucherId(updateArray.getVoucherId());
|
|
|
|
|
list.add(in);
|
|
|
|
|
}
|
|
|
|
|
invoicesService.updateInvoicesArray(list);
|
|
|
|
|
return success(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@DeleteMapping("/delete")
|
|
|
|
|
@Operation(summary = "删除发票")
|
|
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
|
|
|