功能修改

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 * @return
*/ */
List<Map<String, Object>> finishWorkList(@Param("offset") int offset, @Param("size") int size,@Param("deptIds") List<String> deptIds); 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 id="finishWorkList" resultType="map">
SELECT t.* SELECT t.*
from ( 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 from lab_work_order wo
left join blade_user u on wo.repair_person = u.id left join blade_user u on wo.repair_person = u.id
WHERE wo.is_deleted= 0 AND wo.`status` = 203 WHERE wo.is_deleted= 0 AND wo.`status` = 203
@ -17,7 +17,7 @@ from (
</foreach> </foreach>
</if> </if>
UNION ALL 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 from lab_maintenance_task mt
left join blade_user u on mt.serviceman_id = u.id left join blade_user u on mt.serviceman_id = u.id
left join lab_maintenance_task_detail mtd on mt.id = mtd.task_id left join lab_maintenance_task_detail mtd on mt.id = mtd.task_id
@ -36,21 +36,33 @@ limit ${offset}, ${size}
</select> </select>
<select id="finishWorkListCount" resultType="int"> <select id="finishWorkListCount" resultType="int">
SELECT count(1) SELECT count(1)
from ( 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 from lab_work_order wo
left join blade_user u on wo.repair_person = u.id left join blade_user u on wo.repair_person = u.id
WHERE wo.is_deleted= 0 AND wo.`status` = 8 WHERE wo.is_deleted= 0 AND wo.`status` = 203
UNION ALL <if test="deptIds != null">
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 and wo.report_unit in
from lab_maintenance_task mt <foreach collection="deptIds" item="deptId" index="index" open="(" close=")" separator=",">
left join blade_user u on mt.serviceman_id = u.id #{deptId}
left join lab_maintenance_task_detail mtd on mt.id = mtd.task_id </foreach>
WHERE mt.is_deleted= 0 and mt.repair_status = 7 </if>
group by mt.id, mt.task_code UNION ALL
) t 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
left join lab_invoice_apply_detail d on t.business_id = d.business_id from lab_maintenance_task mt
where d.id is NULL 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> </select>

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

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

Loading…
Cancel
Save