Explorar el Código

bug修复以及接口返回数据修改

cs hace 2 años
padre
commit
d1c3bfdb58

+ 7 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/ExpenseItem.java

@@ -39,6 +39,13 @@ public class ExpenseItem extends Model<ExpenseItem> {
     @TableField("project_id")
     private Integer projectId;
 
+    /**
+     * 项目名称
+     */
+    @TableField(exist = false)
+    private  String projectName;
+
+
     /**
      * 费用日期
      */

+ 10 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExpenseSheetServiceImpl.java

@@ -17,6 +17,7 @@ import com.management.platform.util.MessageUtils;
 import org.apache.poi.EncryptedDocumentException;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.ss.usermodel.CellType;
+import org.apache.poi.ss.usermodel.Header;
 import org.apache.poi.xssf.usermodel.XSSFCell;
 import org.apache.poi.xssf.usermodel.XSSFRow;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
@@ -178,6 +179,15 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
     public HttpRespMsg getDetail(Integer id) {
         ExpenseSheet expenseSheet = expenseSheetMapper.selectById(id);
         List<ExpenseItem> list = expenseItemMapper.selectList(new QueryWrapper<ExpenseItem>().eq("expense_id", id));
+        List<Project> Project = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", expenseSheet.getCompanyId()));
+        for (ExpenseItem expenseItem : list) {
+            for (Project project : Project) {
+                if (expenseItem.getProjectId().equals(project.getId())){
+                    expenseItem.setProjectName(project.getProjectName());
+                    break;
+                }
+            }
+        }
         expenseSheet.setInvoiceList(list);
         HttpRespMsg msg = new HttpRespMsg();
         msg.data = expenseSheet;

+ 4 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -1020,7 +1020,7 @@
         from user us
         left join  department dp on dp.department_id=us.department_id
         where us.company_id=#{companyId}
-        and us.id NOT IN (SELECT id FROM `user` WHERE company_id=#{companyId} and inactive_date IS NOT NULL AND inactive_date &lt; #{startDate})
+        and us.id NOT IN (SELECT id FROM `user` WHERE company_id=#{companyId} and inactive_date IS NOT NULL AND inactive_date &lt; #{startDate} AND is_active = 0)
         <if test="userId!=null and userId!=''">
             and us.id=#{userId}
         </if>
@@ -1060,7 +1060,7 @@
         from user us
         left join  department dp on dp.department_id=us.department_id
         where us.company_id=#{companyId}
-        and us.id NOT IN (SELECT id FROM `user` WHERE company_id=#{companyId} and inactive_date IS NOT NULL AND inactive_date &lt; #{startDate})
+        and us.id NOT IN (SELECT id FROM `user` WHERE company_id=#{companyId} and inactive_date IS NOT NULL AND inactive_date &lt; #{startDate} AND is_active = 0)
         <if test="userId!=null and userId!=''">
             and us.id=#{userId}
         </if>
@@ -1228,7 +1228,7 @@
         from user us
         left join department dp on dp.department_id=us.department_id
         where us.company_id=#{companyId}
-        and us.id NOT IN (SELECT id FROM `user` WHERE company_id=#{companyId} and inactive_date IS NOT NULL AND inactive_date &lt; #{startDate})
+        and us.id NOT IN (SELECT id FROM `user` WHERE company_id=#{companyId} and inactive_date IS NOT NULL AND inactive_date &lt; #{startDate} AND is_active = 0)
         <if test="userId!=null and userId!=''">
             and us.id=#{userId}
         </if>
@@ -1261,7 +1261,7 @@
         from user us
         left join  department dp on dp.department_id=us.department_id
         where us.company_id=#{companyId}
-        and us.id NOT IN (SELECT id FROM `user` WHERE company_id=#{companyId} and inactive_date IS NOT NULL AND inactive_date &lt; #{startDate})
+        and us.id NOT IN (SELECT id FROM `user` WHERE company_id=#{companyId} and inactive_date IS NOT NULL AND inactive_date &lt; #{startDate} AND is_active = 0)
         <if test="userId!=null and userId!=''">
             and us.id=#{userId}
         </if>