| | |
| | | } |
| | | goods.setCreateId(user.getUserId().toString()); |
| | | goods.setGoodsIdCode(dto.getGoodsIdCode()); |
| | | goods.setClinicPurchasePrice(dto.getSalesAmount()); |
| | | // goods.setClinicPurchasePrice(dto.getSalesAmount()); |
| | | return R.ok(erpGoodsService.save(goods)); |
| | | } |
| | | |
| | |
| | | |
| | | </select> |
| | | <select id="outboundPageList" resultType="com.ruoyi.system.vo.TErpClinicOutboundPageListVO"> |
| | | select t1.id,t1.outbound_number,t1.order_number,t1.total_money allTotalPrice,t1.create_time ,t1.outbound_type,t2.user_name,t1.type_num |
| | | from t_erp_clinic_outbound t1 left join sys_user t2 on t1.create_by = t2.user_id |
| | | select t1.id,t1.outbound_number,t1.order_number,t1.total_money allTotalPrice,t1.create_time ,t1.outbound_type,t2.nick_name userName,t1.type_num |
| | | from t_erp_clinic_outbound t1 left join sys_user t2 on t1.create_id = t2.user_id |
| | | where t1.disabled = 0 and t1.clinic_id = #{supplierClinicId} |
| | | <if test="query.outboundNumber != null and query.outboundNumber != ''"> |
| | | and t1.outbound_number like concat('%',#{query.outboundNumber},'%') |
| | |
| | | LEFT JOIN t_erp_supplier_warehousing t2 on t1.warehousing_id = t2.id |
| | | LEFT JOIN t_erp_goods t3 on t2.goods_id = t3.id |
| | | LEFT JOIN t_crm_supplier t4 on t3.supplier_clinic_id = t4.id |
| | | LEFT JOIN t_erp_supplier_outbound_goods t5 on t5.warehousing_batch_id =t1.id |
| | | left join ( |
| | | select warehousing_batch_id, sum(outbound_count) as outbound_count |
| | | from t_erp_supplier_outbound_goods |
| | | group by warehousing_batch_id |
| | | ) t5 on t5.warehousing_batch_id =t1.id |
| | | where t2.disabled = 0 and t2.warehouse_id = #{warehouseId} |
| | | and #{endDate} > t1.expiry_date |
| | | <if test="user.roleType !=null and user.roleType ==4"> |
| | |
| | | sum(t2.total_price) as totalPrice, |
| | | t1.create_time, |
| | | t2.id tErpProcurementGoodsId, |
| | | t4.user_name, |
| | | t1.create_by as userName, |
| | | t1.status, |
| | | t1.supplier_money, |
| | | t1.money as platformMoney, |
| | |
| | | left join t_crm_clinic t5 on t1.clinic_id = t5.id |
| | | where t1.disabled = 0 and t1.status !=1 |
| | | <if test="user.roleType !=null and user.roleType==4"> |
| | | and t2.supplier_id =#{supplierClinicId} |
| | | and t2.supplier_id =#{supplierClinicId} and t1.status in(3,4,5) |
| | | </if> |
| | | <if test="query.procurementCode != null and query.procurementCode != ''"> |
| | | and t1.procurement_code = #{query.procurementCode} |
| | |
| | | and t3.supplier_name like concat('%',#{query.clinicName},'%') |
| | | </if> |
| | | <if test="query.userName != null and query.userName != ''"> |
| | | and t4.user_name like concat('%',#{query.userName},'%') |
| | | and t1.create_by like concat('%',#{query.userName},'%') |
| | | </if> |
| | | <if test="query.status != null"> |
| | | and t1.status = #{query.status} |
| | |
| | | t1.logistics_number, |
| | | t1.send_time, |
| | | t1.clinic_id, |
| | | t1.status |
| | | t1.status, |
| | | t1.create_by userName |
| | | from t_erp_procurement t1 |
| | | left JOIN t_crm_clinic t2 on t1.clinic_id = t2.id |
| | | where t1.disabled = 0 and t1.status in(3,4,5) and t1.supplier_id in |
| | |
| | | <select id="validityPeriodWarning" resultType="com.ruoyi.system.vo.ValidityPeriodWarningVo"> |
| | | select * from (select t2.warehouse_id,t2.warehouse_no warehousingNo, t4.goods_name, t4.quasi_number, |
| | | t1.batch_number, t1.id as batchId,t1.expiry_date, t4.id as goodsId,t5.type_name,t6.unit_name packingUnitName, |
| | | case |
| | | when t3.id is null then t1.warehousing_number |
| | | else t1.warehousing_number -t3.outbound_count |
| | | end as num,t3.id as ogid |
| | | t1.warehousing_number -t3.outbound_count as num |
| | | from t_erp_supplier_warehousing_batch t1 |
| | | left join t_erp_supplier_warehousing t2 on t1.warehousing_id = t2.id |
| | | LEFT JOIN t_erp_supplier_outbound_goods t3 on t3.warehousing_batch_id = t1.id |
| | | left join ( |
| | | select warehousing_batch_id, COALESCE(sum(outbound_count), 0) as outbound_count |
| | | from t_erp_supplier_outbound_goods |
| | | group by warehousing_batch_id |
| | | ) t3 on t3.warehousing_batch_id = t1.id |
| | | LEFT JOIN t_erp_goods t4 on t2.goods_id = t4.id |
| | | left join t_erp_goods_type t5 on t4.type_id = t5.id |
| | | left join t_erp_goods_unit t6 on t4.packing_unit_id = t6.id |
| | |
| | | and t4.type_id = #{query.typeId} |
| | | </if> |
| | | group by t1.id |
| | | ) as o where (o.num > 0 or o.ogid is null) |
| | | ) as o where (o.num > 0 ) |
| | | order by o.expiry_date |
| | | |
| | | </select> |
| | | <select id="pageInventoryList" resultType="com.ruoyi.system.vo.PageInventoryListVo"> |
| | | select t1.id,t1.create_time,t2.user_name createBy,t3.warehouse_name |
| | | select t1.id,t1.create_time,t1.create_by,t3.warehouse_name |
| | | from t_erp_supplier_inventory t1 left join sys_user t2 on t1.create_id = t2.user_id |
| | | left join t_crm_warehouse t3 on t1.warehouse_id =t3.id |
| | | where t1.disabled = 0 |
| | |
| | | and t1.warehouse_id = #{query.warehouseId} |
| | | </if> |
| | | <if test="query.createBy != null and query.createBy != ''"> |
| | | and t2.user_name like concat('%',#{query.createBy},'%') |
| | | and t1.create_by like concat('%',#{query.createBy},'%') |
| | | </if> |
| | | <if test="sTime != null and eTime !=null "> |
| | | and t1.create_time between #{sTime} and #{eTime} |