Pārlūkot izejas kodu

服务商配置—开票内容配置

ZhangWenQiang 3 gadi atpakaļ
vecāks
revīzija
55c6b7b20e
20 mainītis faili ar 961 papildinājumiem un 156 dzēšanām
  1. 135 35
      happy-cloud-system/happy-cloud-system-api/src/main/java/org/jeecg/modules/system/aspect/DictAspect.java
  2. 171 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwaccount/controller/HlwCompanyInvoiceCategoryController.java
  3. 77 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwaccount/entity/HlwCompanyInvoiceCategory.java
  4. 17 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwaccount/mapper/HlwCompanyInvoiceCategoryMapper.java
  5. 5 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwaccount/mapper/xml/HlwCompanyInvoiceCategoryMapper.xml
  6. 14 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwaccount/service/IHlwCompanyInvoiceCategoryService.java
  7. 19 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwaccount/service/impl/HlwCompanyInvoiceCategoryServiceImpl.java
  8. 185 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwinvoice/controller/HlwInvoiceCategoryController.java
  9. 89 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwinvoice/entity/HlwInvoiceCategory.java
  10. 17 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwinvoice/mapper/HlwInvoiceCategoryMapper.java
  11. 5 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwinvoice/mapper/xml/HlwInvoiceCategoryMapper.xml
  12. 14 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwinvoice/service/IHlwInvoiceCategoryService.java
  13. 19 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwinvoice/service/impl/HlwInvoiceCategoryServiceImpl.java
  14. 145 111
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/controller/HlwSubcontractorInvoiceCategoryController.java
  15. 4 4
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/entity/HlwSubcontractor.java
  16. 14 5
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/entity/HlwSubcontractorInvoiceCategory.java
  17. 2 1
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/mapper/HlwSubcontractorInvoiceCategoryMapper.java
  18. 19 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/mapper/xml/HlwSubcontractorInvoiceCategoryMapper.xml
  19. 3 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/service/IHlwSubcontractorInvoiceCategoryService.java
  20. 7 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/service/impl/HlwSubcontractorInvoiceCategoryServiceImpl.java

+ 135 - 35
happy-cloud-system/happy-cloud-system-api/src/main/java/org/jeecg/modules/system/aspect/DictAspect.java

@@ -46,14 +46,14 @@ public class DictAspect {
 
     @Around("excudeService()")
     public Object doAround(ProceedingJoinPoint pjp) throws Throwable {
-    	long time1=System.currentTimeMillis();
+        long time1 = System.currentTimeMillis();
         Object result = pjp.proceed();
-        long time2=System.currentTimeMillis();
-        log.debug("获取JSON数据 耗时:"+(time2-time1)+"ms");
-        long start=System.currentTimeMillis();
+        long time2 = System.currentTimeMillis();
+        log.debug("获取JSON数据 耗时:" + (time2 - time1) + "ms");
+        long start = System.currentTimeMillis();
         this.parseDictText(result);
-        long end=System.currentTimeMillis();
-        log.debug("解析注入JSON数据  耗时"+(end-start)+"ms");
+        long end = System.currentTimeMillis();
+        log.debug("解析注入JSON数据  耗时" + (end - start) + "ms");
         return result;
     }
 
@@ -63,20 +63,21 @@ public class DictAspect {
      * 示例为SysUser   字段为sex 添加了注解@Dict(dicCode = "sex") 会在字典服务立马查出来对应的text 然后在请求list的时候将这个字典text,已字段名称加_dictText形式返回到前端
      * 例输入当前返回值的就会多出一个sex_dictText字段
      * {
-     *      sex:1,
-     *      sex_dictText:"男"
+     * sex:1,
+     * sex_dictText:"男"
      * }
      * 前端直接取值sext_dictText在table里面无需再进行前端的字典转换了
-     *  customRender:function (text) {
-     *               if(text==1){
-     *                 return "男";
-     *               }else if(text==2){
-     *                 return "女";
-     *               }else{
-     *                 return text;
-     *               }
-     *             }
-     *             目前vue是这么进行字典渲染到table上的多了就很麻烦了 这个直接在服务端渲染完成前端可以直接用
+     * customRender:function (text) {
+     * if(text==1){
+     * return "男";
+     * }else if(text==2){
+     * return "女";
+     * }else{
+     * return text;
+     * }
+     * }
+     * 目前vue是这么进行字典渲染到table上的多了就很麻烦了 这个直接在服务端渲染完成前端可以直接用
+     *
      * @param result
      */
     private void parseDictText(Object result) {
@@ -85,18 +86,18 @@ public class DictAspect {
                 List<JSONObject> items = new ArrayList<>();
                 for (Object record : ((IPage) ((Result) result).getResult()).getRecords()) {
                     ObjectMapper mapper = new ObjectMapper();
-                    String json="{}";
+                    String json = "{}";
                     try {
                         //解决@JsonFormat注解解析不了的问题详见SysAnnouncement类的@JsonFormat
-                         json = mapper.writeValueAsString(record);
+                        json = mapper.writeValueAsString(record);
                     } catch (JsonProcessingException e) {
-                        log.error("json解析失败"+e.getMessage(),e);
+                        log.error("json解析失败" + e.getMessage(), e);
                     }
                     JSONObject item = JSONObject.parseObject(json);
                     //update-begin--Author:scott -- Date:20190603 ----for:解决继承实体字段无法翻译问题------
                     //for (Field field : record.getClass().getDeclaredFields()) {
                     for (Field field : oConvertUtils.getAllFields(record)) {
-                    //update-end--Author:scott  -- Date:20190603 ----for:解决继承实体字段无法翻译问题------
+                        //update-end--Author:scott  -- Date:20190603 ----for:解决继承实体字段无法翻译问题------
                         if (field.getAnnotation(Dict.class) != null) {
                             String code = field.getAnnotation(Dict.class).dicCode();
                             String text = field.getAnnotation(Dict.class).dicText();
@@ -106,13 +107,13 @@ public class DictAspect {
                             //翻译字典值对应的txt
                             String textValue = translateDictValue(code, text, table, key);
 
-                            log.debug(" 字典Val : "+ textValue);
-                            log.debug(" __翻译字典字段__ "+field.getName() + CommonConstant.DICT_TEXT_SUFFIX+": "+ textValue);
+                            log.debug(" 字典Val : " + textValue);
+                            log.debug(" __翻译字典字段__ " + field.getName() + CommonConstant.DICT_TEXT_SUFFIX + ": " + textValue);
                             item.put(field.getName() + CommonConstant.DICT_TEXT_SUFFIX, textValue);
                         }
                         //date类型默认转换string格式化日期
-                        if (field.getType().getName().equals("java.util.Date")&&field.getAnnotation(JsonFormat.class)==null&&item.get(field.getName())!=null){
-                            SimpleDateFormat aDate=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                        if (field.getType().getName().equals("java.util.Date") && field.getAnnotation(JsonFormat.class) == null && item.get(field.getName()) != null) {
+                            SimpleDateFormat aDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                             item.put(field.getName(), aDate.format(new Date((Long) item.get(field.getName()))));
                         }
                     }
@@ -120,12 +121,111 @@ public class DictAspect {
                 }
                 ((IPage) ((Result) result).getResult()).setRecords(items);
             }
+//针对List
+            else if (((Result) result).getResult() instanceof List) {
+                List<JSONObject> items = new ArrayList<>();
+                for (Object record : (List) ((Result) result).getResult()) {
+                    //先进行字典类型判断,该实体对象是否有字典注解,有则解析
+                    boolean isDict = false;
+                    for (Field field : oConvertUtils.getAllFields(record)) {
+                        if (field.getAnnotation(Dict.class) != null) {
+                            isDict = true;
+                            break;
+                        }
+                    }
+                    if (!isDict) {
+                        return;
+                    }
+                    ObjectMapper mapper = new ObjectMapper();
+                    String json = "{}";
+                    try {
+                        //解决@JsonFormat注解解析不了的问题详见SysAnnouncement类的@JsonFormat
+                        json = mapper.writeValueAsString(record);
+                    } catch (JsonProcessingException e) {
+                        log.error("json解析失败" + e.getMessage(), e);
+                    }
+                    JSONObject item = JSONObject.parseObject(json);
+                    //update-begin--Author:scott -- Date:20190603 ----for:解决继承实体字段无法翻译问题------
+                    //for (Field field : record.getClass().getDeclaredFields()) {
+                    for (Field field : oConvertUtils.getAllFields(record)) {
+                        //update-end--Author:scott  -- Date:20190603 ----for:解决继承实体字段无法翻译问题------
+                        if (field.getAnnotation(Dict.class) != null) {
+                            String code = field.getAnnotation(Dict.class).dicCode();
+                            String text = field.getAnnotation(Dict.class).dicText();
+                            String table = field.getAnnotation(Dict.class).dictTable();
+                            String key = String.valueOf(item.get(field.getName()));
 
+                            //翻译字典值对应的txt
+                            String textValue = translateDictValue(code, text, table, key);
+
+                            log.debug(" 字典Val : " + textValue);
+                            log.debug(" __翻译字典字段__ " + field.getName() + CommonConstant.DICT_TEXT_SUFFIX + ": " + textValue);
+                            item.put(field.getName() + CommonConstant.DICT_TEXT_SUFFIX, textValue);
+                        }
+                        //date类型默认转换string格式化日期
+                        if (field.getType().getName().equals("java.util.Date") && field.getAnnotation(JsonFormat.class) == null && item.get(field.getName()) != null) {
+                            SimpleDateFormat aDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                            item.put(field.getName(), aDate.format(new Date((Long) item.get(field.getName()))));
+                        }
+                    }
+                    items.add(item);
+                }
+                ((Result) result).setResult(items);
+            }
+            //针对Object
+            else if (((Result) result).getResult() instanceof Object) {
+                Object record = ((Result) result).getResult();
+                //先进行字典类型判断,该实体对象是否有字典注解,有则解析
+                boolean isDict = false;
+                for (Field field : oConvertUtils.getAllFields(record)) {
+                    if (field.getAnnotation(Dict.class) != null) {
+                        isDict = true;
+                        break;
+                    }
+                }
+                if (!isDict) {
+                    return;
+                }
+                ObjectMapper mapper = new ObjectMapper();
+                String json = "{}";
+                try {
+                    //解决@JsonFormat注解解析不了的问题详见SysAnnouncement类的@JsonFormat
+                    json = mapper.writeValueAsString(record);
+                } catch (JsonProcessingException e) {
+                    log.error("json解析失败" + e.getMessage(), e);
+                }
+                JSONObject item = JSONObject.parseObject(json);
+                //update-begin--Author:scott -- Date:20190603 ----for:解决继承实体字段无法翻译问题------
+                //for (Field field : record.getClass().getDeclaredFields()) {
+                for (Field field : oConvertUtils.getAllFields(record)) {
+                    //update-end--Author:scott  -- Date:20190603 ----for:解决继承实体字段无法翻译问题------
+                    if (field.getAnnotation(Dict.class) != null) {
+                        String code = field.getAnnotation(Dict.class).dicCode();
+                        String text = field.getAnnotation(Dict.class).dicText();
+                        String table = field.getAnnotation(Dict.class).dictTable();
+                        String key = String.valueOf(item.get(field.getName()));
+
+                        //翻译字典值对应的txt
+                        String textValue = translateDictValue(code, text, table, key);
+
+                        log.debug(" 字典Val : " + textValue);
+                        log.debug(" __翻译字典字段__ " + field.getName() + CommonConstant.DICT_TEXT_SUFFIX + ": " + textValue);
+                        item.put(field.getName() + CommonConstant.DICT_TEXT_SUFFIX, textValue);
+                    }
+                    //date类型默认转换string格式化日期
+                    if (field.getType().getName().equals("java.util.Date") && field.getAnnotation(JsonFormat.class) == null && item.get(field.getName()) != null) {
+                        SimpleDateFormat aDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                        item.put(field.getName(), aDate.format(new Date((Long) item.get(field.getName()))));
+                    }
+                }
+                ((Result) result).setResult(item);
+            }
         }
     }
 
     /**
-     *  翻译字典文本
+     * 翻译字典文本
+     *
      * @param code
      * @param text
      * @param table
@@ -133,20 +233,20 @@ public class DictAspect {
      * @return
      */
     private String translateDictValue(String code, String text, String table, String key) {
-    	if(oConvertUtils.isEmpty(key)) {
-    		return null;
-    	}
-        StringBuffer textValue=new StringBuffer();
+        if (oConvertUtils.isEmpty(key)) {
+            return null;
+        }
+        StringBuffer textValue = new StringBuffer();
         String[] keys = key.split(",");
         for (String k : keys) {
             String tmpValue = null;
-            log.debug(" 字典 key : "+ k);
+            log.debug(" 字典 key : " + k);
             if (k.trim().length() == 0) {
                 continue; //跳过循环
             }
-            if (!StringUtils.isEmpty(table)){
-                log.debug("--DictAspect------dicTable="+ table+" ,dicText= "+text+" ,dicCode="+code);
-                tmpValue= sysBaseRemoteApi.queryTableDictTextByKey(table,text,code,k.trim());
+            if (!StringUtils.isEmpty(table)) {
+                log.debug("--DictAspect------dicTable=" + table + " ,dicText= " + text + " ,dicCode=" + code);
+                tmpValue = sysBaseRemoteApi.queryTableDictTextByKey(table, text, code, k.trim());
             } else {
                 tmpValue = sysBaseRemoteApi.queryDictTextByKey(code, k.trim());
             }

+ 171 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwaccount/controller/HlwCompanyInvoiceCategoryController.java

@@ -0,0 +1,171 @@
+package org.jeecg.modules.hlwaccount.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.hlwaccount.entity.HlwCompanyInvoiceCategory;
+import org.jeecg.modules.hlwaccount.service.IHlwCompanyInvoiceCategoryService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: hlw_company_invoice_category
+ * @Author: jeecg-boot
+ * @Date:   2022-10-26
+ * @Version: V1.0
+ */
+@Api(tags="hlw_company_invoice_category")
+@RestController
+@RequestMapping("/wisdom/hlwCompanyInvoiceCategory")
+@Slf4j
+public class HlwCompanyInvoiceCategoryController extends JeecgController<HlwCompanyInvoiceCategory, IHlwCompanyInvoiceCategoryService> {
+	@Autowired
+	private IHlwCompanyInvoiceCategoryService hlwCompanyInvoiceCategoryService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param hlwCompanyInvoiceCategory
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "hlw_company_invoice_category-分页列表查询")
+	@ApiOperation(value="hlw_company_invoice_category-分页列表查询", notes="hlw_company_invoice_category-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<?> queryPageList(HlwCompanyInvoiceCategory hlwCompanyInvoiceCategory,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<HlwCompanyInvoiceCategory> queryWrapper = QueryGenerator.initQueryWrapper(hlwCompanyInvoiceCategory, req.getParameterMap());
+		Page<HlwCompanyInvoiceCategory> page = new Page<HlwCompanyInvoiceCategory>(pageNo, pageSize);
+		IPage<HlwCompanyInvoiceCategory> pageList = hlwCompanyInvoiceCategoryService.page(page, queryWrapper);
+		return Result.ok(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param hlwCompanyInvoiceCategory
+	 * @return
+	 */
+	@AutoLog(value = "hlw_company_invoice_category-添加")
+	@ApiOperation(value="hlw_company_invoice_category-添加", notes="hlw_company_invoice_category-添加")
+	@PostMapping(value = "/add")
+	public Result<?> add(@RequestBody HlwCompanyInvoiceCategory hlwCompanyInvoiceCategory) {
+		hlwCompanyInvoiceCategoryService.save(hlwCompanyInvoiceCategory);
+		return Result.ok("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param hlwCompanyInvoiceCategory
+	 * @return
+	 */
+	@AutoLog(value = "hlw_company_invoice_category-编辑")
+	@ApiOperation(value="hlw_company_invoice_category-编辑", notes="hlw_company_invoice_category-编辑")
+	@PutMapping(value = "/edit")
+	public Result<?> edit(@RequestBody HlwCompanyInvoiceCategory hlwCompanyInvoiceCategory) {
+		hlwCompanyInvoiceCategoryService.updateById(hlwCompanyInvoiceCategory);
+		return Result.ok("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "hlw_company_invoice_category-通过id删除")
+	@ApiOperation(value="hlw_company_invoice_category-通过id删除", notes="hlw_company_invoice_category-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		hlwCompanyInvoiceCategoryService.removeById(id);
+		return Result.ok("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "hlw_company_invoice_category-批量删除")
+	@ApiOperation(value="hlw_company_invoice_category-批量删除", notes="hlw_company_invoice_category-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.hlwCompanyInvoiceCategoryService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.ok("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "hlw_company_invoice_category-通过id查询")
+	@ApiOperation(value="hlw_company_invoice_category-通过id查询", notes="hlw_company_invoice_category-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
+		HlwCompanyInvoiceCategory hlwCompanyInvoiceCategory = hlwCompanyInvoiceCategoryService.getById(id);
+		if(hlwCompanyInvoiceCategory==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.ok(hlwCompanyInvoiceCategory);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param hlwCompanyInvoiceCategory
+    */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HlwCompanyInvoiceCategory hlwCompanyInvoiceCategory) {
+        return super.exportXls(request, hlwCompanyInvoiceCategory, HlwCompanyInvoiceCategory.class, "hlw_company_invoice_category");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, HlwCompanyInvoiceCategory.class);
+    }
+
+}

+ 77 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwaccount/entity/HlwCompanyInvoiceCategory.java

@@ -0,0 +1,77 @@
+package org.jeecg.modules.hlwaccount.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: hlw_company_invoice_category
+ * @Author: jeecg-boot
+ * @Date: 2022-10-26
+ * @Version: V1.0
+ */
+@Data
+@TableName("hlw_company_invoice_category")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value = "hlw_company_invoice_category对象", description = "hlw_company_invoice_category")
+public class HlwCompanyInvoiceCategory implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键")
+    private java.lang.Integer id;
+    /**
+     * 企业服务商id
+     */
+    @Excel(name = "企业服务商id", width = 15)
+    @ApiModelProperty(value = "企业服务商id")
+    private java.lang.Integer companySubcontractorId;
+    /**
+     * 开票内容id
+     */
+    @Excel(name = "开票内容id", width = 15)
+    @ApiModelProperty(value = "开票内容id")
+    private java.lang.Integer invoiceCategoryId;
+    /**
+     * 创建时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty(value = "创建时间")
+    private java.util.Date createTime;
+    /**
+     * 创建者
+     */
+    @ApiModelProperty(value = "创建者")
+    private java.lang.String createBy;
+    /**
+     * 更新时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty(value = "更新时间")
+    private java.util.Date updateTime;
+    /**
+     * 更新者
+     */
+    @ApiModelProperty(value = "更新者")
+    private java.lang.String updateBy;
+}

+ 17 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwaccount/mapper/HlwCompanyInvoiceCategoryMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.hlwaccount.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.hlwaccount.entity.HlwCompanyInvoiceCategory;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: hlw_company_invoice_category
+ * @Author: jeecg-boot
+ * @Date:   2022-10-26
+ * @Version: V1.0
+ */
+public interface HlwCompanyInvoiceCategoryMapper extends BaseMapper<HlwCompanyInvoiceCategory> {
+
+}

+ 5 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwaccount/mapper/xml/HlwCompanyInvoiceCategoryMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.hlwaccount.mapper.HlwCompanyInvoiceCategoryMapper">
+
+</mapper>

+ 14 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwaccount/service/IHlwCompanyInvoiceCategoryService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.hlwaccount.service;
+
+import org.jeecg.modules.hlwaccount.entity.HlwCompanyInvoiceCategory;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: hlw_company_invoice_category
+ * @Author: jeecg-boot
+ * @Date:   2022-10-26
+ * @Version: V1.0
+ */
+public interface IHlwCompanyInvoiceCategoryService extends IService<HlwCompanyInvoiceCategory> {
+
+}

+ 19 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwaccount/service/impl/HlwCompanyInvoiceCategoryServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.hlwaccount.service.impl;
+
+import org.jeecg.modules.hlwaccount.entity.HlwCompanyInvoiceCategory;
+import org.jeecg.modules.hlwaccount.mapper.HlwCompanyInvoiceCategoryMapper;
+import org.jeecg.modules.hlwaccount.service.IHlwCompanyInvoiceCategoryService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: hlw_company_invoice_category
+ * @Author: jeecg-boot
+ * @Date:   2022-10-26
+ * @Version: V1.0
+ */
+@Service
+public class HlwCompanyInvoiceCategoryServiceImpl extends ServiceImpl<HlwCompanyInvoiceCategoryMapper, HlwCompanyInvoiceCategory> implements IHlwCompanyInvoiceCategoryService {
+
+}

+ 185 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwinvoice/controller/HlwInvoiceCategoryController.java

@@ -0,0 +1,185 @@
+package org.jeecg.modules.hlwinvoice.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.hlwinvoice.entity.HlwInvoiceCategory;
+import org.jeecg.modules.hlwinvoice.service.IHlwInvoiceCategoryService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+/**
+ * @Description: hlw_invoice_category
+ * @Author: jeecg-boot
+ * @Date: 2022-10-26
+ * @Version: V1.0
+ */
+@Api(tags = "hlw_invoice_category")
+@RestController
+@RequestMapping("/wisdom/hlwInvoiceCategory")
+@Slf4j
+public class HlwInvoiceCategoryController extends JeecgController<HlwInvoiceCategory, IHlwInvoiceCategoryService> {
+    @Autowired
+    private IHlwInvoiceCategoryService hlwInvoiceCategoryService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param hlwInvoiceCategory
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "hlw_invoice_category-分页列表查询")
+    @ApiOperation(value = "hlw_invoice_category-分页列表查询", notes = "hlw_invoice_category-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<?> queryPageList(HlwInvoiceCategory hlwInvoiceCategory,
+                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                   HttpServletRequest req) {
+        QueryWrapper<HlwInvoiceCategory> queryWrapper = QueryGenerator.initQueryWrapper(hlwInvoiceCategory, req.getParameterMap());
+        Page<HlwInvoiceCategory> page = new Page<HlwInvoiceCategory>(pageNo, pageSize);
+        IPage<HlwInvoiceCategory> pageList = hlwInvoiceCategoryService.page(page, queryWrapper);
+        return Result.ok(pageList);
+    }
+
+    /**
+     * 所有开票信息
+     *
+     * @return
+     */
+    @GetMapping(value = "/findAllList")
+    public Result<?> findAllList() {
+        QueryWrapper<HlwInvoiceCategory> queryWrapper = new QueryWrapper<>();
+        queryWrapper.orderByAsc("id");
+        List<HlwInvoiceCategory> list = hlwInvoiceCategoryService.list(queryWrapper);
+        return Result.ok(list);
+    }
+
+    /**
+     * 添加
+     *
+     * @param hlwInvoiceCategory
+     * @return
+     */
+    @AutoLog(value = "hlw_invoice_category-添加")
+    @ApiOperation(value = "hlw_invoice_category-添加", notes = "hlw_invoice_category-添加")
+    @PostMapping(value = "/add")
+    public Result<?> add(@RequestBody HlwInvoiceCategory hlwInvoiceCategory) {
+        hlwInvoiceCategoryService.save(hlwInvoiceCategory);
+        return Result.ok("添加成功!");
+    }
+
+    /**
+     * 编辑
+     *
+     * @param hlwInvoiceCategory
+     * @return
+     */
+    @AutoLog(value = "hlw_invoice_category-编辑")
+    @ApiOperation(value = "hlw_invoice_category-编辑", notes = "hlw_invoice_category-编辑")
+    @PutMapping(value = "/edit")
+    public Result<?> edit(@RequestBody HlwInvoiceCategory hlwInvoiceCategory) {
+        hlwInvoiceCategoryService.updateById(hlwInvoiceCategory);
+        return Result.ok("编辑成功!");
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "hlw_invoice_category-通过id删除")
+    @ApiOperation(value = "hlw_invoice_category-通过id删除", notes = "hlw_invoice_category-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        hlwInvoiceCategoryService.removeById(id);
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "hlw_invoice_category-批量删除")
+    @ApiOperation(value = "hlw_invoice_category-批量删除", notes = "hlw_invoice_category-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        this.hlwInvoiceCategoryService.removeByIds(Arrays.asList(ids.split(",")));
+        return Result.ok("批量删除成功!");
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "hlw_invoice_category-通过id查询")
+    @ApiOperation(value = "hlw_invoice_category-通过id查询", notes = "hlw_invoice_category-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
+        HlwInvoiceCategory hlwInvoiceCategory = hlwInvoiceCategoryService.getById(id);
+        if (hlwInvoiceCategory == null) {
+            return Result.error("未找到对应数据");
+        }
+        return Result.ok(hlwInvoiceCategory);
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param hlwInvoiceCategory
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HlwInvoiceCategory hlwInvoiceCategory) {
+        return super.exportXls(request, hlwInvoiceCategory, HlwInvoiceCategory.class, "hlw_invoice_category");
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, HlwInvoiceCategory.class);
+    }
+
+}

+ 89 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwinvoice/entity/HlwInvoiceCategory.java

@@ -0,0 +1,89 @@
+package org.jeecg.modules.hlwinvoice.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: hlw_invoice_category
+ * @Author: jeecg-boot
+ * @Date: 2022-10-26
+ * @Version: V1.0
+ */
+@Data
+@TableName("hlw_invoice_category")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value = "hlw_invoice_category对象", description = "hlw_invoice_category")
+public class HlwInvoiceCategory implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键")
+    private java.lang.Integer id;
+    /**
+     * 开票内容代码
+     */
+    @Excel(name = "开票内容代码", width = 15)
+    @ApiModelProperty(value = "开票内容代码")
+    private java.lang.String invoiceCategoryCode;
+    /**
+     * 开票内容
+     */
+    @Excel(name = "开票内容", width = 15)
+    @ApiModelProperty(value = "开票内容")
+    private java.lang.String invoiceCategoryName;
+    /**
+     * 税收分类代码
+     */
+    @Excel(name = "税收分类代码", width = 15)
+    @ApiModelProperty(value = "税收分类代码")
+    private java.lang.String taxCategoryCode;
+    /**
+     * 税收分类名称
+     */
+    @Excel(name = "税收分类名称", width = 15)
+    @ApiModelProperty(value = "税收分类名称")
+    private java.lang.String taxCategoryName;
+    /**
+     * 创建时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty(value = "创建时间")
+    private java.util.Date createTime;
+    /**
+     * 创建者
+     */
+    @ApiModelProperty(value = "创建者")
+    private java.lang.String createBy;
+    /**
+     * 更新时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty(value = "更新时间")
+    private java.util.Date updateTime;
+    /**
+     * 更新者
+     */
+    @ApiModelProperty(value = "更新者")
+    private java.lang.String updateBy;
+}

+ 17 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwinvoice/mapper/HlwInvoiceCategoryMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.hlwinvoice.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.hlwinvoice.entity.HlwInvoiceCategory;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: hlw_invoice_category
+ * @Author: jeecg-boot
+ * @Date:   2022-10-26
+ * @Version: V1.0
+ */
+public interface HlwInvoiceCategoryMapper extends BaseMapper<HlwInvoiceCategory> {
+
+}

+ 5 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwinvoice/mapper/xml/HlwInvoiceCategoryMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.hlwinvoice.mapper.HlwInvoiceCategoryMapper">
+
+</mapper>

+ 14 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwinvoice/service/IHlwInvoiceCategoryService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.hlwinvoice.service;
+
+import org.jeecg.modules.hlwinvoice.entity.HlwInvoiceCategory;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: hlw_invoice_category
+ * @Author: jeecg-boot
+ * @Date:   2022-10-26
+ * @Version: V1.0
+ */
+public interface IHlwInvoiceCategoryService extends IService<HlwInvoiceCategory> {
+
+}

+ 19 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwinvoice/service/impl/HlwInvoiceCategoryServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.hlwinvoice.service.impl;
+
+import org.jeecg.modules.hlwinvoice.entity.HlwInvoiceCategory;
+import org.jeecg.modules.hlwinvoice.mapper.HlwInvoiceCategoryMapper;
+import org.jeecg.modules.hlwinvoice.service.IHlwInvoiceCategoryService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: hlw_invoice_category
+ * @Author: jeecg-boot
+ * @Date:   2022-10-26
+ * @Version: V1.0
+ */
+@Service
+public class HlwInvoiceCategoryServiceImpl extends ServiceImpl<HlwInvoiceCategoryMapper, HlwInvoiceCategory> implements IHlwInvoiceCategoryService {
+
+}

+ 145 - 111
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/controller/HlwSubcontractorInvoiceCategoryController.java

@@ -9,9 +9,13 @@ import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.hlwaccount.entity.HlwCompanyInvoiceCategory;
+import org.jeecg.modules.hlwaccount.service.IHlwCompanyInvoiceCategoryService;
+import org.jeecg.modules.hlwsubcontractor.entity.HlwSubcontractor;
 import org.jeecg.modules.hlwsubcontractor.entity.HlwSubcontractorInvoiceCategory;
 import org.jeecg.modules.hlwsubcontractor.service.IHlwSubcontractorInvoiceCategoryService;
 
@@ -36,133 +40,163 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.jeecg.common.aspect.annotation.AutoLog;
 
- /**
+/**
  * @Description: hlw_subcontractor_invoice_category
  * @Author: jeecg-boot
- * @Date:   2022-10-25
+ * @Date: 2022-10-25
  * @Version: V1.0
  */
-@Api(tags="hlw_subcontractor_invoice_category")
+@Api(tags = "hlw_subcontractor_invoice_category")
 @RestController
 @RequestMapping("/wisdom/hlwSubcontractorInvoiceCategory")
 @Slf4j
 public class HlwSubcontractorInvoiceCategoryController extends JeecgController<HlwSubcontractorInvoiceCategory, IHlwSubcontractorInvoiceCategoryService> {
-	@Autowired
-	private IHlwSubcontractorInvoiceCategoryService hlwSubcontractorInvoiceCategoryService;
-	
-	/**
-	 * 分页列表查询
-	 *
-	 * @param hlwSubcontractorInvoiceCategory
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	@AutoLog(value = "hlw_subcontractor_invoice_category-分页列表查询")
-	@ApiOperation(value="hlw_subcontractor_invoice_category-分页列表查询", notes="hlw_subcontractor_invoice_category-分页列表查询")
-	@GetMapping(value = "/list")
-	public Result<?> queryPageList(HlwSubcontractorInvoiceCategory hlwSubcontractorInvoiceCategory,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-								   HttpServletRequest req) {
-		QueryWrapper<HlwSubcontractorInvoiceCategory> queryWrapper = QueryGenerator.initQueryWrapper(hlwSubcontractorInvoiceCategory, req.getParameterMap());
-		Page<HlwSubcontractorInvoiceCategory> page = new Page<HlwSubcontractorInvoiceCategory>(pageNo, pageSize);
-		IPage<HlwSubcontractorInvoiceCategory> pageList = hlwSubcontractorInvoiceCategoryService.page(page, queryWrapper);
-		return Result.ok(pageList);
-	}
-	
-	/**
-	 *   添加
-	 *
-	 * @param hlwSubcontractorInvoiceCategory
-	 * @return
-	 */
-	@AutoLog(value = "hlw_subcontractor_invoice_category-添加")
-	@ApiOperation(value="hlw_subcontractor_invoice_category-添加", notes="hlw_subcontractor_invoice_category-添加")
-	@PostMapping(value = "/add")
-	public Result<?> add(@RequestBody HlwSubcontractorInvoiceCategory hlwSubcontractorInvoiceCategory) {
-		hlwSubcontractorInvoiceCategoryService.save(hlwSubcontractorInvoiceCategory);
-		return Result.ok("添加成功!");
-	}
-	
-	/**
-	 *  编辑
-	 *
-	 * @param hlwSubcontractorInvoiceCategory
-	 * @return
-	 */
-	@AutoLog(value = "hlw_subcontractor_invoice_category-编辑")
-	@ApiOperation(value="hlw_subcontractor_invoice_category-编辑", notes="hlw_subcontractor_invoice_category-编辑")
-	@PutMapping(value = "/edit")
-	public Result<?> edit(@RequestBody HlwSubcontractorInvoiceCategory hlwSubcontractorInvoiceCategory) {
-		hlwSubcontractorInvoiceCategoryService.updateById(hlwSubcontractorInvoiceCategory);
-		return Result.ok("编辑成功!");
-	}
-	
-	/**
-	 *   通过id删除
-	 *
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "hlw_subcontractor_invoice_category-通过id删除")
-	@ApiOperation(value="hlw_subcontractor_invoice_category-通过id删除", notes="hlw_subcontractor_invoice_category-通过id删除")
-	@DeleteMapping(value = "/delete")
-	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
-		hlwSubcontractorInvoiceCategoryService.removeById(id);
-		return Result.ok("删除成功!");
-	}
-	
-	/**
-	 *  批量删除
-	 *
-	 * @param ids
-	 * @return
-	 */
-	@AutoLog(value = "hlw_subcontractor_invoice_category-批量删除")
-	@ApiOperation(value="hlw_subcontractor_invoice_category-批量删除", notes="hlw_subcontractor_invoice_category-批量删除")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		this.hlwSubcontractorInvoiceCategoryService.removeByIds(Arrays.asList(ids.split(",")));
-		return Result.ok("批量删除成功!");
-	}
-	
-	/**
-	 * 通过id查询
-	 *
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "hlw_subcontractor_invoice_category-通过id查询")
-	@ApiOperation(value="hlw_subcontractor_invoice_category-通过id查询", notes="hlw_subcontractor_invoice_category-通过id查询")
-	@GetMapping(value = "/queryById")
-	public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
-		HlwSubcontractorInvoiceCategory hlwSubcontractorInvoiceCategory = hlwSubcontractorInvoiceCategoryService.getById(id);
-		if(hlwSubcontractorInvoiceCategory==null) {
-			return Result.error("未找到对应数据");
-		}
-		return Result.ok(hlwSubcontractorInvoiceCategory);
-	}
+    @Autowired
+    private IHlwSubcontractorInvoiceCategoryService hlwSubcontractorInvoiceCategoryService;
+    @Autowired
+    private IHlwCompanyInvoiceCategoryService hlwCompanyInvoiceCategoryService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param hlwSubcontractorInvoiceCategory
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "hlw_subcontractor_invoice_category-分页列表查询")
+    @ApiOperation(value = "hlw_subcontractor_invoice_category-分页列表查询", notes = "hlw_subcontractor_invoice_category-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<?> queryPageList(HlwSubcontractorInvoiceCategory hlwSubcontractorInvoiceCategory,
+                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                   HttpServletRequest req) {
+        QueryWrapper<HlwSubcontractorInvoiceCategory> queryWrapper = QueryGenerator.initQueryWrapper(hlwSubcontractorInvoiceCategory, req.getParameterMap());
+        Page<HlwSubcontractorInvoiceCategory> page = new Page<HlwSubcontractorInvoiceCategory>(pageNo, pageSize);
+        IPage<HlwSubcontractorInvoiceCategory> pageList = hlwSubcontractorInvoiceCategoryService.page(page, queryWrapper);
+        return Result.ok(pageList);
+    }
+
+    /**
+     * 查询服务商开票内容
+     *
+     * @param hlwSubcontractorInvoiceCategory
+     * @return
+     */
+    @GetMapping(value = "/findInvoiceList")
+    public Result<?> findInvoiceList(HlwSubcontractorInvoiceCategory hlwSubcontractorInvoiceCategory) {
+        List<HlwSubcontractorInvoiceCategory> list = hlwSubcontractorInvoiceCategoryService.findInvoiceList(hlwSubcontractorInvoiceCategory);
+        return Result.ok(list);
+    }
+
+
+    /**
+     * 添加
+     *
+     * @param hlwSubcontractorInvoiceCategory
+     * @return
+     */
+    @AutoLog(value = "hlw_subcontractor_invoice_category-添加")
+    @ApiOperation(value = "hlw_subcontractor_invoice_category-添加", notes = "hlw_subcontractor_invoice_category-添加")
+    @PostMapping(value = "/add")
+    public Result<?> add(@RequestBody HlwSubcontractorInvoiceCategory hlwSubcontractorInvoiceCategory) {
+        QueryWrapper<HlwSubcontractorInvoiceCategory> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("subcontractor_id", hlwSubcontractorInvoiceCategory.getSubcontractorId());
+        queryWrapper.eq("invoice_category_id", hlwSubcontractorInvoiceCategory.getInvoiceCategoryId());
+        int count = hlwSubcontractorInvoiceCategoryService.count(queryWrapper);
+        if (count > 0) {
+            return Result.error("该开票内容在本服务商端已存在!");
+        }
+        hlwSubcontractorInvoiceCategoryService.save(hlwSubcontractorInvoiceCategory);
+        return Result.ok("添加成功!");
+    }
+
+    /**
+     * 编辑
+     *
+     * @param hlwSubcontractorInvoiceCategory
+     * @return
+     */
+    @AutoLog(value = "hlw_subcontractor_invoice_category-编辑")
+    @ApiOperation(value = "hlw_subcontractor_invoice_category-编辑", notes = "hlw_subcontractor_invoice_category-编辑")
+    @PutMapping(value = "/edit")
+    public Result<?> edit(@RequestBody HlwSubcontractorInvoiceCategory hlwSubcontractorInvoiceCategory) {
+        hlwSubcontractorInvoiceCategoryService.updateById(hlwSubcontractorInvoiceCategory);
+        return Result.ok("编辑成功!");
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "hlw_subcontractor_invoice_category-通过id删除")
+    @ApiOperation(value = "hlw_subcontractor_invoice_category-通过id删除", notes = "hlw_subcontractor_invoice_category-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        HlwSubcontractorInvoiceCategory hlwSubcontractorInvoiceCategory = hlwSubcontractorInvoiceCategoryService.getById(id);
+        //查询该服务商开票内容是否已被应用到企业端
+        QueryWrapper<HlwCompanyInvoiceCategory> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("invoice_category_id", hlwSubcontractorInvoiceCategory.getInvoiceCategoryId());
+        int count = hlwCompanyInvoiceCategoryService.count(queryWrapper);
+        if (count > 0) {
+            return Result.error("该开票内容已配置到企业端,无法删除");
+        }
+        hlwSubcontractorInvoiceCategoryService.removeById(id);
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "hlw_subcontractor_invoice_category-批量删除")
+    @ApiOperation(value = "hlw_subcontractor_invoice_category-批量删除", notes = "hlw_subcontractor_invoice_category-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        this.hlwSubcontractorInvoiceCategoryService.removeByIds(Arrays.asList(ids.split(",")));
+        return Result.ok("批量删除成功!");
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "hlw_subcontractor_invoice_category-通过id查询")
+    @ApiOperation(value = "hlw_subcontractor_invoice_category-通过id查询", notes = "hlw_subcontractor_invoice_category-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
+        HlwSubcontractorInvoiceCategory hlwSubcontractorInvoiceCategory = hlwSubcontractorInvoiceCategoryService.getById(id);
+        if (hlwSubcontractorInvoiceCategory == null) {
+            return Result.error("未找到对应数据");
+        }
+        return Result.ok(hlwSubcontractorInvoiceCategory);
+    }
 
     /**
-    * 导出excel
-    *
-    * @param request
-    * @param hlwSubcontractorInvoiceCategory
-    */
+     * 导出excel
+     *
+     * @param request
+     * @param hlwSubcontractorInvoiceCategory
+     */
     @RequestMapping(value = "/exportXls")
     public ModelAndView exportXls(HttpServletRequest request, HlwSubcontractorInvoiceCategory hlwSubcontractorInvoiceCategory) {
         return super.exportXls(request, hlwSubcontractorInvoiceCategory, HlwSubcontractorInvoiceCategory.class, "hlw_subcontractor_invoice_category");
     }
 
     /**
-      * 通过excel导入数据
-    *
-    * @param request
-    * @param response
-    * @return
-    */
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
     @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
         return super.importExcel(request, response, HlwSubcontractorInvoiceCategory.class);

+ 4 - 4
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/entity/HlwSubcontractor.java

@@ -161,8 +161,8 @@ public class HlwSubcontractor implements Serializable {
     /**
      * 创建时间
      */
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "创建时间")
     private Date createTime;
     /**
@@ -173,8 +173,8 @@ public class HlwSubcontractor implements Serializable {
     /**
      * 更新时间
      */
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
     /**

+ 14 - 5
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/entity/HlwSubcontractorInvoiceCategory.java

@@ -6,8 +6,10 @@ import java.util.Date;
 import java.math.BigDecimal;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.models.auth.In;
 import lombok.Data;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.springframework.format.annotation.DateTimeFormat;
@@ -55,12 +57,13 @@ public class HlwSubcontractorInvoiceCategory implements Serializable {
      */
     @Excel(name = "是否启用(0:否 1:是)", width = 15)
     @ApiModelProperty(value = "是否启用(0:否 1:是)")
-    private String isOn;
+    @Dict(dicCode = "is_on")
+    private Integer isOn;
     /**
      * 创建时间
      */
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "创建时间")
     private Date createTime;
     /**
@@ -71,8 +74,8 @@ public class HlwSubcontractorInvoiceCategory implements Serializable {
     /**
      * 更新时间
      */
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
     /**
@@ -80,4 +83,10 @@ public class HlwSubcontractorInvoiceCategory implements Serializable {
      */
     @ApiModelProperty(value = "更新者")
     private String updateBy;
+
+    /**
+     * 开票内容
+     */
+    @TableField(exist = false)
+    private String invoiceCategoryName;
 }

+ 2 - 1
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/mapper/HlwSubcontractorInvoiceCategoryMapper.java

@@ -9,9 +9,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 /**
  * @Description: hlw_subcontractor_invoice_category
  * @Author: jeecg-boot
- * @Date:   2022-10-25
+ * @Date: 2022-10-25
  * @Version: V1.0
  */
 public interface HlwSubcontractorInvoiceCategoryMapper extends BaseMapper<HlwSubcontractorInvoiceCategory> {
 
+    List<HlwSubcontractorInvoiceCategory> findInvoiceList(@Param("hlwSubcontractorInvoiceCategory") HlwSubcontractorInvoiceCategory hlwSubcontractorInvoiceCategory);
 }

+ 19 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/mapper/xml/HlwSubcontractorInvoiceCategoryMapper.xml

@@ -2,4 +2,23 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.hlwsubcontractor.mapper.HlwSubcontractorInvoiceCategoryMapper">
 
+    <select id="findInvoiceList" resultType="org.jeecg.modules.hlwsubcontractor.entity.HlwSubcontractorInvoiceCategory">
+        select
+        a.id AS "id",
+        a.subcontractor_id AS "subcontractorId",
+        a.invoice_category_id AS "invoiceCategoryId",
+        a.is_on AS "isOn",
+        a.create_time AS "createTime",
+        a.create_by AS "createBy",
+        a.update_time AS "updateTime",
+        a.update_by AS "updateBy",
+        hic.invoice_category_name AS "invoiceCategoryName"
+        from hlw_subcontractor_invoice_category a
+        LEFT JOIN hlw_invoice_category hic on hic.id = a.invoice_category_id
+        <where>
+            a.subcontractor_id = #{hlwSubcontractorInvoiceCategory.subcontractorId}
+        </where>
+        order by a.create_time desc, a.id desc
+    </select>
+
 </mapper>

+ 3 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/service/IHlwSubcontractorInvoiceCategoryService.java

@@ -3,6 +3,8 @@ package org.jeecg.modules.hlwsubcontractor.service;
 import org.jeecg.modules.hlwsubcontractor.entity.HlwSubcontractorInvoiceCategory;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * @Description: hlw_subcontractor_invoice_category
  * @Author: jeecg-boot
@@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IHlwSubcontractorInvoiceCategoryService extends IService<HlwSubcontractorInvoiceCategory> {
 
+    List<HlwSubcontractorInvoiceCategory> findInvoiceList(HlwSubcontractorInvoiceCategory hlwSubcontractorInvoiceCategory);
 }

+ 7 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/service/impl/HlwSubcontractorInvoiceCategoryServiceImpl.java

@@ -7,6 +7,8 @@ import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import java.util.List;
+
 /**
  * @Description: hlw_subcontractor_invoice_category
  * @Author: jeecg-boot
@@ -16,4 +18,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 @Service
 public class HlwSubcontractorInvoiceCategoryServiceImpl extends ServiceImpl<HlwSubcontractorInvoiceCategoryMapper, HlwSubcontractorInvoiceCategory> implements IHlwSubcontractorInvoiceCategoryService {
 
+    @Override
+    public List<HlwSubcontractorInvoiceCategory> findInvoiceList(HlwSubcontractorInvoiceCategory hlwSubcontractorInvoiceCategory) {
+        List<HlwSubcontractorInvoiceCategory> list = baseMapper.findInvoiceList(hlwSubcontractorInvoiceCategory);
+        return list;
+    }
 }