|
|
@@ -12,8 +12,10 @@ import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
+import org.jeecg.modules.hlwaccount.entity.HlwCompany;
|
|
|
import org.jeecg.modules.hlwaccount.entity.HlwCompanyInvoiceInformation;
|
|
|
import org.jeecg.modules.hlwaccount.service.IHlwCompanyInvoiceInformationService;
|
|
|
+import org.jeecg.modules.hlwaccount.service.IHlwCompanyService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
@@ -37,15 +39,17 @@ import java.util.List;
|
|
|
public class HlwCompanyInvoiceInformationApiController extends JeecgController<HlwCompanyInvoiceInformation, IHlwCompanyInvoiceInformationService> {
|
|
|
@Autowired
|
|
|
private IHlwCompanyInvoiceInformationService hlwCompanyInvoiceInformationService;
|
|
|
+ @Autowired
|
|
|
+ private IHlwCompanyService hlwCompanyService;
|
|
|
|
|
|
/**
|
|
|
- * 已开票列表
|
|
|
+ * 开票资料列表
|
|
|
*
|
|
|
* @param jsonObject
|
|
|
* @return
|
|
|
*/
|
|
|
- @AutoLog(value = "已开票列表")
|
|
|
- @ApiOperation(value = "已开票列表", notes = "已开票列表")
|
|
|
+ @AutoLog(value = "开票资料列表")
|
|
|
+ @ApiOperation(value = "开票资料列表", notes = "开票资料列表")
|
|
|
@PostMapping(value = "/list")
|
|
|
public Result<?> list(@RequestBody JSONObject jsonObject) {
|
|
|
Integer applicationId = jsonObject.getInteger("applicationId");
|
|
|
@@ -63,4 +67,33 @@ public class HlwCompanyInvoiceInformationApiController extends JeecgController<H
|
|
|
return Result.ok(pageList);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 新增开票资料
|
|
|
+ *
|
|
|
+ * @param jsonObject
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "新增开票资料")
|
|
|
+ @ApiOperation(value = "新增开票资料", notes = "新增开票资料")
|
|
|
+ @PostMapping(value = "/add")
|
|
|
+ public Result<?> add(@RequestBody JSONObject jsonObject) {
|
|
|
+ Integer applicationId = jsonObject.getInteger("applicationId");
|
|
|
+ //获取请求参数
|
|
|
+ String companyCode = jsonObject.getString("companyCode");
|
|
|
+ QueryWrapper queryWrapper=new QueryWrapper();
|
|
|
+ queryWrapper.eq("company_code",companyCode);
|
|
|
+ HlwCompany hlwCompany=hlwCompanyService.getOne(queryWrapper);
|
|
|
+ QueryWrapper queryWrapper1=new QueryWrapper();
|
|
|
+ queryWrapper1.eq("company_id",hlwCompany.getId());
|
|
|
+ if(hlwCompanyInvoiceInformationService.getOne(queryWrapper1)!=null){
|
|
|
+ return Result.error("企业已存在开票资料");
|
|
|
+ }
|
|
|
+ HlwCompanyInvoiceInformation hlwCompanyInvoiceInformation=jsonObject.toJavaObject(HlwCompanyInvoiceInformation.class);
|
|
|
+ hlwCompanyInvoiceInformation.setUpdateBy(hlwCompanyInvoiceInformation.getCreateBy());
|
|
|
+ hlwCompanyInvoiceInformation.setCompanyId(hlwCompany.getId());
|
|
|
+ hlwCompanyInvoiceInformationService.save(hlwCompanyInvoiceInformation);
|
|
|
+ return Result.ok("新增开票资料成功");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|