功能修改

master
zhouxinyu 10 months ago
parent ae84177b2b
commit 2da0545111
  1. 2
      src/main/java/org/springblade/modules/business/mapper/InvoiceApplyMapper.java
  2. 46
      src/main/java/org/springblade/modules/business/mapper/InvoiceApplyMapper.xml
  3. 2
      src/main/java/org/springblade/modules/business/service/impl/InvoiceApplyServiceImpl.java
  4. 6
      src/main/java/org/springblade/modules/business/service/impl/MaintenanceTaskDetailServiceImpl.java

@ -23,5 +23,5 @@ public interface InvoiceApplyMapper extends BaseMapper<InvoiceApply> {
* @return
*/
List<Map<String, Object>> finishWorkList(@Param("offset") int offset, @Param("size") int size,@Param("deptIds") List<String> deptIds);
int finishWorkListCount();
int finishWorkListCount(@Param("offset") int offset, @Param("size") int size,@Param("deptIds") List<String> deptIds);
}

@ -6,7 +6,7 @@
<select id="finishWorkList" resultType="map">
SELECT t.*
from (
SELECT 1 as business_type, wo.id as business_id, wo.requirement_code as business_code, u.`name` as serviceman, IFNULL(wo.discount_price,0) as price
SELECT 1 as business_type, wo.id as business_id, wo.requirement_code as business_code, u.`name` as serviceman, IFNULL(wo.total_cost,0) as price
from lab_work_order wo
left join blade_user u on wo.repair_person = u.id
WHERE wo.is_deleted= 0 AND wo.`status` = 203
@ -17,7 +17,7 @@ from (
</foreach>
</if>
UNION ALL
SELECT 2 as business_type, mt.id as business_id, mt.task_code as buseness_code, u.`name` as serviceman, COUNT(mtd.price) as price
SELECT 2 as business_type, mt.id as business_id, mt.task_code as buseness_code, u.`name` as serviceman, IFNULL(mt.actual_amount,0) as price
from lab_maintenance_task mt
left join blade_user u on mt.serviceman_id = u.id
left join lab_maintenance_task_detail mtd on mt.id = mtd.task_id
@ -36,21 +36,33 @@ limit ${offset}, ${size}
</select>
<select id="finishWorkListCount" resultType="int">
SELECT count(1)
from (
SELECT 1 as business_type, wo.id as business_id, wo.requirement_code as business_code, u.`name` as serviceman, IFNULL(wo.discount_price,0) as price
from lab_work_order wo
left join blade_user u on wo.repair_person = u.id
WHERE wo.is_deleted= 0 AND wo.`status` = 8
UNION ALL
SELECT 2 as business_type, mt.id as buseness_id, mt.task_code as buseness_code, u.`name` as serviceman, COUNT(mtd.price) as price
from lab_maintenance_task mt
left join blade_user u on mt.serviceman_id = u.id
left join lab_maintenance_task_detail mtd on mt.id = mtd.task_id
WHERE mt.is_deleted= 0 and mt.repair_status = 7
group by mt.id, mt.task_code
) t
left join lab_invoice_apply_detail d on t.business_id = d.business_id
where d.id is NULL
from (
SELECT 1 as business_type, wo.id as business_id, wo.requirement_code as business_code, u.`name` as serviceman, IFNULL(wo.total_cost,0) as price
from lab_work_order wo
left join blade_user u on wo.repair_person = u.id
WHERE wo.is_deleted= 0 AND wo.`status` = 203
<if test="deptIds != null">
and wo.report_unit in
<foreach collection="deptIds" item="deptId" index="index" open="(" close=")" separator=",">
#{deptId}
</foreach>
</if>
UNION ALL
SELECT 2 as business_type, mt.id as business_id, mt.task_code as buseness_code, u.`name` as serviceman, mt.actual_amount as price
from lab_maintenance_task mt
left join blade_user u on mt.serviceman_id = u.id
left join lab_maintenance_task_detail mtd on mt.id = mtd.task_id
WHERE mt.is_deleted= 0 and mt.repair_status = 7
<if test="deptIds != null">
and mt.dept_id in
<foreach collection="deptIds" item="deptId" index="index" open="(" close=")" separator=",">
#{deptId}
</foreach>
</if>
group by mt.id, mt.task_code
) t
left join lab_invoice_apply_detail d on t.business_id = d.business_id
where d.id is NULL
</select>

@ -49,7 +49,7 @@ public class InvoiceApplyServiceImpl extends BaseServiceImpl<InvoiceApplyMapper,
int size = query == null || query.getSize() == null ? 10 : query.getSize();
List<Map<String, Object>> data = baseMapper.finishWorkList((startPage - 1) * size, size, deptIds);
int total = baseMapper.finishWorkListCount();
int total = baseMapper.finishWorkListCount((startPage - 1) * size, size, deptIds);
IPage page = new Page(startPage, size);
page.setRecords(data);

@ -413,10 +413,10 @@ public class MaintenanceTaskDetailServiceImpl extends BaseServiceImpl<Maintenanc
repairGoodsOutputData.setNo(no);
repairGoodsOutputData.setGoodsName(goods.getGoodsName());
repairGoodsOutputData.setNumber(goods.getNumber());
repairGoodsOutputData.setPrice(goods.getPrice());
repairGoodsOutputData.setTotalPrice(goods.getNumber() * goods.getPrice());
repairGoodsOutputData.setPrice(goods.getPrice()/goods.getNumber());
repairGoodsOutputData.setTotalPrice(goods.getPrice());
repairGoodsList.add(repairGoodsOutputData);
total+=goods.getNumber() * goods.getPrice();
total+=goods.getPrice();
}
}
}

Loading…
Cancel
Save